library: libRGL
#include "TGLBoundingBox.h"

TGLBoundingBox


class description - source file - inheritance tree (.pdf)

class TGLBoundingBox

Inheritance Chart:
TGLBoundingBox
    private:
Double_t Max(UInt_t index) const Double_t Min(UInt_t index) const void UpdateCache() Bool_t ValidIndex(UInt_t index) const public:
TGLBoundingBox() TGLBoundingBox(const TGLVertex3* vertex) TGLBoundingBox(const Double_t** vertex) TGLBoundingBox(const TGLVertex3& lowVertex, const TGLVertex3& highVertex) TGLBoundingBox(const TGLBoundingBox& other) virtual ~TGLBoundingBox() const TGLVector3& Axis(UInt_t i, Bool_t normalised = kTRUE) const TGLVertex3 Center() const static TClass* Class() void Draw(Bool_t solid = kFALSE) const void Dump() const TGLVector3 Extents() const virtual TClass* IsA() const Bool_t IsEmpty() const TGLBoundingBox& operator=(const TGLBoundingBox& other) const TGLVertex3& operator[](UInt_t index) const EOverlap Overlap(const TGLPlane& plane) const EOverlap Overlap(const TGLBoundingBox& box) const void PlaneSet(TGLPlaneSet_t& planeSet) const void Scale(Double_t factor) void Scale(Double_t xFactor, Double_t yFactor, Double_t zFactor) void Set(const TGLVertex3* vertex) void Set(const Double_t** vertex) void Set(const TGLBoundingBox& other) void SetAligned(const TGLVertex3& lowVertex, const TGLVertex3& highVertex) void SetAligned(UInt_t nbPnts, const Double_t* pnts) void SetEmpty() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void Transform(const TGLMatrix& matrix) void Translate(const TGLVector3& offset) const TGLVertex3& Vertex(UInt_t index) const Double_t Volume() const Double_t XMax() const Double_t XMin() const Double_t YMax() const Double_t YMin() const Double_t ZMax() const Double_t ZMin() const

Data Members

    private:
TGLVertex3 fVertex[8] ! the 8 bounding box vertices Double_t fVolume ! box volume - cached for speed TGLVector3 fAxes[3] ! box axes in global frame - cached for speed TGLVector3 fAxesNorm[3] ! normalised box axes in global frame - cached for speed

Class Description

                                                                      
 TGLBoundingBox                                                       
                                                                      
 Concrete class describing an orientated (free) or axis aligned box   
 of 8 verticies. Supports methods for setting aligned or orientated   
 boxes, find volume, axes, extents, centers, face planes etc.         
 Also tests for overlap testing of planes and other bounding boxes,   
 with fast sphere approximation.                                      


TGLBoundingBox()
 Construct an empty bounding box

TGLBoundingBox(const TGLVertex3 vertex[8])
 Construct a bounding box from provided 8 vertices

TGLBoundingBox(const Double_t vertex[8][3])
 Construct a bounding box from provided 8 vertices

TGLBoundingBox(const TGLVertex3 & lowVertex, const TGLVertex3 & highVertex)
 Construct an global axis ALIGNED bounding box from provided low/high vertex pair

TGLBoundingBox(const TGLBoundingBox & other)
 Construct a bounding box as copy of existing one

~TGLBoundingBox()
 Destroy bounding box

void UpdateCache()
 Update the internally cached volume and axes vectors - these are retained
 for efficiency - many more reads than modifications

void Set(const TGLVertex3 vertex[8])
 Set a bounding box from provided 8 vertices

void Set(const Double_t vertex[8][3])
 Set a bounding box from provided 8 vertices

void Set(const TGLBoundingBox & other)
 Set a bounding box from vertices of other

void SetEmpty()
 Set bounding box empty - all vertices at (0,0,0)

void SetAligned(const TGLVertex3 & lowVertex, const TGLVertex3 & highVertex)
 Set ALIGNED box from two low/high vertices. Box axes are aligned with
 global frame axes that vertices are specified in.

void SetAligned(UInt_t nbPnts, const Double_t * pnts)
 Set ALIGNED box from one or more points. Box axes are aligned with
 global frame axes that points are specified in.

void Scale(Double_t factor)
 Isotropically scale bounding box along it's LOCAL axes, preserving center

void Scale(Double_t xFactor, Double_t yFactor, Double_t zFactor)
 Asymetrically scale box along it's LOCAL x,y,z axes, preserving center

void Translate(const TGLVector3 & offset)
 Translate all vertices by offset

void Transform(const TGLMatrix & matrix)
 Transform all vertices with matrix

void PlaneSet(TGLPlaneSet_t & planeSet) const
 Fill out supplied plane set vector with TGLPlane objects
 representing six faces of box

EOverlap Overlap(const TGLPlane & plane) const
 Find overlap (Inside, Outside, Partial) of plane c.f. bounding box

EOverlap Overlap(const TGLBoundingBox & other) const
 Find overlap (Inside, Outside, Partial) of other bounding box c.f. us

void Draw(Bool_t solid) const
 Draw the bounding box as either wireframe (default) of solid using current GL color

Double_t Min(UInt_t index) const
 Find minimum vertex value for axis of index X(0), Y(1), Z(2)

Double_t Max(UInt_t index) const
 Find maximum vertex value for axis of index X(0), Y(1), Z(2)

void Dump() const
 Output to std::cout the vertices, center and volume of box



Inline Functions


                   Bool_t ValidIndex(UInt_t index) const
          TGLBoundingBox& operator=(const TGLBoundingBox& other)
        const TGLVertex3& operator[](UInt_t index) const
        const TGLVertex3& Vertex(UInt_t index) const
                 Double_t XMin() const
                 Double_t XMax() const
                 Double_t YMin() const
                 Double_t YMax() const
                 Double_t ZMin() const
                 Double_t ZMax() const
               TGLVertex3 Center() const
               TGLVector3 Extents() const
        const TGLVector3& Axis(UInt_t i, Bool_t normalised = kTRUE) const
                   Bool_t IsEmpty() const
                 Double_t Volume() const
                  TClass* Class()
                  TClass* IsA() const
                     void ShowMembers(TMemberInspector& insp, char* parent)
                     void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)


Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLBoundingBox.cxx,v 1.17 2005/12/01 11:04:04 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.