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:
Hakan Seven 2026-06-16 11:39:31 +03:00
commit c6152ef705
6 changed files with 26 additions and 26 deletions

View file

@ -134,7 +134,7 @@ impl OpenCADStudio {
CmdResult::CommitSolid { entity, solid } => {
let label = self.history_label_from_active_cmd(i, "SOLID");
self.push_undo_snapshot(i, label);
self.add_model_solid(entity, *solid);
self.add_solid_model(entity, *solid);
self.tabs[i].dirty = true;
self.tabs[i].scene.clear_preview_wire();
self.tabs[i].active_cmd = None;

View file

@ -9,18 +9,18 @@ use truck_modeling::Solid;
use super::Message;
use crate::modules::model::boolean_cmd::BoolOp;
use crate::scene::model::model_solid::{self, Bool};
use crate::scene::model::solid_model::{self, Bool};
impl super::OpenCADStudio {
/// Commit a Model-tab solid: add its acadrust entity to the document, then
/// register the truck B-rep (caches it for booleans + tessellates it into
/// the shaded mesh pipeline). Returns the new entity handle.
pub(super) fn add_model_solid(&mut self, entity: EntityType, solid: Solid) -> Handle {
pub(super) fn add_solid_model(&mut self, entity: EntityType, solid: Solid) -> Handle {
let i = self.active_tab;
let Some(handle) = self.commit_entity_handle(entity) else {
return Handle::NULL;
};
self.tabs[i].scene.register_model_solid(handle, solid);
self.tabs[i].scene.register_solid_model(handle, solid);
handle
}
@ -34,7 +34,7 @@ impl super::OpenCADStudio {
.selected
.iter()
.copied()
.filter(|h| self.tabs[i].scene.model_solids.contains_key(h))
.filter(|h| self.tabs[i].scene.solid_models.contains_key(h))
.collect();
if handles.len() != 2 {
self.command_line.push_error(
@ -42,14 +42,14 @@ impl super::OpenCADStudio {
);
return Task::none();
}
let a = self.tabs[i].scene.model_solids[&handles[0]].clone();
let b = self.tabs[i].scene.model_solids[&handles[1]].clone();
let a = self.tabs[i].scene.solid_models[&handles[0]].clone();
let b = self.tabs[i].scene.solid_models[&handles[1]].clone();
let kind = match op {
BoolOp::Union => Bool::Union,
BoolOp::Subtract => Bool::Subtract,
BoolOp::Intersect => Bool::Intersect,
};
let Some(result) = model_solid::boolean(kind, &a, &b) else {
let Some(result) = solid_model::boolean(kind, &a, &b) else {
self.command_line
.push_error("Boolean failed — the solids may not overlap.");
return Task::none();
@ -62,8 +62,8 @@ impl super::OpenCADStudio {
// so it lives as a Solid3D whose render/boolean data is the injected
// truck mesh + cached B-rep; its edge wires make it pickable.
let mut s3d = Solid3D::new();
s3d.wires = model_solid::edge_wires(&result);
let handle = self.add_model_solid(EntityType::Solid3D(s3d), result);
s3d.wires = solid_model::edge_wires(&result);
let handle = self.add_solid_model(EntityType::Solid3D(s3d), result);
self.tabs[i].scene.deselect_all();
if !handle.is_null() {
self.tabs[i].scene.select_entity(handle, false);