library: libRGL #include "TGLBoundingBox.h" |
TGLBoundingBox
class description - header file - source file
viewCVS header - viewCVS source
class TGLBoundingBox
Function Members (Methods)
Display options:
Data Members
public:
enum EFace { | kFaceLowX | |
| kFaceHighX | |
| kFaceLowY | |
| kFaceHighY | |
| kFaceLowZ | |
| kFaceHighZ | |
| kFaceCount | |
}; | | |
private:
vector<TGLVertex3> | fVertex | ! 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 |
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.
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 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
const std::vector<UInt_t> & FaceVertices(EFace face)
return a vector of face vertices
y
|
|
|________x
/ 3-------2
/ /| /|
z 7-------6 |
| 0-----|-1
|/ |/
4-------5
EOverlap Overlap(const TGLPlane & plane)
Find overlap (Inside, Outside, Partial) of plane c.f. bounding box
EOverlap Overlap(const TGLBoundingBox & other)
Find overlap (Inside, Outside, Partial) of other bounding box c.f. us
void Draw(Bool_t solid)
Draw the bounding box as either wireframe (default) of solid using current GL color
Double_t Min(UInt_t index)
Find minimum vertex value for axis of index X(0), Y(1), Z(2)
Double_t Max(UInt_t index)
Find maximum vertex value for axis of index X(0), Y(1), Z(2)
void Dump()
Output to std::cout the vertices, center and volume of box
const TGLVertex3 & Vertex(UInt_t index)
______________________________________________________________________________
const std::vector<TGLVertex3> & Vertices()
______________________________________________________________________________
TGLVector3 Extents()
______________________________________________________________________________
Return the local axis entents of the box
TGLVertex3 Center()
______________________________________________________________________________
Return the center vertex of the box
const TGLVector3 & Axis(UInt_t i, Bool_t normalised)
______________________________________________________________________________
Return a vector representing axis of index i (0:X, 1:Y, 2:Z).
Vector can be as-is (edge, magnitude == extent) or normalised (default)
y
|
|
|________x
/ 3-------2
/ /| /|
z 7-------6 |
| 0-----|-1
|/ |/
4-------5
Bool_t IsEmpty()
______________________________________________________________________________
Return kTRUE if box has zero volume - kFALSE otherwise
Author: Richard Maunder 25/05/2005
Last update: root/gl:$Name: $:$Id: TGLBoundingBox.cxx,v 1.19 2006/05/26 09:12:37 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.