OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Geometry.h
Go to the documentation of this file.
1#ifndef OPALX_BGeometryBase_HH
2#define OPALX_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// Class BGeometryBase
27// ------------------------------------------------------------------------
29// A BGeometryBase can be considered a 3-dimensional space line parameterised by
30// the distance along the line (arc length) s. All Geometries have an exit
31// and entrance plane and an origin. At any position s, a BGeometryBase can define
32// a unique 3-d rectilinear coordinate frame whose origin is on the geometry
33// at s, and whose local z-axis is tangential to the geometry at s. The
34// orientation of the local x- and y-axes are arbitrarilly specified by
35// the BGeometryBase. A special frame, referred to as the BGeometryBase Local Frame
36// (or Local Frame when it is unambiguous) is specified at s = origin. The
37// Local Frame is is used to define that frame about which translations and
38// rotations can be applied to the BGeometryBase. The entrance and exit planes
39// are defined as those x-y planes (z=0, s=constant) in the frames defined
40// at s=entrance and s=exit.
41
43public:
45 BGeometryBase(const BGeometryBase& right);
46 virtual ~BGeometryBase();
47 const BGeometryBase& operator=(const BGeometryBase& right);
48
50 // Return the length of the geometry, measured along the design arc.
51 virtual double getArcLength() const = 0;
52
54 // Return or the design length of the geometry.
55 // Depending on the element this may be the arc length or the
56 // straight length.
57 virtual double getElementLength() const = 0;
58
60 // Assign the design length of the geometry.
61 // Depending on the element this may be the arc length or the
62 // straight length.
63 virtual void setElementLength(double length);
64
66 // Return the arc length from the entrance to the origin of the
67 // geometry (non-negative).
68 virtual double getOrigin() const;
69
71 // Return the arc length from the origin to the entrance of the
72 // geometry (non-positive).
73 virtual double getEntrance() const;
74
76 // Return the arc length from the origin to the exit of the
77 // geometry (non-negative).
78 virtual double getExit() const;
79
81 // Return the transform of the local coordinate system from the
82 // position [b]fromS[/b] to the position [b]toS[/b].
83 virtual Euclid3D getTransform(double fromS, double toS) const = 0;
84
86 // Equivalent to getTransform(0.0, s).
87 // Return the transform of the local coordinate system from the
88 // origin and [b]s[/b].
89 virtual Euclid3D getTransform(double s) const;
90
92 // Equivalent to getTransform(getEntrance(), getExit()).
93 // Return the transform of the local coordinate system from the
94 // entrance to the exit of the element.
95 virtual Euclid3D getTotalTransform() const;
96
98 // Equivalent to getTransform(0.0, getEntrance()).
99 // Return the transform of the local coordinate system from the
100 // origin to the entrance of the element.
101 virtual Euclid3D getEntranceFrame() const;
102
104 // Equivalent to getTransform(0.0, getExit()).
105 // Return the transform of the local coordinate system from the
106 // origin to the exit of the element.
107 virtual Euclid3D getExitFrame() const;
108
110 // Returns the entrance patch (transformation) which is used to transform
111 // the global geometry to the local geometry for a misaligned element
112 // at its entrance. The default behaviour returns identity transformation.
113 // This function should be overidden by derived concrete classes which
114 // model complex geometries.
115 virtual Euclid3D getEntrancePatch() const;
116
118 // Returns the entrance patch (transformation) which is used to transform
119 // the local geometry to the global geometry for a misaligned element
120 // at its exit. The default behaviour returns identity transformation.
121 // This function should be overidden by derived concrete classes which
122 // model complex geometries.
123 virtual Euclid3D getExitPatch() const;
124};
125
126// inlined (trivial) member functions
128
130
131inline const BGeometryBase& BGeometryBase::operator=(const BGeometryBase&) { return *this; }
132
133#endif // OPALX_BGeometryBase_HH
Abstract base class for accelerator geometry classes.
Definition Geometry.h:42
virtual Euclid3D getTransform(double fromS, double toS) const =0
Get transform.
virtual Euclid3D getExitFrame() const
Get transform.
Definition Geometry.cpp:43
virtual Euclid3D getExitPatch() const
Get patch.
Definition Geometry.cpp:47
virtual void setElementLength(double length)
Set geometry length.
Definition Geometry.cpp:29
virtual ~BGeometryBase()
Definition Geometry.cpp:27
virtual double getEntrance() const
Get entrance position.
Definition Geometry.cpp:33
virtual double getExit() const
Get exit position.
Definition Geometry.cpp:35
virtual Euclid3D getTotalTransform() const
Get transform.
Definition Geometry.cpp:37
virtual double getElementLength() const =0
Get geometry length.
virtual double getOrigin() const
Get origin position.
Definition Geometry.cpp:31
virtual Euclid3D getEntranceFrame() const
Get transform.
Definition Geometry.cpp:41
const BGeometryBase & operator=(const BGeometryBase &right)
Definition Geometry.h:131
virtual Euclid3D getEntrancePatch() const
Get patch.
Definition Geometry.cpp:45
virtual double getArcLength() const =0
Get arc length.
Displacement and rotation in space.
Definition Euclid3D.h:67