KiCad PCB EDA Suite
|
#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_outlinesTolerance |
std::vector< std::shared_ptr< CLEANUP_ITEM > > * | m_itemsList |
Definition at line 36 of file graphics_cleaner.h.
GRAPHICS_CLEANER::GRAPHICS_CLEANER | ( | const DRAWINGS & | aDrawings, |
FOOTPRINT * | aParentFootprint, | ||
BOARD_COMMIT & | aCommit, | ||
TOOL_MANAGER * | aToolManager | ||
) |
Definition at line 39 of file graphics_cleaner.cpp.
Definition at line 124 of file graphics_cleaner.cpp.
References equivalent(), EDA_SHAPE::GetBezierC1(), EDA_SHAPE::GetBezierC2(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), PCB_SHAPE::GetLayer(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), PCB_SHAPE::GetWidth(), m_epsilon, and EDA_SHAPE::SHAPE_T_asString().
Referenced by cleanupShapes().
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.
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().
|
private |
Definition at line 164 of file graphics_cleaner.cpp.
References areEquivalent(), CLEANUP_DUPLICATE_GRAPHIC, CLEANUP_NULL_GRAPHIC, EDA_ITEM::HasFlag(), IS_DELETED, isNullShape(), m_commit, m_drawings, m_dryRun, m_itemsList, COMMIT::Remove(), and EDA_ITEM::SetFlags().
Referenced by CleanupBoard().
|
private |
Definition at line 209 of file graphics_cleaner.cpp.
References COMMIT::Add(), ConnectBoardShapes(), Edge_Cuts, PCB_SHAPE::IsOnLayer(), m_commit, m_drawings, m_dryRun, m_outlinesTolerance, and COMMIT::Modify().
Referenced by CleanupBoard().
|
private |
Definition at line 92 of file graphics_cleaner.cpp.
References ARC_HIGH_DEF, equivalent(), EDA_SHAPE::GetBezierPoints(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetPointCount(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), m_epsilon, EDA_SHAPE::RebuildBezierToSegmentsPointsList(), EDA_SHAPE::SHAPE_T_asString(), and UNIMPLEMENTED_FOR.
Referenced by cleanupShapes(), and mergeRects().
|
private |
Definition at line 383 of file graphics_cleaner.cpp.
References CLEANUP_MERGE_PAD, COMMIT::GetStatus(), TOOL_MANAGER::GetTool(), m_commit, m_dryRun, m_itemsList, m_parentFootprint, m_toolMgr, FOOTPRINT::MapPadNumbersToNetTieGroups(), COMMIT::Modify(), pad, FOOTPRINT::Pads(), and PAD_TOOL::RecombinePad().
Referenced by CleanupBoard().
|
private |
Definition at line 239 of file graphics_cleaner.cpp.
References COMMIT::Add(), CLEANUP_LINES_TO_RECT, EDA_SHAPE::GetEnd(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), IS_DELETED, isNullShape(), left, m_commit, m_drawings, m_dryRun, m_itemsList, m_parentFootprint, COMMIT::Remove(), right, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetFilled(), PCB_SHAPE::SetLayer(), EDA_SHAPE::SetShape(), EDA_SHAPE::SetStart(), PCB_SHAPE::SetStroke(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CleanupBoard().
|
private |
Definition at line 65 of file graphics_cleaner.h.
Referenced by CleanupBoard(), cleanupShapes(), fixBoardOutlines(), mergePads(), and mergeRects().
|
private |
Definition at line 63 of file graphics_cleaner.h.
Referenced by CleanupBoard(), cleanupShapes(), fixBoardOutlines(), and mergeRects().
|
private |
Definition at line 67 of file graphics_cleaner.h.
Referenced by CleanupBoard(), cleanupShapes(), fixBoardOutlines(), mergePads(), and mergeRects().
|
private |
Definition at line 68 of file graphics_cleaner.h.
Referenced by areEquivalent(), CleanupBoard(), and isNullShape().
|
private |
Definition at line 71 of file graphics_cleaner.h.
Referenced by CleanupBoard(), cleanupShapes(), mergePads(), and mergeRects().
|
private |
Definition at line 69 of file graphics_cleaner.h.
Referenced by CleanupBoard(), and fixBoardOutlines().
|
private |
Definition at line 64 of file graphics_cleaner.h.
Referenced by mergePads(), and mergeRects().
|
private |
Definition at line 66 of file graphics_cleaner.h.
Referenced by mergePads().