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