29 using namespace std::placeholders;
33 #include <clipper.hpp> 68 SetTitle(
_(
"Select" ) );
103 m_subtractive( false ),
104 m_exclusive_or( false ),
106 m_skip_heuristics( false ),
107 m_enteredGroup( nullptr ),
108 m_priv(
std::make_unique<
PRIV>() )
133 auto frame = getEditFrame<PCB_BASE_FRAME>();
142 auto selectMenu = std::make_shared<SELECT_MENU>();
143 selectMenu->SetTool(
this );
148 auto activeToolCondition =
154 auto inGroupCondition =
163 menu.AddSeparator( 1000 );
169 menu.AddSeparator( 1 );
180 m_frame = getEditFrame<PCB_BASE_FRAME>();
259 bool highlight_modifier = evt->Modifier(
MD_CTRL )
260 && evt->Modifier(
MD_ALT )
268 !evt->Modifier(
MD_ALT ) &&
281 bool highlight_modifier = evt->Modifier(
MD_CTRL )
283 && !evt->Modifier(
MD_ALT );
299 if( highlight_modifier && brd_editor )
310 bool selectionCancelled =
false;
314 selectPoint( evt->Position(),
false, &selectionCancelled );
318 if( !selectionCancelled )
321 else if( evt->IsDblClick(
BUT_LEFT ) )
371 auto zoneFilledAreaFilter =
375 wxPoint location = wxPoint( aWhere );
376 int accuracy =
KiROUND( 5 * aCollector.GetGuide()->OnePixelInIU() );
377 std::set<EDA_ITEM*> remove;
383 ZONE* zone = static_cast<ZONE*>( item );
387 remove.insert( zone );
392 aCollector.Remove( item );
425 else if( evt->IsCancel() )
434 if( evt->FirstResponder() == this )
446 if( !modifier_enabled
449 && evt->HasPosition()
478 "EnterGroup called when selection is not a single group" );
520 bool aConfirmLockedItems )
533 enum DISPOSITION { BEFORE = 1, AFTER, BOTH };
535 std::map<EDA_ITEM*, DISPOSITION> itemDispositions;
541 itemDispositions[ item ] = BEFORE;
544 aClientFilter(
VECTOR2I(), collector,
this );
548 if( itemDispositions.count( item ) )
549 itemDispositions[ item ] = BOTH;
551 itemDispositions[ item ] = AFTER;
559 for( std::pair<EDA_ITEM* const, DISPOSITION> itemDisposition : itemDispositions )
561 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( itemDisposition.first );
562 DISPOSITION disposition = itemDisposition.second;
564 if( disposition == BEFORE )
570 for( std::pair<EDA_ITEM* const, DISPOSITION> itemDisposition : itemDispositions )
572 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( itemDisposition.first );
573 DISPOSITION disposition = itemDisposition.second;
575 if( disposition == AFTER )
579 else if( disposition == BOTH )
588 if( aConfirmLockedItems )
590 std::vector<BOARD_ITEM*> lockedItems;
594 BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
598 PCB_GROUP* group = static_cast<PCB_GROUP*>( boardItem );
599 bool lockedDescendant =
false;
605 lockedDescendant =
true;
608 if( lockedDescendant )
609 lockedItems.push_back( group );
613 lockedItems.push_back( boardItem );
617 if( !lockedItems.empty() )
621 switch( dlg.ShowModal() )
674 bool* aSelectionCancelledFlag,
688 (wxPoint) aWhere, guide );
691 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
693 if( !
Selectable( collector[ i ] ) || ( aOnDrag && collector[i]->IsLocked() ) )
702 aClientFilter( aWhere, collector,
this );
721 if( aSelectionCancelledFlag )
722 *aSelectionCancelledFlag =
true;
728 bool anyAdded =
false;
729 bool anySubtracted =
false;
736 anySubtracted =
true;
742 for(
int i = 0; i < collector.
GetCount(); ++i )
747 anySubtracted =
true;
762 else if( anySubtracted )
786 bool cancelled =
false;
793 bool anyAdded =
false;
794 bool anySubtracted =
false;
804 bool windowSelection = width >= 0 ? true :
false;
807 windowSelection = !windowSelection;
812 if( evt->IsCancelInteractive() || evt->IsActivate() )
824 anySubtracted =
true;
831 area.
SetEnd( evt->Position() );
848 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> candidates;
861 for(
auto it = candidates.begin(), it_end = candidates.end(); it != it_end; ++it )
863 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( it->first );
865 if( item &&
Selectable( item ) && item->
HitTest( selectionRect, windowSelection ) )
876 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( i );
881 anySubtracted =
true;
895 else if( anySubtracted )
937 std::vector<BOARD_ITEM*>* items = aEvent.
Parameter<std::vector<BOARD_ITEM*>*>();
964 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
970 view->
Query( selectionBox, selectedItems );
974 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( item_pair.first );
1003 std::vector<BOARD_ITEM*>* items = aEvent.
Parameter<std::vector<BOARD_ITEM*>*>();
1008 for(
auto item : *items )
1054 std::set<int> representedNets;
1056 for(
int i = aCollector.
GetCount() - 1; i >= 0; i-- )
1061 else if ( representedNets.count( item->
GetNetCode() ) )
1064 representedNets.insert( item->
GetNetCode() );
1071 unsigned initialCount = 0;
1075 if( dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
1079 if( initialCount == 0 )
1087 for(
EDA_ITEM* item : selectedItems )
1088 item->ClearTempFlags();
1090 for(
EDA_ITEM* item : selectedItems )
1092 TRACK* trackItem = dynamic_cast<TRACK*>( item );
1117 auto connectedItems = connectivity->GetConnectedItems( &aStartItem, types,
true );
1119 std::map<wxPoint, std::vector<TRACK*>> trackMap;
1120 std::map<wxPoint, VIA*> viaMap;
1121 std::map<wxPoint, PAD*> padMap;
1126 switch( item->Type() )
1131 TRACK* track = static_cast<TRACK*>( item );
1132 trackMap[ track->
GetStart() ].push_back( track );
1133 trackMap[ track->
GetEnd() ].push_back( track );
1139 VIA* via = static_cast<VIA*>( item );
1146 PAD* pad = static_cast<PAD*>( item );
1158 std::vector<wxPoint> activePts;
1161 switch( aStartItem.
Type() )
1165 activePts.push_back( static_cast<TRACK*>( &aStartItem )->GetStart() );
1166 activePts.push_back( static_cast<TRACK*>( &aStartItem )->GetEnd() );
1170 activePts.push_back( static_cast<TRACK*>( &aStartItem )->GetStart() );
1188 for(
int i = activePts.size() - 1; i >= 0; --i )
1190 wxPoint pt = activePts[i];
1191 size_t pt_count = trackMap[ pt ].size() + viaMap.count( pt );
1195 activePts.erase( activePts.begin() + i );
1199 if( padMap.count( pt ) && aStopCondition !=
STOP_NEVER )
1201 activePts.erase( activePts.begin() + i );
1205 for(
TRACK* track : trackMap[ pt ] )
1213 if( track->GetStart() == pt )
1214 activePts.push_back( track->GetEnd() );
1216 activePts.push_back( track->GetStart() );
1221 if( viaMap.count( pt ) && !viaMap[ pt ]->IsSelected() && aStopCondition !=
STOP_AT_JUNCTION )
1224 activePts.erase( activePts.begin() + i );
1246 int netcode = aEvent.
Parameter<intptr_t>();
1278 std::list<FOOTPRINT*> footprintList;
1288 if( aSheetPath.IsEmpty() )
1291 if( footprint_path == aSheetPath )
1296 std::list<int> netcodeList;
1297 std::list<PAD*> padList;
1303 if( pad->IsConnected() )
1305 netcodeList.push_back( pad->GetNetCode() );
1306 padList.push_back( pad );
1312 netcodeList.unique();
1314 for(
PAD* pad : padList )
1319 std::list<int> removeCodeList;
1322 for(
int netCode : netcodeList )
1331 removeCodeList.push_back( netCode );
1338 removeCodeList.sort();
1339 removeCodeList.unique();
1341 for(
int removeCode : removeCodeList )
1343 netcodeList.remove( removeCode );
1346 std::list<BOARD_CONNECTED_ITEM*> localConnectionList;
1349 for(
int netCode : netcodeList )
1352 localConnectionList.push_back( item );
1376 screenSize.
x = std::max( 10.0, screenSize.
x );
1377 screenSize.
y = std::max( 10.0, screenSize.
y );
1379 if( selectionBox.GetWidth() != 0 || selectionBox.GetHeight() != 0 )
1381 VECTOR2D vsize = selectionBox.GetSize();
1383 fabs( vsize.
y / screenSize.
y ) );
1396 wxString sheetPath = *aEvent.
Parameter<wxString*>();
1434 if( sheetPath.IsEmpty() )
1449 bool cleared =
false;
1496 bool include =
true;
1502 switch( aItem.
Type() )
1506 const FOOTPRINT& footprint = static_cast<const FOOTPRINT&>( aItem );
1560 const int cmd = dlg.ShowModal();
1562 if( cmd != wxID_OK )
1573 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( i );
1591 std::set<BOARD_ITEM*> rejected;
1595 BOARD_ITEM* item = static_cast<BOARD_ITEM*>( i );
1598 rejected.insert( item );
1602 aCollector.Remove( item );
1611 switch( aItem->
Type() )
1641 ZONE* zone = static_cast<ZONE*>( aItem );
1710 bool enteredGroupFound =
false;
1713 [&](
EDA_ITEM* item,
void* testData )
1729 enteredGroupFound =
true;
1742 if( !enteredGroupFound )
1764 bool selectAll =
false;
1765 bool expandSelection =
false;
1773 if( expandSelection )
1776 expandSelection =
false;
1778 int limit = std::min( 9, aCollector->
GetCount() );
1781 for(
int i = 0; i < limit; ++i )
1791 menu.AppendSeparator();
1792 menu.Add(
_(
"Select &All\tA" ), limit + 1,
nullptr );
1795 menu.Add(
_(
"&Expand Selection\tE" ), limit + 2,
nullptr );
1801 menu.DisplayTitle(
true );
1805 menu.DisplayTitle(
false );
1816 for(
int i = 0; i < aCollector->
GetCount(); ++i )
1822 int id = *evt->GetCommandId();
1825 if(
id > 0 &&
id <= limit )
1827 current = ( *aCollector )[
id - 1];
1834 if(
id == limit + 1 )
1836 for(
int i = 0; i < aCollector->
GetCount(); ++i )
1847 for(
int i = 0; i < aCollector->
GetCount(); ++i )
1856 if(
id == limit + 1 )
1861 else if(
id == limit + 2 )
1863 expandSelection =
true;
1868 else if(
id && ( *
id > 0 ) && ( *
id <= limit ) )
1871 current = ( *aCollector )[*
id - 1];
1884 }
while( expandSelection );
1892 aCollector->
Empty();
1893 aCollector->
Append( current );
1908 bool onActiveLayer =
false;
1910 for(
unsigned int layer : activeLayers )
1913 if( layer < PCB_LAYER_ID_COUNT && aItem->IsOnLayer(
ToLAYER_ID( layer ) ) )
1915 onActiveLayer =
true;
1920 if( !onActiveLayer )
1956 PCB_GROUP* group = const_cast<PCB_GROUP*>( static_cast<const PCB_GROUP*>( aItem ) );
1969 const ZONE* zone =
nullptr;
1970 const VIA* via =
nullptr;
1971 const PAD* pad =
nullptr;
1973 switch( aItem->
Type() )
1980 zone = static_cast<const ZONE*>( aItem );
1986 && !checkVisibilityOnly )
2019 via = static_cast<const VIA*>( aItem );
2053 if( !checkVisibilityOnly )
2073 pad = static_cast<const PAD*>( aItem );
2140 aGroup->
Add( aItem );
2164 static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
2172 static_cast<PCB_GROUP*>( aItem )->RunOnChildren(
2208 static_cast<FOOTPRINT*>( aItem )->RunOnChildren(
2216 static_cast<PCB_GROUP*>( aItem )->RunOnChildren(
2237 (wxPoint) aPoint, guide );
2239 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
2252 int aMaxDistance )
const 2257 SEG loc( aWhere, aWhere );
2259 switch( aItem->
Type() )
2263 PCB_TEXT* text = static_cast<PCB_TEXT*>( aItem );
2270 FP_TEXT* text = static_cast<FP_TEXT*>( aItem );
2277 ZONE* zone = static_cast<ZONE*>( aItem );
2304 PCB_MARKER* marker = static_cast<PCB_MARKER*>( aItem );
2315 PCB_GROUP* group = static_cast<PCB_GROUP*>( aItem );
2347 std::set<BOARD_ITEM*> preferred;
2348 std::set<BOARD_ITEM*> rejected;
2349 wxPoint where( aWhere.
x, aWhere.
y );
2354 if( silkLayers[activeLayer] )
2356 for(
int i = 0; i < aCollector.
GetCount(); ++i )
2364 preferred.insert( item );
2368 if( preferred.size() > 0 )
2373 aCollector.
Append( item );
2381 constexpr
int MAX_SLOP = 5;
2384 int minSlop = INT_MAX;
2386 std::map<BOARD_ITEM*, int> itemsBySloppiness;
2388 for(
int i = 0; i < aCollector.
GetCount(); ++i )
2393 itemsBySloppiness[ item ] = itemSlop;
2395 if( itemSlop < minSlop )
2401 if( minSlop < INT_MAX )
2403 for( std::pair<BOARD_ITEM*, int> pair : itemsBySloppiness )
2405 if( pair.second > minSlop + pixel )
2413 constexpr
double sizeRatio = 1.3;
2415 std::vector<std::pair<BOARD_ITEM*, double>> itemsByArea;
2417 for(
int i = 0; i < aCollector.
GetCount(); ++i )
2423 && static_cast<ZONE*>( item )->HitTestForEdge( where, MAX_SLOP * pixel / 2 ) )
2432 area =
SEG::Square( static_cast<VIA*>( item )->GetDrill() / 2 );
2440 catch(
const ClipperLib::clipperException& e )
2442 wxLogError(
"A clipper exception %s was detected.", e.what() );
2446 itemsByArea.emplace_back( item, area );
2449 std::sort( itemsByArea.begin(), itemsByArea.end(),
2450 [](
const std::pair<BOARD_ITEM*, double>& lhs,
2451 const std::pair<BOARD_ITEM*, double>& rhs ) ->
bool 2453 return lhs.second < rhs.second;
2456 bool rejecting =
false;
2458 for(
int i = 1; i < (int) itemsByArea.size(); ++i )
2460 if( itemsByArea[i].second > itemsByArea[i-1].second * sizeRatio )
2464 rejected.insert( itemsByArea[i].first );
2470 constexpr
double maxCoverRatio = 0.70;
2472 for(
int i = 0; i < aCollector.
GetCount(); ++i )
2483 if( (
unsigned) aCollector.
GetCount() > rejected.size() )
2493 std::unordered_set<BOARD_ITEM*> toAdd;
2496 for(
int j = 0; j < aCollector.
GetCount(); )
2514 toAdd.insert( aTop );
2515 aCollector.
Remove( item );
2522 aCollector.
Remove( item );
2531 if( !aCollector.
HasItem( item ) )
2532 aCollector.
Append( item );
2549 CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
2551 if( conditionalMenu )
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
void Empty()
Clear the list.
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectionActivate
Activation of the selection tool.
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
void ClearReferencePoint()
const std::set< unsigned int > GetHighContrastLayers() const
Returns the set of currently high-contrast layers.
const wxPoint & GetPos() const
Filled polygons are shown.
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
void SetIgnoreTracks(bool ignore)
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
static const KICAD_T FootprintItems[]
A scan list for primary footprint items.
static const TOOL_EVENT SelectedEvent
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
void SetEnd(VECTOR2I aEnd)
Set the current end of the rectangle (the corner that moves with the cursor.
static TOOL_ACTION move
move or drag an item
void SetOnePixelInIU(double aValue)
class ALIGNED_DIMENSION, a linear dimension (graphic item)
virtual void Clear() override
Remove all the stored items from the group.
void ForceRefresh()
Force a redraw.
class LEADER, a leader dimension (graphic item)
bool otherItems
Anything not fitting one of the above categories.
static TOOL_ACTION groupLeave
class FP_TEXT, text in a footprint
static const KICAD_T AllBoardItems[]
A scan list for all editable board items.
void SetIgnoreBlindBuriedVias(bool ignore)
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
static bool WithinScope(BOARD_ITEM *item, PCB_GROUP *scope)
multilayer pads, usually with holes
static const TOOL_EVENT UnselectedEvent
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
class PCB_GROUP, a set of BOARD_ITEMs
void SetOrigin(VECTOR2I aOrigin)
const wxPoint & GetStart() const
A set of BOARD_ITEMs (i.e., without duplicates).
void Collect(BOARD_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
virtual double OnePixelInIU() const =0
void SetIgnoreModulesVals(bool ignore)
void SetIgnoreMicroVias(bool ignore)
Control for copper zone opacity/visibility (color ignored)
class CENTER_DIMENSION, a center point marking (graphic item)
void SetIgnoreModulesOnBack(bool ignore)
static TOOL_ACTION unselectItem
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
the 3d code uses this value
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
static TOOL_ACTION dragFreeAngle
void Move(const VECTOR2I &aVector) override
static TOOL_ACTION unselectItems
static TOOL_ACTION cancelInteractive
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
static TOOL_ACTION properties
Activation of the edit tool.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
static TOOL_ACTION zoomFitScreen
class PCB_TEXT, text on a layer
void SetIgnoreModulesRefs(bool ignore)
LSET GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings Returns a bit-mask of all t...
static TOOL_ACTION selectionMenu
Run a selection menu to select from a list of items.
static TOOL_ACTION selectConnection
Select tracks between junctions or expands an existing selection to pads or the entire connection.
class ARC, an arc track segment on a copper layer
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
void SetExclusiveOr(bool aExclusiveOr)
show footprints values (when texts are visibles)
static TOOL_ACTION drag45Degree
class FP_SHAPE, a footprint edge
class PAD, a pad in a footprint
double OnePixelInIU() const override
virtual void Clear()
Remove all the stored items from the group.
static TOOL_ACTION zoomFitObjects
Struct that will be set with the result of the user choices in the dialog.
const EDA_RECT GetBoundingBox() const override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
virtual wxPoint GetPosition() const
like PAD_PTH, but not plated mechanical use only, no connection allowed
static SEG::ecoord Square(int a)
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
std::unordered_set< BOARD_ITEM * > & GetItems()
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
bool Contains(const wxPoint &aPoint) const
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
bool HitTestForCorner(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForCorner tests if the given wxPoint is near a corner.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
class TRACK, a track segment (segment on a copper layer)
void SetIsHover(bool aIsHover)
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if point aP lies closer to us than aClearance.
virtual void Add(EDA_ITEM *aItem)
PAD_ATTR_T GetAttribute() const
void Append(EDA_ITEM *item)
Add an item to the end of the list.
void SetAdditive(bool aAdditive)
virtual bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const
Test if aPosition is contained within or on the bounding box of an item.
bool includeLockedModules
SEARCH_RESULT Visit(INSPECTOR inspector, void *testData, const KICAD_T scanTypes[]) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
int GetCount() const
Return the number of objects in the list.
void SetState(int type, bool state)
void Transfer(int aIndex)
Move the item at aIndex (first position is 0) to the backup list.
Container for display options like enable/disable some optional drawings.
PCB_LAYER_ID
A quick note on layer IDs:
#define BRIGHTENED
item is drawn with a bright contour
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
const COLLECTORS_GUIDE * GetGuide() const
Item needs to be redrawn.
LSET is a set of PCB_LAYER_IDs.
void SetCenter(const VECTOR2D &aCenter)
Set the center point of the VIEW (i.e.
bool text
Text (free or attached to a footprint)
void SetFlags(STATUS_FLAGS aMask)
void SetIgnoreMTextsOnBack(bool ignore)
std::function< SEARCH_RESULT(EDA_ITEM *aItem, void *aTestData) > INSPECTOR_FUNC
Used to inspect and possibly collect the (search) results of iterating over a list or tree of KICAD_T...
TRACK_DRAG_ACTION m_TrackDragAction
bool dimensions
Dimension items.
void SetIgnorePadsOnFront(bool ignore)
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
virtual EDA_RECT GetBoundingBox() const
static PCB_GROUP * TopLevelGroup(BOARD_ITEM *aItem, PCB_GROUP *aScope, bool aFootprintEditor)
bool IsVisible(const VIEW_ITEM *aItem) const
Return information if the item is visible (or not).
bool keepouts
Keepout zones.
bool graphics
Graphic lines, shapes, polygons.
void SetIgnoreMTextsOnFront(bool ignore)
#define ENTERED
indicates a group has been entered
virtual int GetTopLayer() const
coord_type GetWidth() const
Meta control for all pads opacity/visibility (color ignored)
bool Contains(EDA_ITEM *aItem) const
const BOX2I ViewBBox() const override
Set the origin of the rectangle (the fixed corner)
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const std::deque< EDA_ITEM * > GetItems() const
bool HasItem(const EDA_ITEM *aItem) const
Tests if aItem has already been collected.
static const TOOL_EVENT UninhibitSelectionEditing
EDA_ITEM * GetParent() const
Items that may change while the view stays the same (noncached)
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
ZONE handles a list of polygons defining a copper zone.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
class ZONE, a copper pour area
static const TOOL_EVENT SelectedItemsMoved
Used to inform tools that the selection should temporarily be non-editable.
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invoke a function on all descendants of the group.
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
bool tracks
Copper tracks.
static TOOL_ACTION updateMenu
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
void SetIgnoreMTextsMarkedNoShow(bool ignore)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
#define IS_MOVED
Item being moved.
const BITMAP_OPAQUE info_xpm[1]
virtual void SetLayer(int aLayer)
Set layer used to draw the group.
static TOOL_ACTION hideDynamicRatsnest
bool footprints
Allow selecting entire footprints.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
bool Empty() const
Checks if there is anything selected.
class PCB_TARGET, a target (graphic item)
class FOOTPRINT, a footprint
bool IsMirroredX() const
Return true if view is flipped across the X axis.
static TOOL_ACTION clearHighlight
void SetSubtractive(bool aSubtractive)
const Vec & GetPosition() const
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
virtual unsigned int GetSize() const override
Return the number of stored items.
bool vias
Vias (all types>
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
void ShapeToPolygon(SHAPE_LINE_CHAIN &aPolygon, int aScale=-1) const
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the...
static TOOL_ACTION filterSelection
Filter the items in the current selection (invokes dialog)
void Normalize()
Ensures that the height ant width are positive.
bool Collide(const SHAPE *aShape, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
void SetCallback(boost::function< void(BOARD_ITEM *)> aCallback)
Function to be called on each found event.
bool GetHighContrast() const
static LSET PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
virtual bool IsLocked() const
bool lockedItems
Allow selecting locked items.
class MARKER_PCB, a marker used to show something
bool HitTestForEdge(const wxPoint &refPos, int aAccuracy, SHAPE_POLY_SET::VERTEX_INDEX &aCornerHit) const
Function HitTestForEdge tests if the given wxPoint is near a segment defined by 2 corners.
bool HasAdditionalItems()
Test if the collector has heuristic backup items.
Meta control for all vias opacity/visibility.
static TOOL_ACTION highlightNet
bool IsType(FRAME_T aType) const
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
std::shared_ptr< SHAPE_COMPOUND > GetEffectiveTextShape() const
wxPoint GetPosition() const override
static TOOL_ACTION selectOnSheetFromEeschema
Select all components on sheet from Eeschema crossprobing.
Information pertinent to a Pcbnew printed circuit board.
bool includeItemsOnTechLayers
void SetIgnoreModulesOnFront(bool ignore)
Used when the right click button is pressed, or when the select tool is in effect.
void SetIgnoreThroughVias(bool ignore)
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Return the text to display to be used in the selection clarification context menu when multiple items...
std::pair< VIEW_ITEM *, int > LAYER_ITEM_PAIR
wxString AsString() const
class NETINFO_ITEM, a description of a net
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
class ZONE, managed by a footprint
Handle the component boundary box.
VECTOR2I GetOrigin() const
ZONE_DISPLAY_MODE m_ZoneDisplayMode
PCBNEW_SETTINGS & Settings()
int Size() const
Returns the number of selected parts.
currently selected items overlay
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
A base class for most all the KiCad significant classes used in schematics and boards.
static const TOOL_EVENT InhibitSelectionEditing
coord_type GetHeight() const
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invoke a function on all members of the group.
const wxPoint & GetEnd() const
static TOOL_ACTION deselectNet
Remove all connections belonging to a single net from the active selection.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
void Combine()
Re-combine the backup list into the main list of the collector.
Represent a selection area (currently a rectangle) in a VIEW, drawn corner-to-corner between two poin...
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
class VIA, a via (like a track segment on a copper layer)
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
bool includeBoardOutlineLayer
const Vec & GetSize() const
virtual int Query(const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const
Find all visible items that touch or are within the rectangle aRect.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
#define SKIP_STRUCT
flag indicating that the structure should be ignored
A general implementation of a COLLECTORS_GUIDE.
STATUS_FLAGS GetFlags() const
BOARD_ITEM_CONTAINER * GetParent() const
void FocusOnLocation(const wxPoint &aPos)
Useful to focus on a particular location, in find functions.
virtual BITMAP_DEF GetMenuImage() const
Return a pointer to an image to be used in menus.
class PCB_SHAPE, a segment not on copper layers
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
static TOOL_ACTION selectAll
void FocusOnItem(BOARD_ITEM *aItem)
#define IS_NEW
New item, just created.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
void SetIgnoreThroughHolePads(bool ignore)
show footprints references (when texts are visibles)
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void SetIgnoreZoneFills(bool ignore)
virtual double ViewGetLOD(int aLayer, VIEW *aView) const
Return the level of detail (LOD) of the item.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
KICAD_T Type() const
Returns the type of object.
static TOOL_ACTION selectSameSheet
Select all components on the same sheet as the selected footprint.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
void SetIgnorePadsOnBack(bool ignore)
virtual void Remove(EDA_ITEM *aItem)