Struct geos::BufferParams
source · [−]pub struct BufferParams<'a> { /* private fields */ }
Expand description
Contains the parameters which describe how a Geometry buffer should be constructed using buffer_with_params
Implementations
sourceimpl<'a> BufferParams<'a>
impl<'a> BufferParams<'a>
pub fn new() -> GResult<BufferParams<'a>>
pub fn builder() -> BufferParamsBuilder
sourcepub fn set_end_cap_style(&mut self, style: CapStyle) -> GResult<()>
pub fn set_end_cap_style(&mut self, style: CapStyle) -> GResult<()>
Specifies the end cap style of the generated buffer.
sourcepub fn set_join_style(&mut self, style: JoinStyle) -> GResult<()>
pub fn set_join_style(&mut self, style: JoinStyle) -> GResult<()>
Sets the join style for outside (reflex) corners between line segments.
sourcepub fn set_mitre_limit(&mut self, limit: f64) -> GResult<()>
pub fn set_mitre_limit(&mut self, limit: f64) -> GResult<()>
Sets the limit on the mitre ratio used for very sharp corners.
The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled.
sourcepub fn set_quadrant_segments(&mut self, quadsegs: i32) -> GResult<()>
pub fn set_quadrant_segments(&mut self, quadsegs: i32) -> GResult<()>
Sets the number of line segments used to approximate an angle fillet.
- If
quadsegs
>= 1, joins are round, andquadsegs
indicates the number of segments to use to approximate a quarter-circle. - If
quadsegs
= 0, joins are bevelled (flat) - If
quadSegs
< 0, joins are mitred, and the value of qs indicates the mitre ration limit asmitreLimit = |quadsegs|
For round joins, quadsegs
determines the maximum
error in the approximation to the true buffer curve.
The default value of 8 gives less than 2% max error in the buffer distance.
For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).
sourcepub fn set_single_sided(&mut self, is_single_sided: bool) -> GResult<()>
pub fn set_single_sided(&mut self, is_single_sided: bool) -> GResult<()>
Sets whether the computed buffer should be single-sided.
A single-sided buffer is constructed on only one side of each input line.
The side used is determined by the sign of the buffer distance:
- a positive distance indicates the left-hand side
- a negative distance indicates the right-hand side
The single-sided buffer of point geometries is the same as the regular buffer.
The End Cap Style for single-sided buffers is always ignored, and forced to the
equivalent of CapStyle::Flat
.
Trait Implementations
sourceimpl<'a> ContextHandling for BufferParams<'a>
impl<'a> ContextHandling for BufferParams<'a>
type Context = Arc<ContextHandle<'a>>
fn clone_context(&self) -> Arc<ContextHandle<'a>>
sourceimpl<'a> ContextInteractions<'a> for BufferParams<'a>
impl<'a> ContextInteractions<'a> for BufferParams<'a>
fn set_context_handle(&mut self, context: ContextHandle<'a>)
fn get_context_handle(&self) -> &ContextHandle<'a>
sourcefn get_last_error(&self) -> Option<String>
fn get_last_error(&self) -> Option<String>
Gets the last error (if any) from the ContextHandle
held by this object. Read more
sourcefn get_last_notification(&self) -> Option<String>
fn get_last_notification(&self) -> Option<String>
Gets the last notification (if any) from the ContextHandle
held by this object. Read more
sourceimpl<'a> Drop for BufferParams<'a>
impl<'a> Drop for BufferParams<'a>
impl<'a> Send for BufferParams<'a>
impl<'a> Sync for BufferParams<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for BufferParams<'a>
impl<'a> Unpin for BufferParams<'a>
impl<'a> UnwindSafe for BufferParams<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more