HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MGR_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 __MGR_Node_h__
9 #define __MGR_Node_h__
10 
11 #include "MGR_API.h"
12 #include <OP/OP_Network.h>
13 
15 
16 // Note: order matches MGRmanagerNames and other tables table.
17 typedef enum {
27  MGR_NUM_MANAGERS // sentinel
29 
30 
31 // Be very cautious about renaming these manager level nodes.
32 // It's relatively safe to do, but if you do, all globbing breaks (i.e.
33 // ^/obj/light1). Which makes it very unsafe right now. Well, at least
34 // for /obj.
35 #define OBJECT_MANAGER_NAME OBJ_SCRIPT_NAME
36 #define OUTPUT_MANAGER_NAME ROP_SCRIPT_NAME
37 #define PARTICLE_MANAGER_NAME POPNET_SCRIPT_NAME
38 #define CHOPNET_MANAGER_NAME CHOPNET_SCRIPT_NAME
39 #define SHOP_MANAGER_NAME SHOP_SCRIPT_NAME
40 #define COMPOSITE2_MANAGER_NAME COPNET_SCRIPT_NAME
41 #define VOPNET_MANAGER_NAME VOPNET_SCRIPT_NAME
42 #define MAT_MANAGER_NAME MAT_SCRIPT_NAME
43 #define LOP_MANAGER_NAME "stage"
44 
45 class MGR_API MGR_Node : public OP_Network
46 {
47 public:
48  virtual const char *getChildType() const;
49  virtual const char *getOpType() const;
50 
51  virtual OP_OpTypeId getChildTypeID() const;
52  virtual OP_OpTypeId getOpTypeID() const;
53  static const char *theChildTableName;
54 
55  static PRM_Template myTemplateList[];
56 
57  virtual OP_Node *getDisplayNodePtr();
58  virtual OP_Node *getRenderNodePtr();
59 
60  // deprecated method: interest gets cleared out before every cook
61  virtual void addExtraInput(OP_Node *op, OP_InterestType type);
62 
63  // Manager nodes do not have outputs
64  virtual unsigned maxOutputs() const { return 0; }
65 
66  static OP_Operator *getManagerOperator(MGR_MANAGER_TYPE type);
67  static const char *getManagerName(MGR_MANAGER_TYPE type);
68  static void initTable(MGR_MANAGER_TYPE type);
69 
70 protected:
72  virtual ~MGR_Node();
73 
74  virtual OP_ERROR cookMe(OP_Context &);
75  virtual OP_ERROR bypassMe(OP_Context &, int &);
76 
77  virtual OP_DataType getCookedDataType() const;
78  virtual void *getCookedData(OP_Context &);
79  virtual void deleteCookedData();
80  virtual int saveCookedData(const char *, OP_Context &);
81  virtual int saveCookedData(std::ostream &os, OP_Context &,
82  int binary = 0);
83  int aliasMatch(const char *name) const;
84 
85  virtual const char *getFileExtension(int binary) const;
86 
87  virtual void childFlagChange(OP_Node *);
88  virtual void addNode(OP_Node *node, int notify=1, int explicitly=1);
90 
91 private:
92  static void buildObjTable(const char *); // Objects
93  static void buildIceTable(const char *); // CompNets
94  static void buildRopTable(const char *); // RopNets
95  static void buildPartTable(const char *); // PopNets
96  static void buildChopTable(const char *); // ChopNets
97  static void buildShopTable(const char *); // Shops
98  static void buildCopTable(const char *); // Comp v2 Nets
99  static void buildVopNetTable(const char *); // VopNets
100  static void buildDopTable(const char *); // Dops
101  static void buildVopTable(const char *); // Vops
102  static void buildTopTable(const char *); // Tops
103  static void buildLopTable(const char *); // Lops
104 
105  // This adds all the management ops to the table. Woe be us!
106  static void addManagementOps(OP_OperatorTable *table);
107 
108  // This builds the funky tables which H_OPZ will install a callback
109  // for. A preposition it is bad to end a sentence with.
110  void buildOpZTables();
111 
112  const char **myAliases;
113  MGR_MANAGER_TYPE myType;
115 
116  // Make a friend of the director so that he can create any manager he
117  // wants.
118  // TODO: Change the friend class when the library is defined
119  friend class MOT_Director;
120 };
121 
122 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
static const char * theChildTableName
Definition: MGR_Node.h:53
virtual OP_OpTypeId getOpTypeID() const =0
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
Filter used by material vop containers.
Definition: SHOP_Node.h:434
UT_ErrorSeverity
Definition: UT_Error.h:25
#define MGR_API
Definition: MGR_API.h:10
virtual OP_ERROR cookMe(OP_Context &context)=0
virtual OP_OperatorFilter * getOperatorFilter()
virtual void childFlagChange(OP_Node *)
virtual const char * getOpType() const =0
OP_InterestType
Definition: OP_DataTypes.h:45
virtual unsigned maxOutputs() const
Definition: MGR_Node.h:64
virtual void * getCookedData(OP_Context &)
OP_OpTypeId
Definition: OP_OpTypeId.h:15
virtual OP_Node * getRenderNodePtr()
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual OP_DataType getCookedDataType() const =0
MGR_MANAGER_TYPE
Definition: MGR_Node.h:17
virtual const char * getChildType() const
virtual const char * getFileExtension(int binary) const =0
virtual void addNode(OP_Node *node, int notify=1, int explicitly=1)
virtual void addExtraInput(OP_Node *op, OP_InterestType type)
Definition: OP_Node.h:1597
OP_DataType
Definition: OP_DataTypes.h:28
virtual OP_OpTypeId getChildTypeID() const =0
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
virtual OP_Node * getDisplayNodePtr()
virtual void deleteCookedData()=0