minimc 0.5.1
Loading...
Searching...
No Matches
Sphere Class Reference

A sphere. What else has to be said? More...

#include <CSGSurface.hpp>

Inheritance diagram for Sphere:
Collaboration diagram for Sphere:

Public Member Functions

 Sphere (const pugi::xml_node &sphere_node) noexcept
 Constructs a Sphere from a sphere node of an XML document. More...
 
Real Distance (const Point &origin, const Direction &direction) const noexcept override
 Returns the distance from a given origin Point to the Sphere along a given Direction using the line-sphere intersection algorithm More...
 
bool Contains (const Point &p) const noexcept override
 Implements CSGSurface method. More...
 
- Public Member Functions inherited from CSGSurface
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...
 

Additional Inherited Members

- Static Public Member Functions inherited from CSGSurface
static std::unique_ptr< const CSGSurfaceCreate (const pugi::xml_node &root, const std::string &name)
 Factory method to create new CSGSurface from an XML document. More...
 
- Public Attributes inherited from CSGSurface
const std::string name
 Unique, user-defined identifier (C++ Core Guidelines C.131)
 
- Protected Member Functions inherited from CSGSurface
 CSGSurface (const pugi::xml_node &surface_node) noexcept
 Constructs a CSGSurface from a surface node of an XML document. More...
 
- Static Protected Member Functions inherited from CSGSurface
static Real SolveQuadratic (Real a, Real b, Real c) noexcept
 Specialized form of quadratic equation solver. More...
 

Detailed Description

A sphere. What else has to be said?

Constructor & Destructor Documentation

◆ Sphere()

Sphere::Sphere ( const pugi::xml_node &  sphere_node)
noexcept

Constructs a Sphere from a sphere node of an XML document.

Parameters
sphere_nodeThe requested sphere node in the XML document

Member Function Documentation

◆ Contains()

bool Sphere::Contains ( const Point p) const
overridevirtualnoexcept

Implements CSGSurface method.

Implements CSGSurface.

◆ Distance()

Real Sphere::Distance ( const Point origin,
const Direction direction 
) const
overridevirtualnoexcept

Returns the distance from a given origin Point to the Sphere along a given Direction using the line-sphere intersection algorithm

Parameters
originStarting point from where distance will be calculated.
directionUnit vector. Must be normalized to unity.

Implements CSGSurface.


The documentation for this class was generated from the following file: