DATAKIT API  V2025.1
Dtk_KinParameter Class Referenceabstract

Dtk_KinParameter represents a kinematic parameter. More...

+ Inheritance diagram for Dtk_KinParameter:

Public Member Functions

void addAttribute (Dtk_string inAttribute)
 Add inAttribute at the attribute table. More...
 
Dtk_Int32 DtkDynamicType (const Dtk_Int32 &inId)
 Retrieves the dynamic entity type. More...
 
virtual int DtkDynamicType (const int &inId)=0
 
virtual void dump (FILE *file=stdout)
 
Dtk_status Dump (FILE *inFile, Dtk_bool simplified=DTK_FALSE)
 Write Dump file for parameter. More...
 
type_detk get_type_detk () const
 
Dtk_string getAttribute (Dtk_Size_t inPosition)
 Returns Dtk_string at position inPosition. More...
 
Dtk_Size_t getAttributeSize ()
 Return the attribute tab size. More...
 
int getId ()
 Retrun the parameter id. More...
 
Dtk_string getName ()
 Returns the parameter name. More...
 
Dtk_KinNamedValuePtr getNamedValue ()
 Returns the named value associated at the parameter. More...
 
void * getParentElement ()
 Returns the parent element. More...
 
DTK_KINEMATIC_TYPE getParentType ()
 Returns the node parent type of this parameter (joint, command or mechanism) More...
 
double getRange (int inPosition)
 Get the range value at position inPosition. More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_bool hasAttribute (Dtk_string inAttributeName)
 Test if an attribute name belong at the attribute table. More...
 
Dtk_bool isEqual (Dtk_KinParameterPtr inParam)
 Test if 2 Dtk_KinParameter is equal. More...
 
void setId (int inId)
 Sets the parameter id. More...
 
void setName (Dtk_string inName)
 Sets the parameter name. More...
 
void setNamedValue (Dtk_KinNamedValuePtr inAtt)
 Sets the named value to be associated at parameter. More...
 
void setParentElement (void *inParent)
 Sets the parent element. More...
 
void setParentType (DTK_KINEMATIC_TYPE inType)
 Sets the type of the node parent. More...
 
void setRange (double inRange[4])
 Sets the range attribute of the parameter. More...
 
void setRange (double inValue, int inPosition)
 Sets the inValue of range attribute at inPosition. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

static Dtk_KinParameterPtr Create ()
 Base constructor. More...
 
static Dtk_KinParameterDtkDynamicCast (Dtk_Object *s)
 Performs a dynamic cast - doesn't need RTTI -. More...
 
static Dtk_KinParameterPtr release (Dtk_KinParameterPtr inParameter)
 Delete object. More...
 

Data Fields

Dtk_string _RANGE
 Name for optional attribute. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_KIN_PARAMETER }
 

Protected Member Functions

void _copy (const Dtk_Object &s)
 
void _init ()
 
void _reset ()
 
 Dtk_KinParameter ()
 Default constructor. More...
 
 Dtk_KinParameter (const Dtk_KinParameter &param)
 Copy constructor. More...
 
 ~Dtk_KinParameter ()
 Destructor. More...
 

Protected Attributes

Dtk_StringTab _attributeList
 
int _ID
 
Dtk_string _name
 
Dtk_KinNamedValuePtr _namedValue
 
void * _parentNode
 
DTK_KINEMATIC_TYPE _parentType
 
double _range [4]
 Optional attribute for KinTime parameter. More...
 
unsigned long count_
 

Friends

class Dtk_KinCommand
 
class Dtk_KinJoint
 
class Dtk_KinLaw
 
class Dtk_KinMechanism
 
class Dtk_SmartPtr< Dtk_KinParameter >
 

Detailed Description

Dtk_KinParameter represents a kinematic parameter.

A parameter references a named value.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
279  {
281  };

Constructor & Destructor Documentation

◆ Dtk_KinParameter() [1/2]

Dtk_KinParameter::Dtk_KinParameter ( )
protected

Default constructor.

◆ Dtk_KinParameter() [2/2]

Dtk_KinParameter::Dtk_KinParameter ( const Dtk_KinParameter param)
protected

Copy constructor.

Parameters
paramthe Dtk_KinParameter to be copied

◆ ~Dtk_KinParameter()

Dtk_KinParameter::~Dtk_KinParameter ( )
protected

Destructor.

Member Function Documentation

◆ _copy()

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Object::_init ( )
protectedinherited

◆ _reset()

void Dtk_Object::_reset ( )
protectedinherited

◆ addAttribute()

void Dtk_KinParameter::addAttribute ( Dtk_string  inAttribute)

Add inAttribute at the attribute table.

Parameters
inAttributeAttribute name to be added

If the attribute table doesn't contain inAttribute, add inAttribute at the attribute table

◆ Create()

static Dtk_KinParameterPtr Dtk_KinParameter::Create ( )
static

Base constructor.

◆ DtkDynamicCast()

static Dtk_KinParameter* Dtk_KinParameter::DtkDynamicCast ( Dtk_Object s)
static

Performs a dynamic cast - doesn't need RTTI -.

310  {
311  if(s->DtkDynamicType(_typeID))
312  return static_cast<Dtk_KinParameter*>(s);
313  return NULL;
314  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinParameter::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

300  {
301  if (inId == _typeID)
302  {
303  return 1;
304  }
305  return Dtk_Object::DtkDynamicType(inId);
306  }

◆ DtkDynamicType() [2/2]

◆ dump()

virtual void Dtk_Object::dump ( FILE *  file = stdout)
virtualinherited

◆ Dump()

Dtk_status Dtk_KinParameter::Dump ( FILE *  inFile,
Dtk_bool  simplified = DTK_FALSE 
)

Write Dump file for parameter.

Parameters
inFilethe output file

Sample

Dtk_string fileName = ...;
File * file = fileName.ouvrir_fichier(DTK_W);
Dtk_KinParameter parameter;
parameter.setName(Dtk_string("sample parameter"));
part.setId(1);
parameter.Dump(file);

Result simplified = false

<parameter name="sample parameter" id="1">
<range nbValue="4" _1="..." _2="..." _3="..." _4="..." />
<!-- namedValue.Dump -->
</parameter>

Result simplified = true

<parameter name="sample parameter" id="1" parent="%idParentNode_%typeNode">
</parameter>
// %typeNode = COMMAND or JOINT or MECHANISM or ...

◆ get_type_detk()

type_detk Dtk_KinParameter::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KIN_PARAMETER -
317 { return DTK_TYPE_KIN_PARAMETER; }

◆ getAttribute()

Dtk_string Dtk_KinParameter::getAttribute ( Dtk_Size_t  inPosition)

Returns Dtk_string at position inPosition.

Parameters
inPositionposition of element

If position is out bounds, returns Dtk_string()

◆ getAttributeSize()

Dtk_Size_t Dtk_KinParameter::getAttributeSize ( )

Return the attribute tab size.

◆ getId()

int Dtk_KinParameter::getId ( )

Retrun the parameter id.

◆ getName()

Dtk_string Dtk_KinParameter::getName ( )

Returns the parameter name.

◆ getNamedValue()

Dtk_KinNamedValuePtr Dtk_KinParameter::getNamedValue ( )

Returns the named value associated at the parameter.

◆ getParentElement()

void* Dtk_KinParameter::getParentElement ( )

Returns the parent element.

Dtk_KinParameter * param = ...;
if (param->getNodeParentType() == DTK_KIN_TYPE_JOINT)
{
Dtk_KinJoint * joint = (Dtk_KinJoint *) param->getParentElement();
...
}

◆ getParentType()

DTK_KINEMATIC_TYPE Dtk_KinParameter::getParentType ( )

Returns the node parent type of this parameter (joint, command or mechanism)

◆ getRange()

double Dtk_KinParameter::getRange ( int  inPosition)

Get the range value at position inPosition.

Parameters
inPositionPosition

◆ GetSize()

◆ hasAttribute()

Dtk_bool Dtk_KinParameter::hasAttribute ( Dtk_string  inAttributeName)

Test if an attribute name belong at the attribute table.

Parameters
inAtributeNameName of attribute

The attribute table contains names of optional attribute used. The attribute name is defined with static variable.

◆ isEqual()

Dtk_bool Dtk_KinParameter::isEqual ( Dtk_KinParameterPtr  inParam)

Test if 2 Dtk_KinParameter is equal.

Compare the id attributes.

Parameters
inParamDtk_KinParameter to be tested

◆ release()

static Dtk_KinParameterPtr Dtk_KinParameter::release ( Dtk_KinParameterPtr  inParameter)
static

Delete object.

◆ setId()

void Dtk_KinParameter::setId ( int  inId)

Sets the parameter id.

Parameters
inIdparameter id

◆ setName()

void Dtk_KinParameter::setName ( Dtk_string  inName)

Sets the parameter name.

Parameters
inNameparameter name

◆ setNamedValue()

void Dtk_KinParameter::setNamedValue ( Dtk_KinNamedValuePtr  inAtt)

Sets the named value to be associated at parameter.

Parameters
inAttnamed value

◆ setParentElement()

void Dtk_KinParameter::setParentElement ( void *  inParent)

Sets the parent element.

Parameters
inParentparent element

◆ setParentType()

void Dtk_KinParameter::setParentType ( DTK_KINEMATIC_TYPE  inType)

Sets the type of the node parent.

Parameters
inTypeType o the node parent

◆ setRange() [1/2]

void Dtk_KinParameter::setRange ( double  inRange[4])

Sets the range attribute of the parameter.

Parameters
inRangethe range table

The RANGE name is added at attribute table.

◆ setRange() [2/2]

void Dtk_KinParameter::setRange ( double  inValue,
int  inPosition 
)

Sets the inValue of range attribute at inPosition.

Parameters
inValuethe value for range at position
inPositionposition for the value

The RANGE name is added at attribute table.

◆ Transform()

Dtk_ErrorStatus Dtk_KinParameter::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_KinCommand

friend class Dtk_KinCommand
friend

◆ Dtk_KinJoint

friend class Dtk_KinJoint
friend

◆ Dtk_KinLaw

friend class Dtk_KinLaw
friend

◆ Dtk_KinMechanism

friend class Dtk_KinMechanism
friend

◆ Dtk_SmartPtr< Dtk_KinParameter >

friend class Dtk_SmartPtr< Dtk_KinParameter >
friend

Field Documentation

◆ _attributeList

Dtk_StringTab Dtk_KinParameter::_attributeList
protected

◆ _ID

int Dtk_KinParameter::_ID
protected

◆ _name

Dtk_string Dtk_KinParameter::_name
protected

◆ _namedValue

Dtk_KinNamedValuePtr Dtk_KinParameter::_namedValue
protected

◆ _parentNode

void* Dtk_KinParameter::_parentNode
protected

◆ _parentType

DTK_KINEMATIC_TYPE Dtk_KinParameter::_parentType
protected

◆ _RANGE

Dtk_string Dtk_KinParameter::_RANGE

Name for optional attribute.

◆ _range

double Dtk_KinParameter::_range[4]
protected

Optional attribute for KinTime parameter.

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_KinJoint
Dtk_KinJoint represents a joint to define a mechanism.
Definition: util_kinematics_dtk.hpp:863
Dtk_string::ouvrir_fichier
FILE * ouvrir_fichier(const Dtk_string &droits) const
File Utility : Open a file with the given rights.
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
DTK_TYPE_OBJECT
@ DTK_TYPE_OBJECT
Definition: define.h:464
DTK_W
#define DTK_W
Definition: dtk_string.hpp:43
Dtk_KinParameter::getParentElement
void * getParentElement()
Returns the parent element.
DTK_TYPE_KIN_PARAMETER
@ DTK_TYPE_KIN_PARAMETER
Definition: define.h:548
Dtk_KinParameter
Dtk_KinParameter represents a kinematic parameter.
Definition: util_kinematics_dtk.hpp:271
DTK_KIN_TYPE_JOINT
@ DTK_KIN_TYPE_JOINT
Definition: util_kinematics_dtk.hpp:109
Dtk_KinParameter::Dump
Dtk_status Dump(FILE *inFile, Dtk_bool simplified=DTK_FALSE)
Write Dump file for parameter.
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_KinParameter::setName
void setName(Dtk_string inName)
Sets the parameter name.
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_KinParameter::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:280