Mantid
Loading...
Searching...
No Matches
RectangularDetector.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8#include "MantidGeometry/DllConfig.h"
14#include <string>
15#include <vector>
16
17namespace Mantid {
18namespace Geometry {
19
20class ComponentVisitor;
32class MANTID_GEOMETRY_DLL RectangularDetector : public GridDetector {
33public:
35 std::string type() const override { return "RectangularDetector"; }
38
40 RectangularDetector(const std::string &, IComponent *reference = nullptr);
41
44
46 static bool compareName(const std::string &proposedMatch);
47
49 void initialize(std::shared_ptr<IObject> shape, int xpixels, double xstart, double xstep, int ypixels, double ystart,
50 double ystep, int idstart, bool idfillbyfirst_y, int idstepbyrow, int idstep = 1);
51
53 RectangularDetector *clone() const override;
54
55 std::shared_ptr<Detector> getAtXY(const int X, const int Y) const;
56
57 detid_t getDetectorIDAtXY(const int X, const int Y) const;
58 std::pair<int, int> getXYForDetectorID(const int detectorID) const;
59
60 Kernel::V3D getRelativePosAtXY(int x, int y) const;
61 void getTextureSize(int &xsize, int &ysize) const;
62
63 unsigned int getTextureID() const;
64 void setTextureID(unsigned int textureID);
65
66 // This should inherit the getBoundingBox implementation from CompAssembly
67 // but
68 // the multiple inheritance seems to confuse it so we'll explicityly tell it
69 // that here
70 using CompAssembly::getBoundingBox;
71
72 void testIntersectionWithChildren(Track &testRay, std::deque<IComponent_const_sptr> &searchQueue) const override;
73
74 // ------------ IObjComponent methods ----------------
75
77 const Kernel::Material material() const override;
78
79 virtual size_t registerContents(class ComponentVisitor &componentVisitor) const override;
80
81 // ------------ End of IObjComponent methods ----------------
82
83private:
86
88 unsigned int m_textureID;
89};
90
91MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &, const RectangularDetector &);
92
93using RectangularDetector_sptr = std::shared_ptr<RectangularDetector>;
94using RectangularDetector_const_sptr = std::shared_ptr<const RectangularDetector>;
95
96} // Namespace Geometry
97} // Namespace Mantid
ComponentVisitor : Visitor for IComponents.
GridDetector is a type of CompAssembly, an assembly of components.
Class for Assembly of geometric components.
base class for Geometric IComponent
Definition IComponent.h:53
RectangularDetector is a type of CompAssembly, an assembly of components.
RectangularDetector()
Empty constructor.
std::string type() const override
String description of the type of component.
RectangularDetector & operator=(const ICompAssembly &)
Private copy assignment operator.
unsigned int m_textureID
Texture ID to use in rendering.
Defines a track as a start point and a direction.
Definition Track.h:165
A material is defined as being composed of a given element, defined as a PhysicalConstants::NeutronAt...
Definition Material.h:50
Class for 3D vectors.
Definition V3D.h:34
std::shared_ptr< const RectangularDetector > RectangularDetector_const_sptr
std::shared_ptr< RectangularDetector > RectangularDetector_sptr
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.