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  virtual void initializeNode();
25  virtual void initMaterialFlag();
26 
27  virtual bool isOutputVopNode() const;
28  virtual void getCode(UT_String &codestr,
29  const VOP_CodeGenContext &context);
30 
31  virtual const VOP_OutputVar *castToOutputVar() const { return this; }
32  virtual VOP_OutputVar *castToOutputVar() { return this; }
33 
34  virtual void ensureParametersAreValid();
35 
36  virtual const char *inputLabel(unsigned idx) const;
37 
38  virtual unsigned maxInputs() const;
39 
40  virtual bool forceCodeGenerationOfInputs(
41  const VOP_CodeGenContext &context,
42  bool check_shader_context) const;
43  virtual void getContextsForCodeGeneration(
44  UT_StringArray & context_names ) const;
45 
46  void setOUTPUTCODELAST(bool flag);
47  bool OUTPUTCODELAST();
48 
49  /// Gets the concrete context type this node belongs to.
51 
52  /// Obtains the list of global variables that make up the inputs.
54  { return myGlobalVarList; }
55 
56  virtual VOP_Node * findSimpleInputFromOutput(int output_index);
58  int output_index,
59  UT_IntArray & input_indices );
60 
61  virtual bool isVopMethod() const;
62  virtual bool isVopMethodPublic() const;
63  virtual void getVopFunctionName(UT_String &function_name) const;
64  virtual void getVopFunctionReturnInfo(VOP_FunctionArgInfo &i) const;
65  virtual void getVopFunctionArgInfos(
67 
68  /// Sets the node to use the given shader context type.
69  void setSHADERTYPE(VOP_Type shader_type);
70 
71 protected:
72  VOP_OutputVar(OP_Network *parent, const char *name, OP_Operator *entry);
73  virtual ~VOP_OutputVar();
74 
75  virtual bool updateParmsFlags();
76 
77  virtual void preOpChanged(OP_EventType reason, void *data);
78  virtual void getInputNameSubclass(UT_String &in, int idx) const;
79  virtual int getInputFromNameSubclass(const UT_String &in) const;
80  virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info,
81  int idx);
82  virtual void getAllowedInputTypesSubclass(unsigned idx,
83  VOP_VopTypeArray &voptypes);
84  void refreshGlobalVariables();
85 
86  virtual unsigned getNumVisibleOutputs() const;
87  virtual void getOutputNameSubclass(UT_String &out, int idx) const;
88  virtual void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info,
89  int idx);
90 
91 private:
92  virtual void loadFinished();
93  int getLatestVopVersion() const;
94  bool usingShaderType() const;
95  VOP_ContextType SHADERCONTEXTTYPE() const;
96  VOP_Type SHADERTYPE() const;
97 
98  VOP_GlobalVarList myGlobalVarList;
99  VOP_ContextType myShaderContextType;
100  VOP_Type myShaderType;
101  bool myIsSearchingForInputs;
102 };
103 
104 #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 bool updateParmsFlags()
virtual const VOP_OutputVar * castToOutputVar() const
Definition: VOP_OutputVar.h:31
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
virtual const char * inputLabel(unsigned idx) const
virtual bool isOutputVopNode() const
Definition: VOP_Node.h:933
virtual unsigned getNumVisibleOutputs() const
const VOP_GlobalVarList & getGlobalVarList() const
Obtains the list of global variables that make up the inputs.
Definition: VOP_OutputVar.h:53
virtual void getVopFunctionReturnInfo(VOP_FunctionArgInfo &i) const
virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
png_uint_32 i
Definition: png.h:2877
int VOP_ContextType
Definition: VOP_Types.h:149
virtual int getLatestVopVersion() const
Definition: VOP_Node.h:1497
virtual void findSimpleInputCandidatesFromOutput(int output_index, UT_IntArray &input_indices)
Definition: VOP_Node.h:1185
#define VOP_API
Definition: VOP_API.h:10
virtual void preOpChanged(OP_EventType, void *)
Definition: VOP_Node.h:1362
virtual void loadFinished()
virtual bool isVopMethod() const
Returns true if the VOP represents a method inside a class.
GLboolean * data
Definition: glcorearb.h:130
virtual void getVopFunctionArgInfos(UT_Array< VOP_FunctionArgInfo > &arg_infos)
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual VOP_Node * findSimpleInputFromOutput(int output_index)
Definition: VOP_Node.h:1180
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
Definition: VOP_Types.h:24
virtual void getInputNameSubclass(UT_String &in, int idx) const
virtual VOP_ContextType getSpecificShaderContextType() const
png_infop png_uint_32 flag
Definition: png.h:2242
virtual void ensureParametersAreValid()
virtual VOP_OutputVar * castToOutputVar()
Definition: VOP_OutputVar.h:32
virtual bool isVopMethodPublic() const
Returns true if the VOP represents a method inside a class.