ActiveLib
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
active::geometry::Plane Class Reference

Class to represent a plane. More...

#include <Plane.h>

Public Types

using Unique = std::unique_ptr<Plane>
 Unique pointer.
 
using Shared = std::shared_ptr<Plane>
 Shared pointer.
 
using Option = std::optional<Plane>
 Optional.
 

Public Member Functions

 Plane ()
 
 Plane (const Vector3 &norm)
 
virtual Plane operator+ (const Point &offset)
 
virtual Planeoperator+= (const Point &offset)
 
virtual Plane operator* (const double &mult) const
 
virtual Plane operator* (const Matrix3x3 &matrix) const
 
virtual Plane operator* (const Matrix4x4 &matrix) const
 
virtual Planeoperator*= (const double &mult)
 
virtual Planeoperator*= (const Matrix3x3 &matrix)
 
virtual Planeoperator*= (const Matrix4x4 &matrix)
 
const Vector3getNormal () const
 
double getOffset () const
 
Position positionOf (const Point &ref, double prec=math::eps) const
 
Point closestPointTo (const Point &ref) const
 
double lengthTo (const Point &ref) const
 
double heightAt (const Point &ref, double prec=math::eps) const
 
XPoint::Option intersectionWith (const Line &ref, double prec=math::eps) const
 
Line::Option intersectionWith (const Plane &ref, double prec=math::eps) const
 
Point::Option intersectionWith (const Plane &ref1, const Plane &ref2) const
 
bool isParallelTo (const Plane &ref, double prec=math::eps) const
 
bool cutsThrough (const Box &ref, double prec=math::eps) const
 
bool setNormal (const Vector3 &vect)
 
void setOffset (double offset)
 

Static Public Member Functions

static Option create (double offset, const Vector3 &norm)
 
static Option create (const Point &point, const Vector3 &norm)
 
static Option create (const Point &p1, const Point &p2, const Point &p3)
 

Detailed Description

Class to represent a plane.

Constructor & Destructor Documentation

◆ Plane() [1/2]

Plane::Plane ( )

Default constructor

Here is the caller graph for this function:

◆ Plane() [2/2]

Plane::Plane ( const Vector3 & norm)

Constructor

Parameters
normThe plane normal
Here is the call graph for this function:

Member Function Documentation

◆ closestPointTo()

Point Plane::closestPointTo ( const Point & ref) const

Get the point on the plane closest to the reference point

Parameters
refThe reference point
Returns
The closest point (perpendicular to the plane)
Here is the call graph for this function:

◆ create() [1/3]

Plane::Option Plane::create ( const Point & p1,
const Point & p2,
const Point & p3 )
static

Create a plane from three points

Parameters
p1First point on the plane
p2Second point on the plane
p3Third point on the plane
Returns
An unique_ptr to a plane, or 0 if invalid
Here is the call graph for this function:

◆ create() [2/3]

Plane::Option Plane::create ( const Point & point,
const Vector3 & norm )
static

Create a new plane from a point and normal

Parameters
pointA point on the plane
normNormal to the plane
Returns
An unique_ptr to a plane, or 0 if invalid
Here is the call graph for this function:

◆ create() [3/3]

Plane::Option Plane::create ( double offset,
const Vector3 & norm )
static

Create a new plane from a normal and offset from the origin

Parameters
offsetDistance along normal from the origin to the plane
normNormal to the plane
Returns
An unique_ptr to a plane, or 0 if invalid
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cutsThrough()

bool Plane::cutsThrough ( const Box & ref,
double prec = math::eps ) const

Determine whether this plane cuts through the specified volume

Parameters
refThe volume to compare
precThe required precision
Returns
True if the plane cuts through the specified volume
Here is the call graph for this function:

◆ getNormal()

const Vector3 & Plane::getNormal ( ) const

Get the normal to the plane

Returns
The normal to the plane
Here is the caller graph for this function:

◆ getOffset()

double Plane::getOffset ( ) const

Get the offset from the origin to the plane along the normal

Returns
The offset from the origin to the plane along the normal

◆ heightAt()

double Plane::heightAt ( const Point & ref,
double prec = math::eps ) const

Get the height of a point projected vertically onto the plane

Parameters
refThe reference point
Returns
The height of the point projected vertically onto the plane
Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectionWith() [1/3]

XPoint::Option Plane::intersectionWith ( const Line & ref,
double prec = math::eps ) const

Get the point of intersection between a line and the plane

Parameters
refThe reference line
precThe required precision
Returns
The point of intersection between the line and plane
Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersectionWith() [2/3]

Line::Option Plane::intersectionWith ( const Plane & ref,
double prec = math::eps ) const

Get the vector describing the intersection of two planes

Parameters
refThe reference plane
precThe required precision
Returns
The line along which the planes intersect (or 0 if they are parallel)
Here is the call graph for this function:

◆ intersectionWith() [3/3]

Point::Option active::geometry::Plane::intersectionWith ( const Plane & ref1,
const Plane & ref2 ) const

Get the point at the intersection of three planes

Parameters
ref1The first plane
ref2The second plane
Returns
The point at which the planes intersect

◆ isParallelTo()

bool Plane::isParallelTo ( const Plane & ref,
double prec = math::eps ) const

Determine whether this plane is parallel to another

Parameters
refThe plane to compare
precThe required precision
Returns
True if the planes are parallel
Here is the call graph for this function:

◆ lengthTo()

double Plane::lengthTo ( const Point & ref) const

Get the minimum length from a point to the plane

Parameters
refThe reference point
Returns
The minimum distance between the point and this plane
Here is the call graph for this function:

◆ operator*() [1/3]

Plane Plane::operator* ( const double & mult) const
virtual

Multiplication operator

Parameters
multThe factor to multiply this by
Returns
The result of the multiplication of this and the specified factor

◆ operator*() [2/3]

Plane Plane::operator* ( const Matrix3x3 & matrix) const
virtual

Multiplication operator

Parameters
matrixThe matrix to multiply this by
Returns
The result of the multiplication

◆ operator*() [3/3]

Plane Plane::operator* ( const Matrix4x4 & matrix) const
virtual

Multiplication operator

Parameters
matrixThe matrix to multiply this by
Returns
The result of the multiplication

◆ operator*=() [1/3]

Plane & Plane::operator*= ( const double & mult)
virtual

Multiplication and assignment operator

Parameters
multThe factor to multiply this by
Returns
A reference to this

◆ operator*=() [2/3]

Plane & Plane::operator*= ( const Matrix3x3 & matrix)
virtual

Multiplication and assignment operator

Parameters
matrixThe matrix to multiply this by
Returns
A reference to this

◆ operator*=() [3/3]

Plane & Plane::operator*= ( const Matrix4x4 & matrix)
virtual

Multiplication and assignment operator

Parameters
matrixThe matrix to multiply this by
Returns
A reference to this

◆ operator+()

Plane Plane::operator+ ( const Point & offset)
virtual

Addition operator

Parameters
offsetThe amount to offset this by
Returns
The result of the addition

◆ operator+=()

Plane & Plane::operator+= ( const Point & offset)
virtual

Addition and assignment operator

Parameters
offsetThe amount to offset this by
Returns
A reference to this

◆ positionOf()

Position Plane::positionOf ( const Point & ref,
double prec = math::eps ) const

Get the position of a point with respect to the plane

Parameters
refThe reference point
precThe required precision
Returns
The relative point position
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNormal()

bool Plane::setNormal ( const Vector3 & vect)

Set the normal to the plane

Parameters
vectThe normal to the plane
Returns
True if the normal was applied (false = normal invalid)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOffset()

void active::geometry::Plane::setOffset ( double offset)
inline

Set the offset to the plane

Parameters
offsetThe offset to the plane

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