Skip to content

Commit

Permalink
Finish merging evaluator into host
Browse files Browse the repository at this point in the history
  • Loading branch information
zthompson47 committed Jan 4, 2023
1 parent 9e5efee commit 5fccf65
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 103 deletions.
99 changes: 0 additions & 99 deletions crates/fj-host/src/evaluator.rs

This file was deleted.

22 changes: 21 additions & 1 deletion crates/fj-host/src/host.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::thread;

use crossbeam_channel::{unbounded, Receiver, Sender};
use fj_interop::processed_shape::ProcessedShape;
use fj_operations::shape_processor::ShapeProcessor;
use winit::event_loop::EventLoopProxy;

use crate::{HostCommand, HostHandle, Model, ModelEvent, Watcher};
use crate::{Error, HostCommand, HostHandle, Model, Watcher};

// Use a zero-sized error type to silence `#[warn(clippy::result_large_err)]`.
// The only error from `EventLoopProxy::send_event` is `EventLoopClosed<T>`,
Expand Down Expand Up @@ -117,3 +118,22 @@ impl Host {
Ok(())
}
}

/// An event emitted by the host thread
#[derive(Debug)]
pub enum ModelEvent {
/// A new model is being watched
StartWatching,

/// A change in the model has been detected
ChangeDetected,

/// The model has been evaluated
Evaluated,

/// The model has been processed
ProcessedShape(ProcessedShape),

/// An error
Error(Error),
}
4 changes: 1 addition & 3 deletions crates/fj-host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#![warn(missing_docs)]

mod evaluator;
mod host;
mod host_handle;
mod model;
Expand All @@ -24,8 +23,7 @@ mod platform;
mod watcher;

pub use self::{
evaluator::ModelEvent,
host::{EventLoopClosed, Host},
host::{EventLoopClosed, Host, ModelEvent},
host_handle::{HostCommand, HostHandle},
model::{Error, Evaluation, Model},
parameters::Parameters,
Expand Down

0 comments on commit 5fccf65

Please sign in to comment.