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 CHOPNET_MANAGER_NAME CHOPNET_SCRIPT_NAME
38 #define SHOP_MANAGER_NAME SHOP_SCRIPT_NAME
39 #define COMPOSITE2_MANAGER_NAME COP2NET_SCRIPT_NAME
40 #define VOPNET_MANAGER_NAME VOPNET_SCRIPT_NAME
41 #define MAT_MANAGER_NAME MAT_SCRIPT_NAME
42 #define LOP_MANAGER_NAME "stage"
43 #define TOPNET_MANAGER_NAME "tasks"
44 
45 class MGR_API MGR_Node : public OP_Network
46 {
47 public:
48  const char *getChildType() const override;
49  const char *getOpType() const override;
50 
51  OP_OpTypeId getChildTypeID() const override;
52  OP_OpTypeId getOpTypeID() const override;
53  static const char *theChildTableName;
54 
55  static PRM_Template myTemplateList[];
56 
57  OP_Node *getDisplayNodePtr() override;
58  OP_Node *getRenderNodePtr() override;
59  bool isMaterialManager() const override;
60 
61  // deprecated method: interest gets cleared out before every cook
62  void addExtraInput(OP_Node *op,
63  OP_InterestType type) override;
64 
65  // Manager nodes do not have outputs
66  unsigned maxOutputs() const override { return 0; }
67 
68  static OP_Operator *getManagerOperator(MGR_MANAGER_TYPE type);
69  static const char *getManagerName(MGR_MANAGER_TYPE type);
70  static void initTable(MGR_MANAGER_TYPE type);
71 
72 protected:
74  ~MGR_Node() override;
75 
76  OP_ERROR cookMe(OP_Context &) override;
77  OP_ERROR bypassMe(OP_Context &, int &) override;
78 
79  OP_DataType getCookedDataType() const override;
80  void *getCookedData(OP_Context &) override;
81  void deleteCookedData() override;
82  int saveCookedData(const char *, OP_Context &) override;
83  int saveCookedData(std::ostream &os, OP_Context &,
84  int binary = 0) override;
85  int aliasMatch(const char *name) const;
86 
87  const char *getFileExtension(int binary) const override;
88 
89  void childFlagChange(OP_Node *) override;
90  void addNode(OP_Node *node, int notify=1,
91  int explicitly=1) override;
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 buildDataTable(const char *); // Data
102  static void buildCopTable(const char *); // Comp v3 Nets
103  static void buildCop2Table(const char *); // Comp v2 Nets
104  static void buildVopNetTable(const char *); // VopNets
105  static void buildDopTable(const char *); // Dops
106  static void buildVopTable(const char *); // Vops
107  static void buildTopTable(const char *); // Tops
108  static void buildLopTable(const char *); // Lops
109 
110  // This adds all the management ops to the table. Woe be us!
111  static void addManagementOps(OP_OperatorTable *table);
112 
113  // This builds the funky tables which H_OPZ will install a callback
114  // for. A preposition it is bad to end a sentence with.
115  void buildOpZTables();
116 
117  const char **myAliases;
118  MGR_MANAGER_TYPE myType;
120 
121  // Make a friend of the director so that he can create any manager he
122  // wants.
123  // TODO: Change the friend class when the library is defined
124  friend class MOT_Director;
125 };
126 
127 #endif
virtual int saveCookedData(std::ostream &os, OP_Context &, int binary=0)=0
static const char * theChildTableName
Definition: MGR_Node.h:53
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
Filter used by material vop containers.
Definition: SHOP_Node.h:433
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 *)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
OP_InterestType
Definition: OP_DataTypes.h:44
virtual bool isMaterialManager() const
virtual void * getCookedData(OP_Context &)
OP_OpTypeId
Definition: OP_OpTypeId.h:18
virtual OP_Node * getRenderNodePtr()
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:525
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)
virtual const char * getOpType() const
OP_DataType
Definition: OP_DataTypes.h:28
virtual OP_OpTypeId getChildTypeID() const =0
type
Definition: core.h:1059
virtual OP_ERROR bypassMe(OP_Context &context, int &copied_input)=0
unsigned maxOutputs() const override
Definition: MGR_Node.h:66
virtual OP_Node * getDisplayNodePtr()
virtual void deleteCookedData()=0