Geophysical Inversion and Modelling Library  v1.5.2-5-g042d7f36
GIMLI::Plane Class Reference

A plane. More...

+ Collaboration diagram for GIMLI::Plane:

Public Member Functions

 Plane ()
 
 Plane (const RVector3 &norm, double d)
 
 Plane (const RVector3 &norm, const RVector3 &x0)
 
 Plane (const RVector3 &p0, const RVector3 &p1, const RVector3 &p2)
 
 Plane (double a, double b, double c, double d)
 
 Plane (const Plane &plane)
 
 ~Plane ()
 
Planeoperator= (const Plane &plane)
 
bool operator== (const Plane &plane)
 
bool operator!= (const Plane &plane)
 
bool compare (const Plane &p, double tol=TOLERANCE, bool bothDirs=false)
 
bool touch (const RVector3 &pos, double tol=TOLERANCE)
 
Line intersect (const Plane &plane, double tol=TOLERANCE)
 
RVector3 intersect (const Line &line, double tol=TOLERANCE, bool inside=false)
 
const RVector3norm () const
 
const RVector3 x0 () const
 
double distance (const RVector3 &pos) const
 
double d () const
 
bool checkValidity (double tol=TOLERANCE)
 
bool valid () const
 

Protected Member Functions

void copy_ (const Plane &plane)
 

Protected Attributes

RVector3 norm_
 
double d_
 
bool valid_
 

Detailed Description

A plane.

A plane, defined through Hessian normal form, norm * x = -p. Stores Normvector norm with |norm| = 1.0 and distance d from orign.

Constructor & Destructor Documentation

◆ Plane() [1/6]

GIMLI::Plane::Plane ( )

Default constructor, Construct an invalid empty plane.

◆ Plane() [2/6]

GIMLI::Plane::Plane ( const RVector3 norm,
double  d 
)

Construct a plane based on Hessian normal form norm * x = -p.

References checkValidity().

◆ Plane() [3/6]

GIMLI::Plane::Plane ( const RVector3 norm,
const RVector3 x0 
)

Construct a plane based on his unit nomal vector norm and a base position x0.

References GIMLI::Pos::abs(), checkValidity(), and x0().

◆ Plane() [4/6]

GIMLI::Plane::Plane ( const RVector3 p0,
const RVector3 p1,
const RVector3 p2 
)

Construct a plane based on 3 real positions in R^3, respectivly parameterized style.

References GIMLI::Pos::abs(), checkValidity(), and GIMLI::det().

◆ Plane() [5/6]

GIMLI::Plane::Plane ( double  a,
double  b,
double  c,
double  d 
)

Construct a plane based on his general equation

References checkValidity(), and d().

◆ Plane() [6/6]

GIMLI::Plane::Plane ( const Plane plane)

Copyconstructor.

References copy_().

◆ ~Plane()

GIMLI::Plane::~Plane ( )

Default destructor

Member Function Documentation

◆ checkValidity()

bool GIMLI::Plane::checkValidity ( double  tol = TOLERANCE)

Check if the plane spans norm vector has a length of 1.0 that means it spans a valid R3 space.

References GIMLI::Pos::abs().

Referenced by Plane().

◆ compare()

bool GIMLI::Plane::compare ( const Plane p,
double  tol = TOLERANCE,
bool  bothDirs = false 
)

Compare two planes with a given tolerance. Check if both norms and distances are equal. | norm - p.norm | < tol && | d_ - p.d | < tol. If bothDirection is True | norm - p.norm | can be 2.0 to allow for coplanar check with different orientations.

References d(), GIMLI::Pos::distance(), and norm().

Referenced by GIMLI::Mesh::copyBoundary().

◆ copy_()

void GIMLI::Plane::copy_ ( const Plane plane)
protected

internal: copy content of plane into this plane

References d(), norm(), and valid().

Referenced by operator=(), and Plane().

◆ d()

double GIMLI::Plane::d ( ) const
inline

Distance between the orign(0,0,0) and this plane.

Referenced by compare(), copy_(), intersect(), and Plane().

◆ distance()

double GIMLI::Plane::distance ( const RVector3 pos) const
inline

Returns the distance between the Point pos and this plane.

Referenced by touch().

◆ intersect() [1/2]

RVector3 GIMLI::Plane::intersect ( const Line line,
double  tol = TOLERANCE,
bool  inside = false 
)

Returns the point of intersection between this plane and the Line line. Return an invalid RVector3 if line and this plane are parallel. Optional inside check. Set inside returns invalid RVector3 if intersection point is not inside (including nodes) the line

Line and Plane are parallel

References GIMLI::Line::p0(), GIMLI::Line::p1(), touch(), GIMLI::Line::valid(), valid(), and x0().

◆ intersect() [2/2]

Line GIMLI::Plane::intersect ( const Plane plane,
double  tol = TOLERANCE 
)

Returns the Line of intersection between 2 planes. Are booth planes parallel or identically the returned line is invalid.

References GIMLI::Pos::abs(), d(), GIMLI::det(), and norm().

Referenced by GIMLI::TriangleShape::intersectRay().

◆ norm()

const RVector3& GIMLI::Plane::norm ( ) const
inline

Return a const reference to the unit vector of this plane. | norm | = 1.0

Referenced by compare(), copy_(), intersect(), and GIMLI::PolygonShape::norm().

◆ operator!=()

bool GIMLI::Plane::operator!= ( const Plane plane)
inline

Not_equal_to operator

◆ operator=()

Plane & GIMLI::Plane::operator= ( const Plane plane)

Assignment operator

References copy_().

◆ operator==()

bool GIMLI::Plane::operator== ( const Plane plane)
inline

Equal_to operator

◆ touch()

bool GIMLI::Plane::touch ( const RVector3 pos,
double  tol = TOLERANCE 
)

Returns true if the plane is valid and pos touch this plane. Touch when plane.distance(pos) < tol.

References distance().

Referenced by intersect(), and GIMLI::Shape::touch().

◆ valid()

bool GIMLI::Plane::valid ( ) const
inline

Return the validity of this plane. This plane is not valid if its initialized by default constructor.

Referenced by copy_(), and intersect().

◆ x0()

const RVector3 GIMLI::Plane::x0 ( ) const
inline

Returns the orign if the unit vector. x0 = n * d.

Referenced by intersect(), and Plane().