Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:23:48

0001 //------------------------------- -*- C++ -*- -------------------------------//
0002 // Copyright Celeritas contributors: see top-level COPYRIGHT file for details
0003 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0004 //---------------------------------------------------------------------------//
0005 //! \file orange/detail/OrangeInputIOImpl.json.hh
0006 //---------------------------------------------------------------------------//
0007 #pragma once
0008 
0009 #include <string>
0010 #include <vector>
0011 #include <nlohmann/json.hpp>
0012 
0013 #include "../OrangeTypes.hh"
0014 #include "../surf/VariantSurface.hh"
0015 #include "../transform/VariantTransform.hh"
0016 
0017 namespace celeritas
0018 {
0019 namespace detail
0020 {
0021 //---------------------------------------------------------------------------//
0022 // Read a transform from a JSON object
0023 VariantTransform import_transform(nlohmann::json const& src);
0024 
0025 // Write a transform to arrays suitable for JSON export.
0026 nlohmann::json export_transform(VariantTransform const& t);
0027 
0028 // Read surface data from a JSON object
0029 std::vector<VariantSurface> import_zipped_surfaces(nlohmann::json const& j);
0030 
0031 // Write surface data to a JSON object
0032 nlohmann::json export_zipped_surfaces(std::vector<VariantSurface> const& s);
0033 
0034 // Build a logic definition from a C string.
0035 std::vector<logic_int> string_to_logic(std::string const& s);
0036 
0037 // Convert a logic vector to a string
0038 std::string logic_to_string(std::vector<logic_int> const&);
0039 
0040 //---------------------------------------------------------------------------//
0041 }  // namespace detail
0042 }  // namespace celeritas