#include <SimpleConeBounds.h>
Public Member Functions | |
virtual Bounds * | clone () const |
virtual bool | inside (const Local3DPoint &p) const |
Determine if the point is inside the bounds. | |
virtual bool | inside (const Local3DPoint &p, const LocalError &err, float scale) const |
Determine if a point is inside the bounds, taking error into account. | |
virtual bool | inside (const Local2DPoint &p, const LocalError &err) const |
virtual float | length () const |
Length along Z. | |
Geom::Theta< float > | openingAngle () const |
SimpleConeBounds (float zmin, float rmin_zmin, float rmax_zmin, float zmax, float rmin_zmax, float rmax_zmax) | |
Construct from inner/outer radius on the two Z faces. | |
virtual float | thickness () const |
GlobalPoint | vertex () const |
virtual float | width () const |
Maximum diameter. | |
Private Attributes | |
float | theRmaxZmax |
float | theRmaxZmin |
float | theRminZmax |
float | theRminZmin |
float | theZmax |
float | theZmin |
Cone bounds. The cone axis coincides with the Z axis. The bounds limit the length at constant Z, and allow finite thickness.
Definition at line 26 of file SimpleConeBounds.h.
SimpleConeBounds::SimpleConeBounds | ( | float | zmin, |
float | rmin_zmin, | ||
float | rmax_zmin, | ||
float | zmax, | ||
float | rmin_zmax, | ||
float | rmax_zmax | ||
) | [inline] |
Construct from inner/outer radius on the two Z faces.
Definition at line 30 of file SimpleConeBounds.h.
References swap(), theRmaxZmax, theRmaxZmin, theRminZmax, theRminZmin, theZmax, and theZmin.
Referenced by clone().
: theZmin(zmin), theRminZmin(rmin_zmin), theRmaxZmin(rmax_zmin), theZmax(zmax), theRminZmax(rmin_zmax), theRmaxZmax(rmax_zmax) { if (theZmin > theZmax) { std::swap(theRminZmin, theRminZmax); std::swap(theRmaxZmin, theRmaxZmax); } if (theRminZmin > theRmaxZmin) std::swap(theRminZmin, theRmaxZmin); if (theRminZmax > theRmaxZmax) std::swap(theRminZmax, theRmaxZmax); }
virtual Bounds* SimpleConeBounds::clone | ( | void | ) | const [inline, virtual] |
Implements Bounds.
Definition at line 72 of file SimpleConeBounds.h.
References SimpleConeBounds().
{ return new SimpleConeBounds(*this); }
virtual bool SimpleConeBounds::inside | ( | const Local3DPoint & | , |
const LocalError & | , | ||
float | scale | ||
) | const [inline, virtual] |
Determine if a point is inside the bounds, taking error into account.
Implements Bounds.
Definition at line 58 of file SimpleConeBounds.h.
References inside(), mathSSE::sqrt(), theRmaxZmax, theRmaxZmin, theRminZmax, theRminZmin, theZmax, theZmin, tmp, and LocalError::yy().
{ // std::cout << "WARNING: SimpleConeBounds::inside(const Local3DPoint&, const LocalError not fully implemented" // << std::endl; // FIXME! does not check R. SimpleConeBounds tmp(theZmin - sqrt(err.yy())*scale, theRminZmin, theRmaxZmin, theZmax+ sqrt(err.yy())*scale, theRminZmax, theRmaxZmax); return tmp.inside(p); }
virtual bool SimpleConeBounds::inside | ( | const Local3DPoint & | ) | const [inline, virtual] |
Determine if the point is inside the bounds.
Implements Bounds.
Definition at line 51 of file SimpleConeBounds.h.
References PV3DBase< T, PVType, FrameType >::perp(), theRmaxZmax, theRmaxZmin, theRminZmax, theRminZmin, theZmax, theZmin, and PV3DBase< T, PVType, FrameType >::z().
Referenced by inside().
{ float lrmin = (p.z()-theZmin)*(theRminZmax-theRminZmin)/(theZmax-theZmin); float lrmax = (p.z()-theZmin)*(theRmaxZmax-theRmaxZmin)/(theZmax-theZmin); return p.z() > theZmin && p.z() < theZmax && p.perp() > lrmin && p.perp() < lrmax; }
virtual bool SimpleConeBounds::inside | ( | const Local2DPoint & | p, |
const LocalError & | err | ||
) | const [inline, virtual] |
Definition at line 68 of file SimpleConeBounds.h.
References inside().
{ return Bounds::inside(p,err); }
virtual float SimpleConeBounds::length | ( | ) | const [inline, virtual] |
Length along Z.
Implements Bounds.
Definition at line 43 of file SimpleConeBounds.h.
References theZmax, and theZmin.
Referenced by openingAngle().
Geom::Theta<float> SimpleConeBounds::openingAngle | ( | ) | const [inline] |
Definition at line 77 of file SimpleConeBounds.h.
References length(), pi, theRmaxZmax, theRmaxZmin, theRminZmax, theRminZmin, and theta().
{ float theta = atan(((theRmaxZmax+theRminZmax)/2.- (theRmaxZmin+theRminZmin)/2.)/length()); return Geom::Theta<float>(theta < 0 ? theta+Geom::pi() : theta); }
virtual float SimpleConeBounds::thickness | ( | ) | const [inline, virtual] |
Thickness in the middle (Z center). Maybe it's useless, but it is pure abstract in Bounds...
Implements Bounds.
Definition at line 48 of file SimpleConeBounds.h.
References theRmaxZmax, theRmaxZmin, theRminZmax, and theRminZmin.
{ return ((theRmaxZmin-theRminZmin)+ (theRmaxZmax-theRminZmax))/2.;}
GlobalPoint SimpleConeBounds::vertex | ( | ) | const [inline] |
Definition at line 83 of file SimpleConeBounds.h.
References abs, max(), theRmaxZmax, theRmaxZmin, theRminZmax, theRminZmin, theZmax, and theZmin.
{ float rAtZmax = (theRmaxZmax+theRminZmax)/2.; float rAtZmin = (theRmaxZmin+theRminZmin)/2.; float dr = (rAtZmax-rAtZmin); if (std::abs(dr) < 0.0001) { // handle degenerate case (cone->cylinder) return GlobalPoint(0,0,std::numeric_limits<float>::max()); } else { return GlobalPoint(0,0,(theZmin*rAtZmax - theZmax*rAtZmin)/dr); } }
virtual float SimpleConeBounds::width | ( | ) | const [inline, virtual] |
Maximum diameter.
Implements Bounds.
Definition at line 45 of file SimpleConeBounds.h.
References max(), theRmaxZmax, and theRmaxZmin.
{ return 2*std::max(theRmaxZmin,theRmaxZmax);}
float SimpleConeBounds::theRmaxZmax [private] |
Definition at line 101 of file SimpleConeBounds.h.
Referenced by inside(), openingAngle(), SimpleConeBounds(), thickness(), vertex(), and width().
float SimpleConeBounds::theRmaxZmin [private] |
Definition at line 98 of file SimpleConeBounds.h.
Referenced by inside(), openingAngle(), SimpleConeBounds(), thickness(), vertex(), and width().
float SimpleConeBounds::theRminZmax [private] |
Definition at line 100 of file SimpleConeBounds.h.
Referenced by inside(), openingAngle(), SimpleConeBounds(), thickness(), and vertex().
float SimpleConeBounds::theRminZmin [private] |
Definition at line 97 of file SimpleConeBounds.h.
Referenced by inside(), openingAngle(), SimpleConeBounds(), thickness(), and vertex().
float SimpleConeBounds::theZmax [private] |
Definition at line 99 of file SimpleConeBounds.h.
Referenced by inside(), length(), SimpleConeBounds(), and vertex().
float SimpleConeBounds::theZmin [private] |
Definition at line 96 of file SimpleConeBounds.h.
Referenced by inside(), length(), SimpleConeBounds(), and vertex().