A surface to be used in constructive solid geometry.
More...
#include <CSGSurface.hpp>
|
|
virtual | ~CSGSurface () noexcept |
| | Virtual destructor (C++ Core Guidelines C.127)
|
| |
| virtual bool | Contains (const Point &p) const noexcept=0 |
| | Returns true if Point is in the "negative" side of the (open) surface. A point on the surface or outside is considered to be on the "positive" side. More...
|
| |
| virtual Real | Distance (const Point &origin, const Direction &direction) const noexcept=0 |
| | Return the distance from a given origin Point to the CSGSurface along a given Direction. More...
|
| |
|
|
const std::string | name |
| | Unique, user-defined identifier (C++ Core Guidelines C.131)
|
| |
A surface to be used in constructive solid geometry.
◆ CSGSurface()
| CSGSurface::CSGSurface |
( |
const pugi::xml_node & |
surface_node | ) |
|
|
protectednoexcept |
Constructs a CSGSurface from a surface node of an XML document.
- Parameters
-
| surface_node | The requested surface node in the XML document |
◆ Contains()
| virtual bool CSGSurface::Contains |
( |
const Point & |
p | ) |
const |
|
pure virtualnoexcept |
Returns true if Point is in the "negative" side of the (open) surface. A point on the surface or outside is considered to be on the "positive" side.
Implemented in Sphere, PlaneX, and CylinderX.
◆ Create()
| static std::unique_ptr< const CSGSurface > CSGSurface::Create |
( |
const pugi::xml_node & |
root, |
|
|
const std::string & |
name |
|
) |
| |
|
static |
Factory method to create new CSGSurface from an XML document.
- Parameters
-
| root | Root node of existing XML document |
| name | Name of the CSGSurface in the XML document |
- Returns
- A
std::unique_ptr to the constructed CSGSurface (C++ Core Guidelines R.30)
- Exceptions
-
| std::runtime_error | `surface` node with matching `name` attribute not found |
◆ Distance()
| virtual Real CSGSurface::Distance |
( |
const Point & |
origin, |
|
|
const Direction & |
direction |
|
) |
| const |
|
pure virtualnoexcept |
◆ SolveQuadratic()
Specialized form of quadratic equation solver.
Used for CSGSurface intersection distance calculations. Returns least positive real solution if it exists; infinity otherwise.
The documentation for this class was generated from the following file: