mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 22:43:41 +00:00
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:
@@ -0,0 +1,51 @@
|
||||
/********************************************************************************
|
||||
* *
|
||||
* This file is part of IfcOpenShell. *
|
||||
* *
|
||||
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
||||
* it under the terms of the Lesser GNU General Public License as published by *
|
||||
* the Free Software Foundation, either version 3.0 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* IfcOpenShell is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* Lesser GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the Lesser GNU General Public License *
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef VIEWPORTCORE_H
|
||||
#define VIEWPORTCORE_H
|
||||
|
||||
// Platform-agnostic render core. Owns the wgpu state + scene state +
|
||||
// per-frame render path. Talks to its embedder through ViewportHost
|
||||
// (window/canvas surface, scheduling, notifications) — has no Qt or
|
||||
// browser dependencies of its own.
|
||||
//
|
||||
// Empty for now: this header / TU is the placeholder for the
|
||||
// incremental Path-A refactor (#77-#86). Each subsequent commit moves
|
||||
// one subsystem out of ViewportWindow.cpp into here and updates the
|
||||
// public surface accordingly. Until that work lands, ViewportWindow
|
||||
// retains its render body; this class is just the target for the
|
||||
// move.
|
||||
|
||||
#include "ViewportHost.h"
|
||||
|
||||
class ViewportCore {
|
||||
public:
|
||||
explicit ViewportCore(ViewportHost* host);
|
||||
~ViewportCore();
|
||||
|
||||
ViewportCore(const ViewportCore&) = delete;
|
||||
ViewportCore& operator=(const ViewportCore&) = delete;
|
||||
|
||||
ViewportHost* host() const { return host_; }
|
||||
|
||||
private:
|
||||
ViewportHost* host_;
|
||||
};
|
||||
|
||||
#endif // VIEWPORTCORE_H
|
||||
Reference in New Issue
Block a user