Table of Contents

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

Frame IFrame

The Frame on which this action operates.

Properties

IsAccumulating

Detects whether the accumulate mode is on (Accumulate(PickMode)

public bool IsAccumulating { get; }

Property Value

bool

LastCursorHotspot

Get the last hotspot under the cursor

public IHotSpot LastCursorHotspot { get; }

Property Value

IHotSpot

LastCursorPosition

Get the area the cursor is currently over. e.g. EmptySpace or Hotspot

public SelectObjectsAction.CursorPosition LastCursorPosition { get; }

Property Value

SelectObjectsAction.CursorPosition

PickMode

Gets or sets the pick-mode or selection mode for this SelectObjectsAction.

public PickMode PickMode { get; set; }

Property Value

PickMode

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

bool

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

mode PickMode

AddSelectedObject(IGeoObject)

Adds the provided GeoObject to the list of selected objects. The SelectedObjectListChangedEvent will be raised.

public void AddSelectedObject(IGeoObject selObj)

Parameters

selObj IGeoObject

The 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

selObj GeoObjectList

List 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

Projection.PickArea

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

e MouseEventArgs

the parameter provided by the mouse event

vw IView

the view which issued the mouse event

Returns

bool

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

OldActiveAction Action
SettingAction bool

OnCommand(string)

Overrides OnCommand(string). See OnCommand(string) for more information.

public override bool OnCommand(string MenuId)

Parameters

MenuId string

Returns

bool

OnDelete()

Implements OnDelete(). This implementation initiates the menu command "MenuId.Object.Delete".

public override bool OnDelete()

Returns

bool

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

d DisplayChangeArg

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

sender IHotSpot

The hotspot that caused this notification

mode HotspotChangeMode

The 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

NewActiveAction Action

the action that will become active

RemovingAction bool

true: 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

e MouseEventArgs

MouseEventArgs of the call

vw IView

the 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

e MouseEventArgs

MouseEventArgs of the call

vw IView

the 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

e MouseEventArgs

MouseEventArgs of the call

vw IView

the 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)

public override bool OnUpdateCommand(string MenuId, CommandState CommandState)

Parameters

MenuId string
CommandState CommandState

the command state to manipulate

Returns

bool

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

toDeselect IGeoObject

The 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

geoObject IGeoObject

The GeoObject which should get the focus

SetSelectedObject(IGeoObject)

Sets the provided object as the only selected object

public void SetSelectedObject(IGeoObject toSelect)

Parameters

toSelect IGeoObject

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

selObj GeoObjectList

List 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

selObj GeoObjectList

List of objects to select.

useFilter bool

If 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

SelectObjectsAction.BeforeShowContextMenuDelegate

ClickOnSelectedObjectEvent

Event raised when clicking on a already selected object.

public event SelectObjectsAction.ClickOnSelectedObjectDelegate ClickOnSelectedObjectEvent

Event Type

SelectObjectsAction.ClickOnSelectedObjectDelegate

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

SelectObjectsAction.FilterDragListDelegate

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

SelectObjectsAction.FilterMouseMessagesDelegate

SelectedObjectListChangedEvent

Event raised when the list of selected objects changed.

public event SelectObjectsAction.SelectedObjectListChanged SelectedObjectListChangedEvent

Event Type

SelectObjectsAction.SelectedObjectListChanged