VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
chord.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: chord.h,v $ $Revision: 1.13 $ $State: Exp $
7 *******************************************************************************/
8 #ifndef chord_H_
9 #define chord_H_
10 
12 #include "geometry/point.h"
13 #include "geometry/extent.h"
14 
15 
21 
23 
39 
41 {
42 public:
44  DtChord();
45 
47  DtChord(const DtPoint& endpoint0, const DtPoint& endpoint1);
48 
50  virtual ~DtChord();
51 
53  DtChord(const DtChord& orig);
54 
56  DtChord& operator=(const DtChord& orig);
57 
59 
60  const DtPoint& endpoint0() const;
62 
64  const DtPoint& endpoint1() const;
65 
67  double directedXComponent() const;
68 
70  double directedYComponent() const;
71 
73  double directedZComponent() const;
74 
76  const DtExtent& extent() const;
78 
81  virtual DtPoint computePoint(const double t) const;
82 
84  virtual bool isCollinear(const DtPoint& p) const;
85 
87  virtual bool parallelToXYPlane() const;
88 
90  virtual bool inPlaneZEquals(const double c) const;
91 
95  virtual bool intersectsPlaneZEqualsAtPoint(const double c,
96  double& tvalue) const;
97 
100  virtual bool collinearPointLiesWithin(const DtPoint& pt) const;
101 
102  // \return The length of the chord.
103  // \note Slower than lengthSquared().
104  double length() const;
105 
106  // \return The squared length of the chord.
107  double lengthSquared() const;
108 
109 protected:
110 
112  virtual double minZ() const;
113 
115  virtual double maxZ() const;
116 
117 public:
118 //- -------------- deprecated access/manipulate routines -----------------
121  double lengthOnX() const;
122 
125  double lengthOnY() const;
126 
129  double lengthOnZ() const;
130 
131  //debugging aid
133  virtual void dump(void) const;
134 
135 //- -------------- end deprecated access/manipulate routines -----------------
136 
137 private:
141 
143 
144  double myA; //length of chord along x-axis
145  double myB; //length of chord along y-axis
146  double myC; //length of chord along z-axis
147 
150 };
151 
152 
153 inline const DtExtent& DtChord::extent() const
154 {
155  return myExtent;
156 }
157 
158 inline const DtPoint& DtChord::endpoint0() const
159 {
160  return myFirstEndpoint;
161 }
162 
163 inline const DtPoint& DtChord::endpoint1() const
164 {
165  return mySecondEndpoint;
166 }
167 
168 inline double DtChord::directedXComponent() const
169 {
170  return myA;
171 }
172 
173 inline double DtChord::directedYComponent() const
174 {
175  return myB;
176 }
177 
178 inline double DtChord::directedZComponent() const
179 {
180  return myC;
181 }
182 //- -------------- deprecated access/manipulate routines -----------------
183 inline double DtChord::lengthOnX() const
184 {
185  return myA;
186 }
187 
188 inline double DtChord::lengthOnY() const
189 {
190  return myB;
191 }
192 
193 inline double DtChord::lengthOnZ() const
194 {
195  return myC;
196 }
197 //- -------------- end deprecated access/manipulate routines -----------------
198 
199 #endif
200 
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
const DtExtent & extent() const
Definition: chord.h:153
const DtPoint & endpoint0() const
Definition: chord.h:158
DtExtent myExtent
Data derived from endpoints. Should never be set by user.
Definition: chord.h:148
double directedXComponent() const
Definition: chord.h:168
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
#define DT_DLL_geometry
Definition: geometryDefines.h:23
const DtPoint & endpoint1() const
Definition: chord.h:163
double directedZComponent() const
Definition: chord.h:178
DtPoint myFirstEndpoint
Definition: chord.h:138
double myC
Data derived from endpoints. Should never be set by user.
Definition: chord.h:146
double directedYComponent() const
Definition: chord.h:173
double lengthOnZ() const
Definition: chord.h:193
Contains the declaration of the DtExtent class.
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.
double lengthOnX() const
Definition: chord.h:183
double lengthOnY() const
Definition: chord.h:188
DtPoint mySecondEndpoint
Definition: chord.h:139
double myB
Data derived from endpoints. Should never be set by user.
Definition: chord.h:145
Definition: point.h:34
double myA
Data derived from endpoints. Should never be set by user.
Definition: chord.h:144

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)