KiCad PCB EDA Suite
|
An object that has the ability to modify items on a board. More...
#include <item_modification_routine.h>
Classes | |
class | CALLABLE_BASED_HANDLER |
A handler that is based on a set of callbacks provided by the user of the ITEM_MODIFICATION_ROUTINE. More... | |
class | CHANGE_HANDLER |
Public Member Functions | |
ITEM_MODIFICATION_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler) | |
virtual | ~ITEM_MODIFICATION_ROUTINE ()=default |
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 | |
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 std::optional< 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 | |
BOARD_ITEM * | m_board |
CHANGE_HANDLER & | m_handler |
unsigned | m_numSuccesses |
unsigned | m_numFailures |
An object that has the ability to modify items on a board.
For example, such an object could take pairs of lines and fillet them, or produce other modification to items.
Deliberately not called a "tool" to distinguish it from true tools that are used interactively by the user.
Definition at line 46 of file item_modification_routine.h.
|
inline |
Definition at line 155 of file item_modification_routine.h.
|
virtualdefault |
|
inlineprotected |
Mark that one of the actions failed.
Definition at line 192 of file item_modification_routine.h.
References m_numFailures.
Referenced by LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().
|
inlineprotected |
Mark that one of the actions succeeded.
Definition at line 187 of file item_modification_routine.h.
References m_numSuccesses.
Referenced by OUTSET_ROUTINE::ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().
|
inlineprotected |
The BOARD used when creating new shapes.
Definition at line 182 of file item_modification_routine.h.
References m_board.
Referenced by POLYGON_BOOLEAN_ROUTINE::Finalize(), OUTSET_ROUTINE::ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and DOGBONE_CORNER_ROUTINE::ProcessLinePair().
|
pure virtual |
|
inline |
Definition at line 167 of file item_modification_routine.h.
References m_numFailures.
Referenced by LINE_FILLET_ROUTINE::GetStatusMessage(), LINE_CHAMFER_ROUTINE::GetStatusMessage(), LINE_EXTENSION_ROUTINE::GetStatusMessage(), DOGBONE_CORNER_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), POLYGON_INTERSECT_ROUTINE::GetStatusMessage(), and OUTSET_ROUTINE::GetStatusMessage().
|
inlineprotected |
Access the handler for making changes to the board.
Definition at line 206 of file item_modification_routine.h.
References m_handler.
Referenced by POLYGON_BOOLEAN_ROUTINE::Finalize(), ModifyLineOrDeleteIfZeroLength(), OUTSET_ROUTINE::ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().
|
pure virtual |
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, DOGBONE_CORNER_ROUTINE, POLYGON_MERGE_ROUTINE, POLYGON_SUBTRACT_ROUTINE, POLYGON_INTERSECT_ROUTINE, and OUTSET_ROUTINE.
|
inline |
Definition at line 165 of file item_modification_routine.h.
References m_numSuccesses.
Referenced by LINE_FILLET_ROUTINE::GetStatusMessage(), LINE_CHAMFER_ROUTINE::GetStatusMessage(), LINE_EXTENSION_ROUTINE::GetStatusMessage(), DOGBONE_CORNER_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), POLYGON_INTERSECT_ROUTINE::GetStatusMessage(), and OUTSET_ROUTINE::GetStatusMessage().
|
protected |
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 76 of file item_modification_routine.cpp.
References ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), GetHandler(), EDA_SHAPE::GetShape(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::MarkItemModified(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().
Referenced by LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and DOGBONE_CORNER_ROUTINE::ProcessLinePair().
|
private |
Definition at line 209 of file item_modification_routine.h.
Referenced by GetBoard().
|
private |
Definition at line 210 of file item_modification_routine.h.
Referenced by GetHandler().
|
private |
Definition at line 213 of file item_modification_routine.h.
Referenced by AddFailure(), and GetFailures().
|
private |
Definition at line 212 of file item_modification_routine.h.
Referenced by AddSuccess(), and GetSuccesses().