Mantid
|
base class for Geometric IComponent More...
#include <IComponent.h>
Public Member Functions | |
virtual IComponent * | clone () const =0 |
Return a clone to the current object. More... | |
virtual std::vector< std::shared_ptr< const IComponent > > | getAncestors () const =0 |
Return an array of all ancestors, the nearest first. More... | |
virtual const IComponent * | getBareParent () const =0 |
Returns the bare pointer to the IComponent parent. More... | |
virtual IComponent const * | getBaseComponent () const =0 |
Returns const pointer to base component if this component is parametrized. More... | |
virtual void | getBoundingBox (BoundingBox &boundingBox) const =0 |
Get the bounding box for this component and store it in the given argument. More... | |
virtual ComponentID | getComponentID () const =0 |
Returns the ComponentID - a unique identifier of the component. More... | |
virtual double | getDistance (const IComponent &) const =0 |
Get the distance to another IComponent. More... | |
virtual std::string | getFullName () const =0 |
Get the IComponent full path name. More... | |
virtual std::string | getName () const =0 |
Get the IComponent name. More... | |
virtual std::shared_ptr< const IComponent > | getParent () const =0 |
Return a pointer to the current parent. More... | |
virtual Kernel::V3D | getPos () const =0 |
Get the position of the IComponent. Tree structure is traverse through the. More... | |
virtual Kernel::V3D | getRelativePos () const =0 |
Get the position relative to the parent IComponent (absolute if no parent) More... | |
virtual Kernel::Quat | getRelativeRot () const =0 |
Get the relative Orientation. More... | |
virtual Kernel::Quat | getRotation () const =0 |
Get the absolute orientation of the IComponent. More... | |
virtual Kernel::V3D | getScaleFactor () const |
Gets the scaling factor of the object for the Object Component. More... | |
virtual void | rotate (const Kernel::Quat &)=0 |
Rotate the IComponent. This is relative to parent. More... | |
virtual void | rotate (double, const Kernel::V3D &)=0 |
Rotate the IComponent by an angle in degrees with respect to an axis. More... | |
virtual void | setName (const std::string &)=0 |
Set the IComponent name. More... | |
virtual void | setParent (IComponent *)=0 |
Assign a parent IComponent. Previous parent link is lost. More... | |
virtual void | setPos (const Kernel::V3D &)=0 |
Set the position of the component The position is with respect to the parent component. More... | |
virtual void | setPos (double, double, double)=0 |
Set the IComponent position, x, y, z respective to parent (if present) More... | |
virtual void | setRot (const Kernel::Quat &)=0 |
Set the orientation Kernel::Quaternion relative to parent (if present) More... | |
virtual void | translate (const Kernel::V3D &)=0 |
Copy the Rotation from another IComponent. More... | |
virtual void | translate (double, double, double)=0 |
Translate the IComponent (x,y,z form). This is relative to parent if. More... | |
virtual std::string | type () const |
Returns a string representation of the IComponent type. More... | |
virtual | ~IComponent ()=default |
Destructor. More... | |
ParameterMap access | |
virtual std::set< std::string > | getParameterNames (bool recursive=true) const =0 |
Return the names of the parameters for this component. More... | |
virtual std::map< std::string, ComponentID > | getParameterNamesByComponent () const =0 |
return the parameter names and the component they are from More... | |
virtual bool | hasParameter (const std::string &name, bool recursive=true) const =0 |
Returns a boolean indicating if the component has the named parameter. More... | |
virtual std::string | getParameterType (const std::string &pname, bool recursive=true) const =0 |
virtual std::vector< double > | getNumberParameter (const std::string &pname, bool recursive=true) const =0 |
Get a parameter defined as a double. More... | |
virtual std::vector< Kernel::V3D > | getPositionParameter (const std::string &pname, bool recursive=true) const =0 |
Get a parameter defined as a Kernel::V3D. More... | |
virtual std::vector< Kernel::Quat > | getRotationParameter (const std::string &pname, bool recursive=true) const =0 |
Get a parameter defined as a Kernel::Quaternion. More... | |
virtual std::vector< std::string > | getStringParameter (const std::string &pname, bool recursive=true) const =0 |
Get a parameter defined as a string. More... | |
virtual std::vector< int > | getIntParameter (const std::string &pname, bool recursive=true) const =0 |
Get a parameter defined as an integer. More... | |
virtual std::vector< bool > | getBoolParameter (const std::string &pname, bool recursive=true) const =0 |
Get a parameter defined as a boolean. More... | |
virtual std::string | getParameterAsString (const std::string &pname, bool recursive=true) const =0 |
get a string representation of a parameter More... | |
virtual bool | getParameterVisible (const std::string &pname, bool recursive=true) const =0 |
get visibility attribute of a parameter More... | |
virtual void | printSelf (std::ostream &) const =0 |
Prints a text representation of itself. More... | |
virtual bool | isParametrized () const =0 |
Returns true if the Component is parametrized (has a parameter map) More... | |
virtual size_t | registerContents (class ComponentVisitor &component) const =0 |
base class for Geometric IComponent
This is the base class for geometric components. Geometric IComponent can be placed in a hierarchical structure and are defined with respect to a parent IComponent. The IComponent position and orientation are relatives, i.e. defined with respect to the parent IComponent. The orientation is stored as a Kernel::Quaternion. Each IComponent has a defined bounding box which at the moment is cuboid.
Definition at line 51 of file IComponent.h.
|
virtualdefault |
Destructor.
|
pure virtual |
Return a clone to the current object.
Implemented in Mantid::Geometry::Instrument, Mantid::Geometry::CompAssembly, Mantid::Geometry::Component, Mantid::Geometry::Detector, Mantid::Geometry::DetectorGroup, Mantid::Geometry::GridDetector, Mantid::Geometry::ObjCompAssembly, Mantid::Geometry::ObjComponent, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, Mantid::Geometry::ICompAssembly, and Mantid::Geometry::IObjComponent.
Referenced by Mantid::Geometry::CompAssembly::addCopy(), and Mantid::Geometry::ObjCompAssembly::addCopy().
|
pure virtual |
Return an array of all ancestors, the nearest first.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Algorithms::DetectorDiagnostic::makeMap().
|
pure virtual |
Returns the bare pointer to the IComponent parent.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Detector::hasDetectorInfo(), Mantid::Geometry::Component::isParentNamed(), and Mantid::Geometry::Instrument::removeDetector().
|
pure virtual |
Returns const pointer to base component if this component is parametrized.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Algorithms::CopyInstrumentParameters::exec(), and Mantid::Geometry::Instrument::makeLegacyParameterMap().
|
pure virtual |
Get a parameter defined as a boolean.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Get the bounding box for this component and store it in the given argument.
Implemented in Mantid::Geometry::ObjComponent, Mantid::Geometry::Instrument, Mantid::Geometry::CompAssembly, Mantid::Geometry::GridDetector, Mantid::Geometry::GridDetector, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, Mantid::Geometry::StructuredDetector, Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::DataHandling::AvrgDetector::addDetInfo(), Mantid::API::WorkspaceNearestNeighbours::build(), and Mantid::Algorithms::SpatialGrouping::createBox().
|
pure virtual |
Returns the ComponentID - a unique identifier of the component.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::ParameterMap::add(), Mantid::Geometry::ParameterMap::clearParametersByName(), Mantid::Geometry::InstrumentVisitor::commonRegistration(), Mantid::Geometry::ParameterMap::contains(), Mantid::Geometry::ParameterMap::copyFromParameterMap(), Mantid::Algorithms::CreatePSDBleedMask::exec(), Mantid::Geometry::ParameterMap::forceUnsafeSetMasked(), Mantid::Geometry::ParameterMap::getByType(), Mantid::Geometry::ParameterMap::getCachedLocation(), Mantid::Geometry::ParameterMap::getCachedRotation(), Mantid::CurveFitting::Algorithms::ConvertToYSpace::getComponentParameter(), Mantid::Geometry::ParameterMap::getRecursive(), Mantid::Geometry::ParameterMap::names(), Mantid::API::ExperimentInfo::populateWithParameter(), Mantid::Geometry::ParameterMap::positionOf(), Mantid::API::ExperimentInfo::readParameterMap(), Mantid::Geometry::InstrumentVisitor::registerDetector(), Mantid::Geometry::ParameterMap::setCachedLocation(), Mantid::Geometry::ParameterMap::setCachedRotation(), Mantid::DataHandling::LoadDetectorInfo::updateParameterMap(), and Mantid::Geometry::Instrument::validateComponentProperties().
|
pure virtual |
Get the distance to another IComponent.
Implemented in Mantid::Geometry::Component, Mantid::Geometry::Detector, Mantid::Geometry::DetectorGroup, and Mantid::Geometry::IDetector.
Referenced by Mantid::Geometry::Detector::getDistance().
|
pure virtual |
Get the IComponent full path name.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Algorithms::CopyInstrumentParameters::exec(), Mantid::DataHandling::SaveParameterFile::exec(), and export_IComponent().
|
pure virtual |
Get a parameter defined as an integer.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Get the IComponent name.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::InstrumentVisitor::commonRegistration(), Mantid::Geometry::StructuredDetector::createDetectors(), export_IComponent(), Mantid::Geometry::GridDetector::getComponentByName(), Mantid::Geometry::StructuredDetector::getComponentByName(), Mantid::Algorithms::SofQCommon::getEFixed(), Mantid::Geometry::GridDetector::initialize(), Mantid::Geometry::Instrument::Instrument(), Mantid::Geometry::Component::isParentNamed(), Mantid::Geometry::Instrument::markAsSamplePos(), Mantid::Geometry::Instrument::markAsSource(), Mantid::Geometry::InstrumentVisitor::registerDetector(), Mantid::Geometry::CompAssembly::remove(), Mantid::Geometry::InstrumentDefinitionParser::setLogfile(), and Mantid::Algorithms::NormaliseByDetector::tryParseFunctionParameter().
|
pure virtual |
Get a parameter defined as a double.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::Algorithms::SofQCommon::getEFixed(), Mantid::Algorithms::ConvertSpectrumAxis::getEfixed(), Mantid::Algorithms::ConvertSpectrumAxis2::getEfixed(), and Mantid::Algorithms::He3TubeEfficiency::getParameter().
|
pure virtual |
get a string representation of a parameter
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Return the names of the parameters for this component.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
return the parameter names and the component they are from
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Implemented in Mantid::Geometry::DetectorGroup, and Mantid::Geometry::Component.
|
pure virtual |
get visibility attribute of a parameter
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Return a pointer to the current parent.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::ParameterMap::getRecursive(), and Mantid::Geometry::InstrumentDefinitionParser::getRelativeTranslation().
|
pure virtual |
Get the position of the IComponent. Tree structure is traverse through the.
Implemented in Mantid::Geometry::CompAssembly, Mantid::Geometry::Component, Mantid::Geometry::DetectorGroup, and Mantid::Geometry::ObjCompAssembly.
Referenced by Mantid::DataHandling::AvrgDetector::addDetInfo(), Mantid::Geometry::ParameterMap::addPositionCoordinate(), Mantid::Algorithms::AbsorptionCorrection::calculateDistances(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), Mantid::Algorithms::He3TubeEfficiency::calculateExponential(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Geometry::InstrumentVisitor::commonRegistration(), export_IComponent(), Mantid::Geometry::Component::getDistance(), Mantid::Geometry::Component::getPos(), Mantid::Geometry::InstrumentDefinitionParser::makeXYplaneFaceComponent(), and Mantid::Geometry::InstrumentVisitor::registerDetector().
|
pure virtual |
Get a parameter defined as a Kernel::V3D.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Get the position relative to the parent IComponent (absolute if no parent)
Implemented in Mantid::Geometry::Component, Mantid::Geometry::DetectorGroup, and Mantid::Geometry::GridDetectorPixel.
Referenced by Mantid::Geometry::ObjCompAssembly::createOutline(), Mantid::Geometry::GridDetectorPixel::getRelativePos(), and Mantid::Geometry::Instrument::makeLegacyParameterMap().
|
pure virtual |
Get the relative Orientation.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by export_IComponent(), and Mantid::Geometry::Instrument::makeLegacyParameterMap().
|
pure virtual |
Get the absolute orientation of the IComponent.
Implemented in Mantid::Geometry::CompAssembly, Mantid::Geometry::Component, Mantid::Geometry::DetectorGroup, and Mantid::Geometry::ObjCompAssembly.
Referenced by Mantid::Algorithms::He3TubeEfficiency::calculateExponential(), Mantid::Geometry::InstrumentVisitor::commonRegistration(), Mantid::Geometry::Component::getPos(), Mantid::Geometry::Component::getRotation(), Mantid::Geometry::InstrumentDefinitionParser::makeXYplaneFaceComponent(), Mantid::Geometry::InstrumentVisitor::registerDetector(), and Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
pure virtual |
Get a parameter defined as a Kernel::Quaternion.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
inlinevirtual |
Gets the scaling factor of the object for the Object Component.
Reimplemented in Mantid::Geometry::Component.
Definition at line 118 of file IComponent.h.
Referenced by Mantid::Geometry::InstrumentVisitor::commonRegistration(), Mantid::Geometry::Instrument::makeLegacyParameterMap(), and Mantid::Geometry::InstrumentVisitor::registerDetector().
|
pure virtual |
Get a parameter defined as a string.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Algorithms::populateTable().
|
pure virtual |
Returns a boolean indicating if the component has the named parameter.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Algorithms::AddPeak::exec().
|
pure virtual |
Returns true if the Component is parametrized (has a parameter map)
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Prints a text representation of itself.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::operator<<().
|
pure virtual |
Implemented in Mantid::Geometry::CompAssembly, Mantid::Geometry::Component, Mantid::Geometry::Detector, Mantid::Geometry::GridDetector, Mantid::Geometry::ObjComponent, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, Mantid::Geometry::DetectorGroup, and Mantid::Geometry::ObjCompAssembly.
|
pure virtual |
Rotate the IComponent. This is relative to parent.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::InstrumentDefinitionParser::makeXYplaneFaceComponent(), Mantid::Geometry::InstrumentDefinitionParser::setFacing(), and Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
pure virtual |
Rotate the IComponent by an angle in degrees with respect to an axis.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Set the IComponent name.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::CompAssembly::addCopy(), Mantid::Geometry::ObjCompAssembly::addCopy(), Mantid::Geometry::GridDetector::GridDetector(), Mantid::Geometry::RectangularDetector::RectangularDetector(), and Mantid::Geometry::StructuredDetector::StructuredDetector().
|
pure virtual |
Assign a parent IComponent. Previous parent link is lost.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::CompAssembly::add(), Mantid::Geometry::ObjCompAssembly::add(), Mantid::Geometry::CompAssembly::addCopy(), and Mantid::Geometry::ObjCompAssembly::addCopy().
|
pure virtual |
Set the position of the component The position is with respect to the parent component.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
pure virtual |
Set the IComponent position, x, y, z respective to parent (if present)
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by ComponentCreationHelper::createCylInstrumentWithVerticalOffsetsSpecified(), ComponentCreationHelper::createInstrumentWithPSDTubes(), Mantid::Algorithms::CreateSampleWorkspace::createTestInstrumentRectangular(), ComponentCreationHelper::createTestUnnamedRectangular2(), Mantid::DataHandling::LoadQKK::exec(), and Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
pure virtual |
Set the orientation Kernel::Quaternion relative to parent (if present)
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by ComponentCreationHelper::createTestUnnamedRectangular2().
|
pure virtual |
Copy the Rotation from another IComponent.
Translate the IComponent (vector form). This is relative to parent if
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
Referenced by Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
pure virtual |
Translate the IComponent (x,y,z form). This is relative to parent if.
Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.
|
inlinevirtual |
Returns a string representation of the IComponent type.
Reimplemented in Mantid::Geometry::ICompAssembly, Mantid::Geometry::Instrument, Mantid::Geometry::CompAssembly, Mantid::Geometry::Detector, Mantid::Geometry::GridDetector, Mantid::Geometry::GridDetectorPixel, Mantid::Geometry::ObjCompAssembly, Mantid::Geometry::ObjComponent, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, and Mantid::Geometry::IObjComponent.
Definition at line 54 of file IComponent.h.
Referenced by Mantid::DataHandling::SaveParameterFile::exec(), export_IComponent(), and Mantid::Geometry::Component::printSelf().