forked from 1b-agent/opencadstudio-upstream
refactor(tess): rename LegacyTess → FallbackTess
The trait isn't deprecating anything — it carries the path entities take when they're not covered by the truck topology pipeline (Viewport, Insert, Hatch outline, Ole2Frame). "Fallback" names the purpose; "Legacy" implied retirement that isn't actually on the roadmap. Same rename for LegacyGeometry → FallbackGeometry, legacy_geometry() → fallback_geometry(). Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
aadb64860d
commit
b413fe0efe
8 files changed
+35
-36
No files matched your search
@@ -3,9 +3,9 @@ use glam::Vec3;
|
||||
|
||||
use crate::command::EntityTransform;
|
||||
use crate::entities::common::{diamond_grip, edit_prop as edit, parse_f64, ro_prop as ro};
|
||||
use crate::entities::traits::{Grippable, LegacyTess, PropertyEditable, Transformable};
|
||||
use crate::entities::traits::{Grippable, FallbackTess, PropertyEditable, Transformable};
|
||||
use crate::scene::object::{GripApply, GripDef, PropSection, PropValue, Property};
|
||||
use crate::scene::tess_util::{arc_segments, arc_signed_span, wire_chord_tol, LegacyGeometry};
|
||||
use crate::scene::tess_util::{arc_segments, arc_signed_span, wire_chord_tol, FallbackGeometry};
|
||||
use crate::scene::wire_model::SnapHint;
|
||||
|
||||
fn properties(h: &Hatch) -> PropSection {
|
||||
@@ -350,8 +350,8 @@ impl Grippable for Hatch {
|
||||
}
|
||||
}
|
||||
|
||||
impl LegacyTess for Hatch {
|
||||
fn legacy_geometry(&self, world_offset: [f64; 3]) -> LegacyGeometry {
|
||||
impl FallbackTess for Hatch {
|
||||
fn fallback_geometry(&self, world_offset: [f64; 3]) -> FallbackGeometry {
|
||||
let [ox, oy, oz] = world_offset;
|
||||
let normal = (self.normal.x, self.normal.y, self.normal.z);
|
||||
// Convert a 2D OCS hatch boundary point to WCS, then subtract world_offset.
|
||||
|
||||
@@ -119,8 +119,8 @@ impl Transformable for Insert {
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::entities::traits::LegacyTess for Insert {
|
||||
fn legacy_geometry(&self, world_offset: [f64; 3]) -> crate::scene::tess_util::LegacyGeometry {
|
||||
impl crate::entities::traits::FallbackTess for Insert {
|
||||
fn fallback_geometry(&self, world_offset: [f64; 3]) -> crate::scene::tess_util::FallbackGeometry {
|
||||
let [ox, oy, oz] = world_offset;
|
||||
let ip = Vec3::new(
|
||||
(self.insert_point.x - ox) as f32,
|
||||
|
||||
@@ -202,8 +202,8 @@ impl Transformable for Ole2Frame {
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::entities::traits::LegacyTess for Ole2Frame {
|
||||
fn legacy_geometry(&self, world_offset: [f64; 3]) -> crate::scene::tess_util::LegacyGeometry {
|
||||
impl crate::entities::traits::FallbackTess for Ole2Frame {
|
||||
fn fallback_geometry(&self, world_offset: [f64; 3]) -> crate::scene::tess_util::FallbackGeometry {
|
||||
// OLE objects carry a bounding rectangle in model space.
|
||||
// Render a simple X-through-rectangle placeholder.
|
||||
let [ox, oy, oz] = world_offset;
|
||||
|
||||
@@ -3,18 +3,18 @@ use acadrust::{CadDocument, EntityType};
|
||||
use crate::command::EntityTransform;
|
||||
use crate::scene::acad_to_truck::TruckEntity;
|
||||
use crate::scene::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::tess_util::LegacyGeometry;
|
||||
use crate::scene::tess_util::FallbackGeometry;
|
||||
|
||||
pub trait TruckConvertible {
|
||||
fn to_truck(&self, document: &CadDocument) -> Option<TruckEntity>;
|
||||
}
|
||||
|
||||
/// Legacy fallback geometry for entities not covered by the truck
|
||||
/// topology pipeline (Viewport, Insert, Hatch outline, Ole2Frame, …).
|
||||
/// Returns world-offset-relative `f32` points + snap/key vertices the
|
||||
/// Fallback geometry for entities not routed through the truck topology
|
||||
/// pipeline (Viewport, Insert, Hatch outline, Ole2Frame). Returns
|
||||
/// world-offset-relative `f32` points + snap/key vertices the
|
||||
/// dispatcher wraps into a `WireModel`.
|
||||
pub trait LegacyTess {
|
||||
fn legacy_geometry(&self, world_offset: [f64; 3]) -> LegacyGeometry;
|
||||
pub trait FallbackTess {
|
||||
fn fallback_geometry(&self, world_offset: [f64; 3]) -> FallbackGeometry;
|
||||
}
|
||||
|
||||
pub trait Grippable {
|
||||
|
||||
@@ -567,8 +567,8 @@ impl Transformable for Viewport {
|
||||
}
|
||||
}
|
||||
|
||||
impl crate::entities::traits::LegacyTess for Viewport {
|
||||
fn legacy_geometry(&self, world_offset: [f64; 3]) -> crate::scene::tess_util::LegacyGeometry {
|
||||
impl crate::entities::traits::FallbackTess for Viewport {
|
||||
fn fallback_geometry(&self, world_offset: [f64; 3]) -> crate::scene::tess_util::FallbackGeometry {
|
||||
let [ox, oy, oz] = world_offset;
|
||||
let cx = (self.center.x - ox) as f32;
|
||||
let cy = (self.center.y - oy) as f32;
|
||||
|
||||
Reference in new issue
Block a user