Mantid
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Mantid::Geometry::IComponent Class Referenceabstract

base class for Geometric IComponent More...

#include <IComponent.h>

Inheritance diagram for Mantid::Geometry::IComponent:
Mantid::Geometry::Component Mantid::Geometry::ICompAssembly Mantid::Geometry::IObjComponent Mantid::Geometry::CompAssembly Mantid::Geometry::ObjComponent Mantid::Geometry::CompAssembly Mantid::Geometry::ObjCompAssembly Mantid::Geometry::GridDetector Mantid::Geometry::IDetector Mantid::Geometry::ObjComponent Mantid::Geometry::StructuredDetector

Public Member Functions

virtual IComponentclone () 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 IComponentgetBareParent () 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 IComponentgetParent () 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, ComponentIDgetParameterNamesByComponent () 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::V3DgetPositionParameter (const std::string &pname, bool recursive=true) const =0
 Get a parameter defined as a Kernel::V3D. More...
 
virtual std::vector< Kernel::QuatgetRotationParameter (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
 

Detailed Description

base class for Geometric IComponent

Version
A
Author
Laurent C Chapon, ISIS RAL
Date
01/11/2007

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.

Constructor & Destructor Documentation

◆ ~IComponent()

virtual Mantid::Geometry::IComponent::~IComponent ( )
virtualdefault

Destructor.

Member Function Documentation

◆ clone()

virtual IComponent * Mantid::Geometry::IComponent::clone ( ) const
pure virtual

◆ getAncestors()

virtual std::vector< std::shared_ptr< const IComponent > > Mantid::Geometry::IComponent::getAncestors ( ) const
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().

◆ getBareParent()

virtual const IComponent * Mantid::Geometry::IComponent::getBareParent ( ) const
pure virtual

◆ getBaseComponent()

virtual IComponent const * Mantid::Geometry::IComponent::getBaseComponent ( ) const
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().

◆ getBoolParameter()

virtual std::vector< bool > Mantid::Geometry::IComponent::getBoolParameter ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

Get a parameter defined as a boolean.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getBoundingBox()

virtual void Mantid::Geometry::IComponent::getBoundingBox ( BoundingBox boundingBox) const
pure virtual

◆ getComponentID()

virtual ComponentID Mantid::Geometry::IComponent::getComponentID ( ) const
pure virtual

◆ getDistance()

virtual double Mantid::Geometry::IComponent::getDistance ( const IComponent ) const
pure virtual

◆ getFullName()

virtual std::string Mantid::Geometry::IComponent::getFullName ( ) const
pure virtual

◆ getIntParameter()

virtual std::vector< int > Mantid::Geometry::IComponent::getIntParameter ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

Get a parameter defined as an integer.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getName()

virtual std::string Mantid::Geometry::IComponent::getName ( ) const
pure virtual

◆ getNumberParameter()

virtual std::vector< double > Mantid::Geometry::IComponent::getNumberParameter ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

◆ getParameterAsString()

virtual std::string Mantid::Geometry::IComponent::getParameterAsString ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

get a string representation of a parameter

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getParameterNames()

virtual std::set< std::string > Mantid::Geometry::IComponent::getParameterNames ( bool  recursive = true) const
pure virtual

Return the names of the parameters for this component.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getParameterNamesByComponent()

virtual std::map< std::string, ComponentID > Mantid::Geometry::IComponent::getParameterNamesByComponent ( ) const
pure virtual

return the parameter names and the component they are from

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getParameterType()

virtual std::string Mantid::Geometry::IComponent::getParameterType ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

◆ getParameterVisible()

virtual bool Mantid::Geometry::IComponent::getParameterVisible ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

get visibility attribute of a parameter

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getParent()

virtual std::shared_ptr< const IComponent > Mantid::Geometry::IComponent::getParent ( ) const
pure virtual

◆ getPos()

virtual Kernel::V3D Mantid::Geometry::IComponent::getPos ( ) const
pure virtual

◆ getPositionParameter()

virtual std::vector< Kernel::V3D > Mantid::Geometry::IComponent::getPositionParameter ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

Get a parameter defined as a Kernel::V3D.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getRelativePos()

virtual Kernel::V3D Mantid::Geometry::IComponent::getRelativePos ( ) const
pure virtual

◆ getRelativeRot()

virtual Kernel::Quat Mantid::Geometry::IComponent::getRelativeRot ( ) const
pure virtual

◆ getRotation()

virtual Kernel::Quat Mantid::Geometry::IComponent::getRotation ( ) const
pure virtual

◆ getRotationParameter()

virtual std::vector< Kernel::Quat > Mantid::Geometry::IComponent::getRotationParameter ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

Get a parameter defined as a Kernel::Quaternion.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ getScaleFactor()

virtual Kernel::V3D Mantid::Geometry::IComponent::getScaleFactor ( ) const
inlinevirtual

Gets the scaling factor of the object for the Object Component.

Returns
a vector with 1 in all 3 directions.

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().

◆ getStringParameter()

virtual std::vector< std::string > Mantid::Geometry::IComponent::getStringParameter ( const std::string &  pname,
bool  recursive = true 
) const
pure virtual

Get a parameter defined as a string.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

Referenced by Mantid::Algorithms::populateTable().

◆ hasParameter()

virtual bool Mantid::Geometry::IComponent::hasParameter ( const std::string &  name,
bool  recursive = true 
) const
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().

◆ isParametrized()

virtual bool Mantid::Geometry::IComponent::isParametrized ( ) const
pure virtual

Returns true if the Component is parametrized (has a parameter map)

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ printSelf()

virtual void Mantid::Geometry::IComponent::printSelf ( std::ostream &  ) const
pure virtual

Prints a text representation of itself.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

Referenced by Mantid::Geometry::operator<<().

◆ registerContents()

virtual size_t Mantid::Geometry::IComponent::registerContents ( class ComponentVisitor component) const
pure virtual

◆ rotate() [1/2]

virtual void Mantid::Geometry::IComponent::rotate ( const Kernel::Quat )
pure virtual

◆ rotate() [2/2]

virtual void Mantid::Geometry::IComponent::rotate ( double  ,
const Kernel::V3D  
)
pure virtual

Rotate the IComponent by an angle in degrees with respect to an axis.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ setName()

virtual void Mantid::Geometry::IComponent::setName ( const std::string &  )
pure virtual

◆ setParent()

virtual void Mantid::Geometry::IComponent::setParent ( IComponent )
pure virtual

◆ setPos() [1/2]

virtual void Mantid::Geometry::IComponent::setPos ( const Kernel::V3D )
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.

◆ setPos() [2/2]

virtual void Mantid::Geometry::IComponent::setPos ( double  ,
double  ,
double   
)
pure virtual

◆ setRot()

virtual void Mantid::Geometry::IComponent::setRot ( const Kernel::Quat )
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().

◆ translate() [1/2]

virtual void Mantid::Geometry::IComponent::translate ( const Kernel::V3D )
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().

◆ translate() [2/2]

virtual void Mantid::Geometry::IComponent::translate ( double  ,
double  ,
double   
)
pure virtual

Translate the IComponent (x,y,z form). This is relative to parent if.

Implemented in Mantid::Geometry::Component, and Mantid::Geometry::DetectorGroup.

◆ type()

virtual std::string Mantid::Geometry::IComponent::type ( ) const
inlinevirtual

The documentation for this class was generated from the following file: