ArcEngine二次开发中最短配送路径分析所用接口和类的详解(可供源代码)

本文详细介绍了一个最短配送路径分析系统中的关键类和接口的作用。包括添加站点、障碍点及最短路径分析等核心功能模块的设计与实现。文章还介绍了如何通过不同接口控制地图显示、要素操作等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

第1章 最短配送路径分析中所用类和接口的作用详解... 1

1 添加站点类AddNetStopsTool:BaseTool1

1.1 BaseTool:BaseCommand. 1

1.2 IFeatureWorkspace接口... 1

1.3 IFeatureClass接口... 2

1.4 ITable接口... 2

1.5 IPoint接口... 3

1.6 IHookHelper接口(可略看)... 3

1.7 IActiveView接口... 3

1.8 IScreenDisplay接口... 4

1.9 IDisplayTransformation接口... 4

1.10 IFeature接口... 5

1.11 IZAware接口... 5

1.12 IMAware接口... 5

1.13 IGraphicsContainer接口... 6

1.14 IColor接口... 6

1.15 IRgbColor接口... 7

1.16 IPictureMarkerSymbol接口... 7

1.17 IMarkerElement接口... 7

1.18 IMap接口... 8

1.19 IElement接口... 8

2 添加障碍点类AddNetBarriersTool:BaseTool9

2.1 内容参考1.9

3 添加最短路径分析类ShortPathSolveCommand:BaseCommand. 9

3.1 INAContext接口... 9

3.2 INetworkDataset接口... 9

3.3 ILayer接口... 9

3.4 INetworkLayer接口... 10

3.5 INASolver接口... 10

3.6 INALayer接口... 10

3.7 IGPMessages接口... 11

3.8 ICompositeLayer接口... 11

3.9 IGeoDataset接口... 11

3.10 IEnvelope接口... 12

4 添加NetWorkAnalysClass类... 12

4.1 IWorkspace接口... 12

4.2 IWorkspaceFactory接口... 12

4.3 INAClass接口... 13

4.4 INamedSet接口... 13

4.5 INAClassLoader接口... 13

4.6 INALocator接口... 14

4.7 INAClassFieldMap接口... 14

4.8 IFeatureCursor接口... 14

4.9 INAContextEdit接口... 15

4.10 IDENetworkDataset接口... 15

4.11 IDatasetComponent接口... 15

4.12 IDatasetContainer3接口... 16

4.13 IFeatureDataset接口... 16

4.14 IFeatureDatasetExtension接口... 16

4.15 IFeatureDatasetExtensionContainer接口... 17

4.16 IDataset接口... 17

5 完善主界面类... 17

5.1 ICommand接口... 17

5.2 IMapControlDefault接口... 18

5.3 RuntimeInfo Class(可略看)... 18

 


 


第1章   最短配送路径分析中所用类和接口的作用详解

1 添加站点类AddNetStopsTool:BaseTool

第1章  

1  

1.1 BaseTool:BaseCommand

1)  简介

一个抽象类,旨在为ArcGIS创建新的工具类提供有效的方法。继承BaseTool来创建一个新的自定义工具。这个类来自BaseCommand类。

2)       Protected Fields(字段)

Name

       Description

m_bitmap

The bitmap(位图) that is used as the icon on this command

m_caption

The caption(标题) of this command

m_category

The name of the category with which the command is associated

(与此命令相关联的类别的名称,)

m_message

The statusbar(状态栏 ) message for this command

m_toolTip

       The tooltip(工具提示) for this command

m_name

       A string used for identification of this command

(用于标识此命令的字符串。)

m_cursor

A System.Windows.Forms.Cursor that is used for this tool

3)       Remarks(备注)

Note to inheritors: You must override(重载) theOnCreate method, inherited from BaseCommand. Generally you will also override the OnMouseDown,OnMouseMove and/or OnMouseUp methods of the BaseTool and in those membersperform(执行) the mainactions of your custom(自定义) tool class.

1.2 IFeatureWorkspace接口

1)       简介

Provides access to members that create and open varioustypes of datasets and other workspace level objects.(提供对创建和打开各种类型的数据集和其他工作空间级别对象的成员的访问权限。)

2)       Members(成员)

Name

Description

OpenFeatureClass

Opens an existing(存在的) feature class.

 

 

1.3 IFeatureClass接口

1)       简介

Provides access to members that control the behavior andproperties of a feature class.(提供对控制要素类行为和属性的成员的访问权限。)

2)       Members(成员)

Name

Description

FeatureCount

The number of features selected by the specified(指定的) query.

CreateFeature

Create a new feature, with a system assigned object ID and null property values.(用系统分配的对象ID和空属性值创建一个新要素)

Search

Returns an object cursor that can be used to fetch feature objects selected by the specified query.(返回可用于获取由指定查询选择的要素对象的对象游标)

1.4 ITable接口

1)       简介

Provides access to members that return information aboutand manage tables.(提供对返回有关和管理表的成员的访问权限。)

2)       Members(成员)

Name

Description

DeleteSearchedRows

Delete the Rows in the database selected by the specified query.

RowCount

The number of Rows selected by the specified query.(通过指定查询选择的行数)

1.5 IPoint接口

1)       简介

Provides access to members that define two dimensionalpoints.(提供对定义二维点的成员的访问权限。)

2)       Members(成员)

Name

Description

SpatialReference

The spatial reference associated with this geometry.(与此几何关联的空间参考。)

1.6 IHookHelper接口(可略看)

1)       简介

Provides access to members needed when developing commandsto work with the MapControl, PageLayoutControl, ArcMap, and custom controls andapplications.(在开发与MapControl,PageLayoutControl,ArcMap以及自定义控件和应用程序一起使用的命令时,提供对所需成员的访问。)

2)       Members(成员)

Name

Description

Hook

Hook object that should be the same as the hook object passed in ICommand::OnCreate.

ActiveView

Active view of hooked control or application.

1.7 IActiveView接口

1)       简介

Provides access to members that control the active view -the main application window.(提供对控制活动视图的成员的访问权限 - 主应用程序窗口。)

 

2)       Members(成员)

Name

Description

ScreenDisplay

The screen display used by the view.

Extent

The visible extent rectangle.(矩形)

FocusMap

The map that tools and controls act on.(工具和控件作用的地图。)

PartialRefresh

Draws the specified view phase. Use an envelope of zero to draw the entire phase.(绘制指定的视图阶段。使用零包络绘制整个阶段。)

Refresh

Causes the entire view to draw.(  使整个视图绘制。)

1.8 IScreenDisplay接口

1)       简介

Provides access to members that control Screen Display.(提供对控制屏幕显示的成员的访问权限)

2)       Members(成员)

Name

Description

DisplayTransformation

The transformation used by the display.

1.9 IDisplayTransformation接口

1)       简介

Provides access to members that control DisplayTransformation.(提供对控制显示转换的成员的访问权限。)

2)       Members(成员)

Name

Description

ToMapPoint

Calculates a point in map coordinates corresponding to the device point.(计算设备点对应的地图坐标中的点。)

VisibleBounds

Visible extent in world coordinates.

1.10 IFeature接口

1)       简介

Provides access to members that return and set propertiesof a feature.

2)       Members(成员)

Name

Description

Shape

A reference to the default shape for the feature.(对该要素的默认形状的引用。)

Store

Stores the row.

1.11 IZAware接口

1)       简介

Indicator interface that identifies geometries that canhave persistent Z values attached to their vertices.(指示器接口,用于识别可以将持久Z值附加到顶点的几何图形。)

2)       Members(成员)

Name

Description

ZAware

Indicates whether or not the geometry is aware of and capable of handling Zs.(指示几何是否知道并且能够处理Zs。)

3)       Remarks

Although the Z attribute refers to the 3-Dimensionaldepthof the point, the point still spatially exists in only 2-Dimensions with a Zattribute.  Further, the point must beZAware to make use of the Z attribute.(虽然Z属性指的是点的三维深度,但该点仍然在空间上仅存在于具有Z属性的2维中。此外,该点必须是ZAware才能使用Z属性。)

1.12 IMAware接口

1)       简介

Indicator interface that identifies geometric objects thatcan have persistent M values attached to their vertices.(指示器接口,用于标识可以将持久M值附加到其顶点的几何对象。)

2)       Members(成员)

Name

Description

MAware

       Indicates whether or not the geometry is aware of and capable of handling Ms.(指示几何体是否知道并能够处理MS。)

3)       Remarks

The M attribute is a measure that can be used similar to anaddress for determining position along a path.(M属性是可用于类似于沿着路径确定位置的地址的度量。)

1.13 IGraphicsContainer接口

1)       简介

Provides access to members that control the GraphicsContainer.(提供对控制图形容器的成员的访问。)

2)       Members(成员)

Name

Description

AddElement

Add a new graphic element to the layer.

DeleteAllElements

Delete all the elements.

1.14 IColor接口

1)       简介

Provides access to members that control the basic colorinterface.(提供对控制基本颜色界面的成员的访问权限。)

2)       Members(成员)

Name

Description

RGB

The RGB value of color.

1.15 IRgbColor接口

1)       简介

Provides access to members that control the RGB colorvalues.(提供对控制RGB颜色值的成员的访问权限。)

2)       Members(成员)

Name

Description

Red

The red component(分量) of an IRgbColor (0-255).

Green

The green component of an IRgbColor (0-255).

Blue

The blue component of an IRgbColor (0-255).

1.16 IPictureMarkerSymbol接口

1)       简介

Provides access to members that control the raster (bitmap)marker symbol.(提供对控制栅格(位图)标记符号的成员的访问权限。)

2)       Members(成员)

Name

Description

BitmapTransparencyColor

Color within bitmap indicating transparency.(位图中的颜色表示透明度。)

CreateMarkerSymbolFromFile

Create symbol from picture file.( 从图片文件中创建符号。)

       Size

Marker symbol size.

1.17 IMarkerElement接口

1)       简介

Provides access to members that control the Marker element.(提供对控制标记元素的成员的访问权限。)

2)       Members(成员)

Name

Description

Symbol

Marker symbol this element uses to draw itself.(此元素用于绘制自己的标记符号。)

1.18 IMap接口

1)       简介

Provides access to members that control the map.(提供对控制地图的成员的访问权限。)

2)       Members(成员)

Name

Description

SpatialReference

The spatial reference of the map.

AddLayer

Adds a layer to the map.

LayerCount

Number of layers in the map.

DeleteLayer

Deletes a layer from the map.

Layer

The layer at the given index.

1.19 IElement接口

1)       简介

Provides access to members that control the Element.

2)       Members(成员)

Name

Description

Geometry

Shape of the element as a geometry.

2 添加障碍点类AddNetBarriersTool:BaseTool

2.1 内容参考1.

3 添加最短路径分析类ShortPathSolveCommand:BaseCommand

3.1 INAContext接口

1)       简介

Provides access to the network analysis context.(提供对网络分析上下文的访问。)

2)       Members(成员)

Name

Description

Solver

The function used for the analysis.(    用于分析的功能。)

NAClasses

The collection of classes associated with the analysis.(与分析相关的类的集合)

Locator

The locator used for finding network locations for class items.(用于查找类项目的网络位置的定位器)

3.2 INetworkDataset接口

1)       简介

Provides access to members that query the schema of thenetwork dataset.(提供对查询网络数据集模式的成员的访问权限。)

2)       Members(成员)

Name

Description

 

 

3.3 ILayer接口

1)       简介

Provides access to members that work with all layers.(提供对使用所有图层的成员的访问权限)

2)       Members(成员)

Name

Description

Name

Layer name.

Visible

Indicates if the layer is currently visible.

3.4 INetworkLayer接口

1)       简介

Provides access to members that control a network layer.(提供对控制网络图层的成员的访问权限。)

2)       Members(成员)

Name

Description

NetworkDataset

       The Network Dataset used to define the layer.(网络数据集用于定义图层)

3.5 INASolver接口

1)       简介

Provides access to the common interface for all networksolvers.(提供对所有网络求解器的通用接口的访问。)

2)       Members(成员)

Name

Description

DisplayName

The display name of the solver.

CreateLayer

Makes a new network analysis layer for the solver context.

CreateContext

Creates the analysis context for the solver.

3.6 INALayer接口

1)       简介

Provides access to the network analysis layer.

2)       Members(成员)

Name

Description

 

 

 

 

3.7 IGPMessages接口

1)       简介

Provides access to the properties of a Geoprocessormessage.(提供对地理处理器消息属性的访问。)

2)       Members(成员)

Name

Description

 

 

 

 

3.8 ICompositeLayer接口

1)       简介

Provides access to members that work with a collection oflayers that behaves like a single layer.(提供对使用像单层一样的图层集合的成员的访问权限。)

2)       Members(成员)

Name

Description

Count

Number of layers in the collection.

3.9 IGeoDataset接口

1)       简介

Provides access to members that provide information about aGeographic Dataset.(提供对提供有关地理数据集信息的成员的访问权限)

2)       Members(成员)

Name

Description

Extent

The extent of the GeoDataset.

3.10 IEnvelope接口

1)       简介

Provides access to methods and properties of envelopes.

2)       Members(成员)

Name

Description

Expand

Moves the X and Y coordinates of the sides toward or away from each other.(   将边的X和Y坐标移向或移离彼此。)

4 添加NetWorkAnalysClass类

4.1 IWorkspace接口

1)       简介

Provides access to members that have information about theworkspace.(提供对具有关于工作空间信息的成员的访问权限。)

2)       Members(成员)

Name

Description

 

 

 

4.2 IWorkspaceFactory接口

1)       简介

Provides access to members that create and open workspacesand supply workspace factory information.(提供对创建和打开工作空间并提供工作空间工厂信息的成员的访问权限)

2)       Members(成员)

Name

Description

OpenFromFile

Opens the workspace specified by the given file name.(通过给定的文件名称打开指定的工作空间)

4.3 INAClass接口

1)       简介

Provides access to properties/methods common to all networkanalysis classes.(提供对所有网络分析类通用的属性/方法的访问)

2)       Members(成员)

Name

Description

DeleteAllRows

Remove all items added to the class.

4.4 INamedSet接口

1)       简介

Provides access to a collection of named items.(提供对指定项目集合的访问)

2)       Members(成员)

Name

Description

ItemByName

The item corresponding to a given name.( 该项目对应于给定的名称。)

4.5 INAClassLoader接口

1)       简介

Provides access to populate network analysis classes inpreparation for analysis.(提供对为分析准备填充网络分析类的访问)

2)       Members(成员)

Name

Description

Locator

The locator to be used.

NAClass

The network analysis class.

FieldMap

The field mapping definition.

Load

Populate(填充) the network analysis class.

4.6 INALocator接口

1)       简介

Provides access to properties that apply to all networklocators.(提供对适用于所有网络定位器的属性的访问。)

2)       Members(成员)

Name

Description

SnapTolerance

The distance to search.

4.7 INAClassFieldMap接口

1)       简介

Provides access to the the mapping of input fields tooutput fields.(提供对输入字段到输出字段映射的访问)

2)       Members(成员)

Name

Description

MappedField

The output field name mapped to a given input field name.(输出字段名称映射到给定的输入字段名称。)

 

 

4.8 IFeatureCursor接口

1)       简介

Provides access to members that hand out enumeratedfeatures, field collections and allows for the updating, deleting and insertingof features.(提供对取出枚举要素、字段集合并允许更新、删除和插入要素的成员的访问。)

2)       Members(成员)

Name

Description

 

 

4.9 INAContextEdit接口

1)       简介

Provides access to the editable properties of a networkanalysis context.(提供对网络分析上下文的可编辑属性的访问权限)

2)       Members(成员)

Name

Description

ContextChanged

Message all of the network analysis agents that the analysis context has changed.(向分析上下文已更改的所有网络分析代理发送消息)

Bind

Prepare the context for analysis based upon the current network dataset schema.(根据当前网络数据集模式准备分析上下文)

4.10 IDENetworkDataset接口

1)       简介

Provides access to members that describe network datasetdata elements.(提供对描述网络数据集数据元素的成员的访问权限)

2)       Members(成员)

Name

Description

 

 

4.11 IDatasetComponent接口

1)       简介

Provides access to the common functionality found on alldataset components.(提供对所有数据集组件上常见功能的访问)

2)       Members(成员)

Name

Description

DataElement

       The data element corresponding to the dataset component.(数据元素对应的数据集组件)

4.12 IDatasetContainer3接口

1)       简介

Provides access to members that return datasets by name, IDand index.(提供对按名称,ID和索引返回数据集的成员的访问权限)

2)       Members(成员)

Name

Description

DatasetByName

The dataset of the specified type with the specified name.(具有指定名称的指定类型的数据集)

4.13 IFeatureDataset接口

1)       简介

Provides access to members that create and open varioustypes of datasets and other workspace level objects.(提供对创建和打开各种类型的数据集和其他工作空间级别对象的成员的访问权限)

2)       Members(成员)

Name

Description

OpenFeatureDataset

Opens an existing feature dataset.

4.14 IFeatureDatasetExtension接口

1)       简介

Provides access to standard functionality found in allfeature dataset extensions.(提供对所有要素数据集扩展中的标准功能的访问)

2)       Members(成员)

Name

Description

 

 

4.15 IFeatureDatasetExtensionContainer接口

1)       简介

Provides access to the collection of feature datasetextensions.(提供对要素数据集扩展的集合的访问)

2)       Members(成员)

Name

Description

FindExtension

Provides access to the feature dataset extension that supports the specified dataset type.(提供对支持指定数据集类型的要素数据集扩展的访问)

4.16 IDataset接口

1)       简介

Provides access to members that supply dataset information.(提供对提供数据集信息的成员的访问权限。)

2)       Members(成员)

Name

Description

 

 

5 完善主界面类

5.1 ICommand接口

1)       简介

Provides access to members thatdefine a COM command.

2)       Members(成员)

Name

Description

OnCreate

Occurs when this command is created.(在创建此命令时发生)

5.2 IMapControlDefault接口

1)       简介

Provides access to members that control the MapControl.

2)       Members(成员)

Name

Description

CurrentTool

Current active tool for the MapControl. Set to nothing to clear the tool.(  当前的MapControl活动工具。设置为无效以清除该工具。)

Object

A property that returns the underlying control. This can be used when the control is inside a wrapper object that has been added by a development environment.(返回基础控件的属性。当控件位于由开发环境添加的包装对象中时,可以使用它)

ActiveView

The active view of the Map contained by the MapControl.(MapControl包含的Map的活动视图)

Layer

Layer at the supplied index.

LayerCount

Number of layers in the Map.

DeleteLayer

Removes a Layer from the Map's collection of layers at the specified index position.

Refresh

Redraws the Map, optionally just redraw specified phases or envelope.

3)       Remarks(备注)

The CurrentTool is the Tool used to interact will theMapControl's display. Always check if a tool is enabled before setting it tothe CurrentTool property, otherwise a user will be able to use a tool that isactually disabled.

5.3 RuntimeInfo Class(可略看)

1)       简介

The product and version information associated with aspecified ArcGIS installation.(与指定ArcGIS安装关联的产品和版本信息)

2)       Members(成员)

Name

Description

GetType

Gets the Type of the current instance.

(Inherited from Object.)

Path

Gets the installation path.

ToString

Returns a String that represents the current Object.

(Inherited from Object.)

第2章 地图操作

1 数据视图与布局视图的同步

1.1 IObjectCopy接口

1)       简介

Provides access to members to copy objects by value. Theobject must support IPersistStream to be copied.(提供对成员的访问权限以按值复制对象。该对象必须支持复制IPersistStream。)

2)       Members(成员)

Name

Description

Copy

Obtains a new object which is a copy of the input object.

Overwrite

Overwrites the object with the contents of input object.(用输入对象的内容覆盖对象。)

1.2 IPageLayoutControl接口

1)       简介

提供对控制PageLayoutControl的成员的访问。

2)       Members(成员)

Name

Description

ActiveView

The active view of the PageLayout contained by the PageLayoutControl.

Refresh

Redraws the PageLayout, optionally just redraw specified phases or envelope.

 


评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值