HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CHOP_Handle.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: CHOP_Handle.h ( CHOP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __CHOP_Handle__
12 #define __CHOP_Handle__
13 
14 #include "CHOP_API.h"
15 #include "CHOP_Node.h"
16 #include "CHOP_Types.h"
17 #include <CL/CL_Defines.h>
18 #include <UT/UT_Color.h>
19 
20 class CHOP_Handle;
21 class CHOP_Node;
22 
24 
28 };
29 
31 
35 };
36 
37 #define HANDLE_LABEL_LEFT 0x01
38 #define HANDLE_LABEL_RIGHT 0
39 
40 #define HANDLE_LABEL_TOP 0x02
41 #define HANDLE_LABEL_BOTTOM 0
42 
43 #define HANDLE_BAR 0x04
44 #define HANDLE_GRAPH 0
45 
46 #define HANDLE_WIDTH_END 0x08
47 
48 #define DEFAULT_FLAGS (HANDLE_LABEL_LEFT | \
49  HANDLE_LABEL_BOTTOM | HANDLE_GRAPH)
50 
51 class
53 {
54 public:
55 
56  int shift; // select ourselves as well
57  fpreal xoffset; // x position in samples
58  fpreal yoffset; // y position
59  CL_Unit unit; // return value should be in this unit
60 };
61 
63 
64 public:
65 
67  const char *name,
68  int id,
70  fpreal yoffset = 0,
73  int type_flag = DEFAULT_FLAGS
74  );
75 
76 
77 
78  CHOP_Handle();
79  ~CHOP_Handle();
80  unsigned operator== (const CHOP_Handle &v) const;
82 
84  { myColorOffset = offset; }
85 
86  UT_Color getChopColor(const CL_Clip *clip=nullptr ) const
87  { return myParent->getChopColor(myColorOffset,clip); }
88 
89  CHOP_Node *getCHOP() { return myParent; }
90  const char *getName() const { return myName; }
91  unsigned int getId() const { return myId; }
92  fpreal getXoffset() const { return myXoffset; }
93  fpreal getYoffset() const { return myYoffset; }
94  CHOP_HandleLook getLook() const { return myLook; }
95  CHOP_HandleMotion getMotion() const { return myMotion; }
96 
97  int isLabelLeft() const
98  { return (myFlags & HANDLE_LABEL_LEFT) ? 1:0; }
99 
100  int isLabelTop() const
101  { return (myFlags & HANDLE_LABEL_TOP) ? 1:0; }
102 
103  int isBar() const
104  { return (myFlags & HANDLE_BAR) ? 1:0; }
105 
106  int isWidthEnd() const
107  { return (myFlags & HANDLE_WIDTH_END) ? 1:0; }
108 
109  void setSubParent(int idx)
110  { mySubParentIdx = idx; }
111 
112  int getSubParent() const
113  { return mySubParentIdx; }
114 
115  int isSelected() const
116  { return mySelected; }
117 
118  void setSelected(int yesno)
119  { mySelected = yesno; }
120 
121  int64 getMemoryUsage(bool inclusive) const;
122 
123 private:
124 
125  CHOP_Node *myParent;
126  int mySubParentIdx;
127  char *myName;
128  unsigned int myId;
129 
130  fpreal myXoffset; // measured in indices
131  fpreal myYoffset; // measured in indices
132  CHOP_HandleLook myLook;
133  CHOP_HandleMotion myMotion;
134  int myColorOffset;
135 
136  unsigned int myFlags;
137  char mySelected;
138 
139 };
140 
141 #endif
142 
int isSelected() const
Definition: CHOP_Handle.h:115
void setColorOffset(int offset)
Definition: CHOP_Handle.h:83
int getSubParent() const
Definition: CHOP_Handle.h:112
GLint GLint GLint yoffset
Definition: glcorearb.h:412
#define DEFAULT_FLAGS
Definition: CHOP_Handle.h:48
int isBar() const
Definition: CHOP_Handle.h:103
#define CHOP_API
Definition: CHOP_API.h:10
const GLdouble * v
Definition: glcorearb.h:837
#define HANDLE_LABEL_LEFT
Definition: CHOP_Handle.h:37
int isLabelLeft() const
Definition: CHOP_Handle.h:97
CHOP_HandleLook getLook() const
Definition: CHOP_Handle.h:94
#define HANDLE_LABEL_TOP
Definition: CHOP_Handle.h:40
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
CHOP_HandleMotion getMotion() const
Definition: CHOP_Handle.h:95
GLintptr offset
Definition: glcorearb.h:665
CHOP_Node * getCHOP()
Definition: CHOP_Handle.h:89
const char * getName() const
Definition: CHOP_Handle.h:90
int isLabelTop() const
Definition: CHOP_Handle.h:100
fpreal getXoffset() const
Definition: CHOP_Handle.h:92
long long int64
Definition: SYS_Types.h:116
GLint GLint xoffset
Definition: glcorearb.h:411
GLuint const GLchar * name
Definition: glcorearb.h:786
unsigned int getId() const
Definition: CHOP_Handle.h:91
void setSubParent(int idx)
Definition: CHOP_Handle.h:109
CHOP_HandleLook
Definition: CHOP_Handle.h:23
fpreal getYoffset() const
Definition: CHOP_Handle.h:93
int isWidthEnd() const
Definition: CHOP_Handle.h:106
void setSelected(int yesno)
Definition: CHOP_Handle.h:118
fpreal64 fpreal
Definition: SYS_Types.h:277
LeafData & operator=(const LeafData &)=delete
#define HANDLE_WIDTH_END
Definition: CHOP_Handle.h:46
CL_Unit
Definition: CL_Defines.h:18
#define HANDLE_BAR
Definition: CHOP_Handle.h:43
CHOP_HandleMotion
Definition: CHOP_Handle.h:30
UT_Color getChopColor(const CL_Clip *clip=nullptr) const
Definition: CHOP_Handle.h:86
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
Definition: ImathBoxAlgo.h:29