Element

Struct Element 

Source
pub struct Element {
    pub mesh_id: i32,
    pub vector: Vector,
    pub rotation: Rotation,
    pub guid: String,
    pub element_type: String,
    pub color: Color,
    pub face_colors: Option<Vec<i32>>,
    pub info: HashMap<String, String>,
}
Expand description

Represents a mesh object in three-dimensional space.

Fields§

§mesh_id: i32

The identifier of the mesh associated with the element.

§vector: Vector

The position of the element.

§rotation: Rotation

The rotation of the element.

§guid: String

The globally unique identifier for the element.

§element_type: String

The type of the element.

§color: Color

The color of the element.

§face_colors: Option<Vec<i32>>

The list of integers, that determine face colors of a mesh. They should be organized like this: [r1, g1, b1, a1, r2, g2, b2, a2, r3, g3, b3, a3, … rn, gn, bn, an] E.g. list like: [255, 0, 0, 255, 135, 206, 235, 255, 255, 255, 255, 255] means first triangle should be colored as red (255,0,0,255), second as skyblue (135,206,235,255), third as white (255,255,255,255).

§info: HashMap<String, String>

Additional information about the element.

Implementations§

Source§

impl Element

Source

pub fn new( mesh_id: i32, vector: Vector, rotation: Rotation, guid: String, element_type: String, color: Color, face_colors: Option<Vec<i32>>, info: HashMap<String, String>, ) -> Element

Returns a new Element

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for Element

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Element

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Element

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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, 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,