[−][src]Struct shapefile::record::multipatch::Multipatch
Shapefile's Multipatch shape (p 24/34)
The following things are important with Multipatch shape:
- Ring types must be closed (the various constructors will close the rings if you did not close them yourself)
- InnerRings must follow their OuterRings (this is not checked)
- Parts must not intersects or penetrate each others (this is not checked)
- The points organization of
TriangleStrip
andTriangleFan
is not checked
Implementations
impl Multipatch
[src]
pub fn new(patch: Patch) -> Self
[src]
Creates a Multipatch with one patch
The constructor closes rings patch
Examples
use shapefile::{PointZ, Multipatch, NO_DATA, Patch}; let points = vec![ PointZ::new(0.0, 0.0, 0.0, NO_DATA), PointZ::new(0.0, 1.0, 0.0, NO_DATA), PointZ::new(1.0, 1.0, 0.0, NO_DATA), PointZ::new(1.0, 0.0, 0.0, NO_DATA), ]; let multip = Multipatch::new(Patch::OuterRing(points));
pub fn with_parts(mut patches: Vec<Patch>) -> Self
[src]
Creates a Multipatch with multiple patches
Closes any patch part that is a ring
Example
use shapefile::{PointZ, Multipatch, NO_DATA, Patch}; let multipatch = Multipatch::with_parts(vec![ Patch::OuterRing(vec![ PointZ::new(0.0, 0.0, 0.0, NO_DATA), PointZ::new(0.0, 4.0, 0.0, NO_DATA), PointZ::new(4.0, 4.0, 0.0, NO_DATA), PointZ::new(4.0, 0.0, 0.0, NO_DATA), ]), Patch::InnerRing(vec![ PointZ::new(0.0, 0.0, 0.0, NO_DATA), PointZ::new(0.0, 2.0, 0.0, NO_DATA), PointZ::new(2.0, 2.0, 0.0, NO_DATA), PointZ::new(2.0, 0.0, 0.0, NO_DATA), ]) ]);
pub fn bbox(&self) -> &GenericBBox<PointZ>
[src]
Returns the bounding box of the points contained in this multipatch
pub fn patches(&self) -> &Vec<Patch>
[src]
Returns a reference to the patches of the Multipatch Shape
pub fn patch(&self, index: usize) -> Option<&Patch>
[src]
Returns a reference to the patch at given index
pub fn into_inner(self) -> Vec<Patch>
[src]
Consumes the shape and returns the patches
pub fn total_point_count(&self) -> usize
[src]
Trait Implementations
impl Clone for Multipatch
[src]
pub fn clone(&self) -> Multipatch
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl ConcreteReadableShape for Multipatch
[src]
impl ConcreteShape for Multipatch
[src]
impl Debug for Multipatch
[src]
impl Display for Multipatch
[src]
impl EsriShape for Multipatch
[src]
pub fn x_range(&self) -> [f64; 2]
[src]
pub fn y_range(&self) -> [f64; 2]
[src]
pub fn z_range(&self) -> [f64; 2]
[src]
pub fn m_range(&self) -> [f64; 2]
[src]
impl From<Multipatch> for Shape
[src]
pub fn from(concrete: Multipatch) -> Self
[src]
impl HasShapeType for Multipatch
[src]
impl PartialEq<Multipatch> for Multipatch
[src]
pub fn eq(&self, other: &Multipatch) -> bool
[src]
pub fn ne(&self, other: &Multipatch) -> bool
[src]
impl StructuralPartialEq for Multipatch
[src]
impl TryFrom<Shape> for Multipatch
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl WritableShape for Multipatch
[src]
Auto Trait Implementations
impl RefUnwindSafe for Multipatch
[src]
impl Send for Multipatch
[src]
impl Sync for Multipatch
[src]
impl Unpin for Multipatch
[src]
impl UnwindSafe for Multipatch
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S> ReadableShape for S where
S: ConcreteReadableShape,
[src]
S: ConcreteReadableShape,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,