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 * Cristin Barghiel 00008 * Side Effects Software Inc. 00009 * 20 Maud St. 00010 * Toronto, Ontario, M5V 2M5 00011 * Canada 00012 * 416-366-4607 00013 * 00014 * NAME: Geometry Library (C++) 00015 * 00016 * COMMENTS: 00017 * The vertex class. As opposed to GD_Points, all vertices are unique. 00018 * 00019 */ 00020 00021 #ifndef __GD_Vertex_H__ 00022 #define __GD_Vertex_H__ 00023 00024 #include "GD_API.h" 00025 #include <GB/GB_Vertex.h> 00026 #include "GD_Point.h" 00027 00028 class GD_Detail; 00029 00030 class GD_API GD_Vertex : public GB_Vertex 00031 { 00032 public: 00033 GD_Vertex(GD_Point *p=0) : GB_Vertex(p) {} 00034 00035 // Avoid using this c-tor because it's dangerously shallow! 00036 GD_Vertex(const GD_Vertex &vtx) : GB_Vertex(vtx.getBasePt()) {} 00037 00038 virtual ~GD_Vertex() { } 00039 00040 GD_Point *getPt(void) const { return (GD_Point*)getBasePt(); } 00041 00042 UT_Vector3 &getPos() 00043 { 00044 return ((GD_Point*)getBasePt())->getPos(); 00045 } 00046 const UT_Vector3 &getPos() const 00047 { 00048 return ((const GD_Point*)getBasePt())->getPos(); 00049 } 00050 00051 void steal(GD_Vertex &src) { GB_Vertex::steal(src); } 00052 void copy(const GD_Vertex &src) { setPt(src.getBasePt()); } 00053 00054 // Avoid using operator=() because it's dangerously shallow! 00055 GD_Vertex &operator=(const GD_Vertex &vtx) 00056 { 00057 if (this != &vtx) setPt(vtx.getBasePt()); 00058 return *this; 00059 00060 } 00061 int operator==(const GD_Vertex &vtx) const 00062 { 00063 // Trivial check to make it simple. Do not change. 00064 return this == &vtx; 00065 } 00066 00067 private: 00068 // Nothing. 00069 }; 00070 00071 #endif
1.5.9