Skip to main content

IGeometryImpl

Trait IGeometryImpl 

Source
pub trait IGeometryImpl:
    Send
    + Sync
    + 'static {
Show 14 methods // Required methods fn bounds(&self) -> Rect; fn contour_length(&self) -> f64; fn get_render_bounds(&self, pen: Option<&dyn IPen>) -> Rect; fn get_widened_geometry(&self, pen: &dyn IPen) -> Arc<dyn IGeometryImpl> ⓘ; fn fill_contains(&self, point: Point) -> bool; fn get_fill_intersection_result( &self, geometry: &dyn IGeometryImpl, ) -> IntersectionResult; fn intersect( &self, geometry: &dyn IGeometryImpl, ) -> Option<Arc<dyn IGeometryImpl>>; fn stroke_contains(&self, pen: Option<&dyn IPen>, point: Point) -> bool; fn with_transform( &self, transform: Matrix, ) -> Arc<dyn ITransformedGeometryImpl> ⓘ; fn try_get_point_at_distance(&self, distance: f64) -> Option<Point>; fn try_get_point_and_tangent_at_distance( &self, distance: f64, ) -> Option<(Point, Point)>; fn try_get_segment( &self, start_distance: f64, stop_distance: f64, start_on_begin_figure: bool, ) -> Option<Arc<dyn IGeometryImpl>>; fn as_any(&self) -> &dyn Any; // Provided method fn as_transformed_geometry(&self) -> Option<&dyn ITransformedGeometryImpl> { ... }
}
Expand description

Defines the platform-specific interface for a geometry.

Required Methods§

Source

fn bounds(&self) -> Rect

The geometry’s bounding rectangle.

Source

fn contour_length(&self) -> f64

The geometry’s total length as if all its contours are placed in a straight line.

Source

fn get_render_bounds(&self, pen: Option<&dyn IPen>) -> Rect

Gets the geometry’s bounding rectangle with the specified pen.

Source

fn get_widened_geometry(&self, pen: &dyn IPen) -> Arc<dyn IGeometryImpl> ⓘ

Gets a geometry that is the shape defined by the stroke on the geometry produced by the specified pen.

Source

fn fill_contains(&self, point: Point) -> bool

Indicates whether the geometry’s fill contains the specified point.

Source

fn get_fill_intersection_result( &self, geometry: &dyn IGeometryImpl, ) -> IntersectionResult

Gets the relation between this geometry’s fill and another one’s.

Source

fn intersect( &self, geometry: &dyn IGeometryImpl, ) -> Option<Arc<dyn IGeometryImpl>>

Intersects the geometry with another geometry.

Returns a new geometry object representing the intersection or None when the operation failed.

Source

fn stroke_contains(&self, pen: Option<&dyn IPen>, point: Point) -> bool

Indicates whether the geometry’s stroke contains the specified point.

Source

fn with_transform(&self, transform: Matrix) -> Arc<dyn ITransformedGeometryImpl> ⓘ

Makes a clone of the geometry with the specified transform.

Source

fn try_get_point_at_distance(&self, distance: f64) -> Option<Point>

Attempts to get the corresponding point at the specified distance.

Source

fn try_get_point_and_tangent_at_distance( &self, distance: f64, ) -> Option<(Point, Point)>

Attempts to get the corresponding point and tangent from the specified distance along the contour of the geometry.

Source

fn try_get_segment( &self, start_distance: f64, stop_distance: f64, start_on_begin_figure: bool, ) -> Option<Arc<dyn IGeometryImpl>>

Attempts to get the corresponding path segment given by the two distances specified. Imagine it like snipping a part of the current geometry.

When start_on_begin_figure is true, the resulting snipped path begins with a figure start.

Source

fn as_any(&self) -> &dyn Any

Lets the backend recover its concrete type.

Provided Methods§

Source

fn as_transformed_geometry(&self) -> Option<&dyn ITransformedGeometryImpl>

The geometry viewed as ITransformedGeometryImpl, when it is one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§