CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Surface.h
Go to the documentation of this file.
1 #ifndef Geom_Surface_H
2 #define Geom_Surface_H
3 
5 
7 
10 
12 
14 #include <algorithm>
15 
16 
17 
18 
22 namespace SurfaceOrientation {
25 }
26 
27 
28 //template <class T> class ReferenceCountingPointer;
29 
30 class Plane;
32 
42 class Surface : public GloballyPositioned<float>
44 {
45 public:
47 
49 
50  virtual ~Surface(){}
51 
52 protected:
53  Surface(){}
54  Surface( const PositionType& pos, const RotationType& rot) :
55  Base( pos, rot) {}
56 
57  Surface( const PositionType& pos, const RotationType& rot,
58  Bounds* bounds) :
59  Base( pos, rot),
60  theBounds(bounds)
61  {}
62 
63 
64  Surface( const PositionType& pos, const RotationType& rot,
65  MediumProperties mp) :
66  Base( pos, rot),
68  {}
69 
70  Surface( const PositionType& pos, const RotationType& rot,
72  Bounds* bounds) :
73  Base( pos, rot),
75  theBounds(bounds)
76  {}
77 
78 
79 
80  Surface( const Surface& iSurface ) :
81  Base( iSurface),
83  theBounds(iSurface.theBounds)
84  {}
85 
86  Surface(Surface&& iSurface ) :
87  Base(iSurface),
89  theBounds(std::move(iSurface.theBounds))
90  {}
91 
92 public:
93 
98  virtual Side side( const LocalPoint& p, Scalar tolerance=0) const = 0;
99  virtual Side side( const GlobalPoint& p, Scalar tolerance=0) const {
100  return side( toLocal(p), tolerance);
101  }
102 
103  using Base::toGlobal;
104  using Base::toLocal;
105 
107  return GlobalPoint( rotation().multiplyInverse( lp.basicVector()) +
108  position().basicVector());
109  }
110 
111 
113  return theMediumProperties;
114  }
115 
117  theMediumProperties = mp;
118  }
119 
120  const Bounds& bounds() const { return *theBounds; }
121 
122  // here and not in plane because of PixelBarrelLayer::overlap
123  std::pair<float,float> const & phiSpan() const { return bounds().phiSpan(); }
124  std::pair<float,float> const & zSpan() const { return bounds().zSpan(); }
125  std::pair<float,float> const & rSpan() const { return bounds().rSpan(); }
126 
127 
138 
139 protected:
142 };
143 
144 
145 #endif // Geom_Surface_H
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
MediumProperties theMediumProperties
Definition: Surface.h:140
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp)
Definition: Surface.h:64
virtual ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
Surface(Surface &&iSurface)
Definition: Surface.h:86
std::pair< float, float > const & phiSpan() const
Definition: Surface.h:123
std::pair< float, float > const & zSpan() const
Definition: Surface.h:124
std::pair< float, float > const & rSpan() const
Definition: Surface.h:125
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp, Bounds *bounds)
Definition: Surface.h:70
const Bounds & bounds() const
Definition: Surface.h:120
void move(const GlobalVector &displacement)
Surface(const Surface &iSurface)
Definition: Surface.h:80
virtual Side side(const LocalPoint &p, Scalar tolerance=0) const =0
Definition: Plane.h:17
std::pair< float, float > const & zSpan() const
Definition: Bounds.h:71
Surface()
Definition: Surface.h:53
void setMediumProperties(const MediumProperties &mp)
Definition: Surface.h:116
LocalPoint toLocal(const GlobalPoint &gp) const
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:38
Plane(Args &&...args)
Definition: Plane.h:20
Surface(const PositionType &pos, const RotationType &rot, Bounds *bounds)
Definition: Surface.h:57
Point3DBase< float, GlobalTag > GlobalPoint
std::pair< float, float > const & rSpan() const
Definition: Bounds.h:72
GlobalPoint toGlobal(const LocalPoint &lp) const
virtual ~Surface()
Definition: Surface.h:50
std::pair< float, float > const & phiSpan() const
Definition: Bounds.h:70
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:141
virtual Side side(const GlobalPoint &p, Scalar tolerance=0) const
Definition: Surface.h:99
const RotationType & rotation() const
Definition: Bounds.h:22
SurfaceOrientation::Side Side
Definition: Surface.h:46
const MediumProperties & mediumProperties() const
Definition: Surface.h:112
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:54