Mantid
|
Holds a basic quadratic surface. More...
#include <Quadratic.h>
Public Member Functions | |
void | acceptVisitor (BaseVisit &A) const override |
Accept visitor for line calculation. More... | |
std::string | className () const override |
Effective typeid. More... | |
std::unique_ptr< Quadratic > | clone () const |
const std::vector< double > & | copyBaseEqn () const |
access BaseEquation vector More... | |
void | displace (const Kernel::V3D &) override |
Apply a general displacement to the surface. More... | |
double | distance (const Kernel::V3D &) const override |
distance between point and surface (approx) More... | |
double | eqnValue (const Kernel::V3D &) const |
Helper function to calcuate the value of the equation at a fixed point. More... | |
bool | onSurface (const Kernel::V3D &) const override |
is point valid on surface More... | |
void | print () const override |
Print out the genreal equation for debugging. More... | |
Quadratic () | |
Constructor. More... | |
void | rotate (const Kernel::Matrix< double > &) override |
Rotate the surface by matrix MX. More... | |
virtual void | setBaseEqn ()=0 |
Abstract set baseEqn. More... | |
int | side (const Kernel::V3D &) const override |
Determine if the the Point is true to the surface or on the other side. More... | |
Kernel::V3D | surfaceNormal (const Kernel::V3D &) const override |
Normal at surface. More... | |
void | write (std::ostream &) const override |
Writes out an MCNPX surface description Note : Swap since base equation is swapped in gq output (mcnp 4c manual pg. More... | |
Public Member Functions inherited from Mantid::Geometry::Surface | |
virtual void | acceptVisitor (BaseVisit &A) const |
Accept visitor for line calculation. More... | |
virtual std::string | className () const |
Effective typeid. More... | |
std::unique_ptr< Surface > | clone () const |
virtual void | displace (const Kernel::V3D &)=0 |
translates the surface More... | |
virtual double | distance (const Kernel::V3D &) const =0 |
returns the minimum distance to the surface More... | |
virtual void | getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin)=0 |
bounding box for the surface More... | |
int | getName () const |
Get Name. More... | |
virtual bool | onSurface (const Kernel::V3D &R) const =0 |
is point valid on surface More... | |
Surface & | operator= (const Surface &)=delete |
virtual void | print () const |
Simple print out function for surface header. More... | |
virtual void | rotate (const Kernel::Matrix< double > &)=0 |
rotates the surface More... | |
void | setName (int const N) |
Set Name. More... | |
virtual int | setSurface (const std::string &R)=0 |
Sets the surface based on a string input in MCNPX format. More... | |
virtual int | side (const Kernel::V3D &) const |
Surface side : throw AbsObjMethod. More... | |
Surface () | |
Constructor. More... | |
virtual Kernel::V3D | surfaceNormal (const Kernel::V3D &) const =0 |
returns the normal to the closest point on the surface More... | |
virtual void | write (std::ostream &) const |
The writes the data to the output stream. More... | |
void | writeHeader (std::ostream &) const |
Writes out the start of an MCNPX surface description . More... | |
virtual | ~Surface ()=default |
Static Public Attributes | |
static const int | Nprecision = 10 |
Precision of the output. More... | |
Static Public Attributes inherited from Mantid::Geometry::Surface | |
static const int | Nprecision = 10 |
Precision of the output. More... | |
Protected Member Functions | |
Quadratic & | operator= (const Quadratic &)=delete |
Quadratic (const Quadratic &)=default | |
Protected Member Functions inherited from Mantid::Geometry::Surface | |
Surface (const Surface &)=default | |
Protected Attributes | |
std::vector< double > | BaseEqn |
Base equation (as a 10 point vector) More... | |
Private Member Functions | |
Quadratic * | doClone () const override=0 |
Abstract clone function. More... | |
void | matrixForm (Kernel::Matrix< double > &, Kernel::V3D &, double &) const |
Converts the baseEqn into the matrix form such that. More... | |
Holds a basic quadratic surface.
Holds a basic surface with equation form
\[ Ax^2+By^2+Cz^2+Dxy+Exz+Fyz+Gx+Hy+Jz+K=0 \]
Definition at line 29 of file Quadratic.h.
|
protecteddefault |
Mantid::Geometry::Quadratic::Quadratic | ( | ) |
Constructor.
Definition at line 38 of file Quadratic.cpp.
|
inlineoverridevirtual |
Accept visitor for line calculation.
Reimplemented from Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 46 of file Quadratic.h.
References Mantid::Geometry::BaseVisit::Accept().
|
inlineoverridevirtual |
Effective typeid.
Reimplemented from Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 49 of file Quadratic.h.
std::unique_ptr< Quadratic > Mantid::Geometry::Quadratic::clone | ( | ) | const |
Definition at line 331 of file Quadratic.cpp.
References doClone().
|
inline |
access BaseEquation vector
Definition at line 51 of file Quadratic.h.
|
overridevirtual |
Apply a general displacement to the surface.
Pt | :: Point to add to surface coordinate |
Implements Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 244 of file Quadratic.cpp.
References BaseEqn.
Referenced by Mantid::Geometry::Cylinder::displace(), Mantid::Geometry::Plane::displace(), and Mantid::Geometry::Sphere::displace().
|
overridevirtual |
distance between point and surface (approx)
Proper calcuation of a point to a general surface.
Pt | :: Point to calculate distance from surace |
Implements Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 123 of file Quadratic.cpp.
References Mantid::Kernel::Matrix< T >::Diagonalise(), Mantid::Kernel::V3D::distance(), Mantid::mathLevel::PolyBase::realRoots(), Mantid::Kernel::Tolerance, and Mantid::Kernel::Matrix< T >::Tprime().
|
overrideprivatepure virtual |
Abstract clone function.
Implements Mantid::Geometry::Surface.
Implemented in Mantid::Geometry::Cone, Mantid::Geometry::Cylinder, Mantid::Geometry::General, Mantid::Geometry::Plane, and Mantid::Geometry::Sphere.
Referenced by clone().
double Mantid::Geometry::Quadratic::eqnValue | ( | const Kernel::V3D & | Pt | ) | const |
Helper function to calcuate the value of the equation at a fixed point.
Pt | :: Point to determine the equation surface value at |
Definition at line 45 of file Quadratic.cpp.
|
private |
Converts the baseEqn into the matrix form such that.
\[ x^T A x + B^T x + C =0 \]
A | :: Matrix to place equation into |
B | :: Vector point |
C | :: Constant value |
Definition at line 101 of file Quadratic.cpp.
|
overridevirtual |
is point valid on surface
Test to see if a point is on the surface.
Pt | :: Point to test |
Implements Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 233 of file Quadratic.cpp.
References Mantid::Kernel::Tolerance.
Referenced by Mantid::Geometry::Cylinder::onSurface().
|
overridevirtual |
Print out the genreal equation for debugging.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 298 of file Quadratic.cpp.
References BaseEqn, and Mantid::Geometry::Surface::print().
Referenced by Mantid::Geometry::Cylinder::print(), and Mantid::Geometry::Plane::print().
|
overridevirtual |
Rotate the surface by matrix MX.
MX | :: Matrix for rotation (not inverted like MCNPX) |
Implements Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 258 of file Quadratic.cpp.
References BaseEqn, Mantid::Geometry::d, and Mantid::Kernel::Matrix< T >::Invert().
Referenced by Mantid::Geometry::Cylinder::rotate(), Mantid::Geometry::Plane::rotate(), and Mantid::Geometry::Sphere::rotate().
|
pure virtual |
Abstract set baseEqn.
Implemented in Mantid::Geometry::Cone, Mantid::Geometry::Cylinder, Mantid::Geometry::General, Mantid::Geometry::Plane, and Mantid::Geometry::Sphere.
|
overridevirtual |
Determine if the the Point is true to the surface or on the other side.
Pt | :: Point to check |
1 | : if the point is "true" to the surface |
-1 | : if the point is "false" to the surface |
0 | :: The point is on the surface |
Reimplemented from Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 68 of file Quadratic.cpp.
References fabs, and Mantid::Kernel::Tolerance.
Referenced by Mantid::Geometry::Cylinder::side().
|
overridevirtual |
Normal at surface.
Given a point on the surface Calculate the normal at the point Some rather disturbing behaviour happens if the point is a significant distance from the surface.
Pt | :: Point to calcution |
Implements Mantid::Geometry::Surface.
Definition at line 84 of file Quadratic.cpp.
References Mantid::Kernel::V3D::normalize().
|
overridevirtual |
Writes out an MCNPX surface description Note : Swap since base equation is swapped in gq output (mcnp 4c manual pg.
3-14)
OX | :: Output stream (required for multiple std::endl) |
Reimplemented from Mantid::Geometry::Surface.
Reimplemented in Mantid::Geometry::Sphere.
Definition at line 310 of file Quadratic.cpp.
References Mantid::Geometry::Surface::Nprecision, and Mantid::Kernel::Strings::writeMCNPX().
Referenced by Mantid::Geometry::Cone::write(), and Mantid::Geometry::Cylinder::write().
|
protected |
Base equation (as a 10 point vector)
Definition at line 35 of file Quadratic.h.
Referenced by displace(), print(), rotate(), Mantid::Geometry::Cone::setBaseEqn(), Mantid::Geometry::Cylinder::setBaseEqn(), Mantid::Geometry::Plane::setBaseEqn(), Mantid::Geometry::Sphere::setBaseEqn(), and Mantid::Geometry::General::setSurface().
|
static |
Precision of the output.
Definition at line 40 of file Quadratic.h.