HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_SourceInstanceIterator Class Reference

#include <SIM_VolumeInstanceSource.h>

Public Member Functions

 SIM_SourceInstanceIterator (bool need_rules=true, bool need_vel=false)
 
 SIM_SourceInstanceIterator (const GA_Detail *gdp, bool need_rules=true, bool need_vel=false)
 
void setGeometry (const GA_Detail *gdp)
 Initializes this iterator for the given geometry. More...
 
bool isValid () const
 
void rewind ()
 Restarts the iterator. Must be called to start iteration. More...
 
bool atEnd () const
 
void advance ()
 Advances the iterator to the next instance. More...
 
UT_StringHolder getName () const
 Returns the name of the current instance. More...
 
fpreal32 getFrameOffset () const
 Returns the frame offset for the current instance. More...
 
UT_Vector3F getPosition () const
 Returns the position for the current instance. More...
 
UT_QuaternionF getOrientation () const
 Returns the orientation of the current instance. More...
 
UT_Vector3F getPivot () const
 Returns the pivot of the current instance. More...
 
int getNumberOfRules () const
 
SIM_SourceRule getRule (int rule) const
 
bool hasVelocity () const
 
UT_Vector3F getLinearVelocity () const
 
UT_Vector3F getAngularVelocity () const
 

Protected Member Functions

void updateRulesArray ()
 Updates the internal array of rules when the iterator shifts position. More...
 

Protected Attributes

GA_ROHandleS myInstName
 
GA_ROHandleF myInstFrame
 
GA_ROHandleV3 myInstPos
 
GA_ROHandleV4 myInstOrient
 
GA_ROHandleV3 myInstPivot
 
bool myNeedRules
 
GA_ROHandleDictA myInstRules
 
UT_Array< UT_OptionsHoldermyRulesArray
 
bool myNeedVelocity
 
GA_ROHandleV3 myInstLinV
 
GA_ROHandleV3 myInstAngV
 
GA_Iterator myIterator
 

Detailed Description

This class can be used to iterate over source instances in the given geometry.

Definition at line 156 of file SIM_VolumeInstanceSource.h.

Constructor & Destructor Documentation

SIM_SourceInstanceIterator::SIM_SourceInstanceIterator ( bool  need_rules = true,
bool  need_vel = false 
)

Creates an invalid iterator. setGeometry() must be called before this iterator can be used. need_rules must be true if source rules will be required later. need_vel must be true if instance velocities are required.

SIM_SourceInstanceIterator::SIM_SourceInstanceIterator ( const GA_Detail gdp,
bool  need_rules = true,
bool  need_vel = false 
)

Creates the iterator and initializes it for the given geometry. need_rules must be true if source rules will be required later. need_vel must be true if instance velocities are required.

Member Function Documentation

void SIM_SourceInstanceIterator::advance ( )

Advances the iterator to the next instance.

bool SIM_SourceInstanceIterator::atEnd ( ) const

Returns true if and only if the iterator is at the ned of the list of instances.

UT_Vector3F SIM_SourceInstanceIterator::getAngularVelocity ( ) const

Returns angular velocity of this instance. The iterator needs to be told on creation that velocities are needed to use this method.

fpreal32 SIM_SourceInstanceIterator::getFrameOffset ( ) const

Returns the frame offset for the current instance.

UT_Vector3F SIM_SourceInstanceIterator::getLinearVelocity ( ) const

Returns linear velocity of this instance. The iterator needs to be told on creation that velocities are needed to use this method.

UT_StringHolder SIM_SourceInstanceIterator::getName ( ) const

Returns the name of the current instance.

int SIM_SourceInstanceIterator::getNumberOfRules ( ) const

Get the number of rules that the current instance prescribes. The iterator needs to be told on creation that rules are needed to use this method.

UT_QuaternionF SIM_SourceInstanceIterator::getOrientation ( ) const

Returns the orientation of the current instance.

UT_Vector3F SIM_SourceInstanceIterator::getPivot ( ) const

Returns the pivot of the current instance.

UT_Vector3F SIM_SourceInstanceIterator::getPosition ( ) const

Returns the position for the current instance.

SIM_SourceRule SIM_SourceInstanceIterator::getRule ( int  rule) const

Get a specific rule for the current instance. rule is the index of to acquire, and must be between 0 and getNumberOfRules()-1 (inclusive). The iterator needs to be told on creation that rules are needed to use this method.

bool SIM_SourceInstanceIterator::hasVelocity ( ) const

Do the instances have linear or angular velocity? Will return false if this iterator was told velocities aren't needed on creation.

bool SIM_SourceInstanceIterator::isValid ( ) const

Returns true if and only if this iterator is valid. That is, if the instance geometry has all of the required attributes.

void SIM_SourceInstanceIterator::rewind ( )

Restarts the iterator. Must be called to start iteration.

void SIM_SourceInstanceIterator::setGeometry ( const GA_Detail gdp)

Initializes this iterator for the given geometry.

void SIM_SourceInstanceIterator::updateRulesArray ( )
protected

Updates the internal array of rules when the iterator shifts position.

Member Data Documentation

GA_ROHandleV3 SIM_SourceInstanceIterator::myInstAngV
protected

Definition at line 233 of file SIM_VolumeInstanceSource.h.

GA_ROHandleF SIM_SourceInstanceIterator::myInstFrame
protected

Definition at line 221 of file SIM_VolumeInstanceSource.h.

GA_ROHandleV3 SIM_SourceInstanceIterator::myInstLinV
protected

Definition at line 232 of file SIM_VolumeInstanceSource.h.

GA_ROHandleS SIM_SourceInstanceIterator::myInstName
protected

Definition at line 220 of file SIM_VolumeInstanceSource.h.

GA_ROHandleV4 SIM_SourceInstanceIterator::myInstOrient
protected

Definition at line 223 of file SIM_VolumeInstanceSource.h.

GA_ROHandleV3 SIM_SourceInstanceIterator::myInstPivot
protected

Definition at line 224 of file SIM_VolumeInstanceSource.h.

GA_ROHandleV3 SIM_SourceInstanceIterator::myInstPos
protected

Definition at line 222 of file SIM_VolumeInstanceSource.h.

GA_ROHandleDictA SIM_SourceInstanceIterator::myInstRules
protected

Definition at line 227 of file SIM_VolumeInstanceSource.h.

GA_Iterator SIM_SourceInstanceIterator::myIterator
protected

Definition at line 235 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceInstanceIterator::myNeedRules
protected

Definition at line 226 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceInstanceIterator::myNeedVelocity
protected

Definition at line 231 of file SIM_VolumeInstanceSource.h.

UT_Array<UT_OptionsHolder> SIM_SourceInstanceIterator::myRulesArray
protected

Definition at line 229 of file SIM_VolumeInstanceSource.h.


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