Mantid
Loading...
Searching...
No Matches
Line.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"
10#include "MantidKernel/V3D.h"
11#include <boost/container/small_vector.hpp>
12#include <complex>
13#include <list>
14
15namespace Mantid {
16
17namespace Kernel {
18template <typename T> class Matrix;
19}
20
21namespace Geometry {
22//--------------------------------------
23// Forward declarations
24//--------------------------------------
25class Quadratic;
26class Cylinder;
27class Plane;
28class Sphere;
29
43class MANTID_GEOMETRY_DLL Line {
44public:
45 using PType = boost::container::small_vector<Kernel::V3D, 5>;
46
47 Line();
48 Line(const Kernel::V3D &, const Kernel::V3D &);
49 Line *clone() const;
50
51 Kernel::V3D getPoint(const double lambda) const;
52 const Kernel::V3D &getOrigin() const { return m_origin; }
53 const Kernel::V3D &getDirect() const { return m_direction; }
54 double distance(const Kernel::V3D &) const;
55 int isValid(const Kernel::V3D &) const;
56 void print() const;
57
58 void rotate(const Kernel::Matrix<double> &);
59 void displace(const Kernel::V3D &);
60
61 int setLine(const Kernel::V3D &,
62 const Kernel::V3D &);
63
64 int intersect(PType &, const Quadratic &) const;
65 int intersect(PType &, const Cylinder &) const;
66 int intersect(PType &, const Plane &) const;
67 int intersect(PType &, const Sphere &) const;
68
69private:
72
73 int lambdaPair(const int ix, const std::pair<std::complex<double>, std::complex<double>> &SQ, PType &PntOut) const;
74};
75
76} // namespace Geometry
77
78} // NAMESPACE Mantid
const std::vector< double > * lambda
Holds a cylinder as a vector form.
Definition: Cylinder.h:32
Impliments a line.
Definition: Line.h:43
const Kernel::V3D & getOrigin() const
returns the origin
Definition: Line.h:52
Kernel::V3D m_origin
Orign point (on plane)
Definition: Line.h:70
Kernel::V3D m_direction
Direction of outer surface (Unit Vector)
Definition: Line.h:71
boost::container::small_vector< Kernel::V3D, 5 > PType
Definition: Line.h:45
const Kernel::V3D & getDirect() const
returns the direction
Definition: Line.h:53
Holds a simple Plane.
Definition: Plane.h:35
Holds a basic quadratic surface.
Definition: Quadratic.h:29
Holds a Sphere as vector form.
Definition: Sphere.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.