ROOT
6.07/01
Reference Guide
|
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
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.
Definition at line 32 of file TGLBoundingBox.h.
Public Types | |
enum | EFace { kFaceLowX, kFaceHighX, kFaceLowY, kFaceHighY, kFaceLowZ, kFaceHighZ, kFaceCount } |
Public Member Functions | |
TGLBoundingBox () | |
TGLBoundingBox (const TGLVertex3 vertex[8]) | |
Construct a bounding box from provided 8 vertices. More... | |
TGLBoundingBox (const Double_t vertex[8][3]) | |
Construct a bounding box from provided 8 vertices. More... | |
TGLBoundingBox (const TGLVertex3 &lowVertex, const TGLVertex3 &highVertex) | |
Construct an global axis ALIGNED bounding box from provided low/high vertex pair. More... | |
TGLBoundingBox (const TGLBoundingBox &other) | |
Construct a bounding box as copy of existing one. More... | |
virtual | ~TGLBoundingBox () |
Destroy bounding box. More... | |
TGLBoundingBox & | operator= (const TGLBoundingBox &other) |
void | Set (const TGLVertex3 vertex[8]) |
Set a bounding box from provided 8 vertices. More... | |
void | Set (const Double_t vertex[8][3]) |
Set a bounding box from provided 8 vertices. More... | |
void | Set (const TGLBoundingBox &other) |
Set a bounding box from vertices of other. More... | |
void | SetEmpty () |
Set bounding box empty - all vertices at (0,0,0) More... | |
void | SetAligned (const TGLVertex3 &lowVertex, const TGLVertex3 &highVertex) |
Set ALIGNED box from two low/high vertices. More... | |
void | SetAligned (UInt_t nbPnts, const Double_t *pnts) |
Set ALIGNED box from one or more points. More... | |
void | MergeAligned (const TGLBoundingBox &other) |
Expand current bbox so that it includes other's bbox. More... | |
void | ExpandAligned (const TGLVertex3 &point) |
Expand current bbox so that it includes the point. More... | |
void | Transform (const TGLMatrix &matrix) |
Transform all vertices with matrix. More... | |
void | Scale (Double_t factor) |
Isotropically scale bounding box along it's LOCAL axes, preserving center. More... | |
void | Scale (Double_t xFactor, Double_t yFactor, Double_t zFactor) |
Asymmetrically scale box along it's LOCAL x,y,z axes, preserving center. More... | |
void | Translate (const TGLVector3 &offset) |
Translate all vertices by offset. More... | |
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 | MinAAVertex () const |
Find minimum vertex values. More... | |
TGLVertex3 | MaxAAVertex () const |
Find maximum vertex values. More... | |
const TGLVertex3 * | Vertices () const |
Int_t | NumVertices () const |
const std::vector< UInt_t > & | FaceVertices (EFace face) const |
return a vector of face vertices y | | |________x / 3----—2 / /| /| z 7----—6 | | 0--—|-1 |/ |/ 4----—5 More... | |
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 |
Double_t | Diagonal () const |
void | PlaneSet (TGLPlaneSet_t &planeSet) const |
Fill out supplied plane set vector with TGLPlane objects representing six faces of box. More... | |
TGLPlane | GetNearPlane () const |
Return the near-plane. More... | |
Rgl::EOverlap | Overlap (const TGLPlane &plane) const |
Find overlap (Inside, Outside, Partial) of plane c.f. bounding box. More... | |
Rgl::EOverlap | Overlap (const TGLBoundingBox &box) const |
Find overlap (Inside, Outside, Partial) of other bounding box c.f. us. More... | |
void | Draw (Bool_t solid=kFALSE) const |
Draw the bounding box as either wireframe (default) of solid using current GL color. More... | |
void | Dump () const |
Output to std::cout the vertices, center and volume of box. More... | |
ClassDef (TGLBoundingBox, 0) | |
Private Member Functions | |
void | UpdateCache () |
normalised box axes in global frame - cached for speed More... | |
Bool_t | ValidIndex (UInt_t index) const |
Double_t | Min (UInt_t index) const |
Find minimum vertex value for axis of index X(0), Y(1), Z(2) More... | |
Double_t | Max (UInt_t index) const |
Find maximum vertex value for axis of index X(0), Y(1), Z(2) More... | |
Private Attributes | |
TGLVertex3 | fVertex [8] |
Double_t | fVolume |
the 8 bounding box vertices More... | |
Double_t | fDiagonal |
box volume - cached for speed More... | |
TGLVector3 | fAxes [3] |
max box diagonal - cached for speed More... | |
TGLVector3 | fAxesNorm [3] |
box axes in global frame - cached for speed More... | |
#include <TGLBoundingBox.h>
Enumerator | |
---|---|
kFaceLowX | |
kFaceHighX | |
kFaceLowY | |
kFaceHighY | |
kFaceLowZ | |
kFaceHighZ | |
kFaceCount |
Definition at line 113 of file TGLBoundingBox.h.
TGLBoundingBox::TGLBoundingBox | ( | ) |
TGLBoundingBox::TGLBoundingBox | ( | const TGLVertex3 | vertex[8] | ) |
Construct a bounding box from provided 8 vertices.
Definition at line 41 of file TGLBoundingBox.cxx.
TGLBoundingBox::TGLBoundingBox | ( | const Double_t | vertex[8][3] | ) |
Construct a bounding box from provided 8 vertices.
Definition at line 49 of file TGLBoundingBox.cxx.
TGLBoundingBox::TGLBoundingBox | ( | const TGLVertex3 & | lowVertex, |
const TGLVertex3 & | highVertex | ||
) |
Construct an global axis ALIGNED bounding box from provided low/high vertex pair.
Definition at line 57 of file TGLBoundingBox.cxx.
TGLBoundingBox::TGLBoundingBox | ( | const TGLBoundingBox & | other | ) |
Construct a bounding box as copy of existing one.
Definition at line 65 of file TGLBoundingBox.cxx.
|
virtual |
Destroy bounding box.
Definition at line 73 of file TGLBoundingBox.cxx.
|
inline |
Definition at line 183 of file TGLBoundingBox.h.
Referenced by TGLManip::CalcDrawScale(), TGLRotateManip::Draw(), Extents(), TGLRotateManip::HandleButton(), TGLTransManip::HandleMotion(), TGLScaleManip::HandleMotion(), and TGLAutoRotator::RotateScene().
|
inline |
Definition at line 174 of file TGLBoundingBox.h.
Referenced by TGLManip::CalcDrawScale(), TGLTransManip::Draw(), TGLScaleManip::Draw(), TGLRotateManip::Draw(), TGLViewer::DrawDebugInfo(), TGLUtil::DrawSimpleAxes(), TGLClipSet::GetClipState(), TGLRotateManip::HandleButton(), TGLTransManip::HandleMotion(), TGLScaleManip::HandleMotion(), TGLViewer::PostSceneBuildSetup(), TEveLegoEventHandler::Rotate(), TGLPhysicalShape::Rotate(), TGLAutoRotator::RotateScene(), TGLPhysicalShape::Scale(), TGLClipPlane::Set(), TGLClipSet::SetClipState(), TGLPerspectiveCamera::Setup(), TGLOrthoCamera::Setup(), TGLClipPlane::Setup(), TGLClipBox::Setup(), and TGLLightSet::StdSetupLights().
TGLBoundingBox::ClassDef | ( | TGLBoundingBox | , |
0 | |||
) |
|
inline |
Definition at line 122 of file TGLBoundingBox.h.
Referenced by TGLScene::ComparePhysicalDiagonals(), IsEmpty(), and TGLCamera::OfInterest().
Draw the bounding box as either wireframe (default) of solid using current GL color.
Definition at line 652 of file TGLBoundingBox.cxx.
Referenced by TGLCamera::DrawDebugAids(), TGLViewer::DrawDebugInfo(), TGLUtil::DrawLine(), and TGLManipSet::Render().
void TGLBoundingBox::Dump | ( | ) | const |
Output to std::cout the vertices, center and volume of box.
Definition at line 777 of file TGLBoundingBox.cxx.
void TGLBoundingBox::ExpandAligned | ( | const TGLVertex3 & | point | ) |
Expand current bbox so that it includes the point.
This make the bbox axis-aligned.
Definition at line 273 of file TGLBoundingBox.cxx.
|
inline |
Definition at line 165 of file TGLBoundingBox.h.
Referenced by TGLManip::CalcDrawScale(), TGLViewer::DrawDebugInfo(), TGLClipSet::GetClipState(), TGLOrthoCamera::Reset(), TEveLegoEventHandler::Rotate(), TGLClipSet::SetClipState(), TGLPerspectiveCamera::Setup(), TGLClipPlane::Setup(), TGLClipBox::Setup(), TGLLightSet::StdSetupLights(), and TGLCamera::UpdateInterest().
return a vector of face vertices y | | |________x / 3----—2 / /| /| z 7----—6 | | 0--—|-1 |/ |/ 4----—5
Definition at line 369 of file TGLBoundingBox.cxx.
Referenced by TGLCamera::ViewportRect().
TGLPlane TGLBoundingBox::GetNearPlane | ( | ) | const |
Return the near-plane.
Definition at line 440 of file TGLBoundingBox.cxx.
Referenced by TGLClipPlane::PlaneSet(), and TGLClipPlane::Setup().
|
inline |
Definition at line 207 of file TGLBoundingBox.h.
Referenced by TGLManip::CalcDrawScale(), TEveTextGL::DirectDraw(), MergeAligned(), TGLCamera::OfInterest(), TGLViewerBase::PreRender(), TGLViewer::SetupCameras(), TGLLightSet::StdSetupLights(), and TGLCamera::UpdateInterest().
Find maximum vertex value for axis of index X(0), Y(1), Z(2)
Definition at line 747 of file TGLBoundingBox.cxx.
TGLVertex3 TGLBoundingBox::MaxAAVertex | ( | ) | const |
Find maximum vertex values.
Definition at line 769 of file TGLBoundingBox.cxx.
Referenced by MergeAligned().
void TGLBoundingBox::MergeAligned | ( | const TGLBoundingBox & | other | ) |
Expand current bbox so that it includes other's bbox.
This make the bbox axis-aligned.
Definition at line 251 of file TGLBoundingBox.cxx.
Referenced by TGLViewerBase::MergeSceneBBoxes(), and TGLViewerBase::PreRender().
Find minimum vertex value for axis of index X(0), Y(1), Z(2)
Definition at line 733 of file TGLBoundingBox.cxx.
TGLVertex3 TGLBoundingBox::MinAAVertex | ( | ) | const |
Find minimum vertex values.
Definition at line 761 of file TGLBoundingBox.cxx.
Referenced by MergeAligned().
|
inline |
Definition at line 111 of file TGLBoundingBox.h.
Referenced by TGLCamera::ViewportRect().
|
inline |
Definition at line 137 of file TGLBoundingBox.h.
|
inline |
Definition at line 147 of file TGLBoundingBox.h.
Rgl::EOverlap TGLBoundingBox::Overlap | ( | const TGLPlane & | plane | ) | const |
Find overlap (Inside, Outside, Partial) of plane c.f. bounding box.
Definition at line 448 of file TGLBoundingBox.cxx.
Referenced by TGLCamera::FrustumOverlap(), TGLScene::IsOutside(), TGLCamera::OfInterest(), TGLCamera::UpdateInterest(), TGLSceneBase::UpdateSceneInfo(), and TGLScene::UpdateSceneInfo().
Rgl::EOverlap TGLBoundingBox::Overlap | ( | const TGLBoundingBox & | box | ) | const |
Find overlap (Inside, Outside, Partial) of other bounding box c.f. us.
Definition at line 478 of file TGLBoundingBox.cxx.
void TGLBoundingBox::PlaneSet | ( | TGLPlaneSet_t & | planeSet | ) | const |
Fill out supplied plane set vector with TGLPlane objects representing six faces of box.
Definition at line 413 of file TGLBoundingBox.cxx.
Referenced by TGLClipBox::PlaneSet().
Isotropically scale bounding box along it's LOCAL axes, preserving center.
Definition at line 287 of file TGLBoundingBox.cxx.
Referenced by TGLCamera::UpdateInterest().
Asymmetrically scale box along it's LOCAL x,y,z axes, preserving center.
Definition at line 297 of file TGLBoundingBox.cxx.
void TGLBoundingBox::Set | ( | const TGLVertex3 | vertex[8] | ) |
Set a bounding box from provided 8 vertices.
Definition at line 134 of file TGLBoundingBox.cxx.
Referenced by operator=(), TF2GL::SetBBox(), TGLParametricEquationGL::SetBBox(), TH2GL::SetBBox(), TH3GL::SetBBox(), TGLLogicalShape::TGLLogicalShape(), and TGLPhysicalShape::UpdateBoundingBox().
Set a bounding box from provided 8 vertices.
Definition at line 146 of file TGLBoundingBox.cxx.
void TGLBoundingBox::Set | ( | const TGLBoundingBox & | other | ) |
Set a bounding box from vertices of other.
Definition at line 160 of file TGLBoundingBox.cxx.
void TGLBoundingBox::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.
Definition at line 185 of file TGLBoundingBox.cxx.
Referenced by TGLScene::CalcBoundingBox(), TEveTextGL::DirectDraw(), TEveLegoEventHandler::Rotate(), TGLObject::SetAxisAlignedBBox(), and TGLLogicalShape::TGLLogicalShape().
Set ALIGNED box from one or more points.
Box axes are aligned with global frame axes that points are specified in.
Definition at line 222 of file TGLBoundingBox.cxx.
void TGLBoundingBox::SetEmpty | ( | ) |
Set bounding box empty - all vertices at (0,0,0)
Definition at line 172 of file TGLBoundingBox.cxx.
Referenced by TGLViewerBase::MergeSceneBBoxes(), TGLViewerBase::PreRender(), TGLCamera::ResetInterest(), and TEveTextGL::SetBBox().
Transform all vertices with matrix.
Definition at line 345 of file TGLBoundingBox.cxx.
Referenced by TEveLegoEventHandler::Rotate(), and TGLPhysicalShape::UpdateBoundingBox().
void TGLBoundingBox::Translate | ( | const TGLVector3 & | offset | ) |
Translate all vertices by offset.
Definition at line 333 of file TGLBoundingBox.cxx.
|
private |
normalised box axes in global frame - cached for speed
Update the internally cached volume and axes vectors - these are retained for efficiency - many more reads than modifications.
Definition at line 81 of file TGLBoundingBox.cxx.
Definition at line 66 of file TGLBoundingBox.h.
|
inline |
Definition at line 153 of file TGLBoundingBox.h.
Referenced by TGLCamera::ViewportRect().
|
inline |
Definition at line 159 of file TGLBoundingBox.h.
|
inline |
Definition at line 121 of file TGLBoundingBox.h.
Referenced by TGLScene::ComparePhysicalVolumes(), and TGLCamera::UpdateInterest().
|
inline |
Definition at line 101 of file TGLBoundingBox.h.
Referenced by TGLScenePad::AddHistoPhysical(), TGLScene::CalcBoundingBox(), TGLUtil::DrawSimpleAxes(), and TGLAxisPainterBox::PlotStandard().
|
inline |
Definition at line 100 of file TGLBoundingBox.h.
Referenced by TGLScenePad::AddHistoPhysical(), TGLScene::CalcBoundingBox(), TGLUtil::DrawSimpleAxes(), and TGLAxisPainterBox::PlotStandard().
|
inline |
Definition at line 103 of file TGLBoundingBox.h.
Referenced by TGLScene::CalcBoundingBox(), TGLUtil::DrawSimpleAxes(), and TGLAxisPainterBox::PlotStandard().
|
inline |
Definition at line 102 of file TGLBoundingBox.h.
Referenced by TGLScene::CalcBoundingBox(), TGLUtil::DrawSimpleAxes(), and TGLAxisPainterBox::PlotStandard().
|
inline |
Definition at line 105 of file TGLBoundingBox.h.
Referenced by TGLScene::CalcBoundingBox(), TGLUtil::DrawSimpleAxes(), and TGLAxisPainterBox::PlotStandard().
|
inline |
Definition at line 104 of file TGLBoundingBox.h.
Referenced by TGLScene::CalcBoundingBox(), TGLUtil::DrawSimpleAxes(), and TGLAxisPainterBox::PlotStandard().
|
private |
max box diagonal - cached for speed
Definition at line 61 of file TGLBoundingBox.h.
Referenced by Axis().
|
private |
box axes in global frame - cached for speed
Definition at line 62 of file TGLBoundingBox.h.
Referenced by Axis().
|
private |
box volume - cached for speed
Definition at line 60 of file TGLBoundingBox.h.
Referenced by Diagonal().
|
private |
Definition at line 58 of file TGLBoundingBox.h.
Referenced by Center(), operator[](), Set(), Vertex(), and Vertices().
|
private |