9#include "MantidGeometry/DllConfig.h"
20class ComponentVisitor;
35 std::string
type()
const override {
return "StructuredDetector"; }
38 static bool compareName(
const std::string &proposedMatch);
50 void initialize(
size_t xPixels,
size_t yPixels, std::vector<double> &&x, std::vector<double> &&y,
bool isZBeam,
51 detid_t idStart,
bool idFillByFirstY,
int idStepByRow,
int idStep = 1);
56 std::shared_ptr<Detector> getAtXY(
const size_t x,
const size_t y)
const;
58 detid_t getDetectorIDAtXY(
const size_t X,
const size_t Y)
const;
59 std::pair<size_t, size_t> getXYForDetectorID(
const detid_t detectorID)
const;
61 std::vector<double>
const &getXValues()
const;
62 std::vector<double>
const &getYValues()
const;
64 void setColors(
const std::vector<int> &r,
const std::vector<int> &g,
const std::vector<int> &b)
const;
66 std::vector<int>
const &getR()
const;
67 std::vector<int>
const &getG()
const;
68 std::vector<int>
const &getB()
const;
70 size_t xPixels()
const;
71 size_t yPixels()
const;
73 bool idFillByFirstY()
const;
74 int idStepByRow()
const;
82 std::shared_ptr<const IComponent> getComponentByName(
const std::string &cname,
int nlevels = 0)
const override;
88 using CompAssembly::getBoundingBox;
93 bool isValid(
const Kernel::V3D &point)
const override;
96 bool isOnSide(
const Kernel::V3D &point)
const override;
99 int interceptSurface(
Track &track)
const override;
103 double solidAngle(
const Kernel::V3D &observer)
const override;
105 void getBoundingBox(
BoundingBox &assemblyBox)
const override;
108 int getPointInObject(
Kernel::V3D &point)
const override;
112 void draw()
const override;
115 void drawObject()
const override;
119 void initDraw()
const override;
122 const std::shared_ptr<const IObject> shape()
const override;
127 virtual size_t registerContents(
class ComponentVisitor &componentVisitor)
const override;
134 void createDetectors();
165 mutable std::vector<int>
r;
166 mutable std::vector<int>
g;
167 mutable std::vector<int>
b;
A simple structure that defines an axis-aligned cuboid shaped bounding box for a geometrical object.
Class for Assembly of geometric components.
ComponentVisitor : Visitor for IComponents.
This class represents a detector - i.e.
Class for Assembly of geometric components.
base class for Geometric IComponent
Object Component class, this class brings together the physical attributes of the component to the po...
StructuredDetector is a type of CompAssembly, an assembly of components.
size_t m_xPixels
The number of pixels in the X (horizontal) direction;.
detid_t m_maxDetId
maximum detector id
size_t m_yPixels
The number of pixels in the Y (vertical) direction;.
const StructuredDetector * m_base
Pointer to the base RectangularDetector, for parametrized instruments.
int m_idStepByRow
Step size in ID in each row.
int m_idStep
Step size in ID in each col.
std::vector< double > m_yvalues
detid_t m_minDetId
minimum detector id
bool m_idFillByFirstY
IDs are filled in Y fastest.
std::string type() const override
String description of the type of component.
StructuredDetector & operator=(const ICompAssembly &)
Private copy assignment operator.
std::vector< double > m_xvalues
detid_t m_idStart
IDs start here.
Defines a track as a start point and a direction.
A material is defined as being composed of a given element, defined as a PhysicalConstants::NeutronAt...
std::shared_ptr< StructuredDetector > StructuredDetector_sptr
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
std::shared_ptr< const StructuredDetector > StructuredDetector_const_sptr
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.