Mantid
|
RectangularDetector is a type of CompAssembly, an assembly of components. More...
#include <RectangularDetector.h>
Public Member Functions | |
RectangularDetector * | clone () const override |
Make a clone of the present component. More... | |
std::shared_ptr< Detector > | getAtXY (const int X, const int Y) const |
Return a pointer to the component in the assembly at the (X,Y) pixel position. More... | |
void | getBoundingBox (BoundingBox &assemblyBox) const override |
Get the bounding box for this component and store it in the given argument. More... | |
detid_t | getDetectorIDAtXY (const int X, const int Y) const |
Return the detector ID corresponding to the component in the assembly at the (X,Y) pixel position. More... | |
Kernel::V3D | getRelativePosAtXY (int x, int y) const |
Returns the position of the center of the pixel at x,y, relative to the center of the RectangularDetector, in the plain X,Y coordinates of the pixels (i.e. More... | |
unsigned int | getTextureID () const |
Return the texture ID to be used in plotting . More... | |
void | getTextureSize (int &xsize, int &ysize) const |
Return the number of pixels to make a texture in, given the desired pixel size. More... | |
std::pair< int, int > | getXYForDetectorID (const int detectorID) const |
Given a detector ID, return the X,Y coords into the rectangular detector. More... | |
void | initialize (std::shared_ptr< IObject > shape, int xpixels, double xstart, double xstep, int ypixels, double ystart, double ystep, int idstart, bool idfillbyfirst_y, int idstepbyrow, int idstep=1) |
Create all the detector pixels of this rectangular detector. More... | |
const Kernel::Material | material () const override |
Returns the material of the detector. More... | |
RectangularDetector () | |
Empty constructor. More... | |
RectangularDetector (const RectangularDetector *base, const ParameterMap *map) | |
Parametrized constructor. More... | |
RectangularDetector (const std::string &, IComponent *reference=nullptr) | |
Constructor with a name and parent reference. More... | |
virtual size_t | registerContents (class ComponentVisitor &componentVisitor) const override |
void | setTextureID (unsigned int textureID) |
Set the texture ID to use when rendering the RectangularDetector. 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... | |
Public Member Functions inherited from Mantid::Geometry::GridDetector | |
GridDetector * | 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 > | getAtXYZ (const int x, const int y, const int z) const |
Return a pointer to the component in the assembly at the (X,Y) pixel position. 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 | getDetectorIDAtXYZ (const int x, const int y, const int z) const |
Return the detector ID corresponding to the component in the assembly at the (X,Y) pixel position. More... | |
int | getPointInObject (Kernel::V3D &point) const override |
Try to find a point that lies within (or on) the object. More... | |
Kernel::V3D | getRelativePosAtXYZ (int x, int y, int z) const |
Returns the position of the center of the pixel at x,y, relative to the center of the GridDetector, in the plain X,Y coordinates of the pixels (i.e. More... | |
std::tuple< int, int, int > | getXYZForDetectorID (const detid_t detectorID) const |
Given a detector ID, return the X,Y,Z coords into the grid detector. More... | |
GridDetector (const GridDetector *base, const ParameterMap *map) | |
Parametrized constructor. More... | |
GridDetector (const std::string &name, IComponent *reference=nullptr) | |
Constructor with a name and parent reference. More... | |
bool | idfillbyfirst_y () const |
Returns the idfillbyfirst_y. More... | |
std::string | idFillOrder () const |
Returns the id fill order. More... | |
int | 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 (std::shared_ptr< IObject > shape, int xpixels, double xstart, double xstep, int ypixels, double ystart, double ystep, int zpixels, double zstart, double zstep, int idstart, const std::string &idFillOrder, int idstepbyrow, int idstep=1) |
Create all the detector pixels of this grid 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 |
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... | |
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... | |
int | xpixels () const |
Returns the number of pixels in the X direction. More... | |
double | xsize () const |
Size in X of the detector. More... | |
double | xstart () const |
Returns the start position in the X direction. More... | |
double | xstep () const |
Returns the step size in the X direction. More... | |
int | ypixels () const |
Returns the number of pixels in the Y direction. More... | |
double | ysize () const |
Size in Y of the detector. More... | |
double | ystart () const |
Returns the start position in the Y direction. More... | |
double | ystep () const |
Returns the step size in the Y direction. More... | |
int | zpixels () const |
Returns the number of pixels in the Z direction. More... | |
double | zsize () const |
Size in Z of the detector. More... | |
double | zstart () const |
Returns the start position in the Z direction. More... | |
double | zstep () const |
Returns the step size in the Z 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... | |
Static Public Member Functions inherited from Mantid::Geometry::GridDetector | |
static bool | compareName (const std::string &proposedMatch) |
Matches name to Structured Detector. More... | |
Private Member Functions | |
RectangularDetector & | operator= (const ICompAssembly &) |
Private copy assignment operator. More... | |
Private Attributes | |
unsigned int | m_textureID |
Texture ID to use in rendering. More... | |
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::GridDetector | |
void | createLayer (const std::string &name, CompAssembly *parent, int iz, int &minDetID, int &maxDetID) |
void | init () |
initialize members to bare defaults 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... | |
RectangularDetector is a type of CompAssembly, an assembly of components.
It is designed to be an easy way to specify a rectangular (XY) array of Detector pixels.
Assembly of Detector objects in a rectangular shape
Definition at line 33 of file RectangularDetector.h.
Mantid::Geometry::RectangularDetector::RectangularDetector | ( | ) |
Empty constructor.
Referenced by clone().
Mantid::Geometry::RectangularDetector::RectangularDetector | ( | 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 66 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::init(), m_textureID, Mantid::Geometry::IObjComponent::setGeometryHandler(), and Mantid::Geometry::IComponent::setName().
Mantid::Geometry::RectangularDetector::RectangularDetector | ( | const RectangularDetector * | base, |
const ParameterMap * | map | ||
) |
Parametrized constructor.
Constructor for a parametrized RectangularDetector.
base | the base (un-parametrized) RectangularDetector |
map | pointer to the ParameterMap |
Definition at line 52 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::init().
|
overridevirtual |
Make a clone of the present component.
Clone method Make a copy of the component assembly.
Reimplemented from Mantid::Geometry::GridDetector.
Definition at line 84 of file RectangularDetector.cpp.
References RectangularDetector().
|
static |
Matches name to Structured Detector.
Definition at line 73 of file RectangularDetector.cpp.
Referenced by Mantid::Geometry::InstrumentDefinitionParser::appendLeaf().
std::shared_ptr< Detector > Mantid::Geometry::RectangularDetector::getAtXY | ( | const int | X, |
const int | 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 97 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::getAtXYZ(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by Mantid::Algorithms::CreateSampleWorkspace::createTestInstrumentRectangular(), ComponentCreationHelper::createTestUnnamedRectangular2(), Mantid::DataHandling::LoadQKK::exec(), and testIntersectionWithChildren().
|
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::GridDetector.
Definition at line 80 of file CompAssembly.cpp.
detid_t Mantid::Geometry::RectangularDetector::getDetectorIDAtXY | ( | const int | X, |
const int | 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 111 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::getDetectorIDAtXYZ(), Mantid::Geometry::X, and Mantid::Geometry::Y.
V3D Mantid::Geometry::RectangularDetector::getRelativePosAtXY | ( | int | x, |
int | y | ||
) | const |
Returns the position of the center of the pixel at x,y, relative to the center of the RectangularDetector, in the plain X,Y coordinates of the pixels (i.e.
unrotated).
x | :: x pixel integer |
y | :: y pixel integer |
Definition at line 135 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::getRelativePosAtXYZ(), Mantid::Geometry::x, and Mantid::Geometry::y.
unsigned int Mantid::Geometry::RectangularDetector::getTextureID | ( | ) | const |
Return the texture ID to be used in plotting .
Definition at line 264 of file RectangularDetector.cpp.
References m_textureID.
void Mantid::Geometry::RectangularDetector::getTextureSize | ( | int & | xsize, |
int & | ysize | ||
) | const |
Return the number of pixels to make a texture in, given the desired pixel size.
A texture has to have 2^n pixels per side.
xsize | :: pixel texture size in x direction |
ysize | :: pixel texture size in y direction |
Definition at line 254 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::xpixels(), Mantid::Geometry::GridDetector::xsize(), and Mantid::Geometry::GridDetector::ypixels().
std::pair< int, int > Mantid::Geometry::RectangularDetector::getXYForDetectorID | ( | const int | detectorID | ) | const |
Given a detector ID, return the X,Y coords into the rectangular detector.
detectorID | :: detectorID |
Definition at line 121 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::getXYZForDetectorID().
void Mantid::Geometry::RectangularDetector::initialize | ( | std::shared_ptr< IObject > | shape, |
int | xpixels, | ||
double | xstart, | ||
double | xstep, | ||
int | ypixels, | ||
double | ystart, | ||
double | ystep, | ||
int | idstart, | ||
bool | idfillbyfirst_y, | ||
int | idstepbyrow, | ||
int | idstep = 1 |
||
) |
Create all the detector pixels of this rectangular detector.
Initialize a RectangularDetector 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.
shape | :: a geometry Object containing the shape of each (individual) pixel in the assembly. All pixels must have the same shape. |
xpixels | :: number of pixels in X |
xstart | :: x-position of the 0-th pixel (in length units, normally meters) |
xstep | :: step size between pixels in the horizontal direction (in length units, normally meters) |
ypixels | :: number of pixels in Y |
ystart | :: y-position of the 0-th pixel (in length units, normally meters) |
ystep | :: step size between pixels in the vertical direction (in length units, normally meters) |
idstart | :: detector ID of the first pixel |
idfillbyfirst_y | :: 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 |
Definition at line 167 of file RectangularDetector.cpp.
References Mantid::Geometry::GridDetector::idfillbyfirst_y(), Mantid::Geometry::GridDetector::idstart(), Mantid::Geometry::GridDetector::idstep(), Mantid::Geometry::GridDetector::idstepbyrow(), Mantid::Geometry::GridDetector::initialize(), Mantid::Geometry::GridDetector::shape(), Mantid::Geometry::GridDetector::xpixels(), Mantid::Geometry::GridDetector::xstart(), Mantid::Geometry::GridDetector::xstep(), Mantid::Geometry::GridDetector::ypixels(), Mantid::Geometry::GridDetector::ystart(), and Mantid::Geometry::GridDetector::ystep().
Referenced by Mantid::Algorithms::CreateSampleWorkspace::createTestInstrumentRectangular(), ComponentCreationHelper::createTestUnnamedRectangular2(), and Mantid::DataHandling::LoadQKK::exec().
|
overridevirtual |
Returns the material of the detector.
Reimplemented from Mantid::Geometry::GridDetector.
Definition at line 266 of file RectangularDetector.cpp.
|
private |
Private copy assignment operator.
|
overridevirtual |
Reimplemented from Mantid::Geometry::GridDetector.
Definition at line 268 of file RectangularDetector.cpp.
References Mantid::Geometry::ComponentVisitor::registerRectangularBank().
void Mantid::Geometry::RectangularDetector::setTextureID | ( | unsigned int | textureID | ) |
Set the texture ID to use when rendering the RectangularDetector.
Definition at line 261 of file RectangularDetector.cpp.
References m_textureID.
|
overridevirtual |
Test the intersection of the ray with the children of the component assembly, for InstrumentRayTracer.
Uses the knowledge of the RectangularDetector shape to significantly speed up tracking.
testRay | :: Track under test. The results are stored here. |
searchQueue | :: If a child is a sub-assembly then it is appended for later searching. Unused. |
Base point (x,y,z) = position of pixel 0,0
Vertical (y-axis) basis vector of the detector
Horizontal (x-axis) basis vector of the detector
Reimplemented from Mantid::Geometry::GridDetector.
Definition at line 185 of file RectangularDetector.cpp.
References Mantid::Geometry::Track::addLink(), Mantid::Geometry::Track::direction(), getAtXY(), Mantid::Kernel::Matrix< T >::Invert(), Mantid::Kernel::Matrix< T >::setColumn(), Mantid::Geometry::Track::startPoint(), Mantid::Geometry::GridDetector::xpixels(), and Mantid::Geometry::GridDetector::ypixels().
|
inlineoverridevirtual |
String description of the type of component.
Reimplemented from Mantid::Geometry::GridDetector.
Definition at line 36 of file RectangularDetector.h.
|
private |
Texture ID to use in rendering.
Definition at line 89 of file RectangularDetector.h.
Referenced by getTextureID(), RectangularDetector(), and setTextureID().