|
SFCGAL 2.3.0
|
Represents a cube in 3D space, which is a box where all 3 sides are of equal size. More...
#include <Cube.h>
Public Member Functions | |
| Cube (const Kernel::FT &size=1.0) | |
| Constructs a Cube object in the first octant (+, +, +) centered at origin (0, 0, 0). | |
| Cube (const Cube &other)=default | |
| Copy constructor. | |
| auto | primitiveType () const -> std::string override |
| returns the primitive type | |
| auto | primitiveTypeId () const -> PrimitiveType override |
| ~Cube () override=default | |
| Destructor. | |
| void | setSize (const Kernel::FT &size) |
| Sets the size of the cube. | |
| auto | size () const -> const Kernel::FT & |
| Gets the size of the cube. | |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| Generates a surface mesh representation of the cube. | |
| auto | baseVolume (bool withDiscretization=false) const -> double override |
| Returns the sphere volume without scaling. | |
| auto | area3D (bool withDiscretization=false) const -> double override |
| Returns the primitive area. | |
| auto | toString () const -> std::string override |
| Returns string representation of this object. | |
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 cube in 3D space, which is a box where all 3 sides are of equal size.
This class provides methods to generate a polyhedral surface representation of a cube. It uses SFCGAL's Kernel for exact computations.
| SFCGAL::Cube::Cube | ( | const Kernel::FT & | size = 1.0 | ) |
|
default |
Copy constructor.
| other | copy from |
|
overridedefault |
Destructor.
|
nodiscardoverride |
Returns the primitive area.
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
|
nodiscardoverride |
Returns the sphere volume without scaling.
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
|
override |
Generates a surface mesh representation of the cube.
|
overrideprotected |
Invalidates the cached geometries.
|
nodiscardoverride |
returns the primitive type
|
nodiscardoverride |
| void SFCGAL::Cube::setSize | ( | const Kernel::FT & | size | ) |
Sets the size of the cube.
| size | The new size |
|
nodiscard |
Gets the size of the cube.
|
nodiscardoverride |
Returns string representation of this object.
Can be overriden by sub-classes.
|
overrideprotected |
Verifies that all parameters are valid.
For instance, it raises an error if an extent 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. |