DATAKIT API  V2025.1
Dtk_KinMechanism Class Referenceabstract

Dtk_KinMechanism represents a kinematic mechanism. More...

+ Inheritance diagram for Dtk_KinMechanism:

Public Member Functions

void addCommand (Dtk_KinCommandPtr inCmd)
 Add a command at the command table. More...
 
void addJoint (Dtk_KinJointPtr inJoint)
 Add a joint at the joint table. More...
 
void addLaw (Dtk_KinLawPtr inLaw)
 Add inLaw at the law table. More...
 
void addSpeedAcceleration (Dtk_KinSpeedAccelerationPtr inSpeed)
 Add inSpeed at the speed/acceleration at the speed/acceleration table. More...
 
void deleteLaw (Dtk_KinLawPtr inLaw)
 
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)
 Write Dump file for mechanism. More...
 
type_detk get_type_detk () const
 
Dtk_KinCommandPtr getCommand (Dtk_Size_t inPos)
 Returns Dtk_KinCommand at position inPos. More...
 
Dtk_Size_t getCommandSize ()
 Return the attribute tab size. More...
 
Dtk_KinFixPartPtr getFixPart ()
 Returns the fix part object. More...
 
int getId ()
 Returns the mechanism id. More...
 
Dtk_KinJointPtr getJoint (Dtk_Size_t inPos)
 Returns Dtk_KinJoint at position inPos. More...
 
Dtk_Size_t getJointSize ()
 Return the attribute tab size. More...
 
Dtk_KinLawPtr getLaw (Dtk_Size_t inPos)
 Returns Dtk_KinLaw at position inPos. More...
 
Dtk_Size_t getLawSize ()
 Return the attribute tab size. More...
 
Dtk_string getName ()
 Returns the mechanism name. More...
 
Dtk_KinParameterPtr getParamTime ()
 Returns the time parameter
More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_KinSpeedAccelerationPtr getSpeedAcceleration (Dtk_Size_t inPos)
 Returns Dtk_KinSpeedAcceleration at position inPos. More...
 
Dtk_Size_t getSpeedAccelerationSize ()
 Return the attribute tab size. More...
 
Dtk_string getVersion ()
 Returns the mechanism version. More...
 
Dtk_bool hasCommand (Dtk_KinCommandPtr inCmd)
 Test if the command belong at command table. More...
 
Dtk_bool hasJoint (Dtk_KinJointPtr inJoint)
 Test if the joint belong at joint table. More...
 
Dtk_bool hasLaw (Dtk_KinLawPtr inLaw)
 Test if the law belong at law table. More...
 
Dtk_bool hasSpeedAcceleration (Dtk_KinSpeedAccelerationPtr inSpeed)
 Test if the speed/acceleration belong at speed/acceleration table. More...
 
Dtk_bool isEqual (Dtk_KinMechanismPtr inMechanism)
 Test if 2 Dtk_KinMechanism is equal. More...
 
Dtk_bool operator== (Dtk_KinMechanism &inMechanism)
 Test if 2 Dtk_KinMechanism is equal. More...
 
void setFixPart (Dtk_KinFixPartPtr inFixPart)
 Sets the fix part. More...
 
void setId (int inId)
 Sets the mechanism id. More...
 
void setName (Dtk_string inName)
 Sets the mechanism name. More...
 
void setParamTime (Dtk_KinParameterPtr inParam)
 Sets the time parameter. More...
 
void setVersion (Dtk_string inVersion)
 Sets the mechanism version. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

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

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_KIN_MECHANISM }
 

Protected Member Functions

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

Protected Attributes

Dtk_KinCommandTab _cmdList
 All commands are defined into the kinematic command table. More...
 
Dtk_KinFixPartPtr _fixPart
 
int _ID
 
Dtk_KinJointTab _jointList
 All joints are defined into the kinematic joint table. More...
 
Dtk_KinLawTab _laws
 
Dtk_KinParameterPtr _mechParamTime
 
Dtk_string _name
 
Dtk_KinSpeedAccelerationTab _speedAcc
 
Dtk_string _version
 
unsigned long count_
 

Friends

class Dtk_Kinematic
 
class Dtk_SmartPtr< Dtk_KinMechanism >
 

Detailed Description

Dtk_KinMechanism represents a kinematic mechanism.

A mechanism is linked at a kinematic object.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
1620  {
1622  };

Constructor & Destructor Documentation

◆ Dtk_KinMechanism() [1/2]

Dtk_KinMechanism::Dtk_KinMechanism ( )
protected

Default constructor.

◆ Dtk_KinMechanism() [2/2]

Dtk_KinMechanism::Dtk_KinMechanism ( const Dtk_KinMechanism mecha)
protected

Copy constructor.

Parameters
mechathe Dtk_KinMechanism to be copied

◆ ~Dtk_KinMechanism()

Dtk_KinMechanism::~Dtk_KinMechanism ( )
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

◆ addCommand()

void Dtk_KinMechanism::addCommand ( Dtk_KinCommandPtr  inCmd)

Add a command at the command table.

Parameters
inCmdcommand to be added

◆ addJoint()

void Dtk_KinMechanism::addJoint ( Dtk_KinJointPtr  inJoint)

Add a joint at the joint table.

Parameters
inJointjoint to be added

◆ addLaw()

void Dtk_KinMechanism::addLaw ( Dtk_KinLawPtr  inLaw)

Add inLaw at the law table.

Parameters
inLawlaw to be added

If the law table doesn't contain inLaw, inLaw is added

◆ addSpeedAcceleration()

void Dtk_KinMechanism::addSpeedAcceleration ( Dtk_KinSpeedAccelerationPtr  inSpeed)

Add inSpeed at the speed/acceleration at the speed/acceleration table.

Parameters
inSpeedspeed/acceleration to be added

◆ Create()

static Dtk_KinMechanismPtr Dtk_KinMechanism::Create ( )
static

Base constructor.

◆ deleteLaw()

void Dtk_KinMechanism::deleteLaw ( Dtk_KinLawPtr  inLaw)

◆ DtkDynamicCast()

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

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

1653  {
1654  if(s->DtkDynamicType(_typeID))
1655  return static_cast<Dtk_KinMechanism*>(s);
1656  return NULL;
1657  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinMechanism::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

1643  {
1644  if (inId == _typeID)
1645  {
1646  return 1;
1647  }
1648  return Dtk_Object::DtkDynamicType(inId);
1649  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ Dump()

Dtk_status Dtk_KinMechanism::Dump ( FILE *  inFile)

Write Dump file for mechanism.

Parameters
inFilethe output file

Sample

Dtk_string fileName = ...;
File * file = fileName.ouvrir_fichier(DTK_W);
Dtk_KinMechanism mechanism;
mechanism.setName(Dtk_string("sample mechanism"));
mechanism.setId(1);
mechanism.Dump(file);

Result

<mechanism name="sample mechanism" id="1" version="">
<parts>
<!-- Parts associated at mechanism -->
<!-- part.Dump(inFile, true) -->
</parts>
<commands>
<!-- Commands associated at mechanism -->
<!-- commands.Dump(inFile, true) -->
</commands>
<!-- specfix.Dump(inFile) -->
<paramTime>
<!-- paramTime.Dump(inFile) -->
</paramTime>
<laws>
<!-- law.Dump(inFile) -->
</laws>
</mechanism>

◆ get_type_detk()

type_detk Dtk_KinMechanism::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KIN_MECHANISM -
1660 { return DTK_TYPE_KIN_MECHANISM; }

◆ getCommand()

Dtk_KinCommandPtr Dtk_KinMechanism::getCommand ( Dtk_Size_t  inPos)

Returns Dtk_KinCommand at position inPos.

Parameters
inPosposition of element

If position is out bounds, returns

NULL

◆ getCommandSize()

Dtk_Size_t Dtk_KinMechanism::getCommandSize ( )

Return the attribute tab size.

◆ getFixPart()

Dtk_KinFixPartPtr Dtk_KinMechanism::getFixPart ( )

Returns the fix part object.

◆ getId()

int Dtk_KinMechanism::getId ( )

Returns the mechanism id.

◆ getJoint()

Dtk_KinJointPtr Dtk_KinMechanism::getJoint ( Dtk_Size_t  inPos)

Returns Dtk_KinJoint at position inPos.

Parameters
inPosposition of element

If position is out bounds, returns NULL

◆ getJointSize()

Dtk_Size_t Dtk_KinMechanism::getJointSize ( )

Return the attribute tab size.

◆ getLaw()

Dtk_KinLawPtr Dtk_KinMechanism::getLaw ( Dtk_Size_t  inPos)

Returns Dtk_KinLaw at position inPos.

Parameters
inPosposition of element

If position is out bounds Returns NULL

◆ getLawSize()

Dtk_Size_t Dtk_KinMechanism::getLawSize ( )

Return the attribute tab size.

◆ getName()

Dtk_string Dtk_KinMechanism::getName ( )

Returns the mechanism name.

◆ getParamTime()

Dtk_KinParameterPtr Dtk_KinMechanism::getParamTime ( )

Returns the time parameter

◆ GetSize()

◆ getSpeedAcceleration()

Dtk_KinSpeedAccelerationPtr Dtk_KinMechanism::getSpeedAcceleration ( Dtk_Size_t  inPos)

Returns Dtk_KinSpeedAcceleration at position inPos.

Parameters
inPosposition of element

If position is out bounds returns NULL

◆ getSpeedAccelerationSize()

Dtk_Size_t Dtk_KinMechanism::getSpeedAccelerationSize ( )

Return the attribute tab size.

◆ getVersion()

Dtk_string Dtk_KinMechanism::getVersion ( )

Returns the mechanism version.

◆ hasCommand()

Dtk_bool Dtk_KinMechanism::hasCommand ( Dtk_KinCommandPtr  inCmd)

Test if the command belong at command table.

Parameters
inCmdcommand to be tested

◆ hasJoint()

Dtk_bool Dtk_KinMechanism::hasJoint ( Dtk_KinJointPtr  inJoint)

Test if the joint belong at joint table.

Parameters
inJointjoint to be tested

◆ hasLaw()

Dtk_bool Dtk_KinMechanism::hasLaw ( Dtk_KinLawPtr  inLaw)

Test if the law belong at law table.

Parameters
inLawlaw to be tested

◆ hasSpeedAcceleration()

Dtk_bool Dtk_KinMechanism::hasSpeedAcceleration ( Dtk_KinSpeedAccelerationPtr  inSpeed)

Test if the speed/acceleration belong at speed/acceleration table.

Parameters
inSpeedspeed/acceleration to be tested

◆ isEqual()

Dtk_bool Dtk_KinMechanism::isEqual ( Dtk_KinMechanismPtr  inMechanism)

Test if 2 Dtk_KinMechanism is equal.

Compare the id attributes.

Parameters
inMechanismDtk_KinMechanism to be tested

◆ operator==()

Dtk_bool Dtk_KinMechanism::operator== ( Dtk_KinMechanism inMechanism)

Test if 2 Dtk_KinMechanism is equal.

Compare the id attributes.

Parameters
inMechanismDtk_KinMechanism to be tested

◆ release()

static Dtk_KinMechanismPtr Dtk_KinMechanism::release ( Dtk_KinMechanismPtr  inMechanism)
static

Delete object.

◆ setFixPart()

void Dtk_KinMechanism::setFixPart ( Dtk_KinFixPartPtr  inFixPart)

Sets the fix part.

Parameters
inSpecfixfix part

◆ setId()

void Dtk_KinMechanism::setId ( int  inId)

Sets the mechanism id.

Parameters
inIdmechanism id

◆ setName()

void Dtk_KinMechanism::setName ( Dtk_string  inName)

Sets the mechanism name.

Parameters
inNamemechanism name

◆ setParamTime()

void Dtk_KinMechanism::setParamTime ( Dtk_KinParameterPtr  inParam)

Sets the time parameter.

Parameters
inParamtime parameter

◆ setVersion()

void Dtk_KinMechanism::setVersion ( Dtk_string  inVersion)

Sets the mechanism version.

Parameters
inVersionmechanism version

◆ Transform()

Dtk_ErrorStatus Dtk_KinMechanism::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_Kinematic

friend class Dtk_Kinematic
friend

◆ Dtk_SmartPtr< Dtk_KinMechanism >

friend class Dtk_SmartPtr< Dtk_KinMechanism >
friend

Field Documentation

◆ _cmdList

Dtk_KinCommandTab Dtk_KinMechanism::_cmdList
protected

All commands are defined into the kinematic command table.

◆ _fixPart

Dtk_KinFixPartPtr Dtk_KinMechanism::_fixPart
protected

◆ _ID

int Dtk_KinMechanism::_ID
protected

◆ _jointList

Dtk_KinJointTab Dtk_KinMechanism::_jointList
protected

All joints are defined into the kinematic joint table.

◆ _laws

Dtk_KinLawTab Dtk_KinMechanism::_laws
protected

◆ _mechParamTime

Dtk_KinParameterPtr Dtk_KinMechanism::_mechParamTime
protected

◆ _name

Dtk_string Dtk_KinMechanism::_name
protected

◆ _speedAcc

Dtk_KinSpeedAccelerationTab Dtk_KinMechanism::_speedAcc
protected

◆ _version

Dtk_string Dtk_KinMechanism::_version
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
DTK_TYPE_KIN_MECHANISM
@ DTK_TYPE_KIN_MECHANISM
Definition: define.h:547
Dtk_string::ouvrir_fichier
FILE * ouvrir_fichier(const Dtk_string &droits) const
File Utility : Open a file with the given rights.
Dtk_KinMechanism::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:1621
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_KinMechanism::setId
void setId(int inId)
Sets the mechanism id.
DTK_W
#define DTK_W
Definition: dtk_string.hpp:43
Dtk_KinMechanism::setName
void setName(Dtk_string inName)
Sets the mechanism name.
Dtk_KinMechanism
Dtk_KinMechanism represents a kinematic mechanism.
Definition: util_kinematics_dtk.hpp:1614
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_KinMechanism::Dump
Dtk_status Dump(FILE *inFile)
Write Dump file for mechanism.
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0