Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 524 of file TGLUtil.h.

Public Member Functions

 TGLPlane ()
 Construct a default plane of x + y + z = 0.
 
 TGLPlane (const TGLPlane &other)
 Construct plane from 'other'.
 
 TGLPlane (const TGLVector3 &norm, const TGLVertex3 &point)
 Construct plane with supplied normal vector, passing through point with optional normalisation.
 
 TGLPlane (const TGLVertex3 &p1, const TGLVertex3 &p2, const TGLVertex3 &p3)
 Construct plane passing through 3 supplied points with optional normalisation.
 
 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.
 
 TGLPlane (Double_t eq[4])
 Construct plane with equation eq[0].x + eq[1].y + eq[2].z + eq[3] = 0 with optional normalisation.
 
 ~TGLPlane ()=default
 
Double_t A () const
 
Double_tArr ()
 
Double_t B () const
 
Double_t C () const
 
const Double_tCArr () const
 
Double_t D () const
 
Double_t DistanceTo (const TGLVertex3 &vertex) const
 Distance from plane to vertex.
 
void Dump () const
 Output plane equation to std::out.
 
TClassIsA () const
 
TGLVertex3 NearestOn (const TGLVertex3 &point) const
 Return nearest point on plane.
 
void Negate ()
 Negate the plane.
 
TGLVector3 Norm () const
 
TGLPlaneoperator= (const TGLPlane &src)
 Assignment operator.
 
void Set (const TGLPlane &other)
 Assign from other.
 
void Set (const TGLVector3 &norm, const TGLVertex3 &point)
 Set plane from a normal vector and in-plane point pair.
 
void Set (const TGLVertex3 &p1, const TGLVertex3 &p2, const TGLVertex3 &p3)
 Set plane by three points.
 
void Set (Double_t a, Double_t b, Double_t c, Double_t d)
 Set by values.
 
void Set (Double_t eq[4])
 Set by array values.
 
void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Private Member Functions

void Normalise ()
 Normalise the plane.
 

Private Attributes

Double_t fVals [4]
 

#include <TGLUtil.h>

Constructor & Destructor Documentation

◆ TGLPlane() [1/6]

TGLPlane::TGLPlane ( )

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

Definition at line 336 of file TGLUtil.cxx.

◆ TGLPlane() [2/6]

TGLPlane::TGLPlane ( const TGLPlane other)

Construct plane from 'other'.

Definition at line 344 of file TGLUtil.cxx.

◆ TGLPlane() [3/6]

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 353 of file TGLUtil.cxx.

◆ TGLPlane() [4/6]

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 362 of file TGLUtil.cxx.

◆ TGLPlane() [5/6]

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

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

Definition at line 381 of file TGLUtil.cxx.

◆ TGLPlane() [6/6]

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

Construct plane passing through 3 supplied points with optional normalisation.

Definition at line 371 of file TGLUtil.cxx.

◆ ~TGLPlane()

TGLPlane::~TGLPlane ( )
default

Member Function Documentation

◆ A()

Double_t TGLPlane::A ( ) const
inline

Definition at line 553 of file TGLUtil.h.

◆ Arr()

Double_t * TGLPlane::Arr ( )
inline

Definition at line 564 of file TGLUtil.h.

◆ B()

Double_t TGLPlane::B ( ) const
inline

Definition at line 554 of file TGLUtil.h.

◆ C()

Double_t TGLPlane::C ( ) const
inline

Definition at line 555 of file TGLUtil.h.

◆ CArr()

const Double_t * TGLPlane::CArr ( ) const
inline

Definition at line 563 of file TGLUtil.h.

◆ Class()

static TClass * TGLPlane::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TGLPlane::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TGLPlane::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 568 of file TGLUtil.h.

◆ D()

Double_t TGLPlane::D ( ) const
inline

Definition at line 556 of file TGLUtil.h.

◆ DeclFileName()

static const char * TGLPlane::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 568 of file TGLUtil.h.

◆ DistanceTo()

Double_t TGLPlane::DistanceTo ( const TGLVertex3 vertex) const

Distance from plane to vertex.

Definition at line 492 of file TGLUtil.cxx.

◆ Dump()

void TGLPlane::Dump ( ) const

Output plane equation to std::out.

Definition at line 416 of file TGLUtil.cxx.

◆ IsA()

TClass * TGLPlane::IsA ( ) const
inline
Returns
TClass describing current object

Definition at line 568 of file TGLUtil.h.

◆ NearestOn()

TGLVertex3 TGLPlane::NearestOn ( const TGLVertex3 point) const

Return nearest point on plane.

Definition at line 500 of file TGLUtil.cxx.

◆ Negate()

void TGLPlane::Negate ( )

Negate the plane.

Definition at line 481 of file TGLUtil.cxx.

◆ Norm()

TGLVector3 TGLPlane::Norm ( ) const
inline

Definition at line 558 of file TGLUtil.h.

◆ Normalise()

void TGLPlane::Normalise ( )
private

Normalise the plane.

Definition at line 398 of file TGLUtil.cxx.

◆ operator=()

TGLPlane & TGLPlane::operator= ( const TGLPlane src)

Assignment operator.

Definition at line 389 of file TGLUtil.cxx.

◆ Set() [1/5]

void TGLPlane::Set ( const TGLPlane other)

Assign from other.

Definition at line 425 of file TGLUtil.cxx.

◆ Set() [2/5]

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

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

Definition at line 460 of file TGLUtil.cxx.

◆ Set() [3/5]

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

Set plane by three points.

Definition at line 472 of file TGLUtil.cxx.

◆ Set() [4/5]

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

Set by values.

Definition at line 436 of file TGLUtil.cxx.

◆ Set() [5/5]

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

Set by array values.

Definition at line 448 of file TGLUtil.cxx.

◆ Streamer()

void TGLPlane::Streamer ( TBuffer )

◆ StreamerNVirtual()

void TGLPlane::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 568 of file TGLUtil.h.

Member Data Documentation

◆ fVals

Double_t TGLPlane::fVals[4]
private

Definition at line 528 of file TGLUtil.h.

Libraries for TGLPlane:

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