|
KiCad PCB EDA Suite
|
Pairwise add dogbone corners to an internal corner. More...
#include <item_modification_routine.h>
Classes | |
| struct | PARAMETERS |
Public Member Functions | |
| DOGBONE_CORNER_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler, PARAMETERS aParams) | |
| wxString | GetCommitDescription () const override |
| std::optional< wxString > | GetStatusMessage (int aSegmentCount) const override |
| Get a status message to show when the routine is complete. | |
| void | ProcessLinePair (PCB_SHAPE &aLineA, PCB_SHAPE &aLineB) override |
| Perform the action on the pair of lines given. | |
| unsigned | GetSuccesses () const |
| unsigned | GetFailures () const |
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 | |
| PARAMETERS | m_params |
| bool | m_haveNarrowMouths |
| BOARD_ITEM * | m_board |
| CHANGE_HANDLER & | m_handler |
| unsigned | m_numSuccesses |
| unsigned | m_numFailures |
Pairwise add dogbone corners to an internal corner.
Definition at line 304 of file item_modification_routine.h.
|
inline |
Definition at line 313 of file item_modification_routine.h.
References m_haveNarrowMouths, m_params, move, and PAIRWISE_LINE_ROUTINE::PAIRWISE_LINE_ROUTINE().
|
inlineprotectedinherited |
Mark that one of the actions failed.
Definition at line 181 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().
|
inlineprotectedinherited |
Mark that one of the actions succeeded.
Definition at line 176 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().
|
inlineprotectedinherited |
The BOARD used when creating new shapes.
Definition at line 171 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(), and LINE_FILLET_ROUTINE::ProcessLinePair().
|
overridevirtual |
Implements ITEM_MODIFICATION_ROUTINE.
Definition at line 253 of file item_modification_routine.cpp.
References _.
|
inlineinherited |
Definition at line 163 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().
|
inlineprotectedinherited |
Access the handler for making changes to the board.
Definition at line 195 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(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().
|
overridevirtual |
Get a status message to show when the routine is complete.
Usually this will be an error or nothing.
Implements PAIRWISE_LINE_ROUTINE.
Definition at line 259 of file item_modification_routine.cpp.
References _, ITEM_MODIFICATION_ROUTINE::GetFailures(), ITEM_MODIFICATION_ROUTINE::GetSuccesses(), m_haveNarrowMouths, and m_params.
|
inlineinherited |
Definition at line 161 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().
|
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 74 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().
|
overridevirtual |
Perform the action on the pair of lines given.
The routine will be called repeatedly with all possible pairs of lines in the selection. The tools should handle the ones it's interested in. This means that the same line can appear multiple times with different partners.
The routine can skip lines that it's not interested in by returning without adding to the success or failure count.
| aLineA | the first line |
| aLineB | the second line |
Implements PAIRWISE_LINE_ROUTINE.
Definition at line 288 of file item_modification_routine.cpp.
References ITEM_MODIFICATION_ROUTINE::AddFailure(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::AddNewItem(), addSegment(), ITEM_MODIFICATION_ROUTINE::AddSuccess(), SEG::Angle(), ARC, ComputeDogbone(), ITEM_MODIFICATION_ROUTINE::GetBoard(), EDA_SHAPE::GetEnd(), ITEM_MODIFICATION_ROUTINE::GetHandler(), PCB_SHAPE::GetLayer(), EDA_SHAPE::GetLength(), EDA_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), EDA_ANGLE::IsHorizontal(), BOARD_ITEM::IsLocked(), m_haveNarrowMouths, m_params, ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength(), and SEGMENT.
|
privateinherited |
Definition at line 198 of file item_modification_routine.h.
Referenced by GetBoard(), and ITEM_MODIFICATION_ROUTINE().
|
privateinherited |
Definition at line 199 of file item_modification_routine.h.
Referenced by GetHandler(), and ITEM_MODIFICATION_ROUTINE().
|
private |
Definition at line 327 of file item_modification_routine.h.
Referenced by DOGBONE_CORNER_ROUTINE(), GetStatusMessage(), and ProcessLinePair().
|
privateinherited |
Definition at line 202 of file item_modification_routine.h.
Referenced by AddFailure(), GetFailures(), and ITEM_MODIFICATION_ROUTINE().
|
privateinherited |
Definition at line 201 of file item_modification_routine.h.
Referenced by AddSuccess(), GetSuccesses(), and ITEM_MODIFICATION_ROUTINE().
|
private |
Definition at line 326 of file item_modification_routine.h.
Referenced by DOGBONE_CORNER_ROUTINE(), GetStatusMessage(), and ProcessLinePair().