Geophysical Inversion and Modelling Library
v1.5.2-5-g042d7f36
|
A plane. More...
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 () | |
Plane & | operator= (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 RVector3 & | norm () 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_ |
A plane.
A plane, defined through Hessian normal form, norm * x = -p. Stores Normvector norm with |norm| = 1.0 and distance d from orign.
GIMLI::Plane::Plane | ( | ) |
Default constructor, Construct an invalid empty plane.
GIMLI::Plane::Plane | ( | const RVector3 & | norm, |
double | d | ||
) |
Construct a plane based on Hessian normal form norm * x = -p.
References checkValidity().
Construct a plane based on his unit nomal vector norm and a base position x0.
References GIMLI::Pos::abs(), checkValidity(), and x0().
Construct a plane based on 3 real positions in R^3, respectivly parameterized style.
References GIMLI::Pos::abs(), checkValidity(), and GIMLI::det().
GIMLI::Plane::Plane | ( | double | a, |
double | b, | ||
double | c, | ||
double | d | ||
) |
Construct a plane based on his general equation
References checkValidity(), and d().
GIMLI::Plane::~Plane | ( | ) |
Default destructor
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().
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().
|
protected |
internal: copy content of plane into this plane
References d(), norm(), and valid().
Referenced by operator=(), and Plane().
|
inline |
Distance between the orign(0,0,0) and this plane.
Referenced by compare(), copy_(), intersect(), and Plane().
|
inline |
Returns the distance between the Point pos and this plane.
Referenced by touch().
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
References GIMLI::Line::p0(), GIMLI::Line::p1(), touch(), GIMLI::Line::valid(), valid(), and x0().
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().
|
inline |
Return a const reference to the unit vector of this plane. | norm | = 1.0
Referenced by compare(), copy_(), intersect(), and GIMLI::PolygonShape::norm().
|
inline |
Not_equal_to operator
|
inline |
Equal_to operator
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().
|
inline |
Return the validity of this plane. This plane is not valid if its initialized by default constructor.
Referenced by copy_(), and intersect().
|
inline |
Returns the orign if the unit vector. x0 = n * d.
Referenced by intersect(), and Plane().