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

This class encapsulates a volume merging rule. More...

#include <SIM_VolumeInstanceSource.h>

Public Types

enum  FieldRank { SCALAR = 0, VECTOR }
 
enum  SourceOperation {
  COPY = 0, ADD, SUBTRACT, MULTIPLY,
  DIVIDE, MAXIMUM, MINIMUM, AVERAGE,
  PULL, BLEND, NONE
}
 

Public Member Functions

 SIM_SourceRule ()
 Creates a default, invalid rule. More...
 
void createFromDictionary (const UT_OptionsHolder &dict)
 
fpreal32 getScale (fpreal32 timestep) const
 Returns the scale that takes timestep normalization into account. More...
 
fpreal32 getAccGuideBlend (fpreal32 timestep) const
 
fpreal32 getDecGuideBlend (fpreal32 timestep) const
 
fpreal32 getDirGuideBlend (fpreal32 timestep) const
 
bool needsEntireVector () const
 
void setTimestep (fpreal32 timestep)
 
void applyOperation (fpreal32 source, fpreal32 &dest) const
 
void applyOperation (const UT_Vector3F &source, UT_Vector3F &dest) const
 
void blendValues (fpreal32 source, fpreal32 &dest, fpreal32 source_weight, fpreal32 &dest_weight) const
 
void blendValues (const UT_Vector3F &source, UT_Vector3F &dest, fpreal32 source_weight, fpreal32 &dest_weight) const
 
SIM_SourceRule getWeightUpdateRule () const
 

Public Attributes

FieldRank myRank
 Rank of the target and source fields. More...
 
UT_StringHolder mySourceField
 Name of the source volume. More...
 
UT_StringHolder mySourceWeight
 Name of the source weight volume. More...
 
UT_StringHolder myTargetField
 Name of the target DOP field. More...
 
UT_StringHolder myTargetWeight
 Name of the target DOP weight field. More...
 
SourceOperation myOperation
 The merging operation. More...
 
fpreal32 myAccGuideStr
 Pull strength for acceleration. More...
 
fpreal32 myDecGuideStr
 Pull strength for deceleration. More...
 
fpreal32 myDirGuideStr
 Pull strength for directional guiding. More...
 
fpreal32 myScale
 The final scale applied while merging. More...
 
bool myActivate
 Is the rule active? More...
 
bool myEnableDirBlend
 
bool myUseNorm
 
bool myAddInstanceVel
 
bool myClampZero
 
bool myNormalizeTimestep
 Use the timestep while merging? More...
 
bool myIsValid
 

Protected Attributes

fpreal32 myFinalScale
 Coefficients for internal use. These values incorporate the timestep. More...
 
fpreal32 myFinalAccBlend
 
fpreal32 myFinalDecBlend
 
fpreal32 myFinalDirBlend
 

Detailed Description

This class encapsulates a volume merging rule.

Definition at line 28 of file SIM_VolumeInstanceSource.h.

Member Enumeration Documentation

This enumeration lists the supported field ranks. Token order should match the respective menu.

Enumerator
SCALAR 
VECTOR 

Definition at line 79 of file SIM_VolumeInstanceSource.h.

This enumeration lists the available sourcing operations. Token order should match the respective menu.

Enumerator
COPY 
ADD 
SUBTRACT 
MULTIPLY 
DIVIDE 
MAXIMUM 
MINIMUM 
AVERAGE 
PULL 
BLEND 
NONE 

Definition at line 87 of file SIM_VolumeInstanceSource.h.

Constructor & Destructor Documentation

SIM_SourceRule::SIM_SourceRule ( )

Creates a default, invalid rule.

Member Function Documentation

void SIM_SourceRule::applyOperation ( fpreal32  source,
fpreal32 dest 
) const

Applies the operation encoded in this rule and puts the result in dest. Use blendValues() functions instead if this rule prescribes the BLEND operation.

void SIM_SourceRule::applyOperation ( const UT_Vector3F source,
UT_Vector3F dest 
) const
void SIM_SourceRule::blendValues ( fpreal32  source,
fpreal32 dest,
fpreal32  source_weight,
fpreal32 dest_weight 
) const

Applies the blend operation of this rule and puts the results in dest, dest_weight. Use applyOperation() functions instead if this rule does not prescribe the BLEND operation.

void SIM_SourceRule::blendValues ( const UT_Vector3F source,
UT_Vector3F dest,
fpreal32  source_weight,
fpreal32 dest_weight 
) const
void SIM_SourceRule::createFromDictionary ( const UT_OptionsHolder dict)

Populates the fields of this rule with values from the dictionary. Keys are parameter names from the Volume Source DOP.

fpreal32 SIM_SourceRule::getAccGuideBlend ( fpreal32  timestep) const

Converts the respective pull strength into a blend value, taking the timestep into account.

fpreal32 SIM_SourceRule::getDecGuideBlend ( fpreal32  timestep) const
fpreal32 SIM_SourceRule::getDirGuideBlend ( fpreal32  timestep) const
fpreal32 SIM_SourceRule::getScale ( fpreal32  timestep) const

Returns the scale that takes timestep normalization into account.

SIM_SourceRule SIM_SourceRule::getWeightUpdateRule ( ) const

Returns a source rule to apply the weight update part of this blend operation. The functor's applyOperation method can be used, but the rule may not be fully initialized for other purposes!

bool SIM_SourceRule::needsEntireVector ( ) const

Returns true if this rule needs to work on the entire vector at once (that is, the rule cannot be correctly applied to each component of the vector separately).

void SIM_SourceRule::setTimestep ( fpreal32  timestep)

Initializes the internal coefficients for the given timestep. This function must be called before applyOperation(), blendValues(), or blendValuesNoWeight() functions are useable.

Member Data Documentation

fpreal32 SIM_SourceRule::myAccGuideStr

Pull strength for acceleration.

Definition at line 123 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myActivate

Is the rule active?

Definition at line 132 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myAddInstanceVel

Should instance velocities be added to the source values? Only relevant if rank is set to vector.

Definition at line 142 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myClampZero

Clamp negative numbers to 0 after merging? Only has an effect with the SUBTRACT operation.

Definition at line 145 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myDecGuideStr

Pull strength for deceleration.

Definition at line 125 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myDirGuideStr

Pull strength for directional guiding.

Definition at line 127 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myEnableDirBlend

If using the pull operation with a vector field, independently pull the vector magnitudes and directions towards the goal? If false, each vector component is pulled separately.

Definition at line 136 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myFinalAccBlend
protected

Definition at line 105 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myFinalDecBlend
protected

Definition at line 106 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myFinalDirBlend
protected

Definition at line 107 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myFinalScale
protected

Coefficients for internal use. These values incorporate the timestep.

Definition at line 104 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myIsValid

Was the rule fully initialized? This flag will be false if a critical part of the rule was missing when this rule was created.

Definition at line 151 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myNormalizeTimestep

Use the timestep while merging?

Definition at line 147 of file SIM_VolumeInstanceSource.h.

SourceOperation SIM_SourceRule::myOperation

The merging operation.

Definition at line 121 of file SIM_VolumeInstanceSource.h.

FieldRank SIM_SourceRule::myRank

Rank of the target and source fields.

Definition at line 111 of file SIM_VolumeInstanceSource.h.

fpreal32 SIM_SourceRule::myScale

The final scale applied while merging.

Definition at line 129 of file SIM_VolumeInstanceSource.h.

UT_StringHolder SIM_SourceRule::mySourceField

Name of the source volume.

Definition at line 113 of file SIM_VolumeInstanceSource.h.

UT_StringHolder SIM_SourceRule::mySourceWeight

Name of the source weight volume.

Definition at line 115 of file SIM_VolumeInstanceSource.h.

UT_StringHolder SIM_SourceRule::myTargetField

Name of the target DOP field.

Definition at line 117 of file SIM_VolumeInstanceSource.h.

UT_StringHolder SIM_SourceRule::myTargetWeight

Name of the target DOP weight field.

Definition at line 119 of file SIM_VolumeInstanceSource.h.

bool SIM_SourceRule::myUseNorm

When comparing vectors, use their norms? If false, each component is compared separately.

Definition at line 139 of file SIM_VolumeInstanceSource.h.


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