HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOPNET_Node.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  */
7 
8 #ifndef __VOPNET_Node_h__
9 #define __VOPNET_Node_h__
10 
11 #include "VOPNET_API.h"
12 #include "VOPNET_Error.h"
13 #include <OP/OP_Network.h>
14 #include <VOP/VOP_CodeGenerator.h>
16 
17 class UT_String;
18 
19 
21 {
22 public:
23  static CH_LocalVariable myVariableList[];
24  static OP_Node *myConstructor(OP_Network* net,
25  const char* name,
26  OP_Operator* entry);
27 
30  bool hasVexShaderParameter(const char *parm_name) override;
31 
32  const char *getChildType() const override;
33  const char *getOpType() const override;
34 
35  static const char *theChildTableName;
36  OP_OpTypeId getChildTypeID() const override;
37  OP_OpTypeId getOpTypeID() const override;
38 
39  void opChanged(OP_EventType reason, void *data=0) override;
40 
41  // Local variables for compiler option evaluation
42  bool evalVariableValue(UT_String &v,int index, int thread) override;
43  bool evalVariableValue(fpreal &v,int i, int thr) override
44  { return OP_Network::evalVariableValue(v, i, thr); }
45 
46  const char *getInternalOpTable() const override;
47  const char *getInternalIndexFile() const;
48  bool getShowOpInTabMenuFlag();
49 
50  OP_Operator *getInternalOperator() const override;
51  void setInternalOperator(OP_Operator *op);
52  const UT_String &getOperatorName() const;
53 
54  // Returns true if there are any instances of any operator types
55  // defined by us or any of our child nodes.
56  bool canDestroyNode() override;
57 
58  // VOPNET's have no outputs
59  unsigned maxOutputs() const override { return 0; }
60  // Absolute width
61  fpreal getW() const override;
62  // Absolute height
63  fpreal getH() const override;
64 
65  // Handle the old parm order parameter by storing it, so it can later
66  // be applied to our output node.
67  void resolveObsoleteParms(PRM_ParmList *obsolete_parms) override;
68 
69  // Get the management ops associated with vopnets...
70  static OP_Operator *getManagementOperator();
71  static OP_Operator *getSOPManagementOperator();
72 #if 0
73  static OP_Operator *getPOPManagementOperator();
74 #endif
75  static OP_Operator *getCHOPManagementOperator();
76  static OP_Operator *getCOP2FilterManagementOperator();
77  static OP_Operator *getCOP2GenManagementOperator();
78  static void addSHOPManagementOperators(OP_OperatorTable *table);
79 
80  static void buildOperatorTable (OP_OperatorTable &table);
81 
82 protected:
83  VOPNET_Node(OP_Network* parent, const char* name,
84  OP_Operator* op);
85  ~VOPNET_Node() override;
86 
88  OP_Context &context,
89  OP_NodeInfoParms &iparms) override;
91  bool is_child_call=false) override;
92  void addNode(OP_Node *node, int notify=1,
93  int explicitly=1) override;
94 
95  OP_ERROR cookMe(OP_Context &context) override;
96  OP_ERROR bypassMe(OP_Context &context,
97  int &copied_input) override;
98 
99  OP_DataType getCookedDataType() const override;
100  void* getCookedData(const OP_Context &) override;
101  void deleteCookedData() override;
102  int saveCookedData(const char *, OP_Context &) override;
103  int saveCookedData(std::ostream &, OP_Context &,
104  int bin = 0) override;
105 
106  const char *getFileExtension(int binary) const override;
107 
108  void addError(VOPNET_ErrorCodes code, const char *msg=0)
109  { UTaddError("VOPNET", code, msg); }
110  void addMessage(VOPNET_ErrorCodes code, const char *msg=0)
111  { UTaddMessage("VOPNET", code, msg); }
112  void addWarning(VOPNET_ErrorCodes code, const char *msg=0)
113  { UTaddWarning("VOPNET", code, msg); }
114  void addFatal(VOPNET_ErrorCodes code, const char *msg=0)
115  { UTaddFatal("VOPNET", code, msg); }
116 
118  {
119  if (getVopCodeGenerator()
121  .requiresUpdate(0.0))
122  {
126  }
127  }
128 
132 };
133 
134 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
fpreal getH() const override
Node position/scale is used by the UI.
fpreal getW() const override
Node position/scale is used by the UI.
bool evalVariableValue(fpreal &v, int i, int thr) override
Definition: VOPNET_Node.h:43
const GLdouble * v
Definition: glcorearb.h:837
void addError(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:108
VOP_CodeGenerator * myCodeGenerator
Definition: VOPNET_Node.h:130
UT_API UT_ErrorSeverity UTaddFatal(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
virtual const char * getInternalOpTable() const
Definition: OP_Node.h:1183
virtual void finishedLoadingNetwork(bool is_child_call=false)
virtual bool hasVexShaderParameter(const char *parm_name)
UT_ErrorSeverity
Definition: UT_Error.h:25
Parameters for OP_Node::getInfoText()/OP_Node::getNodeSpecificInfoText()
void ensureSpareParmsAreUpdatedSubclass() override
Definition: VOPNET_Node.h:117
void updateOwnerSpareParmLayout(bool allow_update_while_loading=false)
Update the owner network's spare parameter layout.
bool canDestroyNode() override
Return true if it is safe at this time to destroy this node.
virtual void getNodeSpecificInfoText(OP_Context &context, OP_NodeInfoParms &parms)
UT_API UT_ErrorSeverity UTaddMessage(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual OP_Operator * getInternalOperator() const
Definition: OP_Node.h:1185
virtual OP_ERROR cookMe(OP_Context &context)=0
virtual OP_OperatorFilter * getOperatorFilter()
#define VOPNET_API
Definition: VOPNET_API.h:10
VOP_ExportedParmsManager * exportedParmsManager() const
Return the exported parameters manager.
void addFatal(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:114
void opChanged(OP_EventType reason, void *data=0) override
DEP_MicroNode & eventMicroNode(OP_EventType e)
unsigned maxOutputs() const override
Definition: VOPNET_Node.h:59
OP_OpTypeId
Definition: OP_OpTypeId.h:18
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual OP_DataType getCookedDataType() const =0
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
virtual OP_OpTypeId getOpTypeID() const
Definition: OP_Node.h:532
virtual const char * getChildType() 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
virtual const char * getFileExtension(int binary) const =0
virtual void addNode(OP_Node *node, int notify=1, int explicitly=1)
OP_Operator * myInternalOperator
Definition: VOPNET_Node.h:129
virtual void resolveObsoleteParms(PRM_ParmList *)
fpreal64 fpreal
Definition: SYS_Types.h:277
void addMessage(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:110
GLuint index
Definition: glcorearb.h:786
void addWarning(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:112
virtual const char * getOpType() const
UT_API UT_ErrorSeverity UTaddWarning(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
OP_EventType
Definition: OP_Value.h:22
OP_DataType
Definition: OP_DataTypes.h:28
virtual OP_OpTypeId getChildTypeID() const =0
virtual bool evalVariableValue(UT_String &val, int index, int thread)
static const char * theChildTableName
Definition: VOPNET_Node.h:35
virtual VOP_CodeGenerator * getVopCodeGenerator()
Definition: OP_Node.h:2718
virtual void * getCookedData(const OP_Context &)
VOPNET_ErrorCodes
Definition: VOPNET_Error.h:11
UT_String myObsoleteParmOrder
Definition: VOPNET_Node.h:131
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
Definition: format.h:895
UT_API UT_ErrorSeverity UTaddError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual void deleteCookedData()=0