OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
OffsetGeometry.h
Go to the documentation of this file.
1 #ifndef CLASSIC_OffsetGeometry_HH
2 #define CLASSIC_OffsetGeometry_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: OffsetGeometry.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: OffsetGeometry
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineGeometry
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:34 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
25 
26 // Class OffsetGeometry
27 // ------------------------------------------------------------------------
29 // OffsetGeometry effectively acts as a bridge between two geometries,
30 // designated as the global geometry and the local geometry. The global
31 // geometry is used to define a segment of the true global geometry, and
32 // so most functions are delegated to the global geometry. The local and
33 // global geometries are ``offset'' with respect to each other by a single
34 // transformation (Euclid3D object), which defines the transformation from
35 // the global geometry's Local Frame to the local geometry's Local Frame.
36 // The two patch functions return the necessary transformations to/from the
37 // global/local geometries. OffsetGeometry primary task is to calculate
38 // these two patches. Note that when OffsetGeometry is being used to model
39 // an alignment error, the local and global geometries can both refer to
40 // the same geometry.
41 
42 class OffsetGeometry : public BGeometryBase {
43 public:
44 
46  // Assign the [b]global[/b] and [b]local[/b] geometries,
47  // and the displacement [b]euclid[/b] between their origins.
49  (const BGeometryBase &global, const BGeometryBase &local, const Euclid3D &euclid);
50 
52  // Both global and local geometries are set to [b]geom[/b],
53  // and the displacement is [b]euclid[/b].
54  OffsetGeometry(const BGeometryBase &geom, const Euclid3D &euclid);
55 
57  virtual ~OffsetGeometry();
58  const OffsetGeometry &operator=(const OffsetGeometry &);
59 
61  // Return the displacement from the global to the local origin.
62  Euclid3D getGtoL() const;
63 
65  // Assign the displacement from the global to the local origin.
66  void setGtoL(const Euclid3D &);
67 
69  // Return the length of the global geometry,
70  // measured along its design arc.
71  virtual double getArcLength() const;
72 
74  // Return the design length of the global geometry,
75  // measured along its design polygone.
76  virtual double getElementLength() const;
77 
79  // Return the arc length from the entrance to the origin of the
80  // global geometry (non-negative).
81  virtual double getOrigin() const;
82 
84  // Return the arc length from the origin to the entrance of the
85  // global geometry (non-positive).
86  virtual double getEntrance() const;
87 
89  // Return the arc length from the origin to the exit of the
90  // global geometry (non-negative).
91  virtual double getExit() const;
92 
94  // Return the transform of the global coordinate system from the
95  // position [b]fromS[/b] to the position [b]toS[/b].
96  virtual Euclid3D getTransform(double fromS, double toS) const;
97 
99  // Equivalent to getTransform(0.0, s).
100  // Return the transform of the local coordinate system from the
101  // global origin at [b]s[/b].
102  virtual Euclid3D getTransform(double s) const;
103 
105  // Equivalent to getTransform(getEntrance(), getExit()).
106  // Return the transform of the global coordinate system from the
107  // entrance to the exit of the element.
108  virtual Euclid3D getTotalTransform() const;
109 
110 
112  // Equivalent to getTransform(0.0, getEntrance()).
113  // Return the transform of the local coordinate system from the
114  // global origin to the entrance of the element.
115  virtual Euclid3D getEntranceFrame() const;
116 
118  // Equivalent to getTransform(0.0, getExit()).
119  // Return the transform of the local coordinate system from the
120  // global origin to the exit of the element.
121  virtual Euclid3D getExitFrame() const;
122 
124  // Return the entrance patch (transformation) which is used to transform
125  // the global geometry to the local geometry at entrance.
126  virtual Euclid3D getEntrancePatch() const;
127 
129  // Returns the entrance patch (transformation) which is used to transform
130  // the local geometry to the global geometry at exit.
131  virtual Euclid3D getExitPatch() const;
132 
134  // Special OffsetGeometry function which calculates the transformation
135  // from position [b]globalS[/b] on the global geometry to position
136  // [b]localS[/b] on the local geometry.
137  Euclid3D getGlobalToLocalTransform(double globalS, double localS) const;
138 
139 private:
140 
144 };
145 
146 #endif // CLASSIC_OffsetGeometry_HH
147 
OffsetGeometry(const BGeometryBase &global, const BGeometryBase &local, const Euclid3D &euclid)
Constructor.
virtual ~OffsetGeometry()
A geometry which offset with respect to some global geometry.
virtual Euclid3D getEntranceFrame() const
Get transform.
virtual Euclid3D getTotalTransform() const
Get transform.
virtual Euclid3D getEntrancePatch() const
Get patch.
virtual double getOrigin() const
Get origin.
virtual Euclid3D getExitFrame() const
Get transform.
virtual double getEntrance() const
Get entrance position.
virtual Euclid3D getExitPatch() const
Get patch.
Abstract base class for accelerator geometry classes.
Definition: Geometry.h:43
Euclid3D getGlobalToLocalTransform(double globalS, double localS) const
Transform global to local.
Displacement and rotation in space.
Definition: Euclid3D.h:68
virtual double getExit() const
Get exit position.
virtual Euclid3D getTransform(double fromS, double toS) const
Get transform.
void setGtoL(const Euclid3D &)
Set displacement.
const BGeometryBase & local
const BGeometryBase & global
const OffsetGeometry & operator=(const OffsetGeometry &)
Euclid3D getGtoL() const
Get displacement.
virtual double getElementLength() const
Get design length.
virtual double getArcLength() const
Get arc length.