CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface, represented as some polynomial in x, y, and z. More...
#include <CSGSurface.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 | |
| CSGSurface (const std::string &name) | |
| Default constructor. More... | |
| CSGSurface (const std::string &name, const std::string &surf_type) | |
| Construct a new CSGSurface. More... | |
| virtual | ~CSGSurface ()=default |
| Destructor. More... | |
| const std::string & | getSurfaceType () const |
| Get the Surface Type. More... | |
| virtual std::unordered_map< std::string, Real > | getCoeffs () const =0 |
| Get the coefficients that define the surface. More... | |
| virtual Real | evaluateSurfaceEquationAtPoint (const Point &p) const =0 |
| given a point, determine its evaluation based on the surface equation. 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 | setName (const std::string &name) |
| FRIEND_TEST (CSGSurfaceTest, testSetName) | |
| Friends for unit testing. More... | |
Protected Attributes | |
| 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... | |
Friends | |
| class | CSGSurfaceList |
CSGSurface creates an internal representation of a Constructive Solid Geometry (CSG) surface, represented as some polynomial in x, y, and z.
Definition at line 26 of file CSGSurface.h.
|
strong |
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::CSGSurface::CSGSurface | ( | const std::string & | name | ) |
Default constructor.
| name | unique name of surface |
| CSG::CSGSurface::CSGSurface | ( | const std::string & | name, |
| const std::string & | surf_type | ||
| ) |
Construct a new CSGSurface.
| name | unique name of surface |
| surf_type | surface type |
Definition at line 15 of file CSGSurface.C.
|
virtualdefault |
Destructor.
|
pure virtual |
given a point, determine its evaluation based on the surface equation.
A positive value indicates a point that lies in the positive half-space with regards to the surface, a negative value indicates a point that lies in the negative side of the surface, and a value of 0 indicates that the point lies on the surface.
| p | point |
Implemented in CSG::CSGPlane, CSG::CSGSphere, CSG::CSGXCylinder, CSG::CSGYCylinder, and CSG::CSGZCylinder.
Referenced by getHalfspaceFromPoint().
|
protected |
Friends for unit testing.
|
pure virtual |
Get the coefficients that define the surface.
Implemented in CSG::CSGPlane, CSG::CSGSphere, CSG::CSGXCylinder, CSG::CSGYCylinder, and CSG::CSGZCylinder.
Referenced by operator==().
| CSGSurface::Halfspace CSG::CSGSurface::getHalfspaceFromPoint | ( | const Point & | p | ) | const |
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.
|
inline |
Get the name of surface.
Definition at line 95 of file CSGSurface.h.
Referenced by CSG::CSGSurfaceList::addSurface(), CSG::CSGRegion::CSGRegion(), operator==(), and CSG::CSGSurfaceList::renameSurface().
|
inline |
Get the Surface Type.
Definition at line 61 of file CSGSurface.h.
Referenced by operator==().
| bool CSG::CSGSurface::operator!= | ( | const CSGSurface & | other | ) | const |
Operator overload for checking if two CSGSurface objects are not equal.
Definition at line 45 of file CSGSurface.C.
| bool CSG::CSGSurface::operator== | ( | const CSGSurface & | other | ) | const |
Operator overload for checking if two CSGSurface objects are equal.
Definition at line 37 of file CSGSurface.C.
|
inlineprotected |
Definition at line 106 of file CSGSurface.h.
|
friend |
Definition at line 116 of file CSGSurface.h.
|
protected |
Name of surface.
Definition at line 109 of file CSGSurface.h.
Referenced by getHalfspaceFromPoint(), getName(), and setName().
|
protected |
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 getSurfaceType().
1.8.14