ifcviewer: scaffold ViewportHost + ViewportCore (Path A step 1)

Define the boundary the Path-A web-bring-up refactor will move things
across:

- ViewportHost.h is the embedder interface — surface creation,
  framebuffer geometry, frame scheduling, quit, and notification
  callbacks (onObjectPicked, onToolModeChanged, …). Desktop hosts
  forward notifications to Q_SIGNALS; the future web host pushes
  them to JS callbacks.

- ViewportCore.{h,cpp} is the platform-agnostic render-core target.
  Empty today — the body fills in across the #78-#86 sequence as
  each Qt subsystem (matrices, vectors, strings, timers, render
  path, input) gets de-Qt'd and moved over.

- ViewportWindow now multiply-inherits ViewportHost alongside QWindow
  and implements the host overrides as thin forwarders: createSurface
  returns the cached surface_, requestFrame -> requestUpdate, quit ->
  QCoreApplication::quit, onObjectPicked -> emit objectPicked.
  Renamed the DPR accessor `dpr()` (vs `devicePixelRatio`) to avoid
  the inherited-virtual clash with QWindow's qreal-returning version.

No method movement yet — this is purely the architectural scaffold so
subsequent commits have a destination.
This commit is contained in:
Dion Moult
2026-06-04 19:34:51 +10:00
parent e55a360aa2
commit c314dd3ca8
6 changed files with 258 additions and 1 deletions
+3
View File
@@ -145,6 +145,7 @@ set(IFCVIEWER_CORE_SOURCES
SidecarCache.cpp
StreamingLoader.cpp
StreamingThread.cpp
ViewportCore.cpp
)
set(IFCVIEWER_CORE_HEADERS
BufferPool.h
@@ -158,6 +159,8 @@ set(IFCVIEWER_CORE_HEADERS
StreamingLoader.h
StreamingThread.h
VertexQuantization.h
ViewportCore.h
ViewportHost.h
VisibilityState.h
)
list(TRANSFORM IFCVIEWER_CORE_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/")