pub struct BrepApp { /* private fields */ }Implementations§
Source§impl BrepApp
impl BrepApp
Sourcepub fn automation(&self) -> &Arc<AutomationQueue> ⓘ
pub fn automation(&self) -> &Arc<AutomationQueue> ⓘ
The automation queue a host submits commands to.
Sourcepub fn open_path_from_command_line(&mut self, path: &Path)
pub fn open_path_from_command_line(&mut self, path: &Path)
Open a .nbrep file named on the command line — brep-app model.nbrep,
which is also what a desktop file association hands us (Exec=… %f).
The path goes through the same FileDialog::open_document door as
File>Open, so the document keeps the full path as its identity and a
later plain Save writes back to the file the user double-clicked, rather
than to a copy in the app’s own models directory. A path that does not
parse leaves the status line saying so and the seed document in place —
a bad argument must not cost the user a window.
Native only: called once, before the first frame.
Sourcepub fn view_rect(&self) -> Option<Rect>
pub fn view_rect(&self) -> Option<Rect>
The 3D viewport rect of the last frame, in egui points.
Sourcepub fn docs_engine(&self) -> &EngineState
pub fn docs_engine(&self) -> &EngineState
The active document’s engine.
Sourcepub fn open_mesh_preview(
&mut self,
name: String,
bytes: Vec<u8>,
) -> Result<(), String>
pub fn open_mesh_preview( &mut self, name: String, bytes: Vec<u8>, ) -> Result<(), String>
Open the mesh import preview for the file name (.stl or .3mf)
against the active document — what activating it in the Import explorer
does. The preview replaces the shell until it is accepted or cancelled.
Sourcepub fn mesh_preview_open(&self) -> bool
pub fn mesh_preview_open(&self) -> bool
Whether the mesh import preview is open.
Sourcepub fn viewport_engine(&self) -> &EngineState
pub fn viewport_engine(&self) -> &EngineState
The engine the 3D viewport is drawing: the mesh import preview’s own
while it is open (it replaces the shell), else the active document’s.
What a pointer script’s locate must project through.
pub fn new(cc: &CreationContext<'_>) -> Result<Self, String>
Sourcepub fn new_with(
cc: &CreationContext<'_>,
opts: AppOptions,
) -> Result<Self, String>
pub fn new_with( cc: &CreationContext<'_>, opts: AppOptions, ) -> Result<Self, String>
Build the app with host-supplied options: an isolated store (a host MUST pass one) and whether to start on the seed model.
Sourcepub fn start_update_check(&mut self, ctx: &Context)
pub fn start_update_check(&mut self, ctx: &Context)
Start the desktop update check (crate::update). Called by the
desktop binary’s main only.
Sourcepub fn start_report_followup(&mut self, ctx: &Context)
pub fn start_report_followup(&mut self, ctx: &Context)
Remember submitted problem reports and check them for resolution
(crate::report_followup). Called by the desktop main and the web
entry point only.
Sourcepub fn start_spin(&mut self, frames: u32, step: (f64, f64))
pub fn start_spin(&mut self, frames: u32, step: (f64, f64))
Arm a measured camera spin: frames pointer steps of step logical px
each, starting at the centre of the 3D viewport. Replaces any spin in
flight. See Spin.
Sourcepub fn service_automation(&mut self, ctx: &Context) -> bool
pub fn service_automation(&mut self, ctx: &Context) -> bool
Application-command dispatch without a frame (the desktop loop’s
service step; see automation::queue): the PLM/store tasks that
answered, the queue’s frame-free head, the background runs it started,
and the notices they raised. Draws nothing. Returns whether work it
must keep servicing is still in flight.
Sourcepub fn state_blob_json(&mut self, name: &str, ctx: &Context) -> Option<String>
pub fn state_blob_json(&mut self, name: &str, ctx: &Context) -> Option<String>
One plain-state blob by name, built from the app’s data now. None
for a name that is not one of STATE_BLOBS (a layout blob, which
only a drawn pass publishes).
Sourcepub fn set_settings_window_open(&mut self, open: bool)
pub fn set_settings_window_open(&mut self, open: bool)
Open or close the floating Settings window — the toolbar gear’s flag,
reachable from the automation layer (settings_window).
Sourcepub fn set_part_properties_window_open(&mut self, open: bool)
pub fn set_part_properties_window_open(&mut self, open: bool)
Open or close the floating Part Properties window — the toolbar tag
button’s flag, reachable from the automation layer
(part_properties_window).
Sourcepub fn set_info_window_open(&mut self, open: bool)
pub fn set_info_window_open(&mut self, open: bool)
Open or close the floating Info window — the toolbar info button’s flag,
reachable from the automation layer (info_window).
Sourcepub fn set_script_host(&mut self, host: Box<dyn ScriptHost>)
pub fn set_script_host(&mut self, host: Box<dyn ScriptHost>)
What this session is running on. The app’s ONE record of it: the Info
window draws it, a problem report carries it, the diagnostics command
returns it and the MCP banner names its adapter — all from here.
Where the JavaScript editor’s Run sends a program (a host’s own
script runner; the desktop app installs its server’s on its own).
pub fn diagnostics(&self) -> &Diagnostics
Sourcepub fn begin_bug_report(&mut self, ctx: &Context)
pub fn begin_bug_report(&mut self, ctx: &Context)
Begin the in-app problem report: the same call the Submit Bug button
makes, and for the same reason it makes it THIS frame — request
captures the current frame before its own dialog exists.
Sourcepub fn show_pane(&mut self, kind: PaneKind)
pub fn show_pane(&mut self, kind: PaneKind)
Bring a built-in dock pane to the front (show_pane).
Sourcepub fn update_components(
&mut self,
run: bool,
) -> Result<(usize, Vec<String>, usize), String>
pub fn update_components( &mut self, run: bool, ) -> Result<(usize, Vec<String>, usize), String>
The parts-library staleness check and its refresh — the Constraints
header’s “Update components (N)” button, reachable as the
component_update command. Returns (outdated, missing, refreshed);
run is skipped when nothing is outdated.
Sourcepub fn zoom_to_fit(&mut self)
pub fn zoom_to_fit(&mut self)
Frame what the central tile is actually DRAWING: the OPEN SHEET’s paper when a sheet is open, the 3D scene otherwise.
This is where the fit branch lives, and it is here rather than in the
toolbar because the two halves sit in different places — the 3D fit is an
engine camera op (EngineState::zoom_to_fit) while the sheet’s pan/zoom
is viewport-transient state, refitted by clearing the marker the sheet
paint compares against. One method, so the toolbar’s Zoom-to-fit button
and the zoom_to_fit command can never mean different things — and so
the paper needs no Fit button of its own.
The toolbar draws BEFORE the dock in ui, so a fit requested from the
button lands on this very frame.
Run what a WORKBENCH TOOLBAR button does, by its WorkbenchButton::id.
Split out of ui so a toolbar click and the workbench_button command
run the SAME arms: the workbench registry declares a button, this
dispatches it, and the automation surface owns no second copy of the
list. Returns whether the id was known.
Trait Implementations§
Source§impl App for BrepApp
impl App for BrepApp
Source§fn raw_input_hook(&mut self, ctx: &Context, raw_input: &mut RawInput)
fn raw_input_hook(&mut self, ctx: &Context, raw_input: &mut RawInput)
Phase 1 of the automation frame (§4.4): queued input commands become
egui events; a screenshot that landed completes its reply. Called by
every eframe runner before ui; the headless host calls it itself.
Source§fn ui(&mut self, ui: &mut Ui, _frame: &mut Frame)
fn ui(&mut self, ui: &mut Ui, _frame: &mut Frame)
Source§fn logic(&mut self, ctx: &Context, frame: &mut Frame)
fn logic(&mut self, ctx: &Context, frame: &mut Frame)
Self::ui,
and additionally also called when the UI is hidden, but egui::Context::request_repaint was called. Read moreSource§fn save(&mut self, _storage: &mut dyn Storage)
fn save(&mut self, _storage: &mut dyn Storage)
Source§fn on_exit(&mut self)
fn on_exit(&mut self)
Self::save. Read moreSource§fn auto_save_interval(&self) -> Duration
fn auto_save_interval(&self) -> Duration
Self::saveSource§fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
gl.clearColor. Read moreSource§fn persist_egui_memory(&self) -> bool
fn persist_egui_memory(&self) -> bool
Auto Trait Implementations§
impl !Freeze for BrepApp
impl !RefUnwindSafe for BrepApp
impl !Send for BrepApp
impl !Sync for BrepApp
impl !UnwindSafe for BrepApp
impl Forget for BrepApp
impl Move for BrepApp
impl Unpin for BrepApp
impl UnsafeUnpin for BrepApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.