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 
8 
10 
11 /*
12 #include "DataFormats/GeometrySurface/interface/GlobalError.h"
13 #include "DataFormats/GeometrySurface/interface/LocalError.h"
14 */
18 namespace SurfaceOrientation {
21 }
22 
23 
24 //template <class T> class ReferenceCountingPointer;
25 
26 class TangentPlane;
27 
32 class Surface : public GloballyPositioned<float>
34 {
35 public:
37 
39 
41  Base( pos, rot), theMediumProperties(0.,0.), m_mpSet(false) {}
42 
44  MediumProperties* mp) :
45  Base( pos, rot),
46  theMediumProperties(mp? *mp : MediumProperties(0.,0.)),
47  m_mpSet(mp)
48  {}
49 
51  MediumProperties mp) :
52  Base( pos, rot),
54  m_mpSet(true)
55  {}
56 
57  Surface( const Surface& iSurface ) :
58  Base( iSurface),
60  m_mpSet(iSurface.m_mpSet)
61  {}
62 
63  // pure virtual destructor - makes base classs abstract
64  virtual ~Surface() = 0;
65 
70  virtual Side side( const LocalPoint& p, Scalar tolerance=0) const = 0;
71  virtual Side side( const GlobalPoint& p, Scalar tolerance=0) const {
72  return side( toLocal(p), tolerance);
73  }
74 
75  using Base::toGlobal;
76  using Base::toLocal;
77 
79  return GlobalPoint( rotation().multiplyInverse( lp.basicVector()) +
80  position().basicVector());
81  }
82 
83  /*
84  GlobalError toGlobal( const LocalError& le) const {
85  return rotation().transform(le);
86  }
87 
88  LocalError toLocal( const GlobalError& ge) const {
89  return rotation().transform(ge);
90  }
91  */
92 
94  return m_mpSet ? &theMediumProperties : 0;
95  }
96 
99  m_mpSet = true;
100  }
101 
103  if (mp) {
104  theMediumProperties = *mp;
105  m_mpSet = true;
106  } else {
108  m_mpSet = false;
109  }
110  }
111 
122 
123 private:
124 
126  bool m_mpSet;
127 };
128 
129 inline Surface::~Surface() {}
130 
131 #endif // Geom_Surface_H
Surface(const PositionType &pos, const RotationType &rot, MediumProperties *mp)
Definition: Surface.h:43
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
MediumProperties theMediumProperties
Definition: Surface.h:125
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp)
Definition: Surface.h:50
Surface(const Surface &iSurface)
Definition: Surface.h:57
GloballyPositioned< float > Base
Definition: Surface.h:38
virtual Side side(const LocalPoint &p, Scalar tolerance=0) const =0
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
void setMediumProperties(const MediumProperties &mp)
Definition: Surface.h:97
SurfaceOrientation::Side Side
Definition: Surface.h:36
LocalPoint toLocal(const GlobalPoint &gp) const
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:38
Point3DBase< float, GlobalTag > GlobalPoint
void setMediumProperties(MediumProperties *mp)
Definition: Surface.h:102
GlobalPoint toGlobal(const LocalPoint &lp) const
virtual ReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
bool m_mpSet
Definition: Surface.h:126
virtual Side side(const GlobalPoint &p, Scalar tolerance=0) const
Definition: Surface.h:71
const RotationType & rotation() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:40
virtual ~Surface()=0
Definition: Surface.h:129