13 #ifndef __GR_PickRecord_h__
14 #define __GR_PickRecord_h__
23 #define GR_PICK_GEOPOINT 0x00000001 // GEO_Point
24 #define GR_PICK_GUIDEPOINT 0x00000002 // "guide" points (sphere, tube...)
25 #define GR_PICK_GEOEDGE 0x00000004 // edge between two GEO_Points
26 #define GR_PICK_GUIDEEDGE 0x00000008 // "guide" edges (sphere, tube...)
27 #define GR_PICK_PRIMITIVE 0x00000010 // Primitives
28 #define GR_PICK_POINTNORMAL 0x00000020 // GEO_Point normal
29 #define GR_PICK_PRIMNORMAL 0x00000040 // Primitive normals
30 #define GR_PICK_BREAKPOINT 0x00000080 // primitive break points
31 #define GR_PICK_MIDPOINT 0x00000100 // midpoint of a GEO_Edge
32 #define GR_PICK_VERTEX 0x00000200 // GEO_Vertex
33 #define GR_PICK_STATEPOINT 0x00000400 // point drawn by the current state
34 #define GR_PICK_GEOALL 0x000007ff // all of the geometry pick types
36 #define GR_PICK_HANDLE 0x00000800
37 #define GR_PICK_OBJECT 0x00001000
38 #define GR_PICK_XRAY_OBJECT 0x00002000
42 #define GR_PICK_FLOOREDGE 0x00010000
43 #define GR_PICK_FLOORPOINT 0x00020000
44 #define GR_PICK_UVTILEEDGE 0x00040000
45 #define GR_PICK_UVTILEPOINT 0x00080000
46 #define GR_PICK_FLOORALL 0x000f0000 // all of the floor pick types
48 #define GR_PICK_SCENEHOOK 0x00100000 // A scene hook
50 #define GR_PICK_ALL 0x001f3fff // Everything above
72 { memset(myData, 0,
sizeof(myData)); }
74 { memcpy(myData, data,
sizeof(myData)); }
77 memcpy(myData, base_data,
sizeof(myData)/2);
78 memcpy(&myData[3], component_data,
sizeof(myData)/2);
81 const int *component_data)
83 memcpy(myData, base.myData,
sizeof(myData)/2);
86 myData[3] = component_data[0] + 1;
87 myData[4] = component_data[1] + 1;
88 myData[5] = component_data[2] + 1;
91 memcpy(&myData[3], component_data,
sizeof(myData)/2);
95 { memset(myData, 0,
sizeof(myData)); }
97 {
return (myData[0] != 0); }
99 {
return (memcmp(myData, cmp.myData,
sizeof(myData)) == 0); }
101 {
return !(*
this ==
cmp); }
104 {
return myData[0]; }
117 {
UT_ASSERT(isObject());
return myData[3]; }
120 {
UT_ASSERT(isHandle());
return myData[1]; }
122 {
UT_ASSERT(!isSet() || isHandle());
return myData[3]; }
124 {
UT_ASSERT(!isSet() || isHandle());
return myData[4]; }
126 {
UT_ASSERT(!isSet() || isHandle());
return myData[5]; }
129 {
UT_ASSERT(isFloor());
return myData[1]; }
131 {
UT_ASSERT(!isSet() || isFloor());
return myData[3]; }
133 {
UT_ASSERT(!isSet() || isFloor());
return myData[4]; }
135 {
UT_ASSERT(!isSet() || isFloor());
return myData[5]; }
138 {
UT_ASSERT(isGeometry() || isObject());
return myData[1]; }
140 {
UT_ASSERT(isGeometry() || isObject());
return myData[2]; }
143 {
UT_ASSERT(isSceneHook());
return myData[1]; }
146 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[3]-1; }
148 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[4]-1; }
150 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[5]-1; }
161 void dump(std::ostream &os)
const;
170 return memcmp(p1->myData, p2->myData,
sizeof(
int)*3);
177 return memcmp(p1->myData, p2->myData,
sizeof(
int)*6);
187 if (p1.myData[1] == p2.myData[1] &&
188 p1.myData[2] == p2.myData[2] &&
189 p1.myData[4] == p2.myData[4] &&
190 p1.myData[5] == p2.myData[5])
194 if (p1.myData[1] == p2.myData[1] &&
195 p1.myData[2] == p2.myData[2] &&
196 p1.myData[4] == p2.myData[5] &&
197 p1.myData[5] == p2.myData[4])
209 static inline std::ostream &
211 { pr.
dump(os);
return os; }
void dump(std::ostream &os) const
int getFloorValue2() const
int getComponentId1() const
int getDetailIndex() const
int getSceneHookId() const
int getHandlePickType() const
#define GR_PICK_SCENEHOOK
int getComponentId2() const
bool operator!=(const GR_PickRecord &cmp) const
IMATH_HOSTDEVICE constexpr int cmp(T a, T b) IMATH_NOEXCEPT
std::ostream & operator<<(std::ostream &ostr, const DataType &a)
GR_PickRecord(const int *base_data, const int *component_data)
int getHandleValue2() const
static int comparatorForDups(const GR_PickRecord *p1, const GR_PickRecord *p2)
int getFloorValue1() const
bool operator==(const GR_PickRecord &cmp) const
GR_PickRecord(const GR_PickRecord &base, const int *component_data)
int getFloorValue3() const
void changeComponent(int pick, int id1, int id2=-1, int id3=-1)
int getComponentId3() const
int getHandleValue1() const
SYS_DECLARE_IS_POD(GR_PickRecord)
static bool areEquivalentEdges(const GR_PickRecord &p1, const GR_PickRecord &p2)
static int comparatorFast(const GR_PickRecord *p1, const GR_PickRecord *p2)
#define GR_PICK_XRAY_OBJECT
GR_PickRecord(const int *data)
int getHandleIndex() const