KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DOGBONE_CORNER_ROUTINE Class Reference

Pairwise add dogbone corners to an internal corner. More...

#include <item_modification_routine.h>

Inheritance diagram for DOGBONE_CORNER_ROUTINE:
PAIRWISE_LINE_ROUTINE ITEM_MODIFICATION_ROUTINE

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_ITEMGetBoard () 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_HANDLERGetHandler ()
 Access the handler for making changes to the board.
 

Private Member Functions

bool EnsureBoardOutline () const
 

Private Attributes

PARAMETERS m_params
 
bool m_haveNarrowMouths
 
bool m_boardOutlineCached = false
 
SHAPE_POLY_SET m_boardOutline
 Cached board outline polygons.
 
BOARD_ITEMm_board
 
CHANGE_HANDLERm_handler
 
unsigned m_numSuccesses
 
unsigned m_numFailures
 

Detailed Description

Pairwise add dogbone corners to an internal corner.

Definition at line 308 of file item_modification_routine.h.

Constructor & Destructor Documentation

◆ DOGBONE_CORNER_ROUTINE()

DOGBONE_CORNER_ROUTINE::DOGBONE_CORNER_ROUTINE ( BOARD_ITEM * aBoard,
CHANGE_HANDLER & aHandler,
PARAMETERS aParams )
inline

Member Function Documentation

◆ AddFailure()

void ITEM_MODIFICATION_ROUTINE::AddFailure ( )
inlineprotectedinherited

◆ AddSuccess()

void ITEM_MODIFICATION_ROUTINE::AddSuccess ( )
inlineprotectedinherited

◆ EnsureBoardOutline()

bool DOGBONE_CORNER_ROUTINE::EnsureBoardOutline ( ) const
private

◆ GetBoard()

◆ GetCommitDescription()

wxString DOGBONE_CORNER_ROUTINE::GetCommitDescription ( ) const
overridevirtual

Implements ITEM_MODIFICATION_ROUTINE.

Definition at line 261 of file item_modification_routine.cpp.

References _.

◆ GetFailures()

◆ GetHandler()

◆ GetStatusMessage()

std::optional< wxString > DOGBONE_CORNER_ROUTINE::GetStatusMessage ( int aSegmentCount) const
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 267 of file item_modification_routine.cpp.

References _, ITEM_MODIFICATION_ROUTINE::GetFailures(), ITEM_MODIFICATION_ROUTINE::GetSuccesses(), m_haveNarrowMouths, and m_params.

◆ GetSuccesses()

◆ ModifyLineOrDeleteIfZeroLength()

bool ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength ( PCB_SHAPE & aItem,
const std::optional< SEG > & aSeg )
protectedinherited

Helper function useful for multiple tools: modify a line or delete it if it has zero length.

Parameters
aItemthe line to modify
aSegthe new line geometry

Definition at line 81 of file item_modification_routine.cpp.

References ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), GetHandler(), EDA_SHAPE::GetShape(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::MarkItemModified(), SEGMENT, EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().

Referenced by DOGBONE_CORNER_ROUTINE::ProcessLinePair(), LINE_CHAMFER_ROUTINE::ProcessLinePair(), and LINE_FILLET_ROUTINE::ProcessLinePair().

◆ ProcessLinePair()

void DOGBONE_CORNER_ROUTINE::ProcessLinePair ( PCB_SHAPE & aLineA,
PCB_SHAPE & aLineB )
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.

Parameters
aLineAthe first line
aLineBthe second line
Returns
did the action succeed

Implements PAIRWISE_LINE_ROUTINE.

Definition at line 297 of file item_modification_routine.cpp.

References SEG::A, ITEM_MODIFICATION_ROUTINE::AddFailure(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::AddNewItem(), addSegment(), ITEM_MODIFICATION_ROUTINE::AddSuccess(), SEG::Angle(), ARC, SEG::B, ComputeDogbone(), EnsureBoardOutline(), VECTOR2< T >::EuclideanNorm(), 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_boardOutline, m_haveNarrowMouths, m_params, ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength(), VECTOR2< T >::Resize(), SEGMENT, VECTOR2< T >::x, and VECTOR2< T >::y.

Member Data Documentation

◆ m_board

BOARD_ITEM* ITEM_MODIFICATION_ROUTINE::m_board
privateinherited

Definition at line 202 of file item_modification_routine.h.

Referenced by GetBoard(), and ITEM_MODIFICATION_ROUTINE().

◆ m_boardOutline

SHAPE_POLY_SET DOGBONE_CORNER_ROUTINE::m_boardOutline
mutableprivate

Cached board outline polygons.

Definition at line 336 of file item_modification_routine.h.

Referenced by EnsureBoardOutline(), and ProcessLinePair().

◆ m_boardOutlineCached

bool DOGBONE_CORNER_ROUTINE::m_boardOutlineCached = false
mutableprivate

Definition at line 335 of file item_modification_routine.h.

Referenced by EnsureBoardOutline().

◆ m_handler

CHANGE_HANDLER& ITEM_MODIFICATION_ROUTINE::m_handler
privateinherited

Definition at line 203 of file item_modification_routine.h.

Referenced by GetHandler(), and ITEM_MODIFICATION_ROUTINE().

◆ m_haveNarrowMouths

bool DOGBONE_CORNER_ROUTINE::m_haveNarrowMouths
private

◆ m_numFailures

unsigned ITEM_MODIFICATION_ROUTINE::m_numFailures
privateinherited

Definition at line 206 of file item_modification_routine.h.

Referenced by AddFailure(), GetFailures(), and ITEM_MODIFICATION_ROUTINE().

◆ m_numSuccesses

unsigned ITEM_MODIFICATION_ROUTINE::m_numSuccesses
privateinherited

◆ m_params

PARAMETERS DOGBONE_CORNER_ROUTINE::m_params
private

The documentation for this class was generated from the following files: