Mantid
Loading...
Searching...
No Matches
ShapeInfo.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2017 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
9#include "MantidGeometry/DllConfig.h"
10#include "MantidKernel/V3D.h"
11#include <iosfwd>
12#include <vector>
13
14namespace Mantid {
15namespace Geometry {
16class RectangularDetector;
17class StructuredDetector;
18class IObjComponent;
19
25namespace detail {
26class MANTID_GEOMETRY_DLL ShapeInfo {
27public:
28 enum class GeometryShape {
29 NOSHAPE = 0,
30 CUBOID,
31 HEXAHEDRON,
32 SPHERE,
33 CYLINDER,
34 CONE,
35 HOLLOWCYLINDER,
36 };
37
43 };
53 };
56 double radius;
57 };
61 double radius;
62 double height;
63 };
64 struct ConeGeometry {
67 double radius;
68 double height;
69 };
74 double radius;
75 double height;
76 };
77
78private:
79 std::vector<Kernel::V3D> m_points;
80 double m_radius;
82 double m_height;
85
86public:
87 ShapeInfo();
88 ShapeInfo(const ShapeInfo &) = default;
89 const std::vector<Kernel::V3D> &points() const;
90 double radius() const;
91 double innerRadius() const;
92 double height() const;
93 GeometryShape shape() const;
94
95 void getObjectGeometry(GeometryShape &shape, std::vector<Kernel::V3D> &points, double &innerRadius, double &radius,
96 double &height) const;
97
98 CuboidGeometry cuboidGeometry() const;
99 HexahedronGeometry hexahedronGeometry() const;
100 SphereGeometry sphereGeometry() const;
101 CylinderGeometry cylinderGeometry() const;
102 ConeGeometry coneGeometry() const;
103 HollowCylinderGeometry hollowCylinderGeometry() const;
105 void setCuboid(const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &);
107 void setHexahedron(const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &,
108 const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &, const Kernel::V3D &);
110 void setSphere(const Kernel::V3D &center, double radius);
112 void setCylinder(const Kernel::V3D &centerBottomBase, const Kernel::V3D &symmetryAxis, double radius, double height);
114 void setCone(const Kernel::V3D &center, const Kernel::V3D &symmetryAxis, double radius, double height);
116 void setHollowCylinder(const Kernel::V3D &centreBottomBase, const Kernel::V3D &symmetryAxis, double innerRadius,
117 double outerRadius, double height);
118 bool operator==(const ShapeInfo &other);
119};
120
121MANTID_GEOMETRY_DLL std::ostream &operator<<(std::ostream &os, const ShapeInfo::GeometryShape shape);
122
123} // namespace detail
124} // namespace Geometry
125} // namespace Mantid
double height
Definition: GetAllEi.cpp:155
double radius
Definition: Rasterize.cpp:31
double innerRadius
Definition: Rasterize.cpp:39
V3D centerBottomBase
Definition: Rasterize.cpp:33
ShapeInfo(const ShapeInfo &)=default
double m_radius
Radius for the sphere, cone and cylinder; Also outer radius for hollow cylinder;.
Definition: ShapeInfo.h:80
double m_height
height for cone, cylinder and hollow cylinder;
Definition: ShapeInfo.h:82
std::vector< Kernel::V3D > m_points
Definition: ShapeInfo.h:79
double m_innerRadius
Inner radius for hollow cylinder.
Definition: ShapeInfo.h:83
Class for 3D vectors.
Definition: V3D.h:34
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &os, const ShapeInfo::GeometryShape shape)
Definition: ShapeInfo.cpp:123
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)