pub trait Drawer: 'static {
// Required methods
fn draw(&self, reader: &Reader<'_>, view: &mut PartView) -> GeopResult<()>;
fn structure(&self, reader: &Reader<'_>) -> GeopResult<Vec<StructureItem>>;
// Provided methods
fn hidden(&self, _reader: &Reader<'_>) -> Vec<String> { ... }
fn kept(&self) -> bool { ... }
}Expand description
What a crate draws of the part, and lists of it: the targets it
defines. A part is drawn by every drawer of the registry in turn, into
one PartView — the parts placed in it as instances of components,
never one mesh per placement (see crate::view::ViewInstance).
Required Methods§
Sourcefn draw(&self, reader: &Reader<'_>, view: &mut PartView) -> GeopResult<()>
fn draw(&self, reader: &Reader<'_>, view: &mut PartView) -> GeopResult<()>
Draws what of the part reader reads is this crate’s into view.
Sourcefn structure(&self, reader: &Reader<'_>) -> GeopResult<Vec<StructureItem>>
fn structure(&self, reader: &Reader<'_>) -> GeopResult<Vec<StructureItem>>
What of the part is this crate’s, to list: each drawn item shown
(visible: Some(true)) — the editor hides what is hidden — and
each one that is not drawn with visible: None.
Provided Methods§
The names of what it draws only to be picked: shown only while a
field waiting for a pick could pick it (see
crate::editing::Reference::accepts) — none, unless it says
otherwise.
Sourcefn kept(&self) -> bool
fn kept(&self) -> bool
Whether what it draws is kept between processes, as what a program
builds is (see geop_core_program::kept): for a drawer whose
drawing takes work — the model’s, which meshes its faces — so that a
program reopened is drawn without that work. Not, unless it says so.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".