|
SFCGAL 2.3.0
|
Represents a box in 3D space. More...
#include <Box.h>
Public Member Functions | |
| Box (const Kernel::FT &x_extent=1.0, const Kernel::FT &y_extent=1.0, const Kernel::FT &z_extent=1.0) | |
| Constructs a Box object in the first octant (+, +, +) centered at origin (0, 0, 0). | |
| Box (const Box &other)=default | |
| Copy constructor. | |
| auto | primitiveType () const -> std::string override |
| returns the primitive type | |
| auto | primitiveTypeId () const -> PrimitiveType override |
| ~Box () override=default | |
| Destructor. | |
| void | setXExtent (const Kernel::FT &x_extent) |
| Sets the x_extent of the box. | |
| void | setYExtent (const Kernel::FT &y_extent) |
| Sets the y_extent of the box. | |
| void | setZExtent (const Kernel::FT &z_extent) |
| Sets the z_extent of the box. | |
| auto | xExtent () const -> const Kernel::FT & |
| Gets the x_extent of the box. | |
| auto | yExtent () const -> const Kernel::FT & |
| Gets the y_extent of the box. | |
| auto | zExtent () const -> const Kernel::FT & |
| Gets the z_extent of the box. | |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| Generates a surface mesh representation of the box. | |
| 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. | |
Protected Member Functions | |
| void | validateParameters (std::unordered_map< std::string, PrimitiveParameter > const &tempParameters) const override |
| Verifies that all parameters are valid. | |
Represents a box in 3D space.
This class provides methods to generate a polyhedral surface representation of a box (rectangular prism). It uses SFCGAL's Kernel for exact computations.
| SFCGAL::Box::Box | ( | const Kernel::FT & | x_extent = 1.0, |
| const Kernel::FT & | y_extent = 1.0, | ||
| const Kernel::FT & | z_extent = 1.0 ) |
Constructs a Box object in the first octant (+, +, +) centered at origin (0, 0, 0).
| x_extent | The box length in x direction |
| y_extent | The box length in y direction |
| z_extent | The box length in z direction |
|
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 box.
|
nodiscardoverride |
returns the primitive type
|
nodiscardoverride |
| void SFCGAL::Box::setXExtent | ( | const Kernel::FT & | x_extent | ) |
Sets the x_extent of the box.
| x_extent | The new x_extent |
| void SFCGAL::Box::setYExtent | ( | const Kernel::FT & | y_extent | ) |
Sets the y_extent of the box.
| y_extent | The new y_extent |
| void SFCGAL::Box::setZExtent | ( | const Kernel::FT & | z_extent | ) |
Sets the z_extent of the box.
| z_extent | The new z_extent |
|
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. |
|
nodiscard |
Gets the x_extent of the box.
|
nodiscard |
Gets the y_extent of the box.
|
nodiscard |
Gets the z_extent of the box.