00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __POINT_INCLUDED
00019 #define __POINT_INCLUDED
00020
00021 #include <fstream>
00022 #include <iostream>
00023
00024 #include "common/global.h"
00025
00026 using namespace std;
00027
00028 class TDataPackageList;
00029 class TPoint;
00030
00031
00032
00033
00034
00035
00036
00044 ostream& operator<<( ostream& Stream, const TPoint& point );
00053 TPoint operator*( const double dScale, const TPoint& point );
00054
00055
00056
00057
00058
00059
00060
00071 class TPoint
00072 {
00073 public:
00074 enum
00075 {
00076 X_AXIS=1,
00077 Y_AXIS=2,
00078 Z_AXIS=3
00079 };
00080
00087 TPoint( double x=0, double y=0, double z=0 );
00092 TPoint( const TPoint& point );
00093
00100 double getLength() const;
00104 double GetX() const;
00108 double GetY() const;
00112 double GetZ() const;
00116 bool isNull() const;
00123 bool LinearDependence( const TPoint& two, double dAccuracy=dEps ) const;
00134 bool load( TDataPackageList* in, const string& sIdentifier,
00135 bool bUnique=true );
00142 double Magnitude() const;
00148 TPoint& Normalize();
00154 bool operator==( const TPoint& point ) const;
00160 TPoint& operator+=( const TPoint& point );
00166 TPoint& operator-=( const TPoint& point );
00172 TPoint operator+( const TPoint& point ) const;
00178 TPoint operator-( const TPoint& point ) const;
00184 TPoint& operator*=( const double dScale );
00190 TPoint operator*( const double dScale ) const;
00196 double operator*( const TPoint& point ) const;
00203 void Rescale( double dScale );
00216 bool save( TDataPackageList* out, const string& sIdentifier,
00217 bool bUnique=true, bool bAutoDelete=false ) const;
00221 void setNull();
00225 void SetPoint( double x=0, double y=0, double z=0 );
00229 void SetX( double x );
00233 void SetY( double y );
00237 void SetZ( double z );
00244 ostream& Write( ostream& stream ) const;
00245
00246 protected:
00252 static const double dEps;
00253
00257 double dX;
00261 double dY;
00265 double dZ;
00266 };
00267
00268
00269
00270
00271
00272 #endif // __POINT_INCLUDED
00273
00274
00275
00276
00277