Commit 4ef00b34 authored by gsell's avatar gsell

repo reorganization

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
// ------------------------------------------------------------------------
// $RCSfile: AlignWrapper.cpp,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: AlignWrapper
//
// ------------------------------------------------------------------------
// Class category: AbsBeamline
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:32:31 $
// $Author: fci $
//
// ------------------------------------------------------------------------
#include "AbsBeamline/AlignWrapper.h"
#include "AbsBeamline/BeamlineVisitor.h"
// Class AlignWrapper
// ------------------------------------------------------------------------
void AlignWrapper::accept(BeamlineVisitor &visitor) const {
visitor.visitAlignWrapper(*this);
}
AlignWrapper *AlignWrapper::clone() const {
return new AlignWrapper(*this);
}
ElementBase *AlignWrapper::copyStructure() {
if(isSharable()) {
return this;
} else {
AlignWrapper *wrap = new AlignWrapper(*this);
wrap->itsElement = itsElement->copyStructure();
return wrap;
}
}
void AlignWrapper::makeSharable() {
shareFlag = true;
itsElement->makeSharable();
}
Euclid3D AlignWrapper::getEntranceTransform() const {
if(itsOffset.isIdentity()) {
return itsOffset;
} else {
Euclid3D frame = itsElement->getEntranceFrame();
return frame.inverse() * itsOffset * frame;
}
}
Euclid3D AlignWrapper::getExitTransform() const {
if(itsOffset.isIdentity()) {
return itsOffset;
} else {
Euclid3D frame = itsElement->getExitFrame();
return frame * Inverse(itsOffset) * Inverse(frame);
}
}
ElementBase *AlignWrapper::getElement() const {
return &*itsElement;
}
void AlignWrapper::setElement(ElementBase *elem) {
itsElement = elem;
}
Geometry &AlignWrapper::getGeometry() {
return itsElement->getGeometry();
}
const Geometry &AlignWrapper::getGeometry() const {
return itsElement->getGeometry();
}
const string &AlignWrapper::getType() const {
return itsElement->getType();
}
Euclid3D &AlignWrapper::offset() const {
return itsOffset;
}
ElementBase *AlignWrapper::makeAlignWrapper() {
return this;
}
ElementBase *AlignWrapper::makeFieldWrapper() {
itsElement = itsElement->makeFieldWrapper();
itsElement->setName(itsElement->getName());
return this;
}
ElementBase *AlignWrapper::removeAlignWrapper() {
return &*itsElement;
}
const ElementBase *AlignWrapper::removeAlignWrapper() const {
return &*itsElement;
}
ElementBase *AlignWrapper::removeFieldWrapper() {
return new AlignWrapper(itsElement->removeFieldWrapper());
}
const ElementBase *AlignWrapper::removeFieldWrapper() const {
return new AlignWrapper(itsElement->removeFieldWrapper());
}
ElementBase *AlignWrapper::removeWrappers() {
return itsElement->removeWrappers();
}
const ElementBase *AlignWrapper::removeWrappers() const {
return itsElement->removeWrappers();
}
AlignWrapper::AlignWrapper(const AlignWrapper &rhs):
ElementBase(rhs), itsElement(rhs.itsElement), itsOffset(rhs.itsOffset) {
shareFlag = false;
}
AlignWrapper::~AlignWrapper()
{}
AlignWrapper::AlignWrapper(ElementBase *elem):
ElementBase(elem->getName()), itsElement(elem), itsOffset() {
shareFlag = false;
}
#ifndef CLASSIC_AlignWrapper_HH
#define CLASSIC_AlignWrapper_HH
// ------------------------------------------------------------------------
// $RCSfile: AlignWrapper.h,v $
// ------------------------------------------------------------------------
// $Revision: 1.1.1.1 $
// ------------------------------------------------------------------------
// Copyright: see Copyright.readme
// ------------------------------------------------------------------------
//
// Class: AlignWrapper
//
// ------------------------------------------------------------------------
// Class category: AbsBeamline
// ------------------------------------------------------------------------
//
// $Date: 2000/03/27 09:32:31 $
// $Author: fci $
//
// ------------------------------------------------------------------------
#include "AbsBeamline/ElementBase.h"
#include "BeamlineGeometry/Euclid3D.h"
#include "MemoryManagement/Pointer.h"
class BeamlineVisitor;
// Class AlignWrapper
// ------------------------------------------------------------------------
/// Define the position of a misaligned element.
// An AlignWrapper is used to store misalignment errors or deliberate
// misalignments. It acts as a wrapper around a component or a complete
// beam line. Rotations and translations are defined about the design
// local frame, which in turn is specified by the position of the element
// on the design geometry. An AlignWrapper is non-sharable by default.
class AlignWrapper: public ElementBase {
friend class ElementBase;
public:
/// Apply BeamlineVisitor.
virtual void accept(BeamlineVisitor &) const;
/// Return clone.
// Return an identical deep copy of the wrapper and its contents.
virtual AlignWrapper *clone() const;
/// Make structural copy.
virtual ElementBase *copyStructure();
/// Set sharable flag.
// The whole structure depending on [b]this[/b] is marked as sharable.
// After this call a [b]copyStructure()[/b] call reuses the element.
virtual void makeSharable();
/// Get entrance patch.
// Returns the entrance patch (transformation) which is used to
// transform the global geometry to the local geometry at entrance
// of the misaligned element.
virtual Euclid3D getEntranceTransform() const;
/// Get exit patch.
// Returns the exit patch (transformation) which is used to
// transform the local geometry to the global geometry at exit of
// the misaligned element.
virtual Euclid3D getExitTransform() const;
/// Return the contained element.
virtual ElementBase *getElement() const;
/// Replace the contained element.
void setElement(ElementBase *);
/// Get geometry.
// Return the element geometry.
// Version for non-constant object.
virtual Geometry &getGeometry();