OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Geometry.h
Go to the documentation of this file.
1 #ifndef CLASSIC_BGeometryBase_HH
2 #define CLASSIC_BGeometryBase_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: BGeometryBase.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: BGeometryBase
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineBGeometryBase
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:34 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 // Euclid3D represents an aribitrary 3-d rotation and displacement.
25 
26 
27 // Class BGeometryBase
28 // ------------------------------------------------------------------------
30 // A BGeometryBase can be considered a 3-dimensional space line parameterised by
31 // the distance along the line (arc length) s. All Geometries have an exit
32 // and entrance plane and an origin. At any position s, a BGeometryBase can define
33 // a unique 3-d rectilinear coordinate frame whose origin is on the geometry
34 // at s, and whose local z-axis is tangential to the geometry at s. The
35 // orientation of the local x- and y-axes are arbitrarilly specified by
36 // the BGeometryBase. A special frame, referred to as the BGeometryBase Local Frame
37 // (or Local Frame when it is unambiguous) is specified at s = origin. The
38 // Local Frame is is used to define that frame about which translations and
39 // rotations can be applied to the BGeometryBase. The entrance and exit planes
40 // are defined as those x-y planes (z=0, s=constant) in the frames defined
41 // at s=entrance and s=exit.
42 
44 public:
45 
46  BGeometryBase();
47  BGeometryBase(const BGeometryBase &right);
48  virtual ~BGeometryBase();
49  const BGeometryBase &operator=(const BGeometryBase &right);
50 
52  // Return the length of the geometry, measured along the design arc.
53  virtual double getArcLength() const = 0;
54 
56  // Return or the design length of the geometry.
57  // Depending on the element this may be the arc length or the
58  // straight length.
59  virtual double getElementLength() const = 0;
60 
62  // Assign the design length of the geometry.
63  // Depending on the element this may be the arc length or the
64  // straight length.
65  virtual void setElementLength(double length);
66 
68  // Return the arc length from the entrance to the origin of the
69  // geometry (non-negative).
70  virtual double getOrigin() const;
71 
73  // Return the arc length from the origin to the entrance of the
74  // geometry (non-positive).
75  virtual double getEntrance() const;
76 
78  // Return the arc length from the origin to the exit of the
79  // geometry (non-negative).
80  virtual double getExit() const;
81 
83  // Return the transform of the local coordinate system from the
84  // position [b]fromS[/b] to the position [b]toS[/b].
85  virtual Euclid3D getTransform(double fromS, double toS) const = 0;
86 
88  // Equivalent to getTransform(0.0, s).
89  // Return the transform of the local coordinate system from the
90  // origin and [b]s[/b].
91  virtual Euclid3D getTransform(double s) const;
92 
94  // Equivalent to getTransform(getEntrance(), getExit()).
95  // Return the transform of the local coordinate system from the
96  // entrance to the exit of the element.
97  virtual Euclid3D getTotalTransform() const;
98 
100  // Equivalent to getTransform(0.0, getEntrance()).
101  // Return the transform of the local coordinate system from the
102  // origin to the entrance of the element.
103  virtual Euclid3D getEntranceFrame() const;
104 
106  // Equivalent to getTransform(0.0, getExit()).
107  // Return the transform of the local coordinate system from the
108  // origin to the exit of the element.
109  virtual Euclid3D getExitFrame() const;
110 
112  // Returns the entrance patch (transformation) which is used to transform
113  // the global geometry to the local geometry for a misaligned element
114  // at its entrance. The default behaviour returns identity transformation.
115  // This function should be overidden by derived concrete classes which
116  // model complex geometries.
117  virtual Euclid3D getEntrancePatch() const;
118 
120  // Returns the entrance patch (transformation) which is used to transform
121  // the local geometry to the global geometry for a misaligned element
122  // at its exit. The default behaviour returns identity transformation.
123  // This function should be overidden by derived concrete classes which
124  // model complex geometries.
125  virtual Euclid3D getExitPatch() const;
126 };
127 
128 // inlined (trivial) member functions
130 { }
131 
133 { }
134 
136 { return *this; }
137 
138 #endif // CLASSIC_BGeometryBase_HH
virtual Euclid3D getTransform(double fromS, double toS) const =0
Get transform.
virtual double getEntrance() const
Get entrance position.
Definition: Geometry.cpp:41
virtual Euclid3D getEntranceFrame() const
Get transform.
Definition: Geometry.cpp:61
virtual double getOrigin() const
Get origin position.
Definition: Geometry.cpp:36
virtual void setElementLength(double length)
Set geometry length.
Definition: Geometry.cpp:32
virtual double getExit() const
Get exit position.
Definition: Geometry.cpp:46
virtual double getElementLength() const =0
Get geometry length.
Abstract base class for accelerator geometry classes.
Definition: Geometry.h:43
virtual Euclid3D getTotalTransform() const
Get transform.
Definition: Geometry.cpp:51
Displacement and rotation in space.
Definition: Euclid3D.h:68
virtual double getArcLength() const =0
Get arc length.
virtual Euclid3D getExitPatch() const
Get patch.
Definition: Geometry.cpp:76
const BGeometryBase & operator=(const BGeometryBase &right)
Definition: Geometry.h:135
virtual Euclid3D getEntrancePatch() const
Get patch.
Definition: Geometry.cpp:71
virtual ~BGeometryBase()
Definition: Geometry.cpp:28
virtual Euclid3D getExitFrame() const
Get transform.
Definition: Geometry.cpp:66