Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-29 07:35:19

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 #ifndef DDCORE_SRC_PLUGINS_VIS2XMLEXTRACT_H
0015 #define DDCORE_SRC_PLUGINS_VIS2XMLEXTRACT_H
0016 
0017 // Framework include files
0018 #include <DD4hep/Detector.h>
0019 #include <DD4hep/GeoHandler.h>
0020 #include <DD4hep/DetFactoryHelper.h>
0021 
0022 // C/C++ include files
0023 #include <map>
0024 
0025 // Forward declarations
0026 class TGeoVolume;
0027 
0028 /// Namespace for the AIDA detector description toolkit
0029 namespace dd4hep {
0030 
0031   /// Namespace for implementation details of the AIDA detector description toolkit
0032   namespace detail {
0033 
0034     /// Geometry converter from dd4hep to Geant 4 in Detector format.
0035     /**
0036      *  \author  M.Frank
0037      *  \version 1.0
0038      *  \ingroup DD4HEP_CORE
0039      */
0040     class Vis2XmlExtract: public GeoHandler {
0041     public:
0042 
0043       /// Data structure of the geometry converter from dd4hep to extract visualization information
0044       /**
0045        *  \author  M.Frank
0046        *  \version 1.0
0047        *  \ingroup DD4HEP_CORE
0048        */
0049       class GeometryInfo: public GeoHandler::GeometryInfo {
0050       public:
0051         std::map<Volume,  xml::XmlElement*> xmlVolumes;
0052         std::map<VisAttr, xml::XmlElement*> xmlVis;
0053         xml_doc_t doc;
0054         xml_elt_t doc_root, doc_display, doc_structure;
0055         GeometryInfo();
0056       };
0057 
0058       /// Reference to detector description
0059       Detector&       m_detDesc;
0060       GeometryInfo*   m_dataPtr;
0061 
0062       /// Initializing Constructor
0063       Vis2XmlExtract(Detector& description);
0064 
0065       /// Standard destructor
0066       virtual ~Vis2XmlExtract();
0067 
0068       /// Create geometry conversion in Vis format
0069       xml_doc_t createVis(DetElement top);
0070 
0071       /// Analyze Volume in the geometry hierarchy
0072       virtual xml_h handleVolume(const std::string& name, Volume volume) const;
0073       /// Analyze Visualization attributes of Volume in the geometry hierarchy
0074       virtual xml_h handleVolumeVis(const std::string& name, const TGeoVolume* volume) const;
0075       /// Convert the geometry visualisation attributes to the corresponding Xml object(s).
0076       virtual xml_h handleVis(const std::string& name, VisAttr vis) const;
0077     };
0078   }    // End namespace xml
0079 }      // End namespace dd4hep
0080 #endif // DDCORE_SRC_PLUGINS_VIS2XMLEXTRACT_H