|
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 |
| Handlers for receiving changes from the tool. More... | |
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 |
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. | |
| void | SplitCornerConstraint (const CONSTRAINT_MEMBER &aCornerA, const CONSTRAINT_MEMBER &aCornerB, const CONSTRAINT_MEMBER &aInsertedForA, const CONSTRAINT_MEMBER &aInsertedForB) |
| Hold each line to a shape just inserted at their shared corner, in place of the coincident constraint that held the two lines to each other. | |
| 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 43 of file item_modification_routine.h.
|
inline |
Definition at line 152 of file item_modification_routine.h.
References m_board, m_handler, m_numFailures, and m_numSuccesses.
Referenced by OUTSET_ROUTINE::OUTSET_ROUTINE(), PAIRWISE_LINE_ROUTINE::PAIRWISE_LINE_ROUTINE(), and POLYGON_BOOLEAN_ROUTINE::POLYGON_BOOLEAN_ROUTINE().
|
virtualdefault |
|
inlineprotected |
Mark that one of the actions failed.
Definition at line 182 of file item_modification_routine.h.
References m_numFailures.
Referenced by OUTSET_ROUTINE::ProcessItem(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_FILLET_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().
|
inlineprotected |
Mark that one of the actions succeeded.
Definition at line 177 of file item_modification_routine.h.
References m_numSuccesses.
Referenced by OUTSET_ROUTINE::ProcessItem(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), LINE_FILLET_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().
|
inlineprotected |
The BOARD used when creating new shapes.
Definition at line 172 of file item_modification_routine.h.
References m_board.
Referenced by POLYGON_BOOLEAN_ROUTINE::Finalize(), OUTSET_ROUTINE::ProcessItem(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_FILLET_ROUTINE::ProcessLinePair(), and SplitCornerConstraint().
|
pure virtual |
|
inline |
Definition at line 164 of file item_modification_routine.h.
References m_numFailures.
Referenced by DOGBONE_CORNER_ROUTINE::GetStatusMessage(), LINE_CHAMFER_ROUTINE::GetStatusMessage(), LINE_EXTENSION_ROUTINE::GetStatusMessage(), LINE_FILLET_ROUTINE::GetStatusMessage(), OUTSET_ROUTINE::GetStatusMessage(), POLYGON_INTERSECT_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), and OUTSET_ROUTINE::ProcessItem().
|
inlineprotected |
Access the handler for making changes to the board.
Definition at line 204 of file item_modification_routine.h.
References m_handler.
Referenced by POLYGON_BOOLEAN_ROUTINE::Finalize(), ModifyLineOrDeleteIfZeroLength(), OUTSET_ROUTINE::ProcessItem(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), LINE_FILLET_ROUTINE::ProcessLinePair(), POLYGON_BOOLEAN_ROUTINE::ProcessShape(), and SplitCornerConstraint().
|
inline |
Definition at line 162 of file item_modification_routine.h.
References m_numSuccesses.
Referenced by DOGBONE_CORNER_ROUTINE::GetStatusMessage(), LINE_CHAMFER_ROUTINE::GetStatusMessage(), LINE_EXTENSION_ROUTINE::GetStatusMessage(), LINE_FILLET_ROUTINE::GetStatusMessage(), OUTSET_ROUTINE::GetStatusMessage(), POLYGON_INTERSECT_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), and OUTSET_ROUTINE::ProcessItem().
|
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(), SEGMENT, PCB_SHAPE::SetEnd(), and PCB_SHAPE::SetStart().
Referenced by DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and LINE_FILLET_ROUTINE::ProcessLinePair().
|
protected |
Hold each line to a shape just inserted at their shared corner, in place of the coincident constraint that held the two lines to each other.
The line members are the anchors as they stand after the insertion.
Definition at line 99 of file item_modification_routine.cpp.
References ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::AddNewItem(), COINCIDENT, BOARD::Constraints(), BOARD::Footprints(), BOARD_ITEM::GetBoard(), GetBoard(), GetHandler(), CONSTRAINT_MEMBER::m_anchor, CONSTRAINT_MEMBER::m_index, CONSTRAINT_MEMBER::m_item, ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::MarkItemModified(), and split().
Referenced by DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and LINE_FILLET_ROUTINE::ProcessLinePair().
|
private |
Definition at line 207 of file item_modification_routine.h.
Referenced by GetBoard(), and ITEM_MODIFICATION_ROUTINE().
|
private |
Definition at line 208 of file item_modification_routine.h.
Referenced by GetHandler(), and ITEM_MODIFICATION_ROUTINE().
|
private |
Definition at line 211 of file item_modification_routine.h.
Referenced by AddFailure(), GetFailures(), and ITEM_MODIFICATION_ROUTINE().
|
private |
Definition at line 210 of file item_modification_routine.h.
Referenced by AddSuccess(), GetSuccesses(), and ITEM_MODIFICATION_ROUTINE().