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"
15#include <string>
16#include <vector>
17
18namespace Mantid {
19namespace Geometry {
20
21class ComponentVisitor;
33class MANTID_GEOMETRY_DLL RectangularDetector : public GridDetector {
34public:
36 std::string type() const override { return "RectangularDetector"; }
39
41 RectangularDetector(const std::string &, IComponent *reference = nullptr);
42
45
47 static bool compareName(const std::string &proposedMatch);
48
50 void initialize(std::shared_ptr<IObject> shape, int xpixels, double xstart, double xstep, int ypixels, double ystart,
51 double ystep, int idstart, bool idfillbyfirst_y, int idstepbyrow, int idstep = 1);
52
54 RectangularDetector *clone() const override;
55
56 std::shared_ptr<Detector> getAtXY(const int X, const int Y) const;
57
58 detid_t getDetectorIDAtXY(const int X, const int Y) const;
59 std::pair<int, int> getXYForDetectorID(const int detectorID) const;
60
61 Kernel::V3D getRelativePosAtXY(int x, int y) const;
62 void getTextureSize(int &xsize, int &ysize) const;
63
64 unsigned int getTextureID() const;
65 void setTextureID(unsigned int textureID);
66
67 // This should inherit the getBoundingBox implementation from CompAssembly
68 // but
69 // the multiple inheritance seems to confuse it so we'll explicityly tell it
70 // that here
71 using CompAssembly::getBoundingBox;
72
73 void testIntersectionWithChildren(Track &testRay, std::deque<IComponent_const_sptr> &searchQueue) const override;
74
75 // ------------ IObjComponent methods ----------------
76
78 const Kernel::Material material() const override;
79
80 virtual size_t registerContents(class ComponentVisitor &componentVisitor) const override;
81
82 // ------------ End of IObjComponent methods ----------------
83
84private:
87
89 unsigned int m_textureID;
90};
91
92MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &, const RectangularDetector &);
93
94using RectangularDetector_sptr = std::shared_ptr<RectangularDetector>;
95using RectangularDetector_const_sptr = std::shared_ptr<const RectangularDetector>;
96
97} // Namespace Geometry
98} // Namespace Mantid
ComponentVisitor : Visitor for IComponents.
GridDetector is a type of CompAssembly, an assembly of components.
Definition: GridDetector.h:34
Class for Assembly of geometric components.
Definition: ICompAssembly.h:30
base class for Geometric IComponent
Definition: IComponent.h:51
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.
Definition: PointGroup.cpp:312
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.
Definition: SpectrumInfo.h:21