Mantid
|
Holds a torus in vector form. More...
#include <Torus.h>
Public Member Functions | |
void | acceptVisitor (BaseVisit &A) const override |
Accept visitor for line calculation. More... | |
std::string | className () const override |
Public identifier. More... | |
std::unique_ptr< Torus > | clone () const |
Makes a clone (implicit virtual copy constructor) More... | |
double | distance (const Kernel::V3D &Pt) const override |
Calculates the distance from the point to the Torus does not calculate the point on the Torus that is closest. More... | |
void | getBoundingBox (double &xmax, double &ymax, double &zmax, double &xmin, double &ymin, double &zmin) override |
SGenerates a bounding box for the Torus. More... | |
Kernel::V3D | getCentre () const |
Return centre point. More... | |
Kernel::V3D | getNormal () const |
Central normal. More... | |
bool | onSurface (const Kernel::V3D &R) const override |
is point valid on surface More... | |
int | operator== (const Torus &) const |
Equality operator. More... | |
void | setCentre (const Kernel::V3D &A) |
Sets the central point and the Base Equation. More... | |
void | setDistanceFromCentreToTube (double dist) |
Suppose to set the distance from centre of the torus to the centre of tube. More... | |
void | setNorm (const Kernel::V3D &A) |
Sets the Normal and the Base Equation. More... | |
int | setSurface (const std::string &Pstr) override |
Processes a standard MCNPX cone string Recall that cones can only be specified on an axis Valid input is: More... | |
void | setTubeRadius (double dist) |
Suppose to set the radius of the tube which makes up the torus TODO: More... | |
int | side (const Kernel::V3D &R) const override |
Calculate if the point R is within the torus (return -1) or outside, (return 1) More... | |
Kernel::V3D | surfaceNormal (const Kernel::V3D &Pt) const override |
Get the normal at a point. More... | |
Torus () | |
Constructor with centre line along X axis and centre on origin. More... | |
void | write (std::ostream &OX) const override |
Write out the cone class in an mcnpx format. 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 | |
Torus & | operator= (const Torus &)=delete |
Torus (const Torus &)=default | |
Protected Member Functions inherited from Mantid::Geometry::Surface | |
Surface (const Surface &)=default | |
Private Member Functions | |
void | displace (const Kernel::V3D &) override |
Displace the centre Only need to update the centre position. More... | |
Torus * | doClone () const override |
Makes a clone (implicit virtual copy constructor) More... | |
void | rotate (const Kernel::Matrix< double > &) override |
Rotate both the centre and the normal direction. More... | |
Private Attributes | |
Kernel::V3D | Centre |
Geometry::Vec3D for centre. More... | |
double | Displacement |
Displacement. More... | |
double | Dradius |
Inner radius. More... | |
double | Iradius |
Inner radius. More... | |
Kernel::V3D | Normal |
Normal. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Mantid::Geometry::Surface | |
static const int | Nprecision = 10 |
Precision of the output. More... | |
Holds a torus in vector form.
Defines a Torus as a centre, normal and three parameters:
|
protecteddefault |
Mantid::Geometry::Torus::Torus | ( | ) |
|
inlineoverridevirtual |
Accept visitor for line calculation.
Reimplemented from Mantid::Geometry::Surface.
Definition at line 55 of file Torus.h.
References Mantid::Geometry::BaseVisit::Accept().
|
inlineoverridevirtual |
Public identifier.
Reimplemented from Mantid::Geometry::Surface.
std::unique_ptr< Torus > Mantid::Geometry::Torus::clone | ( | ) | const |
|
overrideprivatevirtual |
Displace the centre Only need to update the centre position.
A | :: Point to add |
Implements Mantid::Geometry::Surface.
Definition at line 174 of file Torus.cpp.
References Centre.
|
overridevirtual |
Calculates the distance from the point to the Torus does not calculate the point on the Torus that is closest.
Pt | :: Point to calcuate from |
Implements Mantid::Geometry::Surface.
Definition at line 217 of file Torus.cpp.
References Mantid::Kernel::V3D::norm(), and Mantid::Kernel::Tolerance.
|
overrideprivatevirtual |
Makes a clone (implicit virtual copy constructor)
Implements Mantid::Geometry::Surface.
Definition at line 59 of file Torus.cpp.
References Torus().
Referenced by clone().
|
overridevirtual |
SGenerates a bounding box for the Torus.
xmax | :: the X max value |
ymax | :: the Y max value |
zmax | :: the Z max value |
xmin | :: the X min value |
ymin | :: the Y min value |
zmin | :: the Z min value |
TODO:
Implements Mantid::Geometry::Surface.
Definition at line 302 of file Torus.cpp.
References UNUSED_ARG, and Mantid::Kernel::Logger::warning().
|
inline |
|
inline |
|
overridevirtual |
is point valid on surface
Calculate if the point R is on the cone (Note: have to be careful here since angle calcuation calcuates an angle. We need a distance for tolerance!)
R | :: Point to check |
Implements Mantid::Geometry::Surface.
Definition at line 253 of file Torus.cpp.
References UNUSED_ARG.
int Mantid::Geometry::Torus::operator== | ( | const Torus & | A | ) | const |
Equality operator.
Checks angle,centre and normal separately
A | :: Torus to compare |
Definition at line 77 of file Torus.cpp.
References fabs, and Mantid::Kernel::Tolerance.
|
overrideprivatevirtual |
Rotate both the centre and the normal direction.
R | :: Matrix for rotation. |
Implements Mantid::Geometry::Surface.
Definition at line 164 of file Torus.cpp.
References Centre, Normal, and Mantid::Kernel::V3D::rotate().
void Mantid::Geometry::Torus::setCentre | ( | const Kernel::V3D & | A | ) |
void Mantid::Geometry::Torus::setDistanceFromCentreToTube | ( | double | dist | ) |
void Mantid::Geometry::Torus::setNorm | ( | const Kernel::V3D & | A | ) |
Sets the Normal and the Base Equation.
A | :: New Normal direction |
Definition at line 193 of file Torus.cpp.
References Mantid::Kernel::V3D::norm(), Normal, and Mantid::Kernel::Tolerance.
|
overridevirtual |
Processes a standard MCNPX cone string Recall that cones can only be specified on an axis Valid input is:
Pstr | :: String to process |
Implements Mantid::Geometry::Surface.
Definition at line 127 of file Torus.cpp.
References Centre, Displacement, Dradius, Iradius, Mantid::Kernel::Strings::section(), and Mantid::Geometry::sectionV3D().
void Mantid::Geometry::Torus::setTubeRadius | ( | double | dist | ) |
|
overridevirtual |
Calculate if the point R is within the torus (return -1) or outside, (return 1)
R | :: Point to determine if in/out of cone |
Reimplemented from Mantid::Geometry::Surface.
Definition at line 236 of file Torus.cpp.
References UNUSED_ARG.
|
overridevirtual |
Get the normal at a point.
Pt | :: The Point of interest |
Implements Mantid::Geometry::Surface.
Definition at line 205 of file Torus.cpp.
References UNUSED_ARG.
|
overridevirtual |
Write out the cone class in an mcnpx format.
OX | :: Output Stream (required for multiple std::endl) |
Reimplemented from Mantid::Geometry::Surface.
Definition at line 270 of file Torus.cpp.
References Mantid::Geometry::Surface::Nprecision, Mantid::Kernel::Tolerance, Mantid::Geometry::Surface::write(), Mantid::Geometry::Surface::writeHeader(), and Mantid::Kernel::Strings::writeMCNPX().
|
private |
Geometry::Vec3D for centre.
Definition at line 32 of file Torus.h.
Referenced by displace(), rotate(), setCentre(), and setSurface().
|
private |
|
private |
Inner radius.
Definition at line 35 of file Torus.h.
Referenced by setSurface(), and setTubeRadius().
|
private |
Inner radius.
Definition at line 34 of file Torus.h.
Referenced by setDistanceFromCentreToTube(), and setSurface().
|
private |