Represents a cube in 3D space, which is a box where all 3 sides are of equal size.
More...
#include <Cube.h>
Inherits SFCGAL::PrimitiveImpl< Derived, Base >.
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 | ) |
|
Constructs a Cube object in the first octant (+, +, +) centered at origin (0, 0, 0).
- Parameters
-
| SFCGAL::Cube::Cube |
( |
const Cube & |
other | ) |
|
|
default |
Copy constructor.
- Parameters
-
| auto SFCGAL::Cube::area3D |
( |
bool |
withDiscretization = false | ) |
const -> double |
|
override |
Returns the primitive area.
- Parameters
-
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
- Returns
- The primitive volume
- Note
- only perfect primitive version is available
| auto SFCGAL::Cube::baseVolume |
( |
bool |
withDiscretization = false | ) |
const -> double |
|
override |
Returns the sphere volume without scaling.
- Parameters
-
| withDiscretization | Computes volume with discretization (true) or as perfect primitive (false). Defaults to false. |
- Returns
- The sphere volume
- Note
- only perfect primitive version is available
Generates a surface mesh representation of the cube.
- Returns
- A CGAL::Surface_mesh object representing the cube
| void SFCGAL::Cube::invalidateCache |
( |
| ) |
|
|
overrideprotected |
Invalidates the cached geometries.
| auto SFCGAL::Cube::primitiveType |
( |
| ) |
const -> std::string |
|
override |
returns the primitive type
- Warning
- use CamelCase (Cylinder, not CYLINDER)
- Returns
- the primitive type as string
- Returns
- a code corresponding to the type
| void SFCGAL::Cube::setSize |
( |
const Kernel::FT & |
size | ) |
|
Sets the size of the cube.
- Parameters
-
| auto SFCGAL::Cube::size |
( |
| ) |
const -> const Kernel::FT & |
Gets the size of the cube.
- Returns
- The size
| auto SFCGAL::Cube::toString |
( |
| ) |
const -> std::string |
|
override |
Returns string representation of this object.
Can be overriden by sub-classes.
- Returns
- string representation of this object
| void SFCGAL::Cube::validateParameters |
( |
std::unordered_map< std::string, PrimitiveParameter > const & |
tempParameters | ) |
const |
|
overrideprotected |
Verifies that all parameters are valid.
For instance, it raises an error if an extent is negative.
- Parameters
-
| tempParameters | a temp map of parameter with new values |
- Exceptions
-
| SFCGAL::Exception | if one of the parameters if not valid provided variant type is not compatible with the parameter. |