HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual bool hasVexShaderParameter(const char *parm_name);
31 
32  virtual const char *getChildType() const;
33  virtual const char *getOpType() const;
34 
35  static const char *theChildTableName;
36  virtual OP_OpTypeId getChildTypeID() const;
37  virtual OP_OpTypeId getOpTypeID() const;
38 
39  virtual void opChanged(OP_EventType reason, void *data=0);
40 
41  // Local variables for compiler option evaluation
42  virtual bool evalVariableValue(UT_String &v,int index, int thread);
43  virtual bool evalVariableValue(fpreal &v,int i, int thr)
44  { return OP_Network::evalVariableValue(v, i, thr); }
45 
46  virtual const char *getInternalOpTable() const;
47  const char *getInternalIndexFile() const;
48  bool getShowOpInTabMenuFlag();
49 
50  virtual OP_Operator *getInternalOperator() const;
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  virtual bool canDestroyNode();
57 
58  // VOPNET's have no outputs
59  virtual unsigned maxOutputs() const { return 0; }
60  // Absolute width
61  virtual fpreal getW() const;
62  // Absolute height
63  virtual fpreal getH() const;
64 
65  // Handle the old parm order parameter by storing it, so it can later
66  // be applied to our output node.
67  virtual void resolveObsoleteParms(PRM_ParmList *obsolete_parms);
68 
69  // Get the management ops associated with vopnets...
70  static OP_Operator *getManagementOperator();
71  static OP_Operator *getSOPManagementOperator();
72  static OP_Operator *getPOPManagementOperator();
73  static OP_Operator *getCHOPManagementOperator();
74  static OP_Operator *getCOP2FilterManagementOperator();
75  static OP_Operator *getCOP2GenManagementOperator();
76  static void addSHOPManagementOperators(OP_OperatorTable *table);
77 
78  static void buildOperatorTable (OP_OperatorTable &table);
79 
80 protected:
81  VOPNET_Node(OP_Network* parent, const char* name,
82  OP_Operator* op);
83  virtual ~VOPNET_Node(void);
84 
85  virtual void getNodeSpecificInfoText(OP_Context &context,
86  OP_NodeInfoParms &iparms);
87  virtual void finishedLoadingNetwork(bool is_child_call=false);
88  virtual void addNode(OP_Node *node, int notify=1, int explicitly=1);
89 
90  virtual OP_ERROR cookMe (OP_Context &context);
91  virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input);
92 
93  virtual OP_DataType getCookedDataType (void) const;
94  virtual void* getCookedData (OP_Context &);
95  virtual void deleteCookedData (void);
96  virtual int saveCookedData (const char *, OP_Context &);
97  virtual int saveCookedData (std::ostream &, OP_Context &,
98  int bin = 0);
99 
100  virtual const char *getFileExtension (int binary) const;
101 
102  void addError(VOPNET_ErrorCodes code, const char *msg=0)
103  { UTaddError("VOPNET", code, msg); }
104  void addMessage(VOPNET_ErrorCodes code, const char *msg=0)
105  { UTaddMessage("VOPNET", code, msg); }
106  void addWarning(VOPNET_ErrorCodes code, const char *msg=0)
107  { UTaddWarning("VOPNET", code, msg); }
108  void addFatal(VOPNET_ErrorCodes code, const char *msg=0)
109  { UTaddFatal("VOPNET", code, msg); }
110 
112  {
113  if (getVopCodeGenerator()
115  .requiresUpdate(0.0))
116  {
120  }
121  }
122 
126 };
127 
128 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
virtual fpreal getH() const
Node position/scale is used by the UI.
const GLdouble * v
Definition: glcorearb.h:836
void addError(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:102
VOP_CodeGenerator * myCodeGenerator
Definition: VOPNET_Node.h:124
virtual OP_OpTypeId getOpTypeID() const =0
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:1923
virtual const char * getInternalOpTable() const
Definition: OP_Node.h:1135
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 updateOwnerSpareParmLayout(bool allow_update_while_loading=false)
Update the owner network's spare parameter layout.
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:1137
png_uint_32 i
Definition: png.h:2877
virtual OP_ERROR cookMe(OP_Context &context)=0
virtual OP_OperatorFilter * getOperatorFilter()
#define VOPNET_API
Definition: VOPNET_API.h:10
virtual void opChanged(OP_EventType reason, void *data=0)
virtual bool canDestroyNode()
Return true if it is safe at this time to destroy this node.
virtual const char * getOpType() const =0
virtual bool evalVariableValue(fpreal &v, int i, int thr)
Definition: VOPNET_Node.h:43
VOP_ExportedParmsManager * exportedParmsManager() const
Return the exported parameters manager.
void addFatal(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:108
virtual void * getCookedData(OP_Context &)
DEP_MicroNode & eventMicroNode(OP_EventType e)
Definition: OP_Node.h:1544
virtual fpreal getW() const
Node position/scale is used by the UI.
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual OP_DataType getCookedDataType() const =0
OP_OpTypeId
Definition: OP_Node.h:263
virtual const char * getChildType() const
double fpreal
Definition: SYS_Types.h:263
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:123
virtual void resolveObsoleteParms(PRM_ParmList *)
void addMessage(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:104
GLuint index
Definition: glcorearb.h:785
void addWarning(VOPNET_ErrorCodes code, const char *msg=0)
Definition: VOPNET_Node.h:106
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:27
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:2531
VOPNET_ErrorCodes
Definition: VOPNET_Error.h:11
virtual void ensureSpareParmsAreUpdatedSubclass()
Definition: VOPNET_Node.h:111
UT_String myObsoleteParmOrder
Definition: VOPNET_Node.h:125
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
UT_API UT_ErrorSeverity UTaddError(const char *type, int code, const char *msg=0, const UT_SourceLocation *loc=0)
virtual void deleteCookedData()=0
virtual unsigned maxOutputs() const
Definition: VOPNET_Node.h:59