File indexing completed on 2025-01-18 09:12:00
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/Io/Svg/SvgTrackingGeometryWriter.hpp"
0010
0011 #include "ActsExamples/Utilities/Paths.hpp"
0012 #include <Acts/Geometry/Layer.hpp>
0013 #include <Acts/Geometry/TrackingGeometry.hpp>
0014 #include <Acts/Geometry/TrackingVolume.hpp>
0015 #include <Acts/Plugins/ActSVG/LayerSvgConverter.hpp>
0016
0017 #include <iostream>
0018 #include <string>
0019
0020 ActsExamples::SvgTrackingGeometryWriter::SvgTrackingGeometryWriter(
0021 const ActsExamples::SvgTrackingGeometryWriter::Config& config,
0022 Acts::Logging::Level level)
0023 : m_logger{Acts::getDefaultLogger(name(), level)}, m_cfg(config) {}
0024
0025 std::string ActsExamples::SvgTrackingGeometryWriter::name() const {
0026 return "SvgTrackingGeometryWriter";
0027 }
0028
0029 ActsExamples::ProcessCode ActsExamples::SvgTrackingGeometryWriter::write(
0030 const AlgorithmContext& context, const Acts::TrackingGeometry& tGeometry) {
0031 ACTS_DEBUG(">>Svg: Writer for TrackingGeometry object called.");
0032
0033 m_writeMutex.lock();
0034
0035 auto geometrySheets = Acts::Svg::TrackingGeometryConverter::convert(
0036 context.geoContext, tGeometry, m_cfg.converterOptions);
0037
0038
0039 for (const auto& sheet : geometrySheets) {
0040 Acts::Svg::toFile({sheet}, joinPaths(m_cfg.outputDir, sheet._id + ".svg"));
0041 }
0042
0043 return ActsExamples::ProcessCode::SUCCESS;
0044 }