[K4] S4 Import: Aufrufer auf den Kern umgestellt, TS-Umwandlung gelöscht
DXF/DWG/PDF (Import-Dialog, CLI), IFC (Meshes/Bauteile) und Meshes laufen über ProjectDocument.importDrawing/ importIfc/importMesh (Store commitImport, ein Undo-Schritt). Dialoge halten nur Puffer + Zusammenfassung (io/importSource.ts). Gelöscht: dxfToDrawings, pdfLineStyles, ifcElements, decodeImport/decodeIfc/decodeMesh, ifcToImportedMeshes, meshObjectsToImportedMeshes, pdfPageToImport, buildDrawings, planImportLayers, Store addDrawingLevel/importDrawings, Paritätstests. ensureContextCategories als Fassade über den Kern; CLI-PDF bekommt wie die App Linienstile für Strichmuster. Tests über importView.testutil (Leseansicht des Kerns).
This commit is contained in:
52 files changed
+880
-3010
No files matched your search
@@ -12,6 +12,8 @@ import type { CoreOp } from "./ops";
|
||||
import { fieldOps } from "./opsBuild";
|
||||
import { opsMutation } from "./opsBuild";
|
||||
import type { ProjectMutation } from "./opsBuild";
|
||||
import type { IfcImportResult } from "../io/ifcImport";
|
||||
import type { MeshImportReport } from "../io/meshImport";
|
||||
|
||||
/**
|
||||
* Gelesene Zeichnungs-Datei für den Kern ([K4] S4): Puffer des Format-Moduls, je Stück (paralleles Lesen
|
||||
@@ -373,14 +375,14 @@ export class ProjectDocument {
|
||||
|
||||
/** IFC-Import ([B3]/[B4], [K4] S4): Kontext-Meshes bzw. (`opts.elements`) Bauteile, ein Undo-Schritt. */
|
||||
importIfc(base: Project, flat: IfcFlatInput, opts: { fileName: string; group?: string; elements?: boolean }, now: number) {
|
||||
return this.commitCore<{ report: Record<string, unknown>; summary: Record<string, number> | null; kept: Record<string, number>; contextObjects: number }>(base, (h) =>
|
||||
return this.commitCore<IfcImportResult>(base, (h) =>
|
||||
core().doc_import_ifc(h, flat.meta, flat.positions, flat.indices, flat.elementData ?? new Float64Array(0), JSON.stringify(opts), "", now),
|
||||
);
|
||||
}
|
||||
|
||||
/** Mesh-Import (OBJ/STL/glTF/PLY, [C11], [K4] S4): Kontext-Meshes, ein Undo-Schritt. */
|
||||
importMesh(base: Project, flat: { flat: Float64Array; strings: string[] }, opts: { fileName: string; placement?: string; group?: string }, now: number) {
|
||||
return this.commitCore<{ report: Record<string, unknown>; contextObjects: number }>(base, (h) =>
|
||||
return this.commitCore<{ report: MeshImportReport; contextObjects: number }>(base, (h) =>
|
||||
core().doc_import_mesh(h, flat.flat, JSON.stringify(flat.strings), JSON.stringify(opts), "", now),
|
||||
);
|
||||
}
|
||||
|
||||
+6
-6
@@ -7,8 +7,7 @@ export { buildPlanDxf } from "../export/exportDxf";
|
||||
export { buildPlanDwg } from "../export/exportDxf";
|
||||
export { buildPlanDxfBinary } from "../export/exportDxf";
|
||||
export { loadFileio } from "../engine/fileioWasm";
|
||||
export { readIfc, ifcToImportedMeshes } from "../io/ifcImport";
|
||||
export { readIfcElements, ifcElementsToProject } from "../io/ifcElements";
|
||||
export { readIfcFlat } from "../io/ifcImport";
|
||||
export { parseBcf, writeBcf, bcfInfo } from "../io/bcf";
|
||||
export { projectGeoOrigin } from "../model/geoRebase";
|
||||
export { ensureContextCategories } from "../model/contextCategories";
|
||||
@@ -42,14 +41,15 @@ export { checkSiteRules, allowedArea, multiPolygonArea, buildingFootprint, model
|
||||
export type { SiteCheck } from "../analysis/siteRules";
|
||||
export { sampleProject } from "../model/sampleProject";
|
||||
export { parseDxf } from "../io/dxfParser";
|
||||
export { contoursToDrawings, textsToDrawings, planImportCategories, distinctImportLayers } from "../io/dxfToDrawings";
|
||||
export { ProjectDocument, sharedDocument } from "./document";
|
||||
export { emptyProject } from "../model/sampleProject";
|
||||
export { readPointCloud, readPointCloudFlat, isPointCloudFile, DEFAULT_MAX_POINTS } from "../io/pointCloud";
|
||||
export type { PointCloudData, PointCloudOptions, PointCloudReport } from "../io/pointCloud";
|
||||
export { readPdfVectorPage, pdfPageToImport, pdfPageInfo, pdfMetersPerPt, isPdfFile, PDF_SCALES } from "../io/pdfVector";
|
||||
export { readPdfVector, pdfImport, pdfPageInfo, isPdfFile, PDF_SCALES } from "../io/pdfVector";
|
||||
export type { PdfVectorPage, PdfVectorPath, PdfVectorText } from "../io/pdfVector";
|
||||
export { readMesh, meshObjectsToImportedMeshes, formatMeshReport, isMeshFile, MESH_UNITS, MESH_UNIT_SCALE } from "../io/meshImport";
|
||||
export type { MeshObject, MeshImportReport, MeshUnit, MeshUp, MeshPlacement } from "../io/meshImport";
|
||||
export { readMesh, readMeshFlat, formatMeshReport, isMeshFile, MESH_UNITS, MESH_UNIT_SCALE } from "../io/meshImport";
|
||||
export type { MeshImportReport, MeshUnit, MeshUp, MeshPlacement } from "../io/meshImport";
|
||||
export { addedItems } from "./opsBuild";
|
||||
export { addItems, fieldOps, findItem, itemsOf, opsMutation, patchItem, patchItems, removeItems, replaceItem, replaceWithMany, setField, setFieldIfChanged } from "./opsBuild";
|
||||
export { cmdMutation } from "./document";
|
||||
export type { EntityCollection, EntityOf, ProjectMutation } from "./opsBuild";
|
||||
|
||||
@@ -102,6 +102,16 @@ export function addItems<K extends EntityCollection>(collection: K, items: reado
|
||||
return [op];
|
||||
}
|
||||
|
||||
/** Die Elemente, die `ops` in die Liste `collection` einfügen (`add`, bzw. `setField` der ganzen Liste). */
|
||||
export function addedItems(ops: readonly CoreOp[], collection: string): unknown[] {
|
||||
const out: unknown[] = [];
|
||||
for (const op of ops) {
|
||||
if (op.kind === "add" && op.collection === collection) out.push(...op.items);
|
||||
else if (op.kind === "setField" && op.key === collection && Array.isArray(op.value)) out.push(...(op.value as unknown[]));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Entfernt die Elemente aus `ids` (bzw. für die `ids(e)` wahr ist), die es gibt; leer, wenn keines trifft. */
|
||||
export function removeItems<K extends EntityCollection>(
|
||||
p: Project,
|
||||
|
||||
Reference in new issue
Block a user