Simulateur Ferroviaire
Reconstruction et visualisation d'un réseau ferroviaire à partir de données GeoJSON — Win32 / WebView2 / Leaflet
Chargement...
Recherche...
Aucune correspondance
PCCPanel.h
Aller à la documentation de ce fichier.
1
46#pragma once
47#include "framework.h"
48#include "TCORenderer.h"
51
52#include <algorithm> // std::clamp
53
55{
56public:
57
64 explicit PCCPanel(Logger& logger);
65
73 void create(HWND hParent, HINSTANCE hInstance);
74
81 void toggle();
82
88 void resize();
89
96 void refresh();
97
102 bool isVisible() const;
103
104private:
105
106 // =========================================================================
107 // WndProc
108 // =========================================================================
109
110 static LRESULT CALLBACK windowProc(HWND hWnd, UINT msg,
111 WPARAM wParam, LPARAM lParam);
112
113 LRESULT handleMessage(HWND hWnd, UINT msg,
114 WPARAM wParam, LPARAM lParam);
115
129 void onPaint(HWND hWnd);
130
136 void onMouseWheel(HWND hWnd, WPARAM wParam, LPARAM lParam);
137
142 void onLButtonDown(HWND hWnd, LPARAM lParam);
143
148 void onMouseMove(HWND hWnd, LPARAM lParam);
149
154 void onLButtonUp(HWND hWnd);
155
159 void resetView();
160
168 void rebuild();
169
170 // =========================================================================
171 // Membres — fenêtre Win32
172 // =========================================================================
173
174 HWND m_hWnd = nullptr;
175 HWND m_hParent = nullptr;
176 HINSTANCE m_hInstance = nullptr;
177
178 // =========================================================================
179 // Membres — données
180 // =========================================================================
181
187
194
195 // =========================================================================
196 // Membres — cache de projection (Famille F)
197 // =========================================================================
198
203 RECT m_lastRect = {};
204
210
216 bool m_projDirty = true;
217
218 // =========================================================================
219 // Membres — état de la vue (zoom / pan)
220 // =========================================================================
221
227 float m_zoom = 1.0f;
228
233 float m_panX = 0.0f;
234
239 float m_panY = 0.0f;
240
241 // =========================================================================
242 // Membres — état du drag (pan par glisser-déposer)
243 // =========================================================================
244
246 bool m_isDragging = false;
247
249 POINT m_dragAnchor = {};
250
252 float m_panXAtDrag = 0.0f;
253
255 float m_panYAtDrag = 0.0f;
256
257 // =========================================================================
258 // Constantes
259 // =========================================================================
260
261 static constexpr wchar_t CLASS_NAME[] = L"PCCPanelClass";
262
264 static constexpr float ZOOM_STEP = 0.12f;
265
267 static constexpr float ZOOM_MIN = 0.05f;
268
270 static constexpr float ZOOM_MAX = 20.0f;};
Système de journalisation à 5 niveaux de trace, un fichier par moteur.
Conteneur propriétaire du graphe PCC.
Renderer GDI du schéma TCO — style SNCF, blocs fixes.
Journaliseur associé à un moteur nommé.
Definition Logger.h:99
Conteneur propriétaire du graphe PCC — nœuds, arêtes et index.
Definition PCCGraph.h:50
Definition PCCPanel.h:55
void onMouseWheel(HWND hWnd, WPARAM wParam, LPARAM lParam)
Gère WM_MOUSEWHEEL avec Ctrl — zoom centré sur le curseur.
Definition PCCPanel.cpp:136
float m_panY
Definition PCCPanel.h:239
HINSTANCE m_hInstance
Definition PCCPanel.h:176
void toggle()
Alterne la visibilité du panneau (masqué ↔ visible).
Definition PCCPanel.cpp:69
Logger & m_logger
Definition PCCPanel.h:186
static constexpr wchar_t CLASS_NAME[]
Definition PCCPanel.h:261
HWND m_hWnd
Definition PCCPanel.h:174
HWND m_hParent
Definition PCCPanel.h:175
LRESULT handleMessage(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition PCCPanel.cpp:256
float m_panYAtDrag
Definition PCCPanel.h:255
void resetView()
Réinitialise zoom = 1, pan = (0, 0) — WM_LBUTTONDBLCLK.
Definition PCCPanel.cpp:223
float m_panXAtDrag
Definition PCCPanel.h:252
static constexpr float ZOOM_STEP
Definition PCCPanel.h:264
bool m_projDirty
Definition PCCPanel.h:216
void create(HWND hParent, HINSTANCE hInstance)
Enregistre la classe Win32 et crée la fenêtre enfant masquée.
Definition PCCPanel.cpp:31
void onPaint(HWND hWnd)
Gestionnaire de WM_PAINT — délègue le dessin à TCORenderer.
Definition PCCPanel.cpp:319
POINT m_dragAnchor
Definition PCCPanel.h:249
RECT m_lastRect
Definition PCCPanel.h:203
PCCGraph m_graph
Definition PCCPanel.h:193
static constexpr float ZOOM_MIN
Definition PCCPanel.h:267
void onMouseMove(HWND hWnd, LPARAM lParam)
Déplace la vue pendant le drag — WM_MOUSEMOVE. No-op si m_isDragging est faux.
Definition PCCPanel.cpp:192
float m_panX
Definition PCCPanel.h:233
void rebuild()
Reconstruit le graphe PCC depuis TopologyRepository.
Definition PCCPanel.cpp:121
bool isVisible() const
Indique si le panneau est actuellement visible.
Definition PCCPanel.cpp:111
static constexpr float ZOOM_MAX
Definition PCCPanel.h:270
void refresh()
Force un rafraîchissement du dessin TCO.
Definition PCCPanel.cpp:103
void onLButtonDown(HWND hWnd, LPARAM lParam)
Démarre un drag & drop (pan) — WM_LBUTTONDOWN. Appelle SetCapture pour continuer à recevoir WM_MOUSEM...
Definition PCCPanel.cpp:172
static LRESULT CALLBACK windowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition PCCPanel.cpp:235
TCORenderer::Projection m_cachedProj
Definition PCCPanel.h:209
float m_zoom
Definition PCCPanel.h:227
void onLButtonUp(HWND hWnd)
Termine le drag — WM_LBUTTONUP. Appelle ReleaseCapture.
Definition PCCPanel.cpp:206
bool m_isDragging
Definition PCCPanel.h:246
void resize()
Redimensionne le panneau pour couvrir toute la zone cliente du parent.
Definition PCCPanel.cpp:92
Paramètres de projection logique → écran.
Definition TCORenderer.h:39