-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin Huth
committed
Nov 13, 2024
1 parent
b14548d
commit a95b77d
Showing
7 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file is part of the ACTS project. | ||
// | ||
// Copyright (C) 2016 CERN for the benefit of the ACTS project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
#include "ActsExamples/Io/Json/JsonSurfacesReader.hpp" | ||
#include <Acts/Plugins/Json/SurfaceJsonConverter.hpp> | ||
|
||
#include <fstream> | ||
|
||
#include <nlohmann/json.hpp> | ||
|
||
void writeSurfaces( | ||
std::ostream &os, | ||
const std::vector<std::shared_ptr<Acts::Surface>> &jSurfaces) { | ||
nlohmann::json j = nlohmann::json::array(); | ||
|
||
for (const auto &jSurface : jSurfaces) { | ||
j.push_back( | ||
Acts::SurfaceJsonConverter::toJson(Acts::GeometryContext{}, *jSurface)); | ||
} | ||
|
||
os << j; | ||
} | ||
|
||
int main(int argc, char **argv) { | ||
std::vector<std::string> args(argv, argv + argc); | ||
|
||
auto surfaces = | ||
ActsExamples::JsonSurfacesReader::readVector({args.at(1), {}}); | ||
|
||
std::ofstream outfile("output_surfaces.json"); | ||
writeSurfaces(outfile, surfaces); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters