Rename the Element structure to Sphere

This makes way for an `Element` trait. Some `Sphere` variables, like the
arguments of the sphere insertion methods, have been renamed to show
that they refer specifically to spheres. Others, like the argument of
`ElementOutlineItem`, have kept their general names, because I expect
them to become `Element` trait objects.
This commit is contained in:
Aaron Fenyes 2025-04-23 01:01:59 -07:00
parent 68abc2ad44
commit a1e23543cb
4 changed files with 41 additions and 41 deletions

View file

@ -14,7 +14,7 @@ use web_sys::{
wasm_bindgen::{JsCast, JsValue}
};
use crate::{AppState, assembly::{Element, ElementKey, ElementColor, ElementMotion}};
use crate::{AppState, assembly::{ElementKey, ElementColor, ElementMotion, Sphere}};
// --- scene data ---
@ -74,7 +74,7 @@ trait DisplayItem {
fn show(&self, scene: &mut Scene, selected: bool);
}
impl DisplayItem for Element {
impl DisplayItem for Sphere {
fn show(&self, scene: &mut Scene, selected: bool) {
const HIGHLIGHT: f32 = 0.2; /* SCAFFOLDING */
let representation = self.representation.get_clone_untracked();