OpenVDB  0.104.0
Classes | Public Types | Public Member Functions | List of all members
Plane< Real > Class Template Reference

Plane Class. More...

#include <Plane.h>

Classes

class  Normalize
 

Public Types

typedef Vec3< RealPoint
 
typedef Vec3< RealVector
 

Public Member Functions

OPENVDB_DEPRECATED Plane ()
 Invalid plane since |N|=0. More...
 
OPENVDB_DEPRECATED Plane (const Point &P0, const Vector &N)
 
OPENVDB_DEPRECATED Plane (const Point &P0, const Vector &N, Normalize)
 Define plane from a point in the pane and its normal. More...
 
OPENVDB_DEPRECATED Plane (const Vector &P1, const Vector &P2, Real alpha)
 Define half-plane as affine interpolation between two points Normal points from P1 to P2 and plane goes through P1 for alpha=0. More...
 
OPENVDB_DEPRECATED Plane (const Point &P0, const Point &P1, const Point &P2)
 
OPENVDB_DEPRECATED Plane (const Point &P0, const Point &P1, const Point &P2, int n)
 
void flip ()
 flips normal of plane. Note that the point is unchanged! More...
 
Real getDist () const
 
Vector getNorm () const
 
Vector getNormal () const
 
Point getPoint () const
 
Real getPoint (int i) const
 
Real getNorm (int i) const
 
Point getNormalPoint () const
 
void setNorm (const Vector &N)
 
void setPoint (const Point &P0)
 redefines plane position but maintains the old normal More...
 
void set (const Point &P0, const Vector &N)
 redefines plane. Assumes N is normalized More...
 
void set (const Point &P0, const Vector &N, Normalize)
 redefines plane. Does not assume N is normalized More...
 
bool operator== (const Plane &other) const
 
bool operator!= (const Plane &other) const
 
bool isValid () const
 
bool isInside (const Point &P) const
 
bool isInside (const Point &P1, const Point &P2) const
 Convenient for checking vertices of an edge or ray. More...
 
bool isInside (const Point &P1, const Point &P2, const Point &P3) const
 Convenient for checking vertices of a trinagle. More...
 
bool isOutside (const Point &P) const
 
bool isOutside (const Point &P1, const Point &P2) const
 Convenient for checking vertices of an edge or ray. More...
 
bool isOutside (const Point &P1, const Point &P2, const Point &P3) const
 
bool isOn (const Point &pt, Real tolerance=1e-6) const
 
bool intersects (const Point &P1, const Point &P2) const
 Convenient for checking vertices of an edge or ray. More...
 
bool intersects (const Ray< Real > &ray) const
 
bool intersects (const Ray< Real > &ray, Real &t) const
 
Real angle (const Plane &other) const
 
Plane slerp (const Plane &other, Real t) const
 
Plane lerp (const Plane &other, Real t) const
 
Plane lerpPoints (const Plane &other, Real t) const
 

Detailed Description

template<typename Real>
class openvdb::v0_104_0::math::Plane< Real >

Plane Class.

Implicit definition of plane with normal N through a point P0:

(P-P0).N = P.N-P0.N = 0

Nx*Px + Ny*Py + Nz*Pz - ( Nx*P0x + Ny*P0y + Nz*P0z ) = Nx*Px + Ny*Py + Nz*Pz - Dist = 0


Nx*Px + Ny*Py + Nz*Pz = Dist


Member Typedef Documentation

typedef Vec3<Real> Point
typedef Vec3<Real> Vector

Constructor & Destructor Documentation

Invalid plane since |N|=0.

OPENVDB_DEPRECATED Plane ( const Point P0,
const Vector N 
)
inline

Define plane from a point in the pane and its normal Assumes N is already normalized!

OPENVDB_DEPRECATED Plane ( const Point P0,
const Vector N,
Normalize   
)
inline

Define plane from a point in the pane and its normal.

OPENVDB_DEPRECATED Plane ( const Vector P1,
const Vector P2,
Real  alpha 
)
inline

Define half-plane as affine interpolation between two points Normal points from P1 to P2 and plane goes through P1 for alpha=0.

OPENVDB_DEPRECATED Plane ( const Point P0,
const Point P1,
const Point P2 
)
inline

Define plane from three point in plane and normal is right-hand turn The point (used for interpolation) is the first, i.e. P0

OPENVDB_DEPRECATED Plane ( const Point P0,
const Point P1,
const Point P2,
int  n 
)
inline

Same as above, however this constructor allow the user the specify which of the three input points to use as P0

Member Function Documentation

Real angle ( const Plane< Real > &  other) const
inline
Returns
angle between planes in radians
void flip ( )
inline

flips normal of plane. Note that the point is unchanged!

Real getDist ( ) const
inline
Returns
Dist in Nx*Px + Ny*Py + Nz*Pz - Dist = 0 This is useful for intersection tests
Vector getNorm ( ) const
inline
Returns
the normal of the plane
Real getNorm ( int  i) const
inline
Returns
component of the plane normal
Vector getNormal ( ) const
inline
Point getNormalPoint ( ) const
inline
Returns
the point in the plane that intersects a line through the origin and a direction defined by the plane normal
Point getPoint ( ) const
inline
Returns
the point on the plane used for the construction
Real getPoint ( int  i) const
inline
Returns
component of the point used for the construction
bool intersects ( const Point P1,
const Point P2 
) const
inline

Convenient for checking vertices of an edge or ray.

bool intersects ( const Ray< Real > &  ray) const
inline
Returns
true if the ray intersects the plane
bool intersects ( const Ray< Real > &  ray,
Real t 
) const
inline
Returns
true if the eay intersects the plane. In this case t takes the value of the intersection point
bool isInside ( const Point P) const
inline
Returns
TRUE is the point, P, is inside the half-plane, i.e. on the opposit side of the plane normal!
bool isInside ( const Point P1,
const Point P2 
) const
inline

Convenient for checking vertices of an edge or ray.

bool isInside ( const Point P1,
const Point P2,
const Point P3 
) const
inline

Convenient for checking vertices of a trinagle.

bool isOn ( const Point pt,
Real  tolerance = 1e-6 
) const
inline
Returns
ture if point is on the plane
bool isOutside ( const Point P) const
inline
Returns
true if point is out the plane defined by the normal
bool isOutside ( const Point P1,
const Point P2 
) const
inline

Convenient for checking vertices of an edge or ray.

bool isOutside ( const Point P1,
const Point P2,
const Point P3 
) const
inline
bool isValid ( ) const
inline
Returns
TRUE if the plane is well defined, i.e. the normal is non-zero!
Plane lerp ( const Plane< Real > &  other,
Real  t 
) const
inline
Returns
linear interpolation of planes (both normals and positions). Note that t is clamped to [0;1] and t=0 returns this and t=1 returns other!
Plane lerpPoints ( const Plane< Real > &  other,
Real  t 
) const
inline
Returns
linear interpolation of planes (ONLY positions). Note that t is clamped to [0;1] and t=0 returns this and t=1 returns other!
bool operator!= ( const Plane< Real > &  other) const
inline
Returns
true if Planes are different. Note that strictly speaking two Planes can have different Points but still define identical half-planes. If you only care about the actual half-planes explicitly test the Norm and Dist!
bool operator== ( const Plane< Real > &  other) const
inline
Returns
true if Planes are identical. Note that strictly speaking two Planes can have different Points but still define identical half-planes. If you only care about the actual half-planes explicitly test the Norm and Dist! the .eq operator applies a tolerance to the equality
void set ( const Point P0,
const Vector N 
)
inline

redefines plane. Assumes N is normalized

void set ( const Point P0,
const Vector N,
Normalize   
)
inline

redefines plane. Does not assume N is normalized

void setNorm ( const Vector N)
inline

redefines normal of plane but assumes the plane is still going through the intersection point of the old plan normal. Assumes N is normalized

void setPoint ( const Point P0)
inline

redefines plane position but maintains the old normal

Plane slerp ( const Plane< Real > &  other,
Real  t 
) const
inline
Returns
plane from spherical interpolation of normals and linear interpolation of the positions. Note that t is clamped to [0;1] and t=0 returns this and t=1 returns other!

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