|
Mantid
|
#include <Plane.h>
Public Member Functions | |
| void | acceptVisitor (BaseVisit &A) const override |
| Accept visitor for line calculation. More... | |
| std::string | className () const override |
| Effective typename. More... | |
| std::unique_ptr< Plane > | clone () const |
| Makes a clone (implicit virtual copy constructor) More... | |
| Kernel::V3D | crossProd (const Plane &) const |
| returns normal cross product More... | |
| void | displace (const Kernel::V3D &) override |
| Displace the plane by Point Sp. More... | |
| double | distance (const Kernel::V3D &) const override |
| distance from a point More... | |
| double | dotProd (const Plane &) const |
| returns normal dot product More... | |
| void | getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override |
| Returns the bounding box values for plane, double max is infinity and double min is -infinity A very crude way of finding the bounding box but its very fast. More... | |
| double | getDistance () const |
| Distance from origin. More... | |
| const Kernel::V3D & | getNormal () const |
| Normal to plane (+ve surface) More... | |
| int | LineIntersectionWithPlane (Kernel::V3D startpt, Kernel::V3D endpt, Kernel::V3D &output) |
| Returns the point of intersection of line with the plane. More... | |
| bool | onSurface (const Kernel::V3D &) const override |
| Calcuate the side that the point is on and returns success if it is on the surface. More... | |
| Plane () | |
| Constructor: sets plane in y-z plane and throught origin. More... | |
| void | print () const override |
| Prints out the surface info and the Plane info. More... | |
| void | rotate (const Kernel::Matrix< double > &) override |
| Rotate the plane about the origin by MA. More... | |
| void | setBaseEqn () override |
| set up to be eqn based More... | |
| int | setPlane (const Kernel::V3D &, const Kernel::V3D &) |
| Given a point and a normal direction set the plane. More... | |
| int | setSurface (const std::string &) override |
| processes a standard MCNPX plane string: There are three types : More... | |
| int | side (const Kernel::V3D &) const override |
| Calcualates the side that the point is on. More... | |
| void | write (std::ostream &) const override |
| Write in MCNPX form. More... | |
Public Member Functions inherited from Mantid::Geometry::Quadratic | |
| 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 |
Protected Member Functions | |
| Plane & | operator= (const Plane &)=delete |
| Plane (const Plane &)=default | |
Protected Member Functions inherited from Mantid::Geometry::Quadratic | |
| Quadratic & | operator= (const Quadratic &)=delete |
| Quadratic (const Quadratic &)=default | |
Protected Member Functions inherited from Mantid::Geometry::Surface | |
| Surface (const Surface &)=default | |
Private Member Functions | |
| Plane * | doClone () const override |
| Makes a clone (implicit virtual copy constructor) More... | |
| std::size_t | planeType () const |
| are we alined on an axis More... | |
Private Attributes | |
| double | m_distance |
| Distance from origin. More... | |
| Kernel::V3D | m_normVec |
| Normal vector. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Mantid::Geometry::Quadratic | |
| 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 Attributes inherited from Mantid::Geometry::Quadratic | |
| std::vector< double > | BaseEqn |
| Base equation (as a 10 point vector) More... | |
Holds a simple Plane.
Defines a plane and a normal and a distance from the origin
|
protecteddefault |
| Mantid::Geometry::Plane::Plane | ( | ) |
Constructor: sets plane in y-z plane and throught origin.
Definition at line 45 of file Plane.cpp.
References setBaseEqn().
Referenced by doClone().
|
inlineoverridevirtual |
Accept visitor for line calculation.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 54 of file Plane.h.
References Mantid::Geometry::BaseVisit::Accept().
|
inlineoverridevirtual |
Effective typename.
Reimplemented from Mantid::Geometry::Surface.
| std::unique_ptr< Plane > Mantid::Geometry::Plane::clone | ( | ) | const |
| Kernel::V3D Mantid::Geometry::Plane::crossProd | ( | const Plane & | A | ) | const |
returns normal cross product
Take the cross produce of the normals.
| A | :: plane to calculate the cross product from |
Definition at line 194 of file Plane.cpp.
References Mantid::Kernel::V3D::cross_prod().
|
overridevirtual |
Displace the plane by Point Sp.
i.e. r+sp now on the plane
| Sp | :: point value of displacement |
Implements Mantid::Geometry::Surface.
Definition at line 163 of file Plane.cpp.
References Mantid::Geometry::Quadratic::displace(), m_distance, m_normVec, and Mantid::Kernel::V3D::scalar_prod().
|
overridevirtual |
distance from a point
Determine the distance of point A from the plane returns a value relative to the normal.
| A | :: point to get distance from |
Implements Mantid::Geometry::Surface.
|
overrideprivatevirtual |
Makes a clone (implicit virtual copy constructor)
Implements Mantid::Geometry::Quadratic.
Definition at line 54 of file Plane.cpp.
References Plane().
Referenced by clone().
| double Mantid::Geometry::Plane::dotProd | ( | const Plane & | A | ) | const |
|
overridevirtual |
Returns the bounding box values for plane, double max is infinity and double min is -infinity A very crude way of finding the bounding box but its very fast.
| xmax | :: input & output maximum value in x direction |
| ymax | :: input & output maximum value in y direction |
| zmax | :: input & output maximum value in z direction |
| xmin | :: input & output minimum value in x direction |
| ymin | :: input & output minimum value in y direction |
| zmin | :: input & output minimum value in z direction |
Implements Mantid::Geometry::Surface.
Definition at line 327 of file Plane.cpp.
References LineIntersectionWithPlane(), and side().
|
inline |
|
inline |
Normal to plane (+ve surface)
Definition at line 66 of file Plane.h.
Referenced by LineIntersectionWithPlane().
| int Mantid::Geometry::Plane::LineIntersectionWithPlane | ( | Kernel::V3D | startpt, |
| Kernel::V3D | endpt, | ||
| Kernel::V3D & | output | ||
| ) |
Returns the point of intersection of line with the plane.
| startpt | :: input start point of the line |
| endpt | :: input end point of the line |
| output | :: output point of intersection |
Definition at line 299 of file Plane.cpp.
References getNormal(), m_distance, m_normVec, and Mantid::Kernel::V3D::scalar_prod().
Referenced by getBoundingBox().
|
overridevirtual |
Calcuate the side that the point is on and returns success if it is on the surface.
Implements Mantid::Geometry::Surface.
|
private |
are we alined on an axis
Find if the normal vector allows it to be a special type of plane (x,y,z direction) (Assumes m_normVec is a unit vector)
| 1-3 | :: on the x,y,z axis |
| 0 | :: general plane |
Definition at line 239 of file Plane.cpp.
References fabs, m_normVec, and Mantid::Kernel::Tolerance.
Referenced by write().
|
overridevirtual |
Prints out the surface info and the Plane info.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 229 of file Plane.cpp.
References m_distance, m_normVec, and Mantid::Geometry::Quadratic::print().
|
overridevirtual |
Rotate the plane about the origin by MA.
| MA | :: direct rotation matrix (3x3) |
Implements Mantid::Geometry::Surface.
Definition at line 152 of file Plane.cpp.
References m_normVec, Mantid::Kernel::V3D::normalize(), Mantid::Geometry::Quadratic::rotate(), and Mantid::Kernel::V3D::rotate().
|
overridevirtual |
set up to be eqn based
Sets the general equation for a plane.
Implements Mantid::Geometry::Quadratic.
Definition at line 257 of file Plane.cpp.
References Mantid::Geometry::Quadratic::BaseEqn, m_distance, and m_normVec.
Referenced by Plane(), setPlane(), and setSurface().
| int Mantid::Geometry::Plane::setPlane | ( | const Kernel::V3D & | P, |
| const Kernel::V3D & | N | ||
| ) |
Given a point and a normal direction set the plane.
| P | :: Point for plane to pass thought |
| N | :: Normal for the plane |
| 0 | :: success |
Definition at line 134 of file Plane.cpp.
References m_distance, m_normVec, Mantid::Kernel::normalize(), Mantid::Kernel::V3D::scalar_prod(), and setBaseEqn().
|
overridevirtual |
processes a standard MCNPX plane string: There are three types :
| Pstr | :: String to make into a plane of type p{xyz} or p |
Implements Mantid::Geometry::Surface.
Definition at line 72 of file Plane.cpp.
References Mantid::Kernel::Strings::convert(), m_distance, m_normVec, Mantid::Kernel::V3D::normalize(), Mantid::Kernel::V3D::scalar_prod(), Mantid::Kernel::Strings::section(), setBaseEqn(), and Mantid::Kernel::Tolerance.
|
overridevirtual |
Calcualates the side that the point is on.
| A | :: test point |
| +ve | :: on the same side as the normal |
| -ve | :: the opposite side |
| 0 | :: A is on the plane itself (within tolerence) |
Reimplemented from Mantid::Geometry::Surface.
Definition at line 204 of file Plane.cpp.
References Mantid::Kernel::Tolerance.
Referenced by getBoundingBox().
|
overridevirtual |
Write in MCNPX form.
Object of write is to output a MCNPX plane info.
| OX | :: Output stream (required for multiple std::endl) |
Reimplemented from Mantid::Geometry::Surface.
Definition at line 275 of file Plane.cpp.
References m_distance, m_normVec, Mantid::Geometry::Surface::Nprecision, planeType(), Mantid::Geometry::Surface::writeHeader(), and Mantid::Kernel::Strings::writeMCNPX().
|
private |
Distance from origin.
Definition at line 38 of file Plane.h.
Referenced by displace(), LineIntersectionWithPlane(), print(), setBaseEqn(), setPlane(), setSurface(), and write().
|
private |
Normal vector.
Definition at line 37 of file Plane.h.
Referenced by displace(), LineIntersectionWithPlane(), planeType(), print(), rotate(), setBaseEqn(), setPlane(), setSurface(), and write().