Mantid
|
Class for Assembly of geometric components. More...
#include <CompAssembly.h>
Public Member Functions | |
int | add (IComponent *) override |
Add a component to the assembly. More... | |
void | addChildren (IComponent *comp) |
Add a copy (clone) of a component. More... | |
int | addCopy (IComponent *) override |
AddCopy method. More... | |
int | addCopy (IComponent *, const std::string &) override |
Add a copy (clone) of a component and rename it. More... | |
IComponent * | clone () const override |
Make a clone of the present component. More... | |
CompAssembly () | |
Empty constructor. More... | |
CompAssembly (const CompAssembly &) | |
Copy constructor. More... | |
CompAssembly (const IComponent *base, const ParameterMap *map) | |
Constructor for parametrized version. More... | |
CompAssembly (const std::string &, IComponent *reference=nullptr) | |
Constructor with a name and parent reference. More... | |
void | getBoundingBox (BoundingBox &assemblyBox) const override |
Get the bounding box for this component and store it in the given argument. More... | |
std::shared_ptr< IComponent > | getChild (const int i) const override |
Get a pointer to the ith component within the assembly. Easier to use than. More... | |
void | getChildren (std::vector< IComponent_const_sptr > &outVector, bool recursive) const override |
Returns a vector of all children contained. More... | |
std::shared_ptr< const IComponent > | getComponentByName (const std::string &cname, int nlevels=0) const override |
Returns a pointer to the first component of assembly encountered with the given name. More... | |
Kernel::V3D | getPos () const override |
Gets the absolute position of the Parametrized CompAssembly This attempts to read the cached position value from the parameter map, and creates it if it is not available. More... | |
Kernel::Quat | getRotation () const override |
Gets the absolute position of the Parametrized CompAssembly This attempts to read the cached position value from the parameter map, and creates it if it is not available. More... | |
int | nelements () const override |
Return the number of elements in the assembly. More... | |
CompAssembly & | operator= (const CompAssembly &other) |
std::shared_ptr< IComponent > | operator[] (int i) const override |
Get a pointer to the ith component in the assembly. More... | |
void | printChildren (std::ostream &) const override |
Print information about all children. More... | |
void | printTree (std::ostream &) const override |
Print information about all the elements in the tree to a stream Loops through all components in the tree and call printSelf(os). More... | |
virtual size_t | registerContents (class ComponentVisitor &componentVisitor) const override |
int | remove (IComponent *) |
Remove a component from the assembly. More... | |
void | testIntersectionWithChildren (Track &testRay, std::deque< IComponent_const_sptr > &searchQueue) const override |
Test the intersection of the ray with the children of the component assembly, for InstrumentRayTracer More... | |
std::string | type () const override |
String description of the type of component. More... | |
~CompAssembly () override | |
Destructor. More... | |
Public Member Functions inherited from Mantid::Geometry::ICompAssembly | |
virtual int | add (IComponent *)=0 |
Add a component to the assembly. More... | |
virtual int | addCopy (IComponent *)=0 |
Add a copy (clone) of a component. More... | |
virtual int | addCopy (IComponent *, const std::string &)=0 |
Add a copy (clone) of a component and rename it. More... | |
IComponent * | clone () const override=0 |
Make a clone of the present component. More... | |
virtual std::shared_ptr< IComponent > | getChild (const int i) const =0 |
Get a pointer to the ith component within the assembly. More... | |
virtual void | getChildren (std::vector< IComponent_const_sptr > &outVector, bool recursive) const =0 |
Get all children. More... | |
virtual std::shared_ptr< const IComponent > | getComponentByName (const std::string &cname, int nlevels=0) const =0 |
Returns a pointer to the first component of assembly encountered with the given name. More... | |
ICompAssembly () | |
virtual int | nelements () const =0 |
Return the number of elements in the assembly. More... | |
virtual std::shared_ptr< IComponent > | operator[] (int i) const =0 |
Overloaded index operator. More... | |
virtual void | printChildren (std::ostream &) const =0 |
Print information about all children. More... | |
virtual void | printTree (std::ostream &) const =0 |
Print information about all the elements in the tree to a stream Loops through all components in the tree and call printSelf(os). More... | |
virtual void | testIntersectionWithChildren (Track &testRay, std::deque< IComponent_const_sptr > &searchQueue) const =0 |
Test the intersection of the ray with the children of the component assembly. More... | |
std::string | type () const override |
String description of the type of component. More... | |
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... | |
Public Member Functions inherited from Mantid::Geometry::Component | |
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 |
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... | |
bool | hasComponentInfo () const |
size_t | index () const |
Helper for legacy access mode. Returns the index of the component. More... | |
Protected Types | |
using | comp_it = std::vector< IComponent * >::iterator |
Iterator type. More... | |
using | const_comp_it = std::vector< IComponent * >::const_iterator |
Const iterator type. More... | |
Protected Attributes | |
BoundingBox * | m_cachedBoundingBox |
A cached bounding box. More... | |
std::vector< IComponent * > | m_children |
the group of child components More... | |
Protected Attributes inherited from Mantid::Geometry::Component | |
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... | |
Private Member Functions | |
CompAssembly & | operator= (const ICompAssembly &) |
Private copy assignment operator. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::Geometry::ICompAssembly | |
ICompAssembly (const ICompAssembly &)=default | |
Protected copy constructor. More... | |
Protected Member Functions inherited from Mantid::Geometry::Component | |
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... | |
Class for Assembly of geometric components.
CompAssembly allows Components to be positioned in a hierarchical structure in the form of a tree. CompAssembly inherits from component.
Definition at line 31 of file CompAssembly.h.
|
protected |
Iterator type.
Definition at line 33 of file CompAssembly.h.
|
protected |
Const iterator type.
Definition at line 34 of file CompAssembly.h.
Mantid::Geometry::CompAssembly::CompAssembly | ( | ) |
Empty constructor.
Definition at line 26 of file CompAssembly.cpp.
Referenced by clone(), Mantid::Geometry::StructuredDetector::createDetectors(), Mantid::Geometry::GridDetector::createLayer(), Mantid::Geometry::Instrument::getSample(), Mantid::Geometry::Instrument::getSource(), and Mantid::Geometry::GridDetector::initialize().
Mantid::Geometry::CompAssembly::CompAssembly | ( | const IComponent * | base, |
const ParameterMap * | map | ||
) |
Constructor for parametrized version.
Constructor for a parametrized CompAssembly.
base | the base (un-parametrized) IComponent |
map | pointer to the ParameterMap |
Definition at line 32 of file CompAssembly.cpp.
Mantid::Geometry::CompAssembly::CompAssembly | ( | const std::string & | n, |
IComponent * | reference = nullptr |
||
) |
Constructor with a name and parent reference.
Valued constructor.
n | :: name of the assembly |
reference | :: the parent Component If the reference is an object of class Component,normal parenting apply. If the reference object is an assembly itself, then in addition to parenting this is registered as a children of reference. |
Definition at line 44 of file CompAssembly.cpp.
References Mantid::Geometry::ICompAssembly::add().
Mantid::Geometry::CompAssembly::CompAssembly | ( | const CompAssembly & | assem | ) |
Copy constructor.
assem | :: assembly to copy |
Definition at line 57 of file CompAssembly.cpp.
|
override |
|
overridevirtual |
Add a component to the assembly.
Add method.
comp | :: component to add |
This becomes the new parent of comp.
Implements Mantid::Geometry::ICompAssembly.
Definition at line 98 of file CompAssembly.cpp.
References m_children, Mantid::Geometry::Component::m_map, and Mantid::Geometry::IComponent::setParent().
Referenced by Mantid::Geometry::Instrument::add(), ComponentCreationHelper::createCylInstrumentWithDetInGivenPositions(), ComponentCreationHelper::createCylInstrumentWithVerticalOffsetsSpecified(), Mantid::Geometry::StructuredDetector::createDetectors(), ComponentCreationHelper::createTestInstrumentCylindrical(), and ComponentCreationHelper::sansInstrument().
void Mantid::Geometry::CompAssembly::addChildren | ( | IComponent * | comp | ) |
Add a copy (clone) of a component.
|
overridevirtual |
AddCopy method.
comp | :: component to add |
Add a copy of a component in the assembly. Comp is cloned if valid, then added in the assembly This becomes the parent of the cloned component
Implements Mantid::Geometry::ICompAssembly.
Definition at line 117 of file CompAssembly.cpp.
References Mantid::Geometry::IComponent::clone(), m_children, Mantid::Geometry::Component::m_map, and Mantid::Geometry::IComponent::setParent().
|
overridevirtual |
Add a copy (clone) of a component and rename it.
AddCopy method.
comp | :: component to add |
n | :: name of the copied component. |
Add a copy of a component in the assembly. Comp is cloned if valid, then added in the assembly This becomes the parent of the cloned component
Implements Mantid::Geometry::ICompAssembly.
Definition at line 138 of file CompAssembly.cpp.
References Mantid::Geometry::IComponent::clone(), m_children, Mantid::Geometry::Component::m_map, n, Mantid::Geometry::IComponent::setName(), and Mantid::Geometry::IComponent::setParent().
|
overridevirtual |
Make a clone of the present component.
Clone method Make a copy of the component assembly.
Implements Mantid::Geometry::ICompAssembly.
Reimplemented in Mantid::Geometry::GridDetector, Mantid::Geometry::RectangularDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 90 of file CompAssembly.cpp.
References CompAssembly().
|
overridevirtual |
Get the bounding box for this component and store it in the given argument.
Get the bounding box for this assembly.
It is simply the sum of the bounding boxes of its children
assemblyBox | :: [Out] The resulting bounding box is stored here. |
Implements Mantid::Geometry::IComponent.
Reimplemented in Mantid::Geometry::GridDetector, Mantid::Geometry::GridDetector, Mantid::Geometry::RectangularDetector, Mantid::Geometry::StructuredDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 352 of file CompAssembly.cpp.
References Mantid::Geometry::ComponentInfo::boundingBox(), Mantid::Geometry::ParameterMap::componentInfo(), Mantid::Geometry::BoundingBox::grow(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Component::index(), m_cachedBoundingBox, m_children, Mantid::Geometry::Component::m_map, nelements(), and operator[]().
|
overridevirtual |
Get a pointer to the ith component within the assembly. Easier to use than.
Get a pointer to the ith component in the assembly.
Note standard C/C++ array notation used, that is, i most be an integer i = 0,1,..., N-1, where N is the number of component in the assembly. Easier to use than the [] operator when you have a pointer
i | :: The index of the component you want |
std::runtime_error | if i is not in range |
Implements Mantid::Geometry::ICompAssembly.
Reimplemented in Mantid::Geometry::Instrument.
Definition at line 197 of file CompAssembly.cpp.
References Mantid::Geometry::ParComponentFactory::create(), Mantid::Geometry::Component::m_base, m_children, and Mantid::Geometry::Component::m_map.
Referenced by Mantid::Geometry::StructuredDetector::getAtXY(), Mantid::Geometry::GridDetector::getAtXYZ(), getChildren(), operator[](), and testIntersectionWithChildren().
|
overridevirtual |
Returns a vector of all children contained.
Return a vector of all contained children components.
outVector | :: vector of IComponent sptr. |
recursive | :: if a child is a CompAssembly, returns its children recursively |
Implements Mantid::Geometry::ICompAssembly.
Definition at line 229 of file CompAssembly.cpp.
References getChild(), and nelements().
Referenced by Mantid::Geometry::Instrument::Instrument().
|
overridevirtual |
Returns a pointer to the first component of assembly encountered with the given name.
Find a component by name.
cname | :: The name of the component. If there are multiple matches, the first one found is returned. If the name contains '/', it will search for the component whose name occurs before the '/' then within that component's assembly, search the component whose name occurs after the '/' and so on with any subsequent '/'. For example to find 'tube020' in 'panel07', one could use the cname 'panel07/tube020', given that tube020 is unique within panel07. |
nlevels | :: Optional argument to limit number of levels searched. If cname has a '/', then nlevels will apply to each step delimited by the '/'s, rather than the whole search. In particular, nlevels=1, would force cname to be a full path name. |
Implements Mantid::Geometry::ICompAssembly.
Reimplemented in Mantid::Geometry::GridDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 262 of file CompAssembly.cpp.
References getComponentByName(), and Mantid::Geometry::Component::getName().
Referenced by Mantid::Crystal::CalibrationHelpers::adjustBankPositionsAndSizes(), getComponentByName(), Mantid::Geometry::GridDetector::getComponentByName(), Mantid::Geometry::StructuredDetector::getComponentByName(), Mantid::Geometry::Instrument::getDetectorsInBank(), Mantid::API::ExperimentInfo::readParameterMap(), and Mantid::Crystal::SCDCalibratePanels::saveXmlFile().
|
overridevirtual |
Gets the absolute position of the Parametrized CompAssembly This attempts to read the cached position value from the parameter map, and creates it if it is not available.
Implements Mantid::Geometry::IComponent.
Definition at line 452 of file CompAssembly.cpp.
References Mantid::Geometry::ParameterMap::getCachedLocation(), Mantid::Geometry::Component::getPos(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Component::m_base, Mantid::Geometry::Component::m_map, and Mantid::Geometry::ParameterMap::setCachedLocation().
Referenced by Mantid::Geometry::Instrument::getBeamDirection(), and Mantid::Geometry::InstrumentDefinitionParser::setLocation().
|
overridevirtual |
Gets the absolute position of the Parametrized CompAssembly This attempts to read the cached position value from the parameter map, and creates it if it is not available.
Implements Mantid::Geometry::IComponent.
Definition at line 470 of file CompAssembly.cpp.
References Mantid::Geometry::ParameterMap::getCachedRotation(), Mantid::Geometry::Component::getRotation(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Component::m_base, Mantid::Geometry::Component::m_map, and Mantid::Geometry::ParameterMap::setCachedRotation().
|
overridevirtual |
Return the number of elements in the assembly.
Return the number of components in the assembly.
Implements Mantid::Geometry::ICompAssembly.
Definition at line 176 of file CompAssembly.cpp.
References Mantid::Geometry::Component::m_base, m_children, and Mantid::Geometry::Component::m_map.
Referenced by Mantid::Geometry::Instrument::addInstrumentChildrenToQueue(), Mantid::Geometry::Instrument::appendPlottable(), Mantid::Geometry::Instrument::getBoundingBox(), getBoundingBox(), getChildren(), Mantid::Geometry::Instrument::isEmptyInstrument(), Mantid::Geometry::operator<<(), printChildren(), printTree(), and testIntersectionWithChildren().
CompAssembly & Mantid::Geometry::CompAssembly::operator= | ( | const CompAssembly & | other | ) |
Definition at line 59 of file CompAssembly.cpp.
References m_cachedBoundingBox, and m_children.
|
private |
Private copy assignment operator.
|
overridevirtual |
Get a pointer to the ith component in the assembly.
Overloaded index access operator.
i | :: Element i within the component assembly |
std:runtime_error | if i is out of range |
Implements Mantid::Geometry::ICompAssembly.
Definition at line 220 of file CompAssembly.cpp.
References getChild().
Referenced by getBoundingBox().
|
overridevirtual |
Print information about all children.
Print information about elements in the assembly to a stream.
os | :: output stream |
Loops through all components in the assembly and call printSelf(os).
Implements Mantid::Geometry::ICompAssembly.
Definition at line 419 of file CompAssembly.cpp.
References nelements().
Referenced by Mantid::Geometry::operator<<().
|
overridevirtual |
Print information about all the elements in the tree to a stream Loops through all components in the tree and call printSelf(os).
os | :: output stream |
Implements Mantid::Geometry::ICompAssembly.
Definition at line 433 of file CompAssembly.cpp.
References Mantid::Geometry::Component::getName(), nelements(), and printTree().
Referenced by printTree().
|
overridevirtual |
Reimplemented from Mantid::Geometry::Component.
Reimplemented in Mantid::Geometry::GridDetector, Mantid::Geometry::RectangularDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 483 of file CompAssembly.cpp.
References Mantid::Geometry::ComponentVisitor::registerComponentAssembly().
int Mantid::Geometry::CompAssembly::remove | ( | IComponent * | comp | ) |
Remove a component from the assembly.
Removes a component from the assembly.
The component will be deleted.
comp | The component to be removed |
std::runtime_error | if the component is not a child of this assembly |
Definition at line 156 of file CompAssembly.cpp.
References Mantid::Geometry::IComponent::getName(), m_children, and Mantid::Geometry::Component::m_map.
Referenced by Mantid::Geometry::Instrument::removeDetector().
|
overridevirtual |
Test the intersection of the ray with the children of the component assembly, for InstrumentRayTracer
Test the intersection of the ray with the children of the component assembly, for InstrumentRayTracer.
testRay | :: Track under test. The results are stored here. |
searchQueue | :: If a child is a sub-assembly then it is appended for later searching |
Implements Mantid::Geometry::ICompAssembly.
Reimplemented in Mantid::Geometry::GridDetector, and Mantid::Geometry::RectangularDetector.
Definition at line 397 of file CompAssembly.cpp.
References getChild(), and nelements().
|
inlineoverridevirtual |
String description of the type of component.
Reimplemented from Mantid::Geometry::ICompAssembly.
Reimplemented in Mantid::Geometry::GridDetector, Mantid::Geometry::RectangularDetector, and Mantid::Geometry::StructuredDetector.
Definition at line 38 of file CompAssembly.h.
|
mutableprotected |
A cached bounding box.
Definition at line 101 of file CompAssembly.h.
Referenced by Mantid::Geometry::Instrument::getBoundingBox(), getBoundingBox(), Mantid::Geometry::StructuredDetector::getBoundingBox(), operator=(), and ~CompAssembly().
|
protected |
the group of child components
Definition at line 98 of file CompAssembly.h.
Referenced by add(), addCopy(), Mantid::Geometry::Instrument::getBoundingBox(), getBoundingBox(), getChild(), nelements(), operator=(), and remove().