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

#include <graphics_cleaner.h>

Public Member Functions

 GRAPHICS_CLEANER (const DRAWINGS &aDrawings, FOOTPRINT *aParentFootprint, BOARD_COMMIT &aCommit, TOOL_MANAGER *aToolManager)
 
void CleanupBoard (bool aDryRun, std::vector< std::shared_ptr< CLEANUP_ITEM > > *aItemsList, bool aMergeRects, bool aDeleteRedundant, bool aMergePads, bool aFixBoardOutlines, int aTolerance)
 the cleanup function.
 

Private Member Functions

bool isNullShape (PCB_SHAPE *aShape)
 
bool areEquivalent (PCB_SHAPE *aShape1, PCB_SHAPE *aShape2)
 
void cleanupShapes ()
 
void fixBoardOutlines ()
 
void mergeRects ()
 
void mergePads ()
 

Private Attributes

const DRAWINGS & m_drawings
 
FOOTPRINTm_parentFootprint
 
BOARD_COMMITm_commit
 
TOOL_MANAGERm_toolMgr
 
bool m_dryRun
 
int m_epsilon
 
int m_outlinesTolerance
 
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_itemsList
 

Detailed Description

Definition at line 36 of file graphics_cleaner.h.

Constructor & Destructor Documentation

◆ GRAPHICS_CLEANER()

GRAPHICS_CLEANER::GRAPHICS_CLEANER ( const DRAWINGS &  aDrawings,
FOOTPRINT aParentFootprint,
BOARD_COMMIT aCommit,
TOOL_MANAGER aToolManager 
)

Definition at line 39 of file graphics_cleaner.cpp.

Member Function Documentation

◆ areEquivalent()

◆ CleanupBoard()

void GRAPHICS_CLEANER::CleanupBoard ( bool  aDryRun,
std::vector< std::shared_ptr< CLEANUP_ITEM > > *  aItemsList,
bool  aMergeRects,
bool  aDeleteRedundant,
bool  aMergePads,
bool  aFixBoardOutlines,
int  aTolerance 
)

the cleanup function.

Parameters
aMergeRects= merge for segments forming a rectangle into a rect
aDeleteRedundant= true to delete null graphics and duplicated graphics
aMergePads= true to apply Pad Editor's merge algorithm to all pads in footprint (it is assumed this will only be run on FPEditor boards)

Definition at line 53 of file graphics_cleaner.cpp.

References cleanupShapes(), fixBoardOutlines(), BOARD_COMMIT::GetBoard(), BOARD::GetDesignSettings(), IS_DELETED, m_commit, m_drawings, m_dryRun, m_epsilon, m_itemsList, BOARD_DESIGN_SETTINGS::m_MaxError, m_outlinesTolerance, mergePads(), and mergeRects().

Referenced by DIALOG_CLEANUP_GRAPHICS::doCleanup().

◆ cleanupShapes()

◆ fixBoardOutlines()

void GRAPHICS_CLEANER::fixBoardOutlines ( )
private

◆ isNullShape()

◆ mergePads()

◆ mergeRects()

Member Data Documentation

◆ m_commit

BOARD_COMMIT& GRAPHICS_CLEANER::m_commit
private

◆ m_drawings

const DRAWINGS& GRAPHICS_CLEANER::m_drawings
private

Definition at line 63 of file graphics_cleaner.h.

Referenced by CleanupBoard(), cleanupShapes(), fixBoardOutlines(), and mergeRects().

◆ m_dryRun

bool GRAPHICS_CLEANER::m_dryRun
private

◆ m_epsilon

int GRAPHICS_CLEANER::m_epsilon
private

Definition at line 68 of file graphics_cleaner.h.

Referenced by areEquivalent(), CleanupBoard(), and isNullShape().

◆ m_itemsList

std::vector<std::shared_ptr<CLEANUP_ITEM> >* GRAPHICS_CLEANER::m_itemsList
private

Definition at line 71 of file graphics_cleaner.h.

Referenced by CleanupBoard(), cleanupShapes(), mergePads(), and mergeRects().

◆ m_outlinesTolerance

int GRAPHICS_CLEANER::m_outlinesTolerance
private

Definition at line 69 of file graphics_cleaner.h.

Referenced by CleanupBoard(), and fixBoardOutlines().

◆ m_parentFootprint

FOOTPRINT* GRAPHICS_CLEANER::m_parentFootprint
private

Definition at line 64 of file graphics_cleaner.h.

Referenced by mergePads(), and mergeRects().

◆ m_toolMgr

TOOL_MANAGER* GRAPHICS_CLEANER::m_toolMgr
private

Definition at line 66 of file graphics_cleaner.h.

Referenced by mergePads().


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