Skip to main content

ClipperBase

Struct ClipperBase 

Source
pub struct ClipperBase {
Show 17 fields pub cliptype: ClipType, pub fillrule: FillRule, pub preserve_collinear: bool, pub reverse_solution: bool, pub error_code: i32, pub has_open_paths: bool, pub succeeded: bool, pub vertex_arena: Vec<Vertex>, pub active_arena: Vec<Active>, pub outpt_arena: Vec<OutPt>, pub outrec_list: Vec<OutRec>, pub minima_list: Vec<LocalMinima>, pub actives: Option<usize>, pub sel: Option<usize>, pub intersect_nodes: Vec<IntersectNode>, pub horz_seg_list: Vec<HorzSegment>, pub horz_join_list: Vec<HorzJoin>, /* private fields */
}
Expand description

Main clipping engine. Manages all arenas and the sweep-line algorithm state. Direct port from clipper.engine.h line 192

Fields§

§cliptype: ClipType§fillrule: FillRule§preserve_collinear: bool§reverse_solution: bool§error_code: i32§has_open_paths: bool§succeeded: bool§vertex_arena: Vec<Vertex>§active_arena: Vec<Active>§outpt_arena: Vec<OutPt>§outrec_list: Vec<OutRec>§minima_list: Vec<LocalMinima>§actives: Option<usize>§sel: Option<usize>§intersect_nodes: Vec<IntersectNode>§horz_seg_list: Vec<HorzSegment>§horz_join_list: Vec<HorzJoin>

Implementations§

Source§

impl ClipperBase

Source

pub fn new() -> Self

Source

pub fn clear(&mut self)

Clear all data Direct port from clipper.engine.h line 284

Source

pub fn insert_scanline(&mut self, y: i64)

Insert a scanline y-value Direct port from clipper.engine.cpp InsertScanline

Source

pub fn pop_scanline(&mut self) -> Option<i64>

Pop the next scanline y-value Direct port from clipper.engine.cpp PopScanline

Source

pub fn pop_local_minima(&mut self, y: i64) -> Option<usize>

Pop a local minimum at a given y-value Direct port from clipper.engine.cpp PopLocalMinima

Source

pub fn new_out_rec(&mut self) -> usize

Create a new OutRec Direct port from clipper.engine.cpp NewOutRec

Source

pub fn new_out_pt(&mut self, pt: Point64, outrec_idx: usize) -> usize

Create a new OutPt in the arena

Source

pub fn new_active(&mut self) -> usize

Create a new Active in the arena

Source

pub fn add_loc_min( &mut self, vert_idx: usize, polytype: PathType, is_open: bool, )

Add a local minimum Direct port from clipper.engine.cpp AddLocMin

Source

pub fn add_path(&mut self, path: &Path64, polytype: PathType, is_open: bool)

Add a path for clipping (converts to vertex representation) Direct port from clipper.engine.cpp AddPath / AddPaths_

Source

pub fn add_paths(&mut self, paths: &Paths64, polytype: PathType, is_open: bool)

Add multiple paths for clipping Direct port from clipper.engine.h AddPaths

Source

pub fn sort_minima_list(&mut self)

Sort the local minima list

Source

pub fn duplicate_op(&mut self, op_idx: usize, insert_after: bool) -> usize

Duplicate an OutPt, inserting after or before Direct port from clipper.engine.cpp DuplicateOp

Source

pub fn dispose_out_pt(&mut self, op_idx: usize) -> usize

Dispose (unlink) an OutPt, return the next Direct port from clipper.engine.cpp DisposeOutPt

Source

pub fn dispose_out_pts(&mut self, outrec_idx: usize)

Dispose all OutPts in a circular list, setting outrec.pts to None Direct port from clipper.engine.cpp DisposeOutPts

Source

pub fn set_sides( &mut self, outrec_idx: usize, start_edge: usize, end_edge: usize, )

Set the front and back edges of an OutRec Direct port from clipper.engine.cpp SetSides

Source

pub fn swap_outrecs(&mut self, e1_idx: usize, e2_idx: usize)

Swap OutRecs between two active edges Direct port from clipper.engine.cpp SwapOutrecs

Source

pub fn is_front(&self, e_idx: usize) -> bool

Check if an active edge is the front edge of its outrec Direct port from clipper.engine.cpp IsFront

Source

pub fn get_prev_hot_edge(&self, e_idx: usize) -> Option<usize>

Get the previous hot edge in AEL Direct port from clipper.engine.cpp GetPrevHotEdge

Source

pub fn add_trial_horz_join(&mut self, op_idx: usize)

Add a trial horizontal join Direct port from clipper.engine.cpp AddTrialHorzJoin

Source

pub fn push_horz(&mut self, e_idx: usize)

Push a horizontal edge onto the horz stack Direct port from clipper.engine.cpp PushHorz

Source

pub fn pop_horz(&mut self) -> Option<usize>

Pop a horizontal edge from the horz stack Direct port from clipper.engine.cpp PopHorz

Source

pub fn build_path64(&self, outrec: &OutRec) -> Option<Path64>

Build Path64 output from OutRec Direct port from clipper.engine.cpp BuildPath64

Source§

impl ClipperBase

Source

pub fn reset(&mut self)

Reset for a new execution Direct port from clipper.engine.cpp Reset (line 786)

Source

pub fn clean_up(&mut self)

Clean up after execution

Source

pub fn clean_collinear(&mut self, outrec_idx: usize)

Clean collinear points from an OutRec Direct port from clipper.engine.cpp CleanCollinear (line 1525)

Source

pub fn check_bounds(&mut self, outrec_idx: usize) -> bool

Check bounds of an outrec Direct port from clipper.engine.cpp CheckBounds (line 2929)

Source

pub fn recursive_check_owners( &mut self, outrec_idx: usize, polytree: &mut PolyTree64, )

Recursively check and set owners for polytree building Direct port from clipper.engine.cpp RecursiveCheckOwners (line 2967)

Source

pub fn execute_internal( &mut self, ct: ClipType, fillrule: FillRule, use_polytrees: bool, ) -> bool

Main execution loop of the sweep-line algorithm Direct port from clipper.engine.cpp ExecuteInternal (line 2129)

Trait Implementations§

Source§

impl Default for ClipperBase

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.