![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2005 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: chord.h,v $ $Revision: 1.13 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef chord_H_ 00009 #define chord_H_ 00010 00011 #include "geometry/geometryDefines.h" 00012 #include "geometry/point.h" 00013 #include "geometry/tdbextent.h" 00014 00015 00021 00023 00039 00040 class DT_DLL_geometry DtChord 00041 { 00042 public: 00044 DtChord(); 00045 00047 DtChord(const DtPoint& endpoint0, const DtPoint& endpoint1); 00048 00050 virtual ~DtChord(); 00051 00053 DtChord(const DtChord& orig); 00054 00056 DtChord& operator=(const DtChord& orig); 00057 00059 00060 00061 const DtPoint& endpoint0() const; 00062 00064 const DtPoint& endpoint1() const; 00065 00067 double directedXComponent() const; 00068 00070 double directedYComponent() const; 00071 00073 double directedZComponent() const; 00074 00076 const DtExtent& extent() const; 00078 00081 virtual DtPoint computePoint(const double t) const; 00082 00084 virtual bool isCollinear(const DtPoint& p) const; 00085 00087 virtual bool parallelToXYPlane() const; 00088 00090 virtual bool inPlaneZEquals(const double c) const; 00091 00095 virtual bool intersectsPlaneZEqualsAtPoint(const double c, 00096 double& tvalue) const; 00097 00100 virtual bool collinearPointLiesWithin(const DtPoint& pt) const; 00101 00102 // \return The length of the chord. 00103 // \note Slower than lengthSquared(). 00104 double length() const; 00105 00106 // \return The squared length of the chord. 00107 double lengthSquared() const; 00108 00109 protected: 00110 00112 virtual double minZ() const; 00113 00115 virtual double maxZ() const; 00116 00117 public: 00118 //- -------------- deprecated access/manipulate routines ----------------- 00121 double lengthOnX() const; 00122 00125 double lengthOnY() const; 00126 00129 double lengthOnZ() const; 00130 00131 //debugging aid 00133 virtual void dump(void) const; 00134 00135 //- -------------- end deprecated access/manipulate routines ----------------- 00136 00137 private: 00138 DtPoint myFirstEndpoint; 00139 DtPoint mySecondEndpoint; 00141 00142 00143 00144 double myA; //length of chord along x-axis 00145 double myB; //length of chord along y-axis 00146 double myC; //length of chord along z-axis 00147 00148 DtExtent myExtent; 00150 }; 00151 00152 00153 inline const DtExtent& DtChord::extent() const 00154 { 00155 return myExtent; 00156 } 00157 00158 inline const DtPoint& DtChord::endpoint0() const 00159 { 00160 return myFirstEndpoint; 00161 } 00162 00163 inline const DtPoint& DtChord::endpoint1() const 00164 { 00165 return mySecondEndpoint; 00166 } 00167 00168 inline double DtChord::directedXComponent() const 00169 { 00170 return myA; 00171 } 00172 00173 inline double DtChord::directedYComponent() const 00174 { 00175 return myB; 00176 } 00177 00178 inline double DtChord::directedZComponent() const 00179 { 00180 return myC; 00181 } 00182 //- -------------- deprecated access/manipulate routines ----------------- 00183 inline double DtChord::lengthOnX() const 00184 { 00185 return myA; 00186 } 00187 00188 inline double DtChord::lengthOnY() const 00189 { 00190 return myB; 00191 } 00192 00193 inline double DtChord::lengthOnZ() const 00194 { 00195 return myC; 00196 } 00197 //- -------------- end deprecated access/manipulate routines ----------------- 00198 00199 #endif 00200