40#define HITTEST_THRESHOLD_PIXELS 3
54 auto& menu =
m_menu->GetMenu();
56 menu.AddSeparator( 200 );
62 menu.AddSeparator( 1000 );
119 bool selectionCancelled =
false;
123 SelectPoint( evt->Position(), &selectionCancelled );
128 m_frame->GetCanvas()->ForceRefresh();
130 if( !selectionCancelled )
135 else if( evt->IsDblClick(
BUT_LEFT ) )
155 m_toolMgr->RunAction(
"plEditor.InteractiveMove.move" );
171 else if( evt->IsCancelInteractive() )
186 if(
m_frame->ToolStackIsEmpty() )
191 && evt->HasPosition()
216 wxMouseState keyboardState = wxGetMouseState();
219 keyboardState.AltDown() );
246 if( drawItem->HitTest( aWhere, threshold ) )
247 collector.
Append( drawItem );
264 if( aSelectionCancelledFlag )
265 *aSelectionCancelledFlag =
true;
271 bool anyAdded =
false;
272 bool anySubtracted =
false;
278 anySubtracted =
true;
285 for(
int i = 0; i < collector.
GetCount(); ++i )
290 anySubtracted =
true;
313 for(
int i = 0; collector.
GetCount() == 2 && i < 2; ++i )
316 EDA_ITEM* other = collector[ ( i + 1 ) % 2 ];
342 bool cancelled =
false;
360 if( evt->IsCancelInteractive() || evt->IsActivate() )
373 area.
SetEnd( evt->Position() );
392 bool anyAdded =
false;
393 bool anySubtracted =
false;
404 if( item->HitTest( selectionRect, windowSelection ) )
409 anySubtracted =
true;
459 if( item->IsSelected() )
504 aGroup->
Add( aItem );
526 const unsigned GRIP_MARGIN = 20;
532 BOX2I itemBox = item->ViewBBox();
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION unselectItem
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 updateMenu
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION unselectItems
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
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()
Return the instance of DS_DATA_MODEL used in the application.
Base class to handle basic graphic items.
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 SetMode(SELECTION_MODE aMode)
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.
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 placeImage
static TOOL_ACTION drawRectangle
static TOOL_ACTION placeText
static TOOL_ACTION drawLine
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)
virtual void Remove(EDA_ITEM *aItem)
#define BRIGHTENED
item is drawn with a bright contour
#define SELECTED
Item was manually selected by the user.
#define HITTEST_THRESHOLD_PIXELS
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D