DD4hep  1.36.0
Detector Description Toolkit for High Energy Physics
Vis2XmlExtract.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
14 #ifndef DDCORE_SRC_PLUGINS_VIS2XMLEXTRACT_H
15 #define DDCORE_SRC_PLUGINS_VIS2XMLEXTRACT_H
16 
17 // Framework include files
18 #include <DD4hep/Detector.h>
19 #include <DD4hep/GeoHandler.h>
21 
22 // C/C++ include files
23 #include <map>
24 
25 // Forward declarations
26 class TGeoVolume;
27 
29 namespace dd4hep {
30 
32  namespace detail {
33 
35 
40  class Vis2XmlExtract: public GeoHandler {
41  public:
42 
44 
50  public:
51  std::map<Volume, xml::XmlElement*> xmlVolumes;
52  std::map<VisAttr, xml::XmlElement*> xmlVis;
55  GeometryInfo();
56  };
57 
61 
63  Vis2XmlExtract(Detector& description);
64 
66  virtual ~Vis2XmlExtract();
67 
70 
72  virtual xml_h handleVolume(const std::string& name, Volume volume) const;
74  virtual xml_h handleVolumeVis(const std::string& name, const TGeoVolume* volume) const;
76  virtual xml_h handleVis(const std::string& name, VisAttr vis) const;
77  };
78  } // End namespace xml
79 } // End namespace dd4hep
80 #endif // DDCORE_SRC_PLUGINS_VIS2XMLEXTRACT_H
dd4hep::detail::Vis2XmlExtract::GeometryInfo::GeometryInfo
GeometryInfo()
Helper constructor.
Definition: Vis2XmlExtract.cpp:153
dd4hep::detail::Vis2XmlExtract::GeometryInfo::doc
xml_doc_t doc
Definition: Vis2XmlExtract.h:53
Detector.h
dd4hep::detail::Vis2XmlExtract::m_dataPtr
GeometryInfo * m_dataPtr
Definition: Vis2XmlExtract.h:60
dd4hep::VisAttr
Handle class describing visualization attributes.
Definition: Objects.h:323
dd4hep::detail::GeoHandlerTypes::GeometryInfo
Data container to store information obtained during the geometry scan.
Definition: GeoHandler.h:60
dd4hep::detail::Vis2XmlExtract
Geometry converter from dd4hep to Geant 4 in Detector format.
Definition: Vis2XmlExtract.h:40
dd4hep::detail::Vis2XmlExtract::Vis2XmlExtract
Vis2XmlExtract(Detector &description)
Initializing Constructor.
Definition: Vis2XmlExtract.cpp:37
dd4hep::xml::Handle_t
Class to easily access the properties of single XmlElements.
Definition: XMLElements.h:380
dd4hep::detail::Vis2XmlExtract::m_detDesc
Detector & m_detDesc
Reference to detector description.
Definition: Vis2XmlExtract.h:59
dd4hep::detail::Vis2XmlExtract::GeometryInfo::doc_structure
xml_elt_t doc_structure
Definition: Vis2XmlExtract.h:54
dd4hep::detail::Vis2XmlExtract::GeometryInfo
Data structure of the geometry converter from dd4hep to extract visualization information.
Definition: Vis2XmlExtract.h:49
dd4hep::DetElement
Handle class describing a detector element.
Definition: DetElement.h:187
dd4hep::Volume
Handle class holding a placed volume (also called physical volume)
Definition: Volumes.h:371
dd4hep::detail::Vis2XmlExtract::GeometryInfo::xmlVis
std::map< VisAttr, xml::XmlElement * > xmlVis
Definition: Vis2XmlExtract.h:52
dd4hep::detail::GeoHandler
The base class for all dd4hep geometry crawlers.
Definition: GeoHandler.h:87
dd4hep::detail::Vis2XmlExtract::handleVolumeVis
virtual xml_h handleVolumeVis(const std::string &name, const TGeoVolume *volume) const
Analyze Visualization attributes of Volume in the geometry hierarchy.
Definition: Vis2XmlExtract.cpp:75
dd4hep::detail::Vis2XmlExtract::createVis
xml_doc_t createVis(DetElement top)
Create geometry conversion in Vis format.
Definition: Vis2XmlExtract.cpp:129
dd4hep::detail::Vis2XmlExtract::GeometryInfo::xmlVolumes
std::map< Volume, xml::XmlElement * > xmlVolumes
Definition: Vis2XmlExtract.h:51
dd4hep::detail::Vis2XmlExtract::~Vis2XmlExtract
virtual ~Vis2XmlExtract()
Standard destructor.
Definition: Vis2XmlExtract.cpp:41
dd4hep::detail::Vis2XmlExtract::handleVolume
virtual xml_h handleVolume(const std::string &name, Volume volume) const
Analyze Volume in the geometry hierarchy.
Definition: Vis2XmlExtract.cpp:48
dd4hep::detail::Vis2XmlExtract::GeometryInfo::doc_root
xml_elt_t doc_root
Definition: Vis2XmlExtract.h:54
dd4hep::xml::Document
Class supporting the basic functionality of an XML document.
Definition: XMLElements.h:697
dd4hep::detail::Vis2XmlExtract::handleVis
virtual xml_h handleVis(const std::string &name, VisAttr vis) const
Convert the geometry visualisation attributes to the corresponding Xml object(s).
Definition: Vis2XmlExtract.cpp:95
DetFactoryHelper.h
dd4hep::detail::Vis2XmlExtract::GeometryInfo::doc_display
xml_elt_t doc_display
Definition: Vis2XmlExtract.h:54
dd4hep::xml::Element
User abstraction class to manipulate XML elements within a document.
Definition: XMLElements.h:769
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:89
GeoHandler.h