HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GQ_Face.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: Quad Edge Library (C++)
7  *
8  * COMMENTS: Code for a quad edge face
9  *
10  */
11 
12 #ifndef _GQ_Face_h_
13 #define _GQ_Face_h_
14 
15 #include "GQ_API.h"
16 #include "GQ_Point.h"
17 #include <GA/GA_Types.h>
18 #include <SYS/SYS_Types.h>
19 #include <UT/UT_SmallObject.h>
20 
21 class GQ_Edge;
22 class GQ_Point;
23 class GEO_PrimPoly;
24 
25 class GQ_Face;
26 
27 class GQ_API GQ_Face: public UT_SmallObject<GQ_Face>
28 {
29 public:
30  explicit GQ_Face(GEO_PrimPoly *p)
31  {
32  myPoly = p;
33  myEdge = 0;
34  mySpare = 0;
35  myNormal = 0;
36  myFlags = 0;
37  myIndex = -1;
38  myGQpt = 0;
39  }
40  ~GQ_Face() { delete myNormal; }
41  GEO_PrimPoly *getPoly() const { return myPoly; }
42  void setPoly(GEO_PrimPoly *p) { myPoly = p; }
43 
44  // Assume no intersection of edges with plane
45  int aboveOrBelow(UT_Vector3 &normal, float distance);
46 
47  void setEdge(GQ_Edge *e) { myEdge = e; }
48  void adjustToSafeEdge();
49  GQ_Edge *getEdge() const { return myEdge; }
50  int getNumEdges() const;
51 
52  void setFlags(unsigned mask) { myFlags = mask; }
53  unsigned getFlags(unsigned mask=~0) const
54  { return myFlags & mask; }
55  void addFlags(unsigned mask) { myFlags |= mask; }
56  void clearFlags(unsigned mask=~0) { myFlags &= ~mask; }
57 
58  // Face point operators, face points are temporarily created:
59  void setGQPoint(GQ_Point *pt) { myGQpt = pt; }
60  GQ_Point *getGQPoint() const { return myGQpt; }
61 
62  GA_Offset ptOff() const
63  { return myGQpt->ptOff(); }
64 
65  // Public data use it with care please
66  union {
69  void *mySpare;
70  };
71 
73  int myIndex;
74 
75 private:
76 
77  GEO_PrimPoly *myPoly;
78  GQ_Point *myGQpt;
79  GQ_Edge *myEdge; // an edge that share this face on left()
80  unsigned myFlags;
81 };
82 #endif
83 
void setFlags(unsigned mask)
Definition: GQ_Face.h:52
void setPoly(GEO_PrimPoly *p)
Definition: GQ_Face.h:42
#define GQ_API
Definition: GQ_API.h:10
void setEdge(GQ_Edge *e)
Definition: GQ_Face.h:47
GQ_Edge * getEdge() const
Definition: GQ_Face.h:49
int64 exint
Definition: SYS_Types.h:125
int mySpareInt
Definition: GQ_Face.h:67
GA_Offset ptOff() const
Definition: GQ_Face.h:62
void * mySpare
Definition: GQ_Face.h:69
GA_Size GA_Offset
Definition: GA_Types.h:646
GEO_PrimPoly * getPoly() const
Definition: GQ_Face.h:41
UT_Vector3 * myNormal
Definition: GQ_Face.h:72
GLint GLuint mask
Definition: glcorearb.h:124
exint mySpareExint
Definition: GQ_Face.h:68
void addFlags(unsigned mask)
Definition: GQ_Face.h:55
void clearFlags(unsigned mask=~0)
Definition: GQ_Face.h:56
void setGQPoint(GQ_Point *pt)
Definition: GQ_Face.h:59
GQ_Point * getGQPoint() const
Definition: GQ_Face.h:60
GQ_Face(GEO_PrimPoly *p)
Definition: GQ_Face.h:30
int myIndex
Definition: GQ_Face.h:73
unsigned getFlags(unsigned mask=~0) const
Definition: GQ_Face.h:53
SIM_API const UT_StringHolder distance
~GQ_Face()
Definition: GQ_Face.h:40