Mantid
Loading...
Searching...
No Matches
Torus.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
9#include "MantidKernel/V3D.h"
10
11namespace Mantid {
12
13namespace Geometry {
14
30class MANTID_GEOMETRY_DLL Torus : public Surface {
31private:
34 double Iradius;
35 double Dradius;
36 double Displacement;
37
38 void rotate(const Kernel::Matrix<double> &) override;
39 void displace(const Kernel::V3D &) override;
40 Torus *doClone() const override;
41
42protected:
43 Torus(const Torus &) = default;
44 Torus &operator=(const Torus &) = delete;
45
46public:
48 std::string className() const override { return "Torus"; }
49
50 Torus();
51 std::unique_ptr<Torus> clone() const;
52 int operator==(const Torus &) const;
53
55 void acceptVisitor(BaseVisit &A) const override { A.Accept(*this); }
56
57 int setSurface(const std::string &Pstr) override;
58 int side(const Kernel::V3D &R) const override;
59 bool onSurface(const Kernel::V3D &R) const override;
60 double distance(const Kernel::V3D &Pt) const override;
61
63 Kernel::V3D getCentre() const { return Centre; }
65 Kernel::V3D getNormal() const { return Normal; }
66 Kernel::V3D surfaceNormal(const Kernel::V3D &Pt) const override;
67
68 void setCentre(const Kernel::V3D &A);
69 void setNorm(const Kernel::V3D &A);
70
74 void setDistanceFromCentreToTube(double dist);
75
78 void setTubeRadius(double dist);
79
80 void write(std::ostream &OX) const override;
81 void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override;
82#ifdef ENABLE_OPENCASCADE
83 TopoDS_Shape createShape() override;
84#endif
85};
86
87} // namespace Geometry
88
89} // NAMESPACE Mantid
virtual void Accept(const Surface &)=0
Accept a surface.
Holds a basic quadratic surface.
Definition: Surface.h:33
Holds a torus in vector form.
Definition: Torus.h:30
Kernel::V3D Normal
Normal.
Definition: Torus.h:33
double Displacement
Displacement.
Definition: Torus.h:36
double Dradius
Inner radius.
Definition: Torus.h:35
void acceptVisitor(BaseVisit &A) const override
Accept visitor for line calculation.
Definition: Torus.h:55
Torus(const Torus &)=default
Kernel::V3D getNormal() const
Central normal.
Definition: Torus.h:65
std::string className() const override
Public identifier.
Definition: Torus.h:48
Torus & operator=(const Torus &)=delete
Kernel::V3D Centre
Geometry::Vec3D for centre.
Definition: Torus.h:32
double Iradius
Inner radius.
Definition: Torus.h:34
Kernel::V3D getCentre() const
Return centre point.
Definition: Torus.h:63
Numerical Matrix class.
Definition: Matrix.h:42
Class for 3D vectors.
Definition: V3D.h:34
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)