56 #define GQ_BRIDGE 0x00010000 // Edge is a bridge edge
57 #define GQ_INTERSECT 0x00020000 // Point is intersect on a plane/surface
58 #define GQ_INSIDE 0x00040000 // Point is inside a close geometry
59 #define GQ_OUTSIDE 0x00080000 // Point is outside a close geometry
60 #define GQ_VISIT 0x00100000 // Visited this edge
61 #define GQ_DELETE 0x00200000 // Mark as delete edge
62 #define GQ_NEW 0x00400000 // Mark as new edge
63 #define GQ_GLUE 0x00800000 // Share edge resulted from unique point op
64 #define GQ_SELECTED 0x01000000 // Need to process
65 #define GQ_SPAREPTR 0x02000000 // Spare pointer points to ptr array
66 #define GQ_VTXBOUNDARY 0x04000000 // Point has differing vertex
67 #define GQ_EDGE 0x08000000 // Face used to be edge
68 #define GQ_CORNER 0x10000000 // Face used to be corner
79 #define FOR_QUAD_EDGES(elem, edge, nedges, dir) \
80 for (edge=elem->getEdge(), nedges=0; \
81 edge && (edge != elem->getEdge() || !nedges); \
82 edge=edge->dir(), nedges++)
94 #define FOR_QUAD_EDGES_STRUCT(elem, localname, dir) \
95 for (GQ_Edge::MacroIterStruct localname(elem->getEdge(), 0); \
96 localname.edge && (localname.edge != elem->getEdge()||!localname.i); \
97 localname.edge=localname.edge->dir(), localname.i++)
100 #define Q_RotN(e,n) (e + (((e)->myIndex + n) & 0x03) - \
101 ((e)->myIndex & 0x03))
102 #define Q_ROT(e) (Q_RotN(e, 1))
103 #define Q_SYM(e) (Q_RotN(e, 2))
104 #define Q_IROT(e) (Q_RotN(e, 3))
105 #define Q_ONEXT(e) ((e)->myNext)
106 #define Q_OPREV(e) (Q_ROT( Q_ONEXT( Q_ROT(e))))
107 #define Q_DNEXT(e) (Q_SYM( Q_ONEXT( Q_SYM(e))))
108 #define Q_DPREV(e) (Q_IROT( Q_ONEXT( Q_IROT(e))))
109 #define Q_LNEXT(e) (Q_ROT( Q_ONEXT( Q_IROT(e))))
110 #define Q_LPREV(e) (Q_SYM( Q_ONEXT(e)))
111 #define Q_RNEXT(e) (Q_IROT( Q_ONEXT( Q_ROT(e))))
112 #define Q_RPREV(e) (Q_ONEXT( Q_SYM(e)))
113 #define Q_ORG(e) ((e)->myData)
114 #define Q_DEST(e) (Q_ORG( Q_SYM(e)))
115 #define Q_LEFT(e) (Q_ORG( Q_IROT(e)))
116 #define Q_RIGHT(e) (Q_ORG( Q_ROT(e)))
132 this->onext() =
this;
133 this->sym()->onext() = this->sym();
134 this->
rot()->onext() = this->irot();
135 this->irot()->onext() = this->
rot();
140 void setData(
void *org,
void *dest,
void *
left,
void *
right);
174 void *&
org() {
return myData; }
175 const void *
org()
const {
return myData; }
187 if (lnext()->org())
return lnext()->org();
188 return rnext()->org();
229 _a->
onext() = _aOnext;
230 _b->
onext() = _bOnext;
240 right() = rnext()->right();
250 right() = rnext()->right();
253 void disconnectOrg();
277 int isShare()
const {
return org() == oprev()->org() &&
278 dest() == lnext()->org(); }
280 int intersectPlane(
UT_Vector3 &nml,
float d,
float &
t,
int donml=1);
293 int index()
const {
return myIndex >> 2; }
296 operator GA_Edge () {
return GA_Edge(orgPoint()->ptOff(), destPoint()->ptOff()); }
297 operator GA_Edge ()
const {
return GA_Edge(orgPoint()->ptOff(), destPoint()->ptOff()); }
299 std::ostream &save(std::ostream &os)
const;
301 { e.
save(os);
return os; }
309 : edge(input_edge), i(input_i) {}
const GQ_Edge * rprev() const
void *& org()
Get the origin of the edge. Needs to be cast to a GQ_Point.
void connect(GQ_Point *org1, GQ_Edge *b)
void *& right()
Get the face on the right of an edge. Needs to be cast to a GQ_Face.
const GQ_Edge * lprev() const
MacroIterStruct(GQ_Edge *input_edge, int input_i)
const GQ_Edge * rnext() const
GQ_Face * leftFace() const
std::ostream & save(std::ostream &os) const
GA_API const UT_StringHolder rot
const GQ_Edge * sym() const
GLboolean GLboolean GLboolean GLboolean a
void swap(T &lhs, T &rhs)
#define Q_RotN(e, n)
A single quad edge is stored as a GQ_Edge[4] block.
const GQ_Edge * dprev() const
GA_EdgeT< GA_Offset, false > GA_Edge
GQ_Point * orgPoint() const
int getFlags(int version)
void addFlags(unsigned mask)
void connect(GQ_Edge *a, GQ_Edge *b)
void setFlags(unsigned mask)
GQ_Point * destPoint() const
const void * dest() const
const GQ_Edge * rot() const
const void * left() const
const GQ_Edge * irot() const
GLboolean GLboolean GLboolean b
const GQ_Edge * lnext() const
void clearFlags(unsigned mask=~0)
unsigned getFlags(unsigned mask=~0) const
const GQ_Edge * root() const
void *& left()
Get the face on the left of an edge. Needs to be cast to a GQ_Face.
IMATH_CONSTEXPR14 bool intersect(const Line3< T > &line, const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, Vec3< T > &pt, Vec3< T > &barycentric, bool &front) IMATH_NOEXCEPT
const GQ_Edge * rotN(int n) const
const GQ_Edge * dnext() const
GQ_Face * rightFace() const
const GQ_Edge * oprev() const
const GQ_Edge * onext() const
const void * right() const
void *& dest()
Get the destination of the edge. Needs to be cast to a GQ_Point.
friend std::ostream & operator<<(std::ostream &os, const GQ_Edge &e)