9#include "MantidGeometry/DllConfig.h"
54 virtual std::string
type()
const {
return "LogicalComponent"; }
68 virtual std::shared_ptr<const IComponent>
getParent()
const = 0;
72 virtual std::vector<std::shared_ptr<const IComponent>>
getAncestors()
const = 0;
74 virtual void setName(
const std::string &) = 0;
81 virtual void setPos(
double,
double,
double) = 0;
127 virtual bool hasParameter(
const std::string &name,
bool recursive =
true)
const = 0;
129 virtual std::string
getParameterType(
const std::string &pname,
bool recursive =
true)
const = 0;
134 virtual std::vector<double>
getNumberParameter(
const std::string &pname,
bool recursive =
true)
const = 0;
136 virtual std::vector<Kernel::V3D>
getPositionParameter(
const std::string &pname,
bool recursive =
true)
const = 0;
138 virtual std::vector<Kernel::Quat>
getRotationParameter(
const std::string &pname,
bool recursive =
true)
const = 0;
140 virtual std::vector<std::string>
getStringParameter(
const std::string &pname,
bool recursive =
true)
const = 0;
142 virtual std::vector<int>
getIntParameter(
const std::string &pname,
bool recursive =
true)
const = 0;
144 virtual std::vector<bool>
getBoolParameter(
const std::string &pname,
bool recursive =
true)
const = 0;
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
ComponentVisitor : Visitor for IComponents.
base class for Geometric IComponent
virtual std::vector< Kernel::Quat > getRotationParameter(const std::string &pname, bool recursive=true) const =0
Get a parameter defined as a Kernel::Quaternion.
virtual size_t registerContents(class ComponentVisitor &component) const =0
virtual std::vector< Kernel::V3D > getPositionParameter(const std::string &pname, bool recursive=true) const =0
Get a parameter defined as a Kernel::V3D.
virtual bool hasParameter(const std::string &name, bool recursive=true) const =0
Returns a boolean indicating if the component has the named parameter.
virtual Kernel::V3D getPos() const =0
Get the position of the IComponent. Tree structure is traverse through the.
virtual IComponent const * getBaseComponent() const =0
Returns const pointer to base component if this component is parametrized.
virtual std::string type() const
Returns a string representation of the IComponent type.
virtual void getBoundingBox(BoundingBox &boundingBox) const =0
Get the bounding box for this component and store it in the given argument.
virtual std::vector< bool > getBoolParameter(const std::string &pname, bool recursive=true) const =0
Get a parameter defined as a boolean.
virtual void setPos(double, double, double)=0
Set the IComponent position, x, y, z respective to parent (if present)
virtual void translate(double, double, double)=0
Translate the IComponent (x,y,z form). This is relative to parent if.
virtual void rotate(double, const Kernel::V3D &)=0
Rotate the IComponent by an angle in degrees with respect to an axis.
virtual std::shared_ptr< const IComponent > getParent() const =0
Return a pointer to the current parent.
virtual void printSelf(std::ostream &) const =0
Prints a text representation of itself.
virtual Kernel::Quat getRotation() const =0
Get the absolute orientation of the IComponent.
virtual double getDistance(const IComponent &) const =0
Get the distance to another IComponent.
virtual std::vector< std::string > getStringParameter(const std::string &pname, bool recursive=true) const =0
Get a parameter defined as a string.
virtual ~IComponent()=default
Destructor.
virtual std::vector< double > getNumberParameter(const std::string &pname, bool recursive=true) const =0
Get a parameter defined as a double.
virtual IComponent * clone() const =0
Return a clone to the current object.
virtual void setPos(const Kernel::V3D &)=0
Set the position of the component The position is with respect to the parent component.
virtual bool getParameterVisible(const std::string &pname, bool recursive=true) const =0
get visibility attribute of a parameter
virtual bool isParametrized() const =0
Returns true if the Component is parametrized (has a parameter map)
virtual std::map< std::string, ComponentID > getParameterNamesByComponent() const =0
return the parameter names and the component they are from
virtual std::string getParameterType(const std::string &pname, bool recursive=true) const =0
virtual std::vector< int > getIntParameter(const std::string &pname, bool recursive=true) const =0
Get a parameter defined as an integer.
virtual Kernel::V3D getScaleFactor() const
Gets the scaling factor of the object for the Object Component.
virtual ComponentID getComponentID() const =0
Returns the ComponentID - a unique identifier of the component.
virtual std::string getParameterAsString(const std::string &pname, bool recursive=true) const =0
get a string representation of a parameter
virtual std::set< std::string > getParameterNames(bool recursive=true) const =0
Return the names of the parameters for this component.
virtual void translate(const Kernel::V3D &)=0
Copy the Rotation from another IComponent.
virtual void setParent(IComponent *)=0
Assign a parent IComponent. Previous parent link is lost.
virtual void rotate(const Kernel::Quat &)=0
Rotate the IComponent. This is relative to parent.
virtual Kernel::Quat getRelativeRot() const =0
Get the relative Orientation.
virtual std::vector< std::shared_ptr< const IComponent > > getAncestors() const =0
Return an array of all ancestors, the nearest first.
virtual void setRot(const Kernel::Quat &)=0
Set the orientation Kernel::Quaternion relative to parent (if present)
virtual Kernel::V3D getRelativePos() const =0
Get the position relative to the parent IComponent (absolute if no parent)
virtual void setName(const std::string &)=0
Set the IComponent name.
virtual std::string getFullName() const =0
Get the IComponent full path name.
virtual const IComponent * getBareParent() const =0
Returns the bare pointer to the IComponent parent.
virtual std::string getName() const =0
Get the IComponent name.
An object for constructing a shared_ptr that won't ever delete its pointee.
void operator()(const void *)
Does nothing.
void operator()(void *)
Does nothing.
std::shared_ptr< const IComponent > IComponent_const_sptr
Typdef of a shared pointer to a const IComponent.
std::shared_ptr< IComponent > IComponent_sptr
Typedef of a shared pointer to a IComponent.
Helper class which provides the Collimation Length for SANS instruments.