Mantid
Loading...
Searching...
No Matches
Quadratic.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 <vector>
12
13namespace Mantid {
14
15namespace Geometry {
16
29class MANTID_GEOMETRY_DLL Quadratic : public Surface {
30private:
31 void matrixForm(Kernel::Matrix<double> &, Kernel::V3D &, double &) const;
32 Quadratic *doClone() const override = 0;
33
34protected:
35 std::vector<double> BaseEqn;
36 Quadratic(const Quadratic &) = default;
37 Quadratic &operator=(const Quadratic &) = delete;
38
39public:
40 static const int Nprecision = 10;
41
42 Quadratic();
43 std::unique_ptr<Quadratic> clone() const;
44
46 void acceptVisitor(BaseVisit &A) const override { A.Accept(*this); }
47
49 std::string className() const override { return "Quadratic"; }
50
51 const std::vector<double> &copyBaseEqn() const { return BaseEqn; }
52
53 int side(const Kernel::V3D &) const override;
54
55 virtual void setBaseEqn() = 0;
56 double eqnValue(const Kernel::V3D &) const;
57
58 bool onSurface(const Kernel::V3D &) const override;
59 double distance(const Kernel::V3D &) const override;
60 Kernel::V3D surfaceNormal(const Kernel::V3D &) const override;
61
62 void displace(const Kernel::V3D &) override;
63 void rotate(const Kernel::Matrix<double> &) override;
64
65 void write(std::ostream &) const override;
66 void print() const override;
67};
68
69} // NAMESPACE Geometry
70
71} // namespace Mantid
virtual void Accept(const Surface &)=0
Accept a surface.
Holds a basic quadratic surface.
Definition: Quadratic.h:29
Quadratic(const Quadratic &)=default
std::string className() const override
Effective typeid.
Definition: Quadratic.h:49
const std::vector< double > & copyBaseEqn() const
access BaseEquation vector
Definition: Quadratic.h:51
std::vector< double > BaseEqn
Base equation (as a 10 point vector)
Definition: Quadratic.h:35
virtual void setBaseEqn()=0
Abstract set baseEqn.
void acceptVisitor(BaseVisit &A) const override
Accept visitor for line calculation.
Definition: Quadratic.h:46
Quadratic & operator=(const Quadratic &)=delete
Quadratic * doClone() const override=0
Abstract clone function.
Holds a basic quadratic surface.
Definition: Surface.h:33
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.