|
SFCGAL 2.3.0
|
Represents a sphere in 3D space centered at the origin. More...
#include <Sphere.h>
Public Member Functions | |
| Sphere (const Kernel::FT &radius=1.0, unsigned int num_subdivisions=2) | |
| Constructs a Sphere object. | |
| Sphere (const Sphere &other)=default | |
| Copy constructor. | |
| ~Sphere () override=default | |
| Destructor. | |
| auto | primitiveType () const -> std::string override |
| returns the primitive type | |
| auto | primitiveTypeId () const -> PrimitiveType override |
| returns a code corresponding to the type | |
| void | setRadius (const Kernel::FT &radius) |
| Sets the radius of the sphere. | |
| void | setNumSubdivisions (unsigned int num) |
| Sets the number of subdivisions. | |
| auto | radius () const -> const Kernel::FT & |
| Gets the radius of the sphere. | |
| auto | numSubdivisions () const -> unsigned int |
| Gets the number of subdivisions. | |
| auto | generatePolyhedron () const -> CGAL::Polyhedron_3< Kernel > |
| Generates a polyhedron representation of the sphere. | |
| auto | generatePoints () const -> std::vector< Kernel::Point_3 > |
| Generates a point cloud representation of the sphere. | |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| Generates a surface mesh representation of the sphere. | |
| auto | baseVolume (bool withDiscretization=false) const -> double override |
| Returns the sphere volume without scaling. | |
| auto | area3D (bool withDiscretization=false) const -> double override |
| Returns the sphere area. | |
Protected Member Functions | |
| void | invalidateCache () override |
| Invalidates the cached geometries. | |
| void | validateParameters (std::unordered_map< std::string, PrimitiveParameter > const &tempParameters) const override |
| Verifies that all parameters are valid. | |
Represents a sphere in 3D space centered at the origin.
This class provides methods to generate a polyhedron and a point cloud representation of a sphere. It uses SFCGAL's Kernel for exact computations.
| SFCGAL::Sphere::Sphere | ( | const Kernel::FT & | radius = 1.0, |
| unsigned int | num_subdivisions = 2 ) |
|
default |
Copy constructor.
| other | copy from |
|
overridedefault |
Destructor.
|
override |
Returns the sphere area.
| withDiscretization | Computes area with discretization (true) or as perfect primitive (false). Defaults to false. |
|
override |
Returns the sphere volume without scaling.
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
| auto SFCGAL::Sphere::generatePoints | ( | ) | const -> std::vector< Kernel::Point_3 > |
Generates a point cloud representation of the sphere.
|
override |
Generates a surface mesh representation of the sphere.
| auto SFCGAL::Sphere::generatePolyhedron | ( | ) | const -> CGAL::Polyhedron_3< Kernel > |
Generates a polyhedron representation of the sphere.
|
overrideprotected |
Invalidates the cached geometries.
|
inlinenodiscard |
Gets the number of subdivisions.
|
nodiscardoverride |
returns the primitive type
|
nodiscardoverride |
returns a code corresponding to the type
|
inlinenodiscard |
Gets the radius of the sphere.
|
inline |
Sets the number of subdivisions.
| num | The new number of subdivisions |
|
inline |
Sets the radius of the sphere.
| radius | The new radius |
|
overrideprotected |
Verifies that all parameters are valid.
For instance, it raises an error if a radius is negative.
| tempParameters | a temp map of parameter with new values |
| SFCGAL::Exception | if one of the parameters if not valid provided variant type is not compatible with the parameter. |