HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_GenericShader.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  * COMMENTS:
9  */
10 
11 #ifndef __VOP_GenericShader__
12 #define __VOP_GenericShader__
13 
14 #include "VOP_API.h"
15 #include "VOP_Node.h"
16 
18 {
19 public:
20  /// Operator factory.
21  static OP_Operator *createOperator();
22 
23  void SHADERNAME( UT_String &name ) const;
24  void setSHADERNAME( const char *name );
25 
26 protected:
27  /// @{ Standard constructor and destructor for vop nodes.
28  static OP_Node *myConstructor(OP_Network *net,
29  const char *name,
30  OP_Operator *entry);
31  VOP_GenericShader(OP_Network *parent, const char *nm, OP_Operator *op);
32  ~VOP_GenericShader() override;
33  /// @}
34 
35 
36  /// @{ Virtuals related to shader nodes.
37  bool isShader() const override;
38  bool isShader(VOP_Type shader_type) const override;
39  const PRM_Template * getShaderParmTemplates() override;
41  VOP_ShaderNameStyle style,
42  VOP_Type shader_type) const override;
43  void getVopFunctionName(
44  UT_String &function_name
45  ) const override;
46  void opChanged(
47  OP_EventType t, void *data=0) override;
48  bool updateParmsFlags() override;
49  /// @}
50 
51  /// @{ Standard vop virtuals for inputs.
52  unsigned getNumVisibleInputs() const override;
53  unsigned orderedInputs() const override;
55  UT_String &in, int idx) const override;
57  const UT_String &in) const override;
59  VOP_TypeInfo &type_info, int idx) override;
60  /// @}
61 
62  /// @{ Standard vop virtuals for outputs.
63  unsigned getNumVisibleOutputs() const override;
65  UT_String &out, int idx) const override;
67  VOP_TypeInfo &type_info, int idx) override;
68  /// @}
69 
70  /// @{ Other vop virtuals
71  void getCode(UT_String &codestr,
72  const VOP_CodeGenContext &context) override;
73  /// @}
74 
75 private:
76  // Info about inputs and outputs.
77  class InOutData;
78  const InOutData * getInOutData() const;
79 
80 private:
81  // Info about inputs and outputs.
82  mutable UT_UniquePtr<InOutData> myInOutData;
83 };
84 
85 #endif
86 
virtual int getInputFromNameSubclass(const UT_String &in) const
virtual void getVopFunctionName(UT_String &function_name) const
virtual unsigned getNumVisibleInputs() const
virtual UT_StringHolder getShaderName(VOP_ShaderNameStyle style, VOP_Type shader_type) const
Returns the name, type, and render mask of the VOP shader.
bool updateParmsFlags() override
virtual unsigned getNumVisibleOutputs() const
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
GLdouble GLdouble t
Definition: glew.h:1403
GLuint in
Definition: glew.h:11552
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
virtual bool isShader() const
#define VOP_API
Definition: VOP_API.h:10
virtual unsigned orderedInputs() const
virtual void getCode(UT_String &codestr, const VOP_CodeGenContext &context)
Get the code fragment to be included in the shader code.
virtual void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual void getOutputNameSubclass(UT_String &out, int idx) const
OP_EventType
Definition: OP_Value.h:22
VOP_Type
Definition: VOP_Types.h:24
virtual void getInputNameSubclass(UT_String &in, int idx) const
VOP_ShaderNameStyle
The allowed name formats when asking for shader name.
Definition: VOP_Node.h:257
Definition: format.h:895
void opChanged(OP_EventType reason, void *data=0) override
const PRM_Template * getShaderParmTemplates() override
Obtains the template array for shader parameters.