Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

point.h

00001 // $Id: point_8h-source.html,v 1.2 2002/06/20 17:09:51 mkrohn5 Exp $
00002 
00003 // Point Header File
00004 // Written by: Marco Krohn
00005 
00006 // Copyright (C) 1999-2000, Marco Krohn, krohn@itp.uni-hannover.de
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 1, or (at your option)
00011 // any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
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 //----------------------------------------  Misc. Functions  ----------------------------------------
00036 
00044 ostream& operator<<( ostream& Stream, const TPoint& point );
00053 TPoint operator*( const double dScale, const TPoint& point );
00054 
00055 
00056 
00057 
00058 
00059 //----------------------------------------  class TPoint  ----------------------------------------
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 

Generated on Thu Jun 20 18:13:16 2002 for Stellar Legacy by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001