HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_Bind.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_Bind_h__
11 #define __VOP_Bind_h__
12 
13 #include "VOP_API.h"
14 #include "VOP_ParameterBase.h"
15 
17 
19 {
20 public:
21  static OP_Node *myConstructor(OP_Network *net,
22  const char *name,
23  OP_Operator *entry);
24  static PRM_Template *buildTemplates(VOP_Language *language);
25 
26  virtual void initializeNode();
27 
28  virtual const VOP_Bind *castToBind() const { return this; }
29  virtual VOP_Bind *castToBind() { return this; }
30 
31  // Get the parm block information that will go in the dialog script
32  // for our VOPNET.
33  virtual void getParameterDeclaration(UT_String &parmdecl,
34  const VOP_Language *language,
35  const VOP_CodeGenContext &context);
36 
37  virtual bool getParmConstantString(const char *parmname,
38  const VOP_TypeInfo &type_info,
39  UT_String &str,
40  bool expand_string,
41  const VOP_Language *language=0);
42 
43  virtual const char *inputLabel(unsigned idx) const;
44 
45  virtual void setPARMNAME(const UT_String &str);
46  void setPARMLABEL(const UT_String &str);
47  virtual void setPARMTYPEINDEX(int type);
48  virtual void setPARMSTORAGE(int type);
49  void setPARMSTRINGTYPE(const char *style);
50  void setPARMOPFILTER(const char *filter);
51 
52  virtual void PARMNAME(UT_String &str) const;
53  virtual void PARMPREFIX(UT_String &str) const;
54  virtual void PARMPOSTFIX(UT_String &str) const;
55  virtual void PARMLABEL(UT_String &str) const;
56  virtual int PARMTYPEINDEX() const;
57  virtual void PARMTYPENAME(UT_String &type_name) const;
58 
59  virtual bool isParmVisible() const;
60  virtual void copySettingsFrom(VOP_ParmGenerator *pvop);
61  virtual void copyDefaultValuesFrom(
62  const PI_EditScriptedParm *parm);
63 
64 protected:
65  VOP_Bind(OP_Network *parent, const char *name,
66  OP_Operator *entry);
67  virtual ~VOP_Bind();
68 
69  virtual bool updateParmsFlags();
70 
71  // Override cook method just so we can set our warnings properly.
72  virtual bool USEASPARMDEFINER() const;
73  virtual bool USEOWNEXPORTCONTEXT() const;
74  virtual bool SHOULDHAVECORRESPONDINGCONNECTOR() const;
75  virtual int UNIFORM() const;
76  virtual int USEBOUND() const;
77  virtual int EXPORTPARM() const;
78  virtual void EXPORTSHADERCONTEXTS(
79  UT_StringArray &context_names) const;
81  virtual void MENUCHOICES(UT_String &str) const;
82  void CALLBACKSTR(UT_String &str) const;
83  void HELPTEXTSTR(UT_String &str) const;
84  int INVISIBLE() const;
85  int JOINNEXT() const;
86  int SHOWLABEL() const;
87  int IRANGE(int index) const;
88  float FRANGE(int index) const;
89 
90  virtual bool needsInput(void);
91 
92  // Build the code to be output when useBound() is true but the parameter
93  // is not actually bound:
94  virtual void getUnboundCode(UT_String &codestr,
95  const VOP_CodeGenContext &context);
96 
97  virtual void getParmDeclarationCode(UT_String &parm_decl,
98  const VOP_CodeGenContext &codegen_ctx,
99  const VOP_Language *language=NULL,
100  bool export_parms=false);
101 
102  // Determines based on the parm index if the PARMNAME may be changed
103  // when this parm is changed.
104  virtual bool getParmCanAffectParmName(int pidx) const;
105 
106  virtual void getInputTypeInfoSubclass(
107  VOP_TypeInfo &type_info, int idx);
108  virtual void getAllowedInputTypesSubclass(unsigned idx,
109  VOP_VopTypeArray &voptypes);
110 
111 private:
112  bool allowMenu(int parmtype) const;
113 
114  // Store the index of the Bind Name and Parameter Type parameters.
115  static int theParmNameParmIndex;
116  static int theParmTypeParmIndex;
117 };
118 
119 #endif
Reprsents a language for which VOPs can generate source code.
Definition: VOP_Language.h:27
virtual const VOP_Bind * castToBind() const
Definition: VOP_Bind.h:28
virtual bool isParmVisible() const =0
virtual int UNIFORM() const =0
virtual bool updateParmsFlags()
virtual void PARMNAME(UT_String &str) const =0
virtual void copySettingsFrom(VOP_ParmGenerator *pvop)
Copy settings from a source parameter generator.
virtual void getAllowedInputTypesSubclass(unsigned idx, VOP_VopTypeArray &voptypes)
virtual bool getParmConstantString(const char *parmname, const VOP_TypeInfo &type_info, UT_String &str, bool expand_string, const VOP_Language *l=0)
Get the constant code that encodes the value of the node parameter.
virtual const char * inputLabel(unsigned idx) const
virtual void copyDefaultValuesFrom(const PI_EditScriptedParm *parm)
virtual bool SHOULDHAVECORRESPONDINGCONNECTOR() const
virtual bool USEOWNEXPORTCONTEXT() const
virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual void PARMLABEL(UT_String &str) const =0
virtual void PARMPREFIX(UT_String &str) const
virtual void EXPORTSHADERCONTEXTS(UT_StringArray &context_names) const
virtual void setPARMTYPEINDEX(int type)
#define VOP_API
Definition: VOP_API.h:10
virtual int PARMTYPEINDEX() const =0
virtual void getParameterDeclaration(UT_String &parmdecl, const VOP_Language *language, const VOP_CodeGenContext &context)
The parameter variable declaration using the syntax of a given language.
virtual int USEBOUND() const
virtual void MENUCHOICES(UT_String &str) const
virtual VOP_Bind * castToBind()
Definition: VOP_Bind.h:29
virtual void getUnboundCode(UT_String &codestr, const VOP_CodeGenContext &context)
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual bool needsInput(void)=0
virtual void PARMPOSTFIX(UT_String &str) const
virtual bool USEASPARMDEFINER() const =0
virtual void setPARMSTORAGE(int type)
GLuint index
Definition: glcorearb.h:785
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual void getParmDeclarationCode(UT_String &parm_decl, const VOP_CodeGenContext &codegen_ctx, const VOP_Language *language=NULL, bool export_parms=false)
virtual void PARMTYPENAME(UT_String &type_name) const
virtual void setPARMNAME(const UT_String &str)
virtual bool getParmCanAffectParmName(int pidx) const =0
virtual void initializeNode()
virtual int EXPORTPARM() const
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296