KiCad PCB EDA Suite
Loading...
Searching...
No Matches
POLYGON_BOOLEAN_ROUTINE Class Referenceabstract

A routine that modifies polygons using boolean operations. More...

#include <item_modification_routine.h>

Inheritance diagram for POLYGON_BOOLEAN_ROUTINE:
ITEM_MODIFICATION_ROUTINE POLYGON_INTERSECT_ROUTINE POLYGON_MERGE_ROUTINE POLYGON_SUBTRACT_ROUTINE

Public Member Functions

 POLYGON_BOOLEAN_ROUTINE (BOARD_ITEM *aBoard, CHANGE_HANDLER &aHandler)
 
void ProcessShape (PCB_SHAPE &aPcbShape)
 
unsigned GetSuccesses () const
 
unsigned GetFailures () const
 
virtual wxString GetCommitDescription () const =0
 
virtual std::optional< wxString > GetStatusMessage () const =0
 Get a status message to show when the routine is complete.
 

Protected Member Functions

PCB_SHAPEGetWorkingPolygon () const
 
virtual bool ProcessSubsequentPolygon (const SHAPE_POLY_SET &aPolygon)=0
 
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 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 Attributes

PCB_SHAPEm_workingPolygon
 
BOARD_ITEMm_board
 
CHANGE_HANDLERm_handler
 
unsigned m_numSuccesses
 
unsigned m_numFailures
 

Detailed Description

A routine that modifies polygons using boolean operations.

Definition at line 308 of file item_modification_routine.h.

Constructor & Destructor Documentation

◆ POLYGON_BOOLEAN_ROUTINE()

POLYGON_BOOLEAN_ROUTINE::POLYGON_BOOLEAN_ROUTINE ( BOARD_ITEM aBoard,
CHANGE_HANDLER aHandler 
)
inline

Definition at line 311 of file item_modification_routine.h.

Member Function Documentation

◆ AddFailure()

void ITEM_MODIFICATION_ROUTINE::AddFailure ( )
inlineprotectedinherited

◆ AddSuccess()

void ITEM_MODIFICATION_ROUTINE::AddSuccess ( )
inlineprotectedinherited

◆ GetBoard()

BOARD_ITEM * ITEM_MODIFICATION_ROUTINE::GetBoard ( ) const
inlineprotectedinherited

◆ GetCommitDescription()

virtual wxString ITEM_MODIFICATION_ROUTINE::GetCommitDescription ( ) const
pure virtualinherited

◆ GetFailures()

◆ GetHandler()

CHANGE_HANDLER & ITEM_MODIFICATION_ROUTINE::GetHandler ( )
inlineprotectedinherited

◆ GetStatusMessage()

virtual std::optional< wxString > ITEM_MODIFICATION_ROUTINE::GetStatusMessage ( ) const
pure virtualinherited

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

Usually this will be an error or nothing.

Implemented in LINE_FILLET_ROUTINE, LINE_CHAMFER_ROUTINE, LINE_EXTENSION_ROUTINE, POLYGON_MERGE_ROUTINE, POLYGON_SUBTRACT_ROUTINE, and POLYGON_INTERSECT_ROUTINE.

◆ GetSuccesses()

◆ GetWorkingPolygon()

PCB_SHAPE * POLYGON_BOOLEAN_ROUTINE::GetWorkingPolygon ( ) const
inlineprotected

◆ ModifyLineOrDeleteIfZeroLength()

bool ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength ( PCB_SHAPE aItem,
const 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 41 of file item_modification_routine.cpp.

References SEG::A, SEG::B, ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem(), ITEM_MODIFICATION_ROUTINE::GetHandler(), EDA_SHAPE::GetShape(), SEG::Length(), ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::MarkItemModified(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().

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

◆ ProcessShape()

◆ ProcessSubsequentPolygon()

virtual bool POLYGON_BOOLEAN_ROUTINE::ProcessSubsequentPolygon ( const SHAPE_POLY_SET aPolygon)
protectedpure virtual

Member Data Documentation

◆ m_board

BOARD_ITEM* ITEM_MODIFICATION_ROUTINE::m_board
privateinherited

Definition at line 209 of file item_modification_routine.h.

Referenced by ITEM_MODIFICATION_ROUTINE::GetBoard().

◆ m_handler

CHANGE_HANDLER& ITEM_MODIFICATION_ROUTINE::m_handler
privateinherited

Definition at line 210 of file item_modification_routine.h.

Referenced by ITEM_MODIFICATION_ROUTINE::GetHandler().

◆ m_numFailures

unsigned ITEM_MODIFICATION_ROUTINE::m_numFailures
privateinherited

◆ m_numSuccesses

unsigned ITEM_MODIFICATION_ROUTINE::m_numSuccesses
privateinherited

◆ m_workingPolygon

PCB_SHAPE* POLYGON_BOOLEAN_ROUTINE::m_workingPolygon
private

Definition at line 324 of file item_modification_routine.h.

Referenced by GetWorkingPolygon(), and ProcessShape().


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