#include <BoundingBox.h>
Public Member Functions | |
BoundingBox () | |
BoundingBox (const BoundPlane &plane) | |
GlobalPoint const & | corner (unsigned int i) const |
GlobalPoint const & | operator[] (unsigned int i) const |
Static Public Member Functions | |
static std::vector< GlobalPoint > | corners (const BoundPlane &) |
Private Attributes | |
GlobalPoint | m_corners [8] |
A helper class that returns the corners of a rectangle that fully contains a bound plane.
Definition at line 12 of file BoundingBox.h.
BoundingBox::BoundingBox | ( | ) | [inline] |
Definition at line 15 of file BoundingBox.h.
{}
BoundingBox::BoundingBox | ( | const BoundPlane & | plane | ) |
Definition at line 6 of file BoundingBox.cc.
References BoundSurface::bounds(), Bounds::length(), m_corners, Bounds::thickness(), Surface::toGlobal(), and Bounds::width().
{ float hLen = plane.bounds().length() / 2; float hWid = plane.bounds().width() / 2; float hThick = plane.bounds().thickness() / 2; m_corners[0] = plane.toGlobal( LocalPoint( hWid, hLen, hThick)); m_corners[1] = plane.toGlobal( LocalPoint( hWid, hLen,-hThick)); m_corners[2] = plane.toGlobal( LocalPoint( hWid,-hLen, hThick)); m_corners[3] = plane.toGlobal( LocalPoint( hWid,-hLen,-hThick)); m_corners[4] = plane.toGlobal( LocalPoint(-hWid, hLen, hThick)); m_corners[5] = plane.toGlobal( LocalPoint(-hWid, hLen,-hThick)); m_corners[6] = plane.toGlobal( LocalPoint(-hWid,-hLen, hThick)); m_corners[7] = plane.toGlobal( LocalPoint(-hWid,-hLen,-hThick)); }
GlobalPoint const& BoundingBox::corner | ( | unsigned int | i | ) | const [inline] |
std::vector< GlobalPoint > BoundingBox::corners | ( | const BoundPlane & | plane | ) | [static] |
Definition at line 24 of file BoundingBox.cc.
References BoundSurface::bounds(), Bounds::length(), query::result, Bounds::thickness(), Surface::toGlobal(), and Bounds::width().
Referenced by GCC11_FINAL< T >::computeBounds(), PlaneBuilderForGluedDet::computeRectBounds(), BarrelDetLayer::computeSurface(), ForwardDetLayer::computeSurface(), and PhiBorderFinder::PhiBorderFinder().
{ std::vector<GlobalPoint> result; result.reserve(8); float hLen = plane.bounds().length() / 2; float hWid = plane.bounds().width() / 2; float hThick = plane.bounds().thickness() / 2; result.push_back( plane.toGlobal( LocalPoint( hWid, hLen, hThick))); result.push_back( plane.toGlobal( LocalPoint( hWid, hLen,-hThick))); result.push_back( plane.toGlobal( LocalPoint( hWid,-hLen, hThick))); result.push_back( plane.toGlobal( LocalPoint( hWid,-hLen,-hThick))); result.push_back( plane.toGlobal( LocalPoint(-hWid, hLen, hThick))); result.push_back( plane.toGlobal( LocalPoint(-hWid, hLen,-hThick))); result.push_back( plane.toGlobal( LocalPoint(-hWid,-hLen, hThick))); result.push_back( plane.toGlobal( LocalPoint(-hWid,-hLen,-hThick))); return result; }
GlobalPoint const& BoundingBox::operator[] | ( | unsigned int | i | ) | const [inline] |
GlobalPoint BoundingBox::m_corners[8] [private] |
Definition at line 33 of file BoundingBox.h.
Referenced by BoundingBox(), corner(), and operator[]().