![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 1998 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: baseVtxLst.h,v $ $Revision: 1.8 $ $State: Exp $ 00007 *********************************************************************/ 00008 00009 #ifndef baseVtxLst_H_ 00010 #define baseVtxLst_H_ 00011 00012 // include files 00013 #include "gdb/gdbDefines.h" 00014 #include "gdb/gdbNode.h" 00015 00016 #include "geometry/point.h" 00017 00018 //forward declarations 00019 class DtChord; 00020 class DtChordIntersectionRecord; 00021 class DtTerrainDatabase; 00022 00023 // 00024 // 00025 // class DtBaseVertexList: 00026 // 00027 // DtBaseVertexList is a base class for representing vertex lists. Grid post 00028 // lists, as well as a list of 3D points, can be represented as vertex lists 00029 // derived from this class. 00030 // 00031 // I have removed surface list from being a member variable of 00032 // base vertex list. A grid post list, however, has a surface list associated 00033 // with it -- RVK 00034 // 00035 // 00036 00037 class DT_DLL_gdb DtBaseVertexList :public DtGdbNode 00038 { 00039 public: 00040 00041 // default constructor 00042 DtBaseVertexList(); 00043 00044 // create a vertex list of specified capacity. 00045 DtBaseVertexList(unsigned int maxNumVertices); 00046 00047 // destructor 00048 virtual ~DtBaseVertexList(); 00049 00050 // returns the number of vertices currently held in the vertex list. 00051 virtual unsigned int size() const; 00052 00053 // increments the size of the vertex list by 1, and returns the new 00054 // size. 00055 virtual unsigned int incrementSize(); 00056 00057 // returns the maximum number of vertices specified for the 00058 // vertex list. 00059 virtual unsigned int maxNumberOfVertices() const; 00060 00061 // set the maximum number of vertices that may be in the 00062 // vertex list 00063 virtual void setMaxNumberOfVertices(unsigned int maxNumVertices); 00064 00065 // set the number of vertices that are in the 00066 // vertex list 00067 virtual void setNumberOfVertices(unsigned int numVertices); 00068 00069 //get the i-th vertex from vertex list 00070 virtual DtPoint vertex(unsigned int i) const = 0; 00071 virtual bool getVertex(DtPoint& retVal, unsigned int i) const = 0; 00072 00073 //determine the extent of the vertex list 00074 virtual DtExtent extent() const; 00075 00076 //modify extent to include all points in the vertex list 00077 virtual void expandExtent(DtExtent& extent) const; 00078 00079 //determine if the vertex list is filled to capacity 00080 virtual bool isFull() const; 00081 00082 //determine if an index into the vertex list is within bounds. 00083 // 0 <= i < maxNumberOfVertices() 00084 virtual bool indexWithinBounds(unsigned int i) const; 00085 00086 //determine if an index into the vertex list is valid. 00087 // 0 <= i < size() 00088 virtual bool validIndex(unsigned int i) const; 00089 00090 //debugging utility 00091 virtual void dump(int indentLevel) const; 00092 00093 virtual int sizeInBytes() const; 00094 00095 protected: 00096 00097 // copy constructor 00098 DtBaseVertexList(const DtBaseVertexList& orig); 00099 00100 // assignment operator 00101 DtBaseVertexList& operator=(const DtBaseVertexList& orig); 00102 00103 protected: 00104 00105 unsigned int myNumberOfVertices; //current size 00106 unsigned int myMaxNumberOfVertices; //maximum capacity 00107 00108 }; 00109 00110 00114 00115 inline unsigned int DtBaseVertexList::maxNumberOfVertices() const 00116 { 00117 return myMaxNumberOfVertices; 00118 } 00119 00120 inline void DtBaseVertexList::setMaxNumberOfVertices(unsigned int n) 00121 { 00122 myMaxNumberOfVertices = n; 00123 } 00124 00125 inline void DtBaseVertexList::setNumberOfVertices(unsigned int n) 00126 { 00127 if (myMaxNumberOfVertices >= n) 00128 { 00129 myNumberOfVertices = n; 00130 } 00131 } 00132 00133 inline unsigned int DtBaseVertexList::size() const 00134 { 00135 return myNumberOfVertices; 00136 } 00137 00138 inline unsigned int DtBaseVertexList::incrementSize() 00139 { 00140 return myNumberOfVertices++; 00141 } 00142 00143 00144 #endif 00145