HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SHOP_OperatorInfo.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: SHOP_OperatorInfo.h ( SHOP Library, C++)
7  *
8  * COMMENTS: This is additional information available via every SHOP
9  * operator.
10  */
11 
12 #ifndef __SHOP_OperatorInfo__
13 #define __SHOP_OperatorInfo__
14 
15 #include "SHOP_API.h"
16 #include "SHOP_NodeTypes.h"
17 #include <OP/OP_Operator.h>
18 #include <VEX/VEX_VexTypes.h>
19 #include <VEX/VEX_RslTypes.h>
20 #include <UT/UT_String.h>
21 #include <iosfwd>
22 
23 
24 class OP_ExtraInfoBuffer;
26 
27 
28 // Some clerks should be automatically added to every SHOP of a specify
29 // type (for example OGL shops should be added to all surface SHOPs). The
30 // following enum controls which clerks can add themselves to the
31 // RenderMask.
32 enum {
33  SHOP_AUTOADD_NONE = 0, // No clerks can add themselves
34  SHOP_AUTOADD_STRING = 1, // Only clerks which have string data
35  SHOP_AUTOADD_ANY = 2 // Any clerk can add itself
36 };
37 
39 {
40 public:
42  const char *rmask="*",
44  ~SHOP_OperatorInfo() override;
45 
46  const char *getRenderMask() const { return myRenderMask; }
47  SHOP_TYPE getShaderType() const { return myShaderType; }
48  bool isRenderMaskRSL() const;
49 
50  void setShaderType(SHOP_TYPE t);
51  void setRenderMask(const char *t);
52 
53  void saveToDialogScript(std::ostream &os) const override;
55  OP_ExtraInfoBuffer &b) const override;
56 
57  void setNumOutputs(int n) { myNumOutputs = n; }
58  int getNumOutputs() const { return myNumOutputs; }
59 
60  VEX_ContextType getVexContextType() const;
61  RSL_ContextType getRslContextType() const;
62 
63  /// Obtains context types applicable for the shop. For single-context
64  /// shaders, the list will contain a single entry. For multi-context shaders
65  /// the list will contain several entries. If error, the list will be empty.
66  /// Creates a new instance, thus it is caller's responsibility to delete it.
67  VOP_LanguageContextTypeList * newLanguageContextTypeList() const;
68 
69 
70  bool skipInputEditor() const
71  { return mySkipInputEditor; }
72  void setSkipInputEditor(bool v)
73  { mySkipInputEditor = v; }
74 
75  /// Flag that indicates whether the operator is a vopnet shop material
76  /// containing many shading contexts (eg, surface, displacement, etc).
77  /// @{
78  void setIsMultiContextMaterial( bool flag )
79  { myMultiContextMaterialFlag = flag; }
81  { return myMultiContextMaterialFlag; }
82  /// @}
83 
84  /// @{ Has node input connectors corresponding to co-shader parameters.
85  void setHasInputsForCoshaderParms( bool flag )
86  { myHasInputsForCoshaderParms = flag; }
88  { return myHasInputsForCoshaderParms; }
89  /// @}
90 
91 private:
92  SHOP_TYPE myShaderType;
93  UT_String myRenderMask;
94  int myAutoAdd;
95  int myNumOutputs; // 1 for everything but subnet?
96  bool mySkipInputEditor;
97  bool myMultiContextMaterialFlag;
98  bool myHasInputsForCoshaderParms;
99 };
100 #endif
101 
int getNumOutputs() const
SHOP_TYPE getShaderType() const
void setNumOutputs(int n)
bool hasInputsForCoshaderParms() const
Has node input connectors corresponding to co-shader parameters.
const GLdouble * v
Definition: glew.h:1391
bool skipInputEditor() const
virtual void updateExtraInfoBuffer(OP_ExtraInfoBuffer &b) const
Definition: OP_Operator.h:120
#define SHOP_API
Definition: SHOP_API.h:10
bool getIsMultiContextMaterial() const
const char * getRenderMask() const
SHOP_TYPE
void setSkipInputEditor(bool v)
GLsizei n
Definition: glew.h:4040
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
virtual void saveToDialogScript(std::ostream &os) const =0
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
RSL_ContextType
RenderMan shader context types.
Definition: VEX_RslTypes.h:25
VEX_ContextType
Definition: VEX_VexTypes.h:60
void setHasInputsForCoshaderParms(bool flag)
Has node input connectors corresponding to co-shader parameters.
GLdouble GLdouble t
Definition: glew.h:1398
void setIsMultiContextMaterial(bool flag)