HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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_OpNode.h"
16 
17 SWIGOUT(%rename(VopNode) HOM_VopNode;)
18 
19 class HOM_API HOM_VopNode : virtual public HOM_OpNode
20 {
21 public:
23  : HOM_NetworkMovableItem(HOM_networkItemType::Node)
24  { HOM_CONSTRUCT_OBJECT(this) }
25  HOM_VopNode(const HOM_VopNode &vop_node)
26  : HOM_OpNode(vop_node),
27  HOM_NetworkMovableItem(vop_node)
28  { HOM_CONSTRUCT_OBJECT(this) }
29  ~HOM_VopNode() override
30  { HOM_DESTRUCT_OBJECT(this) }
31 
32  // Let swig know we're overriding __repr__ for this class so it doesn't
33  // provide its own __repr__.
34  SWIGOUT(virtual std::string __repr__() = 0;)
35 
36  virtual HOM_VopNode* insertParmGenerator(
37  const char* input_name, HOM_EnumValue &parm_gen_type,
38  bool reference_input_defaults) = 0;
39  virtual std::map<std::string, HOM_ElemPtr<HOM_Node> >
40  insertParmGeneratorsForAllInputs(
41  HOM_EnumValue &parm_gen_type,
42  bool reference_input_defaults) = 0;
43 
44  virtual HOM_VopNode* parmDefinerNode() = 0;
45 
46  // Deletes a chain of nodes wired into a particular input if and only if
47  // they are wired only into the specified input on this node. Returns true
48  // if nodes were deleted, false otherwise.
49  virtual bool deleteIndependentInputNodes(int input_index) = 0;
50 
51  virtual bool dependsOnlyOn(HOM_VopNode * other_node, int max_connections,
52  bool recurse) = 0;
53 
54  virtual void setIsInputVisible(const char* input_name, bool is_visible) = 0;
55  virtual bool isInputVisible(const char* input_name) = 0;
56 
57  virtual std::vector<std::string> inputDataTypes() = 0;
58  virtual std::vector<std::string> outputDataTypes() = 0;
59  virtual std::vector<std::string> inputParmTypes() = 0;
60  virtual bool isInputCompatible(int idx, HOM_VopNode &other, int other_idx,
61  bool allow_conversions = false) = 0;
62 
63  virtual std::string code() = 0;
64 
65  virtual std::string outerCode() = 0;
66 
67  // Flags.
68  virtual bool isBypassed() = 0;
69  virtual void bypass(bool on) = 0;
70  virtual bool isDebugFlagSet() = 0;
71  virtual void setDebugFlag(bool on) = 0;
72  virtual bool isDetailLowFlagSet() = 0;
73  virtual void setDetailLowFlag(bool on) = 0;
74  virtual bool isDetailMediumFlagSet() = 0;
75  virtual void setDetailMediumFlag(bool on) = 0;
76  virtual bool isDetailHighFlagSet() = 0;
77  virtual void setDetailHighFlag(bool on) = 0;
78  virtual bool isCompressFlagSet() = 0;
79  virtual void setCompressFlag(bool on) = 0;
80  virtual bool isMaterialFlagSet() = 0;
81  virtual void setMaterialFlag(bool on) = 0;
82 
83  // Parameter groups for the network editor UI.
84  virtual void setInputGroupExpanded(const char *group, bool expanded) = 0;
85  virtual bool isInputGroupExpanded(const char *group) = 0;
86  virtual std::vector<int> inputsInGroup(const char *group) = 0;
87  virtual std::vector<std::string> inputGroupNames() = 0;
88  virtual std::vector<int> inputIndexOrder() = 0;
89 
90  // Returns the name of the input that should be used for tunnel-thru
91  // for the given output, when the VOP node's bypass flag is turned on.
92  virtual std::string findBypassInputName(const char *output_name) = 0;
93 
94  // Get the render mask.
95  virtual std::string renderMask() = 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=nullptr) = 0;
112  virtual std::string shaderNameForSignature(
113  const char *signature = nullptr) = 0;
114 
115  virtual HOM_EnumValue& shaderType() = 0;
116 
117  virtual std::string shaderLanguageName() = 0;
118  virtual bool setShaderLanguageName(const char*language_name) = 0;
119 
120  virtual std::string currentSignatureName() = 0;
121 
122  // When a vop is used as a shader node, some parameters may
123  // be overriden by a layered shader (coshader), or a parameter may
124  // specify an oppath for an explicit coshader.
125  // These methods return info about such coshaders.
126  virtual std::vector<HOM_ElemPtr<HOM_Node> > coshaderNodes(
127  const char *parm_name) = 0;
128  virtual std::vector<std::string> coshaderNodesOutputNames(
129  const char *parm_name) = 0;
130 
131  // Given the subnet output name, returns the subnet child and its input
132  // name that corresponds to that subnet output.
133  virtual std::pair<HOM_ElemPtr<HOM_Node>, std::string>
134  subnetTerminalChild( const char *subnet_output_name) = 0;
135 
136  // Return a list of extra bindings from this specific node, in
137  // particular Snippet VOPs triggering bindings via @ references.
138  virtual std::vector<std::string> extraBindings() = 0;
139 
140  // Return a list of shader node parameters that need to be authored on
141  // the USD shader primitive.
142  virtual std::vector<std::string> usdShaderParms(
143  bool force_parms_at_default=false) = 0;
144 
145  // Return a list of shader node parameters that are used to configure
146  // the USD universal/standard preview shader primitive attributes.
147  // They a parameters tagged with the "ogl_*" spare data.
148  virtual std::vector<std::string> usdPreviewShaderParms() = 0;
149 };
150 
151 #endif
152 
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
Definition: Node.h:52
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
virtual HOM_EnumValue * shaderType()=0
HOM_VopNode(const HOM_VopNode &vop_node)
Definition: HOM_VopNode.h:25
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1302
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
~HOM_VopNode() override
Definition: HOM_VopNode.h:29