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

#include <item_modification_routine.h>

Inheritance diagram for POLYGON_INTERSECT_ROUTINE:
POLYGON_BOOLEAN_ROUTINE ITEM_MODIFICATION_ROUTINE

Public Member Functions

 POLYGON_INTERSECT_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler)
 
bool IsCommutative () const override
 False if the order of the polygons matters.
 
wxString GetCommitDescription () const override
 
std::optional< wxString > GetStatusMessage () const override
 Get a status message to show when the routine is complete.
 
void ProcessShape (PCB_SHAPE &aPcbShape)
 
void Finalize ()
 Clear up any outstanding work.
 
unsigned GetSuccesses () const
 
unsigned GetFailures () const
 

Protected Member Functions

SHAPE_POLY_SETGetWorkingPolygons ()
 
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 ProcessSubsequentPolygon (const SHAPE_POLY_SET &aPolygon) override
 

Private Attributes

SHAPE_POLY_SET m_workingPolygons
 This can be disjoint, which will be fixed at the end.
 
bool m_firstPolygon = true
 
int m_width = 0
 
PCB_LAYER_ID m_layer = PCB_LAYER_ID::UNDEFINED_LAYER
 
FILL_T m_fillMode = FILL_T::NO_FILL
 
BOARD_ITEMm_board
 
CHANGE_HANDLERm_handler
 
unsigned m_numSuccesses
 
unsigned m_numFailures
 

Detailed Description

Definition at line 421 of file item_modification_routine.h.

Constructor & Destructor Documentation

◆ POLYGON_INTERSECT_ROUTINE()

POLYGON_INTERSECT_ROUTINE::POLYGON_INTERSECT_ROUTINE ( BOARD_ITEM * aBoard,
CHANGE_HANDLER & aHandler )
inline

Member Function Documentation

◆ AddFailure()

void ITEM_MODIFICATION_ROUTINE::AddFailure ( )
inlineprotectedinherited

◆ AddSuccess()

void ITEM_MODIFICATION_ROUTINE::AddSuccess ( )
inlineprotectedinherited

◆ Finalize()

void POLYGON_BOOLEAN_ROUTINE::Finalize ( )
inherited

◆ GetBoard()

◆ GetCommitDescription()

wxString POLYGON_INTERSECT_ROUTINE::GetCommitDescription ( ) const
overridevirtual

Implements ITEM_MODIFICATION_ROUTINE.

Definition at line 701 of file item_modification_routine.cpp.

References _.

◆ GetFailures()

◆ GetHandler()

◆ GetStatusMessage()

std::optional< wxString > POLYGON_INTERSECT_ROUTINE::GetStatusMessage ( ) const
overridevirtual

Get a status message to show when the routine is complete.

Usually this will be an error or nothing.

Implements POLYGON_BOOLEAN_ROUTINE.

Definition at line 707 of file item_modification_routine.cpp.

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

◆ GetSuccesses()

◆ GetWorkingPolygons()

SHAPE_POLY_SET & POLYGON_BOOLEAN_ROUTINE::GetWorkingPolygons ( )
inlineprotectedinherited

◆ IsCommutative()

bool POLYGON_INTERSECT_ROUTINE::IsCommutative ( ) const
inlineoverridevirtual

False if the order of the polygons matters.

Implements POLYGON_BOOLEAN_ROUTINE.

Definition at line 429 of file item_modification_routine.h.

◆ 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().

◆ ProcessShape()

◆ ProcessSubsequentPolygon()

bool POLYGON_INTERSECT_ROUTINE::ProcessSubsequentPolygon ( const SHAPE_POLY_SET & aPolygon)
overrideprivatevirtual

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_fillMode

FILL_T POLYGON_BOOLEAN_ROUTINE::m_fillMode = FILL_T::NO_FILL
privateinherited

Definition at line 382 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ m_firstPolygon

bool POLYGON_BOOLEAN_ROUTINE::m_firstPolygon = true
privateinherited

Definition at line 379 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ 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_layer

PCB_LAYER_ID POLYGON_BOOLEAN_ROUTINE::m_layer = PCB_LAYER_ID::UNDEFINED_LAYER
privateinherited

Definition at line 381 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ 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_width

int POLYGON_BOOLEAN_ROUTINE::m_width = 0
privateinherited

Definition at line 380 of file item_modification_routine.h.

Referenced by Finalize(), and ProcessShape().

◆ m_workingPolygons

SHAPE_POLY_SET POLYGON_BOOLEAN_ROUTINE::m_workingPolygons
privateinherited

This can be disjoint, which will be fixed at the end.

Definition at line 377 of file item_modification_routine.h.

Referenced by Finalize(), GetWorkingPolygons(), and ProcessShape().


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