refactor(scene): rename model_solid to solid_model
Match the `*_model` naming of the sibling render models (wire_model, hatch_model, mesh_model, image_model). Also realign the related Scene API for consistency: model_solids → solid_models, add_model_solid → add_solid_model, register_model_solid → register_solid_model. No behavior change; build and tests are green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
7fe7e0230d
commit
c6152ef705
6 changed files with 26 additions and 26 deletions
|
|
@ -685,7 +685,7 @@ pub struct Scene {
|
|||
/// keyed by entity handle. Backs the Design-group boolean tools (a solid
|
||||
/// must be here to be combined). Not persisted — rebuilt only by creating
|
||||
/// or combining primitives in-session.
|
||||
pub model_solids: HashMap<Handle, truck_modeling::Solid>,
|
||||
pub solid_models: HashMap<Handle, truck_modeling::Solid>,
|
||||
/// GPU render data for raster images (RasterImage entities), keyed by handle.
|
||||
pub images: HashMap<Handle, ImageModel>,
|
||||
/// The viewport that is currently "entered" (MSPACE mode).
|
||||
|
|
@ -821,7 +821,7 @@ impl Scene {
|
|||
current_layout: "Model".to_string(),
|
||||
hatches: HashMap::default(),
|
||||
meshes: HashMap::default(),
|
||||
model_solids: HashMap::default(),
|
||||
solid_models: HashMap::default(),
|
||||
images: HashMap::default(),
|
||||
active_viewport: None,
|
||||
bg_color: [0.11, 0.11, 0.11, 1.0],
|
||||
|
|
@ -1011,16 +1011,16 @@ impl Scene {
|
|||
/// tessellate it into the shaded mesh pipeline under `handle`. The solid is
|
||||
/// in the same offset-relative frame the mesh pipeline uses, so the mesh is
|
||||
/// stored as-is (Model-tab geometry is authored at world_offset 0).
|
||||
pub fn register_model_solid(&mut self, handle: Handle, solid: truck_modeling::Solid) {
|
||||
pub fn register_solid_model(&mut self, handle: Handle, solid: truck_modeling::Solid) {
|
||||
let color = self
|
||||
.document
|
||||
.get_entity(handle)
|
||||
.map(|e| self.render_style(e).0)
|
||||
.unwrap_or([0.8, 0.8, 0.85, 1.0]);
|
||||
if let Some(set) = crate::scene::model::model_solid::mesh_from_solid(&solid, color) {
|
||||
if let Some(set) = crate::scene::model::solid_model::mesh_from_solid(&solid, color) {
|
||||
self.meshes.insert(handle, set);
|
||||
}
|
||||
self.model_solids.insert(handle, solid);
|
||||
self.solid_models.insert(handle, solid);
|
||||
self.bump_geometry();
|
||||
}
|
||||
|
||||
|
|
@ -3360,7 +3360,7 @@ impl Scene {
|
|||
for h in &to_remove {
|
||||
self.hatches.remove(h);
|
||||
self.meshes.remove(h);
|
||||
self.model_solids.remove(h);
|
||||
self.solid_models.remove(h);
|
||||
self.document.remove_entity(*h);
|
||||
}
|
||||
|
||||
|
|
@ -4808,7 +4808,7 @@ impl Scene {
|
|||
self.selected.remove(&h);
|
||||
self.hatches.remove(&h);
|
||||
self.meshes.remove(&h);
|
||||
self.model_solids.remove(&h);
|
||||
self.solid_models.remove(&h);
|
||||
self.mark_entity_dirty(h);
|
||||
}
|
||||
// Remove erased handles from all groups; delete groups that become empty.
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ pub mod hatch_model;
|
|||
pub mod hatch_patterns;
|
||||
pub mod image_model;
|
||||
pub mod mesh_model;
|
||||
pub mod model_solid;
|
||||
pub mod solid_model;
|
||||
pub mod object;
|
||||
|
|
|
|||
Loading…
Reference in a new issue