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
56 { memset(myData, 0,
sizeof(myData)); }
58 { memcpy(myData, data,
sizeof(myData)); }
61 memcpy(myData, base_data,
sizeof(myData)/2);
62 memcpy(&myData[3], component_data,
sizeof(myData)/2);
65 const int *component_data)
67 memcpy(myData, base.myData,
sizeof(myData)/2);
70 myData[3] = component_data[0] + 1;
71 myData[4] = component_data[1] + 1;
72 myData[5] = component_data[2] + 1;
75 memcpy(&myData[3], component_data,
sizeof(myData)/2);
79 { memset(myData, 0,
sizeof(myData)); }
81 {
return (myData[0] != 0); }
83 {
return (memcmp(myData, cmp.myData,
sizeof(myData)) == 0); }
85 {
return !(*
this ==
cmp); }
101 {
UT_ASSERT(isObject());
return myData[3]; }
104 {
UT_ASSERT(isHandle());
return myData[1]; }
106 {
UT_ASSERT(!isSet() || isHandle());
return myData[3]; }
108 {
UT_ASSERT(!isSet() || isHandle());
return myData[4]; }
110 {
UT_ASSERT(!isSet() || isHandle());
return myData[5]; }
113 {
UT_ASSERT(isFloor());
return myData[1]; }
115 {
UT_ASSERT(!isSet() || isFloor());
return myData[3]; }
117 {
UT_ASSERT(!isSet() || isFloor());
return myData[4]; }
119 {
UT_ASSERT(!isSet() || isFloor());
return myData[5]; }
122 {
UT_ASSERT(isGeometry() || isObject());
return myData[1]; }
124 {
UT_ASSERT(isGeometry() || isObject());
return myData[2]; }
127 {
UT_ASSERT(isSceneHook());
return myData[1]; }
130 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[3]-1; }
132 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[4]-1; }
134 {
UT_ASSERT(isGeometry()||isSceneHook());
return myData[5]-1; }
145 void dump(std::ostream &os)
const;
154 return memcmp(p1->myData, p2->myData,
sizeof(
int)*3);
161 return memcmp(p1->myData, p2->myData,
sizeof(
int)*6);
171 if (p1.myData[1] == p2.myData[1] &&
172 p1.myData[2] == p2.myData[2] &&
173 p1.myData[4] == p2.myData[4] &&
174 p1.myData[5] == p2.myData[5])
178 if (p1.myData[1] == p2.myData[1] &&
179 p1.myData[2] == p2.myData[2] &&
180 p1.myData[4] == p2.myData[5] &&
181 p1.myData[5] == p2.myData[4])
193 static inline std::ostream &
195 { 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
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