[137] Achsraster im Schnitt/in der Ansicht anwählbar, Schlagschatten der Ansicht wählbar (Schalter in der Objekt-Info), Schriftfeld auf dem Blatt bearbeitbar, Nordpfeil/Massstabsbalken des Präsentationsplans als Gruppen
This commit is contained in:
13 files changed
+160
-11
No files matched your search
@@ -1406,7 +1406,12 @@ pub fn elevation_primitives(p: &Project, level: &LevelSpec, shadows: bool, mono:
|
||||
})
|
||||
.collect();
|
||||
i += 2 * count;
|
||||
items.push(Item { depth: depth - EPS * 10.0, seq, rank: None, prim: polygon(pts, SHADOW_FILL, "none", 0.0, no_hatch()) });
|
||||
let mut prim = polygon(pts, SHADOW_FILL, "none", 0.0, no_hatch());
|
||||
// [137] Klick auf den Schlagschatten wählt die Schatten-Einstellung der Ansicht (keine Element-Id).
|
||||
if let Primitive::Polygon { context_object_id, .. } = &mut prim {
|
||||
*context_object_id = Some(crate::plan::extras::SITE_PICK_VIEW_SHADOWS.into());
|
||||
}
|
||||
items.push(Item { depth: depth - EPS * 10.0, seq, rank: None, prim });
|
||||
seq += 1;
|
||||
}
|
||||
}
|
||||
@@ -1801,6 +1806,9 @@ mod tests {
|
||||
let json = serde_json::to_string(&prims).unwrap();
|
||||
assert!(json.contains("\"wallId\":\"W1\"") && json.contains("\"openingId\":\"O1\"") && json.contains("elevation-ground"), "{json}");
|
||||
assert!(json.contains("#8f959e"), "Schlagschatten fehlt");
|
||||
// [137] Schlagschatten anwählbar: Pick-Id der Ansichts-Schatten (Objekt-Info schaltet sie)
|
||||
let shadow: Vec<_> = prims.iter().filter(|q| matches!(q, Primitive::Polygon { fill, .. } if fill == SHADOW_FILL)).collect();
|
||||
assert!(!shadow.is_empty() && shadow.iter().all(|q| matches!(q, Primitive::Polygon { context_object_id: Some(id), .. } if id == crate::plan::extras::SITE_PICK_VIEW_SHADOWS)));
|
||||
assert!(b[2] > b[0]);
|
||||
// Painter: die Bodenlinie zuletzt
|
||||
assert!(matches!(prims.last(), Some(Primitive::Line { cls, .. }) if cls == "elevation-ground"));
|
||||
|
||||
@@ -15,6 +15,8 @@ use std::collections::HashMap;
|
||||
/// beginnt so): Schattenflächen wählen den Sonnenstand, die Baurechtslinien (unsichtbare Bänder) das Baurecht.
|
||||
pub const SITE_PICK_SUN: &str = "@sunStudy";
|
||||
pub const SITE_PICK_RULES: &str = "@siteRules";
|
||||
/// [137] Schlagschatten der Ansicht (Ebenen-Schalter `shadows`).
|
||||
pub const SITE_PICK_VIEW_SHADOWS: &str = "@viewShadows";
|
||||
|
||||
/// Füllfarbe der Schattenflächen.
|
||||
pub const SUN_SHADOW_FILL: &str = "#3a4a66";
|
||||
|
||||
@@ -25,7 +25,15 @@ pub fn grid_prims(p: &Project, level: &LevelSpec, bounds: [f64; 4], scale: f64)
|
||||
for d in &p.drawings2d {
|
||||
let Drawing2DGeom::Grid { bubble_mm, bubbles, .. } = &d.geom else { continue };
|
||||
let Some(spec) = Spec::of(&d.geom) else { continue };
|
||||
out.extend(one(&spec, &plane, level, bounds, scale, bubble_diameter(*bubble_mm, scale), bubbles.unwrap_or(GridBubbles::Both)));
|
||||
// [137] Achsen, Blasen und Beschriftung tragen die Raster-Id: im Schnitt/in der Ansicht anwählbar.
|
||||
let id = Some(d.id.clone());
|
||||
out.extend(one(&spec, &plane, level, bounds, scale, bubble_diameter(*bubble_mm, scale), bubbles.unwrap_or(GridBubbles::Both)).into_iter().map(|mut q| {
|
||||
match &mut q {
|
||||
Primitive::Line { drawing_id, .. } | Primitive::DrawingCircle { drawing_id, .. } | Primitive::DrawingText { drawing_id, .. } => *drawing_id = id.clone(),
|
||||
_ => {}
|
||||
}
|
||||
q
|
||||
}));
|
||||
}
|
||||
out
|
||||
}
|
||||
@@ -147,6 +155,8 @@ mod tests {
|
||||
assert!((lines[0].0 - 1.0).abs() < 1e-9 && (lines[1].0 - 5.0).abs() < 1e-9);
|
||||
assert!(lines[0].1 < 0.0 && lines[0].2 > 6.0);
|
||||
assert_eq!(texts(&prims), ["1", "2"]);
|
||||
// [137] alles mit der Raster-Id (anwählbar)
|
||||
assert!(prims.iter().all(|q| matches!(q, Primitive::Line { drawing_id: Some(i), .. } | Primitive::DrawingCircle { drawing_id: Some(i), .. } | Primitive::DrawingText { drawing_id: Some(i), .. } if i == "G")), "{prims:?}");
|
||||
// Schnitt längs der Achsen 1/2: nur die waagrechten Achsen A, B queren.
|
||||
let level = LevelSpec { kind: "section".into(), line: Some([v2(2.0, -1.0), v2(2.0, 9.0)]), ..Default::default() };
|
||||
let prims = grid_prims(&p, &level, [0.0, 0.0, 9.0, 6.0], 100.0);
|
||||
|
||||
Reference in new issue
Block a user