DATAKIT API  V2025.1
Dtk_KinFormula Class Referenceabstract

Dtk_KinFormula represents the formula defined the law. More...

+ Inheritance diagram for Dtk_KinFormula:

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)
 Write Dump file for formula. More...
 
type_detk get_type_detk () const
 
Dtk_string getComment ()
 Returns the formula comment. More...
 
Dtk_string getFormula ()
 Returns the formula. More...
 
int getId ()
 Returns the formula id. More...
 
Dtk_string getName ()
 Returns the formula name. More...
 
Dtk_string getParam ()
 Returns the formula parameter. More...
 
virtual Dtk_Size_t GetSize () const
 
void setComment (Dtk_string inComment)
 Sets the formula comment. More...
 
void setFormula (Dtk_string inFormula)
 Sets the formula. More...
 
void setId (int inId)
 Sets the formula id. More...
 
void setName (Dtk_string inName)
 Sets the formula name. More...
 
void setParam (Dtk_string inParam)
 Sets the formula parameter. More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 

Static Public Member Functions

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

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_KIN_FORMULA }
 

Protected Member Functions

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

Protected Attributes

Dtk_string _comment
 
Dtk_string _formula
 
int _ID
 
Dtk_string _name
 
Dtk_string _param
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_KinFormula >
 

Detailed Description

Dtk_KinFormula represents the formula defined the law.

A formula is linked at a law object.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
2107  {
2109  };

Constructor & Destructor Documentation

◆ Dtk_KinFormula() [1/2]

Dtk_KinFormula::Dtk_KinFormula ( )
protected

Default constructor.

◆ Dtk_KinFormula() [2/2]

Dtk_KinFormula::Dtk_KinFormula ( const Dtk_KinFormula inFormula)
protected

Copy constructor.

Parameters
inFormulathe Dtk_KinFormula to be copied

◆ ~Dtk_KinFormula()

Dtk_KinFormula::~Dtk_KinFormula ( )
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_KinFormulaPtr Dtk_KinFormula::Create ( )
static

Base constructor.

◆ DtkDynamicCast()

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

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

2141  {
2142  if(s->DtkDynamicType(_typeID))
2143  return static_cast<Dtk_KinFormula*>(s);
2144  return NULL;
2145  }

◆ DtkDynamicType() [1/2]

Dtk_Int32 Dtk_KinFormula::DtkDynamicType ( const Dtk_Int32 inId)

Retrieves the dynamic entity type.

2131  {
2132  if (inId == _typeID)
2133  {
2134  return 1;
2135  }
2136  return Dtk_Object::DtkDynamicType(inId);
2137  }

◆ DtkDynamicType() [2/2]

◆ dump()

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

◆ Dump()

Dtk_status Dtk_KinFormula::Dump ( FILE *  inFile)

Write Dump file for formula.

Parameters
inFilethe output file

Sample

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

Result

<formula name="sample formula" id="1">
<attributFormula comment="" formula="" parameter=""/>
</formula>

◆ get_type_detk()

type_detk Dtk_KinFormula::get_type_detk ( ) const
Returns
The type of the entity type - DTK_TYPE_KIN_FORMULA -
2148 { return DTK_TYPE_KIN_FORMULA; }

◆ getComment()

Dtk_string Dtk_KinFormula::getComment ( )

Returns the formula comment.

◆ getFormula()

Dtk_string Dtk_KinFormula::getFormula ( )

Returns the formula.

◆ getId()

int Dtk_KinFormula::getId ( )

Returns the formula id.

◆ getName()

Dtk_string Dtk_KinFormula::getName ( )

Returns the formula name.

◆ getParam()

Dtk_string Dtk_KinFormula::getParam ( )

Returns the formula parameter.

◆ GetSize()

◆ release()

static Dtk_KinFormulaPtr Dtk_KinFormula::release ( Dtk_KinFormulaPtr  inFormula)
static

Delete object.

◆ setComment()

void Dtk_KinFormula::setComment ( Dtk_string  inComment)

Sets the formula comment.

Parameters
inCommentformula comment

◆ setFormula()

void Dtk_KinFormula::setFormula ( Dtk_string  inFormula)

Sets the formula.

Parameters
inFormulaformula

◆ setId()

void Dtk_KinFormula::setId ( int  inId)

Sets the formula id.

Parameters
inIdformula id

◆ setName()

void Dtk_KinFormula::setName ( Dtk_string  inName)

Sets the formula name.

Parameters
inNameformula name

◆ setParam()

void Dtk_KinFormula::setParam ( Dtk_string  inParam)

Sets the formula parameter.

Parameters
inParamformula parameter

◆ Transform()

Dtk_ErrorStatus Dtk_KinFormula::Transform ( const Dtk_transfo inTransfo)

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_KinFormula >

friend class Dtk_SmartPtr< Dtk_KinFormula >
friend

Field Documentation

◆ _comment

Dtk_string Dtk_KinFormula::_comment
protected

◆ _formula

Dtk_string Dtk_KinFormula::_formula
protected

◆ _ID

int Dtk_KinFormula::_ID
protected

◆ _name

Dtk_string Dtk_KinFormula::_name
protected

◆ _param

Dtk_string Dtk_KinFormula::_param
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_KinFormula::Dump
Dtk_status Dump(FILE *inFile)
Write Dump file for formula.
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_KinFormula
Dtk_KinFormula represents the formula defined the law.
Definition: util_kinematics_dtk.hpp:2102
Dtk_KinFormula::_typeID
@ _typeID
Definition: util_kinematics_dtk.hpp:2108
Dtk_KinFormula::setName
void setName(Dtk_string inName)
Sets the formula name.
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_Object::DtkDynamicType
virtual int DtkDynamicType(const int &inId)=0
Dtk_KinFormula::setId
void setId(int inId)
Sets the formula id.
DTK_TYPE_KIN_FORMULA
@ DTK_TYPE_KIN_FORMULA
Definition: define.h:556