Class SelectObjectsAction
- Namespace
- CADability.Actions
- Assembly
- CADability.dll
The Action used to select GeoObjects of a (visible) Model. Mouse-clicks in the view are used to determine which objects should be selected. The user can select a rectangular area by dragging the mouse while the left button is pushed. Dragging from left to right selects all objects completely inside the rectangle, dragging from right to left selects all objects which are touched by the rectangle. The PickMode determines on which level the selection is performed, the FilterList adds additional filtering to the selection process.
public class SelectObjectsAction : Action, ICommandHandler
- Inheritance
-
SelectObjectsAction
- Implements
- Inherited Members
Constructors
SelectObjectsAction(IFrame)
Constructs a new SelectObjectsAction. This is automatically done when a IFrame derived object is created and the instance of this class can be retrieved from ActiveAction.
public SelectObjectsAction(IFrame Frame)
Parameters
Properties
IsAccumulating
Detects whether the accumulate mode is on (Accumulate(PickMode)
public bool IsAccumulating { get; }
Property Value
LastCursorHotspot
Get the last hotspot under the cursor
public IHotSpot LastCursorHotspot { get; }
Property Value
LastCursorPosition
Get the area the cursor is currently over. e.g. EmptySpace or Hotspot
public SelectObjectsAction.CursorPosition LastCursorPosition { get; }
Property Value
PickMode
Gets or sets the pick-mode or selection mode for this SelectObjectsAction.
public PickMode PickMode { get; set; }
Property Value
ShowSelectedObjects
Shows the selection. This is normally true, but can be used (e.g. by the modeller of ShapeIt) to turn off the display and implement is in a differnt way
public bool ShowSelectedObjects { get; set; }
Property Value
Methods
Accumulate(PickMode)
Starts the accumulation mode: each click adds to the selection, regardless whether the ctrl key is pressed or not. Used by feature definition and maybe in other situations.
public void Accumulate(PickMode mode)
Parameters
modePickMode
AddSelectedObject(IGeoObject)
Adds the provided GeoObject to the list of selected objects. The SelectedObjectListChangedEvent will be raised.
public void AddSelectedObject(IGeoObject selObj)
Parameters
selObjIGeoObjectThe object to add
AddSelectedObjects(GeoObjectList)
Adds the provided list of geoObjects to the list of selected objects. The SelectedObjectListChangedEvent will be raised.
public void AddSelectedObjects(GeoObjectList selObj)
Parameters
selObjGeoObjectListList of objects to add
ClearSelectedObjects()
Clears the list of selected objects. No more objects are selected after this call. The SelectedObjectListChangedEvent will be raised.
public void ClearSelectedObjects()
GetFocusedSelectedObject()
Returns the selected object which currently has the focus. This is only meaningful if several objects are selected and the user navigates in the control center
public IGeoObject GetFocusedSelectedObject()
Returns
- IGeoObject
The selected object which currently has the focus
GetID()
Must be implemented by derived class. Returns an identification string. All CADability actions return the unique strings like "Draw.Line.TwoPoints" or "Zoom"
public override string GetID()
Returns
- string
the identification of the action
GetPickArea()
Returns the pick area of the last mouse button up event, which caused the list of selected objects to change
public Projection.PickArea GetPickArea()
Returns
GetSelectedObjects()
Returns the list of selected GeoObjects.
public GeoObjectList GetSelectedObjects()
Returns
- GeoObjectList
The list of selected GeoObjects
IsOverHotSpot(MouseEventArgs, IView)
Returns true if the coordinate in the parameter e is inside a currently visible hotspot
public bool IsOverHotSpot(MouseEventArgs e, IView vw)
Parameters
eMouseEventArgsthe parameter provided by the mouse event
vwIViewthe view which issued the mouse event
Returns
OnActivate(Action, bool)
Implements OnActivate(Action, bool). If you override this method don't forget to call the bas implementation.
public override void OnActivate(Action OldActiveAction, bool SettingAction)
Parameters
OnCommand(string)
Overrides OnCommand(string). See OnCommand(string) for more information.
public override bool OnCommand(string MenuId)
Parameters
MenuIdstring
Returns
OnDelete()
Implements OnDelete(). This implementation initiates the menu command "MenuId.Object.Delete".
public override bool OnDelete()
Returns
OnDisplayChanged(DisplayChangeArg)
Implements OnDisplayChanged(DisplayChangeArg). If you override this method don't forget to call the bas implementation.
public override void OnDisplayChanged(DisplayChangeArg d)
Parameters
OnHotspotChanged(IHotSpot, HotspotChangeMode)
Will be called when a hotspot becomes visible/invisible or selected/deselected. Will also be called, when a hotspot has been moved as a result of the change notification of the GeoObject. this is not the place to modify the GeoObject.
protected void OnHotspotChanged(IHotSpot sender, HotspotChangeMode mode)
Parameters
senderIHotSpotThe hotspot that caused this notification
modeHotspotChangeModeThe kind of the change operation
OnInactivate(Action, bool)
Implements OnInactivate(Action, bool). If you override this method don't forget to call the bas implementation.
public override void OnInactivate(Action NewActiveAction, bool RemovingAction)
Parameters
NewActiveActionActionthe action that will become active
RemovingActionbooltrue: if called because the action is removed, false: if called when a new action is set on top of this action
OnMouseDown(MouseEventArgs, IView)
Implements OnMouseDown(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.
public override void OnMouseDown(MouseEventArgs e, IView vw)
Parameters
eMouseEventArgsMouseEventArgs of the call
vwIViewthe IView which contains the mouse
OnMouseMove(MouseEventArgs, IView)
Implements OnMouseMove(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.
public override void OnMouseMove(MouseEventArgs e, IView vw)
Parameters
eMouseEventArgsMouseEventArgs of the call
vwIViewthe IView which contains the mouse
OnMouseUp(MouseEventArgs, IView)
Implements OnMouseUp(MouseEventArgs, IView). If you override this method don't forget to call the bas implementation.
public override void OnMouseUp(MouseEventArgs e, IView vw)
Parameters
eMouseEventArgsMouseEventArgs of the call
vwIViewthe IView which contains the mouse
OnSetAction()
Implements OnSetAction(). If you override this method don't forget to call the bas implementation.
public override void OnSetAction()
OnUpdateCommand(string, CommandState)
Overrides OnUpdateCommand(string, CommandState). See OnUpdateCommand(string, CommandState) for more information.
public override bool OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
MenuIdstringCommandStateCommandStatethe command state to manipulate
Returns
OnViewsChanged()
Implements OnViewsChanged(). If you override this method don't forget to call the bas implementation.
public override void OnViewsChanged()
RemoveSelectedObject(IGeoObject)
Removes the provided GeoObject from the list of selected objects. The SelectedObjectListChangedEvent will be raised.
public void RemoveSelectedObject(IGeoObject toDeselect)
Parameters
toDeselectIGeoObjectThe object to remove
SetFocusedSelectedObject(IGeoObject)
Set the selected object which should get focus. This is only meaningful if several objects are selected and the user navigates in the control center
public void SetFocusedSelectedObject(IGeoObject geoObject)
Parameters
geoObjectIGeoObjectThe GeoObject which should get the focus
SetSelectedObject(IGeoObject)
Sets the provided object as the only selected object
public void SetSelectedObject(IGeoObject toSelect)
Parameters
toSelectIGeoObject
SetSelectedObjects(GeoObjectList)
Replaces the contents of the list of selected objects by the contents of the provided list. The SelectedObjectListChangedEvent will be raised.
public void SetSelectedObjects(GeoObjectList selObj)
Parameters
selObjGeoObjectListList of GeoObjects to be selected
SetSelectedObjects(GeoObjectList, bool)
Replaces the contents of the list of selected objects by those objects of the provided list that are accepted by the according FilterList. The SelectedObjectListChangedEvent will be raised.
public void SetSelectedObjects(GeoObjectList selObj, bool useFilter)
Parameters
selObjGeoObjectListList of objects to select.
useFilterboolIf true, applies all active Filters of the FilterList.
StopAccumulate()
Stops the accumulation mode (Accumulate(PickMode)
public void StopAccumulate()
Events
BeforeShowContextMenuEvent
Event raised before context menue is displayed, you can modify it here.
public event SelectObjectsAction.BeforeShowContextMenuDelegate BeforeShowContextMenuEvent
Event Type
ClickOnSelectedObjectEvent
Event raised when clicking on a already selected object.
public event SelectObjectsAction.ClickOnSelectedObjectDelegate ClickOnSelectedObjectEvent
Event Type
FilterDragListEvent
Event to filter objects that are beeing dragged. This event is called just before the objects are dragged. You may modify the list of objects. If you clear the list, no objects will be dragged.
public event SelectObjectsAction.FilterDragListDelegate FilterDragListEvent
Event Type
FilterMouseMessagesEvent
Event raised before the according mouse message is processed by this action. The user may prevent the handling of this mouse message by this action and/or do some other work instead.
public event SelectObjectsAction.FilterMouseMessagesDelegate FilterMouseMessagesEvent
Event Type
SelectedObjectListChangedEvent
Event raised when the list of selected objects changed.
public event SelectObjectsAction.SelectedObjectListChanged SelectedObjectListChangedEvent