各个接口的选择

ISelectionSet

IFeatureClass

public ISelectionSet Select (
    IQueryFilter QueryFilter,
    esriSelectionType selType,
    esriSelectionOption selOption,
    IWorkspace selectionContainer
); 

 但是我却到现在也没搞明白得到了ISelectionSet以后干什么。

ISelectionSet

public ISelectionSet Select (
    IQueryFilter QueryFilter,
    esriSelectionType selType,
    esriSelectionOption selOption,
    IWorkspace selectionContainer
); 返回原来选择元素的一个子集

IMap

public void SelectFeature (
    ILayer Layer,
    IFeature Feature
);

Adds the feature to the feature layer's selection set. For example, the Editor's 'Create New Feature' task uses this method to select the new feature it has just created. This method also calls IActiveViewEvents::SelectionChanged to notify all listeners of the event.

 IFeatureCursor

IFeatureLayer和IFeatureClass都具有  ISelectionSet也有

public IFeatureCursor Search (
    IQueryFilter filter,
    bool Recycling
);

IFeatureCursor的方法和属性有
DeleteFeature .  Fields    FindField  Flush .  InsertFeature  NextFeature  UpdateFeature

 

ISelection

IMap public ISelection FeatureSelection {get; set;}

ArcMap has two different selections, a feature selection and an element selection. Two different objects represent these selections and both implement the ISelection interface.  The feature selection object additionally implements IEnumFeature and the element selection object IEnumElement. The ISelection interface is used for clipboard type operations and the IEnum interfaces are used to loop through the items in the collection. 

When you ask for the FeatureSelection from IMap you are returned an ISelection but you can perform a query interface for IEnumFeature and usually do so. However, if you get the selection via IActiveView::Selection, the selection can either be an element selection or a feature selection depending on which one is currently active - only one of the selections can be active at a time.  Use FeatureSelection to ensure a reference to the correct selection.

 

IFeatureSelection

IFeatureSelection is a very useful interface to manage or perform selection on a layer or to modify the way the selection is displayed.

IFeatureSelection.SelectFeatures
public void SelectFeatures (
    IQueryFilter Filter,
    esriSelectionResultEnum Method,
    bool justOne
);

The following methods and properties are useful to manage the selection:

The CombinationMethod property is not used.
SelectionSet returns a SelectionSet corresponding to the current selection on the layer.
Clear will clear an existing selection.
Add adds one single feature to the selection.
SelectFeatures will perform a selection based on a query filter. If nothing is used as a query filter all the features will be selected. You can also specify a combination method. The justOne parameter tells the search to stop once it has found one feature.
Call SelectionChanged after modifying SelectionSet to fire update events on the layer.

The following methods and properties are useful to modify the way the selection is displayed:

SelectionSymbol will return or set the symbol used to display selected features on the layer.
SetSelectionSymbol is a boolean used to indicate if the SelectionSymbol is used or not to draw the selection. For feature layers, this is similar to using the "Show selected features...with this symbol" option in the layer properties.
SelectionColor is equivalent to using the "Show selected features...with this color" option in the layer properties.
If BufferDistance is set to a value greater than 0, a buffer will be drawn around the selected features. This is similar to using the Buffer Selection tool that can be added to the map with the Customize command found in the Tools menu.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值