CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Cylinder.h
Go to the documentation of this file.
1 #ifndef Geom_Cylinder_H
2 #define Geom_Cylinder_H
3 
19 
20 class Cylinder : public virtual Surface {
21 public:
24 
25 
30  const RotationType& rot,
31  Scalar radius,
32  MediumProperties* mp=0) {
33  return CylinderPointer(new Cylinder(pos, rot, radius, mp));
34  }
35 
36 
37  // -- DEPRECATED CONSTRUCTORS
38 
43  Surface( pos, rot), theRadius(radius) {}
44 
49  MediumProperties* mp) :
50  Surface( pos, rot, mp), theRadius(radius) {}
51 
52  // -- Extension of Surface interface for cylinder
53 
55  Scalar radius() const {return theRadius;}
56 
57  // -- Implementation of Surface interface
58 
59  using Surface::side;
60  virtual Side side( const LocalPoint& p, Scalar toler) const;
61 
66 
68  Plane fastTangent(const GlobalPoint& aPoint) const{
69  GlobalVector yPlane(rotation().z());
70  GlobalVector xPlane(yPlane.cross(aPoint-position()));
71  return Plane(aPoint,RotationType(xPlane, yPlane));
72  }
73 
75  Plane fastTangent(const LocalPoint& aPoint) const {
76  return fastTangent(toGlobal(aPoint));
77  }
78 
79 private:
80 
82 
83 };
84 
85 #endif
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
Plane fastTangent(const LocalPoint &aPoint) const
tangent plane to surface from local point
Definition: Cylinder.h:75
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const
tangent plane to surface from global point
Definition: Cylinder.cc:23
virtual Side side(const LocalPoint &p, Scalar tolerance=0) const =0
Plane fastTangent(const GlobalPoint &aPoint) const
tangent plane to surface from global point
Definition: Cylinder.h:68
Definition: Plane.h:17
double double double z
Cylinder(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp)
Definition: Cylinder.h:48
virtual Side side(const LocalPoint &p, Scalar toler) const
Definition: Cylinder.cc:9
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
SurfaceOrientation::Side Side
Definition: Surface.h:36
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
Scalar theRadius
Definition: Cylinder.h:81
ConstReferenceCountingPointer< Cylinder > ConstCylinderPointer
Definition: Cylinder.h:23
Cylinder(const PositionType &pos, const RotationType &rot, Scalar radius)
Definition: Cylinder.h:42
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, MediumProperties *mp=0)
Definition: Cylinder.h:29
TkRotation< float > RotationType
const RotationType & rotation() const
const PositionType & position() const
ReferenceCountingPointer< Cylinder > CylinderPointer
Definition: Cylinder.h:22