File indexing completed on 2025-10-31 08:17:09
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
0009 #pragma once
0010 
0011 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0012 #include "ActsExamples/Framework/ProcessCode.hpp"
0013 #include <Acts/Utilities/Logger.hpp>
0014 #include <Acts/Visualization/ViewConfig.hpp>
0015 
0016 #include <cstddef>
0017 #include <fstream>
0018 #include <iostream>
0019 #include <memory>
0020 #include <mutex>
0021 #include <string>
0022 
0023 namespace Acts {
0024 class TrackingVolume;
0025 class TrackingGeometry;
0026 }  
0027 
0028 namespace ActsExamples {
0029 struct AlgorithmContext;
0030 
0031 
0032 
0033 
0034 
0035 class ObjTrackingGeometryWriter {
0036  public:
0037   
0038   
0039   
0040   class Config {
0041    public:
0042     double outputScalor = 1.0;        
0043     std::size_t outputPrecision = 6;  
0044     std::filesystem::path outputDir = ".";
0045 
0046     Acts::ViewConfig containerView = {.color = {220, 220, 220}};
0047     Acts::ViewConfig volumeView = {.color = {220, 220, 0}};
0048     Acts::ViewConfig sensitiveView = {.color = {0, 180, 240}};
0049     Acts::ViewConfig passiveView = {.color = {240, 280, 0}};
0050     Acts::ViewConfig gridView = {.color = {220, 0, 0}};
0051 
0052     Acts::ViewConfig portalView = passiveView;
0053   };
0054 
0055   
0056   
0057   
0058   ObjTrackingGeometryWriter(const Config& config, Acts::Logging::Level level);
0059 
0060   
0061   
0062   std::string name() const;
0063 
0064   
0065   
0066   
0067   
0068   ActsExamples::ProcessCode write(const AlgorithmContext& context,
0069                                   const Acts::TrackingGeometry& tGeometry);
0070 
0071  private:
0072   std::unique_ptr<const Acts::Logger> m_logger;  
0073 
0074   Config m_cfg;  
0075 
0076   
0077   
0078   
0079   void write(const AlgorithmContext& context,
0080              const Acts::TrackingVolume& tVolume, bool gen3 = false);
0081 
0082   
0083   const Acts::Logger& logger() const { return *m_logger; }
0084 };
0085 
0086 }