OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
StraightGeometry.h
Go to the documentation of this file.
1 #ifndef CLASSIC_StraightGeometry_HH
2 #define CLASSIC_StraightGeometry_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: StraightGeometry.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: StraightGeometry
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineGeometry
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:34 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
24 
25 // Class StraightGeometry
26 // ------------------------------------------------------------------------
28 // StraightGeometry represents a straight line segment along the local
29 // z-axis with no torsion. The origin is defined at the centre of the
30 // segment, and the geometry runs from -length/2 to +length/2. All
31 // transformations are correspondingly only simple translations along
32 // the z-axis.
33 
35 public:
36 
38  // Using the [b]length[/b].
39  StraightGeometry(double length = 0.0);
40 
41  StraightGeometry(const StraightGeometry &right);
42  virtual ~StraightGeometry();
43  const StraightGeometry &operator=(const StraightGeometry &right);
44 
46  // Return the arc length, identical to the straight design length.
47  virtual double getArcLength() const;
48 
50  // Return the straight design length.
51  virtual double getElementLength() const;
52 
54  // Assign the straight design length.
55  virtual void setElementLength(double length);
56 
58  // Return the arc length from the entrance to the origin of the element
59  // (origin >= 0)
60  double getOrigin() const;
61 
63  // Return the arc length from the origin to the entrance of the element
64  // (entrance <= 0)
65  double getEntrance() const;
66 
68  // Return the arc length from the origin to the exit of the element
69  // (exit >= 0)
70  double getExit() const;
71 
73  // Return the transform of the local coordinate system from the
74  // position [b]fromS[/b] to the position [b]toS[/b].
75  Euclid3D getTransform(double fromS, double toS) const;
76 
78  // Equivalent to getTransform(0.0, s).
79  // Return the transform of the local coordinate system from the
80  // origin and [b]s[/b].
81  Euclid3D getTransform(double s) const;
82 
84  // Equivalent to getTransform(getEntrance(), getExit()).
85  // Return the transform of the local coordinate system from the
86  // entrance to the exit of the element.
88 
90  // Equivalent to getTransform(0.0, getEntrance()).
91  // Return the transform of the local coordinate system from the
92  // origin to the entrance of the element.
93  Euclid3D getEntranceFrame() const;
94 
96  // Equivalent to getTransform(0.0, getExit()).
97  // Return the transform of the local coordinate system from the
98  // origin to the exit of the element.
99  Euclid3D getExitFrame() const;
100 
101 private:
102 
103  // The design length.
104  double len;
105 };
106 
107 // inlined (trivial) member functions
108 
109 inline StraightGeometry::StraightGeometry(double l): len(l)
110 {}
111 
113  BGeometryBase(right), len(right.len)
114 {}
115 
116 inline const StraightGeometry &StraightGeometry::operator=
117 (const StraightGeometry &rhs) {
118  len = rhs.len;
119  return *this;
120 }
121 
122 #endif // CLASSIC_StraightGeometry_HH
Euclid3D getTransform(double fromS, double toS) const
Get transform.
Abstract base class for accelerator geometry classes.
Definition: Geometry.h:43
double getEntrance() const
Get entrance.
virtual void setElementLength(double length)
Set design length.
virtual double getArcLength() const
Get arc length.
Displacement and rotation in space.
Definition: Euclid3D.h:68
double getExit() const
Get exit.
Euclid3D getTotalTransform() const
Get transform.
A geometry representing a straight line.
double getOrigin() const
Get origin.
virtual double getElementLength() const
Get design length.
StraightGeometry(double length=0.0)
Constructor.
virtual ~StraightGeometry()
Euclid3D getExitFrame() const
Get transform.
const StraightGeometry & operator=(const StraightGeometry &right)
Euclid3D getEntranceFrame() const
Get transform.