[271][272][215] Exporte und Rendering folgen Umbaufilter und Variantenkombination der Ansicht
Gemeinsame Ansicht export/exportView.ts (Umbaufilter, Etappe, Kombination der aktiven Ebene) als EIN Weg in IFC, OBJ/STL/glTF, STEP, Blender-Paket und Cycles-Szene (Text der Kern-Abfragen, renovation::view_from_text). Cycles-Szene: Ausgeblendetes fehlt, Umbau-Farben nur auf Wunsch (renovationColors, cycles_scene_styled); Explosionsaxonometrie bekommt die Umbau-Farben, Pick/Explosion folgten dem Filter schon. App: Export-Dialog und Rendering-Dialog zeigen die Ansicht und lassen Hauptvarianten/kein Filter wählen; Häkchen Umbau-Farben im Bild. CLI: --renovation/--phase auch für ifc, obj, stl, glb, gltf, step, render, blend; render --engine cycles --renovation-colors. Tests: Kern export_view_tests.rs, vitest exportView/exportViewState/render, e2e exportView271; Bilder doc/review-272/07-09.
This commit is contained in:
32 files changed
+695
-42
No files matched your search
@@ -4,10 +4,12 @@
|
||||
// Raumstempel-Editor und der Drop-Rahmen — in derselben Reihenfolge wie zuvor. Gerendert von
|
||||
// `App.tsx` nach der Status-Leiste; Zustand und Handler kommen aus den Hooks der App.
|
||||
|
||||
import { useMemo } from "react";
|
||||
import type { DrawingLevel } from "../model/types";
|
||||
import { lineEndsOf, setFieldIfChanged } from "../core";
|
||||
import { getState, useStore, type RootState } from "../state/appStore";
|
||||
import { setAiAccessEnabled } from "../state/aiAccess";
|
||||
import { activeExportView } from "../state/exportViewState";
|
||||
import { reconcileLayout } from "../state/layoutSlice";
|
||||
import type { useCommandEngineHost } from "../state/useCommandEngineHost";
|
||||
import type { useDialogState } from "../state/useDialogState";
|
||||
@@ -136,6 +138,8 @@ export function AppDialogs(props: {
|
||||
const needsProject = resourcesOpen || !!importState || settingsOpen;
|
||||
const subscribed = useStore((s) => (needsProject ? s.project : null));
|
||||
const project = subscribed ?? getState().project;
|
||||
// [271][272] Ansicht der aktiven Ebene für den Export-Dialog (beim Öffnen gelesen, der Dialog ist modal).
|
||||
const exportView = useMemo(() => (exportSaveFormat ? activeExportView() : null), [exportSaveFormat]);
|
||||
// [193] Höhe eines Netzpunkts (Rechtsklick auf den Griff): Overlay-Eingabe statt window.prompt.
|
||||
const meshHeightPrompt = useStore((s) => s.meshHeightPrompt);
|
||||
const meshPromptZ = useStore((s) => {
|
||||
@@ -255,8 +259,10 @@ export function AppDialogs(props: {
|
||||
<ExportSaveDialog
|
||||
initialFormat={exportSaveFormat}
|
||||
baseName={projectFileName()}
|
||||
onSave={(fmt, filename, ifcOptions) => {
|
||||
runExport(fmt, filename, ifcOptions);
|
||||
view={exportView?.view}
|
||||
viewLabels={exportView?.labels}
|
||||
onSave={(fmt, filename, ifcOptions, view) => {
|
||||
runExport(fmt, filename, ifcOptions, view);
|
||||
setExportSaveFormat(null);
|
||||
}}
|
||||
onClose={() => setExportSaveFormat(null)}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { t } from "../i18n";
|
||||
import { useModalFocus } from "./modalFocus";
|
||||
import { Dropdown } from "./Dropdown";
|
||||
import type { IfcExportOptions, IfcSchema } from "../export/exportIfc";
|
||||
import { hasExportView, type ExportView } from "../export/exportView";
|
||||
|
||||
/** Direkt-herunterladbare Exportformate (mit Datei-Endung). */
|
||||
export type ExportSaveFormat = "csv" | "ifc" | "obj" | "stl" | "glb" | "step";
|
||||
@@ -31,8 +32,15 @@ export interface ExportSaveDialogProps {
|
||||
initialFormat: ExportSaveFormat;
|
||||
/** Basis-Dateiname OHNE Endung (i. d. R. Projektname). */
|
||||
baseName: string;
|
||||
/** `ifc`: Klassifikations-Optionen (nur bei Format IFC gesetzt). */
|
||||
onSave: (format: ExportSaveFormat, filename: string, ifc?: IfcExportOptions) => void;
|
||||
/** [271][272] Ansicht der aktiven Ebene (Umbaufilter, Etappe, Variantenkombination); fehlt oder leer = Hauptvarianten, alles. */
|
||||
view?: ExportView;
|
||||
/** Lesbare Fassung von `view` (Filtername mit Etappe, Kombination) für die Anzeige. */
|
||||
viewLabels?: { renovation: string | null; combination: string | null };
|
||||
/**
|
||||
* `ifc`: Klassifikations-Optionen (nur bei Format IFC gesetzt). `view`: die Ansicht, die der Export übernimmt
|
||||
* (nur bei den 3D-Formaten und wenn gewählt; sonst nicht gesetzt = Hauptvarianten, kein Filter).
|
||||
*/
|
||||
onSave: (format: ExportSaveFormat, filename: string, ifc?: IfcExportOptions, view?: ExportView) => void;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
@@ -46,6 +54,8 @@ function withExt(base: string, ext: string): string {
|
||||
export function ExportSaveDialog({
|
||||
initialFormat,
|
||||
baseName,
|
||||
view,
|
||||
viewLabels,
|
||||
onSave,
|
||||
onClose,
|
||||
}: ExportSaveDialogProps) {
|
||||
@@ -69,7 +79,11 @@ export function ExportSaveDialog({
|
||||
const [context, setContext] = useState(false);
|
||||
// IFC-Schema: IFC4 (Standard) oder IFC2x3 für ältere Fachplaner-Programme.
|
||||
const [schema, setSchema] = useState<IfcSchema>("IFC4");
|
||||
const onConfirm = () => onSave(format, filename, format === "ifc" ? { schema, ebkph, layerCodes, context } : undefined);
|
||||
// [271][272] Die Ansicht der aktiven Ebene gilt für alle 3D-Formate (IFC, OBJ, STL, glTF, STEP); die Bauteilliste (CSV) nicht.
|
||||
const viewApplies = format !== "csv";
|
||||
const viewActive = hasExportView(view);
|
||||
const [useView, setUseView] = useState(true);
|
||||
const onConfirm = () => onSave(format, filename, format === "ifc" ? { schema, ebkph, layerCodes, context } : undefined, viewApplies && viewActive && useView ? view : undefined);
|
||||
|
||||
return (
|
||||
<div className="imp-overlay" onClick={onClose}>
|
||||
@@ -137,6 +151,29 @@ export function ExportSaveDialog({
|
||||
</section>
|
||||
)}
|
||||
|
||||
{viewApplies && (
|
||||
<section className="imp-section" data-testid="export-view">
|
||||
<div className="imp-section-title">{t("exportSave.view")}</div>
|
||||
{viewActive ? (
|
||||
<>
|
||||
<label className="imp-check">
|
||||
<input type="checkbox" data-testid="export-view-use" checked={useView} onChange={(e) => setUseView(e.target.checked)} />
|
||||
<span>{t("exportSave.view.use")}</span>
|
||||
</label>
|
||||
<div className="imp-note" data-testid="export-view-summary">
|
||||
{useView
|
||||
? [viewLabels?.renovation ? t("exportSave.view.renovation", { name: viewLabels.renovation }) : "", viewLabels?.combination ? t("exportSave.view.combination", { name: viewLabels.combination }) : ""].filter(Boolean).join(" · ")
|
||||
: t("exportSave.view.off")}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="imp-note" data-testid="export-view-summary">
|
||||
{t("exportSave.view.none")}
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
)}
|
||||
|
||||
<section className="imp-section">
|
||||
<div className="imp-section-title">{t("exportSave.filename")}</div>
|
||||
<input
|
||||
|
||||
+40
-2
@@ -24,6 +24,7 @@ import {
|
||||
type RenderCameraChoice,
|
||||
type RenderCameraSpec,
|
||||
exportProjectName,
|
||||
hasExportView,
|
||||
} from "../core";
|
||||
import { getState } from "../state/appStore";
|
||||
import { setRenderDialogOpener } from "../state/renderDialogHook";
|
||||
@@ -46,6 +47,7 @@ import {
|
||||
import { saveBinaryFile } from "../native/saveFile";
|
||||
import { runWithAnonymityGate } from "../state/anonymityGate";
|
||||
import { defaultTargetLayout, placeImageOnLayout } from "../state/layoutImageActions";
|
||||
import { activeExportView, type ActiveExportView } from "../state/exportViewState";
|
||||
import { PreviewBadge } from "./PreviewBadge";
|
||||
|
||||
type SizeId = "sd" | "hd" | "uhd" | "a4" | "a3" | "a2" | "custom";
|
||||
@@ -83,6 +85,10 @@ export const RenderDialogHost = memo(function RenderDialogHost() {
|
||||
const [cameras, setCameras] = useState<RenderCameraChoice[]>([]);
|
||||
// [227] Baugrube im Bild ausblenden (Gelände hinterfüllt); das 3D im Modell bleibt wie es ist.
|
||||
const [backfilled, setBackfilled] = useState(true);
|
||||
// [271][272] Ansicht der aktiven 3D-Ansicht (Umbaufilter, Variantenkombination); übernehmen oder Hauptvarianten/alles.
|
||||
const [view, setView] = useState<ActiveExportView>({ view: {}, labels: { renovation: null, combination: null } });
|
||||
const [useView, setUseView] = useState(true);
|
||||
const [renoColors, setRenoColors] = useState(false);
|
||||
// [215] Renderer: eingebautes Cycles oder Blender; `cyclesOk` undefined, bis die Suche nach dem mitgelieferten Programm fertig ist.
|
||||
const [engine, setEngine] = useState<RenderEngine>("blender");
|
||||
const [cyclesOk, setCyclesOk] = useState<boolean | undefined>(undefined);
|
||||
@@ -116,6 +122,9 @@ export const RenderDialogHost = memo(function RenderDialogHost() {
|
||||
const st = getState();
|
||||
setWhen(toInputValue(defaultRenderTime(st.project)));
|
||||
setCamera(currentRenderCamera());
|
||||
setView(activeExportView());
|
||||
setUseView(true);
|
||||
setRenoColors(false);
|
||||
setCameraKey("live");
|
||||
setCameras(projectRenderCameras(st.project));
|
||||
setPath(getBlenderPath());
|
||||
@@ -200,7 +209,9 @@ export const RenderDialogHost = memo(function RenderDialogHost() {
|
||||
// Sonnenzeit der Kamera übernehmen (änderbar).
|
||||
if (choice.sunWhen) setWhen(toInputValue(choice.sunWhen));
|
||||
};
|
||||
const request = () => ({ width: dims.width, height: dims.height, samples, when: date!, camera, backfilled });
|
||||
const viewActive = hasExportView(view.view);
|
||||
const appliedView = viewActive && useView ? view.view : undefined;
|
||||
const request = () => ({ width: dims.width, height: dims.height, samples, when: date!, camera, backfilled, view: appliedView });
|
||||
const stageText = (e: { stage: string; done: number; total: number }) =>
|
||||
e.stage === "render"
|
||||
? t("render.stage.render", { done: e.done, total: e.total })
|
||||
@@ -287,7 +298,7 @@ export const RenderDialogHost = memo(function RenderDialogHost() {
|
||||
try {
|
||||
const res = await renderWithCycles(
|
||||
st.project,
|
||||
{ width: dims.width, height: dims.height, samples, denoise, when: date!, camera, backfilled, context, extraEv: exposureEv },
|
||||
{ width: dims.width, height: dims.height, samples, denoise, when: date!, camera, backfilled, context, extraEv: exposureEv, view: appliedView, renovationColors: renoColors && !!appliedView?.renovation },
|
||||
{
|
||||
signal: ac.signal,
|
||||
onMissingTextures: (n) => st.notify(t("render.missingTextures", { n }), "warning"),
|
||||
@@ -559,6 +570,33 @@ export const RenderDialogHost = memo(function RenderDialogHost() {
|
||||
</label>
|
||||
<div className="imp-note">{t("render.backfilled.hint")}</div>
|
||||
</section>
|
||||
<section className="imp-section" data-testid="render-view">
|
||||
<div className="imp-section-title">{t("render.view")}</div>
|
||||
{viewActive ? (
|
||||
<>
|
||||
<label className="imp-field-label">
|
||||
<input type="checkbox" data-testid="render-view-use" checked={useView} disabled={busy} onChange={(e) => setUseView(e.target.checked)} /> {t("render.view.use")}
|
||||
</label>
|
||||
<div className="imp-note" data-testid="render-view-summary">
|
||||
{useView
|
||||
? [view.labels.renovation ? t("render.view.renovation", { name: view.labels.renovation }) : "", view.labels.combination ? t("render.view.combination", { name: view.labels.combination }) : ""].filter(Boolean).join(" · ")
|
||||
: t("render.view.off")}
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="imp-note" data-testid="render-view-summary">
|
||||
{t("render.view.none")}
|
||||
</div>
|
||||
)}
|
||||
{useCycles && viewActive && useView && !!view.view.renovation && (
|
||||
<>
|
||||
<label className="imp-field-label" style={{ display: "block", marginTop: 4 }}>
|
||||
<input type="checkbox" data-testid="render-reno-colors" checked={renoColors} disabled={busy} onChange={(e) => setRenoColors(e.target.checked)} /> {t("render.view.colors")}
|
||||
</label>
|
||||
<div className="imp-note">{t("render.view.colorsHint")}</div>
|
||||
</>
|
||||
)}
|
||||
</section>
|
||||
{useCycles && (
|
||||
<section className="imp-section" data-testid="render-cycles-options">
|
||||
<label className="imp-field-label">
|
||||
|
||||
Reference in new issue
Block a user