All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  */
10 #ifndef __VOP_SubnetOutput_h__
11 #define __VOP_SubnetOutput_h__
13 #include "VOP_API.h"
14 #include <UT/UT_StringArray.h>
15 #include "VOP_Node.h"
18 {
19 public:
20  static OP_Node *myConstructor(OP_Network *net,
21  const char *name,
22  OP_Operator *entry);
23  static PRM_Template myTemplateList[];
25  virtual void getCode(UT_String &codestr,
26  const VOP_CodeGenContext &context);
28  virtual const char *inputLabel(unsigned idx) const;
30  virtual unsigned getNumVisibleInputs() const;
32  virtual bool forceCodeGenerationOfInputs(
33  const VOP_CodeGenContext &context,
34  bool check_shader_context) const;
36  // For suboutput VOPs, moving an input means we should also rewire the
37  // outputs from our containing subnet. We also watch for setInput calls
38  // to rearrange our parent's outputs when inputs are connected or
39  // disconnected from us.
40  virtual void moveInput(int srcidx, int dstidx,
41  bool forcesubnet = false);
42  // Do not call this method yourself. It performs the core work
43  // necessary to move inputs on this subnet output node, but does not
44  // fully account for the synchonizing it with the rest of the
45  // nodes.
46  void moveInputInternal(int srcidx, int dstidx,
47  bool forcesubnet);
48  virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
49  unsigned outputIdx = 0);
50  virtual OP_ERROR setInputReference(unsigned idx,
51  const char *label,
52  int keeppos,
53  unsigned outputIdx = 0);
55  virtual OP_ERROR setNamedInput(const OP_ConnectorId& input_name, OP_Node *op,
56  const OP_ConnectorId* output_name = NULL);
57  virtual OP_ERROR setNamedInputReference(const OP_ConnectorId& input_name,
58  const char *label, int, const OP_ConnectorId* output_name = NULL);
61  // Returns a pointer used by OPUI_OutputNameEditor to get and set data.
63  { return this; }
65  // Provide access to the output name and label parameter functions so
66  // the OPUI_OutputNameEditor can deal with them appropriately.
67  virtual int getNumInputsFromParent() const;
68  virtual void NAMEFROMPARM(UT_String &str, int idx) const;
69  virtual void LABELFROMPARM(UT_String &str, int idx) const;
70  virtual void setNAMEFROMPARM(UT_String &str, int idx);
71  virtual void setLABELFROMPARM(UT_String &str, int idx);
73  void beginWiring();
74  void endWiring();
75  void clearCachedInputNames();
77 protected:
78  VOP_SubnetOutput(OP_Network *parent, const char *name, OP_Operator *entry);
79  virtual ~VOP_SubnetOutput();
81  virtual void preOpChanged(OP_EventType reason, void *data);
83  virtual void getInputNameSubclass(UT_String &in, int idx) const;
84  virtual int getInputFromNameSubclass(const UT_String &in) const;
85  virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info,
86  int idx);
87  virtual void getAllowedInputTypeInfosSubclass(unsigned idx,
88  VOP_VopTypeInfoArray &voptypes);
90 private:
91  void adjustParentForInputChange(int idx, bool inputnull);
92  void getInternalInputName(UT_String &in, int idx) const;
93  void findSafeBase(UT_String &in) const;
94  int mapToParentInputIndex(int index) const;
96  UT_StringArray myInputNames;
97  int myWiringDepth;
98 };
100 #endif
virtual int getInputFromNameSubclass(const UT_String &in) const
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
virtual OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0)
virtual bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &context, bool check_shader_context) const
virtual unsigned getNumVisibleInputs() const
virtual void moveInput(int srcidx, int dstidx, bool forcesubnet=false)
virtual const char * inputLabel(unsigned idx) const
Definition: UT_Error.h:25
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
virtual void preOpChanged(OP_EventType, void *)
Definition: VOP_Node.h:1362
virtual OP_ERROR setInputReference(unsigned idx, const char *label, int keeppos, unsigned outputIdx=0)
Connects an input to particular node by name in the network.
virtual void setLABELFROMPARM(UT_String &str, int idx)=0
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=NULL)
virtual OP_ERROR setNamedInput(const OP_ConnectorId &input_name, OP_Node *op, const OP_ConnectorId *output_name=NULL)
New input functions that use names instead of indices.
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
GLuint index
Definition: glcorearb.h:785
Definition: OP_Value.h:22
virtual void getInputNameSubclass(UT_String &in, int idx) const
virtual void getAllowedInputTypeInfosSubclass(unsigned idx, VOP_VopTypeInfoArray &infos)
virtual VOP_OutputNameEditorSource * getOutputNameEditorSource()
Returns a pointer used by OPUI_OutputNameEditor to get and set data.
virtual void LABELFROMPARM(UT_String &str, int idx) const =0