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