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§
Sourcefn contour_length(&self) -> f64
fn contour_length(&self) -> f64
The geometry’s total length as if all its contours are placed in a straight line.
Sourcefn get_render_bounds(&self, pen: Option<&dyn IPen>) -> Rect
fn get_render_bounds(&self, pen: Option<&dyn IPen>) -> Rect
Gets the geometry’s bounding rectangle with the specified pen.
Sourcefn get_widened_geometry(&self, pen: &dyn IPen) -> Arc<dyn IGeometryImpl> ⓘ
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.
Sourcefn fill_contains(&self, point: Point) -> bool
fn fill_contains(&self, point: Point) -> bool
Indicates whether the geometry’s fill contains the specified point.
Sourcefn get_fill_intersection_result(
&self,
geometry: &dyn IGeometryImpl,
) -> IntersectionResult
fn get_fill_intersection_result( &self, geometry: &dyn IGeometryImpl, ) -> IntersectionResult
Gets the relation between this geometry’s fill and another one’s.
Sourcefn intersect(
&self,
geometry: &dyn IGeometryImpl,
) -> Option<Arc<dyn IGeometryImpl>>
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.
Sourcefn stroke_contains(&self, pen: Option<&dyn IPen>, point: Point) -> bool
fn stroke_contains(&self, pen: Option<&dyn IPen>, point: Point) -> bool
Indicates whether the geometry’s stroke contains the specified point.
Sourcefn with_transform(&self, transform: Matrix) -> Arc<dyn ITransformedGeometryImpl> ⓘ
fn with_transform(&self, transform: Matrix) -> Arc<dyn ITransformedGeometryImpl> ⓘ
Makes a clone of the geometry with the specified transform.
Sourcefn try_get_point_at_distance(&self, distance: f64) -> Option<Point>
fn try_get_point_at_distance(&self, distance: f64) -> Option<Point>
Attempts to get the corresponding point at the specified distance.
Sourcefn try_get_point_and_tangent_at_distance(
&self,
distance: f64,
) -> Option<(Point, Point)>
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.
Sourcefn try_get_segment(
&self,
start_distance: f64,
stop_distance: f64,
start_on_begin_figure: bool,
) -> Option<Arc<dyn IGeometryImpl>>
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.
Provided Methods§
Sourcefn as_transformed_geometry(&self) -> Option<&dyn ITransformedGeometryImpl>
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".