OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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
35public:
36
38 // Using the [b]length[/b].
39 StraightGeometry(double length = 0.0);
40
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.
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
101private:
102
103 // The design length.
104 double len;
105};
106
107// inlined (trivial) member functions
108
110{}
111
113 BGeometryBase(right), len(right.len)
114{}
115
116inline const StraightGeometry &StraightGeometry::operator=
117(const StraightGeometry &rhs) {
118 len = rhs.len;
119 return *this;
120}
121
122#endif // CLASSIC_StraightGeometry_HH
Displacement and rotation in space.
Definition: Euclid3D.h:68
Abstract base class for accelerator geometry classes.
Definition: Geometry.h:43
A geometry representing a straight line.
virtual double getElementLength() const
Get design length.
Euclid3D getEntranceFrame() const
Get transform.
double getExit() const
Get exit.
virtual double getArcLength() const
Get arc length.
virtual void setElementLength(double length)
Set design length.
virtual ~StraightGeometry()
Euclid3D getExitFrame() const
Get transform.
StraightGeometry(double length=0.0)
Constructor.
double getEntrance() const
Get entrance.
const StraightGeometry & operator=(const StraightGeometry &right)
Euclid3D getTransform(double fromS, double toS) const
Get transform.
double getOrigin() const
Get origin.
Euclid3D getTotalTransform() const
Get transform.