Mantid
|
Holds a cylinder as a vector form. More...
#include <Cylinder.h>
Public Member Functions | |
void | acceptVisitor (BaseVisit &A) const override |
Accept visitor for line calculation. More... | |
std::string | className () const override |
Public identifer. More... | |
std::unique_ptr< Cylinder > | clone () const |
Makes a clone (implicit virtual copy constructor) More... | |
Cylinder () | |
Standard Constructor creats a cylinder (radius 0) along the x axis. More... | |
double | distance (const Kernel::V3D &) const override |
Calculates the distance of point A from the surface of the cylinder. More... | |
void | getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override |
bounding box for the surface More... | |
Kernel::V3D | getCentre () const |
Return centre point. More... | |
Kernel::V3D | getNormal () const |
Return Central line. More... | |
double | getRadius () const |
Get Radius. More... | |
virtual double | lineIntersect (const Kernel::V3D &, const Kernel::V3D &) const |
Given a track starting from Pt and traveling along uVec determine the intersection point (distance) More... | |
bool | onSurface (const Kernel::V3D &) const override |
Calculate if the point PT on the cylinder. More... | |
void | print () const override |
Debug routine to print out basic information. More... | |
void | setBaseEqn () override |
Sets an equation of type (cylinder) More... | |
void | setCentre (const Kernel::V3D &) |
Sets the centre Kernel::V3D. More... | |
void | setNorm (const Kernel::V3D &) |
Sets the centre line unit vector A does not need to be a unit vector. More... | |
void | setRadius (const double &r) |
Set Radius. More... | |
int | setSurface (const std::string &) override |
Processes a standard MCNPX cone string Recall that cones can only be specified on an axis Valid input is: More... | |
int | side (const Kernel::V3D &) const override |
Calculate if the point PT within the middle of the cylinder. More... | |
void | write (std::ostream &) const override |
Write out the cylinder for MCNPX. 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 |
Static Public Attributes | |
static constexpr int | g_NSLICES = 10 |
The number of slices to approximate a cylinder. More... | |
static constexpr int | g_NSTACKS = 1 |
The number of stacks to approximate a cylinder. More... | |
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 Member Functions | |
Cylinder (const Cylinder &)=default | |
Cylinder & | operator= (const Cylinder &)=delete |
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 | |
void | displace (const Kernel::V3D &) override |
Apply a displacement Pt. More... | |
Cylinder * | doClone () const override |
Makes a clone (implicit virtual copy constructor) More... | |
void | rotate (const Kernel::Matrix< double > &) override |
Apply a rotation to the cylinder and re-check the status of the main axis. More... | |
void | setNormVec () |
check to obtain orientation More... | |
void | setRadiusInternal (const double &r) |
Private Attributes | |
Kernel::V3D | m_centre |
Kernel::V3D for centre. More... | |
Kernel::V3D | m_normal |
Direction of centre line. More... | |
std::size_t | m_normVec |
Normal vector is x,y or z :: (1-3) (0 if general) More... | |
double | m_oneoverradius |
double | m_radius |
Radius of cylinder. More... | |
Static Private Attributes | |
static Kernel::Logger & | PLog |
The official logger. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Mantid::Geometry::Quadratic | |
std::vector< double > | BaseEqn |
Base equation (as a 10 point vector) More... | |
Holds a cylinder as a vector form.
Defines a cylinder as a centre point (on main axis) a vector from that point (unit) and a radius.
Definition at line 32 of file Cylinder.h.
|
protecteddefault |
Mantid::Geometry::Cylinder::Cylinder | ( | ) |
Standard Constructor creats a cylinder (radius 0) along the x axis.
Definition at line 40 of file Cylinder.cpp.
References setBaseEqn().
Referenced by doClone().
|
inlineoverridevirtual |
Accept visitor for line calculation.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 63 of file Cylinder.h.
References Mantid::Geometry::BaseVisit::Accept().
|
inlineoverridevirtual |
Public identifer.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 57 of file Cylinder.h.
std::unique_ptr< Cylinder > Mantid::Geometry::Cylinder::clone | ( | ) | const |
Makes a clone (implicit virtual copy constructor)
Definition at line 60 of file Cylinder.cpp.
References doClone().
|
overrideprivatevirtual |
Apply a displacement Pt.
Pt | :: Displacement to add to the centre |
Implements Mantid::Geometry::Surface.
Definition at line 196 of file Cylinder.cpp.
References Mantid::Geometry::Quadratic::displace(), m_centre, and m_normVec.
|
overridevirtual |
Calculates the distance of point A from the surface of the cylinder.
A | :: Point to calculate distance from |
Implements Mantid::Geometry::Surface.
Definition at line 251 of file Cylinder.cpp.
References Mantid::Kernel::V3D::distance(), fabs, lambda, and Mantid::Kernel::V3D::scalar_prod().
|
overrideprivatevirtual |
Makes a clone (implicit virtual copy constructor)
Implements Mantid::Geometry::Quadratic.
Definition at line 51 of file Cylinder.cpp.
References Cylinder().
Referenced by clone().
|
overridevirtual |
bounding box for the surface
Cylinder bounding box find the intersection points of the axis of cylinder with the input bounding box. Using the end points calculate improved limits on the bounding box, if possible.
xmax | :: On input, existing Xmax bound, on exit possibly improved Xmax bound |
xmin | :: On input, existing Xmin bound, on exit possibly improved Xmin bound |
ymax | :: as for xmax |
ymin | :: as for xmin |
zmax | :: as for xmax |
zmin | :: as for xmin |
Implements Mantid::Geometry::Surface.
Definition at line 339 of file Cylinder.cpp.
|
inline |
Return centre point.
Definition at line 74 of file Cylinder.h.
|
inline |
Return Central line.
Definition at line 75 of file Cylinder.h.
|
inline |
Get Radius.
Definition at line 76 of file Cylinder.h.
|
virtual |
Given a track starting from Pt and traveling along uVec determine the intersection point (distance)
Pt | :: Point of track start |
uVec | :: Unit vector of length |
Distance | to intersect |
-1 | Failed to intersect |
Definition at line 313 of file Cylinder.cpp.
|
overridevirtual |
Calculate if the point PT on the cylinder.
Pt | :: Kernel::V3D to test |
Implements Mantid::Geometry::Surface.
Definition at line 149 of file Cylinder.cpp.
References Mantid::Geometry::Quadratic::onSurface(), Mantid::Kernel::Tolerance, Mantid::Geometry::x, and Mantid::Geometry::y.
|
overridevirtual |
Debug routine to print out basic information.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 328 of file Cylinder.cpp.
References m_centre, m_normal, m_radius, and Mantid::Geometry::Quadratic::print().
|
overrideprivatevirtual |
Apply a rotation to the cylinder and re-check the status of the main axis.
MA | :: Rotation Matrix (not inverted) |
Implements Mantid::Geometry::Surface.
Definition at line 182 of file Cylinder.cpp.
References m_centre, m_normal, Mantid::Kernel::V3D::normalize(), Mantid::Geometry::Quadratic::rotate(), Mantid::Kernel::V3D::rotate(), and setNormVec().
|
overridevirtual |
Sets an equation of type (cylinder)
\[ Ax^2+By^2+Cz^2+Dxy+Exz+Fyz+Gx+Hy+Jz+K=0 \]
Implements Mantid::Geometry::Quadratic.
Definition at line 232 of file Cylinder.cpp.
References Mantid::Geometry::Quadratic::BaseEqn, m_centre, m_normal, m_radius, and Mantid::Kernel::V3D::scalar_prod().
Referenced by Cylinder(), setCentre(), setNorm(), and setSurface().
void Mantid::Geometry::Cylinder::setCentre | ( | const Kernel::V3D & | A | ) |
Sets the centre Kernel::V3D.
A | :: centre point |
Definition at line 210 of file Cylinder.cpp.
References m_centre, and setBaseEqn().
void Mantid::Geometry::Cylinder::setNorm | ( | const Kernel::V3D & | A | ) |
Sets the centre line unit vector A does not need to be a unit vector.
A | :: Vector along the centre line |
Definition at line 220 of file Cylinder.cpp.
References m_normal, Mantid::Kernel::normalize(), setBaseEqn(), and setNormVec().
|
private |
check to obtain orientation
Find if the normal vector allows it to be a special type of cylinder on the x,y or z axis.
Definition at line 166 of file Cylinder.cpp.
References fabs, m_normal, m_normVec, and Mantid::Kernel::Tolerance.
|
inline |
Set Radius.
Definition at line 78 of file Cylinder.h.
|
inlineprivate |
Definition at line 46 of file Cylinder.h.
Referenced by setSurface().
|
overridevirtual |
Processes a standard MCNPX cone string Recall that cones can only be specified on an axis Valid input is:
Pstr | :: Input string |
Implements Mantid::Geometry::Surface.
Definition at line 69 of file Cylinder.cpp.
References index, m_centre, m_normal, m_normVec, Mantid::Kernel::Strings::section(), setBaseEqn(), and setRadiusInternal().
|
overridevirtual |
Calculate if the point PT within the middle of the cylinder.
Pt | :: Point to check |
-1 | :: within cylinder |
1 | :: outside the cylinder |
0 | :: on the surface |
Reimplemented from Mantid::Geometry::Surface.
Definition at line 121 of file Cylinder.cpp.
References fabs, Mantid::Geometry::Quadratic::side(), Mantid::Kernel::Tolerance, Mantid::Geometry::x, and Mantid::Geometry::y.
|
overridevirtual |
Write out the cylinder for MCNPX.
OX | :: output stream |
Reimplemented from Mantid::Geometry::Surface.
Definition at line 270 of file Cylinder.cpp.
References Mantid::Geometry::Surface::Nprecision, Mantid::Kernel::Tolerance, Mantid::Geometry::Quadratic::write(), and Mantid::Kernel::Strings::writeMCNPX().
|
staticconstexpr |
The number of slices to approximate a cylinder.
Definition at line 89 of file Cylinder.h.
|
staticconstexpr |
The number of stacks to approximate a cylinder.
Definition at line 91 of file Cylinder.h.
|
private |
Kernel::V3D for centre.
Definition at line 36 of file Cylinder.h.
Referenced by displace(), getBoundingBox(), print(), rotate(), setBaseEqn(), setCentre(), and setSurface().
|
private |
Direction of centre line.
Definition at line 37 of file Cylinder.h.
Referenced by getBoundingBox(), print(), rotate(), setBaseEqn(), setNorm(), setNormVec(), and setSurface().
|
private |
Normal vector is x,y or z :: (1-3) (0 if general)
Definition at line 38 of file Cylinder.h.
Referenced by displace(), setNormVec(), and setSurface().
|
private |
Definition at line 39 of file Cylinder.h.
|
private |
Radius of cylinder.
Definition at line 40 of file Cylinder.h.
Referenced by getBoundingBox(), print(), and setBaseEqn().
|
staticprivate |
The official logger.
Definition at line 34 of file Cylinder.h.