OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
SRotatedGeometry.h
Go to the documentation of this file.
1 #ifndef CLASSIC_SRotatedGeometry_HH
2 #define CLASSIC_SRotatedGeometry_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: SRotatedGeometry.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: SRotatedGeometry
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 SRotatedGeometry
26 // ------------------------------------------------------------------------
28 // An SRotatedGeometry object is a Geometry wrapper which adds two
29 // arbitrary s-rotations (local z-axis rotations) to the entrance and
30 // exit planes of an arbitrary geometry. Any Geometry object can be
31 // wrapped, including another SRotatedGeometry. The s-rotations become
32 // part of the global geometry definition. Functions for setting the
33 // two in- and out-rotations using certain constraints are provided.
34 // [P]
35 // NOTE: in general the transformations returned include the effects of
36 // the s-rotations when the required distance parameter specified is
37 // either the entrance or exit point. Requests for transformations
38 // within the geometry (i.e. from s1 to s2, where s1 and/or s2 are not
39 // the entrance or exit planes) do not contain the s-rotations.
40 
42 public:
43 
45  enum BalanceMode {
46 
49 
51  // srotOut is calculated to be the vlaue which returns the local
52  // x-axis after rotation to be in a plane parallel with the local
53  // x-axis before application of srotIn.
55 
56  };
57 
59  // Use the wrapped geometry [b]geom[/b],
60  // and the two angles [b]srotIn[/b] and [b]srotOut[/b].
61  SRotatedGeometry(const BGeometryBase &geom, double srotIn, double srotOut);
62 
64  // Use the wrapped geometry [b]geom[/b],
65  // the entrance rotation [b]srotIn[/b],
66  // and the balanc mode [b]mode[/b].
67  SRotatedGeometry(const BGeometryBase &geom, double srotIn, BalanceMode mode = tilt);
68 
70  virtual ~SRotatedGeometry();
72 
74  // Return or the design length of the embedded geometry.
75  // This is the length of the straight line connecting entrance and exit.
76  virtual double getArcLength() const;
77 
79  // Return or the design length of the embedded geometry.
80  // Depending on the element this may be the arc length or the straight
81  // length.
82  virtual double getElementLength() const;
83 
85  double getSrotIn() const;
86 
88  double getSrotOut() const;
89 
91  void setSrotIn(double);
92 
94  void setSrotOut(double);
95 
97  // Set the exit rotation in one of two modes:
98  // [UL]
99  // [LI]if [tt]mode==tilt[/tt], then srotOut is set to -srotIn.
100  // [LI]if [tt]mode==balanceX[/tt], then srotOut is calculated to be
101  // the value which returns the local x-axis after rotation to be in
102  // a parallel plane with the local x-axis before the application of
103  // [tt]srotIn[/tt].
104  // [/UL]
105  void balanceSrots(BalanceMode mode = tilt);
106 
108  // Return the arc length from the entrance to the origin of the
109  // geometry (non-negative).
110  double getOrigin() const;
111 
113  // Return the arc length from the origin to the entrance of the
114  // geometry (non-positive)
115  double getEntrance() const;
116 
118  // Return the arc length from the origin to the exit of the
119  // geometry (non-negative)
120  double getExit() const;
121 
123  // Return the transform of the local coordinate system from the
124  // position [b]fromS[/b] to the position [b]toS[/b].
125  Euclid3D getTransform(double fromS, double toS) const;
126 
128  // Equivalent to getTransform(0.0, s).
129  // Return the transform of the local coordinate system from the
130  // origin and [b]s[/b].
131  Euclid3D getTransform(double s) const;
132 
134  // Equivalent to getTransform(getEntrance(), getExit()).
135  // Return the transform of the local coordinate system from the
136  // entrance to the exit of the element.
137  Euclid3D getTotalTransform() const;
138 
140  // Equivalent to getTransform(0.0, getEntrance()).
141  // Return the transform of the local coordinate system from the
142  // origin to the entrance of the element.
143  Euclid3D getEntranceFrame() const;
144 
146  // Equivalent to getTransform(0.0, getExit()).
147  // Return the transform of the local coordinate system from the
148  // origin to the exit of the element.
149  Euclid3D getExitFrame() const;
150 
152  // Returns the entrance patch (transformation) which is used to
153  // transform the global geometry to the local geometry at entrance.
154  Euclid3D getEntrancePatch() const;
155 
157  // Returns the entrance patch (transformation) which is used to
158  // transform the local geometry to the global geometry at exit.
159  Euclid3D getExitPatch() const;
160 
161 private:
162 
163  double srotIn;
164  double srotOut;
166 };
167 
168 #endif // CLASSIC_SRotatedGeometry_HH
169 
virtual double getArcLength() const
Get arc length.
virtual double getElementLength() const
Get design length.
BalanceMode
Balance mode.
const BGeometryBase & geom
Euclid3D getExitPatch() const
Get patch.
srotOut is set to -srotIn.
double getEntrance() const
Get entrance.
Euclid3D getTransform(double fromS, double toS) const
Get transform.
double getSrotIn() const
Get entrance rotation.
Abstract base class for accelerator geometry classes.
Definition: Geometry.h:43
Euclid3D getExitFrame() const
Get transform.
SRotatedGeometry(const BGeometryBase &geom, double srotIn, double srotOut)
Constructor.
void setSrotIn(double)
Set entrance rotation.
double getOrigin() const
Get origin.
double getExit() const
Get exit.
const SRotatedGeometry & operator=(const SRotatedGeometry &)
Displacement and rotation in space.
Definition: Euclid3D.h:68
void setSrotOut(double)
Set exit rotation.
Euclid3D getEntranceFrame() const
Get transform.
void balanceSrots(BalanceMode mode=tilt)
Balance rotations.
double getSrotOut() const
Get exit rotation.
A Geometry which wraps an arbitrary geometry in two s-rotations.
virtual ~SRotatedGeometry()
srotOut calculated.
Euclid3D getTotalTransform() const
Get transform.
Euclid3D getEntrancePatch() const
Get patch.