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 
13 #ifndef CMS_NOCXX11
15 #endif
16 #include <algorithm>
17 
18 
19 
20 
24 namespace SurfaceOrientation {
27 }
28 
29 
30 //template <class T> class ReferenceCountingPointer;
31 
32 class Plane;
33 #ifndef CMS_NOCXX11
35 #else
36 typedef Plane TangentPlane;
37 #endif
38 
48 class Surface : public GloballyPositioned<float>
50 {
51 public:
53 
55 
56  virtual ~Surface(){}
57 
58 protected:
59  Surface(){}
61  Base( pos, rot) {}
62 
64  Bounds* bounds) :
65  Base( pos, rot),
66  theBounds(bounds)
67  {}
68 
69 
71  MediumProperties mp) :
72  Base( pos, rot),
74  {}
75 
78  Bounds* bounds) :
79  Base( pos, rot),
81  theBounds(bounds)
82  {}
83 
84 
85 
86  Surface( const Surface& iSurface ) :
87  Base( iSurface),
89  theBounds(iSurface.theBounds)
90  {}
91 
92 #ifndef CMS_NOCXX11
93  Surface(Surface&& iSurface ) :
94  Base(iSurface),
96  theBounds(std::move(iSurface.theBounds))
97  {}
98 #endif
99 
100 public:
101 
106  virtual Side side( const LocalPoint& p, Scalar tolerance=0) const = 0;
107  virtual Side side( const GlobalPoint& p, Scalar tolerance=0) const {
108  return side( toLocal(p), tolerance);
109  }
110 
111  using Base::toGlobal;
112  using Base::toLocal;
113 
115  return GlobalPoint( rotation().multiplyInverse( lp.basicVector()) +
116  position().basicVector());
117  }
118 
119 
121  return theMediumProperties;
122  }
123 
125  theMediumProperties = mp;
126  }
127 
128  const Bounds& bounds() const { return *theBounds; }
129 
130  // here and not in plane because of PixelBarrelLayer::overlap
131  std::pair<float,float> const & phiSpan() const { return bounds().phiSpan(); }
132  std::pair<float,float> const & zSpan() const { return bounds().zSpan(); }
133  std::pair<float,float> const & rSpan() const { return bounds().rSpan(); }
134 
135 
146 
147 protected:
149 #ifndef CMS_NOCXX11
151 #else
152  Bounds * theBounds;
153 #endif
154 };
155 
156 
157 #endif // Geom_Surface_H
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
MediumProperties theMediumProperties
Definition: Surface.h:148
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp)
Definition: Surface.h:70
Surface(Surface &&iSurface)
Definition: Surface.h:93
std::pair< float, float > const & phiSpan() const
Definition: Surface.h:131
std::pair< float, float > const & zSpan() const
Definition: Surface.h:132
std::pair< float, float > const & rSpan() const
Definition: Surface.h:133
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp, Bounds *bounds)
Definition: Surface.h:76
const Bounds & bounds() const
Definition: Surface.h:128
void move(const GlobalVector &displacement)
Surface(const Surface &iSurface)
Definition: Surface.h:86
GloballyPositioned< float > Base
Definition: Surface.h:54
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:59
void setMediumProperties(const MediumProperties &mp)
Definition: Surface.h:124
SurfaceOrientation::Side Side
Definition: Surface.h:52
LocalPoint toLocal(const GlobalPoint &gp) const
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:38
Plane(Args &&...args)
Definition: Plane.h:21
Surface(const PositionType &pos, const RotationType &rot, Bounds *bounds)
Definition: Surface.h:63
Point3DBase< float, GlobalTag > GlobalPoint
std::pair< float, float > const & rSpan() const
Definition: Bounds.h:72
Plane TangentPlane
Definition: Surface.h:34
GlobalPoint toGlobal(const LocalPoint &lp) const
virtual ~Surface()
Definition: Surface.h:56
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
std::pair< float, float > const & phiSpan() const
Definition: Bounds.h:70
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:150
virtual Side side(const GlobalPoint &p, Scalar tolerance=0) const
Definition: Surface.h:107
const RotationType & rotation() const
Definition: Bounds.h:22
const MediumProperties & mediumProperties() const
Definition: Surface.h:120
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:60