CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Plane.h
Go to the documentation of this file.
1 #ifndef Geom_Plane_H
2 #define Geom_Plane_H
3 
15 #include "boost/intrusive_ptr.hpp"
16 
17 class Plane : public virtual Surface {
18 public:
21 
26  const RotationType& rot,
27  MediumProperties* mp=0) {
28  return PlanePointer(new Plane(pos, rot, mp));
29  }
30 
31  // -- DEPRECATED CONSTRUCTORS
32 
36  Plane( const PositionType& pos, const RotationType& rot) :
37  Surface( pos, rot) {}
38 
43  Surface( pos, rot, mp) {}
44 
45 // extension of Surface interface for planes
46 
48  return GlobalVector( rotation().zx(), rotation().zy(), rotation().zz());
49  }
50 
52  float localZ (const GlobalPoint& gp) const {
53  return normalVector().dot(gp-position());
54  }
55 
57  float localZ (const GlobalVector& gv) const {
58  return normalVector().dot(gv);
59  }
60 
61 // implementation of Surface interface
62 
63  virtual SurfaceOrientation::Side side( const LocalPoint& p, Scalar toler) const {
64  return (std::abs(p.z())<toler) ? SurfaceOrientation::onSurface :
66  }
67 
68  virtual SurfaceOrientation::Side side( const GlobalPoint& p, Scalar toler) const {
69  Scalar lz = localZ(p);
70  return (std::abs(lz)<toler ? SurfaceOrientation::onSurface :
72  }
73 
76 
79 
80 
81 
82 
83 };
84 
85 #endif
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const
tangent plane to surface from global point
Definition: Plane.cc:9
float localZ(const GlobalVector &gv) const
Fast access to component perpendicular to plane for a vector.
Definition: Plane.h:57
ConstReferenceCountingPointer< Plane > ConstPlanePointer
Definition: Plane.h:20
virtual SurfaceOrientation::Side side(const GlobalPoint &p, Scalar toler) const
Definition: Plane.h:68
Plane(const PositionType &pos, const RotationType &rot)
Definition: Plane.h:36
GlobalVector normalVector() const
Definition: Plane.h:47
float localZ(const GlobalPoint &gp) const
Fast access to distance from plane for a point.
Definition: Plane.h:52
#define abs(x)
Definition: mlp_lapack.h:159
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
static PlanePointer build(const PositionType &pos, const RotationType &rot, MediumProperties *mp=0)
Definition: Plane.h:25
Vector3DBase< float, GlobalTag > GlobalVector
Definition: Plane.h:17
Plane(const PositionType &pos, const RotationType &rot, MediumProperties *mp)
Definition: Plane.h:42
T z() const
Definition: PV3DBase.h:63
ReferenceCountingPointer< Plane > PlanePointer
Definition: Plane.h:19
virtual SurfaceOrientation::Side side(const LocalPoint &p, Scalar toler) const
Definition: Plane.h:63
const RotationType & rotation() const
const PositionType & position() const