Enum libreda_db::prelude::Geometry [−][src]
Abstracted geometrical shape.
Variants
Point(Point<T>)
Point.
Edge(Edge<T>)
Edge.
Rect(Rect<T>)
Rect.
SimplePolygon(SimplePolygon<T>)
SimplePolygon.
Polygon(Polygon<T>)
Polygon.
Path(Path<T>)
Path.
Text.
Implementations
impl<T> Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn transformed(&self, tf: &SimpleTransform<T>) -> Geometry<T>
[src]
Create a transformed copy of the geometric object.
Trait Implementations
impl<T> Clone for Geometry<T> where
T: CoordinateType + Clone,
[src]
T: CoordinateType + Clone,
impl<T> Debug for Geometry<T> where
T: CoordinateType + Debug,
[src]
T: CoordinateType + Debug,
impl<T> DoubledOrientedArea<T> for Geometry<T> where
T: CoordinateType + NumCast,
[src]
T: CoordinateType + NumCast,
pub fn area_doubled_oriented(&self) -> T
[src]
Area calculation.
impl<T> Eq for Geometry<T> where
T: CoordinateType + Eq,
[src]
T: CoordinateType + Eq,
impl<T> From<Edge<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<Path<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<Point<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<Polygon<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<Rect<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> From<SimplePolygon<T>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn from(x: SimplePolygon<T>) -> Geometry<T>
[src]
impl<T> From<Text<T, String>> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> Hash for Geometry<T> where
T: CoordinateType + Hash,
[src]
T: CoordinateType + Hash,
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Into<Polygon<T>> for Geometry<T> where
T: CoordinateType + NumCast,
[src]
T: CoordinateType + NumCast,
impl<T> PartialEq<Geometry<T>> for Geometry<T> where
T: CoordinateType + PartialEq<T>,
[src]
T: CoordinateType + PartialEq<T>,
pub fn eq(&self, other: &Geometry<T>) -> bool
[src]
pub fn ne(&self, other: &Geometry<T>) -> bool
[src]
impl<T> StructuralEq for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> StructuralPartialEq for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T> ToPolygon<T> for Geometry<T> where
T: CoordinateType + NumCast,
[src]
T: CoordinateType + NumCast,
pub fn to_polygon(&self) -> Polygon<T>
[src]
Convert a geometry into a polygon.
The coordinate type must implement NumCast
because there is currently
no way to convert a Path
into a polygon without converting it to a float type first.
Examples
use iron_shapes::prelude::*; let rect = Rect::new((0, 0), (1, 2)); // Convert the rectangle to a `Geometry`. let g: Geometry<_> = rect.into(); assert_eq!(g.to_polygon(), rect.to_polygon())
impl<T> TryBoundingBox<T> for Geometry<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn try_bounding_box(&self) -> Option<Rect<T>>
[src]
Calculate the bounding box of this geometrical shape by calling the bounding box method of the concrete type.
impl<T, Dst> TryCastCoord<T, Dst> for Geometry<T> where
T: CoordinateType + NumCast,
Dst: CoordinateType + NumCast,
[src]
T: CoordinateType + NumCast,
Dst: CoordinateType + NumCast,
Auto Trait Implementations
impl<T> RefUnwindSafe for Geometry<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Geometry<T> where
T: Send,
T: Send,
impl<T> Sync for Geometry<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Geometry<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Geometry<T> where
T: UnwindSafe,
T: UnwindSafe,
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<T> TextType for T where
T: Clone + Eq + Debug + Hash,
[src]
T: Clone + Eq + Debug + Hash,
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, 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>,