CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
BoundingBox Class Reference

#include <BoundingBox.h>

Public Member Functions

 BoundingBox ()
 
 BoundingBox (const Plane &plane)
 
GlobalPoint const & corner (unsigned int i) const
 
GlobalPoint const & operator[] (unsigned int i) const
 

Static Public Member Functions

static std::vector< GlobalPointcorners (const Plane &)
 

Private Attributes

GlobalPoint m_corners [8]
 

Detailed Description

A helper class that returns the corners of a rectangle that fully contains a bound plane.

Definition at line 12 of file BoundingBox.h.

Constructor & Destructor Documentation

BoundingBox::BoundingBox ( )
inline

Definition at line 15 of file BoundingBox.h.

15 {}
BoundingBox::BoundingBox ( const Plane plane)

Member Function Documentation

GlobalPoint const& BoundingBox::corner ( unsigned int  i) const
inline

Definition at line 25 of file BoundingBox.h.

References i, and m_corners.

25  {
26  return m_corners[i];
27  }
int i
Definition: DBlmapReader.cc:9
GlobalPoint m_corners[8]
Definition: BoundingBox.h:33
std::vector< GlobalPoint > BoundingBox::corners ( const Plane )
static

Definition at line 24 of file BoundingBox.cc.

References query::result.

Referenced by RodPlaneBuilderFromDet::computeBounds(), ForwardRingDiskBuilderFromDet::computeBounds(), PlaneBuilderForGluedDet::computeRectBounds(), BarrelDetLayer::computeSurface(), ForwardDetLayer::computeSurface(), CylinderBuilderFromDet::operator()(), and PhiBorderFinder::PhiBorderFinder().

25 {
26  std::vector<GlobalPoint> result;
27  result.reserve(8);
28 
29  float hLen = plane.bounds().length() / 2;
30  float hWid = plane.bounds().width() / 2;
31  float hThick = plane.bounds().thickness() / 2;
32 
33  result.push_back( plane.toGlobal( LocalPoint( hWid, hLen, hThick)));
34  result.push_back( plane.toGlobal( LocalPoint( hWid, hLen,-hThick)));
35  result.push_back( plane.toGlobal( LocalPoint( hWid,-hLen, hThick)));
36  result.push_back( plane.toGlobal( LocalPoint( hWid,-hLen,-hThick)));
37  result.push_back( plane.toGlobal( LocalPoint(-hWid, hLen, hThick)));
38  result.push_back( plane.toGlobal( LocalPoint(-hWid, hLen,-hThick)));
39  result.push_back( plane.toGlobal( LocalPoint(-hWid,-hLen, hThick)));
40  result.push_back( plane.toGlobal( LocalPoint(-hWid,-hLen,-hThick)));
41 
42  return result;
43 }
tuple result
Definition: query.py:137
GlobalPoint const& BoundingBox::operator[] ( unsigned int  i) const
inline

Definition at line 22 of file BoundingBox.h.

References i, and m_corners.

22  {
23  return m_corners[i];
24  }
int i
Definition: DBlmapReader.cc:9
GlobalPoint m_corners[8]
Definition: BoundingBox.h:33

Member Data Documentation

GlobalPoint BoundingBox::m_corners[8]
private

Definition at line 33 of file BoundingBox.h.

Referenced by corner(), and operator[]().