CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Geometry/CommonDetUnit/interface/ModifiedSurfaceGenerator.h

Go to the documentation of this file.
00001 #ifndef ModifiedSurfaceGenerator_h_
00002 #define ModifiedSurfaceGenerator_h_
00003 
00004 #include "DataFormats/GeometrySurface/interface/Surface.h"
00005 
00009 template <class T> class ConstReferenceCountingPointer;
00010 template <class T> class ReferenceCountingPointer;
00011 class MediumProperties;
00012 
00013 template <class T> class ModifiedSurfaceGenerator {
00014 private:
00015   typedef ReferenceCountingPointer<T> SurfacePointer;
00016 
00017 public:
00019   ModifiedSurfaceGenerator (const T* surface) :
00020     theSurface(surface) {}
00022   ModifiedSurfaceGenerator (const SurfacePointer surface) :
00023     theSurface(surface.get()) {}
00026   SurfacePointer atNewPosition (const Surface::PositionType& position,
00027                                 const Surface::RotationType& rotation) const {
00028     const MediumProperties &  mp = theSurface->mediumProperties();
00029     SurfacePointer newSurface(new T(position, rotation,mp, theSurface->bounds().clone()));
00030     return newSurface;
00031   }
00032 
00033 private:
00035   ConstReferenceCountingPointer<T> theSurface;
00036 };
00037 
00038 #endif