diff --git a/DDRec/include/DDRec/Surface.h b/DDRec/include/DDRec/Surface.h index 242b36329870a8297b8a1835931c79c39ba74593..dde289f82dc70db8a6ebc0f9473f6e93a33ac5a5 100644 --- a/DDRec/include/DDRec/Surface.h +++ b/DDRec/include/DDRec/Surface.h @@ -520,7 +520,7 @@ namespace DD4hep { * @date Apr, 10 2014 * @version $Id$ */ - class SurfaceList : public std::list< Surface* > { + class SurfaceList : public std::list< ISurface* > { protected: bool _isOwner ; @@ -530,7 +530,7 @@ namespace DD4hep { SurfaceList(bool isOwner=false ) : _isOwner( isOwner ) {} /// copy c'tor - SurfaceList(const SurfaceList& other ) : std::list< Surface* >( other ), _isOwner( false ){} + SurfaceList(const SurfaceList& other ) : std::list< ISurface* >( other ), _isOwner( false ){} /// required c'tor for extension mechanism SurfaceList(const Geometry::DetElement& ){ diff --git a/DDRec/include/DDRec/SurfaceManager.h b/DDRec/include/DDRec/SurfaceManager.h index 19466aac23860ed38151224c9cc7843fa7900453..9f138d2b82fc539c89b0b786fa161d99af2b217f 100644 --- a/DDRec/include/DDRec/SurfaceManager.h +++ b/DDRec/include/DDRec/SurfaceManager.h @@ -1,14 +1,15 @@ #ifndef DDRec_SurfaceManager_H_ #define DDRec_SurfaceManager_H_ -#include "DDRec/Surface.h" +#include "DDSurfaces/ISurface.h" #include <string> +#include <map> namespace DD4hep { namespace DDRec { /// typedef for surface maps, keyed by the cellID - typedef std::map< unsigned long, DD4hep::DDRec::Surface*> SurfaceMap ; + typedef std::map< unsigned long, DDSurfaces::ISurface*> SurfaceMap ; /** Surface manager class that holds maps of surfaces for all known * sensitive detector types and individual sub detectors. diff --git a/DDRec/src/SurfaceManager.cpp b/DDRec/src/SurfaceManager.cpp index 82ff1a5298403165132d46eecccf23101be5251c..9129e33801b990ba63c468ced3d47945d4892bb4 100644 --- a/DDRec/src/SurfaceManager.cpp +++ b/DDRec/src/SurfaceManager.cpp @@ -8,6 +8,7 @@ namespace DD4hep { using namespace Geometry ; + using namespace DDSurfaces ; namespace DDRec { @@ -56,7 +57,7 @@ namespace DD4hep { _map.insert( std::make_pair( name , SurfaceMap() ) ) ; for( SurfaceList::const_iterator it = detSL.begin() ; it != detSL.end() ; ++it ){ - Surface* surf = *it ; + ISurface* surf = *it ; // enter surface into map for this detector _map[ name ].insert( std::make_pair( surf->id(), surf ) ) ; diff --git a/UtilityApps/src/test_surfaces.cpp b/UtilityApps/src/test_surfaces.cpp index 1c619bcf2a33138278d63cc8132a077d87e73a8e..26e6d464e25faac406dce476642f82b633b166a2 100644 --- a/UtilityApps/src/test_surfaces.cpp +++ b/UtilityApps/src/test_surfaces.cpp @@ -132,7 +132,8 @@ int main(int argc, char** argv ){ Surface* surf = surfMap[ id ] ; #else SurfaceMap::const_iterator si = surfMap.find( id ) ; - Surface* surf = ( si != surfMap.end() ? si->second : 0 ) ; + // Surface* surf = dynamic_cast<Surface*> ( ( si != surfMap.end() ? si->second : 0 ) ) ; + ISurface* surf = ( si != surfMap.end() ? si->second : 0 ) ; #endif std::stringstream sst ; diff --git a/UtilityApps/src/teve_display.cpp b/UtilityApps/src/teve_display.cpp index 5a1982b8b9f3b81677ef2e89c23b492ec664a83d..c8c61218321d30432d7be961753a0fb5d4898d30 100644 --- a/UtilityApps/src/teve_display.cpp +++ b/UtilityApps/src/teve_display.cpp @@ -211,7 +211,10 @@ TEveStraightLineSet* getSurfaces(int col, const SurfaceType& type) { for( SurfaceList::const_iterator it = sL.begin() ; it != sL.end() ; ++it ){ - Surface* surf = *it ; + Surface* surf = dynamic_cast< Surface*> ( *it ) ; + + if( ! surf ) + continue ; if( ! ( surf->type().isVisible() && ( surf->type().isSimilar( type ) ) ) ) continue ;