HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_SubnetOutput.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: VOP Library (C++)
7  *
8  */
9 
10 #ifndef __VOP_SubnetOutput_h__
11 #define __VOP_SubnetOutput_h__
12 
13 #include "VOP_API.h"
14 #include <UT/UT_StringArray.h>
15 #include "VOP_Node.h"
16 
18 {
19 public:
20  static OP_Node *myConstructor(OP_Network *net,
21  const char *name,
22  OP_Operator *entry);
23  static PRM_Template myTemplateList[];
24 
25  void getCode(UT_String &codestr,
27  ) override;
28 
29  const char *inputLabel(unsigned idx) const override;
30 
31  unsigned getNumVisibleInputs() const override;
32 
35  bool check_shader_context
36  ) const override;
37 
38  // For suboutput VOPs, moving an input means we should also rewire the
39  // outputs from our containing subnet. We also watch for setInput calls
40  // to rearrange our parent's outputs when inputs are connected or
41  // disconnected from us.
42  void moveInput(int srcidx, int dstidx,
43  bool forcesubnet = false) override;
44  // Do not call this method yourself. It performs the core work
45  // necessary to move inputs on this subnet output node, but does not
46  // fully account for the synchonizing it with the rest of the
47  // nodes.
48  void moveInputInternal(int srcidx, int dstidx,
49  bool forcesubnet);
50  OP_ERROR setInput(unsigned idx, OP_Node *op,
51  unsigned outputIdx = 0) override;
53  unsigned idx,
54  const char *label,
55  int keeppos,
56  unsigned outputIdx = 0) override;
57 
59  const OP_ConnectorId &input_name,
60  OP_Node *op,
61  const OP_ConnectorId *output_name = NULL
62  ) override;
64  const OP_ConnectorId &input_name,
65  const char *label,
66  int,
67  const OP_ConnectorId *output_name = NULL
68  ) override;
69 
70  // Returns a pointer used by OPUI_OutputNameEditor to get and set data.
72  { return this; }
73 
74  // Provide access to the output name and label parameter functions so
75  // the OPUI_OutputNameEditor can deal with them appropriately.
76  int getNumInputsFromParent() const override;
77  void NAMEFROMPARM(
78  UT_String &str, int idx) const override;
79  void LABELFROMPARM(
80  UT_String &str, int idx) const override;
81  void setNAMEFROMPARM(
82  UT_String &str, int idx) override;
83  void setLABELFROMPARM(
84  UT_String &str, int idx) override;
85 
86  void beginWiring();
87  void endWiring();
88  void clearCachedInputNames();
89 
90 protected:
91  VOP_SubnetOutput(OP_Network *parent, const char *name, OP_Operator *entry);
92  ~VOP_SubnetOutput() override;
93 
94  void preOpChanged(
95  OP_EventType reason, void *data) override;
96 
98  UT_String &in, int idx) const override;
100  const UT_String &in) const override;
102  VOP_TypeInfo &type_info, int idx) override;
104  unsigned idx,
105  VOP_VopTypeInfoArray &voptypes) override;
106 
107 private:
108  void adjustParentForInputChange(int idx, bool inputnull);
109  void getInternalInputName(UT_String &in, int idx) const;
110  void findSafeBase(UT_String &in) const;
111  int mapToParentInputIndex(int index) const;
112 
113  UT_StringArray myInputNames;
114  int myWiringDepth;
115 };
116 
117 #endif
virtual int getInputFromNameSubclass(const UT_String &in) const
void moveInput(int srcidx, int dstidx, bool forcesubnet=false) override
GLuint const GLchar * name
Definition: glew.h:1814
OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=nullptr) override
GLuint index
Definition: glew.h:1814
virtual bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &context, bool check_shader_context) const
virtual unsigned getNumVisibleInputs() const
virtual const char * inputLabel(unsigned idx) const
OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0) override
UT_ErrorSeverity
Definition: UT_Error.h:25
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.
virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual int getNumInputsFromParent() const =0
virtual void NAMEFROMPARM(UT_String &str, int idx) const =0
#define VOP_API
Definition: VOP_API.h:10
GLuint in
Definition: glew.h:11510
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
virtual void preOpChanged(OP_EventType, void *)
Definition: VOP_Node.h:1426
virtual void setLABELFROMPARM(UT_String &str, int idx)=0
VOP_OutputNameEditorSource * getOutputNameEditorSource() override
Returns a pointer used by OPUI_OutputNameEditor to get and set data.
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:8986
virtual void getCode(UT_String &codestr, const VOP_CodeGenContext &context)
Get the code fragment to be included in the shader code.
virtual void setNAMEFROMPARM(UT_String &str, int idx)=0
OP_EventType
Definition: OP_Value.h:22
virtual void getInputNameSubclass(UT_String &in, int idx) const
virtual void getAllowedInputTypeInfosSubclass(unsigned idx, VOP_VopTypeInfoArray &infos)
OP_ERROR setNamedInput(const OP_ConnectorId &input_name, OP_Node *op, const OP_ConnectorId *output_name=nullptr) override
New input functions that use names instead of indices.
virtual void LABELFROMPARM(UT_String &str, int idx) const =0