ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TGLPlane Class Reference

3D plane class - of format Ax + By + Cz + D = 0

This is part of collection of simple utility classes for GL only in TGLUtil.h/cxx. These provide const and non-const accessors Arr() & CArr() to a GL compatible internal field - so can be used directly with OpenGL C API calls - which TVector3 etc cannot (easily). They are not intended to be fully featured just provide minimum required.

Definition at line 529 of file TGLUtil.h.

Public Member Functions

 TGLPlane ()
 Construct a default plane of x + y + z = 0. More...
 
 TGLPlane (const TGLPlane &other)
 Construct plane from 'other'. More...
 
 TGLPlane (Double_t a, Double_t b, Double_t c, Double_t d)
 Construct plane with equation a.x + b.y + c.z + d = 0 with optional normalisation. More...
 
 TGLPlane (Double_t eq[4])
 Construct plane with equation eq[0].x + eq[1].y + eq[2].z + eq[3] = 0 with optional normalisation. More...
 
 TGLPlane (const TGLVector3 &norm, const TGLVertex3 &point)
 Construct plane with supplied normal vector, passing through point with optional normalisation. More...
 
 TGLPlane (const TGLVertex3 &p1, const TGLVertex3 &p2, const TGLVertex3 &p3)
 Construct plane passing through 3 supplied points with optional normalisation. More...
 
virtual ~TGLPlane ()
 Destroy plane object. More...
 
void Set (const TGLPlane &other)
 Assign from other. More...
 
void Set (Double_t a, Double_t b, Double_t c, Double_t d)
 Set by values. More...
 
void Set (Double_t eq[4])
 Set by array values. More...
 
void Set (const TGLVector3 &norm, const TGLVertex3 &point)
 Set plane from a normal vector and in-plane point pair. More...
 
void Set (const TGLVertex3 &p1, const TGLVertex3 &p2, const TGLVertex3 &p3)
 Set plane by three points. More...
 
void Negate ()
 Negate the plane. More...
 
Double_t A () const
 
Double_t B () const
 
Double_t C () const
 
Double_t D () const
 
TGLVector3 Norm () const
 
Double_t DistanceTo (const TGLVertex3 &vertex) const
 Distance from plane to vertex. More...
 
TGLVertex3 NearestOn (const TGLVertex3 &point) const
 Return nearest point on plane. More...
 
const Double_tCArr () const
 
Double_tArr ()
 
void Dump () const
 Output plane equation to std::out. More...
 
 ClassDef (TGLPlane, 0)
 

Private Member Functions

void Normalise ()
 Normalise the plane. More...
 

Private Attributes

Double_t fVals [4]
 

#include <TGLUtil.h>

Constructor & Destructor Documentation

TGLPlane::TGLPlane ( )

Construct a default plane of x + y + z = 0.

Definition at line 366 of file TGLUtil.cxx.

TGLPlane::TGLPlane ( const TGLPlane other)

Construct plane from 'other'.

Definition at line 374 of file TGLUtil.cxx.

TGLPlane::TGLPlane ( Double_t  a,
Double_t  b,
Double_t  c,
Double_t  d 
)

Construct plane with equation a.x + b.y + c.z + d = 0 with optional normalisation.

Definition at line 383 of file TGLUtil.cxx.

TGLPlane::TGLPlane ( Double_t  eq[4])

Construct plane with equation eq[0].x + eq[1].y + eq[2].z + eq[3] = 0 with optional normalisation.

Definition at line 392 of file TGLUtil.cxx.

TGLPlane::TGLPlane ( const TGLVector3 norm,
const TGLVertex3 point 
)

Construct plane with supplied normal vector, passing through point with optional normalisation.

Definition at line 411 of file TGLUtil.cxx.

TGLPlane::TGLPlane ( const TGLVertex3 p1,
const TGLVertex3 p2,
const TGLVertex3 p3 
)

Construct plane passing through 3 supplied points with optional normalisation.

Definition at line 401 of file TGLUtil.cxx.

TGLPlane::~TGLPlane ( )
virtual

Destroy plane object.

Definition at line 419 of file TGLUtil.cxx.

Member Function Documentation

Double_t TGLPlane::A ( ) const
inline

Definition at line 556 of file TGLUtil.h.

Referenced by Intersection().

Double_t* TGLPlane::Arr ( )
inline

Definition at line 567 of file TGLUtil.h.

Double_t TGLPlane::B ( ) const
inline

Definition at line 557 of file TGLUtil.h.

Referenced by Intersection().

Double_t TGLPlane::C ( ) const
inline

Definition at line 558 of file TGLUtil.h.

Referenced by Intersection().

const Double_t* TGLPlane::CArr ( ) const
inline

Definition at line 566 of file TGLUtil.h.

Referenced by TGLScene::RenderAllPasses().

TGLPlane::ClassDef ( TGLPlane  ,
 
)
Double_t TGLPlane::D ( ) const
inline
Double_t TGLPlane::DistanceTo ( const TGLVertex3 vertex) const

Distance from plane to vertex.

Definition at line 520 of file TGLUtil.cxx.

Referenced by TGLPerspectiveCamera::Apply(), TGLBoundingBox::Overlap(), and TGLLightSet::StdSetupLights().

void TGLPlane::Dump ( ) const

Output plane equation to std::out.

Definition at line 444 of file TGLUtil.cxx.

TGLVertex3 TGLPlane::NearestOn ( const TGLVertex3 point) const

Return nearest point on plane.

Definition at line 528 of file TGLUtil.cxx.

Referenced by TGLRotateManip::Draw(), TGLCamera::Frustum(), and TGLClipPlane::Set().

void TGLPlane::Negate ( )

Negate the plane.

Definition at line 509 of file TGLUtil.cxx.

Referenced by TGLClipPlane::PlaneSet(), and TGLScene::RenderAllPasses().

TGLVector3 TGLPlane::Norm ( ) const
inline
void TGLPlane::Normalise ( )
private

Normalise the plane.

Definition at line 426 of file TGLUtil.cxx.

void TGLPlane::Set ( const TGLPlane other)

Assign from other.

Definition at line 453 of file TGLUtil.cxx.

Referenced by TGLRotateManip::HandleButton(), TGLCamera::TGLCamera(), and TGLCamera::UpdateCache().

void TGLPlane::Set ( Double_t  a,
Double_t  b,
Double_t  c,
Double_t  d 
)

Set by values.

Definition at line 464 of file TGLUtil.cxx.

void TGLPlane::Set ( Double_t  eq[4])

Set by array values.

Definition at line 476 of file TGLUtil.cxx.

void TGLPlane::Set ( const TGLVector3 norm,
const TGLVertex3 point 
)

Set plane from a normal vector and in-plane point pair.

Definition at line 488 of file TGLUtil.cxx.

void TGLPlane::Set ( const TGLVertex3 p1,
const TGLVertex3 p2,
const TGLVertex3 p3 
)

Set plane by three points.

Definition at line 500 of file TGLUtil.cxx.

Member Data Documentation

Double_t TGLPlane::fVals[4]
private

Definition at line 533 of file TGLUtil.h.

Referenced by A(), Arr(), B(), C(), CArr(), D(), Norm(), and Set().


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