File indexing completed on 2024-04-06 12:04:14
0001
0002
0003 #include "DataFormats/GeometrySurface/interface/GeneralNSurfaceDelimitedBounds.h"
0004 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0005
0006 bool GeneralNSurfaceDelimitedBounds::inside(const Local3DPoint& lp, const LocalError& le, float scale) const {
0007
0008 float tolerance = scale * sqrt(le.xx() * le.xx() + le.yy() * le.yy());
0009
0010 return myInside(lp, tolerance);
0011 }
0012
0013 bool GeneralNSurfaceDelimitedBounds::myInside(const Local3DPoint& lp, float tolerance) const {
0014
0015
0016 Surface::GlobalPoint gp = theSurface->toGlobal(lp);
0017
0018
0019
0020 for (SurfaceContainer::const_iterator i = theLimits.begin(); i != theLimits.end(); i++) {
0021
0022
0023
0024
0025 SurfaceOrientation::Side side = i->first->side(gp, tolerance);
0026 if (side != i->second && side != SurfaceOrientation::onSurface)
0027 return false;
0028 }
0029 return true;
0030 }