Mantid
Loading...
Searching...
No Matches
Cone.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 "MantidGeometry/DllConfig.h"
11#include "MantidKernel/V3D.h"
12
13namespace Mantid {
14
15namespace Geometry {
29class MANTID_GEOMETRY_DLL Cone : public Quadratic {
30private:
33 double alpha;
34 double cangle;
35
36 void rotate(const Kernel::Matrix<double> &) override;
37 void displace(const Kernel::V3D &) override;
38 Cone *doClone() const override;
39
40protected:
41 Cone(const Cone &) = default;
42 Cone &operator=(const Cone &) = delete;
43
44public:
46 std::string className() const override { return "Cone"; }
47 Cone();
48 std::unique_ptr<Cone> clone() const;
49 int operator==(const Cone &) const;
52 int side(const Kernel::V3D &R) const override;
54 bool onSurface(const Kernel::V3D &R) const override;
55
57 void acceptVisitor(BaseVisit &A) const override { A.Accept(*this); }
58
60 Kernel::V3D getCentre() const { return Centre; }
62 Kernel::V3D getNormal() const { return Normal; }
64 double getCosAngle() const { return cangle; }
66 double distance(const Kernel::V3D &) const override;
67
69 int setSurface(const std::string &) override;
71 void setCentre(const Kernel::V3D &);
73 void setNorm(const Kernel::V3D &);
75 void setAngle(double const);
78 void setTanAngle(double const);
80 void setBaseEqn() override;
82 void write(std::ostream &) const override;
83
85 void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override;
86
88 constexpr static int g_NSLICES = 10;
90 constexpr static int g_NSTACKS = 1;
91#ifdef ENABLE_OPENCASCADE
92 TopoDS_Shape createShape() override;
93#endif
94};
95
96} // namespace Geometry
97
98} // NAMESPACE Mantid
virtual void Accept(const Surface &)=0
Accept a surface.
Holds a cone in vector form.
Definition: Cone.h:29
void acceptVisitor(BaseVisit &A) const override
Accept visitor for line calculation.
Definition: Cone.h:57
Kernel::V3D getNormal() const
Central normal.
Definition: Cone.h:62
Kernel::V3D Normal
Normal.
Definition: Cone.h:32
Kernel::V3D getCentre() const
Return centre point.
Definition: Cone.h:60
Kernel::V3D Centre
Kernel::V3D for centre.
Definition: Cone.h:31
double getCosAngle() const
Edge Angle.
Definition: Cone.h:64
double alpha
Angle (degrees)
Definition: Cone.h:33
double cangle
Cos(angle)
Definition: Cone.h:34
std::string className() const override
Public identifer.
Definition: Cone.h:46
Cone & operator=(const Cone &)=delete
Cone(const Cone &)=default
Holds a basic quadratic surface.
Definition: Quadratic.h:29
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)