DWF/DGN underlays: clipping, layers, text, 3D DGN, colours and zoom extents

- PDFOSNAP, DWFOSNAP and DGNOSNAP are separate; UOSNAP sets them all and
  reads 2 while they differ. Enable Snap switches the selected kind's.
- DWFCLIP / DGNCLIP clip their own kind with the kind's prompts and message;
  CLIP routes DWF and DGN underlays there; Enter at a corner asks again.
- The right-edge underlay tools show for DWF and DGN too (import is PDF
  only).
- Underlay layers: DGN levels (V8 level table, "Default" listed as "0"; V7
  used levels named from the level name table), hidden through the layer
  override data with the DGN placeholder string first; a plotted DWF has
  none.
- V8 colour read from its colour word (by level, index, or a true colour
  drawn as its nearest index); 3D V8 elements drawn in plan (lines, line
  strings, ellipses and arcs by their orientation, text); a model's extent
  includes its text.
- DWF 6 TrueType text (font, height, rotation from the font opcode) and DWFx
  glyph runs are drawn; the default W2D colour map is the measured one.
- Contrast pulls lightness towards a per-kind pivot as measured (PDF 0.5,
  DWF 0.243, DGN 0.65).
- Zoom extents includes raster images and underlays whose frames are hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-28 16:10:01 +03:00
1 parent 1cbe89ef62
commit 56ecf786f1
41 files changed
+593 -147

No files matched your search

+15 -4
View File
@@ -1183,16 +1183,27 @@ impl OpenCADStudio {
}
return Some(self.finish_dispatch(cmd));
}
// ponytail: one flag for every underlay kind; split it if a drawing
// needs PDF snaps on while DWF/DGN snaps are off.
if matches!(name.as_str(), "PDFOSNAP" | "DWFOSNAP" | "DGNOSNAP" | "UOSNAP") {
let current = i16::from(crate::scene::model::pdf_vector::pdf_osnap());
use crate::scene::model::pdf_vector as pv;
use codec::entities::UnderlayType;
// UOSNAP sets every kind and reads 2 while they differ.
let kind = match name.as_str() {
"PDFOSNAP" => Some(UnderlayType::Pdf),
"DWFOSNAP" => Some(UnderlayType::Dwf),
"DGNOSNAP" => Some(UnderlayType::Dgn),
_ => None,
};
let current = kind.map_or_else(pv::uosnap, |kind| i16::from(pv::underlay_osnap(kind)));
if let Some(value) = &value {
match value.parse::<i16>().ok().filter(|value| (0..=1).contains(value)) {
Some(mode) => {
if current != mode {
crate::scene::model::pdf_vector::set_pdf_osnap(mode == 1);
match kind {
Some(kind) => pv::set_underlay_osnap(kind, mode == 1),
None => pv::set_uosnap(mode == 1),
}
self.tabs[i].scene.reseed_underlays();
self.sync_underlay_tab();
}
}
None => self.command_line.push_error("Requires 0 or 1 only"),