DATAKIT API  V2025.1
Dtk_KinConstraint Class Referenceabstract

Dtk_KinConstraint represents a constraint to define a joint. More...

+ Inheritance diagram for Dtk_KinConstraint:

Public Member Functions

void addAttribute (Dtk_string inAttribute)
 Add inAttribute at the attribute table. More...
 
void addConnector (Dtk_KinConnectorPtr inConnector)
 Add a connector at the connector 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)
 Write Dump file for constraint. 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...
 
Dtk_KinConnectorPtr getConnector (Dtk_Size_t inPosition)
 Returns the connector at inPosition. More...
 
Dtk_Size_t getConnectorSize ()
 Return the attribute tab size. More...
 
int getId ()
 Retrun the constraint id. More...
 
int getModeInteger ()
 Returns the Dtk_KinParameter represents the mode integer. More...
 
Dtk_string getName ()
 Returns the constraint name. More...
 
Dtk_KinParameterPtr getOrientation ()
 Returns the Dtk_KinParameter represents the orientation. More...
 
Dtk_transfo getPosition ()
 Returns the part position. More...
 
Dtk_KinParameterPtr getReference ()
 Returns the Dtk_KinParameter represents the reference. More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_KinParameterPtr getValue ()
 Returns the Dtk_KinParameter represents the constraint value. More...
 
Dtk_bool hasAttribute (Dtk_string inAttributeName)
 Test if an attribute name belong at the attribute table. More...
 
Dtk_bool isEqual (Dtk_KinConstraintPtr inConstraint)
 Test if 2 Dtk_KinConstraint is equal. More...
 
Dtk_bool operator== (Dtk_KinConstraint &inConstraint)
 Test if 2 Dtk_KinConstraint is equal. More...
 
void replaceConnector (Dtk_Size_t inPosition, Dtk_KinConnectorPtr inConnector)
 Replace the connector at position inPosition by the connector inConnector. More...
 
void setId (int inId)
 Sets the constraint id. More...
 
void setModeInteger (int inMode)
 Sets the parameter for mode integer. More...
 
void setName (Dtk_string inName)
 Sets the constraint name. More...
 
void setOrientation (Dtk_KinParameterPtr inParam)
 Sets the parameter for orientation. More...
 
void setPosition (Dtk_transfo transfo)
 Sets the part position. More...
 
void setReference (Dtk_KinParameterPtr inParam)
 Sets the parameter for reference attribute. More...
 
void setValue (Dtk_KinParameterPtr inParam)
 Sets the parameter for value. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

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

Data Fields

Dtk_string _MODE_INTEGER
 Name for optional attribute. More...
 
Dtk_string _ORIENTATION
 Name for optional attribute. More...
 
Dtk_string _POSITION
 Name for optional attribute. More...
 
Dtk_string _REFERENCE
 Name for optional attribute. More...
 
Dtk_string _VALUE
 Name for optional attribute. More...
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_KIN_CONSTRAINT }
 

Protected Member Functions

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

Protected Attributes

Dtk_StringTab _attributeTable
 Contains the names of the defining optional attributes forced. More...
 
Dtk_KinConnectorTab _connectors
 
int _ID
 
int _modeInteger
 Optional attribute (offset constraint) More...
 
Dtk_string _name
 
Dtk_KinParameterPtr _orientation
 Optional attribute (offset constraint) More...
 
Dtk_transfo _position
 Optional attribute (fix constraint) More...
 
Dtk_KinParameterPtr _reference
 Optional attribute (fix constraint) More...
 
Dtk_KinParameterPtr _value
 Optional attribute (offset constraint) More...
 
unsigned long count_
 

Friends

class Dtk_Kinematic
 
class Dtk_KinFixPart
 
class Dtk_KinJoint
 
class Dtk_SmartPtr< Dtk_KinConstraint >
 

Detailed Description

Dtk_KinConstraint represents a constraint to define a joint.

Constraints types:

  • Coincidence
  • Offset
  • Fix (only for fix part of mechanism)
  • FixTogether (only with Rigid joint)

A constraint is linked at a kinematic object and a joint object.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
609  {
611  };

Constructor & Destructor Documentation

◆ Dtk_KinConstraint() [1/2]

Dtk_KinConstraint::Dtk_KinConstraint ( )
protected

Default constructor.

◆ Dtk_KinConstraint() [2/2]

Dtk_KinConstraint::Dtk_KinConstraint ( const Dtk_KinConstraint constraint)
protected

Copy constructor.

Parameters
constraintthe Dtk_KinConstraint to be copied

◆ ~Dtk_KinConstraint()

Dtk_KinConstraint::~Dtk_KinConstraint ( )
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_KinConstraint::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 attribut table

◆ addConnector()

void Dtk_KinConstraint::addConnector ( Dtk_KinConnectorPtr  inConnector)

Add a connector at the connector table.

Parameters
inConnectorthe connector to be added

The connector is added if connector table doesn't contain this connector

◆ Create()

static Dtk_KinConstraintPtr Dtk_KinConstraint::Create ( )
static

Base constructor.

◆ DtkDynamicCast()

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

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

643  {
644  if(s->DtkDynamicType(_typeID))
645  return static_cast<Dtk_KinConstraint*>(s);
646  return NULL;
647  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinConstraint::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

633  {
634  if (inId == _typeID)
635  {
636  return 1;
637  }
638  return Dtk_Object::DtkDynamicType(inId);
639  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ Dump()

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

Write Dump file for constraint.

Parameters
inFilethe output file
simplifieddetermine if you write a simplified file

Sample

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

Result (simplified = true)

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

Result (simplified = false)
All attributes are represented. Some attributes could not appear into out file.

<constraint name="sample constraint" id="1">
<attributConstraint modeInteger="" value="" orientation="" fixInSpace="">
<matricePosition nbValue="12" _1="" _2="" _3="" _4="" _5="" _6="" _7="" _8="" _9="" _10="" _11="" _12="" />
</attributConstraint>
<parts>
<!-- Parts associated at constraint -->
<!-- part.Dump(inFile, true) -->
</parts>
</constraint>

◆ get_type_detk()

type_detk Dtk_KinConstraint::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KINEMATICS -
650 { return DTK_TYPE_KIN_CONSTRAINT; }

◆ getAttribute()

Dtk_string Dtk_KinConstraint::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_KinConstraint::getAttributeSize ( )

Return the attribute tab size.

◆ getConnector()

Dtk_KinConnectorPtr Dtk_KinConstraint::getConnector ( Dtk_Size_t  inPosition)

Returns the connector at inPosition.

Parameters
inPositionposition of the connector

If position is out bounds, returns NULL.

◆ getConnectorSize()

Dtk_Size_t Dtk_KinConstraint::getConnectorSize ( )

Return the attribute tab size.

◆ getId()

int Dtk_KinConstraint::getId ( )

Retrun the constraint id.

◆ getModeInteger()

int Dtk_KinConstraint::getModeInteger ( )

Returns the Dtk_KinParameter represents the mode integer.

◆ getName()

Dtk_string Dtk_KinConstraint::getName ( )

Returns the constraint name.

◆ getOrientation()

Dtk_KinParameterPtr Dtk_KinConstraint::getOrientation ( )

Returns the Dtk_KinParameter represents the orientation.

◆ getPosition()

Dtk_transfo Dtk_KinConstraint::getPosition ( )

Returns the part position.

◆ getReference()

Dtk_KinParameterPtr Dtk_KinConstraint::getReference ( )

Returns the Dtk_KinParameter represents the reference.

◆ GetSize()

◆ getValue()

Dtk_KinParameterPtr Dtk_KinConstraint::getValue ( )

Returns the Dtk_KinParameter represents the constraint value.

◆ hasAttribute()

Dtk_bool Dtk_KinConstraint::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_KinConstraint::isEqual ( Dtk_KinConstraintPtr  inConstraint)

Test if 2 Dtk_KinConstraint is equal.

Compare the id attribute.

Parameters
inPartDtk_KinConstraint to be tested

◆ operator==()

Dtk_bool Dtk_KinConstraint::operator== ( Dtk_KinConstraint inConstraint)

Test if 2 Dtk_KinConstraint is equal.

Compare the id attribute.

Parameters
inPartDtk_KinConstraint to be tested

◆ release()

static Dtk_KinConstraintPtr Dtk_KinConstraint::release ( Dtk_KinConstraintPtr  inPart)
static

Delete object.

◆ replaceConnector()

void Dtk_KinConstraint::replaceConnector ( Dtk_Size_t  inPosition,
Dtk_KinConnectorPtr  inConnector 
)

Replace the connector at position inPosition by the connector inConnector.

◆ setId()

void Dtk_KinConstraint::setId ( int  inId)

Sets the constraint id.

Parameters
inIdconstraint id

◆ setModeInteger()

void Dtk_KinConstraint::setModeInteger ( int  inMode)

Sets the parameter for mode integer.

Parameters
inModemode integer

The MODE_INTEGER name is added at attribute table.

◆ setName()

void Dtk_KinConstraint::setName ( Dtk_string  inName)

Sets the constraint name.

Parameters
inNameconstraint name

◆ setOrientation()

void Dtk_KinConstraint::setOrientation ( Dtk_KinParameterPtr  inParam)

Sets the parameter for orientation.

Parameters
inParamorientation

The ORIENTATION name is added at attribute table.

◆ setPosition()

void Dtk_KinConstraint::setPosition ( Dtk_transfo  transfo)

Sets the part position.

Parameters
transfoPostion of the part

The POSITION name is added at attribute table

◆ setReference()

void Dtk_KinConstraint::setReference ( Dtk_KinParameterPtr  inParam)

Sets the parameter for reference attribute.

Parameters
inParamreference attribute

The REFERENCE name is added at attribute table

◆ setValue()

void Dtk_KinConstraint::setValue ( Dtk_KinParameterPtr  inParam)

Sets the parameter for value.

Parameters
inParamvalue

The VALUE name is added at attribute table.

◆ Transform()

Dtk_ErrorStatus Dtk_KinConstraint::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_Kinematic

friend class Dtk_Kinematic
friend

◆ Dtk_KinFixPart

friend class Dtk_KinFixPart
friend

◆ Dtk_KinJoint

friend class Dtk_KinJoint
friend

◆ Dtk_SmartPtr< Dtk_KinConstraint >

friend class Dtk_SmartPtr< Dtk_KinConstraint >
friend

Field Documentation

◆ _attributeTable

Dtk_StringTab Dtk_KinConstraint::_attributeTable
protected

Contains the names of the defining optional attributes forced.

◆ _connectors

Dtk_KinConnectorTab Dtk_KinConstraint::_connectors
protected

◆ _ID

int Dtk_KinConstraint::_ID
protected

◆ _MODE_INTEGER

Dtk_string Dtk_KinConstraint::_MODE_INTEGER

Name for optional attribute.

◆ _modeInteger

int Dtk_KinConstraint::_modeInteger
protected

Optional attribute (offset constraint)

  • 1: case reference not checked
  • 2: case reference checked

◆ _name

Dtk_string Dtk_KinConstraint::_name
protected

◆ _ORIENTATION

Dtk_string Dtk_KinConstraint::_ORIENTATION

Name for optional attribute.

◆ _orientation

Dtk_KinParameterPtr Dtk_KinConstraint::_orientation
protected

Optional attribute (offset constraint)

  • 1: same orientation
  • 2: opposite orientation
  • 3: undefined orientation

◆ _POSITION

Dtk_string Dtk_KinConstraint::_POSITION

Name for optional attribute.

◆ _position

Dtk_transfo Dtk_KinConstraint::_position
protected

Optional attribute (fix constraint)

◆ _REFERENCE

Dtk_string Dtk_KinConstraint::_REFERENCE

Name for optional attribute.

◆ _reference

Dtk_KinParameterPtr Dtk_KinConstraint::_reference
protected

Optional attribute (fix constraint)

  • 1: case fix in space checked
  • 2: case fix in space not checked

◆ _VALUE

Dtk_string Dtk_KinConstraint::_VALUE

Name for optional attribute.

◆ _value

Dtk_KinParameterPtr Dtk_KinConstraint::_value
protected

Optional attribute (offset constraint)

◆ 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_string
This is a high level string class.
Definition: dtk_string.hpp:58
DTK_TYPE_OBJECT
@ DTK_TYPE_OBJECT
Definition: define.h:464
Dtk_KinConstraint
Dtk_KinConstraint represents a constraint to define a joint.
Definition: util_kinematics_dtk.hpp:601
DTK_W
#define DTK_W
Definition: dtk_string.hpp:43
DTK_TYPE_KIN_CONSTRAINT
@ DTK_TYPE_KIN_CONSTRAINT
Definition: define.h:546
Dtk_KinConstraint::setId
void setId(int inId)
Sets the constraint id.
Dtk_KinConstraint::setName
void setName(Dtk_string inName)
Sets the constraint name.
Dtk_KinConstraint::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:610
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_KinConstraint::Dump
Dtk_status Dump(FILE *inFile, Dtk_bool simplified)
Write Dump file for constraint.
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0