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