HerdSoftware  0.4.0
Public Member Functions | List of all members
Herd::Parallelogram Class Reference

A parallelogram in 3D space. More...

#include <Parallelogram.h>

Inheritance diagram for Herd::Parallelogram:
Herd::Trapezium Herd::Rectangle

Public Member Functions

 Parallelogram ()
 
 ~Parallelogram () override=default
 Destructor. More...
 
 Parallelogram (std::array< Point, 3 > points)
 
bool Contains (Point point) const override
 Checks if the parallelogram contains the given point. More...
 
bool operator== (const Parallelogram &rhs) const
 Comparison operator. More...
 
bool operator!= (const Parallelogram &rhs) const
 
- Public Member Functions inherited from Herd::Trapezium
 Trapezium ()=default
 
virtual ~Trapezium ()=default
 Destructor. More...
 
 Trapezium (std::array< Point, 4 > points)
 
Herd::Plane Plane () const
 Gets the plane on which the Trapezium lies. More...
 
std::array< Point, 4 > Vertices () const
 Gets the vertices of the Trapezium. More...
 
std::optional< PointIntersection (const Line &line) const
 Computes the intersection point of the given line with the Trapezium. More...
 
bool operator== (const Trapezium &rhs) const
 Comparison operator. More...
 
bool operator!= (const Trapezium &rhs) const
 

Additional Inherited Members

- Protected Attributes inherited from Herd::Trapezium
Herd::Plane m_plane
 
std::array< Vec3D, 3 > m_vertices
 

Detailed Description

A parallelogram in 3D space.

This class describes a parallelogrammatic region on a plane in 3D space.

Constructor & Destructor Documentation

◆ Parallelogram() [1/2]

Herd::Parallelogram::Parallelogram ( )
default

Constructor.

Builds an unspecified parallelogram.

◆ ~Parallelogram()

Herd::Parallelogram::~Parallelogram ( )
overridedefault

Destructor.

◆ Parallelogram() [2/2]

Herd::Parallelogram::Parallelogram ( std::array< Point, 3 >  points)

Constructor.

Builds the parallelogrammatic region whose three vertices are given by the three points passed as argument (the fourth is automatically deduced).

Parameters
pointsThe points defining the parallelogram.
Exceptions
Herd::Exceptionif the given points do not define a parallelogram.

Member Function Documentation

◆ Contains()

bool Herd::Parallelogram::Contains ( Point  point) const
overridevirtual

Checks if the parallelogram contains the given point.

No check is performed to verify if the point lies on the same plane. This is up to the user, and can easily be checked by making sure that the dot product between the point and the plane normal is zero.

Parameters
pointThe point to be checked

Reimplemented from Herd::Trapezium.

◆ operator!=()

bool Herd::Parallelogram::operator!= ( const Parallelogram rhs) const
inline

◆ operator==()

bool Herd::Parallelogram::operator== ( const Parallelogram rhs) const
inline

Comparison operator.

Parameters
rhsThe right-hand-side object of the comparison operation.
Returns
true if the two Parallelograms are member-wise equal.

The documentation for this class was generated from the following files: