Simulateur Ferroviaire
Reconstruction et visualisation d'un réseau ferroviaire à partir de données GeoJSON — Win32 / WebView2 / Leaflet
Chargement...
Recherche...
Aucune correspondance
TopologyRenderer.h
Aller à la documentation de ce fichier.
1
7#pragma once
8
9#include <string>
10#include <vector>
11
15#include "External/nlohmann/json.hpp"
16
17using JsonDocument = nlohmann::json;
18
33{
34public:
35
40 static void exportToFile(const std::string& outputPath);
41
46 static std::wstring loadGeoJsonToWebView();
47
48 // -------------------------------------------------------------------------
49 // Straights
50 // -------------------------------------------------------------------------
51
57 static std::wstring renderStraightBlock(const StraightBlock& straightBlock);
58
59 // -------------------------------------------------------------------------
60 // Switches — jonction
61 // -------------------------------------------------------------------------
62
68 static std::wstring renderSwitchBlock(const SwitchBlock& sw);
69
70 // -------------------------------------------------------------------------
71 // Switches — branches (root / normal / deviation)
72 // -------------------------------------------------------------------------
73
95 static std::wstring renderSwitchBranches(const SwitchBlock& sw);
96
110 static std::wstring renderAllTopology();
111
121 static std::wstring updateSwitchBlocks(const SwitchBlock& sw);
122
123private:
130
136 static JsonDocument convertSwitchToFeature(const SwitchBlock& switchBlock);
137
150 static std::wstring escapeForJavaScript(const std::string& input);
151
153};
Système de journalisation à 5 niveaux de trace, un fichier par moteur.
Modèle de domaine d'un bloc de voie droite (Straight).
Modèle de domaine d'un aiguillage ferroviaire à 3 branches.
nlohmann::json JsonDocument
Definition TopologyRenderer.h:17
Definition StraightBlock.h:24
Definition SwitchBlock.h:41
Utilitaire statique d'export de la topologie ferroviaire en GeoJSON.
Definition TopologyRenderer.h:33
static std::wstring renderSwitchBlock(const SwitchBlock &sw)
Construit l'appel JS renderSwitch(id, lat, lon, isDouble).
Definition TopologyRenderer.cpp:315
static JsonDocument convertStraightToFeature(const StraightBlock &straight)
Convertit un StraightBlock en feature GeoJSON de type LineString.
Definition TopologyRenderer.cpp:130
static std::wstring loadGeoJsonToWebView()
Génère le script JavaScript d'injection GeoJSON dans le WebView.
Definition TopologyRenderer.cpp:213
static void exportToFile(const std::string &outputPath)
Exporte la topologie ferroviaire dans un fichier GeoJSON.
Definition TopologyRenderer.cpp:188
static std::wstring renderStraightBlock(const StraightBlock &straightBlock)
Construit l'appel JS renderStraightBlock(id, Coordinates) pour un bloc.
Definition TopologyRenderer.cpp:289
TopologyRenderer()=delete
static std::wstring renderSwitchBranches(const SwitchBlock &sw)
Construit l'appel JS renderSwitchBranches(...) pour un switch.
Definition TopologyRenderer.cpp:332
static JsonDocument convertSwitchToFeature(const SwitchBlock &switchBlock)
Convertit un SwitchBlock en feature GeoJSON de type Point.
Definition TopologyRenderer.cpp:157
static std::wstring renderAllTopology()
Génère le script JS complet de rendu de toute la topologie.
Definition TopologyRenderer.cpp:257
static std::wstring escapeForJavaScript(const std::string &input)
Échappe une chaîne JSON pour l'injection dans JavaScript.
Definition TopologyRenderer.cpp:233
static std::wstring updateSwitchBlocks(const SwitchBlock &sw)
Génère le script JS de mise à jour visuelle d'un switch et ses partenaires.
Definition TopologyRenderer.cpp:393