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
 
FOOTPRINT * m_parentFootprint
 
BOARD_COMMIT & m_commit
 
TOOL_MANAGER * m_toolMgr
 
bool m_dryRun
 
int m_epsilon
 
int m_maxError
 
int m_outlinesTolerance
 
std::vector< std::shared_ptr< CLEANUP_ITEM > > * m_itemsList
 

Detailed Description

Definition at line 32 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 )

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
aDryRunperforms a dry run clean up if true.
aItemsListis the list of items cleaned up.
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)
aFixBoardOutlinesfixes board outlines one clean up if true.
aTolerance

Definition at line 50 of file graphics_cleaner.cpp.

References cleanupShapes(), fixBoardOutlines(), IS_DELETED, m_commit, m_drawings, m_dryRun, m_epsilon, m_itemsList, m_maxError, m_outlinesTolerance, mergePads(), and mergeRects().

Referenced by DIALOG_CLEANUP_GRAPHICS::doCleanup().

◆ cleanupShapes()

void GRAPHICS_CLEANER::cleanupShapes ( )
private

◆ fixBoardOutlines()

void GRAPHICS_CLEANER::fixBoardOutlines ( )
private

◆ isNullShape()

◆ mergePads()

void GRAPHICS_CLEANER::mergePads ( )
private

◆ mergeRects()

Member Data Documentation

◆ m_commit

BOARD_COMMIT& GRAPHICS_CLEANER::m_commit
private

◆ m_drawings

const DRAWINGS& GRAPHICS_CLEANER::m_drawings
private

◆ m_dryRun

bool GRAPHICS_CLEANER::m_dryRun
private

◆ m_epsilon

int GRAPHICS_CLEANER::m_epsilon
private

Definition at line 69 of file graphics_cleaner.h.

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

◆ m_itemsList

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

◆ m_maxError

int GRAPHICS_CLEANER::m_maxError
private

Definition at line 70 of file graphics_cleaner.h.

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

◆ m_outlinesTolerance

int GRAPHICS_CLEANER::m_outlinesTolerance
private

Definition at line 71 of file graphics_cleaner.h.

Referenced by CleanupBoard(), fixBoardOutlines(), and GRAPHICS_CLEANER().

◆ m_parentFootprint

FOOTPRINT* GRAPHICS_CLEANER::m_parentFootprint
private

Definition at line 65 of file graphics_cleaner.h.

Referenced by GRAPHICS_CLEANER(), mergePads(), and mergeRects().

◆ m_toolMgr

TOOL_MANAGER* GRAPHICS_CLEANER::m_toolMgr
private

Definition at line 67 of file graphics_cleaner.h.

Referenced by GRAPHICS_CLEANER(), and mergePads().


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