HerdSoftware  0.1.1
Public Member Functions | Protected Attributes | List of all members
Herd::Parallelogram Class Reference

A parallelogram in 3D space. More...

#include <Parallelogram.h>

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

Public Member Functions

 Parallelogram ()
 
virtual ~Parallelogram ()=default
 Destructor. More...
 
 Parallelogram (std::array< Point, 3 > points)
 
Herd::Plane Plane () const
 Gets the plane on which the parallelogram lies. More...
 
std::array< Point, 4 > Vertices () const
 Gets the vertices of the parallelogram. More...
 
Point Intersection (const Line &line) const
 Computes the intersection point of the given line with the parallelogram. More...
 

Protected Attributes

Herd::Plane _plane
 
std::array< Vec3D, 2 > _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 ( )

Constructor.

Builds an unspecified parallelogram.

◆ ~Parallelogram()

virtual Herd::Parallelogram::~Parallelogram ( )
virtualdefault

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
#Exceptionif the given points do not define a parallelogram.

Member Function Documentation

◆ Intersection()

Point Herd::Parallelogram::Intersection ( const Line line) const

Computes the intersection point of the given line with the parallelogram.

For a default-constructed Parallelogram the returned intersection point is undefined.

Parameters
lineThe line.
Returns
The intersection point if it exists, otherwise a default-initialized Point object.

◆ Plane()

Herd::Plane Herd::Parallelogram::Plane ( ) const

Gets the plane on which the parallelogram lies.

For a default-constructed Parallelogram the returned plane is undefined.

Returns
The plane containing the parallelogram.

◆ Vertices()

std::array< Point, 4 > Herd::Parallelogram::Vertices ( ) const

Gets the vertices of the parallelogram.

For a default-constructed Parallelogram the returned points are undefined.

Returns
The vertices of the parallelogram.

Member Data Documentation

◆ _plane

Herd::Plane Herd::Parallelogram::_plane
protected

◆ _vertices

std::array<Vec3D, 2> Herd::Parallelogram::_vertices
protected

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