VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
baseVertexList.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1998 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: baseVtxLst.h,v $ $Revision: 1.8 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef baseVertexList_H_
10 #define baseVertexList_H_
11 
12 // include files
13 #include "gdb/gdbDefines.h"
14 #include "gdb/gdbNode.h"
15 
16 #include "geometry/point.h"
17 
18 //forward declarations
19 class DtChord;
21 class DtTerrainDatabase;
22 
23 //
24 //
25 // class DtBaseVertexList:
26 //
27 // DtBaseVertexList is a base class for representing vertex lists. Grid post
28 // lists, as well as a list of 3D points, can be represented as vertex lists
29 // derived from this class.
30 //
31 // I have removed surface list from being a member variable of
32 // base vertex list. A grid post list, however, has a surface list associated
33 // with it -- RVK
34 //
35 //
36 
38 {
39 public:
40 
41  // default constructor
43 
44  // create a vertex list of specified capacity.
45  DtBaseVertexList(unsigned int maxNumVertices);
46 
47  // destructor
48  virtual ~DtBaseVertexList();
49 
50  // returns the number of vertices currently held in the vertex list.
51  virtual unsigned int size() const;
52 
53  // increments the size of the vertex list by 1, and returns the new
54  // size.
55  virtual unsigned int incrementSize();
56 
57  // returns the maximum number of vertices specified for the
58  // vertex list.
59  virtual unsigned int maxNumberOfVertices() const;
60 
61  // set the maximum number of vertices that may be in the
62  // vertex list
63  virtual void setMaxNumberOfVertices(unsigned int maxNumVertices);
64 
65  // set the number of vertices that are in the
66  // vertex list
67  virtual void setNumberOfVertices(unsigned int numVertices);
68 
69  //get the i-th vertex from vertex list
70  virtual DtPoint vertex(unsigned int i) const = 0;
71  virtual bool getVertex(DtPoint& retVal, unsigned int i) const = 0;
72 
73  //determine the extent of the vertex list
74  virtual DtExtent extent() const;
75 
76  //modify extent to include all points in the vertex list
77  virtual void expandExtent(DtExtent& extent) const;
78 
79  //determine if the vertex list is filled to capacity
80  virtual bool isFull() const;
81 
82  //determine if an index into the vertex list is within bounds.
83  // 0 <= i < maxNumberOfVertices()
84  virtual bool indexWithinBounds(unsigned int i) const;
85 
86  //determine if an index into the vertex list is valid.
87  // 0 <= i < size()
88  virtual bool validIndex(unsigned int i) const;
89 
90  //debugging utility
91  virtual void dump(int indentLevel) const;
92 
93  virtual int sizeInBytes() const;
94 
95 protected:
96 
97  // copy constructor
99 
100  // assignment operator
102 
103 protected:
104 
105  unsigned int myNumberOfVertices; //current size
106  unsigned int myMaxNumberOfVertices; //maximum capacity
107 
108 };
109 
110 
114 
115 inline unsigned int DtBaseVertexList::maxNumberOfVertices() const
116 {
117  return myMaxNumberOfVertices;
118 }
119 
120 inline void DtBaseVertexList::setMaxNumberOfVertices(unsigned int n)
121 {
123 }
124 
125 inline void DtBaseVertexList::setNumberOfVertices(unsigned int n)
126 {
127  if (myMaxNumberOfVertices >= n)
128  {
129  myNumberOfVertices = n;
130  }
131 }
132 
133 inline unsigned int DtBaseVertexList::size() const
134 {
135  return myNumberOfVertices;
136 }
137 
138 inline unsigned int DtBaseVertexList::incrementSize()
139 {
140  return myNumberOfVertices++;
141 }
142 
143 
144 #endif
145 
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
Definition: chordIntersectionRecord.h:23
virtual void setNumberOfVertices(unsigned int numVertices)
Definition: baseVertexList.h:125
virtual unsigned int maxNumberOfVertices() const
**********************************************************/// in-line functions *********************...
Definition: baseVertexList.h:115
virtual unsigned int size() const
Definition: baseVertexList.h:133
Definition: gdbNode.h:44
virtual void expandExtent(DtExtent &extent) const
voidpf void uLong size
Definition: ioapi.h:39
virtual int sizeInBytes() const =0
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
#define DT_DLL_gdb
Definition: gdbDefines.h:25
unsigned int myMaxNumberOfVertices
Definition: baseVertexList.h:106
virtual void setMaxNumberOfVertices(unsigned int maxNumVertices)
Definition: baseVertexList.h:120
Definition: baseVertexList.h:37
Definition: terrainDatabase.h:148
DtGdbNode & operator=(const DtGdbNode &orig)
virtual void dump(int indentLevel) const =0
unsigned int myNumberOfVertices
Definition: baseVertexList.h:105
virtual unsigned int incrementSize()
Definition: baseVertexList.h:138
Definition: point.h:34

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)