VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
gdb
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
;
20
class
DtChordIntersectionRecord
;
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
37
class
DT_DLL_gdb
DtBaseVertexList
:
public
DtGdbNode
38
{
39
public
:
40
41
// default constructor
42
DtBaseVertexList
();
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
98
DtBaseVertexList
(
const
DtBaseVertexList
& orig);
99
100
// assignment operator
101
DtBaseVertexList
&
operator=
(
const
DtBaseVertexList
& orig);
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
{
122
myMaxNumberOfVertices
= n;
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
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)