OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
PatchRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_PatchRep_HH
2 #define CLASSIC_PatchRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: PatchRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: PatchRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:34 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/Patch.h"
26 #include "Fields/NullField.h"
27 
28 
29 // Class PatchRep
30 // ------------------------------------------------------------------------
32 
33 class PatchRep: public Patch {
34 
35 public:
36 
38  explicit PatchRep(const std::string &name);
39 
40  PatchRep();
41  PatchRep(const PatchRep &);
42  virtual ~PatchRep();
43 
45  // Return an identical deep copy of the element.
46  virtual ElementBase *clone() const;
47 
49  // This method constructs a Channel permitting read/write access to
50  // the attribute [b]aKey[/b] and returns it.
51  // If the attribute does not exist, it returns NULL.
52  virtual Channel *getChannel(const std::string &aKey, bool = false);
53 
55  // Version for non-constant object.
56  virtual NullField &getField();
57 
59  // Version for constant object.
60  virtual const NullField &getField() const;
61 
63  // Version for non-constant object.
64  virtual NullGeometry &getGeometry();
65 
67  // Version for constant object.
68  virtual const NullGeometry &getGeometry() const;
69 
71  // Return the geometric patch to transform from input to output.
72  virtual const Euclid3D &getPatch() const;
73 
75  // Assign the geometric patch to transform from input to output.
76  void setPatch(const Euclid3D &euclid);
77 
79  // Assign the geometric patch to transform from input to output,
80  // using the displacement (x,y,z) and the rotation vector (vx,vy,vz).
81  void setPatch(double x, double y, double z,
82  double vx, double vy, double vz);
83 
85  // Return the image of the element, containing the name and type string
86  // of the element, and a copy of the user-defined attributes.
87  virtual ElementImage *getImage() const;
88 
90  // Return the x-displacement.
91  double getX() const;
92 
94  // Return the y-displacement.
95  double getY() const;
96 
98  // Return the z-displacement.
99  double getZ() const;
100 
102  // Return the rotation around the x-axis
103  double getVX() const;
104 
106  // Return the rotation around the y-axis
107  double getVY() const;
108 
110  // Return the rotation around the z-axis
111  double getVZ() const;
112 
114  // Assign the x-displacement.
115  void setX(double);
116 
118  // Assign the y-displacement.
119  void setY(double);
120 
122  // Assign the z-displacement.
123  void setZ(double);
124 
126  // Assign the rotation around the x-axis
127  void setVX(double);
128 
130  // Assign the rotation around the y-axis
131  void setVY(double);
132 
134  // Assign the rotation around the z-axis
135  void setVZ(double);
136 
137 private:
138 
139  // Not implemented.
140  void operator=(const PatchRep &);
141 
144 
147 
150 };
151 
152 #endif // CLASSIC_PatchRep_HH
double getVX() const
Get rotation.
Definition: PatchRep.cpp:171
double getX() const
Get displacement.
Definition: PatchRep.cpp:156
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: PatchRep.cpp:99
void setY(double)
Set displacement.
Definition: PatchRep.cpp:197
double getVZ() const
Get rotation.
Definition: PatchRep.cpp:185
double getVY() const
Get rotation.
Definition: PatchRep.cpp:178
void setX(double)
Set displacement.
Definition: PatchRep.cpp:192
Interface for basic beam line object.
Definition: ElementBase.h:128
virtual ElementBase * clone() const
Return clone.
Definition: PatchRep.cpp:94
virtual NullGeometry & getGeometry()
Get geometry.
Definition: PatchRep.cpp:119
Representation for a geometry patch.
Definition: PatchRep.h:33
void setVX(double)
Set rotation.
Definition: PatchRep.cpp:207
A zero electromagnetic field.
Definition: NullField.h:30
NullGeometry geometry
The geometry.
Definition: PatchRep.h:146
void operator=(const PatchRep &)
double getY() const
Get displacement.
Definition: PatchRep.cpp:161
void setVY(double)
Set rotation.
Definition: PatchRep.cpp:215
void setZ(double)
Set displacement.
Definition: PatchRep.cpp:202
An image of an element.
Definition: ElementImage.h:35
Geometry representing an identity transform.
Definition: NullGeometry.h:32
Displacement and rotation in space.
Definition: Euclid3D.h:68
virtual ~PatchRep()
Definition: PatchRep.cpp:90
PatchRep()
Definition: PatchRep.cpp:75
virtual ElementImage * getImage() const
Construct an image.
Definition: PatchRep.cpp:145
Abstract interface for read/write access to variable.
Definition: Channel.h:32
void setPatch(const Euclid3D &euclid)
Set patch.
Definition: PatchRep.cpp:134
NullField field
The zero magnetic field.
Definition: PatchRep.h:143
Euclid3D patch
The geometry patch.
Definition: PatchRep.h:149
virtual NullField & getField()
Get field.
Definition: PatchRep.cpp:110
const std::string name
virtual const Euclid3D & getPatch() const
Get patch.
Definition: PatchRep.cpp:129
Interface for a geometric patch.
Definition: Patch.h:34
void setVZ(double)
Set rotation.
Definition: PatchRep.cpp:223
double getZ() const
Get displacement.
Definition: PatchRep.cpp:166