44#define HITTEST_THRESHOLD_PIXELS 3
56 m_frame = getEditFrame<PL_EDITOR_FRAME>();
58 auto& menu =
m_menu->GetMenu();
60 menu.AddSeparator( 200 );
66 menu.AddSeparator( 1000 );
79 m_frame = getEditFrame<PL_EDITOR_FRAME>();
122 bool selectionCancelled =
false;
126 SelectPoint( evt->Position(), &selectionCancelled );
133 if( !selectionCancelled )
138 else if( evt->IsDblClick(
BUT_LEFT ) )
174 else if( evt->IsCancelInteractive() )
194 && evt->HasPosition()
219 wxMouseState keyboardState = wxGetMouseState();
222 keyboardState.AltDown() );
249 if( drawItem->HitTest( aWhere, threshold ) )
250 collector.
Append( drawItem );
267 if( aSelectionCancelledFlag )
268 *aSelectionCancelledFlag =
true;
274 bool anyAdded =
false;
275 bool anySubtracted =
false;
281 anySubtracted =
true;
288 for(
int i = 0; i < collector.
GetCount(); ++i )
293 anySubtracted =
true;
316 for(
int i = 0; collector.
GetCount() == 2 && i < 2; ++i )
319 EDA_ITEM* other = collector[ ( i + 1 ) % 2 ];
345 bool cancelled =
false;
360 bool windowSelection = width >= 0 ? true :
false;
363 : KICURSOR::SELECT_LASSO );
365 if( evt->IsCancelInteractive() || evt->IsActivate() )
378 area.
SetEnd( evt->Position() );
397 bool anyAdded =
false;
398 bool anySubtracted =
false;
409 if( item->HitTest( selectionRect, windowSelection ) )
414 anySubtracted =
true;
464 if( item->IsSelected() )
509 aGroup->
Add( aItem );
531 const unsigned GRIP_MARGIN = 20;
537 BOX2I itemBox = item->ViewBBox();
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION updateMenu
static TOOL_ACTION zoomFitScreen
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr bool Contains(const Vec &aPoint) const
An abstract class that will find and hold all the objects according to an inspection done by the Insp...
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.
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Drawing sheet structure type definitions.
static DS_DATA_MODEL & GetTheInstance()
static function: returns the instance of DS_DATA_MODEL used in the application
Base class to handle basic graphic items.
void AddStandardSubMenus(TOOL_MENU &aMenu)
Construct a "basic" menu for a tool, containing only items that apply to all tools (e....
void ForceRefresh()
Force a redraw.
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 bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
static const TOOL_EVENT DisambiguatePoint
Used for hotkey feedback.
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT UnselectedEvent
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)
void SetExclusiveOr(bool aExclusiveOr)
void SetEnd(const VECTOR2I &aEnd)
Set the current end of the rectangle (the corner that moves with the cursor.
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...
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 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.
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
static TOOL_ACTION clearSelection
Clear the current selection.
static TOOL_ACTION placeImage
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION selectionMenu
Run a selection menu to select from a list of items.
static TOOL_ACTION drawRectangle
static TOOL_ACTION removeItemFromSel
static TOOL_ACTION addItemsToSel
Select a list of items (specified as the event parameter)
static TOOL_ACTION removeItemsFromSel
static TOOL_ACTION addItemToSel
Select an item (specified as the event parameter).
static TOOL_ACTION placeText
static TOOL_ACTION drawLine
PL_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
Tool that displays edit points allowing to modify items by dragging the points.
bool HasPoint()
Indicate the cursor is over an edit point.
static bool Empty(const SELECTION &aSelection)
Test if there are no items selected.
virtual void Add(EDA_ITEM *aItem)
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.
void ClearReferencePoint()
bool Empty() const
Checks if there is anything selected.
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
int m_DisambiguationMenuDelay
The number of milliseconds to wait in a click before showing a disambiguation menu.
VECTOR2< int32_t > VECTOR2I