pub struct ModelInner {
pub id: Option<Identifier>,
pub parent: Option<Model>,
pub children: Models,
pub element: Refer<Element>,
pub attributes: Attributes,
pub output: Option<RenderOutput>,
}
Expand description
The actual model contents
Fields§
§id: Option<Identifier>
Optional id.
The id is set when the model was created by an assignment: a = Cube(50mm)
.
parent: Option<Model>
Parent object.
children: Models
Children of the model.
element: Refer<Element>
Element of the model with SrcRef.
attributes: Attributes
Attributes used for export.
output: Option<RenderOutput>
The output type of the this model.
Implementations§
Source§impl ModelInner
impl ModelInner
Sourcepub fn new(element: Element, src_ref: SrcRef) -> Self
pub fn new(element: Element, src_ref: SrcRef) -> Self
Create a new ModelInner
with a specific element.
Sourcepub fn render_state(&self) -> ModelRenderState
pub fn render_state(&self) -> ModelRenderState
Return render state of the model.
Sourcepub fn clone_content(&self) -> Self
pub fn clone_content(&self) -> Self
Clone only the content of this model without children and parent.
Sourcepub fn output(&self) -> &RenderOutput
pub fn output(&self) -> &RenderOutput
Returns the render output, panics if there is no render output.
Sourcepub fn output_mut(&mut self) -> &mut RenderOutput
pub fn output_mut(&mut self) -> &mut RenderOutput
Returns the mutable render output, panics if there is no render output.
Source§impl ModelInner
impl ModelInner
Sourcepub fn resolution(&self) -> RenderResolution
pub fn resolution(&self) -> RenderResolution
Get render resolution.
Trait Implementations§
Source§impl Debug for ModelInner
impl Debug for ModelInner
Source§impl Default for ModelInner
impl Default for ModelInner
Source§fn default() -> ModelInner
fn default() -> ModelInner
Returns the “default value” for a type. Read more
Source§impl PropertiesAccess for ModelInner
impl PropertiesAccess for ModelInner
Source§fn get_property(&self, id: &Identifier) -> Option<&Value>
fn get_property(&self, id: &Identifier) -> Option<&Value>
Get a value of property, or
Value::None
if the property does not exist.Source§fn set_property(&mut self, id: Identifier, value: Value) -> Option<Value>
fn set_property(&mut self, id: Identifier, value: Value) -> Option<Value>
Set value of an existing property or add a new property
Source§fn get_properties(&self) -> Option<&Properties>
fn get_properties(&self) -> Option<&Properties>
Get all properties
Source§fn add_properties(&mut self, props: Properties)
fn add_properties(&mut self, props: Properties)
Set or create properties with the given ids and values.
Source§impl SrcReferrer for ModelInner
impl SrcReferrer for ModelInner
Auto Trait Implementations§
impl Freeze for ModelInner
impl !RefUnwindSafe for ModelInner
impl !Send for ModelInner
impl !Sync for ModelInner
impl Unpin for ModelInner
impl !UnwindSafe for ModelInner
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more