VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkSegment.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 networkSegment_H_
12 #define networkSegment_H_
13 
14 #include "gdb/gdbDefines.h"
15 #include <vlutil/vlConfig.h>
16 #include "geometry/chord.h"
18 #include "gdb/networkElement.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.
27 {
28 public:
29 
30  // default constructor
32 
33  // destructor
34  virtual ~DtNetworkSegment();
35 
36  // copy constructor
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 
124 
125  static const double theParallelAngle;
126 };
127 
128 #endif
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
int myIndex2
Definition: networkSegment.h:121
The DtNetworkElement is the base member for nodes, segments, and edges. This class presents the inter...
Definition: networkSegment.h:26
#define DT_DLL_gdb
Definition: gdbDefines.h:25
DtNetworkEdge * myParentEdge
Definition: networkSegment.h:123
virtual const DtSpecification & specification() const =0
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Definition: specification.h:27
Definition: networkEdge.h:28
A DtChord is a finite line segment in 3-space, represented by two points. Data derived from the two e...
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
DT_DLL_vrfutil double closestPointInXY(const DtRailSegment *seg, const DtVector &pointFronm, DtVector &closest, const Coordinate_System &coordinateSystem)
int myIndex1
Definition: networkSegment.h:120
Definition: networkElement.h:38
Definition: point.h:34
static const double theParallelAngle
Definition: networkSegment.h:125

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)