KiCad PCB EDA Suite
|
#include <item_modification_routine.h>
Classes | |
struct | PARAMETERS |
Public Member Functions | |
OUTSET_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler, const PARAMETERS &aParams) | |
wxString | GetCommitDescription () const override |
std::optional< wxString > | GetStatusMessage () const override |
Get a status message to show when the routine is complete. | |
void | ProcessItem (BOARD_ITEM &aItem) |
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 | |
const PARAMETERS | m_params |
BOARD_ITEM * | m_board |
CHANGE_HANDLER & | m_handler |
unsigned | m_numSuccesses |
unsigned | m_numFailures |
Definition at line 414 of file item_modification_routine.h.
|
inline |
Definition at line 429 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(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::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 ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), and POLYGON_BOOLEAN_ROUTINE::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 POLYGON_BOOLEAN_ROUTINE::Finalize(), ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and DOGBONE_CORNER_ROUTINE::ProcessLinePair().
|
overridevirtual |
Implements ITEM_MODIFICATION_ROUTINE.
Definition at line 664 of file item_modification_routine.cpp.
References _.
|
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(), DOGBONE_CORNER_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), POLYGON_INTERSECT_ROUTINE::GetStatusMessage(), and 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 POLYGON_BOOLEAN_ROUTINE::Finalize(), ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength(), ProcessItem(), LINE_FILLET_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), LINE_EXTENSION_ROUTINE::ProcessLinePair(), DOGBONE_CORNER_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 ITEM_MODIFICATION_ROUTINE.
Definition at line 669 of file item_modification_routine.cpp.
References _, ITEM_MODIFICATION_ROUTINE::GetFailures(), and ITEM_MODIFICATION_ROUTINE::GetSuccesses().
|
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(), DOGBONE_CORNER_ROUTINE::GetStatusMessage(), POLYGON_MERGE_ROUTINE::GetStatusMessage(), POLYGON_SUBTRACT_ROUTINE::GetStatusMessage(), POLYGON_INTERSECT_ROUTINE::GetStatusMessage(), and GetStatusMessage().
|
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 76 of file item_modification_routine.cpp.
References ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), ITEM_MODIFICATION_ROUTINE::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().
void OUTSET_ROUTINE::ProcessItem | ( | BOARD_ITEM & | aItem | ) |
Definition at line 692 of file item_modification_routine.cpp.
References SEG::A, ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::AddNewItem(), ITEM_MODIFICATION_ROUTINE::AddSuccess(), PADSTACK::ALL_LAYERS, ANGLE_180, ANGLE_90, SHAPE_LINE_CHAIN::Append(), SEG::B, KIGEOM::ConvertToChain(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), OUTSET_ROUTINE::PARAMETERS::deleteSourceItems, EDA_SHAPE::GetArcAngle(), SHAPE_ARC::GetArcMid(), ITEM_MODIFICATION_ROUTINE::GetBoard(), GetBoardItemWidth(), SHAPE_ARC::GetCenter(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), ITEM_MODIFICATION_ROUTINE::GetHandler(), SHAPE_RECT::GetHeight(), BOARD_ITEM::GetLayer(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_RECT::GetPosition(), PCB_SHAPE::GetPosition(), EDA_SHAPE::GetRadius(), SHAPE_ARC::GetRadius(), EDA_SHAPE::GetRectangleHeight(), EDA_SHAPE::GetRectangleWidth(), GetRectRoundedToGridOutwards(), GetRotated(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), SHAPE_RECT::GetWidth(), OUTSET_ROUTINE::PARAMETERS::gridRounding, OUTSET_ROUTINE::PARAMETERS::layer, SEG::Length(), OUTSET_ROUTINE::PARAMETERS::lineWidth, m_params, OUTSET_ROUTINE::PARAMETERS::outsetDistance, pad, PCB_PAD_T, PCB_SHAPE_T, VECTOR2< T >::Resize(), SHAPE_POLY_SET::Rotate(), OUTSET_ROUTINE::PARAMETERS::roundCorners, SHAPE_LINE_CHAIN::SetClosed(), ROUNDRECT::TransformToPolygon(), EDA_ITEM::Type(), OUTSET_ROUTINE::PARAMETERS::useSourceLayers, OUTSET_ROUTINE::PARAMETERS::useSourceWidths, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 441 of file item_modification_routine.h.
Referenced by ProcessItem().