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