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  ~OBJ_SubNet() override;
42 
43  const char *getChildType() const override;
44  OBJ_OBJECT_TYPE getObjectType() const override;
45 
46  OP_OpTypeId getChildTypeID() const override;
47 
49  OP_Context &ctx) override;
50 
51  OP_Node *getDisplayNodePtr() override;
52  OP_Node *getRenderNodePtr() override;
53  int isObjectRenderable(fpreal t) const override;
54  OP_Bundle *getVisibleObjectBundle(fpreal t);
55  int isVisibleObject(const OBJ_Node *node,
56  fpreal t) const;
57 
58  void opChanged(OP_EventType reason,
59  void *data=0) override;
60  void referencedParmChanged(int parm_index) override;
61 
62  OP_ERROR setInput(unsigned idx, OP_Node *op,
63  unsigned outputIdx = 0) override;
65  unsigned idx,
66  const char *label,
67  int keeppos,
68  unsigned outputIdx = 0) override;
70  unsigned idx,
71  OP_IndirectInput *in) override;
73  const OP_ConnectorId& input_name,
74  OP_Node *op,
75  const OP_ConnectorId* output_name=NULL
76  ) override;
78  const OP_ConnectorId& input_name,
79  const char *label,
80  int,
81  const OP_ConnectorId *output_name=NULL
82  ) override;
84  const OP_ConnectorId& input_name,
85  OP_IndirectInput *input) override;
86 
87  bool getSubnetTransform(OP_Context &context,
88  UT_DMatrix4 &mat);
89 
90  void LABEL(UT_String &str, int idx);
91 
92  void OUTPUTOBJ(UT_String &str) const
93  {
94  evalString(str, "outputobj",
96  0, 0.0f);
97  }
98  int parmIndexOUTPUTOBJ() const
99  {
100  return getCachedParmIndex(
101  "outputobj", I_OUTPUTOBJ);
102  }
103 
105  {
106  evalString(str, "visibleobjects",
108  0, t);
109  }
110  void setVISIBLEOBJECTS(const UT_String &str,
111  CH_StringMeaning meaning, fpreal t)
112  {
113  setString(str, meaning, "visibleobjects",
115  0, t);
116  }
118  {
119  return getCachedParmIndex(
120  "visibleobjects", I_VISIBLEOBJECTS);
121  }
122 
123  static OP_Node *myConstructor(OP_Network *net,
124  const char *name,
125  OP_Operator *entry);
126 
127  static const char *theChildTableName;
128 
129  static PRM_Template *getTemplateList(OBJ_ParmsStyle style);
130 
131  OBJ_SubNet *castToOBJSubNet() override { return this; }
132 
133  void getParallelInputs(
134  OP_Context &context,
135  OP_NodeList &nodes) const override;
136 
137  int doDrawLit() const override { return 1; }
138 
139 protected:
140  // Used to get pointer to indirection indices for each object type
141  int *getIndirect() const override
142  { return subnetIndirect; }
143 
144  OP_ERROR cookMyObj(OP_Context &context) override;
145  void childFlagChange(OP_Node *) override;
146  const char *inputLabel(unsigned idx) const override;
147 
148  void buildParmDependency( int parm_index ) override;
149 
150  bool getTimeOverride() override;
151 
152 private:
153  bool internalDisplayDisabled(fpreal t);
154  void propagateDisplayChangeToDescendents(
155  bool visible_children_changed);
156  void checkInternalExtraInputTimeDependency(
157  fpreal t);
158  void updateInternalTimeDependency();
159 
160  bool myResetInternalTimeDependent;
161  bool myInternalTimeDependent;
162  bool myInternalExtraInputTimeDependent;
163  int myLastDisplayDisabled;
164 
165  static int *subnetIndirect;
166  static int myLastInternalParmIndex;
167 };
168 
169 #endif
OP_OpTypeId getChildTypeID() const override
virtual bool getTimeOverride()
Definition: OBJ_Node.h:1418
OBJ_ParmsStyle
Definition: OBJ_Node.h:207
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
void OUTPUTOBJ(UT_String &str) const
Definition: OBJ_SubNet.h:92
void referencedParmChanged(int parm_index) override
OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=NULL) override
CH_StringMeaning
OP_ERROR setIndirectInput(unsigned idx, OP_IndirectInput *in) override
Connects an input to an indirect input of our parent subnet.
static const char * theChildTableName
Definition: OBJ_SubNet.h:127
UT_ErrorSeverity
Definition: UT_Error.h:25
void VISIBLEOBJECTS(UT_String &str, fpreal t)
Definition: OBJ_SubNet.h:104
virtual OBJ_OBJECT_TYPE getObjectType() const =0
void setString(const UT_StringRef &val, CH_StringMeaning meaning, int parmi, int vectori, fpreal t)
int parmIndexOUTPUTOBJ() const
Definition: OBJ_SubNet.h:98
virtual void childFlagChange(OP_Node *)
bool getBoundingBox(UT_BoundingBox &box, OP_Context &ctx) override
GLfloat f
Definition: glcorearb.h:1926
virtual int * getIndirect() const =0
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:1390
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.
OBJ_SubNet * castToOBJSubNet() override
Definition: OBJ_SubNet.h:131
virtual OP_ERROR cookMyObj(OP_Context &context)
OP_OpTypeId
Definition: OP_OpTypeId.h:18
virtual OP_Node * getRenderNodePtr()
GLuint const GLchar * name
Definition: glcorearb.h:786
GLdouble t
Definition: glad.h:2397
int doDrawLit() const override
Definition: OBJ_SubNet.h:137
virtual int isObjectRenderable(fpreal t) const
void getParallelInputs(OP_Context &context, OP_NodeList &nodes) const override
fpreal64 fpreal
Definition: SYS_Types.h:277
OP_EventType
Definition: OP_Value.h:22
virtual void buildParmDependency(int parm_index)
const char * getChildType() const override
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.
OBJ_SubNetIndex
Definition: OBJ_SubNet.h:22
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 opChanged(OP_EventType reason, void *data=0) override
int * getIndirect() const override
Definition: OBJ_SubNet.h:141
#define OBJ_API
Definition: OBJ_API.h:10
OP_ERROR setNamedIndirectInput(const OP_ConnectorId &input_name, OP_IndirectInput *input) override
Definition: format.h:895
void setVISIBLEOBJECTS(const UT_String &str, CH_StringMeaning meaning, fpreal t)
Definition: OBJ_SubNet.h:110
virtual OP_Node * getDisplayNodePtr()
OBJ_OBJECT_TYPE
Definition: OBJ_Node.h:73
int parmIndexVISIBLEOBJECTS() const
Definition: OBJ_SubNet.h:117