HerdSoftware
0.4.0
|
A trapezoidal prism in 3D space. More...
#include <TrapezoidalPrism.h>
Public Member Functions | |
TrapezoidalPrism ()=default | |
virtual | ~TrapezoidalPrism ()=default |
Destructor. More... | |
TrapezoidalPrism (Trapezium base, Vec3D edge) | |
std::array< Point, 8 > | Vertices () const |
Gets the vertices of the trapezoidal prism. More... | |
const std::array< Parallelogram, 4 > & | Faces () const |
Gets the 4 "lateral" faces of the trapezoidal prism. More... | |
const std::array< Trapezium, 2 > & | Bases () const |
Gets the trapezoidal bases of the trapezoidal prism. More... | |
std::optional< std::array< Point, 2 > > | Intersections (const Line &line) const |
Computes the intersection points of the given line with the trapezoidal prism. More... | |
bool | Contains (const Point &point) const |
Checks if the trapezoidal prism contains the given point. More... | |
Private Member Functions | |
void | ComputeAllFaces () const |
Private Attributes | |
Trapezium | m_base |
Vec3D | m_edge |
std::array< Parallelogram, 4 > | m_faces |
std::array< Trapezium, 2 > | m_bases |
bool | _facesAreValid {false} |
! Check if we already computed the faces More... | |
A trapezoidal prism in 3D space.
This class describes a trapezoidal prism region in 3D space.
|
default |
Constructor.
Builds an unspecified trapezoidal prism.
|
virtualdefault |
Destructor.
Constructor.
Builds a prism where the the provided trapezium is used as base and the edge to generate the 4 rectangular faces
base | A generating trapezium that defines the prism bases. |
edge | A Vec3D that defines the remaining parallelogrammatic faces of the prism. |
Herd::Exception | if the prism construction fails. |
const std::array< Trapezium, 2 > & Herd::TrapezoidalPrism::Bases | ( | ) | const |
Gets the trapezoidal bases of the trapezoidal prism.
For a default-constructed TrapezoidalPrism the returned bases are undefined.
|
private |
bool Herd::TrapezoidalPrism::Contains | ( | const Point & | point | ) | const |
Checks if the trapezoidal prism contains the given point.
point | The point to be checked |
const std::array< Parallelogram, 4 > & Herd::TrapezoidalPrism::Faces | ( | ) | const |
Gets the 4 "lateral" faces of the trapezoidal prism.
For a default-constructed TrapezoidalPrism the returned faces are undefined.
std::optional< std::array< Point, 2 > > Herd::TrapezoidalPrism::Intersections | ( | const Line & | line | ) | const |
Computes the intersection points of the given line with the trapezoidal prism.
line | The line. |
std::array< Point, 8 > Herd::TrapezoidalPrism::Vertices | ( | ) | const |
Gets the vertices of the trapezoidal prism.
For a default-constructed TrapezoidalPrism the returned points are undefined.
|
mutableprivate |
! Check if we already computed the faces
|
private |
|
mutableprivate |
|
private |
|
mutableprivate |