pub struct BuilderWithAttributes { /* private fields */ }
Expand description
A builder for Path
with custom attributes.
Custom attributes are a fixed number of f32
values associated with each endpoint.
All endpoints must have the same number of custom attributes,
Implementations§
source§impl BuilderWithAttributes
impl BuilderWithAttributes
pub fn new(num_attributes: usize) -> Self
pub fn extend_from_paths(&mut self, paths: &[PathSlice<'_>])
pub fn num_attributes(&self) -> usize
pub fn begin(&mut self, at: Point, attributes: Attributes<'_>) -> EndpointId
pub fn end(&mut self, close: bool)
pub fn line_to(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
pub fn quadratic_bezier_to( &mut self, ctrl: Point, to: Point, attributes: Attributes<'_>, ) -> EndpointId
pub fn cubic_bezier_to( &mut self, ctrl1: Point, ctrl2: Point, to: Point, attributes: Attributes<'_>, ) -> EndpointId
pub fn reserve(&mut self, endpoints: usize, ctrl_points: usize)
pub fn build(self) -> Path
Trait Implementations§
source§impl Build for BuilderWithAttributes
impl Build for BuilderWithAttributes
source§impl Clone for BuilderWithAttributes
impl Clone for BuilderWithAttributes
source§fn clone(&self) -> BuilderWithAttributes
fn clone(&self) -> BuilderWithAttributes
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl PathBuilder for BuilderWithAttributes
impl PathBuilder for BuilderWithAttributes
fn num_attributes(&self) -> usize
source§fn begin(&mut self, at: Point, attributes: Attributes<'_>) -> EndpointId
fn begin(&mut self, at: Point, attributes: Attributes<'_>) -> EndpointId
Starts a new sub-path at a given position. Read more
source§fn line_to(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
fn line_to(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
Adds a line segment to the current sub-path. Read more
source§fn quadratic_bezier_to(
&mut self,
ctrl: Point,
to: Point,
attributes: Attributes<'_>,
) -> EndpointId
fn quadratic_bezier_to( &mut self, ctrl: Point, to: Point, attributes: Attributes<'_>, ) -> EndpointId
Adds a quadratic bézier curve to the current sub-path. Read more
source§fn cubic_bezier_to(
&mut self,
ctrl1: Point,
ctrl2: Point,
to: Point,
attributes: Attributes<'_>,
) -> EndpointId
fn cubic_bezier_to( &mut self, ctrl1: Point, ctrl2: Point, to: Point, attributes: Attributes<'_>, ) -> EndpointId
Adds a cubic bézier curve to the current sub-path. Read more
source§fn reserve(&mut self, endpoints: usize, ctrl_points: usize)
fn reserve(&mut self, endpoints: usize, ctrl_points: usize)
Hints at the builder that a certain number of endpoints and control
points will be added. Read more
source§fn path_event(&mut self, event: PathEvent, attributes: Attributes<'_>)
fn path_event(&mut self, event: PathEvent, attributes: Attributes<'_>)
Applies the provided path event. Read more
fn event(&mut self, event: Event<(Point, Attributes<'_>), Point>)
source§fn add_polygon(
&mut self,
polygon: Polygon<'_, Point>,
attributes: Attributes<'_>,
)
fn add_polygon( &mut self, polygon: Polygon<'_, Point>, attributes: Attributes<'_>, )
Adds a sub-path from a polygon. Read more
source§fn add_point(&mut self, at: Point, attributes: Attributes<'_>) -> EndpointId
fn add_point(&mut self, at: Point, attributes: Attributes<'_>) -> EndpointId
Adds a sub-path containing a single point. Read more
source§fn add_line_segment(
&mut self,
line: &LineSegment<f32>,
attributes: Attributes<'_>,
) -> (EndpointId, EndpointId)
fn add_line_segment( &mut self, line: &LineSegment<f32>, attributes: Attributes<'_>, ) -> (EndpointId, EndpointId)
Adds a sub-path containing a single line segment. Read more
source§fn add_ellipse(
&mut self,
center: Point,
radii: Vector,
x_rotation: Angle,
winding: Winding,
attributes: Attributes<'_>,
)
fn add_ellipse( &mut self, center: Point, radii: Vector, x_rotation: Angle, winding: Winding, attributes: Attributes<'_>, )
Adds a sub-path containing an ellipse. Read more
source§fn add_circle(
&mut self,
center: Point,
radius: f32,
winding: Winding,
attributes: Attributes<'_>,
)where
Self: Sized,
fn add_circle(
&mut self,
center: Point,
radius: f32,
winding: Winding,
attributes: Attributes<'_>,
)where
Self: Sized,
Adds a sub-path containing a circle. Read more
source§fn add_rectangle(
&mut self,
rect: &Box2D,
winding: Winding,
attributes: Attributes<'_>,
)
fn add_rectangle( &mut self, rect: &Box2D, winding: Winding, attributes: Attributes<'_>, )
Adds a sub-path containing a rectangle. Read more
source§fn add_rounded_rectangle(
&mut self,
rect: &Box2D,
radii: &BorderRadii,
winding: Winding,
custom_attributes: Attributes<'_>,
)where
Self: Sized,
fn add_rounded_rectangle(
&mut self,
rect: &Box2D,
radii: &BorderRadii,
winding: Winding,
custom_attributes: Attributes<'_>,
)where
Self: Sized,
Adds a sub-path containing a rectangle. Read more
source§fn flattened(self, tolerance: f32) -> Flattened<Self>where
Self: Sized,
fn flattened(self, tolerance: f32) -> Flattened<Self>where
Self: Sized,
Returns a builder that approximates all curves with sequences of line segments.
source§fn transformed<Transform>(
self,
transform: Transform,
) -> Transformed<Self, Transform>
fn transformed<Transform>( self, transform: Transform, ) -> Transformed<Self, Transform>
Returns a builder that applies the given transformation to all positions.
Auto Trait Implementations§
impl Freeze for BuilderWithAttributes
impl RefUnwindSafe for BuilderWithAttributes
impl Send for BuilderWithAttributes
impl Sync for BuilderWithAttributes
impl Unpin for BuilderWithAttributes
impl UnwindSafe for BuilderWithAttributes
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)