Commit e54aba51 authored by Daniel Winklehner's avatar Daniel Winklehner
Browse files

Fixed some issues with new asignment operators in variable RF cavities that...

Fixed some issues with new asignment operators in variable RF cavities that prevented gcc from compiling on merlin PLEASE DOUBLE-CHECK
parent 86ce71fc
......@@ -213,12 +213,12 @@ bool operator==(const Offset& off1, const Offset& off2) {
return false;
}
for (int i = 0; i < 3; ++i) {
if (fabs(off1.getEndPosition()(i)-off2.getEndPosition()(i)) > tol ||
fabs(off1.getEndDirection()(i)-off2.getEndDirection()(i)) > tol)
if ( (fabs(off1.getEndPosition()(i)-off2.getEndPosition()(i)) > tol) ||
(fabs(off1.getEndDirection()(i)-off2.getEndDirection()(i)) > tol))
return false;
}
if (&off1.getGeometry() == NULL && &off2.getGeometry() != NULL ||
&off2.getGeometry() == NULL && &off1.getGeometry() != NULL)
if ( (&off1.getGeometry() == NULL && &off2.getGeometry() != NULL) ||
(&off2.getGeometry() == NULL && &off1.getGeometry() != NULL))
return false;
Euclid3D transform1 = off1.getGeometry().getTotalTransform();
Euclid3D transform2 = off2.getGeometry().getTotalTransform();
......@@ -239,7 +239,7 @@ std::ostream& operator<<(std::ostream& out, const Offset& off) {
out << "Offset " << off.getName() << " local " << off.getIsLocal()
<< " end pos: " << off.getEndPosition()
<< " end dir: " << off.getEndDirection() << std::endl;
return out;
}
bool Offset::bends() const {
......
......@@ -73,8 +73,8 @@ class VariableRFCavity: public Component {
virtual double getHeight() const {return halfHeight_m*2;}
virtual double getWidth() const {return halfWidth_m*2;}
virtual double setHeight(double fullHeight) {halfHeight_m = fullHeight/2;}
virtual double setWidth(double fullWidth) {halfWidth_m = fullWidth/2;}
virtual void setHeight(double fullHeight) {halfHeight_m = fullHeight/2;}
virtual void setWidth(double fullWidth) {halfWidth_m = fullWidth/2;}
virtual AbstractTimeDependence* getAmplitudeModel() const;
......@@ -134,4 +134,3 @@ double VariableRFCavity::getFrequency(double time) const {
#endif // CLASSIC_VirtualRFCavity_HH
......@@ -33,14 +33,17 @@ Euclid3DGeometry::Euclid3DGeometry(Euclid3D transformation)
: BGeometryBase(), transformation_m(transformation) {
}
Euclid3DGeometry::Euclid3DGeometry(const Euclid3DGeometry &right)
: BGeometryBase(), transformation_m(right.transformation_m) {
Euclid3DGeometry::Euclid3DGeometry(const Euclid3DGeometry &rhs)
: BGeometryBase(), transformation_m(rhs.transformation_m) {
}
Euclid3DGeometry::~Euclid3DGeometry() {}
const Euclid3DGeometry &Euclid3DGeometry::operator=(const Euclid3DGeometry &right) {
transformation_m = right.transformation_m;
const Euclid3DGeometry &Euclid3DGeometry::operator=(const Euclid3DGeometry &rhs) {
if (&rhs != this) {
transformation_m = rhs.transformation_m;
}
return *this;
}
double Euclid3DGeometry::getArcLength() const {
......
......@@ -49,17 +49,21 @@ OpalRingSection::~OpalRingSection() {
// delete component_m;
}
// Assignment operator
OpalRingSection& OpalRingSection::operator=(const OpalRingSection& rhs) {
component_m = dynamic_cast<Component*>(rhs.component_m->clone());
if (component_m == NULL)
throw OpalException("OpalRingSection::operator=",
"Failed to copy OpalRingSection");
componentPosition_m = rhs.componentPosition_m;
componentOrientation_m = rhs.componentOrientation_m;
startPosition_m = rhs.startPosition_m;
startOrientation_m = rhs.startOrientation_m;
endPosition_m = rhs.endPosition_m;
endOrientation_m = rhs.endOrientation_m;
if (&rhs != this) {
component_m = dynamic_cast<Component*>(rhs.component_m->clone());
if (component_m == NULL)
throw OpalException("OpalRingSection::operator=",
"Failed to copy OpalRingSection");
componentPosition_m = rhs.componentPosition_m;
componentOrientation_m = rhs.componentOrientation_m;
startPosition_m = rhs.startPosition_m;
startOrientation_m = rhs.startOrientation_m;
endPosition_m = rhs.endPosition_m;
endOrientation_m = rhs.endOrientation_m;
}
return *this;
}
bool OpalRingSection::isOnOrPastStartPlane(const Vector_t& pos) const {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment