HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HOM_VopNode.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  * COMMENTS:
7  */
8 
9 #ifndef __HOM_VopNode_h__
10 #define __HOM_VopNode_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Node.h"
16 
17 // Swig ignores #include by default so we use %include instead.
18 #ifdef SWIG
19 %include <UT/UT_Experimental.h>
20 #else
21 #include <UT/UT_Experimental.h>
22 #endif
23 
24 SWIGOUT(%rename(VopNode) HOM_VopNode;)
25 
26 class HOM_API HOM_VopNode : virtual public HOM_Node
27 {
28 public:
30  : HOM_NetworkMovableItem(HOM_networkItemType::Node)
31  { HOM_CONSTRUCT_OBJECT(this) }
32  HOM_VopNode(const HOM_VopNode &vop_node)
33  : HOM_Node(vop_node),
34  HOM_NetworkMovableItem(vop_node)
35  { HOM_CONSTRUCT_OBJECT(this) }
36  virtual ~HOM_VopNode()
37  { HOM_DESTRUCT_OBJECT(this) }
38 
39  // Let swig know we're overriding __repr__ for this class so it doesn't
40  // provide its own __repr__.
41  SWIGOUT(virtual std::string __repr__() = 0;)
42 
43  virtual HOM_VopNode* insertParmGenerator(
44  const char* input_name, HOM_EnumValue &parm_gen_type,
45  bool reference_input_defaults) = 0;
46  virtual std::map<std::string, HOM_ElemPtr<HOM_Node> >
47  insertParmGeneratorsForAllInputs(
48  HOM_EnumValue &parm_gen_type,
49  bool reference_input_defaults) = 0;
50 
51  virtual HOM_VopNode* parmDefinerNode() = 0;
52 
53  // Deletes a chain of nodes wired into a particular input if and only if
54  // they are wired only into the specified input on this node. Returns true
55  // if nodes were deleted, false otherwise.
56  virtual bool deleteIndependentInputNodes(int input_index) = 0;
57 
58  virtual bool dependsOnlyOn(HOM_VopNode * other_node, int max_connections,
59  bool recurse) = 0;
60 
61  virtual void setIsInputVisible(const char* input_name, bool is_visible) = 0;
62  virtual bool isInputVisible(const char* input_name) = 0;
63 
64  virtual std::vector<std::string> inputDataTypes() = 0;
65  virtual std::vector<std::string> outputDataTypes() = 0;
66  virtual std::vector<std::string> inputParmTypes() = 0;
67  virtual bool isInputCompatible(int idx, HOM_VopNode &other, int other_idx,
68  bool allow_conversions = false) = 0;
69 
70  virtual std::string code() = 0;
71 
72  virtual std::string outerCode() = 0;
73 
74  // Flags.
75  virtual bool isBypassed() = 0;
76  virtual void bypass(bool on) = 0;
77  virtual bool isDebugFlagSet() = 0;
78  virtual void setDebugFlag(bool on) = 0;
79  virtual bool isDetailLowFlagSet() = 0;
80  virtual void setDetailLowFlag(bool on) = 0;
81  virtual bool isDetailMediumFlagSet() = 0;
82  virtual void setDetailMediumFlag(bool on) = 0;
83  virtual bool isDetailHighFlagSet() = 0;
84  virtual void setDetailHighFlag(bool on) = 0;
85  virtual bool isCompressFlagSet() = 0;
86  virtual void setCompressFlag(bool on) = 0;
87  virtual bool isMaterialFlagSet() = 0;
88  virtual void setMaterialFlag(bool on) = 0;
89 
90  // Parameter groups for the network editor UI.
91  virtual void setInputGroupExpanded(const char *group, bool expanded) = 0;
92  virtual bool isInputGroupExpanded(const char *group) = 0;
93  virtual std::vector<int> inputsInGroup(const char *group) = 0;
94  virtual std::vector<std::string> inputGroupNames() = 0;
95  virtual std::vector<int> inputIndexOrder() = 0;
96 
97  // Get the shader string for the render_type. Also, for the multi_type by
98  // default interpret it as a surface (invalid shader type would be better).
99  virtual std::string shaderString(const char *render_type=NULL,
100  HOM_EnumValue &interpret_type = HOM_shaderType::Surface,
101  bool as_encapsulated = false) = 0;
102 
103  // Returns the code for the given shader. If the VOP node is a subnet
104  // returns the encapsulated shader code, otherwise returns the shader code
105  // from the VOP network, or the SHOP.
106  virtual std::string shaderCode(
107  HOM_EnumValue &shader_type = HOM_shaderType::Surface)= 0;
108 
109  SWIGOUT(%kwargs shaderName;)
110  virtual std::string shaderName(
111  bool as_otl_path=true, const char *shader_type_name=NULL)= 0;
112 
113  virtual HOM_EnumValue& shaderType() = 0;
114 
115  virtual std::string shaderLanguageName() = 0;
116 
117  virtual std::string currentSignatureName() = 0;
118 
119  // When a vop is used as a shader node, some parameters may
120  // be overriden by a layered shader (coshader), or a parameter may
121  // specify an oppath for an explicit coshader.
122  // These methods return info about such coshaders.
123  virtual std::vector<HOM_ElemPtr<HOM_Node> > coshaderNodes(
124  const char *parm_name) = 0;
125  virtual std::vector<std::string> coshaderNodesOutputNames(
126  const char *parm_name) = 0;
127 
128  // Return a list of extra bindings from this specific node, in
129  // particular Snippet VOPs triggering bindings via @ references.
130  virtual std::vector<std::string> extraBindings() = 0;
131 };
132 
133 #endif
134 
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:974
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
virtual HOM_EnumValue * shaderType()=0
virtual ~HOM_VopNode()
Definition: HOM_VopNode.h:36
HOM_VopNode(const HOM_VopNode &vop_node)
Definition: HOM_VopNode.h:32
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:973
virtual std::string __repr__()=0