Rename SolveCraft to SolidCraft everywhere, with compatibility shims (#389)
* WIP deep rename (not for push) * WIP2 * WIP3 * WIP4 wxs fix * rustfmt * Rename the remaining identifiers in merged crash-report code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
27415e4dd7
commit
296683229d
464 files changed
+3408
-2956
No files matched your search
@@ -7,9 +7,9 @@ use std::collections::BTreeMap;
|
||||
|
||||
use egui::{Color32, Pos2, RichText, Sense, Stroke, pos2, vec2};
|
||||
use serde_json::{Value, json};
|
||||
use solvecraft_engine::Session;
|
||||
use solvecraft_engine::doc::Mat;
|
||||
use solvecraft_engine::doc::joints::JointKind;
|
||||
use solidcraft_engine::Session;
|
||||
use solidcraft_engine::doc::Mat;
|
||||
use solidcraft_engine::doc::joints::JointKind;
|
||||
|
||||
use crate::SolveApp;
|
||||
use crate::dialogs::{Dialog, Kind, combo, field, row_label};
|
||||
@@ -251,10 +251,10 @@ pub fn table(v: &Value) -> Table {
|
||||
}
|
||||
|
||||
/// The unit a value of this kind is shown in.
|
||||
fn unit_of(k: solvecraft_engine::doc::expr::Kind) -> Option<&'static str> {
|
||||
fn unit_of(k: solidcraft_engine::doc::expr::Kind) -> Option<&'static str> {
|
||||
match k {
|
||||
solvecraft_engine::doc::expr::Kind::Length => Some("mm"),
|
||||
solvecraft_engine::doc::expr::Kind::Angle => Some("deg"),
|
||||
solidcraft_engine::doc::expr::Kind::Length => Some("mm"),
|
||||
solidcraft_engine::doc::expr::Kind::Angle => Some("deg"),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -604,7 +604,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sel
|
||||
&& let Some(unit) = app.session.doc.param(n).map(|parameter| parameter.unit.clone()).or_else(|| {
|
||||
kinds.iter().find(|x| x.0 == n).and_then(|x| {
|
||||
unit_of(x.2).map(|unit| {
|
||||
if x.2 == solvecraft_engine::doc::expr::Kind::Length { app.session.doc.units.clone() } else { unit.to_string() }
|
||||
if x.2 == solidcraft_engine::doc::expr::Kind::Length { app.session.doc.units.clone() } else { unit.to_string() }
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -675,10 +675,10 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sel
|
||||
let (kind, _) = column_parts(c);
|
||||
let appearance = matches!(kind, "appearance" | "component_appearance" | "face_appearance");
|
||||
let shown = if appearance {
|
||||
solvecraft_engine::doc::config::appearance_cell(val)
|
||||
solidcraft_engine::doc::config::appearance_cell(val)
|
||||
.ok()
|
||||
.flatten()
|
||||
.filter(|look| solvecraft_engine::doc::appearance::library(&look.name).as_ref() == Some(look))
|
||||
.filter(|look| solidcraft_engine::doc::appearance::library(&look.name).as_ref() == Some(look))
|
||||
.map(|look| look.name)
|
||||
.unwrap_or_else(|| val.clone())
|
||||
} else {
|
||||
@@ -702,14 +702,14 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sel
|
||||
ui.close();
|
||||
}
|
||||
if kind == "material" {
|
||||
for (name, _) in solvecraft_engine::doc::MATERIALS.iter().filter(|(n, _)| *n != "Default") {
|
||||
for (name, _) in solidcraft_engine::doc::MATERIALS.iter().filter(|(n, _)| *n != "Default") {
|
||||
if ui.button(*name).clicked() {
|
||||
choice = Some(name.to_string());
|
||||
ui.close();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (name, _, _) in solvecraft_engine::doc::appearance::LIBRARY {
|
||||
for (name, _, _) in solidcraft_engine::doc::appearance::LIBRARY {
|
||||
if ui.button(name).clicked() {
|
||||
choice = Some(name.to_string());
|
||||
ui.close();
|
||||
@@ -785,7 +785,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sel
|
||||
}
|
||||
}
|
||||
for selected in &app.session.selection {
|
||||
if let solvecraft_engine::Sel::Face { body, point, .. } = selected {
|
||||
if let solidcraft_engine::Sel::Face { body, point, .. } = selected {
|
||||
options
|
||||
.push((format!("Selected face on {body} (shared appearance)"), json!({"face_appearance":{"body":body,"point":point}})));
|
||||
}
|
||||
@@ -930,7 +930,7 @@ pub fn commands(app: &SolveApp, k: &Mo, inputs: &[SelInput]) -> Result<Vec<(Stri
|
||||
Mo::ContactSet { name, .. } => {
|
||||
let mut occs: Vec<u64> = Vec::new();
|
||||
for x in inputs.first().map(|i| i.items.as_slice()).unwrap_or(&[]) {
|
||||
if let solvecraft_engine::Sel::Body { name } = x
|
||||
if let solidcraft_engine::Sel::Body { name } = x
|
||||
&& let Some(b) = app.session.world_state().body(name)
|
||||
{
|
||||
let comp = app.session.doc.model_body_component(b);
|
||||
@@ -974,9 +974,9 @@ mod tests {
|
||||
#[test]
|
||||
fn shown_poses_are_put_back() {
|
||||
let mut app = SolveApp::new(Session::default(), crate::Services::default());
|
||||
app.session.pending_moves.insert(9, solvecraft_engine::doc::IDENTITY);
|
||||
app.session.pending_moves.insert(9, solidcraft_engine::doc::IDENTITY);
|
||||
let before = app.session.pending_moves.clone();
|
||||
let mut m = solvecraft_engine::doc::IDENTITY;
|
||||
let mut m = solidcraft_engine::doc::IDENTITY;
|
||||
m[3] = [5.0, 0.0, 0.0, 1.0];
|
||||
let shown: BTreeMap<u64, Mat> = [(3, m)].into_iter().collect();
|
||||
for (kind, applied, kept) in [("study", true, false), ("explode", false, false), ("explode", true, true)] {
|
||||
@@ -1061,7 +1061,7 @@ mod tests {
|
||||
select_rule_parameter(&mut h, "length");
|
||||
h.step(&json!({"widget":"Save Rule"})).unwrap();
|
||||
assert!(
|
||||
matches!(&h.app.session.doc.configs.rules[0].condition,solvecraft_engine::doc::config::RuleCondition::All{conditions} if matches!(&conditions[0],solvecraft_engine::doc::config::RuleCondition::Parameter{..}))
|
||||
matches!(&h.app.session.doc.configs.rules[0].condition,solidcraft_engine::doc::config::RuleCondition::All{conditions} if matches!(&conditions[0],solidcraft_engine::doc::config::RuleCondition::Parameter{..}))
|
||||
);
|
||||
h.run(&json!([
|
||||
{"call":"engine.execute","params":{"command":"config.rule","params":{"rule":{"id":"last","name":"Last drive","condition":{"type":"always"},"effect":{"type":"drive_parameter","parameter":"length","expression":"20 mm"}}}}},
|
||||
@@ -1179,8 +1179,8 @@ mod tests {
|
||||
assert!(h.widget("side:outer").is_some());
|
||||
assert!(h.widget("side:inner").is_some());
|
||||
h.run(&json!([{"widget":"side:outer"},{"widget":"Library"},{"widget":"ABS - Red"},{"widget":"Apply"}])).unwrap();
|
||||
let solvecraft_engine::doc::config::Column::FaceAppearance(target) = &h.app.session.doc.configs.columns[0] else { panic!() };
|
||||
assert!(matches!(&target.certificate, Some(solvecraft_engine::doc::config::FaceCertificate::ExtrudeSide { curve, .. }) if curve == "outer"));
|
||||
let solidcraft_engine::doc::config::Column::FaceAppearance(target) = &h.app.session.doc.configs.columns[0] else { panic!() };
|
||||
assert!(matches!(&target.certificate, Some(solidcraft_engine::doc::config::FaceCertificate::ExtrudeSide { curve, .. }) if curve == "outer"));
|
||||
let state = h.app.session.model.state();
|
||||
let body = state.body("Ring").unwrap();
|
||||
let indices = h.app.session.doc.configuration_face_indices(body, target).unwrap();
|
||||
|
||||
Reference in new issue
Block a user