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... | |
Protected Member Functions | |
| void | checkRadius () const |
| void | setName (const std::string &name) |
| FRIEND_TEST (CSGSurfaceTest, testSetName) | |
| Friends for unit testing. More... | |
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... | |
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.
|
protected |
Definition at line 50 of file CSGSphere.C.
Referenced by CSGSphere().
|
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.
|
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 21 of file CSGSurface.C.
|
inlineinherited |
Get the name of surface.
Definition at line 95 of file CSGSurface.h.
Referenced by CSG::CSGSurfaceList::addSurface(), CSG::CSGRegion::CSGRegion(), 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==().
|
inherited |
Operator overload for checking if two CSGSurface objects are not equal.
Definition at line 45 of file CSGSurface.C.
|
inherited |
Operator overload for checking if two CSGSurface objects are equal.
Definition at line 37 of file CSGSurface.C.
|
inlineprotectedinherited |
Definition at line 106 of file CSGSurface.h.
|
protectedinherited |
Name of surface.
Definition at line 109 of file CSGSurface.h.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint(), CSG::CSGSurface::getName(), and CSG::CSGSurface::setName().
|
protected |
Value of r in equation of sphere.
Definition at line 78 of file CSGSphere.h.
Referenced by checkRadius(), evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protectedinherited |
Type of surface that is being represented string is taken directly from the surface class name.
Definition at line 113 of file CSGSurface.h.
Referenced by CSG::CSGSurface::getSurfaceType().
|
protected |
Value of x0 in equation of sphere.
Definition at line 69 of file CSGSphere.h.
Referenced by evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protected |
Value of y0 in equation of sphere.
Definition at line 72 of file CSGSphere.h.
Referenced by evaluateSurfaceEquationAtPoint(), and getCoeffs().
|
protected |
Value of z0 in equation of sphere.
Definition at line 75 of file CSGSphere.h.
Referenced by evaluateSurfaceEquationAtPoint(), and getCoeffs().
1.8.14