All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  */
10 #ifndef __VOP_Visualize_h__
11 #define __VOP_Visualize_h__
13 #include "VOP_API.h"
14 #include "VOP_ParameterBase.h"
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  virtual void getCode(UT_String &codestr,
26  const VOP_CodeGenContext &context);
28  virtual void initializeNode();
31  bool check_shader_context) const
32  {
33  if (!getInput(0))
34  return false;
36  check_shader_context);
37  }
39  virtual bool getIsParmGenerator() const
40  { if (!getInput(0)) return false;
43  // Because we switch in and out of being an op generator we
44  // have to dirty the parm generator explicitly on a rewire.
45  virtual void opChanged(OP_EventType reason, void *data=0);
47  // Get the parm block information that will go in the dialog script
48  // for our VOPNET.
49  virtual void getParameterDeclaration(UT_String &parmdecl,
50  const VOP_Language *language,
51  const VOP_CodeGenContext &context);
53  virtual bool getParmConstantString(const char *parmname,
54  const VOP_TypeInfo &type_info,
55  UT_String &str,
56  bool expand_string,
57  const VOP_Language *language=0);
59  virtual const char *inputLabel(unsigned idx) const;
61  virtual void setPARMNAME(const UT_String &str);
62  void setPARMLABEL(const UT_String &str);
63  virtual void setPARMTYPEINDEX(int type);
64  virtual void setPARMSTORAGE(int type);
65  void setPARMSTRINGTYPE(const char *style);
66  void setPARMOPFILTER(const char *filter);
68  virtual void PARMNAME(UT_String &str) const;
69  virtual void PARMPREFIX(UT_String &str) const;
70  virtual void PARMPOSTFIX(UT_String &str) const;
71  virtual void PARMLABEL(UT_String &str) const;
72  virtual int PARMTYPEINDEX() const;
74  virtual bool isParmVisible() const;
75  virtual void copySettingsFrom(VOP_ParmGenerator *pvop);
76  virtual void copyDefaultValuesFrom(
77  const PI_EditScriptedParm *parm);
79 protected:
80  VOP_Visualize(OP_Network *parent, const char *name,
81  OP_Operator *entry);
82  virtual ~VOP_Visualize();
84  virtual bool updateParmsFlags();
86  // Override cook method just so we can set our warnings properly.
87  virtual bool USEASPARMDEFINER() const;
88  virtual int UNIFORM() const;
89  virtual int USEBOUND() const;
90  virtual int EXPORTPARM() const;
92  UT_StringArray &context_names) const;
94  virtual void MENUCHOICES(UT_String &str) const;
95  void CALLBACKSTR(UT_String &str) const;
96  void HELPTEXTSTR(UT_String &str) const;
97  int INVISIBLE() const;
98  int JOINNEXT() const;
99  int SHOWLABEL() const;
100  int IRANGE(int index) const;
101  float FRANGE(int index) const;
103  virtual bool needsInput(void);
105  // Build the code to be output when useBound() is true but the parameter
106  // is not actually bound:
107  virtual void getUnboundCode(UT_String &codestr,
108  const VOP_CodeGenContext &context);
110  virtual void getParmDeclarationCode(UT_String &parm_decl,
111  const VOP_CodeGenContext &codegen_ctx,
112  const VOP_Language *language=NULL,
113  bool export_parms=false);
115  // Determines based on the parm index if the PARMNAME may be changed
116  // when this parm is changed.
117  virtual bool getParmCanAffectParmName(int pidx) const;
119  virtual void getInputTypeInfoSubclass(
120  VOP_TypeInfo &type_info, int idx);
121  virtual void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info,
122  int idx);
123 private:
124  bool allowMenu(int parmtype) const;
126  // Store the index of the Visualize Name and Parameter Type parameters.
127  static int theParmNameParmIndex;
128  static int theParmTypeParmIndex;
129 };
131 #endif
Reprsents a language for which VOPs can generate source code.
Definition: VOP_Language.h:27
virtual bool isParmVisible() const =0
bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &ctx, bool check_shader_context) const
Definition: VOP_Visualize.h:30
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 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 void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual void getInputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual void PARMLABEL(UT_String &str) const =0
virtual bool getIsParmGenerator() const
Returns true if this VOP is a VOP_ParmGenerator or subclass.
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 bool getIsParmGenerator() const
Returns true if this VOP is a VOP_ParmGenerator or subclass.
Definition: VOP_Visualize.h:39
OP_Node * getInput(unsigned idx, bool mark_used=false) const
Returns the node connected to a particular input (may be null).
virtual int USEBOUND() const
virtual void MENUCHOICES(UT_String &str) const
virtual void getUnboundCode(UT_String &codestr, const VOP_CodeGenContext &context)
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual bool needsInput(void)=0
virtual void PARMPOSTFIX(UT_String &str) const
virtual void getCode(UT_String &codestr, const VOP_CodeGenContext &context)
Get the code fragment to be included in the shader code.
virtual bool USEASPARMDEFINER() const =0
virtual void setPARMSTORAGE(int type)
GLuint index
Definition: glcorearb.h:785
Definition: OP_Value.h:22
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 opChanged(OP_EventType reason, void *data=0)
virtual bool forceCodeGenerationOfInputs(const VOP_CodeGenContext &ctx, bool check_shader_context) 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