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
impl ClipperBase
pub fn new() -> Self
Sourcepub fn insert_scanline(&mut self, y: i64)
pub fn insert_scanline(&mut self, y: i64)
Insert a scanline y-value Direct port from clipper.engine.cpp InsertScanline
Sourcepub fn pop_scanline(&mut self) -> Option<i64>
pub fn pop_scanline(&mut self) -> Option<i64>
Pop the next scanline y-value Direct port from clipper.engine.cpp PopScanline
Sourcepub fn pop_local_minima(&mut self, y: i64) -> Option<usize>
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
Sourcepub fn new_out_rec(&mut self) -> usize
pub fn new_out_rec(&mut self) -> usize
Create a new OutRec Direct port from clipper.engine.cpp NewOutRec
Sourcepub fn new_out_pt(&mut self, pt: Point64, outrec_idx: usize) -> usize
pub fn new_out_pt(&mut self, pt: Point64, outrec_idx: usize) -> usize
Create a new OutPt in the arena
Sourcepub fn new_active(&mut self) -> usize
pub fn new_active(&mut self) -> usize
Create a new Active in the arena
Sourcepub fn add_loc_min(
&mut self,
vert_idx: usize,
polytype: PathType,
is_open: bool,
)
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
Sourcepub fn add_path(&mut self, path: &Path64, polytype: PathType, is_open: bool)
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_
Sourcepub fn add_paths(&mut self, paths: &Paths64, polytype: PathType, is_open: bool)
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
Sourcepub fn sort_minima_list(&mut self)
pub fn sort_minima_list(&mut self)
Sort the local minima list
Sourcepub fn duplicate_op(&mut self, op_idx: usize, insert_after: bool) -> usize
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
Sourcepub fn dispose_out_pt(&mut self, op_idx: usize) -> usize
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
Sourcepub fn dispose_out_pts(&mut self, outrec_idx: usize)
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
Sourcepub fn set_sides(
&mut self,
outrec_idx: usize,
start_edge: usize,
end_edge: usize,
)
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
Sourcepub fn swap_outrecs(&mut self, e1_idx: usize, e2_idx: usize)
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
Sourcepub fn is_front(&self, e_idx: usize) -> bool
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
Sourcepub fn get_prev_hot_edge(&self, e_idx: usize) -> Option<usize>
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
Sourcepub fn add_trial_horz_join(&mut self, op_idx: usize)
pub fn add_trial_horz_join(&mut self, op_idx: usize)
Add a trial horizontal join Direct port from clipper.engine.cpp AddTrialHorzJoin
Sourcepub fn push_horz(&mut self, e_idx: usize)
pub fn push_horz(&mut self, e_idx: usize)
Push a horizontal edge onto the horz stack Direct port from clipper.engine.cpp PushHorz
Sourcepub fn pop_horz(&mut self) -> Option<usize>
pub fn pop_horz(&mut self) -> Option<usize>
Pop a horizontal edge from the horz stack Direct port from clipper.engine.cpp PopHorz
Sourcepub fn build_path64(&self, outrec: &OutRec) -> Option<Path64>
pub fn build_path64(&self, outrec: &OutRec) -> Option<Path64>
Build Path64 output from OutRec Direct port from clipper.engine.cpp BuildPath64
Source§impl ClipperBase
impl ClipperBase
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset for a new execution Direct port from clipper.engine.cpp Reset (line 786)
Sourcepub fn clean_collinear(&mut self, outrec_idx: usize)
pub fn clean_collinear(&mut self, outrec_idx: usize)
Clean collinear points from an OutRec Direct port from clipper.engine.cpp CleanCollinear (line 1525)
Sourcepub fn check_bounds(&mut self, outrec_idx: usize) -> bool
pub fn check_bounds(&mut self, outrec_idx: usize) -> bool
Check bounds of an outrec Direct port from clipper.engine.cpp CheckBounds (line 2929)
Sourcepub fn recursive_check_owners(
&mut self,
outrec_idx: usize,
polytree: &mut PolyTree64,
)
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)