VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
xyNetworkSegmentMetric.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2001 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: xyNetSegMet.h,v $ $Revision: 1.10 $ $State: Exp $
7 *********************************************************************/
8 
9 #ifndef xyNetworkSegmentMetric_H_
10 #define xyNetworkSegmentMetric_H_
11 
12 #include "gdb/gdbDefines.h"
13 #include <vlutil/vlNetTypes.h>
15 
16 class DtNetworkSegment;
18 
19 // class DtXyNetworkSegmentMetric:
20 //
21 // DtXyNetworkSegmentMetric is a metric for segments in an mx-cif
22 // quadtree. The metric is based on proximity to a line segment in
23 // projection onto an x-y plane.
24 
26 {
27 public:
28 
29  // default constructor
31 
32  // destructor
33  virtual ~DtXyNetworkSegmentMetric();
34 
35  // copy constructor
37 
38  // assignment operator
40 
41 public:
42 
43  // measure the network segment
44  virtual double measure(const DtNetworkSegment& seg) const;
45 
46  // measure the distance from the test segment
47  virtual double measureDistanceSquaredFromSegment(
48  const DtNetworkSegment& seg) const;
49 
50  // measure the distance along the test segment to the closest point
51  virtual double measureDistanceSquaredAlongSegment(
52  const DtNetworkSegment& seg) const;
53 
54  // validate the network segment
55  virtual bool valid(const DtNetworkSegment& seg) const;
56 
57  // validate the southwest quadrant (closed on southwest side)
58  virtual bool validSW(double xx, double yy) const;
59 
60  // validate the southeast quadrant (closed on southwest side)
61  virtual bool validSE(double xx, double yy) const;
62 
63  // validate the northeast quadrant (closed on southwest side)
64  virtual bool validNE(double xx, double yy) const;
65 
66  // validate the northwest quadrant (closed on southwest side)
67  virtual bool validNW(double xx, double yy) const;
68 
69  // set conditional segment element by element
70  virtual void setX0Y0X1Y1(double x0, double y0, double x1, double y1);
71 
72  // get/set range. If this equals zero, validity checks intersection.
73  // Range should be nonnegative. If maxRange < 0, the range is set to zero.
74  virtual double maxRange() const;
75  virtual void setMaxRange(double maxRange);
76 
77  // get/set flag indicating that the metric measures distance from
78  // the segment. The alternative is to measure distance along the
79  // segment.
80  virtual bool measuresDistanceFromSegment() const;
81  virtual void setMeasuresDistanceFromSegment(bool flag);
82 
83 
84  // Calculates the distance from the conditional segment to the specified
85  // network segment. This method also caclculates the closest point along
86  // the conditional segment and the closest point on the network segment.
87  virtual double distance(const DtNetworkSegment& seg,
88  double& condX,
89  double& condY,
90  double& netX,
91  double& netY);
92  // Same as above, but only calculates the distance between the segments.
93  virtual double distance(const DtNetworkSegment& seg);
94 
95 protected:
96 
97  // quick check using the bounding rectangles for both the network
98  // segment and the conditional segment. Returns false if the two
99  // segments definitely do not intersect. true is inconclusive.
100  virtual bool boundingRectangleTest(const DtNetworkSegment& seg) const;
101 
102  // Calculate if the projections onto the x-y plane of the network segment
103  // and the conditional segment intersect. distanceSquared is the distance
104  // squared between the closest pair of points on the conditional and
105  // network segments.
106  // condX and condY hold the closest conditional-segment points, and netX
107  // and netY hold the closest point on the network segment.
108  virtual bool xyIntersects(const DtNetworkSegment& seg,
109  double& distanceSquared,
110  double& condX,
111  double& condY,
112  double& netX,
113  double& netY) const;
114  // Same as above, but only calculates if an intersection occurs
115  virtual bool xyIntersects(const DtNetworkSegment& seg) const;
116 
117 
118 protected:
119 
120  double myMaxRange;
121  double myX0;
122  double myY0;
123  double myX1;
124  double myY1;
125  double myMinX;
126  double myMinY;
127  double myMaxX;
128  double myMaxY;
129  double myDeltaX;
130  double myDeltaY;
133 };
134 
135 #endif
double myDeltaX
Definition: xyNetworkSegmentMetric.h:129
bool myMeasuresDistanceFromSegment
Definition: xyNetworkSegmentMetric.h:132
double myMinX
Definition: xyNetworkSegmentMetric.h:125
DtNetworkSegmentMetric & operator=(const DtNetworkSegmentMetric &orig)
Assignment operator.
DtNetworkSegmentMetric is a metric for network segments.
Definition: networkSegmentMetric.h:18
virtual bool validSW(double xx, double yy) const =0
Validate the southwest quadrant (closed on southwest side)
double myMaxX
Definition: xyNetworkSegmentMetric.h:127
bool myPositiveFiniteSlope
Definition: xyNetworkSegmentMetric.h:131
double myMinY
Definition: xyNetworkSegmentMetric.h:126
Definition: networkSegment.h:26
virtual bool valid(const DtNetworkSegment &seg) const =0
Validate the segment.
double myY1
Definition: xyNetworkSegmentMetric.h:124
double myMaxY
Definition: xyNetworkSegmentMetric.h:128
#define DT_DLL_gdb
Definition: gdbDefines.h:25
double myMaxRange
Definition: xyNetworkSegmentMetric.h:120
virtual double measure(const DtNetworkSegment &seg) const =0
Measure the segment.
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...
virtual bool validNW(double xx, double yy) const =0
Validate the northwest quadrant (closed on southwest side)
double myDeltaY
Definition: xyNetworkSegmentMetric.h:130
double myX1
Definition: xyNetworkSegmentMetric.h:123
double myX0
Definition: xyNetworkSegmentMetric.h:121
virtual bool validNE(double xx, double yy) const =0
Validate the northeast quadrant (closed on southwest side)
Definition: xyNetworkSegmentMetric.h:25
double myY0
Definition: xyNetworkSegmentMetric.h:122
virtual bool validSE(double xx, double yy) const =0
Validate the southeast quadrant (closed on southwest side)
Definition: specificationAttribute.h:23

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)