VR-Forces 4.1.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
gdb
netwrkSeg.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2001 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: netwrkSeg.h,v $ $Revision: 1.21 $ $State: Exp $
7
*******************************************************************************/
8
// \file netwrkSeg.h
9
// \brief Contains the DtNetworkSegment class declaration.
10
11
#ifndef netwrkSeg_H_
12
#define netwrkSeg_H_
13
14
#include "
gdb/gdbDefines.h
"
15
#include <vlutil/vlConfig.h>
16
#include "
geometry/chord.h
"
17
#include "
gdb/specMgr.h
"
18
#include "
gdb/netwrkElemnt.h
"
19
#include <vlutil/vlString.h>
20
21
class
DtNetworkEdge
;
22
23
//
24
// DtNetworkSegment represents a section of a network that is approximated
25
// by a line segment.
26
class
DT_DLL_gdb
DtNetworkSegment
:
public
DtNetworkElement
27
{
28
public
:
29
30
// default constructor
31
DtNetworkSegment
();
32
33
// destructor
34
virtual
~
DtNetworkSegment
();
35
36
// copy constructor
37
DtNetworkSegment
(
const
DtNetworkSegment
& orig);
38
39
// assignment operator
40
DtNetworkSegment
& operator=(
const
DtNetworkSegment
& orig);
41
42
// get/set chord
43
virtual
const
DtChord
chord()
const
;
44
virtual
void
setPoints(
int
pt1,
int
pt2);
45
virtual
void
increaseIndex(
int
val);
46
47
// get/set parent edge
48
virtual
DtNetworkEdge
* parentEdge();
49
virtual
const
DtNetworkEdge
* parentEdge()
const
;
50
virtual
void
setParentEdge(
DtNetworkEdge
* edge);
51
52
virtual
DtString
type();
53
54
// first and last endpoint, as traversing forward
55
virtual
DtPoint
endpoint0()
const
;
56
virtual
DtPoint
endpoint1()
const
;
57
58
virtual
double
length()
const
;
59
60
// get specification
61
virtual
const
DtSpecification
&
specification
()
const
;
62
63
// get boundary values
64
virtual
double
minX()
const
;
65
virtual
double
maxX()
const
;
66
virtual
double
minY()
const
;
67
virtual
double
maxY()
const
;
68
virtual
double
minZ()
const
;
69
virtual
double
maxZ()
const
;
70
71
// Get the distance to a specified point
72
//
73
// \param point the point to find the distance to
74
// \return the distance to the specified point
75
virtual
double
distanceToPoint(
const
DtPoint
&
point
)
const
;
76
77
// Get the distance in XY to the specified point
78
//
79
// \param point the point to find the distance to
80
// \return the distance (in the X,Y plane) to the specified point
81
virtual
double
distanceToPointInXY(
const
DtPoint
& pointIn)
const
;
82
83
// Calculate if the projections onto the x-y plane of another segment
84
// and this segment intersect.
85
virtual
bool
xyIntersects(
const
DtNetworkSegment
& seg)
const
;
86
87
// Calculate if the projections onto the x-y plane of another segment
88
// and this segment intersect.
89
// \param distanceSquared The distance between the two segments squared,
90
// \param thisX
91
// \param thisY hold the closest points on this segment
92
// \param otherX/otherY hold the closest point on the network segment.
93
virtual
bool
xyIntersects(
const
DtNetworkSegment
& seg,
94
double
& distanceSquared,
95
double
& thisX,
96
double
& thisY,
97
double
& otherX,
98
double
& otherY)
const
;
99
100
// Find the closest point on the segment to another point
101
//
102
// \param pointIn the point to find the closest point to
103
// \param pointOut the closest point to the specified point
104
// \param distance the distance from the closest point to the specified point
105
// \deprecated TerrainToolkit 3.9
106
virtual
void
closestPoint(
const
DtPoint
& pointIn,
107
DtPoint
& closestPnt,
108
double
&
distance
)
const
;
109
110
// Find the closest point, in 2D (x,y), on the segment to another point
111
//
112
// \param pointIn the point to find the closest point to
113
// \param pointOut the closest point, in 2D, to the specified point
114
// \param distance the distance, in 2D, from the closest point to the specified point
115
// \deprecated TerrainToolkit 3.9
116
virtual
void
closestPointInXY
(
const
DtPoint
& pointIn,
117
DtPoint
& pointOut,
118
double
& distance)
const
;
119
protected
:
120
int
myIndex1
;
121
int
myIndex2
;
122
123
DtNetworkEdge
*
myParentEdge
;
124
125
static
const
double
theParallelAngle
;
126
};
127
128
#endif
Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)