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  ~DOP_Auto() override;
24 
25  const char *inputLabel(unsigned idx) const override;
26  int cookedInputIndex() const override
27  { return myLastInput; }
28 
29  OP_ERROR cookMe(OP_Context &context) override;
31  int thread) override;
32  bool evalVariableValue(UT_String &str,int index,
33  int thread) override;
34 
35  void getNodeSpecificInfoText(OP_Context &context,
36  OP_NodeInfoParms &iparms) override;
38  const OP_NodeInfoTreeParms &parms
39  ) override;
40 
41  static OP_Node *myConstructor(OP_Network *net,
42  const char *name,
43  OP_Operator *entry);
44  static PRM_Template theCommonTemplates[];
45  static CH_LocalVariable theCommonVariables[];
46 
48  PRM_ParmList *obsolete_parms) override;
49 
50 protected:
51  void setLastCookedInputIndex(int idx) { myLastInput = idx; }
53  int foroutputidx,
54  const SIM_ObjectArray &objects,
55  DOP_Engine &engine) override;
56  /// This function just makes sure we are active and that the object
57  /// being processed is part of our group, and calls doApplyOutputData
58  /// to do all the work of actually attaching the data.
60  int outputidx,
61  SIM_RootData &rootdata,
62  const char *parentdataname,
63  DOP_Engine &engine,
64  UT_StringArray *datanames) override;
65  void getInputInfoSubclass(int inputidx,
66  DOP_InOutInfo &info) const override;
67  void getOutputInfoSubclass(int outputidx,
68  DOP_InOutInfo &info) const override;
69  virtual PRM_Template*getCommonTemplates() const;
70  virtual int getFirstSubdataInput() const;
71  virtual bool getHasInputObjects() const;
72  /// True if we are to have no grey inputs and only work with
73  /// apply data.
74  bool isPureApplyData() const;
75 
76  virtual bool ASSUMEDATACONST();
77  virtual int SHAREDATA();
78  virtual int UNIQUEDATANAME();
79  virtual void DATANAME(UT_String &str, fpreal t);
80 
81  void GROUP(UT_String &str, fpreal t);
82 
83  const SIM_Data *getShareData(const SIM_Engine &engine,
84  const char *lcddatatype);
85  void setShareData(const SIM_RootData &rootdata,
86  const char *dataname);
87  void attachInputSubData(SIM_RootData &rootdata,
88  const char *dataname,
89  DOP_Engine &engine,
90  fpreal time);
91 
92  /// This function actually does all the work for applyOutputDataSubclass.
93  /// This extra level of indirection allows efficient impementation of
94  /// the processObjectsSubclass method. This function calls
95  /// doApplyOutputDataSubclass().
96  void doApplyOutputData(fpreal time,
97  int outputidx,
98  SIM_RootData &rootdata,
99  const char *parentdataname,
100  DOP_Engine &engine,
101  UT_StringArray *datanames,
102  bool active);
103 
104  /// Implements the doApplyOutputData functionality. Making this function
105  /// virtual allows it to be overridden (by DOP_FileData, for example).
106  virtual void doApplyOutputDataSubclass(fpreal time,
107  int outputidx,
108  SIM_RootData &rootdata,
109  const char *parentdataname,
110  DOP_Engine &engine,
111  UT_StringArray *datanames,
112  bool active);
113 
114  void removeData(SIM_RootData &rootdata,
115  const UT_String &dataname);
116 
117  virtual void setAdditionalParametersOnDataSubclass(
118  SIM_Data &data, SIM_RootData &root_data,
119  const char *data_name, DOP_Engine &engine,
120  int output_idx);
121 
122  void syncNodeVersion(const char *old_version,
123  const char *cur_version,
124  bool *node_deleted) override;
125 
126  bool updateParmsFlags() override;
127  void getDescriptiveParmName(UT_String &name) const override;
128 
130  const DOP_Engine &engine) override;
131 
132 private:
133  int PARMOP(const char *parmname);
134 
135  bool getParmsToModify(UT_IntArray &parmstomodify,
136  const SIM_Data *existingdata,
137  bool existingdataiscompatibletype);
138  CH_LocalVariable *getVariableById(int index) const;
139  void setParametersOnData(SIM_Data *data,
140  DOP_Engine &engine,
141  const UT_IntArray &parmstomodify,
142  double time);
143  void createData(SIM_RootData &rootdata,
144  const UT_String &dataname,
145  const char *datatype,
146  const char *lcddatatype,
147  DOP_Engine &engine,
148  double time,
149  int outputidx,
150  bool active);
151 
152  const SIM_DopDescription *getDopDescription() const;
153 
154  const SIM_Data *myCurrentData;
155  const SIM_Engine *myCurrentEngine;
156  SIM_Options myOptions;
157  SIM_RootDataId myLastCreatedDataId;
158  UT_String myLastCreatedDataName;
159  int myLastInput;
160 
161 protected:
163  bool myTimeDep;
164 };
165 
166 #endif
virtual bool updateParmsFlags()
bool myTimeDep
Definition: DOP_Auto.h:163
uint64 OP_VERSION
Definition: OP_Version.h:6
void syncNodeVersion(const char *old_version, const char *current_version, bool *node_deleted) override
GT_API const UT_StringHolder time
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
OP_VERSION myLastVersionParms
Definition: DOP_Auto.h:162
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble GLdouble t
Definition: glew.h:1403
OP_ERROR cookMe(OP_Context &) override
Cooking a DOP_Node just performs some basic error checks.
virtual void processObjectsSubclass(fpreal time, int foroutputidx, const SIM_ObjectArray &objects, DOP_Engine &engine)
This default implementation does not affect incoming objects.
const char * inputLabel(unsigned idx) const override
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.
void fillInfoTreeNodeSpecific(UT_InfoTree &tree, const OP_NodeInfoTreeParms &parms) override
Get the info tree specific to this node.
bool evalVariableValue(fpreal &v, int index, int thread) override
Handle the evaluation of standard local variables.
virtual void getDescriptiveParmName(UT_String &str) const
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
Parameters for OP_Node::fillInfoTree()/OP_Node::fillInfoTreeNodeSpecific()
virtual void resolveObsoleteParms(PRM_ParmList *)
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint index
Definition: glcorearb.h:786
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:51
int cookedInputIndex() const override
Definition: DOP_Auto.h:26
This is the base class for all DOP nodes.
Definition: DOP_Node.h:77
Definition: core.h:1131
virtual void ensureCachedDataIsValid(const DOP_Engine &engine)
Definition: format.h:895
void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &iparms) override
Get the MMB info text for this node.