pub enum Primitive {
Lines(Lines),
LineStrips(LineStrips),
Polygons(Polygons),
PolyList(PolyList),
Triangles(Triangles),
TriFans(TriFans),
TriStrips(TriStrips),
}
Expand description
A collection of primitive elements.
Variants§
Lines(Lines)
Line primitives.
LineStrips(LineStrips)
Line-strip primitives.
Polygons(Polygons)
Polygon primitives which may contain holes.
PolyList(PolyList)
Polygon primitives that cannot contain holes.
Triangles(Triangles)
Triangle primitives.
TriFans(TriFans)
Triangle-fan primitives.
TriStrips(TriStrips)
Triangle-strip primitives.
Implementations§
Source§impl Primitive
impl Primitive
Sourcepub fn parse(e: &Element) -> Result<Option<Self>, Error>
pub fn parse(e: &Element) -> Result<Option<Self>, Error>
Parse a Primitive
from an XML element.
Sourcepub fn as_line_strips(&self) -> Option<&LineStrips>
pub fn as_line_strips(&self) -> Option<&LineStrips>
An accessor for the variant.
Sourcepub fn as_polygons(&self) -> Option<&Polygons>
pub fn as_polygons(&self) -> Option<&Polygons>
An accessor for the variant.
Sourcepub fn as_polylist(&self) -> Option<&PolyList>
pub fn as_polylist(&self) -> Option<&PolyList>
An accessor for the variant.
Sourcepub fn as_triangles(&self) -> Option<&Triangles>
pub fn as_triangles(&self) -> Option<&Triangles>
An accessor for the variant.
Sourcepub fn as_trifans(&self) -> Option<&TriFans>
pub fn as_trifans(&self) -> Option<&TriFans>
An accessor for the variant.
Sourcepub fn as_tristrips(&self) -> Option<&TriStrips>
pub fn as_tristrips(&self) -> Option<&TriStrips>
An accessor for the variant.
Trait Implementations§
Source§impl From<Geom<LineStripGeom>> for Primitive
impl From<Geom<LineStripGeom>> for Primitive
Source§fn from(val: LineStrips) -> Self
fn from(val: LineStrips) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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