DATAKIT API  V2025.1
Dtk_KinCommand Class Referenceabstract

Dtk_KinCommand represents a command to simulate a mechanism. More...

+ Inheritance diagram for Dtk_KinCommand:

Public Member Functions

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)
 Write Dump file for command. More...
 
type_detk get_type_detk () const
 
int getId ()
 Returns the command id. More...
 
Dtk_KinJointPtr getJoint ()
 Returns the joint associated at command. More...
 
Dtk_string getName ()
 Returns the command name. More...
 
Dtk_KinParameterPtr getParameter ()
 Returns the parameter associated at command. More...
 
virtual Dtk_Size_t GetSize () const
 
COMMAND_TYPE getType ()
 Returns the command type. More...
 
double getValue ()
 Returns the value of the command for simulation. More...
 
Dtk_bool isEqual (Dtk_KinCommandPtr inCommand)
 Test if 2 Dtk_KinCommand are equal. More...
 
Dtk_bool operator== (Dtk_KinCommand &inCommand)
 Test if 2 Dtk_KinCommand are equal. More...
 
void setId (int inId)
 Sets the command id. More...
 
void setJoint (Dtk_KinJointPtr inJoint)
 Sets the joint associated at command. More...
 
void setName (Dtk_string inName)
 Sets the command name. More...
 
void setParameter (Dtk_KinParameterPtr inParam)
 Sets the parameter command. More...
 
void setType (int inType)
 Sets the type of the command. More...
 
void setValue (double inValue)
 Sets the command value. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

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

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_KIN_COMMAND }
 

Protected Member Functions

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

Protected Attributes

int _ID
 
Dtk_KinJointPtr _joint
 This joint belongs at the kinematic joint table. More...
 
Dtk_string _name
 
Dtk_KinParameterPtr _parameter
 
COMMAND_TYPE _type
 
double _value
 
unsigned long count_
 

Friends

class Dtk_Kinematic
 
class Dtk_KinMechanism
 
class Dtk_SmartPtr< Dtk_KinCommand >
 

Detailed Description

Dtk_KinCommand represents a command to simulate a mechanism.

A command is linked at a kinematic object and a mechanism object.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
1343  {
1345  };

Constructor & Destructor Documentation

◆ Dtk_KinCommand() [1/2]

Dtk_KinCommand::Dtk_KinCommand ( )
protected

Default constructor.

◆ Dtk_KinCommand() [2/2]

Dtk_KinCommand::Dtk_KinCommand ( const Dtk_KinCommand cmd)
protected

Copy constructor.

Parameters
cmdthe Dtk_KinCommand to be copied

◆ ~Dtk_KinCommand()

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

◆ Create()

static Dtk_KinCommandPtr Dtk_KinCommand::Create ( )
static

Base constructor.

◆ DtkDynamicCast()

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

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

1377  {
1378  if(s->DtkDynamicType(_typeID))
1379  return static_cast<Dtk_KinCommand*>(s);
1380  return NULL;
1381  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinCommand::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

1367  {
1368  if (inId == _typeID)
1369  {
1370  return 1;
1371  }
1372  return Dtk_Object::DtkDynamicType(inId);
1373  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ Dump()

Dtk_status Dtk_KinCommand::Dump ( FILE *  inFile,
Dtk_bool  simplified 
)

Write Dump file for command.

Parameters
inFilethe output file
simplifieddetermine if you write a simplified file

Sample

Dtk_string fileName = ...;
File * file = fileName.ouvrir_fichier(DTK_W);
command.setName(Dtk_string("sample command"));
command.setId(1);
command.Dump(file, true);

Result (simplified = true)

<command name="sample command" id="1">
</command>

Result (simplified = false)

<command name="sample command" id="1">
<attributCommand type="" value="" />
<!-- Joint associated at command / _joint.Dump(inFile,true) -->
<!-- Parameter associated at command / _parameter.Dump(inFile) -->
</command>

◆ get_type_detk()

type_detk Dtk_KinCommand::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KIN_COMMAND -
1384 { return DTK_TYPE_KIN_COMMAND; }

◆ getId()

int Dtk_KinCommand::getId ( )

Returns the command id.

◆ getJoint()

Dtk_KinJointPtr Dtk_KinCommand::getJoint ( )

Returns the joint associated at command.

◆ getName()

Dtk_string Dtk_KinCommand::getName ( )

Returns the command name.

◆ getParameter()

Dtk_KinParameterPtr Dtk_KinCommand::getParameter ( )

Returns the parameter associated at command.

◆ GetSize()

◆ getType()

COMMAND_TYPE Dtk_KinCommand::getType ( )

Returns the command type.

◆ getValue()

double Dtk_KinCommand::getValue ( )

Returns the value of the command for simulation.

◆ isEqual()

Dtk_bool Dtk_KinCommand::isEqual ( Dtk_KinCommandPtr  inCommand)

Test if 2 Dtk_KinCommand are equal.

Compare the id attribute.

Parameters
inCommandDtk_KinCommand to be tested

◆ operator==()

Dtk_bool Dtk_KinCommand::operator== ( Dtk_KinCommand inCommand)

Test if 2 Dtk_KinCommand are equal.

Compare the id attribute.

Parameters
inCommandDtk_KinCommand to be tested

◆ release()

static Dtk_KinCommandPtr Dtk_KinCommand::release ( Dtk_KinCommandPtr  inCommand)
static

Delete object.

◆ setId()

void Dtk_KinCommand::setId ( int  inId)

Sets the command id.

Parameters
inIdcommand id

◆ setJoint()

void Dtk_KinCommand::setJoint ( Dtk_KinJointPtr  inJoint)

Sets the joint associated at command.

Parameters
inJointJoint command

◆ setName()

void Dtk_KinCommand::setName ( Dtk_string  inName)

Sets the command name.

Parameters
inNamecommand name

◆ setParameter()

void Dtk_KinCommand::setParameter ( Dtk_KinParameterPtr  inParam)

Sets the parameter command.

Parameters
inParamParameter command

◆ setType()

void Dtk_KinCommand::setType ( int  inType)

Sets the type of the command.

Parameters
inTypetype of the command

◆ setValue()

void Dtk_KinCommand::setValue ( double  inValue)

Sets the command value.

Parameters
inValueCommand value

◆ Transform()

Dtk_ErrorStatus Dtk_KinCommand::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_Kinematic

friend class Dtk_Kinematic
friend

◆ Dtk_KinMechanism

friend class Dtk_KinMechanism
friend

◆ Dtk_SmartPtr< Dtk_KinCommand >

friend class Dtk_SmartPtr< Dtk_KinCommand >
friend

Field Documentation

◆ _ID

int Dtk_KinCommand::_ID
protected

◆ _joint

Dtk_KinJointPtr Dtk_KinCommand::_joint
protected

This joint belongs at the kinematic joint table.

◆ _name

Dtk_string Dtk_KinCommand::_name
protected

◆ _parameter

Dtk_KinParameterPtr Dtk_KinCommand::_parameter
protected

◆ _type

COMMAND_TYPE Dtk_KinCommand::_type
protected

type command:

  • 1: Angle (not compound joint type)
  • 2: Length (not compound joint type)
  • 3: Angle (compound joint : angle command type associated at the first joint of compound joint)
  • 4: Length (compound joint : length command type associated at the first joint of compound joint)
  • 5: Angle (compound joint : angle command type associated at the second joint of compound joint)
  • 6; Length (compound joint : length command type associated at the second joint of compound joint)

◆ _value

double Dtk_KinCommand::_value
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_string::ouvrir_fichier
FILE * ouvrir_fichier(const Dtk_string &droits) const
File Utility : Open a file with the given rights.
Dtk_KinCommand
Dtk_KinCommand represents a command to simulate a mechanism.
Definition: util_kinematics_dtk.hpp:1336
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_TYPE_KIN_COMMAND
@ DTK_TYPE_KIN_COMMAND
Definition: define.h:549
DTK_W
#define DTK_W
Definition: dtk_string.hpp:43
Dtk_KinCommand::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:1344
Dtk_KinCommand::setName
void setName(Dtk_string inName)
Sets the command name.
Dtk_KinCommand::_parameter
Dtk_KinParameterPtr _parameter
Definition: util_kinematics_dtk.hpp:1489
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_KinCommand::_joint
Dtk_KinJointPtr _joint
This joint belongs at the kinematic joint table.
Definition: util_kinematics_dtk.hpp:1488
Dtk_KinCommand::Dump
Dtk_status Dump(FILE *inFile, Dtk_bool simplified)
Write Dump file for command.
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_KinCommand::setId
void setId(int inId)
Sets the command id.