40#define HITTEST_THRESHOLD_PIXELS 3
54 auto& menu =
m_menu->GetMenu();
56 menu.AddSeparator( 200 );
62 menu.AddSeparator( 1000 );
118 bool selectionCancelled =
false;
122 SelectPoint( evt->Position(), &selectionCancelled );
127 m_frame->GetCanvas()->ForceRefresh();
129 if( !selectionCancelled )
153 m_toolMgr->RunAction(
"plEditor.InteractiveMove.move" );
169 else if( evt->IsCancelInteractive() )
184 if(
m_frame->ToolStackIsEmpty() )
189 && evt->HasPosition()
214 wxMouseState keyboardState = wxGetMouseState();
217 keyboardState.AltDown() );
244 if( drawItem->HitTest( aWhere, threshold ) )
245 collector.
Append( drawItem );
262 if( aSelectionCancelledFlag )
263 *aSelectionCancelledFlag =
true;
269 bool anyAdded =
false;
270 bool anySubtracted =
false;
276 anySubtracted =
true;
283 for(
int i = 0; i < collector.
GetCount(); ++i )
288 anySubtracted =
true;
311 for(
int i = 0; collector.
GetCount() == 2 && i < 2; ++i )
314 EDA_ITEM* other = collector[ ( i + 1 ) % 2 ];
340 bool cancelled =
false;
358 if( evt->IsCancelInteractive() || evt->IsActivate() )
371 area.
SetEnd( evt->Position() );
390 bool anyAdded =
false;
391 bool anySubtracted =
false;
402 if( item->HitTest( selectionRect, windowSelection ) )
407 anySubtracted =
true;
471 if( item->IsSelected() )
516 aGroup->
Add( aItem );
538 const unsigned GRIP_MARGIN = 20;
544 BOX2I itemBox = item->ViewBBox();
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION unselectAll
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION unselectItem
static TOOL_ACTION cursorDblClick
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 cursorClick
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectAll
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 to inform tool that it should display the disambiguation menu.
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)
Set the origin of the rectangle (the fixed corner)
const BOX2I ViewBBox() const override
Return the bounding box of the item covering all its layers.
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)
A null aItem is ignored; the selection never holds null members.
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