CMS 3D CMS Logo

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

#include <GeneralNSurfaceDelimitedBounds.h>

Inheritance diagram for GeneralNSurfaceDelimitedBounds:
Bounds

Public Types

typedef std::pair< const
Surface
*, SurfaceOrientation::Side
SurfaceAndSide
 
typedef std::vector
< SurfaceAndSide
SurfaceContainer
 

Public Member Functions

virtual Boundsclone () const
 
 GeneralNSurfaceDelimitedBounds (const Surface *surf, const std::vector< SurfaceAndSide > &limits)
 
virtual bool inside (const Local3DPoint &lp) const
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local3DPoint &, const LocalError &, float scale=1.f) const
 Determine if a point is inside the bounds, taking error into account. More...
 
virtual float length () const
 
virtual float thickness () const
 
virtual float width () const
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.f) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Member Functions

bool myInside (const Local3DPoint &lp, float tolerance) const
 

Private Attributes

SurfaceContainer theLimits
 
const SurfacetheSurface
 

Detailed Description

Bounds for a surface of any type, delimited by N other surfaces of any type. A point is "inside" if it is on the correct side of all delimiting surfaces. This way of computing "inside" is relatively expensive, and should only be applied to situations where there is no specialized implementation for the concrete surface types.

Definition at line 16 of file GeneralNSurfaceDelimitedBounds.h.

Member Typedef Documentation

Definition at line 19 of file GeneralNSurfaceDelimitedBounds.h.

Definition at line 20 of file GeneralNSurfaceDelimitedBounds.h.

Constructor & Destructor Documentation

GeneralNSurfaceDelimitedBounds::GeneralNSurfaceDelimitedBounds ( const Surface surf,
const std::vector< SurfaceAndSide > &  limits 
)
inline

Definition at line 22 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by clone().

Member Function Documentation

virtual Bounds* GeneralNSurfaceDelimitedBounds::clone ( void  ) const
inlinevirtual

Implements Bounds.

Definition at line 39 of file GeneralNSurfaceDelimitedBounds.h.

References GeneralNSurfaceDelimitedBounds().

39 {return new GeneralNSurfaceDelimitedBounds(*this);}
GeneralNSurfaceDelimitedBounds(const Surface *surf, const std::vector< SurfaceAndSide > &limits)
virtual bool GeneralNSurfaceDelimitedBounds::inside ( const Local3DPoint ) const
inlinevirtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 33 of file GeneralNSurfaceDelimitedBounds.h.

References myInside().

33  {
34  return myInside(lp,0);
35  }
bool myInside(const Local3DPoint &lp, float tolerance) const
bool GeneralNSurfaceDelimitedBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale = 1.f 
) const
virtual

Determine if a point is inside the bounds, taking error into account.

Implements Bounds.

Definition at line 6 of file GeneralNSurfaceDelimitedBounds.cc.

References myInside(), mathSSE::sqrt(), LocalError::xx(), and LocalError::yy().

8 {
9  // derive on-surface tolerance from LocalError in a very approximate way
10  float tolerance = scale * sqrt( le.xx()*le.xx() + le.yy()*le.yy());
11 
12  return myInside( lp, tolerance);
13 }
T sqrt(T t)
Definition: SSEVec.h:48
bool myInside(const Local3DPoint &lp, float tolerance) const
virtual float GeneralNSurfaceDelimitedBounds::length ( ) const
inlinevirtual

"Lenght" of the bounded volume; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 26 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by Vispa.Views.LineDecayView.DecayLine::arrowBoundingRect(), Vispa.Views.LineDecayView.DecayLine::labelBoundingRect(), and Vispa.Views.LineDecayView.DecayLine::paint().

26 { return 0;}
bool GeneralNSurfaceDelimitedBounds::myInside ( const Local3DPoint lp,
float  tolerance 
) const
private

Definition at line 15 of file GeneralNSurfaceDelimitedBounds.cc.

References i, SurfaceOrientation::onSurface, theLimits, theSurface, and Surface::toGlobal().

Referenced by inside().

16 {
17  // cout << "GeneralNSurfaceDelimitedBounds::myInside called with local point " << lp << endl;
18 
20 
21  // cout << "corresponding Global point " << gp << endl;
22 
23  for (SurfaceContainer::const_iterator i=theLimits.begin(); i!=theLimits.end(); i++) {
24 
25 // cout << "Local pos in boundary surface " << i->first->toLocal(gp)
26 // << " side " << i->first->side(gp, tolerance) << " should be "
27 // << i->second << endl;
28 
29  SurfaceOrientation::Side side = i->first->side(gp, tolerance);
30  if (side != i->second && side != SurfaceOrientation::onSurface) return false;
31  }
32  return true;
33 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
int i
Definition: DBlmapReader.cc:9
virtual float GeneralNSurfaceDelimitedBounds::thickness ( ) const
inlinevirtual

"Thickness" of the bound around the surface; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 28 of file GeneralNSurfaceDelimitedBounds.h.

28 { return 0;}
virtual float GeneralNSurfaceDelimitedBounds::width ( ) const
inlinevirtual

Member Data Documentation

SurfaceContainer GeneralNSurfaceDelimitedBounds::theLimits
private

Definition at line 43 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().

const Surface* GeneralNSurfaceDelimitedBounds::theSurface
private

Definition at line 44 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().