67 if( aSel.GetSize() == 1 )
81 return aSel.GetSize() == 1 && aSel.Front()->Type() ==
SCH_SYMBOL_T;
87 if( aSel.GetSize() == 1 )
101 if( aSel.GetSize() == 1 )
118 return !
static_cast<SCH_MARKER*
>( aSel.Front() )->IsExcluded();
124 return aSel.GetSize() > 1 && aSel.OnlyContains( {
SCH_SYMBOL_T } );
128#define HITTEST_THRESHOLD_PIXELS 5
135 m_isSymbolEditor( false ),
136 m_isSymbolViewer( false ),
172 m_frame = getEditFrame<SCH_BASE_FRAME>();
177 if( symbolEditorFrame )
195 auto schEditSheetPageNumberCondition =
204 auto schEditCondition =
210 auto belowRootSheetCondition =
234 auto symbolDisplayNameIsEditable =
242 return symbEditorFrame
258 menu.AddSeparator( 100 );
262 menu.AddSeparator( 100 );
265 menu.AddSeparator( 100 );
268 menu.AddSeparator( 200 );
281 menu.AddSeparator( 400 );
287 menu.AddSeparator( 1000 );
299 m_frame = getEditFrame<SCH_BASE_FRAME>();
311 if( symbolEditFrame )
343 bool selCancelled =
false;
344 bool displayWireCursor =
false;
345 bool displayBusCursor =
false;
346 bool displayLineCursor =
false;
347 KIID rolloverItem = lastRolloverItem;
351 evt->Modifier(
MD_ALT ) );
381 schframe->FocusOnItem(
nullptr );
400 autostart->SetParameter( params );
405 else if( collector[0]->IsHypertext() )
407 collector[ 0 ]->DoHypertextAction(
m_frame );
427 SelectPoint( evt->Position(), { SCH_LOCATE_ANY_T },
nullptr, &selCancelled );
440 if(
CollectHits( collector, evt->Position(), { SCH_LOCATE_ANY_T } ) )
444 SelectPoint( evt->Position(), { SCH_LOCATE_ANY_T },
nullptr, &selCancelled );
452 else if( evt->IsDblClick(
BUT_LEFT ) )
458 schframe->FocusOnItem(
nullptr );
494 schframe->FocusOnItem(
nullptr );
542 else if( evt->IsMouseDown(
BUT_AUX1 ) )
546 else if( evt->IsMouseDown(
BUT_AUX2 ) )
567 wxString* net =
new wxString( *evt->Parameter<wxString*>() );
571 else if( evt->IsCancelInteractive() )
576 schframe->FocusOnItem(
nullptr );
582 else if( evt->FirstResponder() ==
this && evt->GetCommandId() == (
int) WXK_ESCAPE )
587 editor->ClearHighlight( *evt );
593 schframe->FocusOnItem(
nullptr );
597 else if( evt->IsMotion() && !
m_isSymbolEditor && evt->FirstResponder() ==
this )
616 displayBusCursor =
true;
618 displayWireCursor =
true;
620 displayLineCursor =
true;
622 else if( collector[0]->IsHypertext() && !collector[0]->IsSelected() )
624 rolloverItem = collector[0]->m_Uuid;
634 if( rolloverItem != lastRolloverItem )
653 lastRolloverItem = rolloverItem;
664 if( displayWireCursor )
668 else if( displayBusCursor )
672 else if( displayLineCursor )
676 else if( rolloverItem !=
niluuid )
682 && evt->HasPosition()
741 if( possibleConnection.
IsBus() )
746 newEvt->SetHasPosition(
true );
747 newEvt->SetForceImmediate(
true );
760 wxMouseState keyboardState = wxGetMouseState();
763 keyboardState.AltDown() );
778 wxMouseState keyboardState = wxGetMouseState();
781 keyboardState.AltDown() );
802 const std::vector<KICAD_T>& aScanTypes )
806 aCollector.
m_Threshold = std::max( pixelThreshold, gridThreshold );
824 int originalCount = aCollector.
GetCount();
826 for(
int ii = 0; ii < originalCount; ++ii )
828 if( aCollector[ii]->Type() ==
SCH_PIN_T )
832 if( !aCollector.
HasItem(
pin->GetParentSymbol() ) )
833 aCollector.
Append(
pin->GetParentSymbol() );
844 bool aCheckLocked,
bool aSelectedOnly )
846 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
854 if( aCheckLocked && collector[i]->IsLocked() )
860 if( aSelectedOnly && !collector[i]->IsSelected() )
874 EDA_ITEM** aItem,
bool* aSelectionCancelledFlag,
bool aAdd,
875 bool aSubtract,
bool aExclusiveOr )
893 if( aSelectionCancelledFlag )
894 *aSelectionCancelledFlag =
true;
900 if( !aAdd && !aSubtract && !aExclusiveOr )
904 bool anySubtracted =
false;
908 for(
int i = 0; i < aCollector.
GetCount(); ++i )
911 bool isLine = aCollector[i]->Type() ==
SCH_LINE_T;
927 || ( aExclusiveOr && aCollector[i]->IsSelected()
928 && ( !isLine || ( isLine && aCollector[i]->HasFlag( flags ) ) ) ) )
930 aCollector[i]->ClearFlags( flags );
939 anySubtracted =
true;
944 aCollector[i]->SetFlags( flags );
951 if( addedCount == 1 )
955 if( aItem && aCollector.
GetCount() == 1 )
956 *aItem = aCollector[0];
960 else if( addedCount > 1 )
965 else if( anySubtracted )
976 const std::vector<KICAD_T>& aScanTypes,
977 EDA_ITEM** aItem,
bool* aSelectionCancelledFlag,
978 bool aCheckLocked,
bool aAdd,
bool aSubtract,
983 if( !
CollectHits( collector, aWhere, aScanTypes ) )
988 return selectPoint( collector, aWhere, aItem, aSelectionCancelledFlag, aAdd, aSubtract,
999 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
1000 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> sheetPins;
1006 view->
Query( selectionBox, selectedItems );
1015 int layer = pair.second;
1022 selectedItems.insert( selectedItems.end(), sheetPins.begin(), sheetPins.end() );
1024 for(
const std::pair<KIGFX::VIEW_ITEM*, int>& item_pair : selectedItems )
1049 std::set<EDA_ITEM*> exactHits;
1051 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
1065 if( item->
HitTest( aPos, pixelThreshold ) )
1066 exactHits.insert( item );
1071 exactHits.insert( item );
1075 if( item->
HitTest( aPos, 0 ) )
1076 exactHits.insert( item );
1080 if( exactHits.size() > 0 && exactHits.size() < (
unsigned) collector.
GetCount() )
1082 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
1086 if( !exactHits.count( item ) )
1096 int closestDist = INT_MAX / 2;
1100 BOX2I bbox = item->GetBoundingBox();
1101 int dist = INT_MAX / 2;
1103 if( exactHits.count( item ) )
1123 if( field->GetParent() && field->GetParent()->Type() ==
SCH_SYMBOL_T )
1125 symbol =
static_cast<SCH_SYMBOL*
>( field->GetParent() );
1131 poss =
SEG( pos, pos );
1135 text->GetEffectiveTextShape()->Collide( poss, closestDist, &dist );
1143 catch(
const boost::bad_pointer& exc )
1147 wxLogError( wxT(
"Boost bad pointer exception '%s' occurred." ), exc.what() );
1155 rect.
Collide( poss, closestDist, &dist );
1168 if( dist == closestDist )
1170 if( item->GetParent() == closest )
1173 else if( dist < closestDist )
1188 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
1192 if( item == closest )
1195 if( !item->
HitTest( tightBox,
true ) )
1215 bool isMoving =
false;
1216 bool anyUnselected =
false;
1221 isMoving |=
static_cast<SCH_ITEM*
>( item )->IsMoving();
1223 if( !item->
IsType( aScanTypes ) )
1226 anyUnselected =
true;
1272 bool cancelled =
false;
1288 bool isGreedy = width < 0;
1291 isGreedy = !isGreedy;
1296 if( evt->IsCancelInteractive() || evt->IsActivate() )
1309 area.
SetEnd( evt->Position() );
1327 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> nearbyViewItems;
1331 std::unordered_set<EDA_ITEM*> nearbyItems;
1332 std::vector<EDA_ITEM*> nearbyChildren;
1333 std::vector<EDA_ITEM*> flaggedItems;
1339 if( nearbyItems.insert( item ).second )
1345 sch_item->RunOnChildren(
1349 if(
SCH_PIN*
pin = dyn_cast<SCH_PIN*>( aChild ) )
1351 int unit =
pin->GetLibPin()->GetUnit();
1353 if( unit && unit !=
pin->GetParentSymbol()->GetUnit() )
1357 nearbyChildren.push_back( aChild );
1367 bool anyAdded =
false;
1368 bool anySubtracted =
false;
1383 anySubtracted =
true;
1388 if( flags && !anySubtracted )
1401 for(
EDA_ITEM* item : nearbyItems )
1403 bool selected =
false;
1415 if( ( isGreedy && line->
HitTest( selectionRect,
false ) )
1422 else if( !isGreedy )
1441 selected = item->HitTest( selectionRect, !isGreedy );
1448 flaggedItems.push_back( item );
1449 selectItem( item, flags );
1455 for(
EDA_ITEM* item : nearbyChildren )
1461 && !item->GetParent()->HasFlag(
CANDIDATE )
1462 && item->HitTest( selectionRect, !isGreedy ) )
1464 selectItem( item, 0 );
1470 for(
EDA_ITEM* item : flaggedItems )
1490 evt->SetPassEvent();
1516 int thresholdMax = std::max( pixelThreshold, gridThreshold );
1518 for(
int threshold : { 0, thresholdMax/4, thresholdMax/2, thresholdMax } )
1527 return collector.
GetCount() ? collector[ 0 ] :
nullptr;
1549 unsigned done =
false;
1556 if( item->IsType( { SCH_ITEM_LOCATE_WIRE_T, SCH_ITEM_LOCATE_BUS_T } )
1557 && !item->IsSelected() )
1612 double compRatio = bbSize.
y / currTextHeight;
1613 double compRatioBent = 1.0;
1621 std::vector<std::pair<double, double>> lut{ { 1.25, 16 },
1630 std::vector<std::pair<double, double>>::iterator it;
1633 compRatioBent = lut.back().second;
1638 if( compRatio >= lut.front().first )
1640 for( it = lut.begin(); it < lut.end() - 1; it++ )
1642 if( it->first <= compRatio &&
next( it )->first >= compRatio )
1644 double diffx = compRatio - it->first;
1645 double diffn =
next( it )->first - it->first;
1647 compRatioBent = it->second + (
next( it )->second - it->second ) * diffx / diffn;
1654 compRatioBent = lut.front().second;
1664 screenSize.
x = std::max( 10.0, screenSize.
x );
1665 screenSize.
y = std::max( 10.0, screenSize.
y );
1666 double ratio = std::max( -1.0, fabs( bbSize.
y / screenSize.
y ) );
1670 std::max( fabs( bbSize.
x / screenSize.
x ), fabs( bbSize.
y / screenSize.
y ) );
1675 if( bbSize.
x > screenSize.
x * ratio * compRatioBent )
1679 compRatioBent = 1.0;
1680 wxLogTrace(
"CROSS_PROBE_SCALE",
1681 "Part TOO WIDE for screen. Using normal KiCad zoom ratio: %1.5f", ratio );
1686 ratio *= compRatioBent;
1688 bool alwaysZoom =
false;
1691 if( ( ratio < 0.5 || ratio > 1.0 ) || alwaysZoom )
1697 SCH_ITEM* focusItem, std::vector<SCH_ITEM*> items )
1749 if( item.IsSelected() )
1758 if( item->IsSelected() )
1764 item->RunOnChildren(
1782 bool checkVisibilityOnly )
const
1793 switch( aItem->
Type() )
1893 aGroup->
Add( aItem );
1899 sch_item->RunOnChildren(
1937 sch_item->RunOnChildren(
1956 const unsigned GRIP_MARGIN = 20;
1962 BOX2I itemBox = item->ViewBBox();
VECTOR2D mapCoords(const VECTOR2D &aSource)
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION cursorLeft
static TOOL_ACTION zoomOutCenter
static TOOL_ACTION zoomIn
static TOOL_ACTION cursorLeftFast
static TOOL_ACTION cursorDown
static TOOL_ACTION zoomOut
static TOOL_ACTION cursorRightFast
static TOOL_ACTION zoomCenter
static TOOL_ACTION panDown
static TOOL_ACTION cursorDownFast
static TOOL_ACTION cursorUpFast
static TOOL_ACTION panLeft
static TOOL_ACTION updateMenu
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION zoomFitObjects
static TOOL_ACTION zoomInCenter
static TOOL_ACTION panRight
static TOOL_ACTION cursorUp
Cursor control with keyboard.
static TOOL_ACTION cursorRight
static TOOL_ACTION selectAll
CROSS_PROBING_SETTINGS m_CrossProbing
BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
const Vec & GetPosition() const
const Vec GetCenter() const
coord_type GetHeight() const
coord_type GetWidth() const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
const Vec & GetSize() const
void Transfer(int aIndex)
Move the item at aIndex (first position is 0) to the backup list.
int GetCount() const
Return the number of objects in the list.
bool HasItem(const EDA_ITEM *aItem) const
Tests if aItem has already been collected.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
void Append(EDA_ITEM *item)
Add an item to the end of the list.
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
void FocusOnLocation(const VECTOR2I &aPos)
Useful to focus on a particular location, in find functions.
virtual EDA_ITEM * GetItem(const KIID &aId) const
Fetch an item by KIID.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
void SetFlags(EDA_ITEM_FLAGS aMask)
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual bool IsType(const std::vector< KICAD_T > &aScanTypes) const
Check whether the item is one of the listed types.
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
EDA_ITEM * GetParent() const
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
void XorFlags(EDA_ITEM_FLAGS aMask)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
virtual const wxString & GetText() const
Return the string associated with the text object.
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION properties
static TOOL_ACTION addItemsToSel
Selects a list of items (specified as the event parameter)
static TOOL_ACTION clearHighlight
static TOOL_ACTION selectConnection
If current selection is a wire or bus, expand to entire connection.
static TOOL_ACTION pinTable
static TOOL_ACTION navigateForward
static TOOL_ACTION assignNetclass
static TOOL_ACTION clearSelection
Clears the current selection.
static TOOL_ACTION navigateBack
static TOOL_ACTION selectionMenu
Runs a selection menu to select from a list of items.
static TOOL_ACTION placeClassLabel
static TOOL_ACTION drawWire
static TOOL_ACTION removeItemsFromSel
static TOOL_ACTION drawBus
static TOOL_ACTION finishWire
static TOOL_ACTION selectNode
Select the junction, wire or bus segment under the cursor.
static TOOL_ACTION breakWire
static TOOL_ACTION drawLines
static TOOL_ACTION importSheetPin
static TOOL_ACTION selectOnPCB
static TOOL_ACTION leaveSheet
static TOOL_ACTION placeGlobalLabel
static TOOL_ACTION removeItemFromSel
static TOOL_ACTION placeHierLabel
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
static TOOL_ACTION symbolProperties
static TOOL_ACTION editPageNumber
static TOOL_ACTION enterSheet
static TOOL_ACTION setUnitDisplayName
static TOOL_ACTION unfoldBus
static TOOL_ACTION placeLabel
static TOOL_ACTION placeJunction
static TOOL_ACTION finishBus
bool m_ShowPinElectricalTypes
static const std::vector< KICAD_T > MovableItems
void Collect(SCH_SCREEN *aScreen, const std::vector< KICAD_T > &aScanTypes, const VECTOR2I &aPos, int aUnit=0, int aConvert=0)
Scan a EDA_ITEM using this class's Inspector method which does the collection.
static SELECTION_CONDITION SingleSymbol
static SELECTION_CONDITION SingleSymbolOrPower
static SELECTION_CONDITION SingleMultiUnitSymbol
static SELECTION_CONDITION SingleNonExcludedMarker
static SELECTION_CONDITION SingleDeMorganSymbol
static SELECTION_CONDITION MultipleSymbolsOrPower
VECTOR2I BestSnapAnchor(const VECTOR2I &aOrigin, int aLayer, SCH_ITEM *aDraggedItem)
Tool that displays edit points allowing to modify items by dragging the points.
bool HasPoint()
Indicate the cursor is over an edit point.
BOX2I GetBoundingBox() const override
EDA_ITEM * GetTopLeftItem(bool onlyModules=false) const override
static const TOOL_EVENT DisambiguatePoint
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT PointSelectedEvent
static const TOOL_EVENT UnselectedEvent
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Represent a selection area (currently a rectangle) in a VIEW, drawn corner-to-corner between two poin...
VECTOR2I GetOrigin() const
void SetSubtractive(bool aSubtractive)
void SetAdditive(bool aAdditive)
void SetOrigin(const VECTOR2I &aOrigin)
const BOX2I ViewBBox() const override
Set the origin of the rectangle (the fixed corner)
void SetExclusiveOr(bool aExclusiveOr)
void SetEnd(const VECTOR2I &aEnd)
Set the current end of the rectangle (the corner that moves with the cursor.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
bool m_ShowPinsElectricalType
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
VECTOR2D GetCursorPosition() const
Return the current cursor position in world coordinates.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
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.
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...
VECTOR2D ToWorld(const VECTOR2D &aCoord, bool aAbsolute=true) const
Converts a screen space point/vector to a point/vector in world space coordinates.
bool IsMirroredX() const
Return true if view is flipped across the X axis.
std::pair< VIEW_ITEM *, int > LAYER_ITEM_PAIR
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
The base class for drawable items used by schematic library symbols.
Define a library symbol object.
LIB_ITEMS_CONTAINER & GetDrawItems()
Return a reference to the draw item list.
SCH_SHEET_PATH & CurrentSheet() const override
CONNECTION_GRAPH * ConnectionGraph() const override
void SetCurrentSheet(const SCH_SHEET_PATH &aPath) override
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
EESCHEMA_SETTINGS * eeconfig() const
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
virtual bool GetShowAllPins() const
Allow some frames to show/hide hidden pins.
Class for a wire to bus entry.
SCH_ITEM * m_connected_bus_item
Pointer to the bus item (usually a bus wire) connected to this bus-wire entry, if it is connected to ...
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
void ConfigureFromLabel(const wxString &aLabel)
Configures the connection given a label.
KIGFX::SCH_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Handle actions specific to the schematic editor.
Schematic editor (Eeschema) main window.
const SCH_CONNECTION * GetHighlightedConnection() const
SCH_SHEET_PATH & GetCurrentSheet() const
SCHEMATIC & Schematic() const
void DisplayCurrentSheet()
Draw the current sheet on the display.
void FocusOnItem(SCH_ITEM *aItem)
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
virtual bool IsPointClickableAnchor(const VECTOR2I &aPos) const
Segment description base class to describe items which have 2 end points (track, wire,...
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
bool IsStartDangling() const
VECTOR2I GetEndPoint() const
VECTOR2I GetStartPoint() const
bool IsEndDangling() const
bool IsBus() const
Return true if the line is a bus.
bool IsGraphicLine() const
Return if the line is a graphic (non electrical line)
void ClearDrawingState()
Clear the state flags of all the items in the screen.
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
std::set< SCH_ITEM * > MarkConnections(SCH_LINE *aSegment, bool aSecondPass)
Return all wires and junctions connected to aSegment which are not connected any symbol pin.
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
std::vector< SCH_SHEET_PIN * > & GetPins()
VECTOR2I GetPosition() const override
TRANSFORM & GetTransform()
BOX2I GetBodyAndPinsBoundingBox() const
Return a bounding box for the symbol body and pins but not the fields.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
BOX2I GetBodyBoundingBox() const
Return a bounding box for the symbol body but not the pins or fields.
static SELECTION_CONDITION HasTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if among the selected items there is at least one of a given types.
static bool Empty(const SELECTION &aSelection)
Test if there are no items selected.
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static SELECTION_CONDITION LessThan(int aNumber)
Create a functor that tests if the number of selected items is smaller than the value given as parame...
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
virtual void Add(EDA_ITEM *aItem)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
void SetIsHover(bool aIsHover)
virtual void Remove(EDA_ITEM *aItem)
virtual unsigned int GetSize() const override
Return the number of stored items.
virtual void Clear() override
Remove all the stored items from the group.
int Size() const
Returns the number of selected parts.
void ClearReferencePoint()
void SetReferencePoint(const VECTOR2I &aP)
bool Empty() const
Checks if there is anything selected.
bool Collide(const SHAPE *aShape, int aClearance, VECTOR2I *aMTV) const override
Check if the boundary of shape (this) lies closer to the shape aShape than aClearance,...
The symbol library editor main window.
bool IsSymbolAlias() const
Return true if aLibId is an alias for the editor screen symbol.
bool IsSymbolEditable() const
Test if a symbol is loaded and can be edited.
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
Symbol library viewer main window.
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
#define BRIGHTENED
item is drawn with a bright contour
#define IS_NEW
New item, just created.
#define SELECTED
Item was manually selected by the user.
#define ENDPOINT
ends. (Used to support dragging.)
std::uint32_t EDA_ITEM_FLAGS
#define CANDIDATE
flag indicating that the structure is connected
#define IS_ROLLOVER
Rollover active. Used for hyperlink highlighting.
#define IS_MOVING
Item being moved.
#define SHOW_ELEC_TYPE
Show pin electrical type. Shared with IS_ROLLOVER.
#define STARTPOINT
When a line is selected, these flags indicate which.
@ ID_POPUP_SCH_UNFOLD_BUS_END
@ ID_POPUP_SCH_SELECT_UNIT_CMP
@ ID_POPUP_SCH_UNFOLD_BUS
@ ID_POPUP_SCH_SELECT_UNIT_SYM_MAX
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
bool zoom_to_fit
Zoom to fit items (ignored if center_on_items is off)
bool center_on_items
Automatically pan to cross-probed items.
constexpr int MilsToIU(int mils) const
bool select_pin_selects_symbol
double DistanceLinePoint(const VECTOR2I &linePointA, const VECTOR2I &linePointB, const VECTOR2I &referencePoint)
Compute the distance between a line and a reference point Reference: http://mathworld....
bool HitTestPoints(const VECTOR2I &pointA, const VECTOR2I &pointB, double threshold)
Test, if two points are near each other.
double EuclideanNorm(const VECTOR2I &vector)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
@ SCH_SYMBOL_LOCATE_POWER_T
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".