Struct norad::ContourPoint
source · pub struct ContourPoint {
pub x: f64,
pub y: f64,
pub typ: PointType,
pub smooth: bool,
pub name: Option<Name>,
/* private fields */
}
Expand description
A single point in a Contour
.
Fields§
§x: f64
Contour point x coordinate value.
y: f64
Contour point y coordinate value.
typ: PointType
Contour point type.
smooth: bool
Whether a smooth curvature should be maintained at this point. Must not be set for off-curve points.
name: Option<Name>
Optional contour point name.
Implementations§
source§impl ContourPoint
impl ContourPoint
sourcepub fn new(
x: f64,
y: f64,
typ: PointType,
smooth: bool,
name: Option<Name>,
identifier: Option<Identifier>,
lib: Option<Plist>
) -> Self
pub fn new( x: f64, y: f64, typ: PointType, smooth: bool, name: Option<Name>, identifier: Option<Identifier>, lib: Option<Plist> ) -> Self
Returns a new ContourPoint
given an x
coordinate value,
y
coordinate value, point type, and smooth definition.
sourcepub fn lib_mut(&mut self) -> Option<&mut Plist>
pub fn lib_mut(&mut self) -> Option<&mut Plist>
Returns a mutable reference to the contour’s lib.
sourcepub fn replace_lib(&mut self, lib: Plist) -> Option<Plist>
pub fn replace_lib(&mut self, lib: Plist) -> Option<Plist>
Replaces the actual lib by the lib given in parameter, returning the old lib if present. Sets a new UUID v4 identifier if none is set already.
sourcepub fn take_lib(&mut self) -> Option<Plist>
pub fn take_lib(&mut self) -> Option<Plist>
Takes the lib out of the contour, leaving a None in its place.
sourcepub fn identifier(&self) -> Option<&Identifier>
pub fn identifier(&self) -> Option<&Identifier>
Returns a reference to the contour’s identifier.
sourcepub fn replace_identifier(&mut self, id: Identifier) -> Option<Identifier>
pub fn replace_identifier(&mut self, id: Identifier) -> Option<Identifier>
Replaces the actual identifier by the identifier given in parameter, returning the old identifier if present.
sourcepub fn to_kurbo(&self) -> Point
pub fn to_kurbo(&self) -> Point
Returns a kurbo::Point
with this ContourPoint
’s coordinates.
sourcepub fn transform(&mut self, transform: AffineTransform)
pub fn transform(&mut self, transform: AffineTransform)
Applies a transformation matrix to the point’s coordinates
Trait Implementations§
source§impl Clone for ContourPoint
impl Clone for ContourPoint
source§fn clone(&self) -> ContourPoint
fn clone(&self) -> ContourPoint
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ContourPoint
impl Debug for ContourPoint
source§impl PartialEq for ContourPoint
impl PartialEq for ContourPoint
source§fn eq(&self, other: &ContourPoint) -> bool
fn eq(&self, other: &ContourPoint) -> bool
self
and other
values to be equal, and is used
by ==
.