ModelInner

Struct ModelInner 

Source
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

Source

pub fn new(element: Element, src_ref: SrcRef) -> Self

Create a new ModelInner with a specific element.

Source

pub fn render_state(&self) -> ModelRenderState

Return render state of the model.

Source

pub fn clone_content(&self) -> Self

Clone only the content of this model without children and parent.

Source

pub fn children(&self) -> Iter<'_, Model>

Return iterator of children.s

Source

pub fn is_empty(&self) -> bool

Return if ,model has no children.

Source

pub fn element(&self) -> &Element

Return element of this model.

Source

pub fn output(&self) -> &RenderOutput

Returns the render output, panics if there is no render output.

Source

pub fn output_mut(&mut self) -> &mut RenderOutput

Returns the mutable render output, panics if there is no render output.

Source§

impl ModelInner

Source

pub fn resolution(&self) -> RenderResolution

Get render resolution.

Trait Implementations§

Source§

impl Debug for ModelInner

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModelInner

Source§

fn default() -> ModelInner

Returns the “default value” for a type. Read more
Source§

impl PropertiesAccess for ModelInner

Source§

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>

Set value of an existing property or add a new property
Source§

fn get_properties(&self) -> Option<&Properties>

Get all properties
Source§

fn add_properties(&mut self, props: Properties)

Set or create properties with the given ids and values.
Source§

impl SrcReferrer for ModelInner

Source§

fn src_ref(&self) -> SrcRef

Return source code reference.
Source§

fn source_hash(&self) -> u64

Return source code hash.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool