refactor(scene): group modules into role-based subfolders

Move the 30 flat modules under src/scene/ into six folders by role:
convert (entity→geometry), text (fonts/shaping), model (render models),
pick (hit-test/selection/grips/xclip), view (camera/transform/render),
cache (block + property caches). pipeline/ is unchanged.

Full path migration — all `scene::X` references become
`scene::<group>::X`, no compatibility re-exports. render.rs items that
were `pub(super)` (parent was scene) become `pub(in crate::scene)` to
keep their original scene-wide visibility.

No behavior change; build and tests are green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-16 11:33:46 +03:00
1 parent cd048165a9
commit 7fe7e0230d
160 files changed
+732 -715

No files matched your search

+21 -21
View File
@@ -523,8 +523,8 @@ impl OpenCADStudio {
for h in &dest {
if let Some(e) = self.tabs[i].scene.document.get_entity_mut(*h) {
e.as_entity_mut().set_layer(layer.clone());
crate::scene::dispatch::apply_color(e, color);
crate::scene::dispatch::apply_line_weight(e, lw);
crate::scene::view::dispatch::apply_color(e, color);
crate::scene::view::dispatch::apply_line_weight(e, lw);
e.common_mut().linetype = linetype.clone();
e.common_mut().linetype_scale = lt_scale;
}
@@ -553,7 +553,7 @@ impl OpenCADStudio {
.clone()
.into_iter()
.map(|mut entity| {
crate::scene::dispatch::apply_transform(&mut entity, &translate);
crate::scene::view::dispatch::apply_transform(&mut entity, &translate);
entity.common_mut().handle = acadrust::Handle::NULL;
self.tabs[i].scene.add_entity(entity)
})
@@ -1170,8 +1170,8 @@ impl OpenCADStudio {
} => {
use crate::entities::traits::EntityTypeOps;
use crate::modules::insert::solid3d_cmds::empty_solid3d;
use crate::scene::acad_to_truck::TruckObject;
use crate::scene::truck_tess;
use crate::scene::convert::acad_to_truck::TruckObject;
use crate::scene::convert::truck_tess;
use truck_modeling::builder;
use truck_modeling::Vector3 as TruckVec3;
@@ -1192,7 +1192,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1236,8 +1236,8 @@ impl OpenCADStudio {
} => {
use crate::entities::traits::EntityTypeOps;
use crate::modules::insert::solid3d_cmds::empty_solid3d;
use crate::scene::acad_to_truck::TruckObject;
use crate::scene::truck_tess;
use crate::scene::convert::acad_to_truck::TruckObject;
use crate::scene::convert::truck_tess;
use truck_modeling::builder;
use truck_modeling::{Point3, Rad, Vector3 as TruckVec3};
@@ -1270,7 +1270,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1311,8 +1311,8 @@ impl OpenCADStudio {
} => {
use crate::entities::traits::EntityTypeOps;
use crate::modules::insert::solid3d_cmds::empty_solid3d;
use crate::scene::acad_to_truck::TruckObject;
use crate::scene::truck_tess;
use crate::scene::convert::acad_to_truck::TruckObject;
use crate::scene::convert::truck_tess;
use truck_modeling::builder;
use truck_modeling::Vector3 as TruckVec3;
@@ -1355,7 +1355,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1372,7 +1372,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1404,7 +1404,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1421,7 +1421,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1460,8 +1460,8 @@ impl OpenCADStudio {
CmdResult::LoftEntities { handles, color } => {
use crate::entities::traits::EntityTypeOps;
use crate::modules::insert::solid3d_cmds::empty_solid3d;
use crate::scene::acad_to_truck::TruckObject;
use crate::scene::truck_tess;
use crate::scene::convert::acad_to_truck::TruckObject;
use crate::scene::convert::truck_tess;
use truck_modeling::builder;
// Collect wires from each profile.
@@ -1482,7 +1482,7 @@ impl OpenCADStudio {
}
let woff = self.tabs[i].scene.world_offset;
let result: Option<crate::scene::mesh_model::MeshModel> = (|| {
let result: Option<crate::scene::model::mesh_model::MeshModel> = (|| {
if wires.len() < 2 {
return None;
}
@@ -1511,7 +1511,7 @@ impl OpenCADStudio {
verts,
normals,
indices,
} => Some(crate::scene::mesh_model::MeshModel {
} => Some(crate::scene::model::mesh_model::MeshModel {
name: String::new(),
verts,
normals,
@@ -1552,8 +1552,8 @@ impl OpenCADStudio {
if let Some(mut model) = self.tabs[i].scene.hatches.get(&handle).cloned() {
// Update model fields
if !name.is_empty() {
use crate::scene::hatch_model::HatchPattern;
use crate::scene::hatch_patterns;
use crate::scene::model::hatch_model::HatchPattern;
use crate::scene::model::hatch_patterns;
model.name = name.clone();
if name.to_uppercase() == "SOLID" {
model.pattern = HatchPattern::Solid;
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::command::CadCommand;
use crate::linetypes;
use crate::modules::home::modify::refedit::RefEditSession;
use crate::scene::grip::GripEdit;
use crate::scene::pick::grip::GripEdit;
use crate::scene::GripDef;
use crate::scene::Scene;
use crate::snap::SnapResult;
+2 -2
View File
@@ -50,7 +50,7 @@ pub struct GripPopup {
pub handle: acadrust::Handle,
pub grip_id: usize,
pub anchor: iced::Point,
pub items: Vec<crate::scene::object::GripMenuItem>,
pub items: Vec<crate::scene::model::object::GripMenuItem>,
pub selected: usize,
}
@@ -62,7 +62,7 @@ pub struct GripPopup {
pub struct GripPendingValue {
pub handle: acadrust::Handle,
pub grip_id: usize,
pub action: crate::scene::object::GripMenuAction,
pub action: crate::scene::model::object::GripMenuAction,
pub label: &'static str,
}
+1 -1
View File
@@ -9,7 +9,7 @@ use truck_modeling::Solid;
use super::Message;
use crate::modules::model::boolean_cmd::BoolOp;
use crate::scene::model_solid::{self, Bool};
use crate::scene::model::model_solid::{self, Bool};
impl super::OpenCADStudio {
/// Commit a Model-tab solid: add its acadrust entity to the document, then
+2 -2
View File
@@ -323,8 +323,8 @@ pub fn visible_spans(raw: &str) -> Vec<(usize, usize)> {
// ── App-side editor driver ──────────────────────────────────────────────────
use crate::scene::tessellate;
use crate::scene::wire_model::WireModel;
use crate::scene::convert::tessellate;
use crate::scene::model::wire_model::WireModel;
use iced::widget::text_editor::{Action, Edit};
use std::sync::Arc;
+31 -31
View File
@@ -1,7 +1,7 @@
use super::helpers::{entity_type_key, entity_type_label, title_case_word};
use super::{OpenCADStudio, VARIES_LABEL};
use crate::linetypes;
use crate::scene::dispatch;
use crate::scene::view::dispatch;
use crate::ui;
use acadrust::{EntityType, Handle};
@@ -118,28 +118,28 @@ impl OpenCADStudio {
.collect();
if let Some(geom) = sections.last_mut() {
geom.props.push(crate::scene::object::Property {
geom.props.push(crate::scene::model::object::Property {
label: "Frozen Layers".to_string(),
field: "frozen_layers",
value: crate::scene::object::PropValue::EditText(
value: crate::scene::model::object::PropValue::EditText(
frozen_names.join(", "),
),
});
if !ucs_names.is_empty() {
geom.props.push(crate::scene::object::Property {
geom.props.push(crate::scene::model::object::Property {
label: "UCS Name".to_string(),
field: "vp_ucs_name",
value: crate::scene::object::PropValue::Choice {
value: crate::scene::model::object::PropValue::Choice {
selected: current_ucs,
options: ucs_names,
},
});
}
if !view_names.is_empty() {
geom.props.push(crate::scene::object::Property {
geom.props.push(crate::scene::model::object::Property {
label: "Named View".to_string(),
field: "vp_named_view",
value: crate::scene::object::PropValue::Choice {
value: crate::scene::model::object::PropValue::Choice {
selected: String::new(),
options: view_names,
},
@@ -167,7 +167,7 @@ impl OpenCADStudio {
if let Some(prop) =
geom.props.iter_mut().find(|p| p.field == "vscale_std")
{
prop.value = crate::scene::object::PropValue::Choice {
prop.value = crate::scene::model::object::PropValue::Choice {
selected,
options,
};
@@ -195,10 +195,10 @@ impl OpenCADStudio {
geom.props.iter_mut().find(|p| p.field == "style_name")
{
let current = match &prop.value {
crate::scene::object::PropValue::EditText(s) => s.clone(),
crate::scene::model::object::PropValue::EditText(s) => s.clone(),
_ => String::new(),
};
prop.value = crate::scene::object::PropValue::Choice {
prop.value = crate::scene::model::object::PropValue::Choice {
selected: current,
options: dim_style_names,
};
@@ -210,10 +210,10 @@ impl OpenCADStudio {
if !group_names.is_empty() {
let label = group_names.join(", ");
if let Some(general) = sections.first_mut() {
general.props.push(crate::scene::object::Property {
general.props.push(crate::scene::model::object::Property {
label: "Group".to_string(),
field: "group",
value: crate::scene::object::PropValue::ReadOnly(label),
value: crate::scene::model::object::PropValue::ReadOnly(label),
});
}
}
@@ -240,7 +240,7 @@ impl OpenCADStudio {
.iter()
.flat_map(|section| section.props.iter())
.filter_map(|prop| match &prop.value {
crate::scene::object::PropValue::Choice { options, .. } => Some((
crate::scene::model::object::PropValue::Choice { options, .. } => Some((
prop.field.to_string(),
iced::widget::combo_box::State::new(options.clone()),
)),
@@ -252,7 +252,7 @@ impl OpenCADStudio {
layer_combo: iced::widget::combo_box::State::new(layer_names.clone()),
linetype_combo: iced::widget::combo_box::State::new(linetype_items.clone()),
hatch_pattern_combo: iced::widget::combo_box::State::new(
crate::scene::hatch_patterns::names(),
crate::scene::model::hatch_patterns::names(),
),
lineweight_combo: iced::widget::combo_box::State::new(
ui::properties::lw_options(),
@@ -284,7 +284,7 @@ impl OpenCADStudio {
.iter()
.flat_map(|section| section.props.iter())
.filter_map(|prop| match &prop.value {
crate::scene::object::PropValue::Choice { options, .. } => Some((
crate::scene::model::object::PropValue::Choice { options, .. } => Some((
prop.field.to_string(),
iced::widget::combo_box::State::new(options.clone()),
)),
@@ -299,7 +299,7 @@ impl OpenCADStudio {
layer_combo: iced::widget::combo_box::State::new(layer_names.clone()),
linetype_combo: iced::widget::combo_box::State::new(linetype_items.clone()),
hatch_pattern_combo: iced::widget::combo_box::State::new(
crate::scene::hatch_patterns::names(),
crate::scene::model::hatch_patterns::names(),
),
lineweight_combo: iced::widget::combo_box::State::new(
ui::properties::lw_options(),
@@ -527,13 +527,13 @@ impl OpenCADStudio {
}
}
crate::scene::dispatch::apply_color(&mut entity, self.ribbon.active_color);
crate::scene::dispatch::apply_common_prop(
crate::scene::view::dispatch::apply_color(&mut entity, self.ribbon.active_color);
crate::scene::view::dispatch::apply_common_prop(
&mut entity,
"linetype",
&self.ribbon.active_linetype.clone(),
);
crate::scene::dispatch::apply_line_weight(&mut entity, self.ribbon.active_lineweight);
crate::scene::view::dispatch::apply_line_weight(&mut entity, self.ribbon.active_lineweight);
// CELTSCALE (header.current_entity_linetype_scale): new entities
// pick up the document's saved per-entity linetype scale. The user
// can override per entity later via the properties panel.
@@ -741,12 +741,12 @@ pub(super) fn build_selection_groups(
pub(super) fn aggregate_sections(
selected: &[(Handle, &EntityType)],
text_style_names: &[String],
) -> Vec<crate::scene::object::PropSection> {
) -> Vec<crate::scene::model::object::PropSection> {
if selected.is_empty() {
return vec![];
}
let mut all_sections: Vec<Vec<crate::scene::object::PropSection>> = selected
let mut all_sections: Vec<Vec<crate::scene::model::object::PropSection>> = selected
.iter()
.map(|(handle, entity)| dispatch::properties_sectioned(*handle, entity, text_style_names))
.collect();
@@ -759,15 +759,15 @@ pub(super) fn aggregate_sections(
}
fn merge_sections(
left: &[crate::scene::object::PropSection],
right: &[crate::scene::object::PropSection],
) -> Vec<crate::scene::object::PropSection> {
left: &[crate::scene::model::object::PropSection],
right: &[crate::scene::model::object::PropSection],
) -> Vec<crate::scene::model::object::PropSection> {
left.iter()
.filter_map(|section| {
let rhs = right
.iter()
.find(|candidate| candidate.title == section.title)?;
let props: Vec<crate::scene::object::Property> = section
let props: Vec<crate::scene::model::object::Property> = section
.props
.iter()
.filter_map(|prop| {
@@ -775,7 +775,7 @@ fn merge_sections(
.props
.iter()
.find(|candidate| candidate.field == prop.field)?;
Some(crate::scene::object::Property {
Some(crate::scene::model::object::Property {
label: prop.label.clone(),
field: prop.field,
value: merge_prop_value(&prop.value, &other.value),
@@ -785,7 +785,7 @@ fn merge_sections(
if props.is_empty() {
None
} else {
Some(crate::scene::object::PropSection {
Some(crate::scene::model::object::PropSection {
title: section.title.clone(),
props,
})
@@ -795,10 +795,10 @@ fn merge_sections(
}
fn merge_prop_value(
left: &crate::scene::object::PropValue,
right: &crate::scene::object::PropValue,
) -> crate::scene::object::PropValue {
use crate::scene::object::PropValue;
left: &crate::scene::model::object::PropValue,
right: &crate::scene::model::object::PropValue,
) -> crate::scene::model::object::PropValue {
use crate::scene::model::object::PropValue;
if left == right {
return left.clone();
+39 -39
View File
@@ -4,8 +4,8 @@ use super::helpers::{
};
use super::{Message, OpenCADStudio, POLY_START_DELAY_MS};
use crate::modules::ModuleEvent;
use crate::scene::grip::{find_hit_grip, find_hit_grip_paper, GripEdit};
use crate::scene::object::GripApply;
use crate::scene::pick::grip::{find_hit_grip, find_hit_grip_paper, GripEdit};
use crate::scene::model::object::GripApply;
use crate::scene::{
self, hover_id, Scene, TileEdgeOrient, VIEWCUBE_DRAW_PX, VIEWCUBE_PAD, VIEWCUBE_PX,
};
@@ -552,13 +552,13 @@ impl OpenCADStudio {
// STL gets the highest-resolution LOD (slot 0) so the
// exported geometry isn't downgraded by the view-dependent
// mesh LOD ladder used for rendering.
let meshes: Vec<crate::scene::mesh_model::MeshModel> = self.tabs[i]
let meshes: Vec<crate::scene::model::mesh_model::MeshModel> = self.tabs[i]
.scene
.meshes
.values()
.filter_map(|s| s.lods.first().cloned())
.collect();
let mesh_refs: Vec<&crate::scene::mesh_model::MeshModel> = meshes.iter().collect();
let mesh_refs: Vec<&crate::scene::model::mesh_model::MeshModel> = meshes.iter().collect();
match crate::io::stl::build_stl(&mesh_refs) {
Some(bytes) => match std::fs::write(&path, bytes) {
Ok(()) => self
@@ -603,13 +603,13 @@ impl OpenCADStudio {
Message::StepExportPath(Some(path)) => {
let i = self.active_tab;
// Export uses LOD 0 (full resolution); see StlExportPath above.
let meshes: Vec<crate::scene::mesh_model::MeshModel> = self.tabs[i]
let meshes: Vec<crate::scene::model::mesh_model::MeshModel> = self.tabs[i]
.scene
.meshes
.values()
.filter_map(|s| s.lods.first().cloned())
.collect();
let mesh_refs: Vec<&crate::scene::mesh_model::MeshModel> = meshes.iter().collect();
let mesh_refs: Vec<&crate::scene::model::mesh_model::MeshModel> = meshes.iter().collect();
match crate::io::step::build_step(&mesh_refs) {
Some(text) => match std::fs::write(&path, text.as_bytes()) {
Ok(()) => self
@@ -1435,7 +1435,7 @@ impl OpenCADStudio {
if let Some(e) = self.tabs[i].scene.document.get_entity_mut(h) {
e.apply_grip_menu(
gid,
crate::scene::object::GripMenuAction::RemoveLeader,
crate::scene::model::object::GripMenuAction::RemoveLeader,
);
}
self.tabs[i].scene.bump_geometry();
@@ -2121,7 +2121,7 @@ impl OpenCADStudio {
// Multi-functional grip hover: detect cursor sitting on a
// selected entity's grip and, after a dwell, open the
// popup menu. See scene::object::GripMenuItem.
// popup menu. See scene::model::object::GripMenuItem.
self.update_grip_hover(i, p);
let mut sel = self.tabs[i].scene.selection.borrow_mut();
@@ -2405,7 +2405,7 @@ impl OpenCADStudio {
};
let view_proj = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let all_wires = self.tabs[i].scene.hit_test_wires();
let hovered = scene::hit_test::click_hit(p, &all_wires[..], view_proj, bounds)
let hovered = scene::pick::hit_test::click_hit(p, &all_wires[..], view_proj, bounds)
.and_then(|s| Scene::handle_from_wire_name(s));
self.tabs[i].scene.set_hover_highlight(hovered);
} else {
@@ -2620,7 +2620,7 @@ impl OpenCADStudio {
p
} else if needs_entity {
let hover_handle =
scene::hit_test::click_hit(p, &all_wires[..], view_proj, bounds)
scene::pick::hit_test::click_hit(p, &all_wires[..], view_proj, bounds)
.and_then(|s| Scene::handle_from_wire_name(s))
.unwrap_or(acadrust::Handle::NULL);
let mut p = self.tabs[i]
@@ -3185,7 +3185,7 @@ impl OpenCADStudio {
{
let vp_mat2 = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let all_wires2 = self.tabs[i].scene.hit_test_wires();
let hit = scene::hit_test::click_hit(p, &all_wires2[..], vp_mat2, bounds)
let hit = scene::pick::hit_test::click_hit(p, &all_wires2[..], vp_mat2, bounds)
.and_then(|s| Scene::handle_from_wire_name(s));
if let Some(handle) = hit {
// Some commands (e.g. SS_CATCHMENT) need the entity
@@ -3374,7 +3374,7 @@ impl OpenCADStudio {
let crossing = box_crossing;
let all_wires = self.tabs[i].scene.hit_test_wires();
let vp_mat = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let mut handles: Vec<Handle> = scene::hit_test::box_hit(
let mut handles: Vec<Handle> = scene::pick::hit_test::box_hit(
a,
p,
crossing,
@@ -3385,7 +3385,7 @@ impl OpenCADStudio {
.into_iter()
.filter_map(|s| Scene::handle_from_wire_name(s))
.collect();
handles.extend(scene::hit_test::box_hit_hatch(
handles.extend(scene::pick::hit_test::box_hit_hatch(
a,
p,
crossing,
@@ -3427,7 +3427,7 @@ impl OpenCADStudio {
self.tabs[i].scene.selection.borrow_mut().poly_last_crossing = crossing;
let all_wires = self.tabs[i].scene.hit_test_wires();
let vp_mat = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let mut handles: Vec<Handle> = scene::hit_test::poly_hit(
let mut handles: Vec<Handle> = scene::pick::hit_test::poly_hit(
&poly_pts,
crossing,
&all_wires[..],
@@ -3437,7 +3437,7 @@ impl OpenCADStudio {
.into_iter()
.filter_map(|s| Scene::handle_from_wire_name(s))
.collect();
handles.extend(scene::hit_test::poly_hit_hatch(
handles.extend(scene::pick::hit_test::poly_hit_hatch(
&poly_pts,
crossing,
&self.tabs[i].scene.visible_hatches_for_click(),
@@ -3481,7 +3481,7 @@ impl OpenCADStudio {
// unchanged when off.
let mut handled_by_cycling = false;
if self.selection_cycling {
let cands: Vec<Handle> = scene::hit_test::click_hits_all(
let cands: Vec<Handle> = scene::pick::hit_test::click_hits_all(
p,
&all_wires[..],
vp_mat,
@@ -3500,10 +3500,10 @@ impl OpenCADStudio {
if !handled_by_cycling {
let hit =
scene::hit_test::click_hit(p, &all_wires[..], vp_mat, bounds)
scene::pick::hit_test::click_hit(p, &all_wires[..], vp_mat, bounds)
.and_then(|s| Scene::handle_from_wire_name(s))
.or_else(|| {
scene::hit_test::click_hit_hatch(
scene::pick::hit_test::click_hit_hatch(
p,
&self.tabs[i].scene.visible_hatches_for_click(),
vp_mat,
@@ -3513,7 +3513,7 @@ impl OpenCADStudio {
.or_else(|| {
// Block-internal hatch: resolve to the
// parent Insert (AutoCAD behaviour).
scene::hit_test::click_hit_insert_hatch(
scene::pick::hit_test::click_hit_insert_hatch(
p,
&self.tabs[i].scene.insert_hatches_for_click(),
vp_mat,
@@ -3561,7 +3561,7 @@ impl OpenCADStudio {
let crossing = box_crossing;
let all_wires = self.tabs[i].scene.hit_test_wires();
let vp_mat = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let mut handles: Vec<Handle> = scene::hit_test::box_hit(
let mut handles: Vec<Handle> = scene::pick::hit_test::box_hit(
a,
p,
crossing,
@@ -3572,7 +3572,7 @@ impl OpenCADStudio {
.into_iter()
.filter_map(|s| Scene::handle_from_wire_name(s))
.collect();
handles.extend(scene::hit_test::box_hit_hatch(
handles.extend(scene::pick::hit_test::box_hit_hatch(
a,
p,
crossing,
@@ -3657,7 +3657,7 @@ impl OpenCADStudio {
};
let vp_mat = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let all_wires = self.tabs[i].scene.hit_test_wires();
let hit = scene::hit_test::click_hit(p, &all_wires[..], vp_mat, bounds)
let hit = scene::pick::hit_test::click_hit(p, &all_wires[..], vp_mat, bounds)
.and_then(|s| Scene::handle_from_wire_name(s));
if let Some(handle) = hit {
// Any text-bearing entity opens its in-place editor
@@ -3712,7 +3712,7 @@ impl OpenCADStudio {
let hit_vp: Option<acadrust::Handle> = {
let vp_mat = self.tabs[i].scene.camera.borrow().view_proj(bounds);
let all_wires = self.tabs[i].scene.hit_test_wires();
scene::hit_test::click_hit(p, &all_wires[..], vp_mat, bounds)
scene::pick::hit_test::click_hit(p, &all_wires[..], vp_mat, bounds)
.and_then(|s| Scene::handle_from_wire_name(s))
.and_then(|h| {
if let Some(AcadEntityType::Viewport(vp)) =
@@ -3981,7 +3981,7 @@ impl OpenCADStudio {
return Task::none();
};
use crate::entities::traits::EntityTypeOps;
use crate::scene::object::GripMenuAction;
use crate::scene::model::object::GripMenuAction;
if matches!(
item.action,
GripMenuAction::Stretch
@@ -4643,7 +4643,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for handle in handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_common_prop(entity, "layer", &layer);
crate::scene::view::dispatch::apply_common_prop(entity, "layer", &layer);
}
}
self.tabs[i].dirty = true;
@@ -4669,7 +4669,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for handle in handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_color(entity, color);
crate::scene::view::dispatch::apply_color(entity, color);
}
}
self.tabs[i].dirty = true;
@@ -4706,7 +4706,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for handle in handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_common_prop(entity, "linetype", &lt);
crate::scene::view::dispatch::apply_common_prop(entity, "linetype", &lt);
}
}
self.tabs[i].dirty = true;
@@ -4728,7 +4728,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for handle in handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_line_weight(entity, lw);
crate::scene::view::dispatch::apply_line_weight(entity, lw);
}
}
self.tabs[i].dirty = true;
@@ -4790,7 +4790,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for &handle in &handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_common_prop(entity, "layer", &layer);
crate::scene::view::dispatch::apply_common_prop(entity, "layer", &layer);
}
}
self.invalidate_property_targets(i, &handles);
@@ -4807,7 +4807,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for &handle in &handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_color(entity, color);
crate::scene::view::dispatch::apply_color(entity, color);
}
}
self.invalidate_property_targets(i, &handles);
@@ -4826,7 +4826,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for &handle in &handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_line_weight(entity, lw);
crate::scene::view::dispatch::apply_line_weight(entity, lw);
}
}
self.invalidate_property_targets(i, &handles);
@@ -4843,7 +4843,7 @@ impl OpenCADStudio {
self.push_undo_snapshot(i, "CHPROP");
for &handle in &handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
crate::scene::dispatch::apply_common_prop(entity, "linetype", &lt);
crate::scene::view::dispatch::apply_common_prop(entity, "linetype", &lt);
}
}
self.invalidate_property_targets(i, &handles);
@@ -4857,7 +4857,7 @@ impl OpenCADStudio {
let i = self.active_tab;
let handles = self.property_target_handles(i);
if !handles.is_empty() {
use crate::scene::hatch_patterns;
use crate::scene::model::hatch_patterns;
if let Some(entry) = hatch_patterns::find(&name) {
self.push_undo_snapshot(i, "HATCHEDIT");
for &handle in &handles {
@@ -4867,7 +4867,7 @@ impl OpenCADStudio {
dxf.pattern = hatch_patterns::build_dxf_pattern(entry);
dxf.is_solid = matches!(
entry.gpu,
crate::scene::hatch_model::HatchPattern::Solid
crate::scene::model::hatch_model::HatchPattern::Solid
);
}
if let Some(model) = self.tabs[i].scene.hatches.get_mut(&handle) {
@@ -4891,9 +4891,9 @@ impl OpenCADStudio {
for &handle in &handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle) {
match field {
"invisible" => crate::scene::dispatch::toggle_invisible(entity),
"invisible" => crate::scene::view::dispatch::toggle_invisible(entity),
_ => {
crate::scene::dispatch::apply_geom_prop(entity, field, "toggle")
crate::scene::view::dispatch::apply_geom_prop(entity, field, "toggle")
}
}
}
@@ -4958,7 +4958,7 @@ impl OpenCADStudio {
for &handle in &handles {
if let Some(entity) = self.tabs[i].scene.document.get_entity_mut(handle)
{
crate::scene::dispatch::apply_geom_prop(entity, field, &value);
crate::scene::view::dispatch::apply_geom_prop(entity, field, &value);
}
}
}
@@ -5014,12 +5014,12 @@ impl OpenCADStudio {
{
match field {
"linetype_scale" | "transparency" => {
crate::scene::dispatch::apply_common_prop(
crate::scene::view::dispatch::apply_common_prop(
entity, field, &val,
);
}
_ => {
crate::scene::dispatch::apply_geom_prop(
crate::scene::view::dispatch::apply_geom_prop(
entity, field, &val,
);
}
+2 -2
View File
@@ -3,8 +3,8 @@ use super::document::{DynComponent, DynFieldEntry};
use super::helpers::grid_plane_from_camera;
use super::history::history_dropdown_labels;
use super::{Message, OpenCADStudio};
use crate::scene::grip::{grips_to_screen, grips_to_screen_paper};
use crate::scene::viewport_pane::ViewportPane;
use crate::scene::pick::grip::{grips_to_screen, grips_to_screen_paper};
use crate::scene::view::viewport_pane::ViewportPane;
use crate::scene::{VIEWCUBE_DRAW_PX, VIEWCUBE_PAD};
use crate::ui::overlay;
use iced::widget::{
+1 -1
View File
@@ -15,7 +15,7 @@ use acadrust::objects::BlockVisibilityParameter;
use acadrust::types::Vector3;
use acadrust::{EntityType, Handle};
use crate::scene::object::{GripDef, GripShape};
use crate::scene::model::object::{GripDef, GripShape};
use super::OpenCADStudio;