14#include "TGLIncludes.h"
102 for (
UInt_t i = 0; i<3; i++) {
201 if (
diff.X() < 0.0 ||
diff.Y() < 0.0 ||
diff.Z() < 0.0) {
202 Error(
"TGLBoundingBox::SetAligned",
"low/high vertex range error");
232 for (
UInt_t i = 0; i < 3; i++) {
233 if (
pnts[3*
p + i] < low[i]) {
234 low[i] =
pnts[3*
p + i] ;
236 if (
pnts[3*
p + i] > high[i]) {
237 high[i] =
pnts[3*
p + i] ;
251 if (
other.IsEmpty())
return;
287 Scale(factor, factor, factor);
520 for (i=0 ; i<3 ; i++) {
521 for (k=0; k<3; k++) {
524 if (fabs(
roaT[i][k]) < 1
e-14) {
538 for (i=0; i<3; i++) {
544 else if (
ra < t +
rb)
549 for (k=0; k<3; k++) {
555 else if (
ra < t +
rb)
567 else if (
ra < t +
rb)
576 else if (
ra < t +
rb)
585 else if (
ra < t +
rb)
594 else if (
ra < t +
rb)
603 else if (
ra < t +
rb)
612 else if (
ra < t +
rb)
621 else if (
ra < t +
rb)
630 else if (
ra < t +
rb)
639 else if (
ra < t +
rb)
777 for (
UInt_t i = 0; i<8; i++) {
778 std::cout <<
"[" << i <<
"] (" <<
fVertex[i].
X() <<
"," <<
fVertex[i].
Y() <<
"," <<
fVertex[i].
Z() <<
")" << std::endl;
782 std::cout <<
"Volume: " <<
Volume() << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Double_t Dot(const TGLVector3 &v1, const TGLVector3 &v2)
std::vector< TGLPlane > TGLPlaneSet_t
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Concrete class describing an orientated (free) or axis aligned box of 8 vertices.
Double_t Min(UInt_t index) const
Find minimum vertex value for axis of index X(0), Y(1), Z(2)
Double_t fDiagonal
box volume - cached for speed
TGLPlane GetNearPlane() const
Return the near-plane.
TGLVector3 Extents() const
TGLVertex3 Center() const
void Set(const TGLVertex3 vertex[8])
Set a bounding box from provided 8 vertices.
void SetEmpty()
Set bounding box empty - all vertices at (0,0,0)
void PlaneSet(TGLPlaneSet_t &planeSet) const
Fill out supplied plane set vector with TGLPlane objects representing six faces of box.
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----...
void Transform(const TGLMatrix &matrix)
Transform all vertices with matrix.
TGLVector3 fAxesNorm[3]
box axes in global frame - cached for speed
void MergeAligned(const TGLBoundingBox &other)
Expand current bbox so that it includes other's bbox.
void Translate(const TGLVector3 &offset)
Translate all vertices by offset.
TGLVertex3 MinAAVertex() const
Find minimum vertex values.
TGLBoundingBox()
Construct an empty bounding box.
void Scale(Double_t factor)
Isotropically scale bounding box along it's LOCAL axes, preserving center.
TGLVector3 fAxes[3]
max box diagonal - cached for speed
void SetAligned(const TGLVertex3 &lowVertex, const TGLVertex3 &highVertex)
Set ALIGNED box from two low/high vertices.
TGLVertex3 MaxAAVertex() const
Find maximum vertex values.
void UpdateCache()
normalised box axes in global frame - cached for speed
Double_t Max(UInt_t index) const
Find maximum vertex value for axis of index X(0), Y(1), Z(2)
const TGLVector3 & Axis(UInt_t i, Bool_t normalised=kTRUE) const
void ExpandAligned(const TGLVertex3 &point)
Expand current bbox so that it includes the point.
Double_t fVolume
the 8 bounding box vertices
virtual ~TGLBoundingBox()
Destroy bounding box.
void Dump() const
Output to std::cout the vertices, center and volume of box.
Rgl::EOverlap Overlap(const TGLPlane &plane) const
Find overlap (Inside, Outside, Partial) of plane c.f. bounding box.
void Draw(Bool_t solid=kFALSE) const
Draw the bounding box as either wireframe (default) of solid using current GL color.
16 component (4x4) transform matrix - column MAJOR as per GL.
3D plane class - of format Ax + By + Cz + D = 0
3 component (x/y/z) vector class.
3 component (x/y/z) vertex class.
void Dump() const
Output vertex component values to std::cout.
void Minimum(const TGLVertex3 &other)
void Maximum(const TGLVertex3 &other)
void Set(Double_t x, Double_t y, Double_t z)
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.