[181] [152] Importe als eigenständige Elemente: Klasse Pflicht, Herkunft nur Auskunft, keine Import-Liste
Gelände, Höhenlinien, Netzkörper (Nachbargebäude, IFC/OBJ/STEP/DXF-Netze), Luftbilder und Baugruben (`Project.context`) sind normale Elemente: - Modell: `categoryCode` Pflicht (String) an allen fünf Arten; `layer` (Gruppierung) und `hidden` (Einzel-Ausblenden) entfallen; neu `source` (Herkunft, ohne Wirkung). `ContextObject::category_code()`. - Kern: Plan, Schnitt, Ansicht, 3D, Pick fragen nur die Klasse ab (kein „ohne Kategorie immer sichtbar"). IFC-Gelände (IfcSite bzw. Name Gelände/Terrain) wird beim Import ein Gelände-Element (`import_context::ifc_meshes`); `mesh_view::is_terrain` entfällt, geschlossene Gelände-Netze schneidet der Schnitt als Oberkante. Importe setzen `source` statt `layer` (IFC-Klasse, DXF-Layer, STEP-Datei). - Objekt-Info: Klasse im Kopf änderbar und Farbe der Klasse auch für Gelände-/Umgebungs-Elemente, Herkunft als Auskunft; Einzel-Ausblenden-Schalter entfernt. - Panel „Gelände": Import-Liste entfernt (nur Aktionen); Elemente-Panel mit Knoten „Gelände & Umgebung". - swissBUILDINGS3D/OSM/swissALTI3D/SWISSIMAGE setzen Klasse und `source`; Dach-Trennung über den DXF-Layer beim Import. - Musterhaus komplex nachgeführt (ohne `layer`); Doku: ARCHITEKTUR Abschnitt 8 (Entwurf), Glossar, READMEs. Geprüft: cargo test im Kern (bis auf den Zeit-Wächter ansicht_gross_schnell unter Last), vitest (alle), tsc, Plan-/CLI-Goldens unverändert, e2e siteSelect/excavation/terrainHide angepasst und grün. Musterhaus komplex mit zwei Nachbarnetzen: Grundriss EG/UG 1:200, Schnitt A-A, Ansicht Süd per CLI vor/nach byte-gleich (angesehen). Nicht in der Tauri-App/auf dem Mac geprüft.
This commit is contained in:
70 files changed
+616
-710
No files matched your search
@@ -5764,9 +5764,9 @@ pub struct Project {
|
||||
pub rooms: Option<Vec<Room>>,
|
||||
/// Freie 2D-Zeichengeometrie (Line/Polyline/Rect/Circle/Arc/Text).
|
||||
pub drawings2d: Vec<Drawing2D>,
|
||||
/// Kontext-Schicht: importierte/abgeleitete „dumme" Geometrie (Meshes,
|
||||
/// Konturen, Gelände-TIN) — NICHT semantisch. Optional, damit bestehende
|
||||
/// Projekte/Tests ohne `context` gültig bleiben (Default: leer behandeln).
|
||||
/// [181] Gelände- und Umgebungs-Elemente (Gelände, Höhenlinien, Netzkörper wie Nachbargebäude, Luftbilder,
|
||||
/// Baugruben): normale Elemente mit Klasse (`categoryCode`), unabhängig von ihrer Herkunft; s.
|
||||
/// {@link ContextObject}. Fehlt das Feld, gilt die Liste als leer.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub context: Option<Vec<ContextObject>>,
|
||||
@@ -6104,17 +6104,15 @@ pub struct SequenceRule {
|
||||
pub struct ImportedMesh {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
/// Ursprünglicher DXF-Layer-Name (für spätere Kategorisierung).
|
||||
/// [181] Klasse/Ebene (Grafik-Kategorie, s. {@link LayerCategory}): steuert Sichtbarkeit, Grau und
|
||||
/// Sperren wie bei jedem anderen Element. Pflicht; Importe setzen sie (`model/contextCategories.ts`).
|
||||
#[serde(rename = "categoryCode")]
|
||||
pub category_code: String,
|
||||
/// [181] Herkunft (z. B. „swissBUILDINGS3D", „IFC IfcSite", „DXF-Layer Haus") — nur Auskunft in der
|
||||
/// Objekt-Info, ohne jede Wirkung auf Darstellung oder Sichtbarkeit (die steuert allein `categoryCode`).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub layer: Option<String>,
|
||||
/// Grafik-Kategorie-Code (s. {@link LayerCategory}, `model/contextCategories.ts`)
|
||||
/// — steuert Sichtbarkeit/Grau/Sperren wie bei jedem anderen Bauteil (Ebenen-
|
||||
/// Panel). Fehlt er (ältere Importe vor dieser Erweiterung), bleibt das Objekt
|
||||
/// IMMER sichtbar (Rückwärtskompatibilität), s. `plan/context.rs` im Kern.
|
||||
#[serde(rename = "categoryCode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub category_code: Option<String>,
|
||||
pub source: Option<String>,
|
||||
/// Farbe aus der Quelldatei (`#rrggbb`, z. B. IFC-Oberflächenstil/Material); fehlt sie, gilt die Kontext-Grundfarbe.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
@@ -6131,11 +6129,6 @@ pub struct ImportedMesh {
|
||||
#[serde(rename = "creaseAngle", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub crease_angle: Option<f64>,
|
||||
/// [137] Nur dieses Netz ausblenden (Grundriss, Schnitt, Ansicht, 3D, Pick); die Kategorie bleibt
|
||||
/// davon unberührt. Fehlt/false = sichtbar.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub hidden: Option<bool>,
|
||||
pub positions: Vec<f64>,
|
||||
pub indices: Vec<f64>,
|
||||
#[serde(flatten)]
|
||||
@@ -6204,14 +6197,15 @@ pub struct Contour {
|
||||
pub struct ContourSet {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
/// Ursprünglicher DXF-Layer-Name (für spätere Kategorisierung).
|
||||
/// [181] Klasse/Ebene (Grafik-Kategorie, s. {@link LayerCategory}): steuert Sichtbarkeit, Grau und
|
||||
/// Sperren wie bei jedem anderen Element. Pflicht; Importe setzen sie (`model/contextCategories.ts`).
|
||||
#[serde(rename = "categoryCode")]
|
||||
pub category_code: String,
|
||||
/// [181] Herkunft (z. B. „swissBUILDINGS3D", „IFC IfcSite", „DXF-Layer Haus") — nur Auskunft in der
|
||||
/// Objekt-Info, ohne jede Wirkung auf Darstellung oder Sichtbarkeit (die steuert allein `categoryCode`).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub layer: Option<String>,
|
||||
/// Grafik-Kategorie-Code, s. {@link ImportedMesh.categoryCode}.
|
||||
#[serde(rename = "categoryCode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub category_code: Option<String>,
|
||||
pub source: Option<String>,
|
||||
pub contours: Vec<Contour>,
|
||||
#[serde(flatten)]
|
||||
#[ts(skip)]
|
||||
@@ -6220,20 +6214,22 @@ pub struct ContourSet {
|
||||
|
||||
/// Ein TIN-Geländemodell, abgeleitet aus Konturen (Delaunay über (x,y), Z aus der
|
||||
/// jeweiligen Kontur-Höhe). `positions` = flaches (x,y,z…)-Array in Metern,
|
||||
/// `indices` = Dreiecks-Indizes. Gelände ist NICHT semantisch (Kontext-Schicht).
|
||||
/// `indices` = Dreiecks-Indizes. Gelände-Element ([181]): aus Höhenlinien erzeugt oder importiert (swissALTI3D,
|
||||
/// IFC-Gelände), danach unabhängig von der Quelle.
|
||||
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, TS)]
|
||||
#[serde(default)]
|
||||
pub struct TerrainMesh {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
/// Ebenen-/Gruppierungsname (SitePanel), z. B. „Terrain". Optional.
|
||||
/// [181] Klasse/Ebene (Grafik-Kategorie, s. {@link LayerCategory}): steuert Sichtbarkeit, Grau und
|
||||
/// Sperren wie bei jedem anderen Element. Pflicht; Importe setzen sie (`model/contextCategories.ts`).
|
||||
#[serde(rename = "categoryCode")]
|
||||
pub category_code: String,
|
||||
/// [181] Herkunft (z. B. „swissBUILDINGS3D", „IFC IfcSite", „DXF-Layer Haus") — nur Auskunft in der
|
||||
/// Objekt-Info, ohne jede Wirkung auf Darstellung oder Sichtbarkeit (die steuert allein `categoryCode`).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub layer: Option<String>,
|
||||
/// Grafik-Kategorie-Code, s. {@link ImportedMesh.categoryCode}.
|
||||
#[serde(rename = "categoryCode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub category_code: Option<String>,
|
||||
pub source: Option<String>,
|
||||
pub positions: Vec<f64>,
|
||||
pub indices: Vec<f64>,
|
||||
/// Optionale Pro-Vertex-Albedo (flach `[r,g,b, …]`, 0..1) — ein Wert je
|
||||
@@ -6265,11 +6261,6 @@ pub struct TerrainMesh {
|
||||
#[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub source_id: Option<String>,
|
||||
/// [137] Nur dieses Netz ausblenden (Grundriss, Schnitt, Ansicht, 3D, Pick); die Kategorie bleibt
|
||||
/// davon unberührt. Fehlt/false = sichtbar.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub hidden: Option<bool>,
|
||||
#[serde(flatten)]
|
||||
#[ts(skip)]
|
||||
pub extra: Extra,
|
||||
@@ -6285,12 +6276,10 @@ pub struct TerrainMesh {
|
||||
pub struct Excavation {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub layer: Option<String>,
|
||||
#[serde(rename = "categoryCode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub category_code: Option<String>,
|
||||
/// [181] Klasse/Ebene (Grafik-Kategorie, s. {@link LayerCategory}): steuert Sichtbarkeit, Grau und
|
||||
/// Sperren wie bei jedem anderen Element. Pflicht; Importe setzen sie (`model/contextCategories.ts`).
|
||||
#[serde(rename = "categoryCode")]
|
||||
pub category_code: String,
|
||||
pub outline: Vec<Vec2>,
|
||||
pub bottom: f64,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
@@ -6356,14 +6345,15 @@ pub struct ContextImageFilters {
|
||||
pub struct ContextImage {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
/// Ebenen-/Gruppierungsname (SitePanel), z. B. „Luftbild". Optional.
|
||||
/// [181] Klasse/Ebene (Grafik-Kategorie, s. {@link LayerCategory}): steuert Sichtbarkeit, Grau und
|
||||
/// Sperren wie bei jedem anderen Element. Pflicht; Importe setzen sie (`model/contextCategories.ts`).
|
||||
#[serde(rename = "categoryCode")]
|
||||
pub category_code: String,
|
||||
/// [181] Herkunft (z. B. „swissBUILDINGS3D", „IFC IfcSite", „DXF-Layer Haus") — nur Auskunft in der
|
||||
/// Objekt-Info, ohne jede Wirkung auf Darstellung oder Sichtbarkeit (die steuert allein `categoryCode`).
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub layer: Option<String>,
|
||||
/// Grafik-Kategorie-Code, s. {@link ImportedMesh.categoryCode}.
|
||||
#[serde(rename = "categoryCode", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub category_code: Option<String>,
|
||||
pub source: Option<String>,
|
||||
/// Bildquelle als Data-URL (PNG/JPEG).
|
||||
pub src: String,
|
||||
/// Modell-Meter Bounding-Box (das Bild füllt [min..max] planar von oben).
|
||||
|
||||
@@ -630,7 +630,9 @@ pub enum ParametricRule {
|
||||
Sequence(SequenceRule),
|
||||
}
|
||||
|
||||
/// Kontext-Objekt (Tag `type`).
|
||||
/// Gelände- und Umgebungs-Element (Tag `type`, Sammlung `Project.context`, [181]): Netzkörper (`importedMesh`,
|
||||
/// z. B. Nachbargebäude), Höhenlinien (`contourSet`), Gelände (`terrainMesh`), Luftbild (`image`), Baugrube
|
||||
/// (`excavation`). Normale Elemente mit Klasse (`categoryCode`), unabhängig davon, woher sie kommen.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, TS)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum ContextObject {
|
||||
@@ -646,6 +648,30 @@ pub enum ContextObject {
|
||||
Excavation(Excavation),
|
||||
}
|
||||
|
||||
impl ContextObject {
|
||||
/// [181] Klasse/Ebene des Elements (Pflichtfeld jeder Art).
|
||||
pub fn category_code(&self) -> &str {
|
||||
match self {
|
||||
ContextObject::ImportedMesh(m) => &m.category_code,
|
||||
ContextObject::ContourSet(s) => &s.category_code,
|
||||
ContextObject::TerrainMesh(t) => &t.category_code,
|
||||
ContextObject::Image(i) => &i.category_code,
|
||||
ContextObject::Excavation(e) => &e.category_code,
|
||||
}
|
||||
}
|
||||
|
||||
/// Element-Id.
|
||||
pub fn id(&self) -> &str {
|
||||
match self {
|
||||
ContextObject::ImportedMesh(m) => &m.id,
|
||||
ContextObject::ContourSet(s) => &s.id,
|
||||
ContextObject::TerrainMesh(t) => &t.id,
|
||||
ContextObject::Image(i) => &i.id,
|
||||
ContextObject::Excavation(e) => &e.id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Drawing2DGeom {
|
||||
fn default() -> Self {
|
||||
Drawing2DGeom::Pointmarker { at: Vec2::default() }
|
||||
|
||||
@@ -45,7 +45,7 @@ mod tests {
|
||||
#[test]
|
||||
fn importiertes_netz_mit_farbe_und_ifc_id() {
|
||||
let raw: Value = serde_json::from_str(
|
||||
r##"{"type":"importedMesh","id":"m","name":"Wand","color":"#aabbcc","ifcGlobalId":"2O2Fr$t4X7Zf8NOew3FLOH",
|
||||
r##"{"type":"importedMesh","id":"m","name":"Wand","categoryCode":"10","source":"IFC IfcWall","color":"#aabbcc","ifcGlobalId":"2O2Fr$t4X7Zf8NOew3FLOH",
|
||||
"positions":[0,0,0],"indices":[0,0,0]}"##,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
Reference in new issue
Block a user