DATAKIT SDK  V2026.2
Dtk_Constraint Class Reference

This is the Dtk_Constraint class. More...

+ Inheritance diagram for Dtk_Constraint:

Data Structures

class  _ConstraintValue
 

Public Types

enum  ConstraintOrientationTypeEnum {
  ValueTypeUndefined = 0, ValueTypeSame, ValueTypeOpposite, ValueTypeInternal,
  ValueTypeExternal
}
 
enum  ConstraintTypeEnum {
  TypeUnknown = 0, TypeAlign, TypeAngle, TypeBond,
  TypeCam, TypeCenter, TypeConcentric, TypeCoincidence,
  TypeDistance, TypeFit, TypeFix, TypeGear,
  TypeHinge, TypeLimit, TypeLinear, TypeLinearCoupler,
  TypeLock, TypeOrientAngle, TypeParallel, TypePathMate,
  TypePerpendicular, TypeProfileCenter, TypeRackPinion, TypeScrew,
  TypeSlot, TypeSymmetric, TypeTangent, TypeTouch,
  TypeUniversalJoint, TypeWidth
}
 
enum  ConstraintValueTypeEnum {
  ValueTypeUnknown = 0, ValueTypeAngle, ValueTypeDistance, ValueTypePosition,
  ValueTypeRotation, ValueTypeOrientation
}
 

Public Member Functions

virtual Dtk_ErrorStatus _Store (void *)
 
void AddConstraintReference (const Dtk_ConstraintReferencePtr &in)
 Add a ConstraintReference to this Constraint . More...
 
virtual void conv_ptr (Dtk_Constraint **s)
 
 Dtk_Constraint (const ConstraintTypeEnum &inType)
 
 Dtk_Constraint (const Dtk_Constraint &p)
 
int DtkDynamicType (const int &inId)
 
virtual void dump (FILE *file=stdout)
 
Dtk_InfoPtr get_info () const
 
type_detk get_type_detk () const
 
const Dtk_tab< Dtk_ConstraintReferencePtr > & GetConstraintReference () const
 Get all ConstraintReferences of the Constraint. More...
 
const Dtk_ConstraintReferencePtrGetConstraintReference (const Dtk_Size_t &index) const
 Get the Dtk_ConstraintReference at the specified index. More...
 
const ConstraintTypeEnumGetConstraintType () const
 Get the type of the Constraint . More...
 
const _ConstraintValueGetConstraintValue (const Dtk_Size_t &index) const
 Get the Dtk_Constraint::_ConstraintValue at the specified index. More...
 
const Dtk_IDGetID () const
 Get Internal UniqueID. More...
 
Dtk_Size_t GetNumberOfConstraintReferences () const
 Get the number of Dtk_ConstraintReference in the constraint. More...
 
Dtk_Size_t GetNumberOfConstraintValues ()
 Get the number of Dtk_Constraint::_ConstraintValue in the constraint. More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_ErrorStatus GetValue (const ConstraintValueTypeEnum &inValue, Dtk_Val &outValue) const
 
Dtk_ErrorStatus GetValue (const ConstraintValueTypeEnum &inValue, Dtk_Val &outValue, Dtk_Int32 &outEnableLowerLimit, Dtk_Double64 &outLowerLimit, Dtk_Int32 &outEnableUpperLimit, Dtk_Double64 &outUpperLimit) const
 Get a Value of the Constraint . More...
 
Dtk_tab< ConstraintValueTypeEnumGetValuesTypes () const
 Get all types of values in the Constraint. More...
 
Dtk_InfoPtrinfo ()
 
Dtk_Constraintoperator= (const Dtk_Constraint &p)
 
virtual void PrepareTransfo ()
 
void SetConstraintType (const ConstraintTypeEnum &in)
 Set the type of the Constraint . More...
 
void SetValue (const ConstraintValueTypeEnum &inValueType, Dtk_Val &inValue)
 
void SetValue (const ConstraintValueTypeEnum &inValueType, Dtk_Val &inValue, const Dtk_Int32 &inEnableLowerLimit, const Dtk_Double64 &inLowerLimit, const Dtk_Int32 &inEnableUpperLimit, const Dtk_Double64 &inUpperLimit)
 Set a Value of the Constraint . More...
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 Applies a transformation matrix to the entity. //! More...
 

Static Public Member Functions

static Dtk_string ConstraintOrientationTypeEnumToString (const ConstraintOrientationTypeEnum &inEnum)
 
static Dtk_string ConstraintTypeEnumToString (const ConstraintTypeEnum &inEnum)
 
static Dtk_string ConstraintValueTypeEnumToString (const ConstraintValueTypeEnum &inEnum)
 
static Dtk_SmartPtr< Dtk_ConstraintCreate ()
 Calls default constructor to allocate a new object. More...
 
static Dtk_ConstraintDtkDynamicCast (Dtk_Object *inObject)
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_ENTITY }
 

Protected Member Functions

void _Copy (const Dtk_Constraint &s)
 
void _copy (const Dtk_Entity &s)
 
void _init ()
 
void _Init ()
 
void _reset ()
 
void _Reset ()
 
virtual Dtk_ObjectClone ()
 
 Dtk_Constraint ()
 
virtual ~Dtk_Constraint ()
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Detailed Description

This is the Dtk_Constraint class.

A Dtk_Constraint contains the AxisSystem definition which defines by its Name, statut and the Matrix

This class lets you use Dtk_Constraint.

See also
Use Dtk_ConstraintPtr class to handle it.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ ConstraintOrientationTypeEnum

Enumerator
ValueTypeUndefined 
ValueTypeSame 
ValueTypeOpposite 
ValueTypeInternal 
ValueTypeExternal 
1156  {
1157  ValueTypeUndefined = 0,
1158  ValueTypeSame,
1162  };

◆ ConstraintTypeEnum

Enumerator
TypeUnknown 
TypeAlign 
TypeAngle 
TypeBond 
TypeCam 
TypeCenter 
TypeConcentric 
TypeCoincidence 
TypeDistance 
TypeFit 
TypeFix 
TypeGear 
TypeHinge 
TypeLimit 
TypeLinear 
TypeLinearCoupler 
TypeLock 
TypeOrientAngle 
TypeParallel 
TypePathMate 
TypePerpendicular 
TypeProfileCenter 
TypeRackPinion 
TypeScrew 
TypeSlot 
TypeSymmetric 
TypeTangent 
TypeTouch 
TypeUniversalJoint 
TypeWidth 
1219  {
1220  TypeUnknown = 0,
1221  //! \image html align.png
1222  TypeAlign,
1223  //! \image html angle.png
1224  TypeAngle,
1225  //! \image html bond.png
1226  TypeBond,
1227  TypeCam,
1228  //! \image html center.png
1229  TypeCenter,
1230  //! \image html concentric.png
1232  //! \image html coincidence.png
1234  //! \image html distance.png
1235  TypeDistance,
1236  //! \image html fit.png
1237  TypeFit,
1238  //! \image html fix.png
1239  TypeFix,
1240  TypeGear,
1241  TypeHinge,
1242  TypeLimit,
1243  TypeLinear,
1245  //! \image html lock.png
1246  TypeLock,
1247  //! \image html orientangle.png
1249  //! \image html parallel.png
1250  TypeParallel,
1251  TypePathMate,
1252  //! \image html perpendicular.png
1256  TypeScrew,
1257  TypeSlot,
1258  //! \image html symmetric.png
1259  TypeSymmetric,
1260  //! \image html tangent.png
1261  TypeTangent,
1262  //! \image html touch.png
1263  TypeTouch,
1265  TypeWidth
1266  };

◆ ConstraintValueTypeEnum

Enumerator
ValueTypeUnknown 
ValueTypeAngle 
ValueTypeDistance 
ValueTypePosition 
ValueTypeRotation 
ValueTypeOrientation 
1177  {
1178  ValueTypeUnknown = 0,
1184  };

Constructor & Destructor Documentation

◆ Dtk_Constraint() [1/3]

Dtk_Constraint::Dtk_Constraint ( const Dtk_Constraint p)

◆ Dtk_Constraint() [2/3]

Dtk_Constraint::Dtk_Constraint ( const ConstraintTypeEnum inType)

◆ Dtk_Constraint() [3/3]

Dtk_Constraint::Dtk_Constraint ( )
protected

◆ ~Dtk_Constraint()

virtual Dtk_Constraint::~Dtk_Constraint ( )
protectedvirtual

Member Function Documentation

◆ _Copy()

void Dtk_Constraint::_Copy ( const Dtk_Constraint s)
protected

◆ _copy()

void Dtk_Entity::_copy ( const Dtk_Entity s)
protectedinherited

◆ _init()

void Dtk_Entity::_init ( )
protectedinherited

◆ _Init()

void Dtk_Constraint::_Init ( )
protected

◆ _reset()

void Dtk_Entity::_reset ( )
protectedinherited

◆ _Reset()

void Dtk_Constraint::_Reset ( )
protected

◆ _Store()

◆ AddConstraintReference()

void Dtk_Constraint::AddConstraintReference ( const Dtk_ConstraintReferencePtr in)

Add a ConstraintReference to this Constraint .

◆ Clone()

virtual Dtk_Object* Dtk_Constraint::Clone ( )
protectedvirtual

Implements Dtk_Entity.

1383 { return new Dtk_Constraint(*this); }

◆ ConstraintOrientationTypeEnumToString()

static Dtk_string Dtk_Constraint::ConstraintOrientationTypeEnumToString ( const ConstraintOrientationTypeEnum inEnum)
static
1164  {
1165  switch( inEnum )
1166  {
1167  case ValueTypeSame: return L"TypeSame";
1168  case ValueTypeOpposite: return L"TypeOpposite";
1169  case ValueTypeInternal: return L"TypeInternal";
1170  case ValueTypeExternal: return L"TypeExternal";
1171  default:
1172  case ValueTypeUndefined: return L"TypeUndefined";
1173  }
1174  }

◆ ConstraintTypeEnumToString()

static Dtk_string Dtk_Constraint::ConstraintTypeEnumToString ( const ConstraintTypeEnum inEnum)
static
1268  {
1269  switch (inEnum)
1270  {
1271  case TypeAlign: return L"TypeAlign";
1272  case TypeAngle: return L"TypeAngle";
1273  case TypeBond: return L"TypeBond";
1274  case TypeCam: return L"TypeCam";
1275  case TypeCenter: return L"TypeCenter";
1276  case TypeConcentric: return L"TypeConcentric";
1277  case TypeCoincidence: return L"TypeCoincidence";
1278  case TypeDistance: return L"TypeDistance";
1279  case TypeFit: return L"TypeFit";
1280  case TypeFix: return L"TypeFix";
1281  case TypeGear: return L"TypeGear";
1282  case TypeHinge: return L"TypeHinge";
1283  case TypeLimit: return L"TypeLimit";
1284  case TypeLinear: return L"TypeLinear";
1285  case TypeLinearCoupler: return L"TypeLinearCoupler";
1286  case TypeLock: return L"TypeLock";
1287  case TypeOrientAngle: return L"TypeOrientAngle";
1288  case TypeParallel: return L"TypeParallel";
1289  case TypePathMate: return L"TypePathMate";
1290  case TypePerpendicular: return L"TypePerpendicular";
1291  case TypeProfileCenter: return L"TypeProfileCenter";
1292  case TypeRackPinion: return L"TypeRackPinion";
1293  case TypeScrew: return L"TypeScrew";
1294  case TypeSlot: return L"TypeSlot";
1295  case TypeSymmetric: return L"TypeSymmetric";
1296  case TypeTangent: return L"TypeTangent";
1297  case TypeTouch: return L"TypeTouch";
1298  case TypeUniversalJoint: return L"TypeUniversalJoint";
1299  case TypeWidth: return L"TypeWidth";
1300  default:
1301  case TypeUnknown: return L"Unknown";
1302  }
1303  }

◆ ConstraintValueTypeEnumToString()

static Dtk_string Dtk_Constraint::ConstraintValueTypeEnumToString ( const ConstraintValueTypeEnum inEnum)
static
1186  {
1187  switch( inEnum )
1188  {
1189  case ValueTypeAngle: return L"Angle";
1190  case ValueTypeDistance: return L"Distance";
1191  case ValueTypePosition: return L"Position";
1192  case ValueTypeRotation: return L"Rotation";
1193  case ValueTypeOrientation: return L"Orientation";
1194  default:
1195  case ValueTypeUnknown: return L"TypeUnknown";
1196  }
1197  }

◆ conv_ptr()

virtual void Dtk_Constraint::conv_ptr ( Dtk_Constraint **  s)
virtual
1368 { *s = this; }

◆ Create()

static Dtk_SmartPtr<Dtk_Constraint> Dtk_Constraint::Create ( )
static

Calls default constructor to allocate a new object.

◆ DtkDynamicCast()

static Dtk_Constraint* Dtk_Constraint::DtkDynamicCast ( Dtk_Object inObject)
static

◆ DtkDynamicType()

int Dtk_Constraint::DtkDynamicType ( const int &  inId)
virtual

Reimplemented from Dtk_Entity.

◆ dump()

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

◆ get_info()

Dtk_InfoPtr Dtk_Entity::get_info ( ) const
inherited

◆ get_type_detk()

type_detk Dtk_Constraint::get_type_detk ( ) const
virtual
Returns
The type of the entity type - DTK_TYPE_CONSTRAINT -

Implements Dtk_Entity.

1364 { return DTK_TYPE_CONSTRAINT; }

◆ GetConstraintReference() [1/2]

const Dtk_tab<Dtk_ConstraintReferencePtr>& Dtk_Constraint::GetConstraintReference ( ) const

Get all ConstraintReferences of the Constraint.

Returns
A tab with all the ConstraintReferences of this Constraint.

◆ GetConstraintReference() [2/2]

const Dtk_ConstraintReferencePtr& Dtk_Constraint::GetConstraintReference ( const Dtk_Size_t index) const

Get the Dtk_ConstraintReference at the specified index.

Parameters
Theindex to retrieve the Dtk_ConstraintReference from.
Returns
A Dtk_ConstraintReference.

◆ GetConstraintType()

const ConstraintTypeEnum& Dtk_Constraint::GetConstraintType ( ) const

Get the type of the Constraint .

Returns
the type of this Constraint .

◆ GetConstraintValue()

const _ConstraintValue& Dtk_Constraint::GetConstraintValue ( const Dtk_Size_t index) const

Get the Dtk_Constraint::_ConstraintValue at the specified index.

Returns
A Dtk_Constraint::_ConstraintValue.

◆ GetID()

const Dtk_ID& Dtk_Entity::GetID ( ) const
inherited

Get Internal UniqueID.

Returns
InternalID

◆ GetNumberOfConstraintReferences()

Dtk_Size_t Dtk_Constraint::GetNumberOfConstraintReferences ( ) const

Get the number of Dtk_ConstraintReference in the constraint.

Returns
The number of Dtk_ConstraintReference in the constraint.

◆ GetNumberOfConstraintValues()

Dtk_Size_t Dtk_Constraint::GetNumberOfConstraintValues ( )

Get the number of Dtk_Constraint::_ConstraintValue in the constraint.

Returns
The number of Dtk_Constraint::_ConstraintValue in the constraint.

◆ GetSize()

◆ GetValue() [1/2]

Dtk_ErrorStatus Dtk_Constraint::GetValue ( const ConstraintValueTypeEnum inValue,
Dtk_Val outValue 
) const

◆ GetValue() [2/2]

Dtk_ErrorStatus Dtk_Constraint::GetValue ( const ConstraintValueTypeEnum inValue,
Dtk_Val outValue,
Dtk_Int32 outEnableLowerLimit,
Dtk_Double64 outLowerLimit,
Dtk_Int32 outEnableUpperLimit,
Dtk_Double64 outUpperLimit 
) const

Get a Value of the Constraint .

Returns
a Value of this Constraint .

◆ GetValuesTypes()

Dtk_tab< ConstraintValueTypeEnum > Dtk_Constraint::GetValuesTypes ( ) const

Get all types of values in the Constraint.

Returns
All types of values contained in the Constraint.

◆ info()

Dtk_InfoPtr& Dtk_Entity::info ( )
inherited

◆ operator=()

Dtk_Constraint& Dtk_Constraint::operator= ( const Dtk_Constraint p)

◆ PrepareTransfo()

virtual void Dtk_Entity::PrepareTransfo ( )
virtualinherited

Reimplemented in Dtk_OffsetSurface.

◆ SetConstraintType()

void Dtk_Constraint::SetConstraintType ( const ConstraintTypeEnum in)

Set the type of the Constraint .

◆ SetValue() [1/2]

void Dtk_Constraint::SetValue ( const ConstraintValueTypeEnum inValueType,
Dtk_Val inValue 
)

◆ SetValue() [2/2]

void Dtk_Constraint::SetValue ( const ConstraintValueTypeEnum inValueType,
Dtk_Val inValue,
const Dtk_Int32 inEnableLowerLimit,
const Dtk_Double64 inLowerLimit,
const Dtk_Int32 inEnableUpperLimit,
const Dtk_Double64 inUpperLimit 
)

Set a Value of the Constraint .

◆ Transform()

Dtk_ErrorStatus Dtk_Constraint::Transform ( const Dtk_transfo inTransfo)
virtual

Applies a transformation matrix to the entity. //!

Parameters
inTransfoThe transformation matrix to apply.

Implements Dtk_Entity.

Field Documentation

◆ _Private

Dtk_Handle* Dtk_Constraint::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
Dtk_Constraint::TypeFix
@ TypeFix
Definition: util_ent_dtk.hpp:1239
Dtk_Constraint::TypeSlot
@ TypeSlot
Definition: util_ent_dtk.hpp:1257
Dtk_Constraint::TypeLinearCoupler
@ TypeLinearCoupler
Definition: util_ent_dtk.hpp:1244
Dtk_Constraint::TypeWidth
@ TypeWidth
Definition: util_ent_dtk.hpp:1265
Dtk_Constraint::TypeAlign
@ TypeAlign
Definition: util_ent_dtk.hpp:1222
DTK_TYPE_ENTITY
@ DTK_TYPE_ENTITY
Definition: define.h:457
Dtk_Constraint::Dtk_Constraint
Dtk_Constraint()
Dtk_Constraint::ValueTypeSame
@ ValueTypeSame
Definition: util_ent_dtk.hpp:1158
Dtk_Constraint::TypeSymmetric
@ TypeSymmetric
Definition: util_ent_dtk.hpp:1259
Dtk_Constraint::TypeBond
@ TypeBond
Definition: util_ent_dtk.hpp:1226
Dtk_Constraint::ValueTypeInternal
@ ValueTypeInternal
Definition: util_ent_dtk.hpp:1160
Dtk_Constraint::TypeUnknown
@ TypeUnknown
Definition: util_ent_dtk.hpp:1220
DTK_TYPE_OBJECT
@ DTK_TYPE_OBJECT
Definition: define.h:455
Dtk_Constraint::ValueTypeExternal
@ ValueTypeExternal
Definition: util_ent_dtk.hpp:1161
Dtk_Constraint::ValueTypeOrientation
@ ValueTypeOrientation
Definition: util_ent_dtk.hpp:1183
Dtk_Constraint::ValueTypeDistance
@ ValueTypeDistance
Definition: util_ent_dtk.hpp:1180
Dtk_Constraint::ValueTypeAngle
@ ValueTypeAngle
Definition: util_ent_dtk.hpp:1179
Dtk_Constraint::ValueTypeRotation
@ ValueTypeRotation
Definition: util_ent_dtk.hpp:1182
Dtk_Constraint::TypeTouch
@ TypeTouch
Definition: util_ent_dtk.hpp:1263
Dtk_Constraint::TypeAngle
@ TypeAngle
Definition: util_ent_dtk.hpp:1224
Dtk_Constraint::TypePerpendicular
@ TypePerpendicular
Definition: util_ent_dtk.hpp:1253
Dtk_Constraint::TypeHinge
@ TypeHinge
Definition: util_ent_dtk.hpp:1241
Dtk_Constraint::TypeConcentric
@ TypeConcentric
Definition: util_ent_dtk.hpp:1231
Dtk_Constraint::TypeParallel
@ TypeParallel
Definition: util_ent_dtk.hpp:1250
Dtk_Constraint::ValueTypePosition
@ ValueTypePosition
Definition: util_ent_dtk.hpp:1181
Dtk_Constraint::TypeUniversalJoint
@ TypeUniversalJoint
Definition: util_ent_dtk.hpp:1264
Dtk_Constraint::TypeFit
@ TypeFit
Definition: util_ent_dtk.hpp:1237
Dtk_Entity::_typeID
@ _typeID
Definition: util_ent_dtk.hpp:375
Dtk_Constraint::TypeCam
@ TypeCam
Definition: util_ent_dtk.hpp:1227
Dtk_Constraint::TypePathMate
@ TypePathMate
Definition: util_ent_dtk.hpp:1251
Dtk_Constraint::ValueTypeOpposite
@ ValueTypeOpposite
Definition: util_ent_dtk.hpp:1159
Dtk_Constraint::ValueTypeUndefined
@ ValueTypeUndefined
Definition: util_ent_dtk.hpp:1157
Dtk_Constraint::TypeProfileCenter
@ TypeProfileCenter
Definition: util_ent_dtk.hpp:1254
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:10
Dtk_Constraint::TypeOrientAngle
@ TypeOrientAngle
Definition: util_ent_dtk.hpp:1248
Dtk_Constraint::TypeDistance
@ TypeDistance
Definition: util_ent_dtk.hpp:1235
DTK_TYPE_CONSTRAINT
@ DTK_TYPE_CONSTRAINT
Definition: define.h:599
Dtk_Constraint::TypeCoincidence
@ TypeCoincidence
Definition: util_ent_dtk.hpp:1233
Dtk_Constraint::TypeLimit
@ TypeLimit
Definition: util_ent_dtk.hpp:1242
Dtk_Constraint::ValueTypeUnknown
@ ValueTypeUnknown
Definition: util_ent_dtk.hpp:1178
Dtk_Constraint::TypeTangent
@ TypeTangent
Definition: util_ent_dtk.hpp:1261
Dtk_Constraint::TypeScrew
@ TypeScrew
Definition: util_ent_dtk.hpp:1256
Dtk_Constraint::TypeGear
@ TypeGear
Definition: util_ent_dtk.hpp:1240
Dtk_Constraint::TypeLinear
@ TypeLinear
Definition: util_ent_dtk.hpp:1243
Dtk_Constraint::TypeLock
@ TypeLock
Definition: util_ent_dtk.hpp:1246
Dtk_Constraint::TypeRackPinion
@ TypeRackPinion
Definition: util_ent_dtk.hpp:1255
Dtk_Constraint::TypeCenter
@ TypeCenter
Definition: util_ent_dtk.hpp:1229