DOP_Engine Class Reference

#include <DOP_Engine.h>

Inheritance diagram for DOP_Engine:

SIM_Engine

List of all members.

Public Member Functions

 DOP_Engine (OP_Node *owner)
 Constructor is given a pointer to the network that owns the simulation.
virtual ~DOP_Engine ()
 Destructor destroys all data for the simulation.
void getObjectsAtInputs (DOP_Node *node, UT_PtrArray< const SIM_ObjectArray * > &objectsatinputs) const
void getObjectsForNode (DOP_Node *node, SIM_ConstObjectArray &objects) const
void addObjectForNode (DOP_Node *node, SIM_RootData &rootdata)
DOP_NodegetDopNodeBeingProcessed () const

Protected Member Functions

virtual void resetSimulation ()
virtual void preSimulationStep ()
virtual void postSimulationStep ()
 Overrides the actions that occur after a simulation step.
virtual void clearReferencesToMostRecentState ()
virtual void objectCreated (SIM_Object *object)
virtual void objectRemoved (SIM_Object *object)
virtual void handleExternalNodeChangeSubclass (OP_Node *changednode, OP_EventType eventtype, void *data)
virtual void addErrorSubclass (const SIM_RootData *rootdata, const SIM_Data *data, int errorcode, const char *errorparm, UT_ErrorSeverity severity) const
virtual const SIM_Time getEngineTimeSubclass (const SIM_Time &t) const
 Returns the simulation time that corresponds to the given global time.
virtual const SIM_Time getGlobalTimeSubclass (const SIM_Time &t) const
 Returns the global time that corresponds to the given simulation time.


Detailed Description

This subclass of SIM_Engine is the one used to contain simulations controlled by DOP_Node networks. It serves as the glue between the pure simulation library and the DOP_Node interface given to simulations in Houdini.
Examples:

DOP/DOP_GroupAndApply.C, and DOP/DOP_GroupAndApply.h.

Definition at line 40 of file DOP_Engine.h.


Constructor & Destructor Documentation

DOP_Engine::DOP_Engine ( OP_Node owner  ) 

Constructor is given a pointer to the network that owns the simulation.

virtual DOP_Engine::~DOP_Engine (  )  [virtual]

Destructor destroys all data for the simulation.


Member Function Documentation

virtual void DOP_Engine::addErrorSubclass ( const SIM_RootData rootdata,
const SIM_Data data,
int  errorcode,
const char *  errorparm,
UT_ErrorSeverity  severity 
) const [protected, virtual]

Uses the object and data arguments to put the error message on an appropriate DOP_Node. First priority is given to the node that created the data, then the node that created the object, then the node with the display flag.

Reimplemented from SIM_Engine.

void DOP_Engine::addObjectForNode ( DOP_Node node,
SIM_RootData rootdata 
)

Adds the specified root data (cast to an object) as a sort of "extra object" processed by a DOP node. These extra objects don't affect cooking at all, but show up in the list of objects processed by that node (in the MMB info and dopnodeobjs expression).

virtual void DOP_Engine::clearReferencesToMostRecentState (  )  [protected, virtual]

When the most recent simulation state is being deleted or removed from memory, we have to clear all our references to it. This basically means our lists of output objects to process.

Reimplemented from SIM_Engine.

DOP_Node* DOP_Engine::getDopNodeBeingProcessed (  )  const

Gets a pointer to the node that is currently being processed by the DOP_Engine. The return value will be null if the engine is not currently in the preSimulationStep and inside a call to DOP_Node::processObjects(). This function is used by subnet DOPs to evaluate standard DOP local variables in the context of the node that is being processed (since subnets have no context of their own).

virtual const SIM_Time DOP_Engine::getEngineTimeSubclass ( const SIM_Time t  )  const [protected, virtual]

Returns the simulation time that corresponds to the given global time.

Reimplemented from SIM_Engine.

virtual const SIM_Time DOP_Engine::getGlobalTimeSubclass ( const SIM_Time t  )  const [protected, virtual]

Returns the global time that corresponds to the given simulation time.

Reimplemented from SIM_Engine.

void DOP_Engine::getObjectsAtInputs ( DOP_Node node,
UT_PtrArray< const SIM_ObjectArray * > &  objectsatinputs 
) const

Groups objects passed to a DOP_Node by the input they arrived in. Each entry in the returned UT_PtrArray represents an input to the DOP_Node. If a particular input is not connected, the corresponding entry in the array will by null. Generally this function will be called from DOP_Node::processObjects() by nodes which need to have objects coming through one input interact in some way with objects coming through another input.

void DOP_Engine::getObjectsForNode ( DOP_Node node,
SIM_ConstObjectArray objects 
) const

Gets the objects in the stream associated with the supplied node. For nodes with multiple outputs, the result is the combination of all objects on any output. This function does not do any cooking of the networks, or call partitionObjects on any nodes. It only pulls existing data from our set of outputs to process. This function is for use by expression functions that want to know what objects most recently passed through a particular node.

virtual void DOP_Engine::handleExternalNodeChangeSubclass ( OP_Node changednode,
OP_EventType  eventtype,
void *  data 
) [protected, virtual]

Override this method to flag ourselves as requiring a resimulation when any of our external referenced nodes changes in a significant way.

Reimplemented from SIM_Engine.

virtual void DOP_Engine::objectCreated ( SIM_Object object  )  [protected, virtual]

Sets up custom data on a new object. This implementation calls the base class implementation, then it stores information about the DOP_Node that created the object.

Reimplemented from SIM_Engine.

virtual void DOP_Engine::objectRemoved ( SIM_Object object  )  [protected, virtual]

Overrides the default behavior when removing a simulation object. This implementation eliminates all references to this object stored in our internal data then calls the base class implementation.

Reimplemented from SIM_Engine.

virtual void DOP_Engine::postSimulationStep (  )  [protected, virtual]

Overrides the actions that occur after a simulation step.

Reimplemented from SIM_Engine.

virtual void DOP_Engine::preSimulationStep (  )  [protected, virtual]

Overrides the actions that occur before doing a simulation step. This is where the network of DOP_Nodes is parsed. Each DOP_Node has a chance to alter the simulation objects in the DOP_Node::processObjects() function. Nodes can also specify which objects are sent to each output of the node.

Reimplemented from SIM_Engine.

virtual void DOP_Engine::resetSimulation (  )  [protected, virtual]

Overrides the base class method to make sure that all our internal data related to the last timestep cook has been cleared away.

Reimplemented from SIM_Engine.


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

Generated on Fri May 25 00:10:22 2012 for HDK by  doxygen 1.5.9