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
73 { memset(myData, 0,
sizeof(myData)); }
75 { memcpy(myData, data,
sizeof(myData)); }
78 memcpy(myData, base_data,
sizeof(myData)/2);
79 memcpy(&myData[3], component_data,
sizeof(myData)/2);
82 const int *component_data)
84 memcpy(myData, base.myData,
sizeof(myData)/2);
87 myData[3] = component_data[0] + 1;
88 myData[4] = component_data[1] + 1;
89 myData[5] = component_data[2] + 1;
92 memcpy(&myData[3], component_data,
sizeof(myData)/2);
96 { memset(myData, 0,
sizeof(myData)); }
98 {
return (myData[0] != 0); }
100 {
return (memcmp(myData, cmp.myData,
sizeof(myData)) == 0); }
102 {
return !(*
this ==
cmp); }
105 {
return myData[0]; }
118 {
UT_ASSERT(isObject());
return myData[3]; }
121 {
UT_ASSERT(isHandle());
return myData[1]; }
123 {
UT_ASSERT(!isSet() || isHandle());
return myData[3]; }
125 {
UT_ASSERT(!isSet() || isHandle());
return myData[4]; }
127 {
UT_ASSERT(!isSet() || isHandle());
return myData[5]; }
130 {
UT_ASSERT(isFloor());
return myData[1]; }
132 {
UT_ASSERT(!isSet() || isFloor());
return myData[3]; }
134 {
UT_ASSERT(!isSet() || isFloor());
return myData[4]; }
136 {
UT_ASSERT(!isSet() || isFloor());
return myData[5]; }
139 {
UT_ASSERT(isGeometry() || isObject());
return myData[1]; }
141 {
UT_ASSERT(isGeometry() || isObject());
return myData[2]; }
144 {
UT_ASSERT(isSceneHook());
return myData[1]; }
147 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[3]-1; }
149 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[4]-1; }
151 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[5]-1; }
162 void dump(std::ostream &os)
const;
171 return memcmp(p1->myData, p2->myData,
sizeof(
int)*3);
178 return memcmp(p1->myData, p2->myData,
sizeof(
int)*6);
188 if (p1.myData[1] == p2.myData[1] &&
189 p1.myData[2] == p2.myData[2] &&
190 p1.myData[4] == p2.myData[4] &&
191 p1.myData[5] == p2.myData[5])
195 if (p1.myData[1] == p2.myData[1] &&
196 p1.myData[2] == p2.myData[2] &&
197 p1.myData[4] == p2.myData[5] &&
198 p1.myData[5] == p2.myData[4])
210 static inline std::ostream &
212 { 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