#include <SIM_Data.h>

Classes | |
| class | SIM_SubDataInfo |
| This class stores information about our subdata if we have any. | |
Public Member Functions | |
| const UT_String & | getDataType () 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) const |
| bool | saveToStream (ostream &os) const |
| bool | loadFromFile (const char *filename) |
| bool | loadFromStream (UT_IStream &is, bool skiptype=false) |
| bool | getIsOfType (const char *datatype) const |
| const void * | getConstPointerToType (const char *datatype) const |
| void * | getPointerToType (const char *datatype) |
| int | getNumSubData () const |
| Get the number of sub-data items attached to this data. | |
| const char * | getSubDataName (int index) const |
| Get the name of the sub-data at a particular index location. | |
| int | getSubDataIndex (const SIM_Data *subdata) const |
| bool | buildSubDataPath (const SIM_Data *subdata, UT_String &pathto) const |
| const SIM_Query & | getQueryObject () const |
| long | getGuideParmVersion () const |
| GU_ConstDetailHandle | getGuideGeometry (const SIM_RootData &root, const char *datapath, UT_DMatrix4 &xform, const SIM_Time &t) const |
| SIM_Data * | getSubData (int index) |
| const SIM_Data * | getConstSubData (int index) const |
| SIM_Data * | getNamedSubData (const char *dataname) |
| const SIM_Data * | getConstNamedSubData (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_Data * | getNthSubData (UT_String *name, const SIM_DataFilter &filter, int n, const char *startfrom, const SIM_DataFilter &recurseFilter) |
| const SIM_Data * | getNthConstSubData (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_Data * | createNamedSubData (const char *dataname, const char *datatype, int creationflags) |
| SIM_Data * | getOrCreateAlternateRepresentation (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. | |
| void | removeSubData (int index) |
| Remove some existing sub-data by index. | |
| void | moveNamedSubData (const char *oldname, const char *newname) |
| const UT_Guid & | getUniqueId () const |
| long | getReferenceCount () const |
| int | getCreatorId () const |
| Get the ID of the node that created this data. | |
| OP_Node * | getCreatorNode () const |
| Use the creator ID to look up the OP_Node that created this data. | |
| OP_Node * | getOwnerNetwork () const |
| Look up the owner node of our engine to get the DOP Network pointer. | |
| int | getCreatorIndex () const |
| Get the output index of the creator node that generated this data. | |
| const SIM_Time & | getCreationTime () const |
| Get the creation time for this data. | |
| bool | getIsSelected () const |
| Get the selected flag for this data. | |
| void | setIsSelected (bool selected) const |
| bool | getSelectionRepresentsObject () const |
| void | copyCreationInfoFrom (const SIM_Data *source) |
| OP_Node & | getNodePathsRelativeTo () const |
| OP_Node * | getOPNode (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return an OBJ_Node. | |
| OBJ_Node * | getOBJNode (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return an OBJ_Node. | |
| SOP_Node * | getSOPNode (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return a SOP_Node. | |
| POP_Node * | getPOPNode (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return a POP_Node. | |
| DOP_Node * | getDOPNode (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return a DOP_Node. | |
| COP2_Node * | getCOP2Node (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return a COP2_Node. | |
| CHOP_Node * | getCHOPNode (const char *path, bool addinterest) const |
| Given a path relative to our creator node, return a CHOP_Node. | |
| void | addOPInterest (OP_Node *node) const |
| Adds an interest in the specified node to our engine's owner node. | |
| void | addError (const SIM_RootData *root, int errorcode, const char *errorparm, UT_ErrorSeverity severity) const |
| Adds an error to our SIM_Engine. | |
Static Public Member Functions | |
| static bool | getDataTypeFromFile (const char *filename, UT_String &datatype) |
| static bool | getDataTypeFromStream (UT_IStream &is, UT_String &datatype) |
| static const void * | castConstPointerToType (const SIM_Data *data, const char *datatype) |
| static void * | castPointerToType (SIM_Data *data, const char *datatype) |
Protected Member Functions | |
| SIM_Data (const SIM_DataFactory *factory) | |
| virtual | ~SIM_Data () |
| const SIM_Engine & | getEngine () const |
| Get the engine that created us (from our data factory). | |
| void | handleModification (int code=-1) |
| void | setNeedsToRecalculateMemorySize () const |
| void | deleteQueryObjectIfNotBuilding () const |
| Deletes the query object for this data, if there is one. | |
| void | deleteGuideObjectIfNotBuilding () const |
| Delete the guide geometry for this data, if it exists. | |
| void | initAlternateRepresentation () const |
| void | setNeedsInitialization (bool needsinit) const |
| Flags an alternate representation subdata as requiring initialization. | |
| bool | getNeedsInitialization () const |
| Tests whether an alternate representation requires initialization. | |
| bool | saveOptionPacket (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 | buildGuideOptions (SIM_Options &options, const SIM_Time &time) const |
| void | setSelectionRepresentsObject (bool representsobject) |
| virtual void | initializeSubclass () |
| virtual void | makeEqualSubclass (const SIM_Data *source) |
| virtual void | saveSubclass (ostream &os) const |
| virtual bool | loadSubclass (UT_IStream &is) |
| virtual SIM_Query * | createQueryObjectSubclass () const |
| virtual long | getGuideParmVersionSubclass () const |
| virtual SIM_Guide * | createGuideObjectSubclass () 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 | setNamedSubDataSubclass (const char *dataname, const SIM_Data *data) |
| virtual void | removeNamedSubDataSubclass (const char *dataname) |
| virtual void | interpolateSubclass (const SIM_Data *source1, const SIM_Data *source2, fpreal interp) |
| virtual int64 | getMemorySizeSubclass () const |
| virtual void | handleModificationSubclass (int code) |
| virtual bool | getIsAlternateRepresentationSubclass () const |
| virtual void | initAlternateRepresentationSubclass (const SIM_Data &) |
| virtual void * | getCastToType (const char *datatype) const |
| virtual const UT_String & | getDataTypeSubclass () const |
Static Protected Member Functions | |
| static const PRM_Template * | getEmptyTemplateList () |
| static const SIM_DopDescription * | getEmptyDopDescription () |
| A DOP description that says not to create an automatic DOP. | |
Friends | |
| class | SIM_DataFactory |
| class | SIM_SimulationState |
| class | SIM_OptionsUser |
| class | SIM_Guide |
ROP/ROP_DopField.C, SIM/SIM_ElectricalProperties.h, SIM/SIM_SolverHair.C, SIM/SNOW_Solver.C, and SIM/SNOW_Solver.h.
Definition at line 142 of file SIM_Data.h.
| SIM_Data::SIM_Data | ( | const SIM_DataFactory * | factory | ) | [explicit, protected] |
The SIM_Data constructor when being created by a SIM_DataFactory. All SIM_Data subclasses should have protected constructors to ensure that only the SIM_DataFactory can create objects of this type.
| virtual SIM_Data::~SIM_Data | ( | ) | [protected, virtual] |
The SIM_Data destructor. It is very important that SIM_Data created by a SIM_DataFactory only be deleted by that SIM_DataFactory.
| void SIM_Data::addError | ( | const SIM_RootData * | root, | |
| int | errorcode, | |||
| const char * | errorparm, | |||
| UT_ErrorSeverity | severity | |||
| ) | const |
| void SIM_Data::addOPInterest | ( | OP_Node * | node | ) | const |
Adds an interest in the specified node to our engine's owner node.
| virtual void SIM_Data::buildGuideGeometrySubclass | ( | const SIM_RootData & | root, | |
| const SIM_Options & | options, | |||
| const GU_DetailHandle & | gdh, | |||
| UT_DMatrix4 * | xform, | |||
| const SIM_Time & | t | |||
| ) | const [protected, virtual] |
Override this function to create custom guide geometry for this class. This method should add geometry to the gdp (if supplied), not alter anything that is already there. The xform will always default to an identity matrix. The gdp pointer or the xform pointer may be null, in which case the other should still be calculated.
Reimplemented in SIM_BVTree, SIM_Constraint, SIM_ForceFan, SIM_ForceField, SIM_ForceMagnet, SIM_ForceVortex, SIM_IndexFieldVisualization, SIM_MatrixFieldVisualization, SIM_ScalarFieldVisualization, SIM_SDF, SIM_SlicePlane, SIM_VectorFieldVisualization, SIM_Visualization, SIM_ParticleFieldVisualization, SIM_SolverPop, HDK_Sample::SIM_ForceOrbit, and HDK_Sample::SNOW_Visualize.
| void SIM_Data::buildGuideOptions | ( | SIM_Options & | options, | |
| const SIM_Time & | time | |||
| ) | const [protected] |
Collect the information in our guide templates and store to a SIM_Options structure.
Finds the given data as subdata. Returns true if found and populates the path required to get there. There is no preceding '/' on the returned path. If subdata == this, "" is the path.
| static const void* SIM_Data::castConstPointerToType | ( | const SIM_Data * | data, | |
| const char * | datatype | |||
| ) | [static] |
This static function checks the passed in value for a null pointer then calls getConstPointerToType().
| static void* SIM_Data::castPointerToType | ( | SIM_Data * | data, | |
| const char * | datatype | |||
| ) | [static] |
This static function checks the passed in value for a null pointer then calls getPointerToType().
| void SIM_Data::copyCreationInfoFrom | ( | const SIM_Data * | source | ) |
Copy the creation info from the specified data into this data. This optional call after makeEqual() copies the creation info from the source data which is appropriate if this data is meant to replace or precisely represent the source data.
| virtual SIM_Guide* SIM_Data::createGuideObjectSubclass | ( | ) | const [protected, virtual] |
Override this to create a custom SIM_Guide subclass. The SIM_Guide class controls how requests for guide geometry are translated into actual geometry creation.
Reimplemented in SIM_BVTree, SIM_Constraint, SIM_ForceFan, SIM_ForceField, SIM_ForceMagnet, SIM_ForceVortex, SIM_IndexFieldVisualization, SIM_MatrixFieldVisualization, SIM_ScalarFieldVisualization, SIM_SDF, SIM_SlicePlane, SIM_VectorFieldVisualization, SIM_Visualization, SIM_ParticleFieldVisualization, SIM_SolverPop, HDK_Sample::SIM_ForceOrbit, and HDK_Sample::SNOW_Visualize.
| SIM_Data* SIM_Data::createNamedSubData | ( | const char * | dataname, | |
| const char * | datatype, | |||
| int | creationflags | |||
| ) |
Adds a new sub-data item to this data. The returned value is a pointer to the newly created sub-data. The creationflags parameter can be any combination of the SIM_DATA flags defined in this file. The SIM_DATA_CREATE macro provides an easy way to call this function and cast the return value in a single step.
| virtual SIM_Query* SIM_Data::createQueryObjectSubclass | ( | ) | const [protected, virtual] |
Override this method to create a custom SIM_Query for this class. By creating a custom SIM_Query, it is possible to customize the expression function interface to the data.
Reimplemented in SIM_ConRel, SIM_Geometry, SIM_Impacts, SIM_Object, and SIM_Relationship.
Generates a unique sub-data name. Using the passed in dataname parameter as a starting point. this function generates a subdata name that is not currently in use. This function usually does not need to be called explicitly since it is called by setNamedSubData() and createNamedSubData() if the SIM_DATA_CREATE_UNIQUE_NAME flag is passed in.
| void SIM_Data::deleteGuideObjectIfNotBuilding | ( | ) | const [protected] |
Delete the guide geometry for this data, if it exists.
| void SIM_Data::deleteQueryObjectIfNotBuilding | ( | ) | const [protected] |
Deletes the query object for this data, if there is one.
| void SIM_Data::filterConstSubData | ( | SIM_ConstDataArray & | dp, | |
| UT_StringArray * | names, | |||
| const SIM_DataFilter & | filter, | |||
| const char * | startfrom, | |||
| const SIM_DataFilter & | recurseFilter | |||
| ) | const |
Fills an array with all subdata pointers accepted by a filter. The startfrom parameter, if not null, is the name of a subdata item which acts as the root of the search. No data items will be copied by this function, even if they are shared. The names parameter, if not null, will be filled with the paths to the returned data items relative to the startfrom data. The recurseFilter determines which data items have their subdata items searched (and which of those subdata items have their subdata items searched, and so on).
| void SIM_Data::filterSubData | ( | SIM_DataArray & | ncdp, | |
| UT_StringArray * | names, | |||
| const SIM_DataFilter & | ncfilter, | |||
| const char * | startfrom, | |||
| const SIM_DataFilter & | recursefilter | |||
| ) |
Fills an array with all subdata pointers accepted by a filter. The startfrom parameter, if not null, is the name of a subdata item which acts as the root of the search. Data items accepted by the filter will be copied if they point to shared data. When searching recursively, this means that the parents of any returned data must also be copied. The names parameter, if not null, will be filled with the paths to the returned data items relative to the startfrom data. The recurseFilter determines which data items have their subdata items searched (and which of those subdata items have their subdata items searched, and so on).
| void SIM_Data::forEachConstSubData | ( | SIM_EachDataCallback & | cb, | |
| const SIM_DataFilter & | filter, | |||
| const char * | startfrom, | |||
| const SIM_DataFilter & | recurseFilter | |||
| ) | const |
Executes a callback function for each sub-data item that matches the filter criteria. The callback is called with each data item as a parameter. If the recurse parameter is true, this function searches each sub-data recursively, looking for sub-data items of its own. No data items will be copied by this function, even if they are shared.
| void SIM_Data::forEachSubData | ( | SIM_EachDataCallback & | cb, | |
| const SIM_DataFilter & | filter, | |||
| const char * | startfrom, | |||
| const SIM_DataFilter & | recurseFilter | |||
| ) |
Executes a callback function for each sub-data item that matches the filter criteria. The callback is called with each data item as a parameter. If the recurse parameter is true, this function searches each sub-data recursively, looking for sub-data items of its own. Data items accepted by the filter will be copied if they point to shared data. When searching recursively, this means that the parents of any returned data must also be copied.
| virtual void* SIM_Data::getCastToType | ( | const char * | datatype | ) | const [protected, virtual] |
Return this pointer cast us to another data type. All subclasses should implement this function, but generally the DECLARE_STANDARD_GETCASTTOYPE() macro will work. Only if your class uses multiple inheritance will it be necessary to write a custom version of this function. If you write your own custom implementation of this method, remember to call the base class implementation.
| CHOP_Node* SIM_Data::getCHOPNode | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return a CHOP_Node.
| const SIM_Data* SIM_Data::getConstNamedSubData | ( | const char * | dataname | ) | const |
Get the sub-data attached to this data with a particular name. If no sub-data with the specified name exists, null is returned. The returned data is not copied even if it is shared.
| const void* SIM_Data::getConstPointerToType | ( | const char * | datatype | ) | const |
Return a const pointer that can be cast directly to the specified type. This function calls getDistanceToType(). It will return null if we can't be converted to the specified type. This function should normally not be called directly. Instead, the SIM_DATA_CASTCONST macro provides a safer method of using this function.
| const SIM_Data* SIM_Data::getConstSubData | ( | int | index | ) | const |
This is the same as getSubData(), but it returns a const pointer. Also, the returned data is not copied even if it is shared.
| COP2_Node* SIM_Data::getCOP2Node | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return a COP2_Node.
| const SIM_Time& SIM_Data::getCreationTime | ( | ) | const |
Get the creation time for this data.
| int SIM_Data::getCreatorId | ( | ) | const |
Get the ID of the node that created this data.
| int SIM_Data::getCreatorIndex | ( | ) | const |
Get the output index of the creator node that generated this data.
| OP_Node* SIM_Data::getCreatorNode | ( | ) | const |
Use the creator ID to look up the OP_Node that created this data.
| const UT_String& SIM_Data::getDataType | ( | ) | const |
Return the unique descriptive name for the class. The returned value will always be the most-derived class for the data object. The name is fetched from the SIM_DataFactory that created this data.
| static bool SIM_Data::getDataTypeFromFile | ( | const char * | filename, | |
| UT_String & | datatype | |||
| ) | [static] |
Opens the specified file and returns the type of data stored in that file. Having a static function here to look up this information from the file saves any callers from requiring any knowledge of the single data format.
| static bool SIM_Data::getDataTypeFromStream | ( | UT_IStream & | is, | |
| UT_String & | datatype | |||
| ) | [static] |
| virtual const UT_String& SIM_Data::getDataTypeSubclass | ( | ) | const [protected, virtual] |
Returns the class name for this data type. This function is automaticaly implemented by the DECLARE_CLASSNAME() and DECLARE_DATAFACTORY() macros.
| DOP_Node* SIM_Data::getDOPNode | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return a DOP_Node.
| static const SIM_DopDescription* SIM_Data::getEmptyDopDescription | ( | ) | [static, protected] |
A DOP description that says not to create an automatic DOP.
| static const PRM_Template* SIM_Data::getEmptyTemplateList | ( | ) | [static, protected] |
An empty parm template. This provides a simple default value to use for those SIM_Data subclasses that don't want to define a parm template.
| const SIM_Engine& SIM_Data::getEngine | ( | ) | const [protected] |
Get the engine that created us (from our data factory).
| GU_ConstDetailHandle SIM_Data::getGuideGeometry | ( | const SIM_RootData & | root, | |
| const char * | datapath, | |||
| UT_DMatrix4 & | xform, | |||
| const SIM_Time & | t | |||
| ) | const |
Get the guide geometry associated with this data. The returned value may be null if there is no guide geometry.
| long SIM_Data::getGuideParmVersion | ( | ) | const |
Returns a number that indicates the current state of the guide parms on our source node (or nodes). This value is used to automatically refresh our guide geometry if one of our guide parms changes. This function just calls getGuideParmVersionSubclass().
| virtual long SIM_Data::getGuideParmVersionSubclass | ( | ) | const [protected, virtual] |
Override this if the guide geometry for this data depends on parameters on nodes other than our creator node. Otherwise the guide geometry won't refresh when changing those parameters.
Reimplemented in SIM_Constraint.
| bool SIM_Data::getIsAlternateRepresentation | ( | ) | const |
This function returns true if this data is built on demand from some other data. This function calls getIsAlternateRepresentationSubclass(). This value is usually a characteristic of the data type as a whole, and will be the same for all data of a particular type.
| virtual bool SIM_Data::getIsAlternateRepresentationSubclass | ( | ) | const [protected, virtual] |
Override this method to return true if your data type is built on demand. This is true for data that is just an alternative representation of some other data. This has several consequences. First, it implies that the data can be rebuilt from other data on the object, therefore it is not saved to disk. Also, it is assumed to be represent its parent data, so any modifications to the parent data cause this data to be deleted. If you override this method, do not call the base class implementation.
Reimplemented in RBD_SphereEdgeTree, RBD_SpherePointTree, SIM_BVTree, SIM_ContainerAlt, SIM_IndexFieldVisualization, SIM_MatrixFieldVisualization, SIM_PointMapping, SIM_PointNeighbourList, SIM_PointTree, SIM_RayIntersect, SIM_ScalarFieldVisualization, SIM_SDF, SIM_TriangulatedGeometry, SIM_VectorFieldVisualization, SIM_ParticleFieldVisualization, and HDK_Sample::SNOW_Visualize.
| bool SIM_Data::getIsDoingSimplifiedSaveLoad | ( | ) | const [protected] |
Returns true if we are performing a simplified load or save. A simplified load or save is one performed from the saveToFile or loadFromFile functions.
| bool SIM_Data::getIsOfType | ( | const char * | datatype | ) | const |
Return whether we are of the specified type, or a subclass of it. This function calls the getPointerToType() function to make this determination.
| bool SIM_Data::getIsSelected | ( | ) | const |
Get the selected flag for this data.
| int64 SIM_Data::getMemorySize | ( | ) | const |
This function returns the amount of memory consumed by this data. The returned value will not include the size of any subdata.
| virtual int64 SIM_Data::getMemorySizeSubclass | ( | ) | const [protected, virtual] |
Override this function to return an accurate representation of the amount of memory used by this piece of data. The size of subdata should not be included in this calculation.
Reimplemented in RBD_SphereEdgeTree, RBD_SpherePointTree, SIM_BVTreeBase, SIM_Geometry, SIM_Impacts, SIM_IndexField, SIM_MatrixField, SIM_Object, SIM_PointMapping, SIM_PointNeighbourList, SIM_PointTree, SIM_RayIntersect, SIM_Relationship, SIM_ScalarField, SIM_SDF, SIM_TriangulatedGeometry, SIM_VectorField, SIM_PopGeometry, and HDK_Sample::SNOW_VoxelArray.
| SIM_Data* SIM_Data::getNamedSubData | ( | const char * | dataname | ) |
Get the sub-data attached to this data with a particular name. If no sub-data with the specified name exists, null is returned. If the found data is shared, then the data is copied before it is returned.
| bool SIM_Data::getNeedsInitialization | ( | ) | const [protected] |
Tests whether an alternate representation requires initialization.
| OP_Node& SIM_Data::getNodePathsRelativeTo | ( | ) | const |
Returns the node that relative node paths are relative to. This function returns the creator node if there is one, otherwise it returns the OP_Director.
| const SIM_Data* SIM_Data::getNthConstSubData | ( | UT_String * | name, | |
| const SIM_DataFilter & | filter, | |||
| int | n, | |||
| const char * | startfrom, | |||
| const SIM_DataFilter & | recurseFilter | |||
| ) | const |
Returns the nth data item which matches the filter criteria. The startfrom parameter, if not null, is the name of a subdata item which acts as the root of the search. If the recurse parameter is true, then subdata are checked recursively. No data items will be copied by this function, even if they are shared. The name parameter, if not null, will be filled with the path to the returned data item relative to the startfrom data. Note that n starts at zero, in typical C++ fashion.
| SIM_Data* SIM_Data::getNthSubData | ( | UT_String * | name, | |
| const SIM_DataFilter & | filter, | |||
| int | n, | |||
| const char * | startfrom, | |||
| const SIM_DataFilter & | recurseFilter | |||
| ) |
Returns the nth data item which matches the filter criteria. The startfrom parameter, if not null, is the name of a subdata item which acts as the root of the search. If the recurse parameter is true, then subdata are checked recursively. The data item returned by this function will be copied if it points to shared data. When searching recursively, this means that the parents of the returned data must also be copied. The name parameter, if not null, will be filled with the path to the returned data item relative to the startfrom data. Note that n starts at zero, in typical C++ fashion.
| int SIM_Data::getNumSubData | ( | ) | const |
Get the number of sub-data items attached to this data.
| OBJ_Node* SIM_Data::getOBJNode | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return an OBJ_Node.
| OP_Node* SIM_Data::getOPNode | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return an OBJ_Node.
| SIM_Data* SIM_Data::getOrCreateAlternateRepresentation | ( | const char * | dataname, | |
| const char * | datatype | |||
| ) | const |
This function is a special version of the function above. It can only be used to create subdata that represents an alternate representation of this data. Because the new subdata is just another representation of this data, it can be added to a const SIM_Data. There is no creationflags parameter because this parameter is always implicitly SIM_DATA_RETURN_EXISTING.
| OP_Node* SIM_Data::getOwnerNetwork | ( | ) | const |
Look up the owner node of our engine to get the DOP Network pointer.
| void* SIM_Data::getPointerToType | ( | const char * | datatype | ) |
Return a pointer that can be cast directly to the specified type. This function calls getDistanceToType(). It will return null if we can't be converted to the specified type. This function should normally not be called directly. Instead, the SIM_DATA_CAST macro provides a safer method of using this function.
| POP_Node* SIM_Data::getPOPNode | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return a POP_Node.
| const SIM_Query& SIM_Data::getQueryObject | ( | ) | const |
Get a SIM_Query object associated with this data. The returned reference will generally be destroyed when the data is next modified.
| long SIM_Data::getReferenceCount | ( | ) | const |
Returns the reference count for this data. This is the number of other data items that hold a pointer to this data.
| bool SIM_Data::getSelectionRepresentsObject | ( | ) | const |
This function returns true if selecting this data is equivalent to selecting the DOP object to which it is attached. This is currently a property of the data type.
| SOP_Node* SIM_Data::getSOPNode | ( | const char * | path, | |
| bool | addinterest | |||
| ) | const |
Given a path relative to our creator node, return a SOP_Node.
| SIM_Data* SIM_Data::getSubData | ( | int | index | ) |
Get the sub-data at a particular index location. If the found data is shared, then the data is copied before it is returned.
| int SIM_Data::getSubDataIndex | ( | const SIM_Data * | subdata | ) | const |
Returns the index for a piece of sub-data. The return value is -1 if the sub-data can't be found.
| const char* SIM_Data::getSubDataName | ( | int | index | ) | const |
Get the name of the sub-data at a particular index location.
| const UT_Guid& SIM_Data::getUniqueId | ( | ) | const |
Returns the unique identifier for this data. The unique identifier will be unique for all data over all time in this simulations.
| void SIM_Data::handleModification | ( | int | code = -1 |
) | [protected] |
Call this function whenever the internal data of this object changes. The code parameter can be used to signal what sort of modification has occurred. The meaning of this code can be different from one data type to the next. This function calls handleModificationSubclass.
| virtual void SIM_Data::handleModificationSubclass | ( | int | code | ) | [protected, virtual] |
Override this method to customize the behavior when our internal data changes. The code parameter is a data type specific value which can be used to indicate the type of change that has occurred. The default implementation deletes all subdata that was created with the deleteifmodified flag turned on. Remember to call the base class implementation.
Reimplemented in SIM_SopGeometry, SIM_SopScalarField, SIM_SopVectorField, and HDK_Sample::SNOW_VoxelArray.
| void SIM_Data::initAlternateRepresentation | ( | ) | const [protected] |
This function is called from getOrCreateAlternateRepresentation(). It should be used to initialize the alternate representation from the parent data. It calls initAlternateRepresentationSubclass() to do the actual work.
| virtual void SIM_Data::initAlternateRepresentationSubclass | ( | const SIM_Data & | ) | [protected, virtual] |
Override this function if getIsAlternateRepresentationSubclass() is overridden to return true. This function is used to initialize the alternate representation based on the data to which it was just attached.
Reimplemented in RBD_SphereEdgeTree, RBD_SpherePointTree, SIM_BVTree, SIM_IndexFieldVisualization, SIM_MatrixFieldVisualization, SIM_PointMapping, SIM_PointNeighbourList, SIM_PointTree, SIM_RayIntersect, SIM_ScalarFieldVisualization, SIM_SDF, SIM_TriangulatedGeometry, SIM_VectorFieldVisualization, SIM_ParticleFieldVisualization, and HDK_Sample::SNOW_Visualize.
| void SIM_Data::initialize | ( | const SIM_SubdataBehavior & | subdatabehavior | ) |
Set this data to its default empty state. This function calls initializeSubclass() to initialize the state of the data. After calling this function, the data should be indistinguishable from a new instance of this data type. This function is always called when a new piece of data is created.
| void SIM_Data::initializeFromParmDefaults | ( | ) | [protected] |
This function looks through the parameter templates defined in our SIM_DopDescription, loads the default values into a SIM_Options structure, and calls setParameters(). This function is useful for initializing data types that use the SIM_DopDescription to create an automatic DOP node type.
| virtual void SIM_Data::initializeSubclass | ( | ) | [protected, virtual] |
Override this method to set this data to its default empty state. Remember to call the base class implementation. The default implementation clears all subdata, and if the data is a subclass of SIM_OptionsUser, calls initializeFromParmDefaults().
Reimplemented in RBD_SphereEdgeTree, RBD_SpherePointTree, SIM_ConRel, SIM_Geometry, SIM_GeometryCopy, SIM_Impacts, SIM_IndexField, SIM_IndexFieldVisualization, SIM_MatrixField, SIM_MatrixFieldVisualization, SIM_Object, SIM_PointMapping, SIM_PointNeighbourList, SIM_PointTree, SIM_RandomTwister, SIM_RayIntersect, SIM_Relationship, SIM_ScalarField, SIM_ScalarFieldVisualization, SIM_SDF, SIM_VectorField, SIM_VectorFieldVisualization, SIM_ParticleFieldVisualization, SIM_PointPosition, SIM_PopGeometry, HDK_Sample::SNOW_VoxelArray, and HDK_Sample::SNOW_Visualize.
Set this data to be some linear interpolation between two input data. This method is used by the simulation engine to generate approximate data between timesteps. It can also be used by solvers that sub-sample the global timestep, and for display purposes if the global time step is greater than one step time. This function calls interpolateSubclass.
Warning: if the source1 or source2 pointers are equal to the this pointer, this function will only do an assignment (via makeEqual) to one of the sources.
| virtual void SIM_Data::interpolateSubclass | ( | const SIM_Data * | source1, | |
| const SIM_Data * | source2, | |||
| fpreal | interp | |||
| ) | [protected, virtual] |
Override this method to customize the interpolation behavior. The interp parameter will always be greater than 0 and less than one in this call. Values outside this range are handled by the interpolate() function by calling makeEqual() on one source or the other. The default implementation calls makeEqualSubclass() on source1 or source2 depending on whether interp is less or greater than 0.5. Both source1 and source2 are guaranteed to be non-null in this call. Subclasses should not call the base class implementation, except in the case of an error condition which prevents the custom interpolation from functioning properly. You should also not call makeEqual() from this function, though makeEqualSubclass() is acceptable.
Reimplemented in SIM_Geometry, SIM_Object, SIM_PositionSimple, SIM_SopGeometry, SIM_SopScalarField, and SIM_SopVectorField.
| void SIM_Data::interpolateSubData | ( | const SIM_Data & | source1, | |
| const SIM_Data & | source2, | |||
| fpreal | interp, | |||
| const SIM_DataFilter & | interpdata, | |||
| const SIM_DataFilter & | recurse | |||
| ) |
Creates a new sub-data item for this data by interpolating between two reference sub-data items. This function provides an easy way to interpolate certain sub-data items after making a copy of some existing data.
| bool SIM_Data::loadFromFile | ( | const char * | filename | ) |
Loads this piece of data from a file. This file must be in a format like that saved from saveToFile(). No subdata or creation info is loaded (because it isn't saved in the file).
| bool SIM_Data::loadFromStream | ( | UT_IStream & | is, | |
| bool | skiptype = false | |||
| ) |
skiptype is set if the stream is already past the type data, for example due to an earlier call to getDataTypeFromStream
| bool SIM_Data::loadOptionPacket | ( | UT_IStream & | is, | |
| const char * | name, | |||
| SIM_Options * | opts | |||
| ) | const [protected] |
This function loads a SIM_Options from a stream. Using a SIM_Options provides an easy way to allow for forward and backward compatibility when new data is added or removed.
| virtual bool SIM_Data::loadSubclass | ( | UT_IStream & | is | ) | [protected, virtual] |
Override this method to read in subclass-specific data. Remember to call the base class implementation.
Reimplemented in SIM_BVTreeStructure, SIM_ConRel, SIM_Geometry, SIM_Impacts, SIM_IndexField, SIM_MatrixField, SIM_Object, SIM_RandomTwister, SIM_Relationship, SIM_ScalarField, SIM_SDF, SIM_VectorField, SIM_PopGeometry, and HDK_Sample::SNOW_VoxelArray.
| void SIM_Data::makeEqual | ( | const SIM_Data * | source, | |
| const SIM_SubdataBehavior & | subdatabehavior | |||
| ) |
Sets our data to be the same as the source data. This function calls makeEqualSubclass() to do the actual assignment. Note that it is legal to call makeEqual() with any pair of SIM_Data subclasses, not just related types. It is up to the makeEqualSubclass implementation to determine if the passed in data type is acceptable.
| virtual void SIM_Data::makeEqualSubclass | ( | const SIM_Data * | source | ) | [protected, virtual] |
Override this method to set subclass data equal to the source data. The source parameter at this level is guaranteed to be non-null. Remember to call the base class implementation.
Reimplemented in SIM_BVTreeBase, SIM_ConRel, SIM_Geometry, SIM_GeometryCopy, SIM_Impacts, SIM_IndexField, SIM_MatrixField, SIM_Object, SIM_RandomTwister, SIM_Relationship, SIM_ScalarField, SIM_VectorField, SIM_PopGeometry, and HDK_Sample::SNOW_VoxelArray.
| void SIM_Data::moveNamedSubData | ( | const char * | oldname, | |
| const char * | newname | |||
| ) |
Change the name of some existing sub-data found by name. The newname may specify a completely different location than the old name.
| void SIM_Data::removeNamedSubData | ( | const char * | dataname | ) |
Remove some existing sub-data by name.
| virtual void SIM_Data::removeNamedSubDataSubclass | ( | const char * | dataname | ) | [protected, virtual] |
Override this function to do special processing when removing subdata. One example would be to eliminate a cached value set up in the setNamedSubDataSubclass() function.
Reimplemented in SIM_Object.
| void SIM_Data::removeSubData | ( | int | index | ) |
Remove some existing sub-data by index.
| bool SIM_Data::saveOptionPacket | ( | ostream & | os, | |
| const char * | name, | |||
| const SIM_Options * | opts | |||
| ) | const [protected] |
This function saves a SIM_Options to a stream. Using a SIM_Options provides an easy way to allow for forward and backward compatibility when new data is added or removed.
| virtual void SIM_Data::saveSubclass | ( | ostream & | os | ) | const [protected, virtual] |
Override this method to write out subclass-specific data. Remember to call the base class implementation.
Reimplemented in SIM_BVTreeStructure, SIM_ConRel, SIM_Geometry, SIM_Impacts, SIM_IndexField, SIM_MatrixField, SIM_Object, SIM_RandomTwister, SIM_Relationship, SIM_ScalarField, SIM_SDF, SIM_VectorField, and HDK_Sample::SNOW_VoxelArray.
| bool SIM_Data::saveToFile | ( | const char * | filename | ) | const |
Saves this piece of data to a file. This is the only public method for saving SIM_Data. It does not save subdata or creation info. It simply saves the contents of this single piece of data to a file.
| bool SIM_Data::saveToStream | ( | ostream & | os | ) | const |
| void SIM_Data::setIsSelected | ( | bool | selected | ) | const |
Set the selected flag for this data. Notice this method is const. Selection isn't really part of the data, it is a UI concept.
| void SIM_Data::setNamedSubData | ( | const char * | dataname, | |
| const SIM_Data * | data, | |||
| int | setflags | |||
| ) |
Add a new piece of sub-data to this data. If data with the given name already exists it will be deleted and replaced with the new data. The data pointer will most likely come from a call to createNamedData() or getSubData() on another parent data. The setflags parameter can be any combination of the SIM_DATA flags defined in this file.
| virtual void SIM_Data::setNamedSubDataSubclass | ( | const char * | dataname, | |
| const SIM_Data * | data | |||
| ) | [protected, virtual] |
Override this virtual to do special processing when adding subdata. One example would be to cache certain pieces of subdata for quicker access through member functions. Remember to also handle the removeNamedSubDataSubclass function to handle the removal of subdata.
Reimplemented in SIM_Object.
| void SIM_Data::setNeedsInitialization | ( | bool | needsinit | ) | const [protected] |
Flags an alternate representation subdata as requiring initialization.
| void SIM_Data::setNeedsToRecalculateMemorySize | ( | ) | const [protected] |
This function flags the data as needing to recalculate its memory size. The default handleModificationSubclass() implementation calls this function, but it can also be called directly when the memory size of a SIM_Data is changing without any changes that would require a handleModification() call.
| void SIM_Data::setParameters | ( | const SIM_Options & | parms | ) |
Given a SIM_Options, set up this data. This function calls setParametersSubclass() to do its work. It is used by automatically generated DOP nodes to convert parameter values into SIM_Options entries, then set up the data. This function can also be used by loadSubclass() if some of the data for this type is stored in a SIM_Options.
| virtual void SIM_Data::setParametersSubclass | ( | const SIM_Options & | parms | ) | [protected, virtual] |
Override this method to process our DOP node parameter values. Automatically created DOP nodes turn their parameter values into SIM_Options entries, which are passed to this function. This function can also be used to help load data from a stream if it is stored in a SIM_Options. Remember to call the base class implementation.
Reimplemented in SIM_GeometryCopy, and SIM_PointPosition.
| void SIM_Data::setSelectionRepresentsObject | ( | bool | representsobject | ) | [protected] |
Sets the flag indicating that selecting this object represents a selection of the object to which it is attached.
friend class SIM_DataFactory [friend] |
Definition at line 760 of file SIM_Data.h.
friend class SIM_Guide [friend] |
Definition at line 763 of file SIM_Data.h.
friend class SIM_OptionsUser [friend] |
Definition at line 762 of file SIM_Data.h.
friend class SIM_SimulationState [friend] |
1.5.9