DATAKIT API  V2025.1
Dtk_KinLaw Class Referenceabstract

Dtk_KinLaw represents a law associated at a command. More...

+ Inheritance diagram for Dtk_KinLaw:

Public Member Functions

void addCurve (Dtk_KinCurvePtr inCurve)
 Add a curve at the parameter in. More...
 
void addParameter (Dtk_KinParameterPtr param)
 Add a paramater at the parameter 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)
 Write Dump file for law. More...
 
type_detk get_type_detk () const
 
int getActive ()
 Returns the active attribute. More...
 
int getAlgo ()
 
Dtk_string getComment ()
 Returns the law comment. More...
 
Dtk_KinCurvePtr getCurve (Dtk_Size_t inPos)
 Returns the curve at the position inPos. More...
 
Dtk_Size_t getCurveSize ()
 Return the size of the curve tab. More...
 
Dtk_KinFormulaPtr getExpression ()
 Returns the law expression (formula) More...
 
int getId ()
 Returns the law id. More...
 
Dtk_string getName ()
 Returns the law name. More...
 
Dtk_KinParameterTab getParameter ()
 Returns the parameter table The last is the out parameter. More...
 
virtual Dtk_Size_t GetSize () const
 
int getSynchrone ()
 Returns the synchrone attribute. More...
 
Dtk_bool isEqual (Dtk_KinLawPtr inLaw)
 Test if 2 Dtk_KinLaw is equal. More...
 
void setActive (int inActive)
 Sets the active attribute. More...
 
void setAlgo (int inAlgo)
 
void setComment (Dtk_string inComment)
 Sets the law comment. More...
 
void setExpression (Dtk_KinFormulaPtr inExpression)
 Sets the formula. More...
 
void setId (int inId)
 Sets the law id. More...
 
void setName (Dtk_string inName)
 Sets the law name. More...
 
void setParameter (Dtk_KinParameterTab inParamOut)
 Sets the parameter table. More...
 
void setSynchrone (int inSynchrone)
 Sets the synchrone attribute. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

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

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_KIN_LAW }
 

Protected Member Functions

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

Protected Attributes

int _active
 
int _algo
 
Dtk_string _comment
 
Dtk_KinCurveTab _curve
 
Dtk_KinFormulaPtr _expression
 
int _ID
 
Dtk_string _name
 
Dtk_KinParameterTab _param
 
int _synchrone
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_KinLaw >
 

Detailed Description

Dtk_KinLaw represents a law associated at a command.

A law is linked at a mechanism object.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
2339  {
2341  };

Constructor & Destructor Documentation

◆ Dtk_KinLaw() [1/2]

Dtk_KinLaw::Dtk_KinLaw ( )
protected

Default constructor.

◆ Dtk_KinLaw() [2/2]

Dtk_KinLaw::Dtk_KinLaw ( const Dtk_KinLaw inLaw)
protected

Copy constructor.

Parameters
inLawthe Dtk_KinLaw to be copied

◆ ~Dtk_KinLaw()

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

◆ addCurve()

void Dtk_KinLaw::addCurve ( Dtk_KinCurvePtr  inCurve)

Add a curve at the parameter in.

Parameters
inCurveCurve to be added

◆ addParameter()

void Dtk_KinLaw::addParameter ( Dtk_KinParameterPtr  param)

Add a paramater at the parameter table.

Parameters
paramParameter to be added

◆ Create()

static Dtk_KinLawPtr Dtk_KinLaw::Create ( )
static

Base constructor.

◆ DtkDynamicCast()

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

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

2373  {
2374  if(s->DtkDynamicType(_typeID))
2375  return static_cast<Dtk_KinLaw*>(s);
2376  return NULL;
2377  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinLaw::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

2363  {
2364  if (inId == _typeID)
2365  {
2366  return 1;
2367  }
2368  return Dtk_Object::DtkDynamicType(inId);
2369  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ Dump()

Dtk_status Dtk_KinLaw::Dump ( FILE *  inFile)

Write Dump file for law.

Parameters
inFilethe output file

Sample

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

Result

<law name="sample law" id="1">
<attributLaw comment="" synchrone="" active="" algo=""/>
<!-- formula.Dump(inFile) -->
<parameters>
<!-- parameter.Dump(inFile) -->
</parameters>
</law>

◆ get_type_detk()

type_detk Dtk_KinLaw::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KIN_LAW -
2380 { return DTK_TYPE_KIN_LAW; }

◆ getActive()

int Dtk_KinLaw::getActive ( )

Returns the active attribute.

◆ getAlgo()

int Dtk_KinLaw::getAlgo ( )

◆ getComment()

Dtk_string Dtk_KinLaw::getComment ( )

Returns the law comment.

◆ getCurve()

Dtk_KinCurvePtr Dtk_KinLaw::getCurve ( Dtk_Size_t  inPos)

Returns the curve at the position inPos.

Parameters
inPosposition of element

If position is out bounds returns NULL

◆ getCurveSize()

Dtk_Size_t Dtk_KinLaw::getCurveSize ( )

Return the size of the curve tab.

◆ getExpression()

Dtk_KinFormulaPtr Dtk_KinLaw::getExpression ( )

Returns the law expression (formula)

◆ getId()

int Dtk_KinLaw::getId ( )

Returns the law id.

◆ getName()

Dtk_string Dtk_KinLaw::getName ( )

Returns the law name.

◆ getParameter()

Dtk_KinParameterTab Dtk_KinLaw::getParameter ( )

Returns the parameter table The last is the out parameter.

◆ GetSize()

◆ getSynchrone()

int Dtk_KinLaw::getSynchrone ( )

Returns the synchrone attribute.

◆ isEqual()

Dtk_bool Dtk_KinLaw::isEqual ( Dtk_KinLawPtr  inLaw)

Test if 2 Dtk_KinLaw is equal.

Compare the id attributes.

Parameters
inPartDtk_KinLaw to be tested

◆ release()

static Dtk_KinLawPtr Dtk_KinLaw::release ( Dtk_KinLawPtr  inLaw)
static

Delete object.

◆ setActive()

void Dtk_KinLaw::setActive ( int  inActive)

Sets the active attribute.

Parameters
inActiveactive attribute

◆ setAlgo()

void Dtk_KinLaw::setAlgo ( int  inAlgo)

◆ setComment()

void Dtk_KinLaw::setComment ( Dtk_string  inComment)

Sets the law comment.

Parameters
inCommentlaw comment

◆ setExpression()

void Dtk_KinLaw::setExpression ( Dtk_KinFormulaPtr  inExpression)

Sets the formula.

Parameters
inExpressionformula

◆ setId()

void Dtk_KinLaw::setId ( int  inId)

Sets the law id.

Parameters
inIdlaw id

◆ setName()

void Dtk_KinLaw::setName ( Dtk_string  inName)

Sets the law name.

Parameters
inNamelaw name

◆ setParameter()

void Dtk_KinLaw::setParameter ( Dtk_KinParameterTab  inParamOut)

Sets the parameter table.

Parameters
inParamOutparameter table

◆ setSynchrone()

void Dtk_KinLaw::setSynchrone ( int  inSynchrone)

Sets the synchrone attribute.

Parameters
inSynchronesynchrone attribute

◆ Transform()

Dtk_ErrorStatus Dtk_KinLaw::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_KinLaw >

friend class Dtk_SmartPtr< Dtk_KinLaw >
friend

Field Documentation

◆ _active

int Dtk_KinLaw::_active
protected

value:

  • 1: deactivate
  • 2: activate

◆ _algo

int Dtk_KinLaw::_algo
protected

◆ _comment

Dtk_string Dtk_KinLaw::_comment
protected

◆ _curve

Dtk_KinCurveTab Dtk_KinLaw::_curve
protected

◆ _expression

Dtk_KinFormulaPtr Dtk_KinLaw::_expression
protected

◆ _ID

int Dtk_KinLaw::_ID
protected

◆ _name

Dtk_string Dtk_KinLaw::_name
protected

◆ _param

Dtk_KinParameterTab Dtk_KinLaw::_param
protected

◆ _synchrone

int Dtk_KinLaw::_synchrone
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_KinLaw
Dtk_KinLaw represents a law associated at a command.
Definition: util_kinematics_dtk.hpp:2335
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_TYPE_KIN_LAW
@ DTK_TYPE_KIN_LAW
Definition: define.h:551
DTK_W
#define DTK_W
Definition: dtk_string.hpp:43
Dtk_KinLaw::setId
void setId(int inId)
Sets the law id.
Dtk_KinLaw::Dump
Dtk_status Dump(FILE *inFile)
Write Dump file for law.
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_KinLaw::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:2340
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_KinLaw::setName
void setName(Dtk_string inName)
Sets the law name.