00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * David Wong 00008 * Side Effects 00009 * 477 Richmond Street West 00010 * Toronto, Ontario 00011 * Canada M5V 3E7 00012 * 416-504-9876 00013 * 00014 * NAME: Quad Edge Library (C++) 00015 * 00016 * COMMENTS: Code for a quad edge face 00017 * 00018 */ 00019 00020 #ifndef _GQ_Face_h_ 00021 #define _GQ_Face_h_ 00022 00023 #include "GQ_API.h" 00024 class GQ_Edge; 00025 class GQ_Point; 00026 class GEO_PrimPoly; 00027 class GEO_Point; 00028 00029 class GQ_API GQ_Face { 00030 public: 00031 explicit GQ_Face(GEO_PrimPoly *p) 00032 { 00033 myPoly = p; 00034 myEdge = 0; 00035 mySpare = 0; 00036 myNormal = 0; 00037 myFlags = 0; 00038 myGQpt = 0; 00039 } 00040 ~GQ_Face() { delete myNormal; } 00041 GEO_PrimPoly *getPoly() const { return myPoly; } 00042 void setPoly(GEO_PrimPoly *p) { myPoly = p; } 00043 00044 // Assume no intersection of edges with plane 00045 int aboveOrBelow(UT_Vector3 &normal, float distance); 00046 00047 void setEdge(GQ_Edge *e) { myEdge = e; } 00048 void adjustToSafeEdge(); 00049 GQ_Edge *getEdge() const { return myEdge; } 00050 int getNumEdges() const; 00051 00052 void setFlags(unsigned mask) { myFlags = mask; } 00053 unsigned getFlags(unsigned mask=~0) const 00054 { return myFlags & mask; } 00055 void addFlags(unsigned mask) { myFlags |= mask; } 00056 void clearFlags(unsigned mask=~0) { myFlags &= ~mask; } 00057 00058 // Face point operators, face points are temporarily created: 00059 void setGQPoint(GQ_Point *pt) { myGQpt = pt; } 00060 GQ_Point *getGQPoint() const { return myGQpt; } 00061 GEO_Point *getPoint() const; 00062 00063 // Public data use it with care please 00064 void *mySpare; 00065 UT_Vector3 *myNormal; 00066 int myIndex; 00067 00068 private: 00069 00070 GEO_PrimPoly *myPoly; 00071 GQ_Point *myGQpt; 00072 GQ_Edge *myEdge; // an edge that share this face on left() 00073 unsigned myFlags; 00074 }; 00075 #endif 00076
1.5.9