|
Mantid
|
Component is a wrapper for a Component which can modify some of its parameters, e.g. More...
#include <Geometry/Component.h>
Public Member Functions | |
| IComponent * | clone () const override |
| Clone method Make a copy of the Component. More... | |
| Component () | |
| Create Empty Component at Origin, with no orientation and null parent. More... | |
| Component (const IComponent *base, const ParameterMap *map) | |
| Constructor for parametrized component. More... | |
| Component (std::string name, const Kernel::V3D &position, const Kernel::Quat &rotation, IComponent *parent=nullptr) | |
| Create a named component with positioning vector, orientation and parent. More... | |
| Component (std::string name, const Kernel::V3D &position, IComponent *parent=nullptr) | |
| Create a named component with positioning vector, and parent component. More... | |
| Component (std::string name, IComponent *parent=nullptr) | |
| Create a named component with a parent component (optional) More... | |
| std::vector< std::shared_ptr< const IComponent > > | getAncestors () const override |
| Return an array of all ancestors. More... | |
| IComponent const * | getBaseComponent () const override |
| Returns const pointer to base component if this component is parametrized. More... | |
| void | getBoundingBox (BoundingBox &boundingBox) const override |
| Get the bounding box for this component and store it in the given argument. More... | |
| ComponentID | getComponentID () const override |
| Returns the ComponentID - a unique identifier of the component. More... | |
| double | getDistance (const IComponent &) const override |
| Get the distance to another IComponent. More... | |
| std::string | getFullName () const override |
| Get the full pathname. More... | |
| std::string | getName () const override |
| Get the IComponent name. More... | |
| std::shared_ptr< const IComponent > | getParent () const override |
| Return a pointer to the current parent. as shared pointer. More... | |
| Kernel::V3D | getPos () const override |
| Get the position of the IComponent. Tree structure is traverse through the. More... | |
| Kernel::V3D | getRelativePos () const override |
| Get the position relative to the parent IComponent (absolute if no parent) More... | |
| Kernel::Quat | getRelativeRot () const override |
| Get the relative Orientation. More... | |
| Kernel::Quat | getRotation () const override |
| Get the absolute orientation of the IComponent. More... | |
| bool | isParentNamed (const std::string &expectedName, int maxDepth=-1) const |
| Return true if one of the parents of this component is named something. More... | |
| void | rotate (const Kernel::Quat &) override |
| Rotate the IComponent. This is relative to parent. More... | |
| void | rotate (double, const Kernel::V3D &) override |
| Rotate the IComponent by an angle in degrees with respect to an axis. More... | |
| void | setName (const std::string &) override |
| Set the IComponent name. More... | |
| void | setParent (IComponent *) override |
| Assign a parent IComponent. Previous parent link is lost. More... | |
| void | setPos (const Kernel::V3D &) override |
| Set the position of the Component The position is with respect to the parent Component. More... | |
| void | setPos (double, double, double) override |
| Set the IComponent position, x, y, z respective to parent (if present) More... | |
| void | setRot (const Kernel::Quat &) override |
| Set the orientation Kernel::Quaternion relative to parent (if present) More... | |
| void | translate (const Kernel::V3D &) override |
| Translate the IComponent (vector form). This is relative to parent if. More... | |
| void | translate (double, double, double) override |
| Translate the IComponent (x,y,z form). This is relative to parent if. More... | |
| virtual std::string | typeName () const |
Public Member Functions inherited from Mantid::Geometry::IComponent | |
| 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 | |
| const IComponent * | m_parent |
| Parent component in the tree. More... | |
| const Component * | m_base |
| The base component - this is the unmodified component (without the parameters). More... | |
| const ParameterMap * | m_map |
| A pointer to const ParameterMap containing the parameters. More... | |
| std::string | m_name |
| Name of the component. More... | |
| Kernel::V3D | m_pos |
| Position w. More... | |
| Kernel::Quat | m_rot |
| Orientation. More... | |
| template<typename T > | |
| class | ComponentPool |
| std::set< std::string > | getParameterNames (bool recursive=true) const override |
| Return the parameter names. More... | |
| std::map< std::string, ComponentID > | getParameterNamesByComponent () const override |
| return the parameter names and the component they are from More... | |
| bool | hasParameter (const std::string &name, bool recursive=true) const override |
| Returns a boolean indicating if the component has the named parameter. More... | |
| std::vector< double > | getNumberParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a double. More... | |
| std::vector< int > | getIntParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as an int. More... | |
| std::string | getParameterType (const std::string &pname, bool recursive=true) const override |
| Get a parameter's type – this is HACK until Python can export property regardless of the property type. More... | |
| std::string | getDescription () const |
| Get this component parameter's description – no recursive search within children. More... | |
| std::string | getParamDescription (const std::string &pname, bool recursive=true) const |
| Get description of a parameter attached to this component More... | |
| std::string | getParamShortDescription (const std::string &pname, bool recursive=true) const |
| Get a component's parameter short description. More... | |
| std::string | getShortDescription () const |
| Get a components's short description. More... | |
| void | setDescription (const std::string &descr) |
| Set components description. More... | |
| std::vector< bool > | getBoolParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a bool. More... | |
| std::vector< Kernel::V3D > | getPositionParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a Kernel::V3D. More... | |
| std::vector< Kernel::Quat > | getRotationParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a Kernel::Quaternion. More... | |
| std::vector< std::string > | getStringParameter (const std::string &pname, bool recursive=true) const override |
| Get a parameter defined as a string. More... | |
| std::string | getParameterAsString (const std::string &pname, bool recursive=true) const override |
| get a string representation of a parameter More... | |
| bool | getParameterVisible (const std::string &p_name, bool recursive) const override |
| Get a visibility attribute of a parameter from the parameter map. More... | |
| void | printSelf (std::ostream &) const override |
| Prints a text representation of itself. More... | |
| const IComponent * | base () const |
| Returns the address of the base component. More... | |
| Kernel::V3D | getScaleFactor () const override |
| Returns the ScaleFactor. More... | |
| const IComponent * | getBareParent () const override |
| Returns the bare pointer to the IComponent parent. More... | |
| virtual void | readXMLAttributes (const Poco::XML::Attributes &attr) |
| Reads the XML attributes from Poco XML parser. More... | |
| virtual void | writeXML (Poco::XML::XMLWriter &writer) const |
| virtual void | appendXML (std::ostream &xmlStream) const |
| Append to an open XML string. More... | |
| bool | isParametrized () const override |
| Return true if the Component is, in fact, parametrized (that is - it has a valid parameter map) More... | |
| virtual size_t | registerContents (class ComponentVisitor &componentVisitor) const override |
| bool | hasComponentInfo () const |
| size_t | index () const |
| Helper for legacy access mode. Returns the index of the component. More... | |
| template<class TYPE > | |
| std::vector< TYPE > | getParameter (const std::string &p_name, bool recursive) const |
| Get a parameter from the parameter map. More... | |
| void | swap (const Component *base, const ParameterMap *pmap) |
| Swap the current references to the un-parameterized component and parameter map for new ones. More... | |
Component is a wrapper for a Component which can modify some of its parameters, e.g.
position, orientation. Implements IComponent.
Definition at line 41 of file Component.h.
| Mantid::Geometry::Component::Component | ( | const IComponent * | base, |
| const ParameterMap * | map | ||
| ) |
Constructor for parametrized component.
Constructor for a parametrized Component.
| base | :: a Component that is the base (un-parametrized) component |
| map | :: a ParameterMap to parameterize the component |
Definition at line 31 of file Component.cpp.
References m_base.
| Mantid::Geometry::Component::Component | ( | ) |
Create Empty Component at Origin, with no orientation and null parent.
Empty constructor Create a component with null parent.
Definition at line 42 of file Component.cpp.
Referenced by clone().
|
explicit |
Create a named component with a parent component (optional)
Constructor by value.
Definition at line 48 of file Component.cpp.
| Mantid::Geometry::Component::Component | ( | std::string | name, |
| const Kernel::V3D & | position, | ||
| IComponent * | parent = nullptr |
||
| ) |
Create a named component with positioning vector, and parent component.
Constructor by value.
| name | :: Component name |
| position | :: position absolute or relative if the parent is defined |
| parent | :: parent Component |
Definition at line 57 of file Component.cpp.
| Mantid::Geometry::Component::Component | ( | std::string | name, |
| const Kernel::V3D & | position, | ||
| const Kernel::Quat & | rotation, | ||
| IComponent * | parent = nullptr |
||
| ) |
Create a named component with positioning vector, orientation and parent.
Constructor.
| name | :: Component name |
| position | :: position (relative to parent, if present) |
| rotation | :: orientation quaternion (relative to parent, if present) |
| parent | :: parent Component (optional) |
Definition at line 66 of file Component.cpp.
|
virtual |
Append to an open XML string.
| xmlStream | :: string to append to. |
Definition at line 553 of file Component.cpp.
References m_pos, m_rot, and Mantid::Kernel::V3D::write().
|
inline |
Returns the address of the base component.
Definition at line 280 of file Component.h.
Referenced by Mantid::Geometry::Instrument::getComponentByID(), Mantid::Geometry::ObjComponent::shape(), and swap().
|
overridevirtual |
Clone method Make a copy of the Component.
if pmap not present throw
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::Detector, Mantid::Geometry::GridDetector, Mantid::Geometry::ObjCompAssembly, Mantid::Geometry::ObjComponent, Mantid::Geometry::RectangularDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 79 of file Component.cpp.
References Component().
|
overridevirtual |
Return an array of all ancestors.
Returns an array of all ancestors of this component, starting with the direct parent and moving up.
Implements Mantid::Geometry::IComponent.
Definition at line 147 of file Component.cpp.
References getParent().
Referenced by getFullName().
|
inlineoverridevirtual |
Returns the bare pointer to the IComponent parent.
Implements Mantid::Geometry::IComponent.
Definition at line 286 of file Component.h.
|
overridevirtual |
Returns const pointer to base component if this component is parametrized.
Implements Mantid::Geometry::IComponent.
Definition at line 96 of file Component.cpp.
|
inlineoverridevirtual |
Get a parameter defined as a bool.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 205 of file Component.h.
Referenced by export_Component().
|
overridevirtual |
Get the bounding box for this component and store it in the given argument.
Get the bounding box for this component.
It is no shape so gives an empty box.
| boundingBox | :: [Out] The resulting bounding box is stored here. |
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::ObjComponent, Mantid::Geometry::GridDetector, Mantid::Geometry::GridDetector, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 428 of file Component.cpp.
|
overridevirtual |
Returns the ComponentID - a unique identifier of the component.
Get the component's ID (pointer address)
Implements Mantid::Geometry::IComponent.
Definition at line 89 of file Component.cpp.
Referenced by getParameterNamesByComponent(), and index().
| std::string Mantid::Geometry::Component::getDescription | ( | ) | const |
Get this component parameter's description – no recursive search within children.
Get this parameter's description – no recursive search within children.
Definition at line 601 of file Component.cpp.
References getName(), and getParamDescription().
Referenced by export_Component().
|
overridevirtual |
Get the distance to another IComponent.
Gets the distance between two Components.
| comp | :: The Component to measure against |
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::Detector.
Definition at line 421 of file Component.cpp.
References Mantid::Kernel::V3D::distance(), Mantid::Geometry::IComponent::getPos(), and getPos().
|
overridevirtual |
Get the full pathname.
Get the full path name of the Component.
Implements Mantid::Geometry::IComponent.
Definition at line 183 of file Component.cpp.
References getAncestors(), and getName().
|
inlineoverridevirtual |
Get a parameter defined as an int.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 160 of file Component.h.
Referenced by export_Component().
|
overridevirtual |
Get the IComponent name.
Get the name of the Component.
Implements Mantid::Geometry::IComponent.
Definition at line 173 of file Component.cpp.
References getName(), m_base, m_map, and m_name.
Referenced by Mantid::Geometry::Instrument::getAllComponentsWithName(), Mantid::Geometry::CompAssembly::getComponentByName(), getDescription(), getFullName(), Mantid::Geometry::Instrument::getInstrumentParameters(), getName(), getShortDescription(), printSelf(), Mantid::Geometry::CompAssembly::printTree(), Mantid::Geometry::Instrument::saveNexus(), Mantid::Crystal::SCDCalibratePanels::saveXmlFile(), and setDescription().
|
inlineoverridevirtual |
Get a parameter defined as a double.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 149 of file Component.h.
Referenced by export_Component().
| std::string Mantid::Geometry::Component::getParamDescription | ( | const std::string & | pname, |
| bool | recursive = true |
||
| ) | const |
Get description of a parameter attached to this component
Get a parameter's description.
Only parameterized component can have description
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Definition at line 585 of file Component.cpp.
References Mantid::Geometry::ParameterMap::get(), Mantid::Geometry::ParameterMap::getRecursive(), and m_map.
Referenced by export_Component(), and getDescription().
|
inlineprotected |
Get a parameter from the parameter map.
| p_name | :: The name of the parameter |
| recursive | :: If true then the lookup will walk up the tree if this component does not have parameter |
Definition at line 324 of file Component.h.
References Mantid::Geometry::ParameterMap::get(), and Mantid::Geometry::ParameterMap::getRecursive().
|
inlineoverridevirtual |
get a string representation of a parameter
Implements Mantid::Geometry::IComponent.
Definition at line 243 of file Component.h.
|
overridevirtual |
Return the parameter names.
Get the names of the parameters for this component.
| recursive | :: If true, the parameters for all of the parent components are also included |
Implements Mantid::Geometry::IComponent.
Definition at line 436 of file Component.cpp.
References getParent(), m_map, and Mantid::Geometry::ParameterMap::names().
Referenced by export_Component().
|
overridevirtual |
return the parameter names and the component they are from
Get the names of the parameters for this component and it's parents.
Implements Mantid::Geometry::IComponent.
Definition at line 459 of file Component.cpp.
References getComponentID(), getParent(), m_map, and Mantid::Geometry::ParameterMap::names().
|
inlineoverridevirtual |
Get a parameter's type – this is HACK until Python can export property regardless of the property type.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 173 of file Component.h.
Referenced by export_Component().
|
inlineoverridevirtual |
Get a visibility attribute of a parameter from the parameter map.
| p_name | :: The name of the parameter |
| recursive | :: If true then the lookup will walk up the tree if this component does not have parameter |
Implements Mantid::Geometry::IComponent.
Definition at line 258 of file Component.h.
| std::string Mantid::Geometry::Component::getParamShortDescription | ( | const std::string & | pname, |
| bool | recursive = true |
||
| ) | const |
Get a component's parameter short description.
Get a parameter's short description Only parameterized component can have description.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Definition at line 616 of file Component.cpp.
References Mantid::Geometry::ParameterMap::get(), Mantid::Geometry::ParameterMap::getRecursive(), and m_map.
Referenced by export_Component(), and getShortDescription().
|
overridevirtual |
Return a pointer to the current parent. as shared pointer.
Get a pointer to the parent.
Implements Mantid::Geometry::IComponent.
Definition at line 113 of file Component.cpp.
References Mantid::Geometry::ParComponentFactory::create(), getParent(), m_base, m_map, and m_parent.
Referenced by getAncestors(), getParameterNames(), getParameterNamesByComponent(), getParent(), getPos(), getRotation(), hasParameter(), and printSelf().
|
overridevirtual |
Get the position of the IComponent. Tree structure is traverse through the.
Return the absolute position of the Component.
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::ObjCompAssembly.
Definition at line 325 of file Component.cpp.
References Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::ParameterMap::getCachedLocation(), Mantid::Geometry::ParameterMap::getCachedRotation(), getParent(), Mantid::Geometry::IComponent::getPos(), getRelativePos(), Mantid::Geometry::IComponent::getRotation(), Mantid::Kernel::Quat::getRotation(), hasComponentInfo(), index(), m_base, m_map, m_parent, m_pos, Mantid::Geometry::ComponentInfo::position(), and Mantid::Kernel::Quat::rotate().
Referenced by Mantid::Geometry::ObjComponent::factorOutComponentPosition(), Mantid::Geometry::InstrumentDefinitionParser::getAbsolutPositionInCompCoorSys(), Mantid::Geometry::ObjComponent::getBoundingBox(), getDistance(), Mantid::Geometry::Detector::getPhi(), Mantid::Geometry::ObjComponent::getPointInObject(), Mantid::Geometry::CompAssembly::getPos(), Mantid::Geometry::ObjCompAssembly::getPos(), Mantid::Geometry::Detector::getSignedTwoTheta(), Mantid::Geometry::Detector::getTopology(), Mantid::Geometry::Detector::getTwoTheta(), Mantid::Geometry::ObjComponent::interceptSurface(), Mantid::Geometry::ObjComponent::isOnSide(), Mantid::Geometry::ObjComponent::isValid(), Mantid::Geometry::InstrumentDefinitionParser::makeXYplaneFaceComponent(), and printSelf().
|
inlineoverridevirtual |
Get a parameter defined as a Kernel::V3D.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 216 of file Component.h.
Referenced by export_Component().
|
overridevirtual |
Get the position relative to the parent IComponent (absolute if no parent)
Return the relative position to the parent Component.
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::GridDetectorPixel.
Definition at line 308 of file Component.cpp.
References Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::ParameterMap::contains(), Mantid::Geometry::ParameterMap::get(), hasComponentInfo(), index(), m_base, m_map, m_pos, and Mantid::Geometry::ComponentInfo::relativePosition().
Referenced by export_Component(), and getPos().
|
overridevirtual |
Get the relative Orientation.
Return the relative rotation of the Compoonent to the parent.
Implements Mantid::Geometry::IComponent.
Definition at line 371 of file Component.cpp.
References Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::ParameterMap::contains(), Mantid::Geometry::ParameterMap::get(), hasComponentInfo(), index(), m_base, m_map, m_rot, and Mantid::Geometry::ComponentInfo::relativeRotation().
Referenced by getRotation(), and printSelf().
|
overridevirtual |
Get the absolute orientation of the IComponent.
Return the absolute rotation of the Component.
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::ObjCompAssembly.
Definition at line 387 of file Component.cpp.
References Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::ParameterMap::getCachedRotation(), getParent(), getRelativeRot(), Mantid::Geometry::IComponent::getRotation(), Mantid::Kernel::Quat::getRotation(), hasComponentInfo(), index(), m_base, m_map, m_parent, m_rot, and Mantid::Geometry::ComponentInfo::rotation().
Referenced by export_Component(), Mantid::Geometry::ObjComponent::getBoundingBox(), Mantid::Geometry::ObjComponent::getPointInObject(), Mantid::Geometry::CompAssembly::getRotation(), Mantid::Geometry::ObjCompAssembly::getRotation(), Mantid::Geometry::ObjComponent::interceptSurface(), and Mantid::Geometry::ObjComponent::takeOutRotation().
|
inlineoverridevirtual |
Get a parameter defined as a Kernel::Quaternion.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 227 of file Component.h.
Referenced by export_Component().
|
overridevirtual |
Returns the ScaleFactor.
Get ScaleFactor of detector.
Looks at the "sca" parameter in the parameter map.
Reimplemented from Mantid::Geometry::IComponent.
Definition at line 282 of file Component.cpp.
References Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::ParameterMap::get(), hasComponentInfo(), index(), m_base, m_map, Mantid::Geometry::ParameterMap::scale(), and Mantid::Geometry::ComponentInfo::scaleFactor().
Referenced by Mantid::Geometry::ObjComponent::getBoundingBox(), Mantid::Geometry::ObjComponent::getDepth(), Mantid::Geometry::ObjComponent::getHeight(), Mantid::Geometry::ObjComponent::getPointInObject(), Mantid::Geometry::ObjComponent::getWidth(), Mantid::Geometry::ObjComponent::interceptSurface(), Mantid::Geometry::ObjComponent::isOnSide(), Mantid::Geometry::ObjComponent::isValid(), and Mantid::Geometry::ObjComponent::solidAngle().
| std::string Mantid::Geometry::Component::getShortDescription | ( | ) | const |
Get a components's short description.
Get a parameter's tooltip (short description) – no recursive search within children.
Definition at line 634 of file Component.cpp.
References getName(), and getParamShortDescription().
Referenced by export_Component().
|
inlineoverridevirtual |
Get a parameter defined as a string.
| pname | :: The name of the parameter |
| recursive | :: If true the search will walk up through the parent components |
Implements Mantid::Geometry::IComponent.
Definition at line 238 of file Component.h.
Referenced by Mantid::Algorithms::DirectILLTubeBackground::components(), and export_Component().
| bool Mantid::Geometry::Component::hasComponentInfo | ( | ) | const |
Definition at line 299 of file Component.cpp.
References Mantid::Geometry::IComponent::getBareParent(), Mantid::Geometry::ParameterMap::hasComponentInfo(), m_base, and m_map.
Referenced by Mantid::Geometry::ObjComponent::getBoundingBox(), Mantid::Geometry::CompAssembly::getBoundingBox(), Mantid::Geometry::GridDetector::getBoundingBox(), Mantid::Geometry::StructuredDetector::getBoundingBox(), Mantid::Geometry::CompAssembly::getPos(), getPos(), Mantid::Geometry::ObjCompAssembly::getPos(), getRelativePos(), getRelativeRot(), Mantid::Geometry::CompAssembly::getRotation(), getRotation(), Mantid::Geometry::ObjCompAssembly::getRotation(), getScaleFactor(), Mantid::Geometry::Instrument::makeLegacyParameterMap(), and Mantid::Geometry::ObjComponent::solidAngle().
|
overridevirtual |
Returns a boolean indicating if the component has the named parameter.
| name | :: The name of the parameter |
| recursive | :: If true the parent components will also be searched (Default: true) |
Implements Mantid::Geometry::IComponent.
Definition at line 486 of file Component.cpp.
References Mantid::Geometry::ParameterMap::contains(), getParent(), and m_map.
Referenced by Mantid::Algorithms::DirectILLTubeBackground::components(), and export_Component().
| size_t Mantid::Geometry::Component::index | ( | ) | const |
Helper for legacy access mode. Returns the index of the component.
Definition at line 297 of file Component.cpp.
References Mantid::Geometry::ParameterMap::componentIndex(), getComponentID(), and m_map.
Referenced by Mantid::Geometry::ObjComponent::getBoundingBox(), Mantid::Geometry::Instrument::getBoundingBox(), Mantid::Geometry::CompAssembly::getBoundingBox(), Mantid::Geometry::GridDetector::getBoundingBox(), Mantid::Geometry::StructuredDetector::getBoundingBox(), getPos(), getRelativePos(), getRelativeRot(), getRotation(), getScaleFactor(), Mantid::Geometry::Instrument::isMonitorViaIndex(), and Mantid::Geometry::ObjComponent::solidAngle().
|
overridevirtual |
Return true if the Component is, in fact, parametrized (that is - it has a valid parameter map)
Implements Mantid::Geometry::IComponent.
Definition at line 73 of file Component.cpp.
References m_map.
Referenced by Mantid::Geometry::Instrument::parseTreeAndCacheBeamline(), Mantid::Geometry::Instrument::saveNexus(), and Mantid::Geometry::ParameterMap::setInstrument().
| bool Mantid::Geometry::Component::isParentNamed | ( | const std::string & | expectedName, |
| int | maxDepth = -1 |
||
| ) | const |
Return true if one of the parents of this component is named something.
| expectedName | :: case-sensitive name to look for. |
| maxDepth | :: levels of recursion to look into, -1 for no limit (default) |
Definition at line 129 of file Component.cpp.
References Mantid::Geometry::IComponent::getBareParent(), Mantid::Geometry::IComponent::getName(), and m_parent.
|
overridevirtual |
Prints a text representation of itself.
| os | :: The output stream to write to |
Implements Mantid::Geometry::IComponent.
Definition at line 509 of file Component.cpp.
References getName(), getParent(), getPos(), getRelativeRot(), and Mantid::Geometry::IComponent::type().
Referenced by Mantid::Geometry::operator<<().
|
virtual |
Reads the XML attributes from Poco XML parser.
| attr | :: XML attributes |
Definition at line 535 of file Component.cpp.
References UNUSED_ARG.
Referenced by Mantid::Geometry::ComponentParser::startElement().
|
overridevirtual |
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::CompAssembly, Mantid::Geometry::Detector, Mantid::Geometry::GridDetector, Mantid::Geometry::ObjComponent, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, and Mantid::Geometry::ObjCompAssembly.
Definition at line 658 of file Component.cpp.
References Mantid::Geometry::ComponentVisitor::registerGenericComponent().
|
overridevirtual |
Rotate the IComponent. This is relative to parent.
Rotate the Component relative to the parent Component.
| r | :: translation vector |
Implements Mantid::Geometry::IComponent.
Definition at line 260 of file Component.cpp.
|
overridevirtual |
Rotate the IComponent by an angle in degrees with respect to an axis.
Rotate the Component by an angle in degrees with respect to an axis.
| angle | :: the number of degrees to rotate |
| axis | :: The Vector to rotate around |
Implements Mantid::Geometry::IComponent.
Definition at line 271 of file Component.cpp.
| void Mantid::Geometry::Component::setDescription | ( | const std::string & | descr | ) |
Set components description.
Works for parameterized components only
Works for parameterized components only
| descr | :: String which describes the component. |
Definition at line 641 of file Component.cpp.
References getName(), Mantid::Geometry::ParameterMap::getRecursive(), and m_map.
Referenced by export_Component().
|
overridevirtual |
Set the IComponent name.
Set the name of the Component (currently does nothing)
| s | :: name string |
Implements Mantid::Geometry::IComponent.
Definition at line 162 of file Component.cpp.
|
overridevirtual |
Assign a parent IComponent. Previous parent link is lost.
Set the parent.
Previous parenting is lost.
| comp | :: the parent Component |
Implements Mantid::Geometry::IComponent.
Definition at line 107 of file Component.cpp.
References m_parent.
Referenced by Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
overridevirtual |
Set the position of the Component The position is with respect to the parent Component.
| v | :: vector position |
Implements Mantid::Geometry::IComponent.
Definition at line 215 of file Component.cpp.
|
overridevirtual |
Set the IComponent position, x, y, z respective to parent (if present)
Set the position of the Component The position is with respect to the parent Component.
| x | :: x position |
| y | :: y position |
| z | :: z position |
Implements Mantid::Geometry::IComponent.
Definition at line 204 of file Component.cpp.
References m_map, m_pos, Mantid::Geometry::x, Mantid::Geometry::y, and Mantid::Geometry::z.
Referenced by InstrumentCreationHelper::addDetector(), InstrumentCreationHelper::addFullInstrumentToWorkspace(), ComponentCreationHelper::addSourceToInstrument(), ComponentCreationHelper::createCylInstrumentWithDetInGivenPositions(), ComponentCreationHelper::createCylInstrumentWithVerticalOffsetsSpecified(), ComponentCreationHelper::createEmptyInstrument(), Mantid::DataHandling::LoadGSS::createInstrumentGeometry(), ComponentCreationHelper::createInstrumentWithPSDTubes(), ComponentCreationHelper::createInstrumentWithSourceRotation(), Mantid::Geometry::ComponentHelper::createMinimalInstrument(), ComponentCreationHelper::createMinimalInstrument(), ComponentCreationHelper::createSimpleInstrumentWithRotation(), ComponentCreationHelper::createTestAssemblyOfFourCylinders(), ComponentCreationHelper::createTestInstrumentCylindrical(), Mantid::Algorithms::CreateSampleWorkspace::createTestInstrumentRectangular(), Mantid::Geometry::ComponentHelper::createVirtualInstrument(), Mantid::Geometry::ComponentParser::endElement(), Mantid::Algorithms::EditInstrumentGeometry::exec(), Mantid::Crystal::LoadHKL::exec(), Mantid::DataHandling::LoadInstrumentFromNexus::exec(), Mantid::DataHandling::LoadInstrumentFromRaw::exec(), Mantid::DataHandling::LoadNXSPE::exec(), Mantid::DataHandling::LoadQKK::exec(), Mantid::Geometry::InstrumentDefinitionParser::getAbsolutPositionInCompCoorSys(), ComponentCreationHelper::makeBank(), WorkspaceCreationHelper::maskSpectra(), ComponentCreationHelper::sansInstrument(), and Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
overridevirtual |
Set the orientation Kernel::Quaternion relative to parent (if present)
Set the orientation of the Component The position is with respect to the parent Component.
| q | :: rotation quaternion |
Implements Mantid::Geometry::IComponent.
Definition at line 226 of file Component.cpp.
Referenced by ComponentCreationHelper::createInstrumentWithSourceRotation(), ComponentCreationHelper::createSimpleInstrumentWithRotation(), Mantid::Geometry::ComponentParser::endElement(), and Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
protected |
Swap the current references to the un-parameterized component and parameter map for new ones.
| base | A pointer to the new un-parameterized component |
| pmap | A pointer to the new parameter map |
Definition at line 570 of file Component.cpp.
|
overridevirtual |
Translate the IComponent (vector form). This is relative to parent if.
Translate the Component relative to the parent Component.
| v | :: translation vector |
Implements Mantid::Geometry::IComponent.
Definition at line 250 of file Component.cpp.
|
overridevirtual |
Translate the IComponent (x,y,z form). This is relative to parent if.
Translate the Component relative to the parent Component.
| x | :: translation on the x-axis |
| y | :: translation on the y-axis |
| z | :: translation on the z-axis |
Implements Mantid::Geometry::IComponent.
Definition at line 238 of file Component.cpp.
References m_map, m_pos, Mantid::Geometry::x, Mantid::Geometry::y, and Mantid::Geometry::z.
|
inlinevirtual |
Definition at line 44 of file Component.h.
|
virtual |
Definition at line 543 of file Component.cpp.
References m_pos, and Mantid::Kernel::V3D::toString().
|
friend |
Definition at line 347 of file Component.h.
|
protected |
The base component - this is the unmodified component (without the parameters).
Stored as a pointer to Component so that it's properties can be accessed without casting each time
Definition at line 305 of file Component.h.
Referenced by Component(), getBaseComponent(), Mantid::Geometry::CompAssembly::getChild(), getComponentID(), Mantid::Geometry::Detector::getID(), getName(), getParent(), Mantid::Geometry::CompAssembly::getPos(), getPos(), Mantid::Geometry::ObjCompAssembly::getPos(), getRelativePos(), getRelativeRot(), Mantid::Geometry::CompAssembly::getRotation(), getRotation(), Mantid::Geometry::ObjCompAssembly::getRotation(), Mantid::Geometry::Instrument::getSample(), getScaleFactor(), Mantid::Geometry::Instrument::getSource(), hasComponentInfo(), Mantid::Geometry::Detector::hasDetectorInfo(), Mantid::Geometry::CompAssembly::nelements(), Mantid::Geometry::ObjCompAssembly::nelements(), Mantid::Geometry::ObjCompAssembly::operator[](), Mantid::Geometry::ObjComponent::shape(), and swap().
|
protected |
A pointer to const ParameterMap containing the parameters.
Definition at line 307 of file Component.h.
Referenced by Mantid::Geometry::CompAssembly::add(), Mantid::Geometry::ObjCompAssembly::add(), Mantid::Geometry::CompAssembly::addCopy(), Mantid::Geometry::ObjCompAssembly::addCopy(), Mantid::Geometry::Instrument::baseInstrument(), Mantid::Geometry::Instrument::detectorIndex(), Mantid::Geometry::StructuredDetector::getB(), getBaseComponent(), Mantid::Geometry::ObjComponent::getBoundingBox(), Mantid::Geometry::Instrument::getBoundingBox(), Mantid::Geometry::CompAssembly::getBoundingBox(), Mantid::Geometry::GridDetector::getBoundingBox(), Mantid::Geometry::StructuredDetector::getBoundingBox(), Mantid::Geometry::CompAssembly::getChild(), Mantid::Geometry::Instrument::getComponentByID(), getComponentID(), Mantid::Geometry::Instrument::getDetector(), Mantid::Geometry::StructuredDetector::getDetectorIDAtXY(), Mantid::Geometry::GridDetector::getDetectorIDAtXYZ(), Mantid::Geometry::Instrument::getDetectorIDs(), Mantid::Geometry::Instrument::getDetectors(), Mantid::Geometry::Instrument::getFilename(), Mantid::Geometry::StructuredDetector::getG(), Mantid::Geometry::Detector::getID(), Mantid::Geometry::Instrument::getMinMaxDetectorIDs(), Mantid::Geometry::Instrument::getMonitors(), getName(), Mantid::Geometry::Instrument::getNumberDetectors(), getParamDescription(), Mantid::Geometry::Instrument::getParameterMap(), getParameterNames(), getParameterNamesByComponent(), getParamShortDescription(), getParent(), Mantid::Geometry::Instrument::getPhysicalInstrument(), Mantid::Geometry::Instrument::getPlottable(), Mantid::Geometry::CompAssembly::getPos(), getPos(), Mantid::Geometry::ObjCompAssembly::getPos(), Mantid::Geometry::StructuredDetector::getR(), Mantid::Geometry::Instrument::getReferenceFrame(), getRelativePos(), Mantid::Geometry::GridDetectorPixel::getRelativePos(), Mantid::Geometry::GridDetector::getRelativePosAtXYZ(), getRelativeRot(), Mantid::Geometry::CompAssembly::getRotation(), getRotation(), Mantid::Geometry::ObjCompAssembly::getRotation(), Mantid::Geometry::Instrument::getSample(), getScaleFactor(), Mantid::Geometry::Instrument::getSource(), Mantid::Geometry::Instrument::getXmlText(), Mantid::Geometry::StructuredDetector::getXValues(), Mantid::Geometry::StructuredDetector::getXYForDetectorID(), Mantid::Geometry::GridDetector::getXYZForDetectorID(), Mantid::Geometry::StructuredDetector::getYValues(), hasComponentInfo(), Mantid::Geometry::Detector::hasDetectorInfo(), hasParameter(), Mantid::Geometry::GridDetector::idfillbyfirst_y(), Mantid::Geometry::StructuredDetector::idFillByFirstY(), Mantid::Geometry::GridDetector::idFillOrder(), Mantid::Geometry::GridDetector::idstart(), Mantid::Geometry::StructuredDetector::idStart(), Mantid::Geometry::GridDetector::idstep(), Mantid::Geometry::StructuredDetector::idStep(), Mantid::Geometry::GridDetector::idstepbyrow(), Mantid::Geometry::StructuredDetector::idStepByRow(), index(), Mantid::Geometry::Detector::index(), Mantid::Geometry::StructuredDetector::initialize(), Mantid::Geometry::GridDetector::initialize(), Mantid::Geometry::Instrument::isMonitor(), Mantid::Geometry::Instrument::isMonitorViaIndex(), isParametrized(), Mantid::Geometry::Instrument::makeLegacyParameterMap(), Mantid::Geometry::Instrument::markAsDetector(), Mantid::Geometry::Instrument::markAsDetectorIncomplete(), Mantid::Geometry::Instrument::markAsMonitor(), Mantid::Geometry::Instrument::markAsSamplePos(), Mantid::Geometry::Instrument::markAsSource(), Mantid::Geometry::GridDetector::maxDetectorID(), Mantid::Geometry::StructuredDetector::maxDetectorID(), Mantid::Geometry::GridDetector::minDetectorID(), Mantid::Geometry::StructuredDetector::minDetectorID(), Mantid::Geometry::CompAssembly::nelements(), Mantid::Geometry::ObjCompAssembly::nelements(), Mantid::Geometry::ObjCompAssembly::operator[](), Mantid::Geometry::Detector::parameterMap(), Mantid::Geometry::CompAssembly::remove(), Mantid::Geometry::Instrument::removeDetector(), rotate(), Mantid::Geometry::StructuredDetector::setColors(), setDescription(), Mantid::Geometry::Instrument::setFilename(), setName(), Mantid::Geometry::Instrument::setPhysicalInstrument(), setPos(), setRot(), Mantid::Geometry::ObjComponent::setShape(), Mantid::Geometry::Instrument::setXmlText(), Mantid::Geometry::ObjComponent::shape(), Mantid::Geometry::ObjComponent::solidAngle(), swap(), translate(), Mantid::Geometry::GridDetector::xpixels(), Mantid::Geometry::StructuredDetector::xPixels(), Mantid::Geometry::GridDetector::xsize(), Mantid::Geometry::GridDetector::xstart(), Mantid::Geometry::GridDetector::xstep(), Mantid::Geometry::GridDetector::ypixels(), Mantid::Geometry::StructuredDetector::yPixels(), Mantid::Geometry::GridDetector::ysize(), Mantid::Geometry::GridDetector::ystart(), Mantid::Geometry::GridDetector::ystep(), Mantid::Geometry::GridDetector::zpixels(), Mantid::Geometry::GridDetector::zsize(), Mantid::Geometry::GridDetector::zstart(), and Mantid::Geometry::GridDetector::zstep().
|
protected |
Name of the component.
Definition at line 310 of file Component.h.
|
protected |
Parent component in the tree.
Definition at line 300 of file Component.h.
Referenced by getParent(), getPos(), getRotation(), isParentNamed(), and setParent().
|
protected |
Position w.
Definition at line 312 of file Component.h.
Referenced by appendXML(), getPos(), getRelativePos(), setPos(), translate(), and writeXML().
|
protected |
Orientation.
Definition at line 314 of file Component.h.
Referenced by appendXML(), getRelativeRot(), getRotation(), rotate(), and setRot().