Struct Geom

Source
pub struct Geom<T> {
    pub name: Option<String>,
    pub material: Option<String>,
    pub count: usize,
    pub inputs: InputList,
    pub data: T,
    pub extra: Vec<Extra>,
}
Expand description

The common data for the geometry types:

Fields§

§name: Option<String>

The text string name of this element.

§material: Option<String>

Declares a symbol for a material. This symbol is bound to a material at the time of instantiation; see Instance<Geometry> and BindMaterial. If not specified then the lighting and shading results are application defined.

§count: usize

The number of line/triangle/polygon primitives.

§inputs: InputList

The vertex attribute access information.

§data: T

The specific data for the geometry element.

§extra: Vec<Extra>

Provides arbitrary additional information about this element.

Implementations§

Source§

impl<T> Geom<T>

Source

pub fn importer<'a, R: UrlResolver<'a, Source>>( &'a self, res: &R, vimp: VertexImporter<'a>, ) -> Result<Importer<'a>, R::Error>

Construct an Importer from a VertexImporter and a UrlResolver.

Source§

impl Geom<LineGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, count: usize, prim: Box<[u32]>, ) -> Self

Construct a new Lines object from a data buffer. The data buffer prim contains exactly count lines, consisting of 2 vertices, each consisting of inputs.len() indices, for a total of inputs.len() * 2 * count values.

Source§

impl Geom<LineStripGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, prim: Vec<Box<[u32]>>, ) -> Self

Construct a new LineStrips object from a data buffer. Each buffer in data contains 2 or more vertices, each consisting of inputs.len() indices, for a total of inputs.len() * verts values.

Source§

impl Geom<PolygonGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, prim: Vec<PolygonHole>, ) -> Self

Construct a new Polygons object from raw data.

Source§

impl Geom<PolyListGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, vcount: Box<[u32]>, prim: Box<[u32]>, ) -> Self

Construct a new PolyList object from a data buffer. Each value n in vcount corresponds to a polygon with n vertices, to which inputs.len() * n index values are associated in prim.

Source§

impl Geom<TriangleGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, count: usize, prim: Box<[u32]>, ) -> Self

Construct a new Triangles object from a data buffer. The data buffer prim contains exactly count triangles, consisting of 3 vertices, each consisting of inputs.len() indices, for a total of inputs.len() * 3 * count values.

Source§

impl Geom<TriFanGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, prim: Vec<Box<[u32]>>, ) -> Self

Construct a new TriFans object from a data buffer. Each buffer in data contains 3 or more vertices, each consisting of inputs.len() indices, for a total of inputs.len() * verts values.

Source§

impl Geom<TriStripGeom>

Source

pub fn new( material: Option<String>, inputs: Vec<InputS>, prim: Vec<Box<[u32]>>, ) -> Self

Construct a new TriStrips object from a data buffer. Each buffer in data contains 3 or more vertices, each consisting of inputs.len() indices, for a total of inputs.len() * verts values.

Trait Implementations§

Source§

impl<T: Clone> Clone for Geom<T>

Source§

fn clone(&self) -> Geom<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Geom<T>

Source§

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

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

impl<T: Default> Default for Geom<T>

Source§

fn default() -> Geom<T>

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

impl From<Geom<LineGeom>> for Primitive

Source§

fn from(val: Lines) -> Self

Converts to this type from the input type.
Source§

impl From<Geom<LineStripGeom>> for Primitive

Source§

fn from(val: LineStrips) -> Self

Converts to this type from the input type.
Source§

impl From<Geom<PolyListGeom>> for Primitive

Source§

fn from(val: PolyList) -> Self

Converts to this type from the input type.
Source§

impl From<Geom<PolygonGeom>> for Primitive

Source§

fn from(val: Polygons) -> Self

Converts to this type from the input type.
Source§

impl From<Geom<TriFanGeom>> for Primitive

Source§

fn from(val: TriFans) -> Self

Converts to this type from the input type.
Source§

impl From<Geom<TriStripGeom>> for Primitive

Source§

fn from(val: TriStrips) -> Self

Converts to this type from the input type.
Source§

impl From<Geom<TriangleGeom>> for Primitive

Source§

fn from(val: Triangles) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for Geom<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Geom<T>
where T: RefUnwindSafe,

§

impl<T> Send for Geom<T>
where T: Send,

§

impl<T> Sync for Geom<T>
where T: Sync,

§

impl<T> Unpin for Geom<T>
where T: Unpin,

§

impl<T> UnwindSafe for Geom<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.