KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
POLYGON_BOOLEAN_ROUTINE Class Referenceabstract

A routine that modifies polygons using boolean operations. More...

#include <item_modification_routine.h>

Inheritance diagram for POLYGON_BOOLEAN_ROUTINE:
ITEM_MODIFICATION_ROUTINE POLYGON_INTERSECT_ROUTINE POLYGON_MERGE_ROUTINE POLYGON_SUBTRACT_ROUTINE

Public Member Functions

 POLYGON_BOOLEAN_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler)
 
void ProcessShape (PCB_SHAPE &aPcbShape)
 
void Finalize ()
 Clear up any outstanding work.
 
virtual std::optional< wxString > GetStatusMessage () const =0
 Get a status message to show when the routine is complete.
 
unsigned GetSuccesses () const
 
unsigned GetFailures () const
 
virtual wxString GetCommitDescription () const =0
 

Protected Member Functions

SHAPE_POLY_SETGetWorkingPolygons ()
 
virtual bool ProcessSubsequentPolygon (const SHAPE_POLY_SET &aPolygon)=0
 
BOARD_ITEMGetBoard () const
 The BOARD used when creating new shapes.
 
void AddSuccess ()
 Mark that one of the actions succeeded.
 
void AddFailure ()
 Mark that one of the actions failed.
 
bool ModifyLineOrDeleteIfZeroLength (PCB_SHAPE &aItem, const std::optional< SEG > &aSeg)
 Helper function useful for multiple tools: modify a line or delete it if it has zero length.
 
CHANGE_HANDLERGetHandler ()
 Access the handler for making changes to the board.
 

Private Attributes

SHAPE_POLY_SET m_workingPolygons
 This can be disjoint, which will be fixed at the end.
 
bool m_firstPolygon = true
 
int m_width = 0
 
PCB_LAYER_ID m_layer = PCB_LAYER_ID::UNDEFINED_LAYER
 
FILL_T m_fillMode = FILL_T::NO_FILL
 
BOARD_ITEMm_board
 
CHANGE_HANDLERm_handler
 
unsigned m_numSuccesses
 
unsigned m_numFailures
 

Detailed Description

A routine that modifies polygons using boolean operations.

Definition at line 338 of file item_modification_routine.h.

Constructor & Destructor Documentation

◆ POLYGON_BOOLEAN_ROUTINE()

POLYGON_BOOLEAN_ROUTINE::POLYGON_BOOLEAN_ROUTINE ( BOARD_ITEM aBoard,
CHANGE_HANDLER aHandler 
)
inline

Definition at line 341 of file item_modification_routine.h.

Member Function Documentation

◆ AddFailure()

void ITEM_MODIFICATION_ROUTINE::AddFailure ( )
inlineprotectedinherited

◆ AddSuccess()

void ITEM_MODIFICATION_ROUTINE::AddSuccess ( )
inlineprotectedinherited

◆ Finalize()

◆ GetBoard()

BOARD_ITEM * ITEM_MODIFICATION_ROUTINE::GetBoard ( ) const
inlineprotectedinherited

◆ GetCommitDescription()

virtual wxString ITEM_MODIFICATION_ROUTINE::GetCommitDescription ( ) const
pure virtualinherited

◆ GetFailures()

◆ GetHandler()

◆ GetStatusMessage()

virtual std::optional< wxString > POLYGON_BOOLEAN_ROUTINE::GetStatusMessage ( ) const
pure virtual

Get a status message to show when the routine is complete.

Usually this will be an error or nothing.

Implemented in POLYGON_MERGE_ROUTINE, POLYGON_SUBTRACT_ROUTINE, and POLYGON_INTERSECT_ROUTINE.

◆ GetSuccesses()

◆ GetWorkingPolygons()

◆ ModifyLineOrDeleteIfZeroLength()

bool ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength ( PCB_SHAPE aItem,
const std::optional< SEG > &  aSeg 
)
protectedinherited

◆ ProcessShape()

◆ ProcessSubsequentPolygon()

virtual bool POLYGON_BOOLEAN_ROUTINE::ProcessSubsequentPolygon ( const SHAPE_POLY_SET aPolygon)
protectedpure virtual

Member Data Documentation

◆ m_board

BOARD_ITEM* ITEM_MODIFICATION_ROUTINE::m_board
privateinherited

Definition at line 202 of file item_modification_routine.h.

Referenced by ITEM_MODIFICATION_ROUTINE::GetBoard().

◆ m_fillMode

FILL_T POLYGON_BOOLEAN_ROUTINE::m_fillMode = FILL_T::NO_FILL
private

Definition at line 372 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ m_firstPolygon

bool POLYGON_BOOLEAN_ROUTINE::m_firstPolygon = true
private

Definition at line 369 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ m_handler

CHANGE_HANDLER& ITEM_MODIFICATION_ROUTINE::m_handler
privateinherited

Definition at line 203 of file item_modification_routine.h.

Referenced by ITEM_MODIFICATION_ROUTINE::GetHandler().

◆ m_layer

PCB_LAYER_ID POLYGON_BOOLEAN_ROUTINE::m_layer = PCB_LAYER_ID::UNDEFINED_LAYER
private

Definition at line 371 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ m_numFailures

unsigned ITEM_MODIFICATION_ROUTINE::m_numFailures
privateinherited

◆ m_numSuccesses

unsigned ITEM_MODIFICATION_ROUTINE::m_numSuccesses
privateinherited

◆ m_width

int POLYGON_BOOLEAN_ROUTINE::m_width = 0
private

Definition at line 370 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ m_workingPolygons

SHAPE_POLY_SET POLYGON_BOOLEAN_ROUTINE::m_workingPolygons
private

This can be disjoint, which will be fixed at the end.

Definition at line 367 of file item_modification_routine.h.

Referenced by Finalize(), GetWorkingPolygons(), and ProcessShape().


The documentation for this class was generated from the following files: