DOP_Node Class Reference

This is the base class for all DOP nodes. More...

#include <DOP_Node.h>

Inheritance diagram for DOP_Node:

OP_Network OP_Node OP_Parameters OP_NetworkBoxItem PRM_ParmOwner DOP_Auto DOP_Python DOP_SubNet HDK_Sample::DOP_GroupAndApply DOP_AutoRelType DOP_AutoSolver DOP_SolverPython

List of all members.

Classes

class  DOP_CookData

Public Member Functions

 DOP_Node (OP_Network *dad, const char *name, OP_Operator *entry)
 Constructor to allocate a new DOP_Node.
virtual ~DOP_Node ()
 Destructor.
void applyDataFromInput (fpreal time, int inputidx, int inputidxforsuffix, SIM_RootData &rootdata, const char *parentdataname, DOP_Engine &engine, UT_StringArray *datanames, bool changeuniquenamesuffix)
void getRequiredOutputs (fpreal time, int foroutputidx, UT_RefArray< DOP_Output > &outputs, const DOP_Engine &engine)
void partitionObjects (fpreal time, const SIM_ObjectArray &objects, const UT_PtrArray< SIM_ObjectArray * > &p, const DOP_Engine &engine)
void processObjects (fpreal time, int foroutputidx, const SIM_ObjectArray &objects, DOP_Engine &engine)
void applyOutputData (fpreal time, int outputidx, SIM_RootData &rootdata, const char *parentdataname, DOP_Engine &engine, UT_StringArray *datanames)
void preNetworkProcessing (DOP_Engine &engine)
void postNetworkProcessing (DOP_Engine &engine)
void getInputInfo (int inputidx, DOP_InOutInfo &info)
void getOutputInfo (int outputidx, DOP_InOutInfo &info)
void addError (int code, const char *msg=0)
 Adds an error from the DOP error file.
void addMessage (DOP_ErrorCode code, const char *msg=0)
 Adds a message from the DOP error file.
void addWarning (DOP_ErrorCode code, const char *msg=0)
 Adds a warning from the DOP error file.
void addFatal (DOP_ErrorCode code, const char *msg=0)
 Adds a fatal error from the DOP error file.
virtual const char * getChildType () const
 Returns "DOP" because our child nodes will be DOP_Nodes.
virtual const char * getOpType () const
 Returns "DOP" because we are a DOP_Node.
virtual OP_OpTypeId getChildTypeID () const
 Returns DOP_OPTYPE_ID because our child nodes will be DOP_Nodes.
virtual OP_OpTypeId getOpTypeID () const
 Returns DOP_OPTYPE_ID because we are a DOP_Node.
virtual OP_NodegetRenderNodePtr ()
virtual const char * inputLabel (unsigned idx) const
 REturn text describing a particular input.
virtual void opChanged (OP_EventType reason, void *data=0)
virtual void referencedParmChanged (int pi)
virtual float getVariableValue (int index, int thread)
 Handle the evaluation of standard local variables.
virtual void getVariableString (int index, UT_String &value, int thread)
 Handle the evaluation of standards string local variables.
virtual fpreal getW () const
 Return the absolute width of the tile for this node.
virtual fpreal getH () const
 Return the absolute height of the tile for this node.
virtual int getDandROpsEqual ()
 The display and render ops of a DOP Network are always equal.
virtual int updateDandROpsEqual (int check_inputs=1)
virtual void clearInterrupted ()
virtual void getNodeSpecificInfoText (OP_Context &context, int verbose, UT_WorkBuffer &text)
 Get the MMB info text for this node.
virtual DOP_ParentcastToDOPParent ()
virtual const DOP_ParentcastToDOPParent () const
virtual OP_ERROR setInput (unsigned idx, OP_Node *op, unsigned outputIdx=0)
virtual OP_ERROR setInputReference (unsigned idx, const char *label, int keeppos, unsigned outputIdx=0)
 Connects an input to particular node by name in the network.
virtual bool hasDifferentMultiInputs () const
void setCurrentObject (int objectindex, int objectcount, const SIM_Object *object)
void setCurrentRel (const SIM_Relationship *rel)
void copyCurrentObjectAndRelInto (DOP_Node *dest) const
void clearCurrentObjectAndRel ()
 Clears the current object and relationship information.

Static Public Member Functions

static void buildActivationRules (void *data, PRM_Name *menu, int maxSize, const PRM_SpareData *, PRM_Parm *)
static int setActivationCallback (void *data, int index, float t, const PRM_Template *)
static void buildOperatorTable (OP_OperatorTable &table)
 Adds DOP_Operators to teh DOP operator table.
static void initializeExpressions ()
 Adds the DOP specific expression functions.
static void installCommands ()
 Adss Dop specific hscript commands.

Static Public Attributes

static OP_VariablePair theVariablePair
static CH_LocalVariable theVariables []

Protected Member Functions

virtual OP_ERROR cookMe (OP_Context &)
 Cooking a DOP_Node just performs some basic error checks.
virtual OP_ERROR bypassMe (OP_Context &, int &)
 Bypassing a DOP_Node does nothing.
virtual const char * getFileExtension (int binary) const
 Returns the file extension to use for opsave commands on a DOP_Node.
virtual void childFlagChange (OP_Node *)
 Handle changes to our child node display and render flags.
OP_ERROR checkInputValidity ()
 Checks that the input types match the output types connected to them.
virtual bool cookedDataUsesAllParameters () const
virtual OP_DATA_TYPE getCookedDataType () const
 A DOP_Node has no data, so do nothing.
virtual void deleteCookedData ()
 A DOP_Node has no data, so do nothing.
virtual int saveCookedData (const char *, OP_Context &)
 A DOP_Node has no data, so do nothing.
virtual int saveCookedData (ostream &, OP_Context &, int)
 A DOP_Node has no data, so do nothing.
virtual int getWorldTransform (UT_DMatrix4 &xform, OP_Context &)
virtual int getIWorldTransform (UT_DMatrix4 &xform, OP_Context &)
virtual int propagateModification (OP_Node *by_whom, OP_EventType reason, int parm_index, OP_PropagateData &prop_data)
bool isActive (float time)
virtual void getRequiredOutputsSubclass (fpreal time, int foroutputidx, UT_RefArray< DOP_Output > &outputs, const DOP_Engine &engine)
 This default implementation indicates that all inputs are required.
virtual void partitionObjectsSubclass (fpreal time, const SIM_ObjectArray &objects, const UT_PtrArray< SIM_ObjectArray * > &p, const DOP_Engine &engine)
 This default implementation sends all objects to the first output.
virtual void processObjectsSubclass (fpreal time, int foroutputidx, const SIM_ObjectArray &objects, DOP_Engine &engine)
 This default implementation does not affect incoming objects.
virtual void applyOutputDataSubclass (fpreal time, int outputidx, SIM_RootData &rootdata, const char *parentdataname, DOP_Engine &engine, UT_StringArray *datanames)
virtual void preNetworkProcessingSubclass (DOP_Engine &engine)
virtual void postNetworkProcessingSubclass (DOP_Engine &engine)
virtual void getInputInfoSubclass (int inputidx, DOP_InOutInfo &info)
 This default implementation specifies the input accepts objects.
virtual void getOutputInfoSubclass (int outputidx, DOP_InOutInfo &info)
 This default implementation specifies the output sends out objects.
void makeFullDataName (const char *root, UT_String &name) const
void appendUniqueDataNameSuffix (UT_String &dataname, bool usenodepath) const

Friends

class DOP_Parent


Detailed Description

This is the base class for all DOP nodes.
Examples:

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

Definition at line 85 of file DOP_Node.h.


Constructor & Destructor Documentation

DOP_Node::DOP_Node ( OP_Network dad,
const char *  name,
OP_Operator entry 
)

Constructor to allocate a new DOP_Node.

virtual DOP_Node::~DOP_Node (  )  [virtual]

Destructor.


Member Function Documentation

void DOP_Node::addError ( int  code,
const char *  msg = 0 
) [inline]

Adds an error from the DOP error file.

Examples:
DOP/DOP_GroupAndApply.C.

Definition at line 165 of file DOP_Node.h.

void DOP_Node::addFatal ( DOP_ErrorCode  code,
const char *  msg = 0 
) [inline]

Adds a fatal error from the DOP error file.

Definition at line 174 of file DOP_Node.h.

void DOP_Node::addMessage ( DOP_ErrorCode  code,
const char *  msg = 0 
) [inline]

Adds a message from the DOP error file.

Definition at line 168 of file DOP_Node.h.

void DOP_Node::addWarning ( DOP_ErrorCode  code,
const char *  msg = 0 
) [inline]

Adds a warning from the DOP error file.

Definition at line 171 of file DOP_Node.h.

void DOP_Node::appendUniqueDataNameSuffix ( UT_String dataname,
bool  usenodepath 
) const [protected]

Appends the name and index number of the node that is applying data. This is used to generate a unique data name.

void DOP_Node::applyDataFromInput ( fpreal  time,
int  inputidx,
int  inputidxforsuffix,
SIM_RootData rootdata,
const char *  parentdataname,
DOP_Engine engine,
UT_StringArray datanames,
bool  changeuniquenamesuffix 
)

This function applies SIM_Data from one of our inputs to some parent data. This is done by calling applyOutputData() for the DOP_Node that is connected to the specfiied input index.

Examples:
DOP/DOP_GroupAndApply.C.

void DOP_Node::applyOutputData ( fpreal  time,
int  outputidx,
SIM_RootData rootdata,
const char *  parentdataname,
DOP_Engine engine,
UT_StringArray datanames 
)

Adds the data corresponding to the specified output to the object. This function calls applyOutputDataSubclass() to do real work.

virtual void DOP_Node::applyOutputDataSubclass ( fpreal  time,
int  outputidx,
SIM_RootData rootdata,
const char *  parentdataname,
DOP_Engine engine,
UT_StringArray datanames 
) [protected, virtual]

This default implementation does nothing because DOP_Node doesn't have any data outputs.

Reimplemented in DOP_Auto, and DOP_SubNet.

static void DOP_Node::buildActivationRules ( void *  data,
PRM_Name menu,
int  maxSize,
const PRM_SpareData ,
PRM_Parm  
) [static]

This function builds a menu of all the rules in the DOPActivationRules file.

static void DOP_Node::buildOperatorTable ( OP_OperatorTable table  )  [static]

Adds DOP_Operators to teh DOP operator table.

virtual OP_ERROR DOP_Node::bypassMe ( OP_Context ,
int &   
) [protected, virtual]

Bypassing a DOP_Node does nothing.

Implements OP_Node.

virtual const DOP_Parent* DOP_Node::castToDOPParent (  )  const [virtual]

Return the const DOP_Parent pointer associated with this node. To cast a DOP_Node to a DOP_Parent, just cast our creator node.

Reimplemented from OP_Node.

virtual DOP_Parent* DOP_Node::castToDOPParent (  )  [virtual]

Return the DOP_Parent pointer associated with this node. To cast a DOP_Node to a DOP_Parent, just cast our creator node.

Reimplemented from OP_Node.

OP_ERROR DOP_Node::checkInputValidity (  )  [protected]

Checks that the input types match the output types connected to them.

virtual void DOP_Node::childFlagChange ( OP_Node  )  [protected, virtual]

Handle changes to our child node display and render flags.

Reimplemented from OP_Network.

void DOP_Node::clearCurrentObjectAndRel (  ) 

Clears the current object and relationship information.

virtual void DOP_Node::clearInterrupted (  )  [virtual]

Reimplemented from OP_Node.

virtual bool DOP_Node::cookedDataUsesAllParameters (  )  const [inline, protected, virtual]

Return true so that we evaluate all parameters on every cook. This ensures handles will update properly in the viewer.

Reimplemented from OP_Node.

Definition at line 282 of file DOP_Node.h.

virtual OP_ERROR DOP_Node::cookMe ( OP_Context  )  [protected, virtual]

Cooking a DOP_Node just performs some basic error checks.

Implements OP_Node.

Reimplemented in DOP_SubNet.

void DOP_Node::copyCurrentObjectAndRelInto ( DOP_Node dest  )  const

This function copies the current object information from this node into another destination node.

virtual void DOP_Node::deleteCookedData (  )  [protected, virtual]

A DOP_Node has no data, so do nothing.

Implements OP_Node.

virtual const char* DOP_Node::getChildType (  )  const [virtual]

Returns "DOP" because our child nodes will be DOP_Nodes.

Reimplemented from OP_Network.

virtual OP_OpTypeId DOP_Node::getChildTypeID (  )  const [virtual]

Returns DOP_OPTYPE_ID because our child nodes will be DOP_Nodes.

Implements OP_Network.

virtual OP_DATA_TYPE DOP_Node::getCookedDataType (  )  const [protected, virtual]

A DOP_Node has no data, so do nothing.

Implements OP_Node.

virtual int DOP_Node::getDandROpsEqual (  )  [virtual]

The display and render ops of a DOP Network are always equal.

Reimplemented from OP_Network.

virtual const char* DOP_Node::getFileExtension ( int  binary  )  const [protected, virtual]

Returns the file extension to use for opsave commands on a DOP_Node.

Implements OP_Node.

virtual fpreal DOP_Node::getH (  )  const [virtual]

Return the absolute height of the tile for this node.

Reimplemented from OP_Node.

void DOP_Node::getInputInfo ( int  inputidx,
DOP_InOutInfo info 
)

Gets information about the specified input. This function calls getInputInfoSubclass() to do the real work.

virtual void DOP_Node::getInputInfoSubclass ( int  inputidx,
DOP_InOutInfo info 
) [protected, virtual]

This default implementation specifies the input accepts objects.

Reimplemented in DOP_Auto, DOP_SubNet, and HDK_Sample::DOP_GroupAndApply.

virtual int DOP_Node::getIWorldTransform ( UT_DMatrix4 xform,
OP_Context  
) [protected, virtual]

Reimplemented from OP_Node.

virtual void DOP_Node::getNodeSpecificInfoText ( OP_Context context,
int  verbose,
UT_WorkBuffer text 
) [virtual]

Get the MMB info text for this node.

Reimplemented from OP_Node.

Reimplemented in DOP_Auto.

virtual const char* DOP_Node::getOpType (  )  const [virtual]

Returns "DOP" because we are a DOP_Node.

Implements OP_Node.

virtual OP_OpTypeId DOP_Node::getOpTypeID (  )  const [virtual]

Returns DOP_OPTYPE_ID because we are a DOP_Node.

Implements OP_Node.

void DOP_Node::getOutputInfo ( int  outputidx,
DOP_InOutInfo info 
)

Gets information about the specified output. This function calls getOutputInfoSubclass() to do the real work.

virtual void DOP_Node::getOutputInfoSubclass ( int  outputidx,
DOP_InOutInfo info 
) [protected, virtual]

This default implementation specifies the output sends out objects.

Reimplemented in DOP_Auto, DOP_AutoRelType, DOP_SubNet, and HDK_Sample::DOP_GroupAndApply.

virtual OP_Node* DOP_Node::getRenderNodePtr (  )  [virtual]

Override this method to always return null. DOP_Nodes are only interested in the display node, not the render node.

Reimplemented from OP_Network.

void DOP_Node::getRequiredOutputs ( fpreal  time,
int  foroutputidx,
UT_RefArray< DOP_Output > &  outputs,
const DOP_Engine engine 
)

Returns information about which DOP_Node outputs are required to process this node. This function calls getRequiredOutputsSubclass() to do the real work.

virtual void DOP_Node::getRequiredOutputsSubclass ( fpreal  time,
int  foroutputidx,
UT_RefArray< DOP_Output > &  outputs,
const DOP_Engine engine 
) [protected, virtual]

This default implementation indicates that all inputs are required.

Reimplemented in DOP_SubNet.

virtual void DOP_Node::getVariableString ( int  index,
UT_String value,
int  thread 
) [virtual]

Handle the evaluation of standards string local variables.

Reimplemented from OP_Parameters.

Reimplemented in DOP_Auto, and DOP_SubNet.

virtual float DOP_Node::getVariableValue ( int  index,
int  thread 
) [virtual]

Handle the evaluation of standard local variables.

Reimplemented from OP_Parameters.

Reimplemented in DOP_Auto, and DOP_SubNet.

virtual fpreal DOP_Node::getW (  )  const [virtual]

Return the absolute width of the tile for this node.

Reimplemented from OP_Node.

virtual int DOP_Node::getWorldTransform ( UT_DMatrix4 xform,
OP_Context  
) [protected, virtual]

DOP Nodes always return their parent's transform, making it easy to do stuff like optransform() from within a dopnetwork.

Reimplemented from OP_Node.

virtual bool DOP_Node::hasDifferentMultiInputs (  )  const [virtual]

Returns whether multi-inputs on this particular op might have different names for each of the inputs, or if the name will always be the same for all the inputs.

Reimplemented from OP_Node.

static void DOP_Node::initializeExpressions (  )  [static]

Adds the DOP specific expression functions.

virtual const char* DOP_Node::inputLabel ( unsigned  idx  )  const [virtual]

REturn text describing a particular input.

Reimplemented from OP_Node.

Reimplemented in DOP_Auto, and DOP_SubNet.

static void DOP_Node::installCommands (  )  [static]

Adss Dop specific hscript commands.

bool DOP_Node::isActive ( float  time  )  [protected]

Returns whether the DOP should do any processing. This function checks the bypass flag and the "activation" parameter if there is one. This function should only be called from getRequiredOutputsSubclass(), partitionObjectsSubclass(), processObjectsSubclass(), and applyOutputDataSubclass().

Examples:
DOP/DOP_GroupAndApply.C.

void DOP_Node::makeFullDataName ( const char *  root,
UT_String name 
) const [protected]

Prefixes the supplied data name with the root name. This utility function is often used to concatenate data paths.

virtual void DOP_Node::opChanged ( OP_EventType  reason,
void *  data = 0 
) [virtual]

Override the opChanged method. Whenever a DOP node parameter changes, we need to notify the simulation engine that it needs to recook the last timestep to reflect the changed DOP values.

Reimplemented from OP_Node.

void DOP_Node::partitionObjects ( fpreal  time,
const SIM_ObjectArray objects,
const UT_PtrArray< SIM_ObjectArray * > &  p,
const DOP_Engine engine 
)

Divides incoming objects among the various outputs from this node. This function calls partitionObjectSubclass() to do the real work.

virtual void DOP_Node::partitionObjectsSubclass ( fpreal  time,
const SIM_ObjectArray objects,
const UT_PtrArray< SIM_ObjectArray * > &  p,
const DOP_Engine engine 
) [protected, virtual]

This default implementation sends all objects to the first output.

void DOP_Node::postNetworkProcessing ( DOP_Engine engine  ) 

This function gets called on all nodes after a timestep completes. This function calls postNetworkProcessingSubclass() on this node, and calls postNetworkProcessing() on all our child DOP_Nodes.

virtual void DOP_Node::postNetworkProcessingSubclass ( DOP_Engine engine  )  [protected, virtual]

This function gets called on all nodes after a timestep completes. The default implementation does nothing.

void DOP_Node::preNetworkProcessing ( DOP_Engine engine  ) 

This function gets called on all nodes before a timestep starts. This function calls preNetworkProcessingSubclass() on this node, and calls preNetworkProcessing() on all our child DOP_Nodes.

virtual void DOP_Node::preNetworkProcessingSubclass ( DOP_Engine engine  )  [protected, virtual]

This function gets called on all nodes before a timestep starts. The default implementation does nothing.

Reimplemented in DOP_Auto.

void DOP_Node::processObjects ( fpreal  time,
int  foroutputidx,
const SIM_ObjectArray objects,
DOP_Engine engine 
)

Processes incoming objects by adding, removing, or modifying data. This function calls processObjectSubclass() to do the real work.

virtual void DOP_Node::processObjectsSubclass ( fpreal  time,
int  foroutputidx,
const SIM_ObjectArray objects,
DOP_Engine engine 
) [protected, virtual]

This default implementation does not affect incoming objects.

Reimplemented in DOP_Auto, DOP_AutoRelType, DOP_AutoSolver, DOP_Python, DOP_SolverPython, and HDK_Sample::DOP_GroupAndApply.

virtual int DOP_Node::propagateModification ( OP_Node by_whom,
OP_EventType  reason,
int  parm_index,
OP_PropagateData prop_data 
) [protected, virtual]

Override propagateModifiction because DOP nodes shouldn't propagate OP_INPUT_CHANGED events from their input nodes. Data doesn't flow through the network, so changes to one node don't necessarily indicate changes to the nodes it is connected to. Other input changed events should be handled normally as they may indicate changes to nodes referenced in expressions on this node.

Reimplemented from OP_Network.

virtual void DOP_Node::referencedParmChanged ( int  pi  )  [virtual]

Handle changes to a parameter that is referenced by one of our parameters. DOP Nodes want to treat this the same as a parm change.

Reimplemented from OP_Node.

virtual int DOP_Node::saveCookedData ( ostream &  ,
OP_Context ,
int   
) [protected, virtual]

A DOP_Node has no data, so do nothing.

Implements OP_Node.

virtual int DOP_Node::saveCookedData ( const char *  ,
OP_Context  
) [protected, virtual]

A DOP_Node has no data, so do nothing.

Implements OP_Node.

static int DOP_Node::setActivationCallback ( void *  data,
int  index,
float  t,
const PRM_Template  
) [static]

This function responds to a selection of the adtivation rule menu by setting the activation parameter.

void DOP_Node::setCurrentObject ( int  objectindex,
int  objectcount,
const SIM_Object object 
)

This functions sets the evaluation object index and the current object pointer that is used for local variable evaluation. It clears the current relationship information.

Examples:
DOP/DOP_GroupAndApply.C.

void DOP_Node::setCurrentRel ( const SIM_Relationship rel  ) 

This functions sets the evaluation relationship index and the current relationship pointer that is used for local variable evaluation. It clears the current object information.

virtual OP_ERROR DOP_Node::setInput ( unsigned  idx,
OP_Node op,
unsigned  outputIdx = 0 
) [virtual]

Override the setInput functions so that we can send notification to the nodes that are our inputs when we disconnect from them. This lets then adjust their tile UI if necessary.

Reimplemented from OP_Node.

virtual OP_ERROR DOP_Node::setInputReference ( unsigned  idx,
const char *  label,
int  keeppos,
unsigned  outputIdx = 0 
) [virtual]

Connects an input to particular node by name in the network.

Reimplemented from OP_Node.

virtual int DOP_Node::updateDandROpsEqual ( int  check_inputs = 1  )  [virtual]

Reimplemented from OP_Network.


Friends And Related Function Documentation

friend class DOP_Parent [friend]

Definition at line 383 of file DOP_Node.h.


Member Data Documentation

The standard DOP local variables. These get added to all DOP nodes automatically by the DOP_Operator constructor.

Definition at line 96 of file DOP_Node.h.

Definition at line 97 of file DOP_Node.h.


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

Generated on Mon Jan 28 00:28:37 2013 for HDK by  doxygen 1.5.9