HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DOP_Auto.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: DOP_Auto.h ( SOP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __DOP_Auto_h__
12 #define __DOP_Auto_h__
13 
14 #include "DOP_API.h"
15 #include <SIM/SIM_Options.h>
16 #include <SIM/SIM_RootDataId.h>
17 #include "DOP_Node.h"
18 
19 class DOP_API DOP_Auto : public DOP_Node
20 {
21 public:
22  DOP_Auto(OP_Network *net, const char *name, OP_Operator *entry);
23  virtual ~DOP_Auto();
24 
25  virtual const char *inputLabel(unsigned idx) const;
26  virtual int cookedInputIndex() const
27  { return myLastInput; }
28 
29  virtual OP_ERROR cookMe(OP_Context &context);
30  virtual bool evalVariableValue(
31  fpreal &value, int index, int thread);
32  virtual bool evalVariableValue(
33  UT_String &str,int index, int thread);
34 
35  virtual void getNodeSpecificInfoText(OP_Context &context,
36  OP_NodeInfoParms &iparms);
37  virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree,
38  const OP_NodeInfoTreeParms &parms);
39 
40  static OP_Node *myConstructor(OP_Network *net,
41  const char *name,
42  OP_Operator *entry);
43  static PRM_Template theCommonTemplates[];
44  static CH_LocalVariable theCommonVariables[];
45 
46  virtual void resolveObsoleteParms(
47  PRM_ParmList *obsolete_parms);
48 
49 protected:
50  void setLastCookedInputIndex(int idx) { myLastInput = idx; }
51  virtual void processObjectsSubclass(fpreal time,
52  int foroutputidx,
53  const SIM_ObjectArray &objects,
54  DOP_Engine &engine);
55  /// This function just makes sure we are active and that the object
56  /// being processed is part of our group, and calls doApplyOutputData
57  /// to do all the work of actually attaching the data.
58  virtual void applyOutputDataSubclass(fpreal time,
59  int outputidx,
60  SIM_RootData &rootdata,
61  const char *parentdataname,
62  DOP_Engine &engine,
63  UT_StringArray *datanames);
64  virtual void preNetworkProcessingSubclass(
65  DOP_Engine &engine, bool firstframe);
66  virtual void getInputInfoSubclass(int inputidx,
67  DOP_InOutInfo &info) const;
68  virtual void getOutputInfoSubclass(int outputidx,
69  DOP_InOutInfo &info) const;
70  virtual PRM_Template*getCommonTemplates() const;
71  virtual int getFirstSubdataInput() const;
72  virtual bool getHasInputObjects() const;
73  /// True if we are to have no grey inputs and only work with
74  /// apply data.
75  bool isPureApplyData() const;
76 
77  virtual bool ASSUMEDATACONST();
78  virtual int SHAREDATA();
79  virtual int UNIQUEDATANAME();
80  virtual void DATANAME(UT_String &str, fpreal t);
81 
82  void GROUP(UT_String &str, fpreal t);
83 
84  const SIM_Data *getShareData(const SIM_Engine &engine,
85  const char *lcddatatype);
86  void setShareData(const SIM_RootData &rootdata,
87  const char *dataname);
88  void attachInputSubData(SIM_RootData &rootdata,
89  const char *dataname,
90  DOP_Engine &engine,
91  fpreal time);
92 
93  /// This function actually does all the work for applyOutputDataSubclass.
94  /// This extra level of indirection allows efficient impementation of
95  /// the processObjectsSubclass method. This function calls
96  /// doApplyOutputDataSubclass().
97  void doApplyOutputData(fpreal time,
98  int outputidx,
99  SIM_RootData &rootdata,
100  const char *parentdataname,
101  DOP_Engine &engine,
102  UT_StringArray *datanames,
103  bool active);
104 
105  /// Implements the doApplyOutputData functionality. Making this function
106  /// virtual allows it to be overridden (by DOP_FileData, for example).
107  virtual void doApplyOutputDataSubclass(fpreal time,
108  int outputidx,
109  SIM_RootData &rootdata,
110  const char *parentdataname,
111  DOP_Engine &engine,
112  UT_StringArray *datanames,
113  bool active);
114 
115  void removeData(SIM_RootData &rootdata,
116  const UT_String &dataname);
117 
118  virtual void setAdditionalParametersOnDataSubclass(
119  SIM_Data &data, SIM_RootData &root_data,
120  const char *data_name, DOP_Engine &engine,
121  int output_idx);
122 
123  virtual void syncNodeVersion(const char *old_version,
124  const char *cur_version,
125  bool *node_deleted);
126 
127  virtual bool updateParmsFlags();
128  virtual void getDescriptiveParmName(UT_String &name) const;
129 
130 private:
131  int PARMOP(const char *parmname);
132 
133  bool getParmsToModify(UT_IntArray &parmstomodify,
134  const SIM_Data *existingdata,
135  bool existingdataiscompatibletype);
136  CH_LocalVariable *getVariableById(int index) const;
137  void setParametersOnData(SIM_Data *data,
138  DOP_Engine &engine,
139  const UT_IntArray &parmstomodify,
140  double time);
141  void createData(SIM_RootData &rootdata,
142  const UT_String &dataname,
143  const char *datatype,
144  const char *lcddatatype,
145  DOP_Engine &engine,
146  double time,
147  int outputidx,
148  bool active);
149 
150  const SIM_DopDescription *getDopDescription() const;
151 
152  const SIM_Data *myCurrentData;
153  const SIM_Engine *myCurrentEngine;
154  SIM_Options myOptions;
155  SIM_RootDataId myLastCreatedDataId;
156  UT_String myLastCreatedDataName;
157  int myLastInput;
158 
159 protected:
161  bool myTimeDep;
162 };
163 
164 #endif
virtual bool evalVariableValue(fpreal &v, int index, int thread)
Handle the evaluation of standard local variables.
virtual bool updateParmsFlags()
bool myTimeDep
Definition: DOP_Auto.h:161
uint64 OP_VERSION
Definition: OP_Version.h:6
GT_API const UT_StringHolder time
virtual int cookedInputIndex() const
Definition: DOP_Auto.h:26
virtual void syncNodeVersion(const char *old_version, const char *current_version, bool *node_deleted)
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
OP_VERSION myLastVersionParms
Definition: DOP_Auto.h:160
virtual void processObjectsSubclass(fpreal time, int foroutputidx, const SIM_ObjectArray &objects, DOP_Engine &engine)
This default implementation does not affect incoming objects.
virtual const char * inputLabel(unsigned idx) const
REturn text describing a particular input.
#define DOP_API
Definition: DOP_API.h:10
virtual void getOutputInfoSubclass(int outputidx, DOP_InOutInfo &info) const
This default implementation specifies the output sends out objects.
Holds pointers to a number of SIM_Object objects.
GLboolean * data
Definition: glcorearb.h:130
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &iparms)
Get the MMB info text for this node.
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms)
Get the info tree specific to this node.
virtual void getDescriptiveParmName(UT_String &str) const
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
virtual void resolveObsoleteParms(PRM_ParmList *)
GLuint index
Definition: glcorearb.h:785
virtual void applyOutputDataSubclass(fpreal time, int outputidx, SIM_RootData &rootdata, const char *parentdataname, DOP_Engine &engine, UT_StringArray *datanames)
virtual void getInputInfoSubclass(int inputidx, DOP_InOutInfo &info) const
This default implementation specifies the input accepts objects.
void setLastCookedInputIndex(int idx)
Definition: DOP_Auto.h:50
This is the base class for all DOP nodes.
Definition: DOP_Node.h:75
virtual void preNetworkProcessingSubclass(DOP_Engine &engine, bool firstframe)
virtual OP_ERROR cookMe(OP_Context &)
Cooking a DOP_Node just performs some basic error checks.