File indexing completed on 2025-01-31 09:17:03
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/Io/Obj/ObjTrackingGeometryWriter.hpp"
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0013 #include <Acts/Geometry/TrackingGeometry.hpp>
0014 #include <Acts/Visualization/GeometryView3D.hpp>
0015 #include <Acts/Visualization/ObjVisualization3D.hpp>
0016
0017 #include <filesystem>
0018
0019 ActsExamples::ObjTrackingGeometryWriter::ObjTrackingGeometryWriter(
0020 const ActsExamples::ObjTrackingGeometryWriter::Config& config,
0021 Acts::Logging::Level level)
0022 : m_logger{Acts::getDefaultLogger(name(), level)}, m_cfg(config) {}
0023
0024 std::string ActsExamples::ObjTrackingGeometryWriter::name() const {
0025 return "ObjTrackingGeometryWriter";
0026 }
0027
0028 ActsExamples::ProcessCode ActsExamples::ObjTrackingGeometryWriter::write(
0029 const AlgorithmContext& context, const Acts::TrackingGeometry& tGeometry) {
0030 ACTS_DEBUG(">>Obj: Writer for TrackingGeometry object called.");
0031
0032 auto world = tGeometry.highestTrackingVolume();
0033 if (world != nullptr) {
0034 write(context, *world);
0035 }
0036 return ActsExamples::ProcessCode::SUCCESS;
0037 }
0038
0039 void ActsExamples::ObjTrackingGeometryWriter::write(
0040 const AlgorithmContext& context, const Acts::TrackingVolume& tVolume) {
0041 ACTS_DEBUG(">>Obj: Writer for TrackingVolume object called.");
0042
0043 Acts::ObjVisualization3D objVis(m_cfg.outputPrecision, m_cfg.outputScalor);
0044
0045 Acts::GeometryView3D::drawTrackingVolume(
0046 objVis, tVolume, context.geoContext, m_cfg.containerView,
0047 m_cfg.volumeView, m_cfg.passiveView, m_cfg.sensitiveView, m_cfg.gridView,
0048 true, "", std::filesystem::path(m_cfg.outputDir));
0049 }