Make name of type more explicit

This commit is contained in:
Hanno Braun 2025-06-18 11:50:27 +02:00
parent 71a9da0e94
commit 3229d19a11
3 changed files with 7 additions and 7 deletions

View File

@ -17,5 +17,5 @@ mod window;
pub use self::{
graphics::RendererInitError,
viewer::{Error, Viewer, make_viewer_and_spawn_thread},
viewer::{Error, ViewerHandle, make_viewer_and_spawn_thread},
};

View File

@ -34,7 +34,7 @@ use crate::{
/// This function should be called from the application's main thread, or
/// displaying models might end up not working correctly.
pub fn make_viewer_and_spawn_thread<R>(
f: impl FnOnce(Viewer) -> R + Send + 'static,
f: impl FnOnce(ViewerHandle) -> R + Send + 'static,
) -> Result<R, Error>
where
R: Send + 'static,
@ -46,7 +46,7 @@ where
};
let proxy = event_loop.create_proxy();
let handle = thread::spawn(|| f(Viewer { event_loop: proxy }));
let handle = thread::spawn(|| f(ViewerHandle { event_loop: proxy }));
event_loop.run_app(&mut display_state)?;
@ -59,11 +59,11 @@ where
}
/// # Fornjot model viewer
pub struct Viewer {
pub struct ViewerHandle {
event_loop: EventLoopProxy<ToDisplay>,
}
impl Viewer {
impl ViewerHandle {
/// # Display a 2D face in a new window
pub fn display_face(&self, points: Vec<Point<2>>) {
// If there's an error, that means the display thread has closed down

View File

@ -1,6 +1,6 @@
use fj_interop::{Tolerance, TriMesh};
use fj_math::Vector;
use fj_viewer::Viewer;
use fj_viewer::ViewerHandle;
use crate::{
geometry::{FloatingCurve, Line, Sketch, SweptCurve},
@ -9,7 +9,7 @@ use crate::{
topology::surface::Surface,
};
pub fn model(viewer: &Viewer) -> TriMesh {
pub fn model(viewer: &ViewerHandle) -> TriMesh {
let tolerance = Tolerance::from(0.001);
let top = {