HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SOP_Visibility.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: SOP Library (C++)
7  *
8  * COMMENTS:
9  * Hides and exposes geometry by adding to/removing from a primitive
10  * group.
11  */
12 
13 #ifndef __SOP_Visibility_h__
14 #define __SOP_Visibility_h__
15 
16 #include "SOP_API.h"
17 #include "SOP_Node.h"
18 
19 // Constants for parameter indices:
20 #define SOP_VISIBILITY_GROUP_INDEX 0
21 #define SOP_VISIBILITY_HIDE_OR_EXPOSE_INDEX 1
22 #define SOP_VISIBILITY_SEL_OR_NONSEL_INDEX 2
23 #define SOP_VISIBILITY_3D_OR_2D_INDEX 3
24 #define SOP_VISIBILITY_CUMULATIVE 4
25 
27 {
28 public:
29  SOP_Visibility(OP_Network *net, const char *name,
30  OP_Operator *entry);
31  virtual ~SOP_Visibility();
32 
33  // These enumerated types are public so users can get or set
34  // parameters.
35  enum { HIDE, EXPOSE };
36  enum { SELECTED, NON_SELECTED };
37  enum { THREE_D, TWO_D, TWO_D_AND_THREE_D };
38 
39  virtual OP_ERROR cookInputGroups(OP_Context &context,
40  int alone = 0);
41 
42  static OP_Node *myConstructor(OP_Network *net,
43  const char *name,
44  OP_Operator *entry);
45 
46  static PRM_Template myTemplateList[];
47 
48 protected:
49  virtual OP_ERROR cookMySop(OP_Context &context);
50  virtual const char *inputLabel(unsigned idx) const;
51 
52  void performVisibility(fpreal t);
53 
54 private:
55  void getGroups(UT_String &str, fpreal t)
56  { evalString(str, SOP_VISIBILITY_GROUP_INDEX, 0, t); }
57  int HIDE_OR_EXPOSE(fpreal t)
59  int SEL_OR_NONSEL(fpreal t)
61  int THREE_D_OR_TWO_D(fpreal t)
62  { return evalInt(SOP_VISIBILITY_3D_OR_2D_INDEX, 0, t); }
63  int CUMULATIVE(fpreal t)
64  { return evalInt(SOP_VISIBILITY_CUMULATIVE, 0, t); }
65 
66  GA_PrimitiveGroup *myGroup;
67 };
68 
69 #endif
virtual const char * inputLabel(unsigned idx) const
#define SOP_VISIBILITY_SEL_OR_NONSEL_INDEX
UT_ErrorSeverity
Definition: UT_Error.h:25
#define SOP_VISIBILITY_CUMULATIVE
void evalString(UT_String &val, int pi, int vi, fpreal t) const
#define SOP_VISIBILITY_HIDE_OR_EXPOSE_INDEX
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual OP_ERROR cookInputGroups(OP_Context &context, int alone=0)
double fpreal
Definition: SYS_Types.h:270
#define SOP_API
Definition: SOP_API.h:10
#define SOP_VISIBILITY_3D_OR_2D_INDEX
exint evalInt(int pi, int vi, fpreal t) const
#define SOP_VISIBILITY_GROUP_INDEX
virtual OP_ERROR cookMySop(OP_Context &context)=0