OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
StraightGeometry.h
Go to the documentation of this file.
1#ifndef OPALX_StraightGeometry_HH
2#define OPALX_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:
37 // Using the [b]length[/b].
38 StraightGeometry(double length = 0.0);
39
41 virtual ~StraightGeometry();
42 const StraightGeometry& operator=(const StraightGeometry& right);
43
45 // Return the arc length, identical to the straight design length.
46 virtual double getArcLength() const;
47
49 // Return the straight design length.
50 virtual double getElementLength() const;
51
53 // Assign the straight design length.
54 virtual void setElementLength(double length);
55
57 // Return the arc length from the entrance to the origin of the element
58 // (origin >= 0)
59 double getOrigin() const;
60
62 // Return the arc length from the origin to the entrance of the element
63 // (entrance <= 0)
64 double getEntrance() const;
65
67 // Return the arc length from the origin to the exit of the element
68 // (exit >= 0)
69 double getExit() const;
70
72 // Return the transform of the local coordinate system from the
73 // position [b]fromS[/b] to the position [b]toS[/b].
74 Euclid3D getTransform(double fromS, double toS) const;
75
77 // Equivalent to getTransform(0.0, s).
78 // Return the transform of the local coordinate system from the
79 // origin and [b]s[/b].
80 Euclid3D getTransform(double s) const;
81
83 // Equivalent to getTransform(getEntrance(), getExit()).
84 // Return the transform of the local coordinate system from the
85 // entrance to the exit of the element.
87
89 // Equivalent to getTransform(0.0, getEntrance()).
90 // Return the transform of the local coordinate system from the
91 // origin to the entrance of the element.
93
95 // Equivalent to getTransform(0.0, getExit()).
96 // Return the transform of the local coordinate system from the
97 // origin to the exit of the element.
98 Euclid3D getExitFrame() const;
99
100private:
101 // The design length.
102 double len;
103};
104
105// inlined (trivial) member functions
106
107inline StraightGeometry::StraightGeometry(double l) : len(l) {}
108
110 : BGeometryBase(right), len(right.len) {}
111
113 len = rhs.len;
114 return *this;
115}
116
117#endif // OPALX_StraightGeometry_HH
Abstract base class for accelerator geometry classes.
Definition Geometry.h:42
Displacement and rotation in space.
Definition Euclid3D.h:67
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.
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.