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: 00017 */ 00018 00019 #ifndef _GQ_Point_h_ 00020 #define _GQ_Point_h_ 00021 00022 #include "GQ_API.h" 00023 #include <UT/UT_Vector3.h> 00024 #include <UT/UT_Math.h> 00025 #include <GEO/GEO_Point.h> 00026 00027 class GQ_Edge; 00028 class GEO_Point; 00029 00030 class GQ_API GQ_Point { 00031 public: 00032 explicit GQ_Point(GEO_Point *pt) 00033 { myGpt = pt; myEdge = 0; myFlags = 0; mySpare = 0; } 00034 00035 GEO_Point *getPoint() const { return myGpt; } 00036 int aboveOrBelow(UT_Vector3 &normal, float distance) const 00037 { 00038 float dist; 00039 00040 dist = dot(myGpt->getPos(), normal) + distance; 00041 00042 if (UTequalZero(dist)) return 0; 00043 else return (dist > 0.0F) ? 1 : -1; 00044 } 00045 float distToPlane(UT_Vector3 &normal, float distance) const 00046 { 00047 float dist; 00048 00049 dist = dot(myGpt->getPos(), normal) + distance; 00050 00051 return dist; 00052 } 00053 00054 void setEdge(GQ_Edge *e) { myEdge = e; } 00055 GQ_Edge *getEdge() const { return myEdge; } 00056 00057 void setFlags(unsigned mask) { myFlags = mask; } 00058 unsigned getFlags(unsigned mask=~0) const 00059 { return myFlags & mask; } 00060 void addFlags(unsigned mask) { myFlags |= mask; } 00061 void clearFlags(unsigned mask=~0) { myFlags &= ~mask; } 00062 00063 void *mySpare; 00064 00065 private: 00066 00067 GEO_Point *myGpt; 00068 GQ_Edge *myEdge; // an edge that share this point at org() 00069 unsigned myFlags; 00070 }; 00071 #endif
1.5.9