Mantid
Loading...
Searching...
No Matches
Plane.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
10#include "MantidKernel/V3D.h"
11#include <string>
12
13namespace Mantid {
14
15namespace Kernel {
16template <typename T> class Matrix;
17}
18
19namespace Geometry {
20//---------------------------------------------
21// Forward declaration
22//---------------------------------------------
23class BaseVisit;
24
35class MANTID_GEOMETRY_DLL Plane : public Quadratic {
36private:
38 double m_distance;
39
40 std::size_t planeType() const;
41 Plane *doClone() const override;
42
43protected:
44 Plane(const Plane &) = default;
45 Plane &operator=(const Plane &) = delete;
46
47public:
49 std::string className() const override { return "Plane"; }
50
51 Plane();
52 std::unique_ptr<Plane> clone() const;
53
54 void acceptVisitor(BaseVisit &A) const override { A.Accept(*this); }
55
56 int setPlane(const Kernel::V3D &, const Kernel::V3D &);
57 // int setPlane(const std::string&);
58 int side(const Kernel::V3D &) const override;
59 bool onSurface(const Kernel::V3D &) const override;
60 // stuff for finding intersections etc.
61 double dotProd(const Plane &) const;
62 Kernel::V3D crossProd(const Plane &) const;
63 double distance(const Kernel::V3D &) const override;
64
65 double getDistance() const { return m_distance; }
66 const Kernel::V3D &getNormal() const { return m_normVec; }
67
68 void rotate(const Kernel::Matrix<double> &) override;
69 void displace(const Kernel::V3D &) override;
70
71 int setSurface(const std::string &) override;
72 void print() const override;
73 void write(std::ostream &) const override;
74
75 void setBaseEqn() override;
76
77 int LineIntersectionWithPlane(Kernel::V3D startpt, Kernel::V3D endpt, Kernel::V3D &output);
78 void getBoundingBox(double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override;
79#ifdef ENABLE_OPENCASCADE
80 TopoDS_Shape createShape() override;
81#endif
82};
83
84} // NAMESPACE Geometry
85
86} // NAMESPACE Mantid
virtual void Accept(const Surface &)=0
Accept a surface.
Holds a simple Plane.
Definition: Plane.h:35
Plane & operator=(const Plane &)=delete
std::string className() const override
Effective typename.
Definition: Plane.h:49
double m_distance
Distance from origin.
Definition: Plane.h:38
double getDistance() const
Distance from origin.
Definition: Plane.h:65
void acceptVisitor(BaseVisit &A) const override
Accept visitor for line calculation.
Definition: Plane.h:54
const Kernel::V3D & getNormal() const
Normal to plane (+ve surface)
Definition: Plane.h:66
Plane(const Plane &)=default
Kernel::V3D m_normVec
Normal vector.
Definition: Plane.h:37
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.