Mantid
|
StructuredDetector is a type of CompAssembly, an assembly of components. More...
#include <StructuredDetector.h>
Public Member Functions | |
IComponent * | clone () const override |
Make a clone of the present component. More... | |
void | draw () const override |
Draws the objcomponent. More... | |
void | drawObject () const override |
Draws the Object. More... | |
std::shared_ptr< Detector > | getAtXY (const size_t x, const size_t y) const |
Return a pointer to the component in the assembly at the (X,Y) pixel position. More... | |
std::vector< int > const & | getB () const |
Returns the blue color channel for detector colors. More... | |
void | getBoundingBox (BoundingBox &assemblyBox) const override |
Get the bounding box for this component and store it in the given argument. More... | |
void | getBoundingBox (BoundingBox &assemblyBox) const override |
Retrieve the cached bounding box. 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... | |
detid_t | getDetectorIDAtXY (const size_t X, const size_t Y) const |
Return the detector ID corresponding to the component in the assembly at the (X,Y) pixel position. More... | |
std::vector< int > const & | getG () const |
Returns the green color channel for detector colors. More... | |
int | getPointInObject (Kernel::V3D &point) const override |
Try to find a point that lies within (or on) the object. More... | |
std::vector< int > const & | getR () const |
Returns the red color channel for detector colors. More... | |
std::vector< double > const & | getXValues () const |
std::pair< size_t, size_t > | getXYForDetectorID (const detid_t detectorID) const |
Given a detector ID, return the X,Y coords into the structured detector. More... | |
std::vector< double > const & | getYValues () const |
bool | idFillByFirstY () const |
Returns the idFillByFirstY. More... | |
detid_t | idStart () const |
Returns the idStart. More... | |
int | idStep () const |
Returns the idStep. More... | |
int | idStepByRow () const |
Returns the idStepByRow. More... | |
void | initDraw () const override |
Initializes the ObjComponent for rendering, this function should be called before rendering. More... | |
void | initialize (size_t xPixels, size_t yPixels, std::vector< double > &&x, std::vector< double > &&y, bool isZBeam, detid_t idStart, bool idFillByFirstY, int idStepByRow, int idStep=1) |
Create all the detector pixels of this rectangular detector. More... | |
int | interceptSurface (Track &track) const override |
Checks whether the track given will pass through this Component. More... | |
bool | isOnSide (const Kernel::V3D &point) const override |
Does the point given lie on the surface of this object component? More... | |
bool | isValid (const Kernel::V3D &point) const override |
Does the point given lie within this object component? More... | |
const Kernel::Material | material () const override |
Returns the material of the detector. More... | |
detid_t | maxDetectorID () |
maximum detector id More... | |
detid_t | minDetectorID () |
minimum detector id More... | |
virtual size_t | registerContents (class ComponentVisitor &componentVisitor) const override |
Register the structured detector for Instrument 2.0 usage. More... | |
void | setColors (const std::vector< int > &r, const std::vector< int > &g, const std::vector< int > &b) const |
Sets the colours for detector IDs based on color maps created by instrument actor. More... | |
const std::shared_ptr< const IObject > | shape () const override |
Returns the shape of the Object. More... | |
double | solidAngle (const Kernel::V3D &observer) const override |
Finds the approximate solid angle covered by the component when viewed from the point given. More... | |
StructuredDetector () | |
Empty constructor. More... | |
StructuredDetector (const std::string &name, IComponent *reference=nullptr) | |
Constructor with a name and parent reference. More... | |
StructuredDetector (const StructuredDetector *base, const ParameterMap *map) | |
Parametrized constructor. More... | |
std::string | type () const override |
String description of the type of component. More... | |
size_t | xPixels () const |
Returns the number of pixels in the X direction. More... | |
size_t | yPixels () const |
Returns the number of pixels in the Y direction. More... | |
Public Member Functions inherited from Mantid::Geometry::CompAssembly | |
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... | |
Public Member Functions inherited from Mantid::Geometry::IObjComponent | |
IComponent * | clone () const override=0 |
Virtual Copy Constructor. More... | |
virtual void | draw () const =0 |
Draws the objcomponent. More... | |
virtual void | drawObject () const =0 |
Draws the Object. More... | |
virtual int | getPointInObject (Kernel::V3D &point) const =0 |
Try to find a point that lies within (or on) the object. More... | |
GeometryHandler * | Handle () const |
Gets the GeometryHandler. More... | |
virtual void | initDraw () const =0 |
Initializes the ObjComponent for rendering, this function should be called before rendering. More... | |
virtual int | interceptSurface (Track &track) const =0 |
Checks whether the track given will pass through this Component. More... | |
IObjComponent () | |
IObjComponent (const IObjComponent &) | |
Copy constructor. More... | |
IObjComponent (GeometryHandler *the_handler) | |
Constructor, specifying the GeometryHandler (renderer engine) for this IObjComponent. More... | |
virtual bool | isOnSide (const Kernel::V3D &point) const =0 |
Does the point given lie on the surface of this object component? More... | |
virtual bool | isValid (const Kernel::V3D &point) const =0 |
Does the point given lie within this object component? More... | |
virtual const Kernel::Material | material () const =0 |
Returns the material of the Object. More... | |
IObjComponent & | operator= (const IObjComponent &rhs) |
Assignment operator. More... | |
virtual const std::shared_ptr< const IObject > | shape () const =0 |
Returns the shape of the Object. More... | |
virtual double | solidAngle (const Kernel::V3D &observer) const =0 |
Finds the approximate solid angle covered by the component when viewed from the point given. More... | |
std::string | type () const override |
type string More... | |
~IObjComponent () override | |
Static Public Member Functions | |
static bool | compareName (const std::string &proposedMatch) |
Matches name to Structured Detector. More... | |
Private Member Functions | |
Detector * | addDetector (CompAssembly *parent, const std::string &name, size_t x, size_t y, detid_t id) |
Creates new hexahedral detector pixel at row x column y using the detector vertex values. More... | |
void | createDetectors () |
Creates all detector pixels within the StructuredDetector. More... | |
void | init () |
initialize members to bare defaults More... | |
StructuredDetector & | operator= (const ICompAssembly &) |
Private copy assignment operator. More... | |
Private Attributes | |
std::vector< int > | b |
std::vector< int > | g |
const StructuredDetector * | m_base |
Pointer to the base RectangularDetector, for parametrized instruments. More... | |
bool | m_idFillByFirstY |
IDs are filled in Y fastest. More... | |
detid_t | m_idStart |
IDs start here. More... | |
int | m_idStep |
Step size in ID in each col. More... | |
int | m_idStepByRow |
Step size in ID in each row. More... | |
detid_t | m_maxDetId |
maximum detector id More... | |
detid_t | m_minDetId |
minimum detector id More... | |
size_t | m_xPixels |
The number of pixels in the X (horizontal) direction;. More... | |
std::vector< double > | m_xvalues |
size_t | m_yPixels |
The number of pixels in the Y (vertical) direction;. More... | |
std::vector< double > | m_yvalues |
std::vector< int > | r |
Additional Inherited Members | |
Protected Types inherited from Mantid::Geometry::CompAssembly | |
using | comp_it = std::vector< IComponent * >::iterator |
Iterator type. More... | |
using | const_comp_it = std::vector< IComponent * >::const_iterator |
Const iterator type. More... | |
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... | |
Protected Member Functions inherited from Mantid::Geometry::IObjComponent | |
void | setGeometryHandler (GeometryHandler *h) |
Reset the current geometry handler. More... | |
Protected Attributes inherited from Mantid::Geometry::CompAssembly | |
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... | |
StructuredDetector is a type of CompAssembly, an assembly of components.
It is designed to be a more efficient way of defining instruments which are topologically regular but geometrically irregular.
Assembly of Detector objects with topological regularity and geometrical irregularity
Definition at line 32 of file StructuredDetector.h.
Mantid::Geometry::StructuredDetector::StructuredDetector | ( | ) |
Empty constructor.
Definition at line 30 of file StructuredDetector.cpp.
References init().
Referenced by clone().
Mantid::Geometry::StructuredDetector::StructuredDetector | ( | const std::string & | name, |
IComponent * | reference = nullptr |
||
) |
Constructor with a name and parent reference.
Valued constructor.
name | :: 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 41 of file StructuredDetector.cpp.
References init(), and Mantid::Geometry::IComponent::setName().
Mantid::Geometry::StructuredDetector::StructuredDetector | ( | const StructuredDetector * | base, |
const ParameterMap * | map | ||
) |
Parametrized constructor.
Constructor for a parametrized StructuredrDetector.
base | the base (un-parametrized) StructuredDetector |
map | pointer to the ParameterMap |
Definition at line 51 of file StructuredDetector.cpp.
References init().
|
private |
Creates new hexahedral detector pixel at row x column y using the detector vertex values.
parent | :: The parent component assembly |
name | :: The pixel name identifier |
x | :: The pixel row |
y | :: The pixel column |
id | :: The pixel ID |
Definition at line 366 of file StructuredDetector.cpp.
References Mantid::Geometry::ShapeFactory::createHexahedralShape(), m_xPixels, m_xvalues, m_yvalues, shape(), Mantid::Geometry::x, and Mantid::Geometry::y.
Referenced by createDetectors().
|
overridevirtual |
Make a clone of the present component.
Clone method Make a copy of the component assembly.
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 80 of file StructuredDetector.cpp.
References StructuredDetector().
|
static |
Matches name to Structured Detector.
Definition at line 56 of file StructuredDetector.cpp.
Referenced by Mantid::Geometry::InstrumentDefinitionParser::appendLeaf(), and Mantid::Geometry::InstrumentDefinitionParser::createStructuredDetector().
|
private |
Creates all detector pixels within the StructuredDetector.
Definition at line 320 of file StructuredDetector.cpp.
References Mantid::Geometry::CompAssembly::add(), addDetector(), Mantid::Geometry::CompAssembly::CompAssembly(), getDetectorIDAtXY(), Mantid::Geometry::IComponent::getName(), m_idStart, m_maxDetId, m_minDetId, m_xPixels, and m_yPixels.
Referenced by initialize().
|
overridevirtual |
Draws the objcomponent.
Draws the objcomponent, If the handler is not set then this function does nothing.
Implements Mantid::Geometry::IObjComponent.
Definition at line 515 of file StructuredDetector.cpp.
References Mantid::Geometry::IObjComponent::Handle(), and Mantid::Geometry::GeometryHandler::render().
|
overridevirtual |
Draws the Object.
Implements Mantid::Geometry::IObjComponent.
Definition at line 525 of file StructuredDetector.cpp.
std::shared_ptr< Detector > Mantid::Geometry::StructuredDetector::getAtXY | ( | const size_t | x, |
const size_t | y | ||
) | const |
Return a pointer to the component in the assembly at the (X,Y) pixel position.
x | :: index from 0..m_xPixels-1 |
y | :: index from 0..m_yPixels-1 |
runtime_error | if the x/y pixel width is not set, or X/Y are out of range |
Definition at line 93 of file StructuredDetector.cpp.
References Mantid::Geometry::CompAssembly::getChild(), Mantid::Geometry::x, xPixels(), Mantid::Geometry::y, and yPixels().
Referenced by getBoundingBox().
std::vector< int > const & Mantid::Geometry::StructuredDetector::getB | ( | ) | const |
Returns the blue color channel for detector colors.
Definition at line 194 of file StructuredDetector.cpp.
References b, getB(), m_base, and Mantid::Geometry::Component::m_map.
Referenced by getB().
|
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. |
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 80 of file CompAssembly.cpp.
|
overridevirtual |
Retrieve the cached bounding box.
Get the bounding box and store it in the given object.
This is cached after the first call.
assemblyBox | :: A BoundingBox object that will be overwritten |
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 484 of file StructuredDetector.cpp.
References Mantid::Geometry::ComponentInfo::boundingBox(), Mantid::Geometry::ParameterMap::componentInfo(), getAtXY(), Mantid::Geometry::BoundingBox::grow(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Component::index(), Mantid::Geometry::CompAssembly::m_cachedBoundingBox, Mantid::Geometry::Component::m_map, xPixels(), and yPixels().
|
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. |
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 427 of file StructuredDetector.cpp.
References Mantid::Geometry::CompAssembly::getComponentByName(), and Mantid::Geometry::IComponent::getName().
detid_t Mantid::Geometry::StructuredDetector::getDetectorIDAtXY | ( | const size_t | x, |
const size_t | y | ||
) | const |
Return the detector ID corresponding to the component in the assembly at the (X,Y) pixel position.
No bounds check is made!
x | :: index from 0..m_xPixels-1 |
y | :: index from 0..m_yPixels-1 |
runtime_error | if the x/y pixel width is not set, or X/Y are out of range |
Definition at line 115 of file StructuredDetector.cpp.
References m_base, m_idFillByFirstY, m_idStart, m_idStep, m_idStepByRow, Mantid::Geometry::Component::m_map, Mantid::Geometry::x, and Mantid::Geometry::y.
Referenced by createDetectors().
std::vector< int > const & Mantid::Geometry::StructuredDetector::getG | ( | ) | const |
Returns the green color channel for detector colors.
Definition at line 185 of file StructuredDetector.cpp.
References g, getG(), m_base, and Mantid::Geometry::Component::m_map.
Referenced by getG().
|
overridevirtual |
Try to find a point that lies within (or on) the object.
Implements Mantid::Geometry::IObjComponent.
Definition at line 475 of file StructuredDetector.cpp.
std::vector< int > const & Mantid::Geometry::StructuredDetector::getR | ( | ) | const |
Returns the red color channel for detector colors.
Definition at line 176 of file StructuredDetector.cpp.
References getR(), m_base, Mantid::Geometry::Component::m_map, and r.
Referenced by getR().
std::vector< double > const & Mantid::Geometry::StructuredDetector::getXValues | ( | ) | const |
Definition at line 242 of file StructuredDetector.cpp.
References getXValues(), m_base, Mantid::Geometry::Component::m_map, and m_xvalues.
Referenced by getXValues().
std::pair< size_t, size_t > Mantid::Geometry::StructuredDetector::getXYForDetectorID | ( | const detid_t | detectorID | ) | const |
Given a detector ID, return the X,Y coords into the structured detector.
detectorID | :: detectorID |
Definition at line 129 of file StructuredDetector.cpp.
References m_base, m_idFillByFirstY, m_idStart, m_idStep, m_idStepByRow, and Mantid::Geometry::Component::m_map.
std::vector< double > const & Mantid::Geometry::StructuredDetector::getYValues | ( | ) | const |
Definition at line 249 of file StructuredDetector.cpp.
References getYValues(), m_base, Mantid::Geometry::Component::m_map, and m_yvalues.
Referenced by getYValues().
bool Mantid::Geometry::StructuredDetector::idFillByFirstY | ( | ) | const |
Returns the idFillByFirstY.
Definition at line 219 of file StructuredDetector.cpp.
References m_base, m_idFillByFirstY, and Mantid::Geometry::Component::m_map.
Referenced by initialize().
detid_t Mantid::Geometry::StructuredDetector::idStart | ( | ) | const |
Returns the idStart.
Definition at line 211 of file StructuredDetector.cpp.
References m_base, m_idStart, and Mantid::Geometry::Component::m_map.
Referenced by initialize().
int Mantid::Geometry::StructuredDetector::idStep | ( | ) | const |
Returns the idStep.
Definition at line 235 of file StructuredDetector.cpp.
References m_base, m_idStep, and Mantid::Geometry::Component::m_map.
Referenced by initialize().
int Mantid::Geometry::StructuredDetector::idStepByRow | ( | ) | const |
Returns the idStepByRow.
Definition at line 227 of file StructuredDetector.cpp.
References m_base, m_idStepByRow, and Mantid::Geometry::Component::m_map.
Referenced by initialize().
|
private |
initialize members to bare defaults
Definition at line 63 of file StructuredDetector.cpp.
References Mantid::Geometry::IObjComponent::GeometryHandler, m_idFillByFirstY, m_idStart, m_idStep, m_idStepByRow, m_maxDetId, m_minDetId, m_xPixels, m_yPixels, and Mantid::Geometry::IObjComponent::setGeometryHandler().
Referenced by StructuredDetector().
|
overridevirtual |
Initializes the ObjComponent for rendering, this function should be called before rendering.
Implements Mantid::Geometry::IObjComponent.
Definition at line 531 of file StructuredDetector.cpp.
References Mantid::Geometry::IObjComponent::Handle(), and Mantid::Geometry::GeometryHandler::initialize().
void Mantid::Geometry::StructuredDetector::initialize | ( | size_t | xPixels, |
size_t | yPixels, | ||
std::vector< double > && | x, | ||
std::vector< double > && | y, | ||
bool | isZBeam, | ||
detid_t | idStart, | ||
bool | idFillByFirstY, | ||
int | idStepByRow, | ||
int | idStep = 1 |
||
) |
Create all the detector pixels of this rectangular detector.
Initialize a StructuredDetector by creating all of the pixels contained within it.
You should have set the name, position and rotation and facing of this object BEFORE calling this. NB xPixels and yPixels requires (xPixels+1)*(yPixels+1) vertices
xPixels | :: number of pixels in X |
yPixels | :: number of pixels in Y |
x | :: X vertices |
y | :: Y vertices |
isZBeam | :: Whether or not the alongBeam axis is z |
idStart | :: detector ID of the first pixel |
idFillByFirstY | :: set to true if ID numbers increase with Y indices first. That is: (0,0)=0; (0,1)=1, (0,2)=2 and so on. |
idStepByRow | :: amount to increase the ID number on each row. e.g, if you fill by Y first, and set idStepByRow = 100, and have 50 Y pixels, you would get: (0,0)=0; (0,1)=1; ... (0,49)=49; (1,0)=100; (1,1)=101; etc. |
idStep | :: amount to increase each individual ID number with a row. e.g, if you fill by Y first, and idStep=100 and idStart=1 then (0,0)=1; (0,1)=101; and so on |
IDs start here
IDs are filled in Y fastest
Step size in ID in each row
Step size in ID in each col
Definition at line 278 of file StructuredDetector.cpp.
References createDetectors(), idFillByFirstY(), idStart(), idStep(), idStepByRow(), m_idFillByFirstY, m_idStart, m_idStep, m_idStepByRow, Mantid::Geometry::Component::m_map, m_xPixels, m_xvalues, m_yPixels, m_yvalues, Mantid::Geometry::x, xPixels(), Mantid::Geometry::y, and yPixels().
|
overridevirtual |
Checks whether the track given will pass through this Component.
Implements Mantid::Geometry::IObjComponent.
Definition at line 464 of file StructuredDetector.cpp.
|
overridevirtual |
Does the point given lie on the surface of this object component?
Implements Mantid::Geometry::IObjComponent.
Definition at line 459 of file StructuredDetector.cpp.
|
overridevirtual |
Does the point given lie within this object component?
Implements Mantid::Geometry::IObjComponent.
Definition at line 454 of file StructuredDetector.cpp.
|
overridevirtual |
Returns the material of the detector.
Implements Mantid::Geometry::IObjComponent.
Definition at line 586 of file StructuredDetector.cpp.
int Mantid::Geometry::StructuredDetector::maxDetectorID | ( | ) |
maximum detector id
Returns the maximum detector id.
Definition at line 421 of file StructuredDetector.cpp.
References m_base, Mantid::Geometry::Component::m_map, and m_maxDetId.
int Mantid::Geometry::StructuredDetector::minDetectorID | ( | ) |
minimum detector id
Returns the minimum detector id.
Definition at line 411 of file StructuredDetector.cpp.
References m_base, Mantid::Geometry::Component::m_map, and m_minDetId.
|
private |
Private copy assignment operator.
|
overridevirtual |
Register the structured detector for Instrument 2.0 usage.
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 612 of file StructuredDetector.cpp.
References Mantid::Geometry::ComponentVisitor::registerStructuredBank().
void Mantid::Geometry::StructuredDetector::setColors | ( | const std::vector< int > & | r, |
const std::vector< int > & | g, | ||
const std::vector< int > & | b | ||
) | const |
Sets the colours for detector IDs based on color maps created by instrument actor.
r | red color channel |
g | green color channel |
b | blue color channel |
Definition at line 163 of file StructuredDetector.cpp.
References b, g, m_base, Mantid::Geometry::Component::m_map, r, and setColors().
Referenced by setColors().
|
overridevirtual |
Returns the shape of the Object.
Implements Mantid::Geometry::IObjComponent.
Definition at line 539 of file StructuredDetector.cpp.
References Mantid::Geometry::ShapeFactory::createShape(), m_xPixels, m_xvalues, m_yPixels, m_yvalues, and xPixels().
Referenced by addDetector().
|
overridevirtual |
Finds the approximate solid angle covered by the component when viewed from the point given.
Implements Mantid::Geometry::IObjComponent.
Definition at line 470 of file StructuredDetector.cpp.
|
inlineoverridevirtual |
String description of the type of component.
Reimplemented from Mantid::Geometry::CompAssembly.
Definition at line 35 of file StructuredDetector.h.
size_t Mantid::Geometry::StructuredDetector::xPixels | ( | ) | const |
Returns the number of pixels in the X direction.
Definition at line 150 of file StructuredDetector.cpp.
References m_base, Mantid::Geometry::Component::m_map, and m_xPixels.
Referenced by getAtXY(), getBoundingBox(), initialize(), and shape().
size_t Mantid::Geometry::StructuredDetector::yPixels | ( | ) | const |
Returns the number of pixels in the Y direction.
Definition at line 203 of file StructuredDetector.cpp.
References m_base, Mantid::Geometry::Component::m_map, and m_yPixels.
Referenced by getAtXY(), getBoundingBox(), and initialize().
|
mutableprivate |
Definition at line 167 of file StructuredDetector.h.
Referenced by getB(), and setColors().
|
mutableprivate |
Definition at line 166 of file StructuredDetector.h.
Referenced by getG(), and setColors().
|
private |
Pointer to the base RectangularDetector, for parametrized instruments.
Definition at line 139 of file StructuredDetector.h.
Referenced by getB(), getDetectorIDAtXY(), getG(), getR(), getXValues(), getXYForDetectorID(), getYValues(), idFillByFirstY(), idStart(), idStep(), idStepByRow(), maxDetectorID(), minDetectorID(), setColors(), xPixels(), and yPixels().
|
private |
IDs are filled in Y fastest.
Definition at line 156 of file StructuredDetector.h.
Referenced by getDetectorIDAtXY(), getXYForDetectorID(), idFillByFirstY(), init(), and initialize().
|
private |
IDs start here.
Definition at line 154 of file StructuredDetector.h.
Referenced by createDetectors(), getDetectorIDAtXY(), getXYForDetectorID(), idStart(), init(), and initialize().
|
private |
Step size in ID in each col.
Definition at line 160 of file StructuredDetector.h.
Referenced by getDetectorIDAtXY(), getXYForDetectorID(), idStep(), init(), and initialize().
|
private |
Step size in ID in each row.
Definition at line 158 of file StructuredDetector.h.
Referenced by getDetectorIDAtXY(), getXYForDetectorID(), idStepByRow(), init(), and initialize().
|
private |
maximum detector id
Definition at line 151 of file StructuredDetector.h.
Referenced by createDetectors(), init(), and maxDetectorID().
|
private |
minimum detector id
Definition at line 149 of file StructuredDetector.h.
Referenced by createDetectors(), init(), and minDetectorID().
|
private |
The number of pixels in the X (horizontal) direction;.
Definition at line 144 of file StructuredDetector.h.
Referenced by addDetector(), createDetectors(), init(), initialize(), shape(), and xPixels().
|
private |
Definition at line 162 of file StructuredDetector.h.
Referenced by addDetector(), getXValues(), initialize(), and shape().
|
private |
The number of pixels in the Y (vertical) direction;.
Definition at line 146 of file StructuredDetector.h.
Referenced by createDetectors(), init(), initialize(), shape(), and yPixels().
|
private |
Definition at line 163 of file StructuredDetector.h.
Referenced by addDetector(), getYValues(), initialize(), and shape().
|
mutableprivate |
Definition at line 165 of file StructuredDetector.h.
Referenced by getR(), and setColors().