HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_OutputVar.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_OutputVar_h__
11 #define __VOP_OutputVar_h__
12 
13 #include "VOP_API.h"
14 #include "VOP_Node.h"
15 
17 {
18 public:
19  static OP_Node *myConstructor(OP_Network *net,
20  const char *name,
21  OP_Operator *entry);
22  static PRM_Template myTemplateList[];
23 
24  void initializeNode() override;
25  void initMaterialFlag() override;
26 
27  bool isOutputVopNode() const override;
28  void getCode(UT_String &codestr,
29  const VOP_CodeGenContext &context
30  ) override;
31 
32  const VOP_OutputVar *castToOutputVar() const override
33  { return this; }
34  VOP_OutputVar *castToOutputVar() override { return this; }
35 
36  void ensureParametersAreValid() override;
37 
38  const char *inputLabel(unsigned idx) const override;
39 
40  unsigned maxInputs() const override;
41 
43  const VOP_CodeGenContext &context,
44  bool check_shader_context
45  ) const override;
47  UT_StringArray & context_names
48  ) const override;
49 
50  void setOUTPUTCODELAST(bool flag);
51  bool OUTPUTCODELAST();
52 
53  /// Gets the concrete context type this node belongs to.
55 
56  /// Obtains the list of global variables that make up the inputs.
58  { return myGlobalVarList; }
59 
61  int output_index) override;
63  int output_index,
64  UT_IntArray & input_indices) override;
65 
66  bool isVopMethod() const override;
67  bool isVopMethodPublic() const override;
68  void getVopFunctionName(
69  UT_String &function_name) const override;
71  VOP_FunctionArgInfo &i) const override;
74  ) override;
75 
76  /// Sets the node to use the given shader context type.
77  void setSHADERTYPE(VOP_Type shader_type);
78 
79 protected:
80  VOP_OutputVar(OP_Network *parent, const char *name, OP_Operator *entry);
81  ~VOP_OutputVar() override;
82 
83  bool updateParmsFlags() override;
84 
85  void preOpChanged(
86  OP_EventType reason, void *data) override;
88  UT_String &in, int idx) const override;
90  const UT_String &in) const override;
92  VOP_TypeInfo &type_info, int idx) override;
94  unsigned idx,
95  VOP_VopTypeArray &voptypes) override;
96  void refreshGlobalVariables();
97 
98  unsigned getNumVisibleOutputs() const override;
100  UT_String &out, int idx) const override;
102  VOP_TypeInfo &type_info, int idx) override;
103 
104 private:
105  void loadFinished() override;
106  int getLatestVopVersion() const override;
107  bool usingShaderType() const;
108  VOP_ContextType SHADERCONTEXTTYPE() const;
109  VOP_Type SHADERTYPE() const;
110 
111  VOP_GlobalVarList myGlobalVarList;
112  VOP_ContextType myShaderContextType;
113  VOP_Type myShaderType;
114  bool myIsSearchingForInputs;
115 };
116 
117 #endif
virtual int getInputFromNameSubclass(const UT_String &in) const
virtual void getVopFunctionName(UT_String &function_name) const
virtual void getContextsForCodeGeneration(UT_StringArray &context_names) const
virtual void initMaterialFlag()
virtual void getAllowedInputTypesSubclass(unsigned idx, VOP_VopTypeArray &voptypes)
virtual unsigned maxInputs() const
Maximum inputs that can be connected to a node.
virtual bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &context, bool check_shader_context) const
bool updateParmsFlags() override
virtual const char * inputLabel(unsigned idx) const
virtual bool isOutputVopNode() const
Definition: VOP_Node.h:978
virtual unsigned getNumVisibleOutputs() const
const VOP_GlobalVarList & getGlobalVarList() const
Obtains the list of global variables that make up the inputs.
Definition: VOP_OutputVar.h:57
virtual void getVopFunctionReturnInfo(VOP_FunctionArgInfo &i) const
virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
int VOP_ContextType
Definition: VOP_Types.h:177
virtual int getLatestVopVersion() const
Definition: VOP_Node.h:1597
virtual void findSimpleInputCandidatesFromOutput(int output_index, UT_IntArray &input_indices)
Definition: VOP_Node.h:1269
#define VOP_API
Definition: VOP_API.h:10
VOP_OutputVar * castToOutputVar() override
Definition: VOP_OutputVar.h:34
virtual void preOpChanged(OP_EventType, void *)
Definition: VOP_Node.h:1453
virtual void loadFinished()
virtual bool isVopMethod() const
Returns true if the VOP represents a method inside a class.
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual void getVopFunctionArgInfos(UT_Array< VOP_FunctionArgInfo > &arg_infos)
const VOP_OutputVar * castToOutputVar() const override
Definition: VOP_OutputVar.h:32
virtual VOP_Node * findSimpleInputFromOutput(int output_index)
Definition: VOP_Node.h:1264
virtual void initializeNode()
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
Enumeration of the built-in (basic) VOP data types.
Definition: VOP_Types.h:25
virtual void getInputNameSubclass(UT_String &in, int idx) const
virtual VOP_ContextType getSpecificShaderContextType() const
virtual void ensureParametersAreValid()
virtual bool isVopMethodPublic() const
Returns true if the VOP represents a method inside a class.
Definition: format.h:895