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

#include <SIM_Object.h>

+ Inheritance diagram for SIM_Object:

Public Types

enum  SIM_SolveState { SIM_UNSOLVED, SIM_SOLVING, SIM_FEEDBACK, SIM_SOLVED }
 This enumeration defines the possible solve states for an object. More...
 

Public Member Functions

int getObjectId () const
 
void setName (const char *name)
 
bool getIsBaked () const
 
bool getAllowCaching () const
 
void setAllowCaching (bool allowcaching)
 
bool getSolveFirstFrame () const
 
void getAffectors (SIM_ObjectArray &affobjs, const char *relationshiptype)
 
void getConstAffectors (SIM_ConstObjectArray &affobjs, const char *relationshiptype) const
 
bool getIsAffector (const SIM_Object *affector, const char *relationshiptype) const
 
void getColliderInfo (SIM_ColliderInfoArray &colliderinfo) const
 
void getColliderInfoTokenString (UT_TokenString &ts) const
 
const SIM_SolveStategetSolveState () const
 Returns the current solved state of this object. More...
 
const SIM_SolvergetSolver () const
 
const SIM_PositiongetPosition () const
 
const SIM_GeometrygetGeometry () const
 
const SIM_PhysicalParmsgetPhysicalParms () const
 
const SIM_ColliderLabelgetColliderLabel () const
 
void getColliderLabel (UT_String &label) const
 
const SIM_RelationshipArraygetRelationships (bool ingroup)
 
int getNumRelationships (bool ingroup) const
 Returns the number of relationships to which this object belongs. More...
 
const SIM_RelationshipgetRelationship (bool ingroup, int index) const
 
const SIM_RelationshipgetRelationship (bool ingroup, const char *name) const
 
void filterConstRelationships (bool ingroup, const SIM_DataFilter &filter, SIM_ConstDataArray &rels) const
 
bool getIsSubStepObject () const
 
bool getIsStatic () const
 
bool getIsIntangible () const
 
SIM_MetaObject * getMetaObject () const
 
const SIM_CollidergetCollider (const SIM_Object &affector, const char *defaultlabel=0) const
 
void preserveImpacts (SIM_Engine &engine)
 
void rollbackImpacts (SIM_Engine &engine)
 
UT_Vector3 getLocalVelocityAtPosition (const UT_Vector3 &localspacepos, bool usesdfhistory, bool usegeohistory) const
 
UT_Vector3 getVelocityAtPosition (const UT_Vector3 &worldspacepos, bool usesdfhistory, bool usegeohistory, fpreal integrateovertime=0.0) const
 
SIM_PropertyResolvergetVelocityAtPositionResolver (bool usesdfhistory, bool usegeohistory, fpreal integrateovertime=0.0) const
 
fpreal getPropertyAtPosition (const UT_Vector3 &wpos, const SIM_Property &property) const
 
fpreal getPropertyAtPoint (GA_Index ptnum, const SIM_Property &property) const
 
SIM_PropertyResolvergetPropertyResolver (const SIM_Property &property) const
 
UT_Vector3 getVelocityAtPoint (GA_Index ptnum, const SIM_Geometry *geo=0) const
 
UT_Vector3 getPositionOfPoint (GA_Index ptnum, const SIM_Geometry *geo=0) const
 Gets the simulation space position of a point on our geometry. More...
 
GA_Index getNearestPoint (const UT_Vector3 &wspos) const
 Returns the point number closest to a world space position. More...
 
SIM_PropertyResolvergetNearestPointAttribResolver (const char *attribname) const
 
bool getPointAttribute (GA_Index ptnum, const char *attrib, fpreal &value) const
 
const SIM_PositiongetPositionForGeometry (const char *geo) const
 
SIM_ObjectSolveInfogetSolveInfo () const
 Returns the object-specific solve info for this object. More...
 
- Public Member Functions inherited from SIM_RootData
const UT_StringgetName () const
 
bool getMatchesString (const char *pattern) const
 
void getRootDataId (SIM_RootDataId &id) const
 Fills out the root data identifier by calling getRootDataIdSubclass(). More...
 
- Public Member Functions inherited from SIM_Data
const UT_StringHoldergetDataType () const
 
void initialize (const SIM_SubdataBehavior &subdatabehavior)
 
void makeEqual (const SIM_Data *source, const SIM_SubdataBehavior &subdatabehavior)
 
void setParameters (const SIM_Options &parms)
 
void interpolate (const SIM_Data *source1, const SIM_Data *source2, fpreal interp)
 
int64 getMemorySize () const
 
bool getIsAlternateRepresentation () const
 
bool saveToFile (const char *filename, UT_CompressionType compressionType) const
 
bool saveToStream (std::ostream &os, UT_CompressionType compressionType) const
 
void appendFullDataPath (const SIM_Data *subdata, bool useobjectid, UT_String &datapath) const
 
bool loadFromFile (const char *filename)
 
bool loadFromStream (UT_IStream &is, bool skiptype=false)
 
bool getIsOfType (const UT_StringRef &datatype) const
 
const voidgetConstPointerToType (const UT_StringRef &datatype) const
 
voidgetPointerToType (const UT_StringRef &datatype)
 
int getNumSubData () const
 Get the number of sub-data items attached to this data. More...
 
const UT_StringHoldergetSubDataName (int index) const
 Get the name of the sub-data at a particular index location. More...
 
int getSubDataIndex (const SIM_Data *subdata) const
 
bool buildSubDataPath (const SIM_Data *subdata, UT_String &pathto) const
 
const SIM_QuerygetQueryObject () const
 
SIM_OptionsgetUserOptions ()
 
const SIM_OptionsgetConstUserOptions () const
 
long getGuideParmVersion () const
 
void addGuideDep (DEP_MicroNode &src) const
 
virtual bool getGuideGeometryList (const SIM_RootData &root, const char *datapath, const SIM_Time &t, UT_Array< GU_ConstDetailHandle > &detailArray, UT_Array< UT_DMatrix4 > &xformArray) const
 
GU_ConstDetailHandle getGuideGeometry (const SIM_RootData &root, const char *datapath, UT_DMatrix4 &xform, const SIM_Time &t) const
 
void buildGuideOptions (SIM_Options &options, const SIM_Time &time) const
 
SIM_DatagetSubData (int index)
 
const SIM_DatagetConstSubData (int index) const
 
SIM_DatagetNamedSubData (const char *dataname)
 
const SIM_DatagetConstNamedSubData (const char *dataname) const
 
void filterSubData (SIM_DataArray &ncdp, UT_StringArray *names, const SIM_DataFilter &ncfilter, const char *startfrom, const SIM_DataFilter &recursefilter)
 
void filterConstSubData (SIM_ConstDataArray &dp, UT_StringArray *names, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurseFilter) const
 
SIM_DatagetNthSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurseFilter)
 
const SIM_DatagetNthConstSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurseFilter) const
 
void forEachSubData (SIM_EachDataCallback &cb, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurseFilter)
 
void forEachConstSubData (SIM_EachDataCallback &cb, const SIM_DataFilter &filter, const char *startfrom, const SIM_DataFilter &recurseFilter) const
 
SIM_DatacreateNamedSubData (const char *dataname, const char *datatype, int creationflags, UT_String *newdatanameptr=NULL)
 
SIM_DatagetOrCreateAlternateRepresentation (const char *dataname, const char *datatype) const
 
void interpolateSubData (const SIM_Data &source1, const SIM_Data &source2, fpreal interp, const SIM_DataFilter &interpdata, const SIM_DataFilter &recurse)
 
void setNamedSubData (const char *dataname, const SIM_Data *data, int setflags)
 
void createUniqueSubDataName (const SIM_Data *subdata, UT_String &dataname) const
 
void removeNamedSubData (const char *dataname)
 Remove some existing sub-data by name. More...
 
void removeSubData (int index)
 Remove some existing sub-data by index. More...
 
void moveNamedSubData (const char *oldname, const char *newname)
 
const UT_GuidgetUniqueId () const
 
long getReferenceCount () const
 
int getCreatorId () const
 Get the ID of the node that created this data. More...
 
OP_NodegetCreatorNode () const
 Use the creator ID to look up the OP_Node that created this data. More...
 
OP_NodegetOwnerNetwork () const
 Look up the owner node of our engine to get the DOP Network pointer. More...
 
const SIM_EnginegetEngine () const
 Get the engine that created us (from our data factory). More...
 
int getCreatorIndex () const
 Get the output index of the creator node that generated this data. More...
 
const SIM_TimegetCreationTime () const
 Get the creation time for this data. More...
 
bool getIsSelected () const
 Get the selected flag for this data. More...
 
void setIsSelected (bool selected) const
 
bool getSelectionRepresentsObject () const
 
void copyCreationInfoFrom (const SIM_Data *source)
 
OP_NodegetNodePathsRelativeTo () const
 
OP_NodegetOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return an OBJ_Node. More...
 
OBJ_NodegetOBJNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return an OBJ_Node. More...
 
SOP_NodegetSOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a SOP_Node. More...
 
DOP_NodegetDOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a DOP_Node. More...
 
COP2_NodegetCOP2Node (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a COP2_Node. More...
 
CHOP_NodegetCHOPNode (const char *path, bool addinterest) const
 Given a path relative to our creator node, return a CHOP_Node. More...
 
void addOPInterest (OP_Node *node) const
 Adds an interest in the specified node to our engine's owner node. More...
 
void addError (const SIM_RootData *root, int errorcode, const char *errorparm, UT_ErrorSeverity severity) const
 Adds an error to our SIM_Engine. More...
 
void makeMemberDataUnique ()
 
virtual void makeMemberDataUniqueSubclass ()
 

Protected Member Functions

 SIM_Object (const SIM_SimulationState *factory)
 The constructor for a new simulation object. More...
 
 ~SIM_Object () override
 The object destructor. More...
 
void initializeSubclass () override
 Clears all attached data. More...
 
void makeEqualSubclass (const SIM_Data *source) override
 Makes two objects equal, but not their names or object ids. More...
 
void saveSubclass (std::ostream &os) const override
 Saves an object to a stream. More...
 
bool loadSubclass (UT_IStream &is) override
 Loads an object from a stream. More...
 
void setNamedSubDataSubclass (const char *dataname, const SIM_Data *data) override
 Caches the solver, collider, and position data for quick access. More...
 
void removeNamedSubDataSubclass (const char *dataname) override
 Clears the solver, collider, and position cached pointers. More...
 
SIM_QuerycreateQueryObjectSubclass () const override
 Creates a query object for getting SIM_Object-specific information. More...
 
void interpolateSubclass (const SIM_Data *source1, const SIM_Data *source2, fpreal interp) override
 Overrides interpolateSubclass() to set our interpolated flag. More...
 
int64 getMemorySizeSubclass () const override
 Get the amount of memory used by this object. More...
 
void getRootDataIdSubclass (SIM_RootDataId &id) const override
 Override the SIM_RootData function for getting our identifier. More...
 
bool getMatchesStringSubclass (const char *pattern) const override
 Override the SIM_RootData function for matching us to a string. More...
 
- Protected Member Functions inherited from SIM_RootData
 SIM_RootData (const SIM_DataFactory *factory)
 
 ~SIM_RootData () override
 
- Protected Member Functions inherited from SIM_Data
 SIM_Data (const SIM_DataFactory *factory)
 
virtual ~SIM_Data ()
 
void handleModification (int code=-1)
 
void setNeedsToRecalculateMemorySize () const
 
void deleteQueryObjectIfNotBuilding () const
 Deletes the query object for this data, if there is one. More...
 
void deleteGuideObjectIfNotBuilding () const
 Delete the guide geometry for this data, if it exists. More...
 
void initAlternateRepresentation () const
 
void setNeedsInitialization (bool needsinit) const
 Flags an alternate representation subdata as requiring initialization. More...
 
bool getNeedsInitialization () const
 Tests whether an alternate representation requires initialization. More...
 
bool saveOptionPacket (std::ostream &os, const char *name, const SIM_Options *opts) const
 
bool loadOptionPacket (UT_IStream &is, const char *name, SIM_Options *opts) const
 
bool getIsDoingSimplifiedSaveLoad () const
 
void initializeFromParmDefaults ()
 
void setSelectionRepresentsObject (bool representsobject)
 
virtual void setNeedsInitializationSubclass (bool needsinit) const
 
virtual void saveIOSubclass (std::ostream &os, SIM_DataThreadedIO *io) const
 
virtual bool loadIOSubclass (UT_IStream &is, SIM_DataThreadedIO *io)
 
virtual long getGuideParmVersionSubclass () const
 
virtual SIM_GuidecreateGuideObjectSubclass () const
 
virtual void buildGuideGeometrySubclass (const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const
 
virtual void setParametersSubclass (const SIM_Options &parms)
 
virtual void handleModificationSubclass (int code)
 
virtual bool getIsAlternateRepresentationSubclass () const
 
virtual void initAlternateRepresentationSubclass (const SIM_Data &)
 
virtual voidgetCastToType (const UT_StringRef &datatype) const
 
virtual const UT_StringHoldergetDataTypeSubclass () const
 
const SIM_DatagetAlternateRepresentationOf () const
 

Friends

class SIM_SimulationState
 
class SIM_Relationship
 
class SIM_ObjectSolveInfo
 

Additional Inherited Members

- Static Public Member Functions inherited from SIM_RootData
static void forceValidRootDataName (UT_String &rootdataname)
 
- Static Public Member Functions inherited from SIM_Data
static bool getDataTypeFromFile (const char *filename, UT_String &datatype)
 
static bool getDataTypeFromStream (UT_IStream &is, UT_String &datatype)
 
static const voidcastConstPointerToType (const SIM_Data *data, const UT_StringRef &datatype)
 
static voidcastPointerToType (SIM_Data *data, const UT_StringRef &datatype)
 
- Static Protected Member Functions inherited from SIM_Data
static const PRM_TemplategetEmptyTemplateList ()
 
static const SIM_DopDescriptiongetEmptyDopDescription ()
 A DOP description that says not to create an automatic DOP. More...
 
static void getDataTypeSuperclasses (UT_StringArray &)
 
- Protected Attributes inherited from SIM_RootData
UT_String myName
 

Detailed Description

This class is a simple container for all the data that is used to represent an object in a simulation. Each piece of data has a name and can be of any type that is subclassed from SIM_Data.

Examples:
SIM/GAS_NetVDBSliceExchange.C, SIM/GAS_NetVDBSliceExchange.h, SIM/SIM_ForceOrbit.C, SIM/SIM_ForceOrbit.h, SIM/SIM_GasAdd.C, SIM/SIM_GasAdd.h, SIM/SIM_RadialEmit.C, SIM/SIM_RadialEmit.h, SIM/SIM_SolverHair.C, SIM/SIM_SolverHair.h, SIM/SNOW_Solver.C, and SIM/SNOW_Solver.h.

Definition at line 33 of file SIM_Object.h.

Member Enumeration Documentation

This enumeration defines the possible solve states for an object.

Enumerator
SIM_UNSOLVED 
SIM_SOLVING 
SIM_FEEDBACK 
SIM_SOLVED 

Definition at line 80 of file SIM_Object.h.

Constructor & Destructor Documentation

SIM_Object::SIM_Object ( const SIM_SimulationState factory)
explicitprotected

The constructor for a new simulation object.

SIM_Object::~SIM_Object ( )
overrideprotected

The object destructor.

Member Function Documentation

SIM_Query* SIM_Object::createQueryObjectSubclass ( ) const
overrideprotectedvirtual

Creates a query object for getting SIM_Object-specific information.

Reimplemented from SIM_Data.

void SIM_Object::filterConstRelationships ( bool  ingroup,
const SIM_DataFilter filter,
SIM_ConstDataArray rels 
) const

Gets all the relationships of a particular type. The type of a relationship is defined by the one subdata on the SIM_Relationship.

void SIM_Object::getAffectors ( SIM_ObjectArray affobjs,
const char *  relationshiptype 
)

Returns the affector information for this object. The returned array contains a list of all objects that affect this object.

bool SIM_Object::getAllowCaching ( ) const

Returns true if the object allows cachine. Uncached objects will not persist in the cache.

const SIM_Collider* SIM_Object::getCollider ( const SIM_Object affector,
const char *  defaultlabel = 0 
) const

Returns a pointer to a SIM_Collider that should be used to do collision detection between this object and the supplied affector object. This function should be called only if the SIM_ColliderInfo for this affector object did not specify a SIM_Collider to use. The return value from this function can be null, in which case no collision detection should be done between the objects.

The method for determining the SIM_Collider to use is as follows: First, we look at the collider label for the affector, and look for SIM_Collider subdata on the SIM_ColliderLabel of this object with a name that matches the affector's collider label. If a SIM_Collider is found with that subdata name, we return that collider. Otherwise, we go to the solver attached to this object. The SIM_Solver::getDefaultCollider() function is called, passing in this object, the affector object's collider label. This function returns the name of the SIM_Collider subclass we should use based on the needs of the solver. We then create subdata on the solver itself, and attach a SIM_Collider of the requested type. Then we return a pointer to this new collider.

For the special case of self-collision, the collider label of the affector is replaced with SIM_COLLIDERLABEL_SELF, which allows the solver and the collider label data to treat self-collision as a special case. In some cases this means using a spcial SIM_Collider, and in other cases it means returning null and skipping collision detection altogether (e.g. the RBD Solver doesn't do self-collision detection).

void SIM_Object::getColliderInfo ( SIM_ColliderInfoArray colliderinfo) const

Gets an array of objects we will collide with, what collider to use, and how to apply impact data to those objects.

void SIM_Object::getColliderInfoTokenString ( UT_TokenString ts) const

Fills a UT_TokenString with enough information to uniquely determine what the SIM_ColliderInfoArray for this object will contain. This lets use very quickly determine if two objects will have the same array of collider infos.

const SIM_ColliderLabel* SIM_Object::getColliderLabel ( ) const

Returns our cached SIM_ColliderLabel pointer. This function is equivalent to but much faster than using the SIM_DATA_GETCONST() macro.

void SIM_Object::getColliderLabel ( UT_String label) const

Gets the actual collider label string from our collider label subdata. If we have no collider label subdata, our solver is queried to get the default collider label for an object handled by that solver.

void SIM_Object::getConstAffectors ( SIM_ConstObjectArray affobjs,
const char *  relationshiptype 
) const

Returns the affector information for this object. The returned array contains a const list of all objects that affect this object.

const SIM_Geometry* SIM_Object::getGeometry ( ) const

Returns our cached SIM_Geometry pointer. This function is equivalent to but much faster than using the SIM_DATA_GETCONST() macro.

Examples:
SIM/SIM_SolverHair.C, and SIM/SNOW_Solver.C.
bool SIM_Object::getIsAffector ( const SIM_Object affector,
const char *  relationshiptype 
) const

Returns true if the supplied object is an affector of this object. Checking this way is faster than building a full affector list and comparing against that.

bool SIM_Object::getIsBaked ( ) const

Returns true if the object's baked flag is set. This flag indicates that the object was loaded from a file or merged from another simulation.

bool SIM_Object::getIsIntangible ( ) const

Returns true if the object is marked as intangible, ie, should ignore all auto-relationships from merge nodes and only deal with explicit merges.

bool SIM_Object::getIsStatic ( ) const

Returns false if the object is either a baked object (because it was loaded from a file) or it is passive.

bool SIM_Object::getIsSubStepObject ( ) const

Returns whether or not this object is a substep object. This is true for both temporary interpolated objects created with SIM_Engine::getObjectAtTime() and substep objects explicitly created with SIM_Engine::createSubStepObject().

UT_Vector3 SIM_Object::getLocalVelocityAtPosition ( const UT_Vector3 localspacepos,
bool  usesdfhistory,
bool  usegeohistory 
) const

Gets the velocity of a point in the space local to an object. The returned velocity is also in local space. There are two methods that can be used to calculate the velocity. The first method uses the SDF representing the geometry at the previous time step compared to the current time step. The second method uses the velocity point attribute attached to the geometry. If no velocity attribute is found, the geometry at this time step is compared to the geometry at the previous time step to calculate the velocity for each point.

bool SIM_Object::getMatchesStringSubclass ( const char *  pattern) const
overrideprotectedvirtual

Override the SIM_RootData function for matching us to a string.

Implements SIM_RootData.

int64 SIM_Object::getMemorySizeSubclass ( ) const
overrideprotectedvirtual

Get the amount of memory used by this object.

Reimplemented from SIM_Data.

SIM_MetaObject* SIM_Object::getMetaObject ( ) const

Gets the meta-object pointer for this object. The meta-object is a value that is used only by the SIM_Engine.

GA_Index SIM_Object::getNearestPoint ( const UT_Vector3 wspos) const

Returns the point number closest to a world space position.

SIM_PropertyResolver* SIM_Object::getNearestPointAttribResolver ( const char *  attribname) const

Returns a resolver to lookup the closest point and extract the given attribute. If attribute not found, 1.0 is returned.

int SIM_Object::getNumRelationships ( bool  ingroup) const

Returns the number of relationships to which this object belongs.

int SIM_Object::getObjectId ( ) const

Returns the unique identifier for the object. This identifier is unique for the duration of a simulation and will not be reused even if the object is deleted.

const SIM_PhysicalParms* SIM_Object::getPhysicalParms ( ) const

Returns our cached SIM_PhysicalParms pointer. This function is equivalent to but much faster than using the SIM_DATA_GETCONST() macro.

bool SIM_Object::getPointAttribute ( GA_Index  ptnum,
const char *  attrib,
fpreal value 
) const

Fetches the value of the supplied point attribute from our geometry. Returns true if the attribute was found, otherwise it returns false. The attribute must be a simple float attribute.

const SIM_Position* SIM_Object::getPosition ( ) const

Returns our cached SIM_Position pointer. This function is equivalent to but much faster than using the SIM_DATA_GETCONST() macro.

Examples:
SIM/SNOW_Solver.C.
const SIM_Position* SIM_Object::getPositionForGeometry ( const char *  geo) const

Fetches the SIM_Position data associated with the geometry data at the supplied location. This uses the SIM_NAME_POSITIONPATH relative path to find the SIM_Position that the data refers to. Supported data are SIM_Geometry and SIM_*Field.

UT_Vector3 SIM_Object::getPositionOfPoint ( GA_Index  ptnum,
const SIM_Geometry geo = 0 
) const

Gets the simulation space position of a point on our geometry.

fpreal SIM_Object::getPropertyAtPoint ( GA_Index  ptnum,
const SIM_Property property 
) const

Gets the value of some physical property for the supplied object at a given point on the object's geometry. This function calls SIM_Solver::getPropertyAtPoint().

fpreal SIM_Object::getPropertyAtPosition ( const UT_Vector3 wpos,
const SIM_Property property 
) const

Gets the value of some physical property for the supplied object at a given position in world space. This function calls SIM_Solver::getPropertyAtPosition().

SIM_PropertyResolver* SIM_Object::getPropertyResolver ( const SIM_Property property) const

Returns a resolver for efficiently computing property values The caller must delete the returned object.

const SIM_Relationship* SIM_Object::getRelationship ( bool  ingroup,
int  index 
) const

This function allows looping through the relationships for an object. This is a const function, so it returns a const SIM_Relationship.

const SIM_Relationship* SIM_Object::getRelationship ( bool  ingroup,
const char *  name 
) const

Get the relationship for this object with a particular name. Because This is a const function, so it returns a const SIM_Relationship.

const SIM_RelationshipArray& SIM_Object::getRelationships ( bool  ingroup)

Get a const reference to our array of relationships. Note that even though the returned array is const, it's members are non-const, and so the SIM_Relationship data can be modified. Thus this must be a non-const function on SIM_Object.

void SIM_Object::getRootDataIdSubclass ( SIM_RootDataId id) const
overrideprotectedvirtual

Override the SIM_RootData function for getting our identifier.

Implements SIM_RootData.

bool SIM_Object::getSolveFirstFrame ( ) const

Returns true if the object was created with the solve first frame flag turned on.

SIM_ObjectSolveInfo* SIM_Object::getSolveInfo ( ) const

Returns the object-specific solve info for this object.

const SIM_Solver* SIM_Object::getSolver ( ) const

Returns our cached SIM_Solver pointer. This function is equivalent to but much faster than using the SIM_DATA_GETCONST() macro.

const SIM_SolveState& SIM_Object::getSolveState ( ) const

Returns the current solved state of this object.

UT_Vector3 SIM_Object::getVelocityAtPoint ( GA_Index  ptnum,
const SIM_Geometry geo = 0 
) const

Gets the velocity of a point on the object specified by a point number. The returned velocity is in world space. If a velocity point attribute exists, that value is used as the local velocity.

UT_Vector3 SIM_Object::getVelocityAtPosition ( const UT_Vector3 worldspacepos,
bool  usesdfhistory,
bool  usegeohistory,
fpreal  integrateovertime = 0.0 
) const

Gets the velocity of a point on the object specified in world space. The returned velocity is also in world space. The two boolean values specify what method should be used to determine the local space portion of the velocity. If both these values are false, no local velocity component is calculated and it is assumed that the geometry attached to the object is static.

SIM_PropertyResolver* SIM_Object::getVelocityAtPositionResolver ( bool  usesdfhistory,
bool  usegeohistory,
fpreal  integrateovertime = 0.0 
) const

Returns a resolver for efficiently computing velocity values The caller must delete the returned object.

void SIM_Object::initializeSubclass ( )
overrideprotectedvirtual

Clears all attached data.

Reimplemented from SIM_Data.

void SIM_Object::interpolateSubclass ( const SIM_Data source1,
const SIM_Data source2,
fpreal  interp 
)
overrideprotectedvirtual

Overrides interpolateSubclass() to set our interpolated flag.

Reimplemented from SIM_Data.

bool SIM_Object::loadSubclass ( UT_IStream is)
overrideprotectedvirtual

Loads an object from a stream.

Reimplemented from SIM_Data.

void SIM_Object::makeEqualSubclass ( const SIM_Data source)
overrideprotectedvirtual

Makes two objects equal, but not their names or object ids.

Reimplemented from SIM_Data.

void SIM_Object::preserveImpacts ( SIM_Engine engine)

Stores impacts information from the temporary locations to the permanent locations. Copies impact information from the SIM_NEWIMPACTS_DATANAME data into SIM_IMPACTS_DATANAME, and from SIM_NEWFEEDBACK_DATANAME to SIM_FEEDBACK_DATANAME. Then the NEW impact data is removed. This should be called after a set of new impacts have been processed successfully.

void SIM_Object::removeNamedSubDataSubclass ( const char *  dataname)
overrideprotectedvirtual

Clears the solver, collider, and position cached pointers.

Reimplemented from SIM_Data.

void SIM_Object::rollbackImpacts ( SIM_Engine engine)

Eliminates any temporary impact data. Temporary impacts data is stored in SIM_Impacts data named SIM_NEWIMPACTS_DATANAME and SIM_NEWFEEDBACK_DATANAME. Unlike preserveImpacts(), which copies the data into SIM_IMPACTS_DATANAME and SIM_FEEDBACK_DATANAME, this function simply deletes the data. This funciton should be called when rolling back a substep.

void SIM_Object::saveSubclass ( std::ostream &  os) const
overrideprotectedvirtual

Saves an object to a stream.

Reimplemented from SIM_Data.

void SIM_Object::setAllowCaching ( bool  allowcaching)
void SIM_Object::setName ( const char *  name)

Sets the name ofthe object to a new value. This value does not need to be unique. If the value is not a valid object name (e.g. it contains spaces or other invalid characters), this function modifies the name to make it valid.

void SIM_Object::setNamedSubDataSubclass ( const char *  dataname,
const SIM_Data data 
)
overrideprotectedvirtual

Caches the solver, collider, and position data for quick access.

Reimplemented from SIM_Data.

Friends And Related Function Documentation

friend class SIM_ObjectSolveInfo
friend

Definition at line 345 of file SIM_Object.h.

friend class SIM_Relationship
friend

Definition at line 344 of file SIM_Object.h.

friend class SIM_SimulationState
friend

Definition at line 343 of file SIM_Object.h.


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