Represents a box in 3D space.
More...
#include <Box.h>
Inherits SFCGAL::PrimitiveImpl< Derived, Base >.
|
| | 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). More...
|
| |
| | Box (const Box &other)=default |
| | Copy constructor. More...
|
| |
| auto | primitiveType () const -> std::string override |
| | returns the primitive type More...
|
| |
| auto | primitiveTypeId () const -> PrimitiveType override |
| |
| | ~Box () override=default |
| | Destructor. More...
|
| |
| void | setXExtent (const Kernel::FT &x_extent) |
| | Sets the x_extent of the box. More...
|
| |
| void | setYExtent (const Kernel::FT &y_extent) |
| | Sets the y_extent of the box. More...
|
| |
| void | setZExtent (const Kernel::FT &z_extent) |
| | Sets the z_extent of the box. More...
|
| |
| auto | xExtent () const -> const Kernel::FT & |
| | Gets the x_extent of the box. More...
|
| |
| auto | yExtent () const -> const Kernel::FT & |
| | Gets the y_extent of the box. More...
|
| |
| auto | zExtent () const -> const Kernel::FT & |
| | Gets the z_extent of the box. More...
|
| |
| auto | generatePolyhedralSurface () const -> PolyhedralSurface override |
| | Generates a surface mesh representation of the box. More...
|
| |
| auto | baseVolume (bool withDiscretization=false) const -> double override |
| | Returns the sphere volume without scaling. More...
|
| |
| auto | area3D (bool withDiscretization=false) const -> double override |
| | Returns the primitive area. More...
|
| |
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).
- Parameters
-
| x_extent | The box length in x direction |
| y_extent | The box length in y direction |
| z_extent | The box length in z direction |
| SFCGAL::Box::Box |
( |
const Box & |
other | ) |
|
|
default |
Copy constructor.
- Parameters
-
| auto SFCGAL::Box::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::Box::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 box.
- Returns
- A CGAL::Surface_mesh object representing the box
| auto SFCGAL::Box::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::Box::setXExtent |
( |
const Kernel::FT & |
x_extent | ) |
|
Sets the x_extent of the box.
- Parameters
-
| void SFCGAL::Box::setYExtent |
( |
const Kernel::FT & |
y_extent | ) |
|
Sets the y_extent of the box.
- Parameters
-
| void SFCGAL::Box::setZExtent |
( |
const Kernel::FT & |
z_extent | ) |
|
Sets the z_extent of the box.
- Parameters
-
| void SFCGAL::Box::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. |
| auto SFCGAL::Box::xExtent |
( |
| ) |
const -> const Kernel::FT & |
Gets the x_extent of the box.
- Returns
- The x_extent
| auto SFCGAL::Box::yExtent |
( |
| ) |
const -> const Kernel::FT & |
Gets the y_extent of the box.
- Returns
- The y_extent
| auto SFCGAL::Box::zExtent |
( |
| ) |
const -> const Kernel::FT & |
Gets the z_extent of the box.
- Returns
- The z_extent