HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OBJ_SubNet.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  * NAME: OBJ_SubNet.h (Custom Library, C++)
7  *
8  * COMMENTS: An object to describe a motion capture handle
9  *
10  */
11 
12 #ifndef __OBJ_SubNet__
13 #define __OBJ_SubNet__
14 
15 #include "OBJ_API.h"
16 #include <UT/UT_DMatrix4.h>
17 #include "OBJ_Node.h"
18 #include "OBJ_Shared.h"
19 
20 class OP_Bundle;
21 
23 {
28 
31 
33 };
34 
35 class OBJ_API OBJ_SubNet : public OBJ_Node
36 {
37 public:
39  const char *name,
40  OP_Operator *op);
41  virtual ~OBJ_SubNet();
42 
43  virtual const char *getChildType() const;
44  virtual OBJ_OBJECT_TYPE getObjectType() const;
45 
46  virtual OP_OpTypeId getChildTypeID() const;
47 
48  virtual bool getBoundingBox(UT_BoundingBox &box,
49  OP_Context &ctx);
50 
51  virtual OP_Node *getDisplayNodePtr();
52  virtual OP_Node *getRenderNodePtr();
53  virtual int isObjectRenderable(fpreal t) const;
54  OP_Bundle *getVisibleObjectBundle(fpreal t);
55  int isVisibleObject(const OBJ_Node *node,
56  fpreal t) const;
57 
58  virtual void opChanged(OP_EventType reason, void *data=0);
59  virtual void referencedParmChanged(int parm_index);
60 
61  virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
62  unsigned outputIdx = 0);
63  virtual OP_ERROR setInputReference(unsigned idx,
64  const char *label,
65  int keeppos,
66  unsigned outputIdx = 0);
67  virtual OP_ERROR setIndirectInput(unsigned idx,
68  OP_IndirectInput *in);
69  virtual OP_ERROR setNamedInput(
70  const OP_ConnectorId& input_name,
71  OP_Node *op,
72  const OP_ConnectorId* output_name=NULL);
74  const OP_ConnectorId& input_name,
75  const char *label,
76  int,
77  const OP_ConnectorId *output_name=NULL);
79  const OP_ConnectorId& input_name,
80  OP_IndirectInput *input);
81 
82  bool getSubnetTransform(OP_Context &context,
83  UT_DMatrix4 &mat);
84 
85  void LABEL(UT_String &str, int idx);
86 
87  void OUTPUTOBJ(UT_String &str) const
88  {
89  evalString(str, "outputobj",
91  0, 0.0f);
92  }
93  int parmIndexOUTPUTOBJ() const
94  {
95  return getCachedParmIndex(
96  "outputobj", I_OUTPUTOBJ);
97  }
98 
100  {
101  evalString(str, "visibleobjects",
103  0, t);
104  }
105  void setVISIBLEOBJECTS(const UT_String &str,
106  CH_StringMeaning meaning, fpreal t)
107  {
108  setString(str, meaning, "visibleobjects",
110  0, t);
111  }
113  {
114  return getCachedParmIndex(
115  "visibleobjects", I_VISIBLEOBJECTS);
116  }
117 
118  static OP_Node *myConstructor(OP_Network *net,
119  const char *name,
120  OP_Operator *entry);
121 
122  static const char *theChildTableName;
123 
124  static PRM_Template *getTemplateList(OBJ_ParmsStyle style);
125 
126  virtual OBJ_SubNet *castToOBJSubNet() { return this; }
127 
128  virtual void getParallelInputs(OP_Context &context,
129  OP_NodeList &nodes) const;
130 
131  virtual int doDrawLit() const { return 1; }
132 
133 protected:
134  // Used to get pointer to indirection indices for each object type
135  virtual int *getIndirect() const
136  { return subnetIndirect; }
137 
138  virtual OP_ERROR cookMyObj(OP_Context &context);
139  virtual void childFlagChange(OP_Node *);
140  virtual const char *inputLabel(unsigned idx) const;
141 
142  virtual void buildParmDependency( int parm_index );
143 
144  virtual bool getTimeOverride();
145 
146 private:
147  bool internalDisplayDisabled(fpreal t);
148  void propagateDisplayChangeToDescendents(
149  bool visible_children_changed);
150  void checkInternalExtraInputTimeDependency(
151  fpreal t);
152  void updateInternalTimeDependency();
153 
154  bool myResetInternalTimeDependent;
155  bool myInternalTimeDependent;
156  bool myInternalExtraInputTimeDependent;
157  int myLastDisplayDisabled;
158 
159  static int *subnetIndirect;
160  static int myLastInternalParmIndex;
161 };
162 
163 #endif
virtual int doDrawLit() const
Definition: OBJ_SubNet.h:131
virtual bool getTimeOverride()
Definition: OBJ_Node.h:1391
OBJ_ParmsStyle
Definition: OBJ_Node.h:205
virtual OP_ERROR setInputReference(unsigned idx, const char *label, int keeppos, unsigned outputIdx=0) override
Connects an input to particular node by name in the network.
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
void OUTPUTOBJ(UT_String &str) const
Definition: OBJ_SubNet.h:87
virtual OP_ERROR setNamedIndirectInput(const OP_ConnectorId &input_name, OP_IndirectInput *input) override
CH_StringMeaning
static const char * theChildTableName
Definition: OBJ_SubNet.h:122
UT_ErrorSeverity
Definition: UT_Error.h:25
void VISIBLEOBJECTS(UT_String &str, fpreal t)
Definition: OBJ_SubNet.h:99
virtual OBJ_OBJECT_TYPE getObjectType() const =0
void setString(const UT_StringRef &val, CH_StringMeaning meaning, int parmi, int vectori, fpreal t)
virtual void opChanged(OP_EventType reason, void *data=0) override
int parmIndexOUTPUTOBJ() const
Definition: OBJ_SubNet.h:93
virtual void referencedParmChanged(int parm_index) override
virtual void childFlagChange(OP_Node *)
virtual OP_OpTypeId getChildTypeID() const override
GLfloat f
Definition: glcorearb.h:1925
virtual const char * getChildType() const override
virtual int * getIndirect() const =0
virtual int * getIndirect() const
Definition: OBJ_SubNet.h:135
virtual OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=NULL) override
void evalString(UT_String &val, int pi, int vi, fpreal t) const
int getCachedParmIndex(const UT_StringRef &name, int name_idx) const
Definition: OBJ_Node.h:1363
virtual OP_ERROR cookMyObj(OP_Context &context)
OP_OpTypeId
Definition: OP_OpTypeId.h:15
virtual OP_Node * getRenderNodePtr()
GLboolean * data
Definition: glcorearb.h:130
virtual OP_ERROR setNamedInput(const OP_ConnectorId &input_name, OP_Node *op, const OP_ConnectorId *output_name=NULL) override
New input functions that use names instead of indices.
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:270
virtual int isObjectRenderable(fpreal t) const
virtual bool getBoundingBox(UT_BoundingBox &box, OP_Context &ctx) override
virtual void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const override
OP_EventType
Definition: OP_Value.h:22
virtual void buildParmDependency(int parm_index)
OBJ_SubNetIndex
Definition: OBJ_SubNet.h:22
#define OBJ_API
Definition: OBJ_API.h:10
virtual OBJ_SubNet * castToOBJSubNet()
Definition: OBJ_SubNet.h:126
virtual OP_ERROR setIndirectInput(unsigned idx, OP_IndirectInput *in) override
Connects an input to an indirect input of our parent subnet.
virtual OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0) override
Sets a given input to connect to an output of a particular node.
void setVISIBLEOBJECTS(const UT_String &str, CH_StringMeaning meaning, fpreal t)
Definition: OBJ_SubNet.h:105
virtual OP_Node * getDisplayNodePtr()
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:71
int parmIndexVISIBLEOBJECTS() const
Definition: OBJ_SubNet.h:112