HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VOP_Constant.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_Constant_h__
11 #define __VOP_Constant_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 *buildTemplates(const VOP_Language *language);
23 
24  static PRM_Template *getObsolete(const VOP_Language *language);
25 
26  void getCode(UT_String &codestr,
27  const VOP_CodeGenContext &context
28  ) override;
29 
30  const char *outputLabel(unsigned idx) const override;
31 
32  const char * getConstantValueParmName();
33 
34  void setPARMNAME(const UT_String &str);
35  void setPARMLABEL(const UT_String &str);
36  void setPARMTYPEINDEX(int idx);
37  void setPARMSTORAGE(int type);
38 
39  int PARMTYPEINDEX();
40 
41  /// Constant VOP can represent a value of an attribute on a USD shader
42  /// or material primitive. So it can be translated directly to it.
43  bool translatesDirectlyToUSD() const override
44  { return true; }
45 
46 protected:
47  VOP_Constant(OP_Network *net, const char *name, OP_Operator *entry);
48  ~VOP_Constant() override;
49 
50  bool updateParmsFlags() override;
51  void getDescriptiveName(UT_String &name) const override;
52 
54  UT_String &out, int idx) const override;
56  VOP_TypeInfo &type_info, int idx) override;
57 
58 private:
59  VOP_Type getUniformType(int pidx, bool conditioned,
60  const VOP_Language *language=0);
61 
62  void PARMNAME(UT_String &str);
63  void PARMLABEL(UT_String &str);
64  int UNIFORM();
65 };
66 
67 #endif
Reprsents a language for which VOPs can generate source code.
Definition: VOP_Language.h:29
bool translatesDirectlyToUSD() const override
Definition: VOP_Constant.h:43
bool updateParmsFlags() override
#define VOP_API
Definition: VOP_API.h:10
virtual void getDescriptiveName(UT_String &str) const
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual void getCode(UT_String &codestr, const VOP_CodeGenContext &context)
Get the code fragment to be included in the shader code.
virtual const char * outputLabel(unsigned idx) const
virtual void getOutputTypeInfoSubclass(VOP_TypeInfo &type_info, int idx)
virtual void getOutputNameSubclass(UT_String &out, int idx) const
VOP_Type
Enumeration of the built-in (basic) VOP data types.
Definition: VOP_Types.h:25
type
Definition: core.h:1059