[180] Grau im 3D: Klassen im Darstellungsmodus „grau" als gedämpfte Geisterschicht
Kern ClassFilter mit grey/lock/ghost (Hauptmodell ohne graue Elemente, ghost nur sie; Öffnungen grau mit Klasse oder Wirt; gesperrte nicht anwählbar), render3d ghost.rs + set_ghost_model (hell entsättigt, durchscheinend), Viewer, natives 3D-Fenster (native.rs), CLI model3d --grey und render_png.
This commit is contained in:
20 files changed
+543
-54
No files matched your search
@@ -13,7 +13,10 @@ import type { Plan } from "../../core";
|
||||
import { materializeUnderlay } from "../../core";
|
||||
import type { Project } from "../../model/types";
|
||||
import { planSceneBin } from "../../core";
|
||||
import { projectToModel3d } from "../../core";
|
||||
import { ghostFilter3d, projectToModel3d } from "../../core";
|
||||
import type { Hide3d } from "../../core";
|
||||
|
||||
type Model3d = ReturnType<typeof projectToModel3d>;
|
||||
|
||||
/** Sammel-Fenster: Modelländerungen werden gebündelt gepusht (nicht je Frame). */
|
||||
const DEBOUNCE_MS = 200;
|
||||
@@ -89,14 +92,23 @@ export function pushNativeWalls(
|
||||
project: Project,
|
||||
/** Explosionsabstand ([65], 0 = aus): dasselbe Modell wie im WASM-Viewport (`projectToModel3d`). */
|
||||
explode = lastExplode,
|
||||
/** [180] Darstellungsmodus wie im WASM-Viewport (ausgeblendete, graue Klassen; graue als `ghost`-Schicht). */
|
||||
hide?: Hide3d,
|
||||
): void {
|
||||
if (!isTauri()) return;
|
||||
lastExplode = explode;
|
||||
clearTimeout(wallsTimer);
|
||||
wallsTimer = setTimeout(async () => {
|
||||
if (!(await isNativeEnabled())) return;
|
||||
void invokeNative("push_native_walls", { walls: projectToModel3d(project, { voids: true, explode }) });
|
||||
void invokeNative("push_native_walls", { walls: nativeModel3d(project, explode, hide) });
|
||||
}, DEBOUNCE_MS);
|
||||
}
|
||||
|
||||
/** [180] Modell fürs native 3D-Fenster: ohne die grauen Klassen, die stehen gedämpft in `ghost` (render3d `ghost.rs`). */
|
||||
export function nativeModel3d(project: Project, explode: number, hide?: Hide3d): Model3d & { ghost?: Model3d } {
|
||||
const model = projectToModel3d(project, { voids: true, explode, hide });
|
||||
const ghost = ghostFilter3d(hide);
|
||||
return ghost ? { ...model, ghost: projectToModel3d(project, { voids: true, explode, hide: ghost }) } : model;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import { hiddenFloorIds } from "../panels/displayMode";
|
||||
import { applyGroupDimmingToPlan } from "../state/groupActions";
|
||||
import { useStore } from "../state/appStore";
|
||||
import { planFitKey } from "../state/viewTabs";
|
||||
import { classDisplay3d } from "../state/view3dFilter";
|
||||
import { PlanView } from "./plan/PlanView";
|
||||
import type {
|
||||
GripHandlers,
|
||||
@@ -312,8 +313,9 @@ export const Content = memo(function Content({
|
||||
|
||||
// [180] Klassen, die der Darstellungsmodus des Ebenen-Panels nicht zeichnet, fehlen auch im 3D (die im
|
||||
// Ebenen-Baum ausgeschalteten blendet der Kern selbst aus).
|
||||
const hidden3d = useMemo(
|
||||
() => flattenCategories(project.layers ?? []).map((c) => c.code).filter((c) => !categoryDisplay(c).render),
|
||||
// Graue Klassen erscheinen gedämpft (Geisterschicht), gesperrte sind nicht anwählbar — wie im Grundriss.
|
||||
const display3d = useMemo(
|
||||
() => classDisplay3d(flattenCategories(project.layers ?? []).map((c) => c.code), categoryDisplay),
|
||||
[project.layers, categoryDisplay],
|
||||
);
|
||||
// [196] Geschosse mit ausgeschaltetem Auge (Zeichnungsebenen-Panel) fehlen auch im 3D.
|
||||
@@ -327,7 +329,9 @@ export const Content = memo(function Content({
|
||||
</div>
|
||||
<Viewport3D
|
||||
project={project}
|
||||
hiddenCodes={hidden3d}
|
||||
hiddenCodes={display3d.hide}
|
||||
greyCodes={display3d.grey}
|
||||
lockedCodes={display3d.lock}
|
||||
hiddenFloors={hiddenFloors3d}
|
||||
renderMode={renderMode}
|
||||
detail={detail}
|
||||
@@ -855,9 +859,14 @@ function LevelPlanView({
|
||||
}, [plan]);
|
||||
// Explosionsaxonometrie ([65]) auch im nativen 3D-Fenster.
|
||||
const explode = useStore((s) => (s.explode3d ? s.explode3dGap : 0));
|
||||
// [180] Mit dem Darstellungsmodus der Klassen wie im WASM-Viewport (aus, grau = Geisterschicht).
|
||||
const nativeHide = useMemo(() => {
|
||||
const d = classDisplay3d(flattenCategories(project.layers ?? []).map((c) => c.code), categoryDisplay);
|
||||
return { hide: d.hide, grey: d.grey, hideFloors: hiddenFloorIds(project.drawingLevels, floorDisplay) };
|
||||
}, [project.layers, project.drawingLevels, categoryDisplay, floorDisplay]);
|
||||
useEffect(() => {
|
||||
pushNativeWalls(project, explode);
|
||||
}, [project, explode]);
|
||||
pushNativeWalls(project, explode, nativeHide);
|
||||
}, [project, explode, nativeHide]);
|
||||
|
||||
return (
|
||||
<section className="pane">
|
||||
|
||||
Reference in new issue
Block a user