HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_Collect.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_Collect_h__
11 #define __VOP_Collect_h__
12 
13 #include "VOP_API.h"
14 #include "VOP_VariableInput.h"
15 
16 class UT_StringRef;
17 
19 {
20 protected:
21  VOP_Collect(OP_Network *parent, const char *name, OP_Operator *entry);
22  virtual ~VOP_Collect();
23 
24 public:
25  static OP_Operator *createOperator();
26  static OP_Node *myConstructor(OP_Network *net,
27  const char *name,
28  OP_Operator *entry);
29  static PRM_Template myTemplateList[];
30 
31  /// Get nodes that effectively are fed into the collect node. These
32  /// include regular (eg, output) nodes, but also regular nodes indirectly
33  /// connected through a chain of nulls and switches.
34  void getCollectedNodes(VOP_NodeList &outputs);
35 
36  /// Get the types of shaders wired into this collect node.
37  void getCollectedShaderTypes(VOP_ShaderTypeList &types) const;
38 
39  /// Collect VOP is virtually equivalent to a vo material.
40  virtual VOP_Type getShaderType() const;
41 
42 protected:
43  /// Inherited from VOP_Node.
44  virtual void initMaterialFlag();
45 
46  /// Generate the node errors.
47  /// Return true if an error was generated and false otherwise.
48  virtual bool generateErrorsSubclass();
49 
50  /// @{
51  /// API from VOP_VariableInput
52  virtual const char *getVariableOperator() const;
53  virtual const char *getVariableOutputName() const;
54  virtual const char *getVariableInputName() const;
55  virtual VOP_Type *getAllowedTypeCombinations() const;
56  /// @}
57 
58  /// @{ Intercepting input manipulation to notify the parent.
59  virtual void moveInput(int srcidx, int dstidx,
60  bool forcesubnet = false);
61  virtual OP_ERROR setInput(unsigned idx, OP_Node *op,
62  unsigned outputIdx = 0);
63  virtual OP_ERROR setInputReference(unsigned idx, const char *label,
64  int keeppos, unsigned outputIdx = 0);
65  virtual OP_ERROR setNamedInput(const OP_ConnectorId& input_id,
66  OP_Node *op,
67  const OP_ConnectorId* output_name = nullptr);
68  virtual OP_ERROR setNamedInputReference(const OP_ConnectorId& input_id,
69  const char *label, int keeppos,
70  const OP_ConnectorId* output_name = nullptr);
71  /// @}
72 
73  /// @{ In case the collect VOP is assigned as a material.
74  virtual VOP_Node *findShader(VOP_Type shader_type, fpreal now);
75  virtual void findAllShaders( VOP_NodeList &shader_nodes,
76  VOP_ShaderTypeList &shader_types );
78  virtual bool getParameterOrProperty(
79  const UT_StringRef &name, fpreal now,
80  OP_Node *&op, PRM_Parm *&parm,
81  bool create_missing_multiparms,
82  PRM_ParmList *obsolete = 0);
84  const UT_StringRef &chname,
85  fpreal now, OP_Node *&op, PRM_Parm *&parm,
86  int &vector_index,
87  PRM_ParmList *obsolete = 0);
88  /// @}
89 
90  /// Returns true if there is more than one input of the same type.
91  bool hasInputTypeConflicts();
92 
93 private:
94  /// Informs the parent of connector changes.
95  void notifyParentOfInputChange();
96 };
97 
98 #endif
virtual VOP_Type getShaderType() const
Returns the name, type, and render mask of the VOP shader.
virtual void initMaterialFlag()
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
virtual VOP_Node * getProcedural(VOP_Type type)
Material VOP may be able to return a procedural node.
virtual OP_ERROR setInput(unsigned idx, OP_Node *op, unsigned outputIdx=0)
virtual VOP_Type * getAllowedTypeCombinations() const =0
virtual void moveInput(int srcidx, int dstidx, bool forcesubnet=false)
virtual const char * getVariableInputName() const
UT_ErrorSeverity
Definition: UT_Error.h:25
virtual bool generateErrorsSubclass()
#define VOP_API
Definition: VOP_API.h:10
virtual void findAllShaders(VOP_NodeList &shader_nodes, VOP_ShaderTypeList &shader_types)
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 const char * getVariableOutputName() const =0
GLuint const GLchar * name
Definition: glcorearb.h:785
double fpreal
Definition: SYS_Types.h:270
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 OP_ERROR setNamedInputReference(const OP_ConnectorId &input_name, const char *label, int, const OP_ConnectorId *output_name=NULL)
virtual bool getParameterOrPropertyByChannel(const UT_StringRef &chname, fpreal now, OP_Node *&op, PRM_Parm *&parm, int &vector_index, PRM_ParmList *obsolete=0)
VOP_Type
Definition: VOP_Types.h:24
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual bool getParameterOrProperty(const UT_StringRef &name, fpreal now, OP_Node *&op, PRM_Parm *&parm, bool create_missing_multiparms, PRM_ParmList *obsolete=0)
GLsizei GLenum GLenum * types
Definition: glcorearb.h:2541
virtual const char * getVariableOperator() const =0
virtual VOP_Node * findShader(VOP_Type shader_type, fpreal now)