HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_ConstraintNetwork::iterator Class Reference

#include <SIM_ConstraintNetworkIterator.h>

+ Inheritance diagram for SIM_ConstraintNetwork::iterator:

Public Member Functions

 iterator (const SIM_Data &container, const SIM_Data &data_root, SIM_GeometryCopy *geo, const SIM_Time &t, const SIM_DataFilter &filter=SIM_DataFilterAll())
 
 ~iterator ()
 
void rewind ()
 
bool atEnd () const
 
void advance ()
 
exint getConstraintIndex () const
 Return the number of constraints that have been seen so far. More...
 
GA_Index getPrimIndex () const
 Return the primitive number corresponding to the current constraint. More...
 
GA_Offset getPrimOffset () const
 
GA_Index getPointNumber (bool anchor1) const
 Return the point number corresponding to an anchor. More...
 
GU_DetailgetGdp () const
 
void breakConstraint ()
 
template<typename T >
get (const UT_StringRef &attribute_name) const
 
template<typename T >
getDataOption (const UT_StringRef &attribute_name) const
 Retrieve a value from the attached subdata for the constraint. More...
 
template<typename T >
bool getPrimitiveAttribute (const UT_StringRef &attribute_name, T &value) const
 Retrieve a value from a primitive attribute of the constraint. More...
 
template<typename T >
getDetailAttribute (const UT_StringRef &attribute_name, const T &default_value) const
 
bool set (const UT_StringHolder &attribute_name, fpreal val)
 
void updateLinearConstraintState (fpreal force, fpreal distance)
 
void updateAngularConstraintState (fpreal torque, fpreal angle)
 
const_iteratorgetConstIterator ()
 Returns the underlying const_iterator. More...
 

Detailed Description

Provides a convenient way to process all of the constraints in the network, and update attributes of the constraints.

Definition at line 352 of file SIM_ConstraintNetworkIterator.h.

Constructor & Destructor Documentation

SIM_ConstraintNetwork::iterator::iterator ( const SIM_Data container,
const SIM_Data data_root,
SIM_GeometryCopy geo,
const SIM_Time t,
const SIM_DataFilter filter = SIM_DataFilterAll() 
)

Use the filter parameter to process only a certain constraint type. The default behaviour is to process everything.

SIM_ConstraintNetwork::iterator::~iterator ( )

Member Function Documentation

void SIM_ConstraintNetwork::iterator::advance ( )
inline

Definition at line 364 of file SIM_ConstraintNetworkIterator.h.

bool SIM_ConstraintNetwork::iterator::atEnd ( ) const
inline

Definition at line 363 of file SIM_ConstraintNetworkIterator.h.

void SIM_ConstraintNetwork::iterator::breakConstraint ( )

Mark the current constraint as being broken. This will cause it to switch to the next constraint type (if defined) or break and be skipped on any further traversals of the constraints. The broken constraints are placed into a primitive group, which can then be used in a SOP solver to trigger events when constraints break.

template<typename T >
T SIM_ConstraintNetwork::iterator::get ( const UT_StringRef attribute_name) const
inline

Returns the value of an attribute of the constraint. If there is no primitive attribute with that name, a default value will be taken from the attached subdata if possible.

Definition at line 390 of file SIM_ConstraintNetworkIterator.h.

const_iterator& SIM_ConstraintNetwork::iterator::getConstIterator ( )
inline

Returns the underlying const_iterator.

Definition at line 432 of file SIM_ConstraintNetworkIterator.h.

exint SIM_ConstraintNetwork::iterator::getConstraintIndex ( ) const
inline

Return the number of constraints that have been seen so far.

Definition at line 367 of file SIM_ConstraintNetworkIterator.h.

template<typename T >
T SIM_ConstraintNetwork::iterator::getDataOption ( const UT_StringRef attribute_name) const
inline

Retrieve a value from the attached subdata for the constraint.

Definition at line 400 of file SIM_ConstraintNetworkIterator.h.

template<typename T >
T SIM_ConstraintNetwork::iterator::getDetailAttribute ( const UT_StringRef attribute_name,
const T &  default_value 
) const
inline

Definition at line 415 of file SIM_ConstraintNetworkIterator.h.

GU_Detail& SIM_ConstraintNetwork::iterator::getGdp ( ) const
inline

Definition at line 376 of file SIM_ConstraintNetworkIterator.h.

GA_Index SIM_ConstraintNetwork::iterator::getPointNumber ( bool  anchor1) const

Return the point number corresponding to an anchor.

GA_Index SIM_ConstraintNetwork::iterator::getPrimIndex ( ) const
inline

Return the primitive number corresponding to the current constraint.

Definition at line 370 of file SIM_ConstraintNetworkIterator.h.

template<typename T >
bool SIM_ConstraintNetwork::iterator::getPrimitiveAttribute ( const UT_StringRef attribute_name,
T &  value 
) const
inline

Retrieve a value from a primitive attribute of the constraint.

Definition at line 407 of file SIM_ConstraintNetworkIterator.h.

GA_Offset SIM_ConstraintNetwork::iterator::getPrimOffset ( ) const
inline

Definition at line 371 of file SIM_ConstraintNetworkIterator.h.

void SIM_ConstraintNetwork::iterator::rewind ( )
inline

Definition at line 362 of file SIM_ConstraintNetworkIterator.h.

bool SIM_ConstraintNetwork::iterator::set ( const UT_StringHolder attribute_name,
fpreal  val 
)

Update an attribute of the current constraint. If the primitive attribute does not exist, it will be created. Returns true if the value was successfully set.

void SIM_ConstraintNetwork::iterator::updateAngularConstraintState ( fpreal  torque,
fpreal  angle 
)
void SIM_ConstraintNetwork::iterator::updateLinearConstraintState ( fpreal  force,
fpreal  distance 
)

Convenience method to update the constraint about the forces or torques applied to satisfy it.


The documentation for this class was generated from the following file: