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