CSGSphere creates an internal representation of a Constructive Solid Geometry (CSG) sphere, represented in the form (x - x0)^2 + (y - y0)^2 + (z - z0)^2 = r^2. More...
#include <CSGSphere.h>
Public Types | |
| enum | Halfspace { Halfspace::POSITIVE, Halfspace::NEGATIVE } |
| Enum for the sign of the half-space being represented by a point and surface. More... | |
Public Member Functions | |
| CSGSphere (const std::string &name, const Point ¢er, const Real r) | |
| Construct a new CSGSphere surface. More... | |
| CSGSphere (const std::string &name, const Real r) | |
| Construct a new CSGSphere surface. More... | |
| virtual | ~CSGSphere ()=default |
| Destructor. More... | |
| virtual std::unordered_map< std::string, Real > | getCoeffs () const override |
| Get the coefficients (x0, y0, z0, r) for the equation of a sphere (x - x0)^2 + (y - y0)^2 + (z - z0)^2 = r^2. More... | |
| virtual Real | evaluateSurfaceEquationAtPoint (const Point &p) const override |
| given a point, determine its evaluation based on the equation of the sphere More... | |
| const std::string & | getSurfaceType () const |
| Get the Surface Type. More... | |
| CSGSurface::Halfspace | getHalfspaceFromPoint (const Point &p) const |
| given a point, determine if it is in the positive or negative half-space for the surface More... | |
| const std::string & | getName () const |
| Get the name of surface. More... | |
| bool | operator== (const CSGSurface &other) const |
| Operator overload for checking if two CSGSurface objects are equal. More... | |
| bool | operator!= (const CSGSurface &other) const |
| Operator overload for checking if two CSGSurface objects are not equal. More... | |
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & | getTransformations () const |
| Get the list of transformations. More... | |
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > | getTransformationsAsStrings () const |
| Get the transformations of this object with string representations for types. More... | |
Static Public Member Functions | |
| static bool | isValidTransformationValue (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Check if the transformation value is valid for the given type. More... | |
| static std::string | getTransformationTypeString (TransformationType type) |
| Get the string representation of the transformation type. More... | |
Protected Member Functions | |
| virtual std::unique_ptr< CSGSurface > | clone () const override |
| create clone of CSGSphere object More... | |
| void | checkRadius () const |
| void | setName (const std::string &name) |
| void | addTransformation (TransformationType type, const std::tuple< Real, Real, Real > &values) |
| Add a transformation to the list of transformations. More... | |
| Point | applyReverseTransformsToPoint (Point p) const |
| update the value of point p by applying the inverse of the list of transformations to the point More... | |
| FRIEND_TEST (CSGSurfaceTest, testSetName) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testSurfaceEquality) | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithTransform) | |
| Friends for unit testing. More... | |
| FRIEND_TEST (CSGSurfaceTest, testHalfspaceWithNullTransform) | |
Protected Attributes | |
| Real | _x0 |
| Value of x0 in equation of sphere. More... | |
| Real | _y0 |
| Value of y0 in equation of sphere. More... | |
| Real | _z0 |
| Value of z0 in equation of sphere. More... | |
| Real | _r |
| Value of r in equation of sphere. More... | |
| std::string | _name |
| Name of surface. More... | |
| const std::string | _surface_type |
| Type of surface that is being represented string is taken directly from the surface class name. More... | |
| std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > | _transformations |
| List of transformations applied to this object. More... | |
CSGSphere creates an internal representation of a Constructive Solid Geometry (CSG) sphere, represented in the form (x - x0)^2 + (y - y0)^2 + (z - z0)^2 = r^2.
Definition at line 23 of file CSGSphere.h.
|
stronginherited |
Enum for the sign of the half-space being represented by a point and surface.
| Enumerator | |
|---|---|
| POSITIVE | |
| NEGATIVE | |
Definition at line 30 of file CSGSurface.h.
| CSG::CSGSphere::CSGSphere | ( | const std::string & | name, |
| const Point & | center, | ||
| const Real | r | ||
| ) |
Construct a new CSGSphere surface.
| name | unique name for the sphere surface |
| center | center point of sphere |
| r | radius of sphere |
Definition at line 15 of file CSGSphere.C.
| CSG::CSGSphere::CSGSphere | ( | const std::string & | name, |
| const Real | r | ||
| ) |
Construct a new CSGSphere surface.
| name | unique name for the sphere surface |
| r | radius of sphere |
Definition at line 25 of file CSGSphere.C.
|
virtualdefault |
Destructor.
|
protectedinherited |
Add a transformation to the list of transformations.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 16 of file CSGTransformationHelper.C.
|
protectedinherited |
update the value of point p by applying the inverse of the list of transformations to the point
| p | point to transform |
Definition at line 74 of file CSGTransformationHelper.C.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint().
|
protected |
Definition at line 50 of file CSGSphere.C.
Referenced by CSGSphere().
|
inlineoverrideprotectedvirtual |
create clone of CSGSphere object
Implements CSG::CSGSurface.
Definition at line 70 of file CSGSphere.h.
|
overridevirtual |
given a point, determine its evaluation based on the equation of the sphere
| p | point |
Implements CSG::CSGSurface.
Definition at line 39 of file CSGSphere.C.
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
protectedinherited |
Friends for unit testing.
|
protectedinherited |
|
overridevirtual |
Get the coefficients (x0, y0, z0, r) for the equation of a sphere (x - x0)^2 + (y - y0)^2 + (z - z0)^2 = r^2.
Implements CSG::CSGSurface.
Definition at line 32 of file CSGSphere.C.
|
inherited |
given a point, determine if it is in the positive or negative half-space for the surface
| p | point |
Definition at line 23 of file CSGSurface.C.
|
inlineinherited |
Get the name of surface.
Definition at line 95 of file CSGSurface.h.
Referenced by CSG::CSGSurfaceList::addSurface(), CSG::CSGBase::addTransformation(), CSG::CSGBase::checkSurfaceInBase(), CSG::CSGBase::deleteSurface(), CSG::CSGSurface::operator==(), and CSG::CSGSurfaceList::renameSurface().
|
inlineinherited |
Get the Surface Type.
Definition at line 61 of file CSGSurface.h.
Referenced by CSG::CSGSurface::operator==().
|
inlineinherited |
Get the list of transformations.
Definition at line 47 of file CSGTransformationHelper.h.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGUniverse::operator==(), CSG::CSGSurface::operator==(), CSG::CSGCell::operator==(), and CSG::CSGLattice::operator==().
|
inherited |
Get the transformations of this object with string representations for types.
Definition at line 65 of file CSGTransformationHelper.C.
|
staticinherited |
Get the string representation of the transformation type.
| type | The transformation type |
Definition at line 56 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
|
staticinherited |
Check if the transformation value is valid for the given type.
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 26 of file CSGTransformationHelper.C.
Referenced by CSG::CSGTransformationHelper::addTransformation().
|
inherited |
Operator overload for checking if two CSGSurface objects are not equal.
Definition at line 54 of file CSGSurface.C.
|
inherited |
Operator overload for checking if two CSGSurface objects are equal.
Definition at line 45 of file CSGSurface.C.
|
inlineprotectedinherited |
Definition at line 113 of file CSGSurface.h.
|
protectedinherited |
Name of surface.
Definition at line 116 of file CSGSurface.h.
Referenced by CSG::CSGXCylinder::clone(), CSG::CSGYCylinder::clone(), CSG::CSGZCylinder::clone(), clone(), CSG::CSGPlane::clone(), CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGSurface::getName(), and CSG::CSGSurface::setName().
|
protected |
Value of r in equation of sphere.
Definition at line 88 of file CSGSphere.h.
Referenced by checkRadius(), clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protectedinherited |
Type of surface that is being represented string is taken directly from the surface class name.
Definition at line 120 of file CSGSurface.h.
Referenced by CSG::CSGSurface::getSurfaceType().
|
protectedinherited |
List of transformations applied to this object.
Definition at line 92 of file CSGTransformationHelper.h.
Referenced by CSG::CSGTransformationHelper::addTransformation(), CSG::CSGTransformationHelper::applyReverseTransformsToPoint(), CSG::CSGTransformationHelper::getTransformations(), and CSG::CSGTransformationHelper::getTransformationsAsStrings().
|
protected |
Value of x0 in equation of sphere.
Definition at line 79 of file CSGSphere.h.
Referenced by clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protected |
Value of y0 in equation of sphere.
Definition at line 82 of file CSGSphere.h.
Referenced by clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protected |
Value of z0 in equation of sphere.
Definition at line 85 of file CSGSphere.h.
Referenced by clone(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
1.8.14