欢迎来到天天文库
浏览记录
ID:52329658
大小:923.01 KB
页数:17页
时间:2020-04-04
《理解对象模型图(OMD).ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、AO/AE编程基础(1)1.2理解对象模型图(OMD)LessonoverviewArcObject的对象模型图阅读一个对象的模型图类的类型类的相互关系接口、属性、方法的图标根据OMD图表编写程序2OMDshelpyouwritecodeShowinterfaces,methods,andpropertiesforeachclassShowrelationshipsbetweenclasses在几个图表中拥有超过1,500个类超过1,600个接口ArcObjectobjectmodeldiagrams3在哪里可以找到ArcGISOMD图表Start
2、>Programs>ArcGIS>ArcObjectsDeveloperHelp简单的、详细的类图PDFfiles电子书籍光盘中软件安装的目录中4Relationshipsymbols继承组成用来创建对应关系1:N联合*_____蛋鸟翅膀羽毛2AbstractClassClassClass小鸡CoClass巢CoClass*5类和他们相应的对象ArcMapobjectsMxDocumentMapLayer**FeatureLayerApplication6NotcreatableorinstantiableCanneverhaveinstances
3、ofanabstractclassDefinegeneralinterfacesforsubclassesSubclassesinheritinterfacesOMDsymbol:2Dshadedrectangle抽象类(没有阴影)7实例化类(Class)NoncreatableclassCannotcreatewiththeNewkeywordObtaininstancesfromotherobjectsOMDSymbol:3DRectanglewithnoshadeDimpNewRowAsIRowSetpNewRow=pTable.Create
4、Row生成8Creatable:UsetheNewkeywordDimpMapAsIMapSetpMap=NewMapInstantiable:ObtainfromotherobjectsDimpMapAsIMapSetpMap=pMxDocument.FocusMapOMDsymbol:Shaded3Drectangle可创建的类(CoClass)9Wheretobegin?GettingintotheOMD特殊的全局变量Application:IApplicationinterfaceoftheApplicationobjectThisDocu
5、ment:IDocumentinterfaceoftheMxDocumentobject阅读ArcMap或ArcCatalogOMD图表的入口ApplicationThisDocument10PropertyandmethodsymbolsProperty哑铃形状的图标MethodPropertyGet(read)PropertySet(write)11PropertyPut:MostArcObjectspropertiesPropertyholdsavalueoracopyofanobjectDonotuseSetkeywordPropertyP
6、utbyReference:SomeArcObjectspropertiesPropertyholdsareferencetoanobjectMustusetheSetkeyword如果引用对象发生了变化,对象的属性将同步受到影像SettingpropertiespLayer.Name="PortMoresby"'NoSetkeywordSetpLayer.FeatureClass=pMoresbyData'MustuseSet!12ReturnavalueName:StringReturnanobjectreferenceDocument:IDo
7、cumentStatusBar:IStatusBarGettingproperties返回一个值DimstrNameAsStringDimpDocAsIDocumentDimpBarAsIStatusBarstrName=Application.NameMsgBoxstrName返回一个引用SetpDoc=Application.DocumentSetpBar=Application.StatusBarpBar.Message(0)pDoc.Title13棒棒糖类型的图标()Findinginterfaces这些接口也是有效的。但是详细的属性和方法
8、必须在其它地方浏览。(e.g.,ObjectBrowser).该接口被本类使用.所有的属性和放都列表在类图中.继承接口是有
此文档下载收益归作者所有