HerdSoftware
0.4.0
|
A parallelepiped in 3D space. More...
#include <Parallelepiped.h>
Public Member Functions | |
Parallelepiped () | |
virtual | ~Parallelepiped ()=default |
Destructor. More... | |
Parallelepiped (std::array< Point, 4 > points) | |
std::array< Point, 8 > | Vertices () const |
Gets the vertices of the parallelepiped. More... | |
const std::array< Parallelogram, 6 > & | Faces () const |
Gets the faces of the parallelepiped. More... | |
std::optional< std::array< Point, 2 > > | Intersections (const Line &line) const |
Computes the intersection points of the given line with the parallelepiped. More... | |
bool | Contains (const Point &point) const |
Checks if the parallelepiped contains the given point. More... | |
Protected Attributes | |
Herd::Point | m_origin |
std::array< Vec3D, 3 > | m_sides |
std::array< Parallelogram, 6 > | m_faces |
! Faces of the parallelepiped More... | |
bool | m_facesAreValid {false} |
! Check if we already computed the faces More... | |
Friends | |
bool | operator== (const Parallelepiped &lhs, const Parallelepiped &rhs) |
A parallelepiped in 3D space.
This class describes a parallepipedal region in 3D space.
Herd::Parallelepiped::Parallelepiped | ( | ) |
Constructor.
Builds an unspecified parallepiped.
|
virtualdefault |
Destructor.
Herd::Parallelepiped::Parallelepiped | ( | std::array< Point, 4 > | points | ) |
Constructor.
Builds the parallepipedal region whose vertices are defined by the four points passed as argument (the remaining two are automatically deduced).
points | The points defining the parallelepiped. |
Herd::Exception | if the given points do not define a parallelepiped. |
bool Herd::Parallelepiped::Contains | ( | const Point & | point | ) | const |
Checks if the parallelepiped contains the given point.
point | The point to be checked |
const std::array< Parallelogram, 6 > & Herd::Parallelepiped::Faces | ( | ) | const |
Gets the faces of the parallelepiped.
For a default-constructed Parallelepiped the returned faces are undefined.
std::optional< std::array< Point, 2 > > Herd::Parallelepiped::Intersections | ( | const Line & | line | ) | const |
Computes the intersection points of the given line with the parallelepiped.
line | The line. |
std::array< Point, 8 > Herd::Parallelepiped::Vertices | ( | ) | const |
Gets the vertices of the parallelepiped.
For a default-constructed Parallelepiped the returned points are undefined.
|
friend |
|
mutableprotected |
! Faces of the parallelepiped
|
mutableprotected |
! Check if we already computed the faces
|
protected |
|
protected |