CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

AxisAngle.h

Go to the documentation of this file.
00001 #ifndef HEP_AXISANGLE_H
00002 #define HEP_AXISANGLE_H
00003 
00004 // ----------------------------------------------------------------------
00005 //
00006 // AxisAngle.h - provide HepAxisAngle class
00007 //
00008 // History:
00009 //   23-Jan-1998  WEB  Initial draft
00010 //   15-Jun-1998  WEB  Added namespace support
00011 //   02-May-2000  WEB  No global using
00012 //   27-Jul-2000  MF   CLHEP version
00013 //
00014 // ----------------------------------------------------------------------
00015 
00016 
00017 #ifndef HEP_THREEVECTOR_H
00018   #include "CLHEP/Vector/ThreeVector.h"
00019 #endif
00020 
00021 #include <iostream>
00022 #include "CLHEP/Vector/defs.h" 
00023 
00024 
00025 namespace CLHEP {
00026 
00027 
00028 // Declarations of classes and global methods
00029 class HepAxisAngle;
00030 std::ostream & operator<<( std::ostream & os, const HepAxisAngle & aa );
00031 std::istream & operator>>( std::istream & is,       HepAxisAngle & aa );
00032 
00037 class HepAxisAngle {
00038 
00039 public:
00040   typedef double Scalar;
00041 
00042 protected:
00043   typedef HepAxisAngle AA;         // just an abbreviation
00044   static Scalar tolerance;      // to determine relative nearness
00045 
00046 public:
00047 
00048   // ----------  Constructors:
00049   inline HepAxisAngle();
00050   inline HepAxisAngle( const Hep3Vector axis, Scalar delta );
00051 
00052   // ----------  Destructor, copy constructor, assignment:
00053   // use C++ defaults
00054 
00055   // ----------  Accessors:
00056 
00057 public:
00058   inline Hep3Vector            getAxis() const;
00059   inline Hep3Vector            axis() const;
00060   inline AA &                  setAxis( const Hep3Vector axis );
00061 
00062   inline double             getDelta() const;
00063   inline double             delta() const ;
00064   inline AA &                  setDelta( Scalar delta );
00065 
00066   inline AA & set( const Hep3Vector axis, Scalar delta );
00067 
00068   // ----------  Operations:
00069 
00070   //   comparisons:
00071   inline int  compare   ( const AA & aa ) const;
00072 
00073   inline bool operator==( const AA & aa ) const;
00074   inline bool operator!=( const AA & aa ) const;
00075   inline bool operator< ( const AA & aa ) const;
00076   inline bool operator<=( const AA & aa ) const;
00077   inline bool operator> ( const AA & aa ) const;
00078   inline bool operator>=( const AA & aa ) const;
00079 
00080   //   relative comparison:
00081   inline static double getTolerance();
00082   inline static double setTolerance( Scalar tol );
00083 
00084 protected:
00085     double distance( const HepAxisAngle & aa ) const;
00086 public:
00087 
00088   bool isNear ( const AA & aa, Scalar epsilon = tolerance ) const;
00089   double  howNear( const AA & aa ) const;
00090 
00091   // ----------  I/O:
00092 
00093   friend std::ostream & operator<<( std::ostream & os, const AA & aa );
00094   friend std::istream & operator>>( std::istream & is,       AA & aa );
00095 
00096 private:
00097   Hep3Vector axis_;  // Note:  After construction, this is always of mag 1
00098   double  delta_;
00099 
00100 };  // HepAxisAngle
00101 
00102 
00103 }  // namespace CLHEP
00104 
00105 
00106 namespace zmpv  {
00107 
00108   typedef CLHEP::HepAxisAngle AxisAngle;
00109 
00110 }  // namespace zmpv
00111 
00112 
00113 #define AXISANGLE_ICC
00114 #include "CLHEP/Vector/AxisAngle.icc"
00115 #undef AXISANGLE_ICC
00116 
00117 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
00118 //  backwards compatibility will be enabled ONLY in CLHEP 1.9
00119 using namespace CLHEP;
00120 #endif
00121 
00122 #endif  // HEP_AXISANGLE_H

Generated on 15 Nov 2012 for CLHEP by  doxygen 1.4.7