KiCad PCB EDA Suite
|
A routine that modifies polygons using boolean operations. More...
#include <item_modification_routine.h>
Public Member Functions | |
POLYGON_BOOLEAN_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler) | |
void | ProcessShape (PCB_SHAPE &aPcbShape) |
unsigned | GetSuccesses () const |
unsigned | GetFailures () const |
virtual wxString | GetCommitDescription () const =0 |
virtual std::optional< wxString > | GetStatusMessage () const =0 |
Get a status message to show when the routine is complete. | |
Protected Member Functions | |
PCB_SHAPE * | GetWorkingPolygon () const |
virtual bool | ProcessSubsequentPolygon (const SHAPE_POLY_SET &aPolygon)=0 |
BOARD_ITEM * | GetBoard () 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 SEG &aSeg) |
Helper function useful for multiple tools: modify a line or delete it if it has zero length. | |
CHANGE_HANDLER & | GetHandler () |
Access the handler for making changes to the board. | |
Private Attributes | |
PCB_SHAPE * | m_workingPolygon |
BOARD_ITEM * | m_board |
CHANGE_HANDLER & | m_handler |
unsigned | m_numSuccesses |
unsigned | m_numFailures |
A routine that modifies polygons using boolean operations.
Definition at line 308 of file item_modification_routine.h.
|
inline |
Definition at line 311 of file item_modification_routine.h.
|
inlineprotectedinherited |
Mark that one of the actions failed.
Definition at line 192 of file item_modification_routine.h.
References ITEM_MODIFICATION_ROUTINE::m_numFailures.
Referenced by LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and ProcessShape().
|
inlineprotectedinherited |
Mark that one of the actions succeeded.
Definition at line 187 of file item_modification_routine.h.
References ITEM_MODIFICATION_ROUTINE::m_numSuccesses.
Referenced by LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), and ProcessShape().
|
inlineprotectedinherited |
The BOARD used when creating new shapes.
Definition at line 182 of file item_modification_routine.h.
References ITEM_MODIFICATION_ROUTINE::m_board.
Referenced by LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and ProcessShape().
|
pure virtualinherited |
|
inlineinherited |
Definition at line 167 of file item_modification_routine.h.
References ITEM_MODIFICATION_ROUTINE::m_numFailures.
Referenced by LINE_FILLET_ROUTINE::GetStatusMessage(), LINE_CHAMFER_ROUTINE::GetStatusMessage(), LINE_EXTENSION_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), and POLYGON_INTERSECT_ROUTINE::GetStatusMessage().
|
inlineprotectedinherited |
Access the handler for making changes to the board.
Definition at line 206 of file item_modification_routine.h.
References ITEM_MODIFICATION_ROUTINE::m_handler.
Referenced by ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), and ProcessShape().
|
pure virtualinherited |
Get a status message to show when the routine is complete.
Usually this will be an error or nothing.
Implemented in LINE_FILLET_ROUTINE, LINE_CHAMFER_ROUTINE, LINE_EXTENSION_ROUTINE, POLYGON_MERGE_ROUTINE, POLYGON_SUBTRACT_ROUTINE, and POLYGON_INTERSECT_ROUTINE.
|
inlineinherited |
Definition at line 165 of file item_modification_routine.h.
References ITEM_MODIFICATION_ROUTINE::m_numSuccesses.
Referenced by LINE_FILLET_ROUTINE::GetStatusMessage(), LINE_CHAMFER_ROUTINE::GetStatusMessage(), LINE_EXTENSION_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), and POLYGON_INTERSECT_ROUTINE::GetStatusMessage().
|
inlineprotected |
Definition at line 319 of file item_modification_routine.h.
References m_workingPolygon.
Referenced by POLYGON_MERGE_ROUTINE::ProcessSubsequentPolygon(), POLYGON_SUBTRACT_ROUTINE::ProcessSubsequentPolygon(), and POLYGON_INTERSECT_ROUTINE::ProcessSubsequentPolygon().
|
protectedinherited |
Helper function useful for multiple tools: modify a line or delete it if it has zero length.
aItem | the line to modify |
aSeg | the new line geometry |
Definition at line 41 of file item_modification_routine.cpp.
References SEG::A, SEG::B, ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), ITEM_MODIFICATION_ROUTINE::GetHandler(), EDA_SHAPE::GetShape(), SEG::Length(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::MarkItemModified(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().
Referenced by LINE_FILLET_ROUTINE::ProcessLinePair(), and LINE_CHAMFER_ROUTINE::ProcessLinePair().
void POLYGON_BOOLEAN_ROUTINE::ProcessShape | ( | PCB_SHAPE & | aPcbShape | ) |
Definition at line 313 of file item_modification_routine.cpp.
References ITEM_MODIFICATION_ROUTINE::AddFailure(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::AddNewItem(), ITEM_MODIFICATION_ROUTINE::AddSuccess(), SHAPE_POLY_SET::Append(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), ITEM_MODIFICATION_ROUTINE::GetBoard(), ITEM_MODIFICATION_ROUTINE::GetHandler(), PCB_SHAPE::GetLayer(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetRectCorners(), EDA_SHAPE::GetShape(), PCB_SHAPE::GetWidth(), m_workingPolygon, SHAPE_POLY_SET::NewOutline(), and ProcessSubsequentPolygon().
|
protectedpure virtual |
Implemented in POLYGON_MERGE_ROUTINE, POLYGON_SUBTRACT_ROUTINE, and POLYGON_INTERSECT_ROUTINE.
Referenced by ProcessShape().
|
privateinherited |
Definition at line 209 of file item_modification_routine.h.
Referenced by ITEM_MODIFICATION_ROUTINE::GetBoard().
|
privateinherited |
Definition at line 210 of file item_modification_routine.h.
Referenced by ITEM_MODIFICATION_ROUTINE::GetHandler().
|
privateinherited |
Definition at line 213 of file item_modification_routine.h.
Referenced by ITEM_MODIFICATION_ROUTINE::AddFailure(), and ITEM_MODIFICATION_ROUTINE::GetFailures().
|
privateinherited |
Definition at line 212 of file item_modification_routine.h.
Referenced by ITEM_MODIFICATION_ROUTINE::AddSuccess(), and ITEM_MODIFICATION_ROUTINE::GetSuccesses().
|
private |
Definition at line 324 of file item_modification_routine.h.
Referenced by GetWorkingPolygon(), and ProcessShape().