理解对象模型图_第1页
理解对象模型图_第2页
理解对象模型图_第3页
理解对象模型图_第4页
理解对象模型图_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、AO/AE编程基础(1)1.2 理解对象模型图(OMD)Lesson overviewArcObject 的对象模型图 阅读一个对象的模型图类的类型类的相互关系接口、属性、方法的图标 根据OMD图表编写程序2OMDs help you write codeShow interfaces, methods, and properties for each classShow relationships between classes在几个图表中拥有超过 1,500 个类超过 1,600 个接口 ArcObject object model diagrams3在哪里可以找到ArcGIS OMD图表

2、Start Programs ArcGIS ArcObjects Developer Help简单的、详细的类图PDF files电子书籍光盘中软件安装的目录中4Relationship symbols继承组成用来创建对应关系 1:N联合*_蛋鸟翅膀羽毛2AbstractClassClassClass小鸡CoClass巢CoClass*5类和他们相应的对象ArcMap objectsMxDocumentMapLayer*FeatureLayerApplication6Not creatable or instantiableCan never have instances of an abst

3、ract classDefine general interfaces for subclassesSubclasses inherit interfacesOMD symbol: 2D shaded rectangle抽象类(没有阴影)7实例化类 (Class)Noncreatable classCannot create with the New keywordObtain instances from other objectsOMD Symbol: 3D Rectangle with no shadeDim pNewRow As IRowSet pNewRow = pTable.Cre

4、ateRow生 成8Creatable: Use the New keywordDim pMap As IMapSet pMap = New MapInstantiable: Obtain from other objectsDim pMap As IMapSet pMap = pMxDocument.FocusMapOMD symbol: Shaded 3D rectangle可创建的类 (CoClass)9Where to begin? Getting into the OMD特殊的全局变量Application: IApplication interface of the Applica

5、tion objectThisDocument: IDocument interface of the MxDocument object阅读 ArcMap 或 ArcCatalog OMD图表的入口ApplicationThisDocument10Property and method symbolsProperty哑铃形状的图标MethodProperty Get(read)Property Set(write)11Property Put: Most ArcObjects propertiesProperty holds a value or a copy of an objectDo

6、not use Set keyword Property Put by Reference: Some ArcObjects propertiesProperty holds a reference to an objectMust use the Set keyword如果引用对象发生了变化,对象的属性将同步受到影像Setting propertiespLayer.Name = Port Moresby No Set keywordSet pLayer.FeatureClass = pMoresbyData Must use Set!12Return a valueName: String

7、Return an object referenceDocument: IDocumentStatusBar: IStatusBarGetting properties返回一个值Dim strName As String Dim pDoc As IDocumentDim pBar As IStatusBarstrName = Application.NameMsgBox strName返回一个引用Set pDoc = Application.DocumentSet pBar = Application.StatusBar pBar.Message(0) pDoc.Title13棒棒糖类型的图标

8、 ( )Finding interfaces这些接口也是有效的。但是详细的属性和方法必须在其它地方浏览。(e.g., Object Browser).该接口被本类使用.所有的属性和放都列表在类图中.继承接口是有效的14FeatureLayer on Map Layer OMD概念上,这是一个对象模型事实上, 被分别在几张图表里存放虫洞表现了图表与图表间的连接关系WormholesElement on ArcMap OMD虫洞15Example: MxDocument Map layerGet the FocusMap (active data frame) from MxDocumentMxD

9、ocument may have several Maps ( * )Get a layer from the the MapMany types of layers ( )Dim pMxDoc As IMxDocumentSet pMxDoc = ThisDocumentDim pMap As IMapSet pMap = pMxDoc.FocusMapDim pLayer As ILayerSet pLayer = pMap.Layer(1)Is pLayer a FeatureLayer?If TypeOf pLayer Is IFeatureLayer ThenMsgBox Yes!, its a feature layerEnd IfMxDocumentMapFeatureLayerLayer*OthersA16Exercise 2 overviewInterpret the ArcObject ob

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论