Geant4  10.03
AxisAngle.icc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // ---------------------------------------------------------------------------
3 //
4 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
5 //
6 // ----------------------------------------------------------------------
7 //
8 // ----------------------------------------------------------------------
9 //
10 // AxisAngle.icc
11 //
12 // History:
13 // 23-Jan-1998 WEB Initial draft
14 // 12-Mar-1998 WEB Gave default constructor proper default values
15 // 13-Mar-1998 WEB Corrected setDelta; simplified compare()
16 // 17-Jun-1998 WEB Added namespace support
17 // 26-Jul-2000 MF CLHEP version
18 //
19 // ----------------------------------------------------------------------
20 
21 namespace CLHEP {
22 
23 inline HepAxisAngle::HepAxisAngle() :
24  axis_( Hep3Vector(0,0,1) ), delta_( 0.0 )
25 {} // HepAxisAngle::HepAxisAngle()
26 
27 inline HepAxisAngle::HepAxisAngle( const Hep3Vector aaxis, Scalar ddelta ) :
28  axis_( aaxis.unit() ), delta_( ddelta )
29 {} // HepAxisAngle::HepAxisAngle()
30 
31 
32 inline Hep3Vector HepAxisAngle::getAxis() const {
33  return axis_;
34 } // HepAxisAngle::getAxis()
35 
36 inline Hep3Vector HepAxisAngle::axis() const {
37  return axis_;
38 } // HepAxisAngle::axis()
39 
40 
41 inline HepAxisAngle & HepAxisAngle::setAxis( const Hep3Vector aaxis ) {
42  axis_ = aaxis.unit();
43  return *this;
44 } // HepAxisAngle::setAxis()
45 
46 
47 inline double HepAxisAngle::getDelta() const {
48  return delta_;
49 } // HepAxisAngle::getDelta()
50 
51 inline double HepAxisAngle::delta() const {
52  return delta_;
53 } // HepAxisAngle::delta()
54 
55 
56 inline HepAxisAngle & HepAxisAngle::setDelta( Scalar ddelta ) {
57  delta_ = ddelta;
58  return *this;
59 } // HepAxisAngle::setDelta()
60 
61 
62 inline HepAxisAngle & HepAxisAngle::set( const Hep3Vector aaxis, Scalar ddelta ) {
63  axis_ = aaxis.unit();
64  delta_ = ddelta;
65  return *this;
66 } // HepAxisAngle::set()
67 
68 
69 inline int HepAxisAngle::compare( const AA & aa ) const {
70 
71  return delta_ < aa.delta_ ? -1
72  : delta_ > aa.delta_ ? +1
73  : axis_ < aa.axis_ ? -1
74  : axis_ > aa.axis_ ? +1
75  : 0;
76 
77 } // HepAxisAngle::compare()
78 
79 
80 inline bool HepAxisAngle::operator==( const AA & aa ) const {
81  return ( compare( aa ) == 0 );
82 } // HepAxisAngle::operator==()
83 
84 
85 inline bool HepAxisAngle::operator!=( const AA & aa ) const {
86  return ( compare( aa ) != 0 );
87 } // HepAxisAngle::operator!=()
88 
89 
90 inline bool HepAxisAngle::operator<( const AA & aa ) const {
91  return ( compare( aa ) < 0 );
92 } // HepAxisAngle::operator<()
93 
94 
95 inline bool HepAxisAngle::operator<=( const AA & aa ) const {
96  return ( compare( aa ) <= 0 );
97 } // HepAxisAngle::operator<=()
98 
99 
100 inline bool HepAxisAngle::operator>( const AA & aa ) const {
101  return ( compare( aa ) > 0 );
102 } // HepAxisAngle::operator>()
103 
104 
105 inline bool HepAxisAngle::operator>=( const AA & aa ) const {
106  return ( compare( aa ) >= 0 );
107 } // HepAxisAngle::operator>=()
108 
109 
110 inline double HepAxisAngle::getTolerance() {
111  return tolerance;
112 } // HepAxisAngle::getTolerance()
113 
114 
115 inline double HepAxisAngle::setTolerance( Scalar tol ) {
116  Scalar oldTolerance( tolerance );
117  tolerance = tol;
118  return oldTolerance;
119 } // HepAxisAngle::setTolerance()
120 
121 } // namespace CLHEP