资源描述
单击此处编辑母版标题,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,Skyline,软件系列培训,Skysymbol,:,曹巍,软件应用培训材料,二次开发篇,目录,SkyLine,框架体系,;,SkyLine,开发准备;,SkyLine,API,接口简介;,SkyLine,COM,的使用;,SkyLine,ActiveX,的使用,;,6.,SkyLine,编程举例,1.,SkyLine,框架体系,1.1,TerraExplorer,TerraExplorer,:,简洁、高效的,Skyline,产品浏览的免费工具,具备强大的浏览功能和简单的用户定置、空间分析等基础操作功能。,1.2,TerraExplorer,Pro,TerraExplorer,Pro,:,它是一个强大的、易于使用的交互式,3D,环境工具,具有编辑、注释、打印真实地物图象的功能。它允许用户塑造自己感兴趣的地方的“数字地球”,并可进行相应的编辑、注释、对象实体模型的建造、空间分析等功能;还可进行实时的,3D,地形浏览以及利用外部数据源如,GPS,的实时,3D,场景对象的跟踪等功能。,1.3,TerraDeveloper,TerraDeveloper,:,基于,ActiveX,的软件开发包,允许用户自定义,TerraExplorer,Pro,的应用和建立强大的,3D,地理空间用户界面。,1.4,各层次开发体系功能,2.,Skyline,开发准备,熟悉,SkyLine,软件的基本使用,熟练,COM,语言的使用,,如,VB/VC,、,.NET,、,Delphi,熟练脚本语言的使用,,如,VBScript/JavaScript,2.1 Skyline,主要开发工具,COM,接口,TerraExplorer,框架体系,HTML,(VBScript,JavaScript),VB/VC/Delphi,.NET,其它,COM,语言,2.2 Skyline,开发体系结构,内嵌式脚本开发,嵌入网页式开发,应用程序自定义开发,COM,接口技术,程序网络发布开发,应用程序浏览器,2.3 Skyline,的,特点、特性,简单、便捷、单一实例开发思想,基于,COM,技术开发,基于,OLE,技术的,ActiveX,技术,嵌入式开发与组件式开发有机统一,具备内置开发及功能定制,。,3.,Skyline API,接口简介,整合,TerraExplorer,、,TerraExplorer,Pro,和自定义应用等强大的技术方法,提供访问外部信息的扩展的方法的创建,如数据库或,GIS,文件;所有的接口都是基于,COM,协议技术。,3.1,TerraExplorer,Viewer,接口,ITerraExplorer4,(,Partial,),IPlane3,ITerrain3,IContainer,IRender4,ISnapShot2,IStartPosition,ITerraExplorerEvents4,IInformationTree4(Partial),IObjectManager4(Partial),3.2,TerraExplorer,Pro,接口,TerraExplorer,Viewer,接口,IObjectManager4,IInformationTree4,ICoordSys3,IScriptEngine,3.3,TerraExplorer,Developer,接口,TerraExplorer,Pro,接口,ITE3DWindow,_ITE3DWindowEvents,ITEInformationWindow,IMenu,4.Skyline COM,的使用,Skyline,的,COM,控件工具,TEArcSDE,Plugin,TEAscii,Plugin,TECollaboration,TEDetect,TEDxf,Plugin,TEFalconView,Tool,TEFlt,Plugin,TEGeoDB,Plugin,TERTE,Plugin,TEShape,Plugin,4.1 Skyline COM,的使用,-,VBScript,Declare Variables,Sub,Go2(),Assign Interfaces,Call a method,End sub,4.1 Skyline COM,的使用,-,VBScript,Dim,IPlane,Sub,Go2(),Set,IPlane,=TE.interface(“IPlane3”),IPlane.SetPosition,-102.0,27.5,3700000,10,0,0,0,-75.0,End sub,4.1 Skyline COM,的使用,-,VB,4.1 Skyline COM,的使用,-,VB,4.1 Skyline COM,的使用,-,VB,Dim,WithEvents,TE,As,TerraExplorer,Dim,IPlane,As,IPlane3,Private Sub,Form_Load(),Set,TE=,New,TerraExplorer,Set,IPlane,=,TE,End Sub,Private Sub,Command1_Click(),IPlane.SetPosition,-102#,27.5,3700000,End Sub,4.2 Skyline COM,的使用,-,Visual C+,4.2 Skyline COM,的使用,-,Visual C+,#import,C:Program.,TerraExplorer.exe,no_namespace,named_guids,CoInitialize(NULL,);,ITerraExplorer3Ptr pITerraExplorer3;,IPlane3Ptr,pIPlane,;,pITerraExplorer3.CreateInstance(CLSID_TerraExplorer);pITerraExplorer3.QueryInterface(IID_IPlane3,(IPlane3Ptr*)&,pIPlane,pIPlane,-,SetPosition,(-102.0,27.5,3700000.0,10.0,0.0,0.0,0.0,-75.0,0);,CoUninitialize,();,4.3,其它内置脚本开发,利用,VBScript,和内置常量,(,This,、,TerraExplorer,),显示定制信息;结合接口,IScriptEngine,可扩展其功能。,IPlane.SetPosition,-102.0,27.5,3700000,10,0,0,0,-75.0,Set,IPlane,=TerraExplorer.interface(IPlane3),5.1,Skyline ActiveX,的使用,VBScript,5.1,Skyline ActiveX,的使用,VB,5.1,Skyline ActiveX,的使用,VB,5.1,Skyline ActiveX,的使用,VB,5.2,Skyline ActiveX,的使用,Visual C+,5.2,Skyline ActiveX,的使用,Visual C+,5.2,Skyline ActiveX,的使用,Visual C+,6.1,SkyLine,编程举例,(VB),VB,打开一个,Fly,文件,Dim,OpenFlyFile,As ITerraExplorer4,Set,OpenFlyFile,=New,TerraExplorer,OpenFlyFile.LoadEx,“Http:,Skysymbolchina_bjdefault.fly,”,“”,“”,False,飞到指定目标,Dim,IPlane,As IPlane3,Set,Iplane,=New,TerraExplore,Iplane.FlyTo,946672.31,2113310.65,2000,100,0,0,FlyToTerrain,关闭指定图层,Dim,TempObject,As ITerraExplorerObject2,Dim,TempModel,As ITerrainModel2,Dim,InfoTree,As IInformationTree4,Set,InfoTree,=New,TerraExplorer,Set,TempObject,=InfoTree.GetObject(InfoTree.GetNextItem(0,10),If(,TempObject.ObjectType,=17)Then OT_MODEL,Set,TempModel,=,TempObject,If(,TempModel.Visible,=0)Then,TempModel.Visible,=True,Else,TempModel.Visible,=False,End If,End If,6.2,SkyLine,编程举例,(VBScript),VBScript,飞到指定目标,Sub,FlyTo,(),Set,IPlane3=TE.interface(IPlane3),IPlane3.FlyTo 946672.31,2113310.65,2000,100,0,0,FlyToTerrain,End Sub,6.2,SkyLine,编程举例,(VBScript),VBScript,生成折线,sub,CreatePolyline,(),Set,IObjectManager,=,TE.interface(IObjectManager,),Set,IPolyline,=,IObjectManager.CreatePolyline,(,CreateVertArray,(),16744703,0),end sub,Function,CreateVertArray,(),Dim,vert(6),vert(0)=952094.99,First vertex X-coordinate.,vert(1)=40.0,First vertex height.,vert(2)=2113817.05,First vertex Y-coordinate.,vert(3)=952280.91,Second vertex X-coordinate.,vert(4)=260.0,Second vertex height.,vert(5)=2114104.65,Second vertex Y-coordinate.,CreateVertArray,=,vert,End Function,获取和设置飞行器的方位,Sub,GetPosition,(),Set,IPlane3=TE.interface(IPlane3),IPlane3.GetPosition X,Y,Height,Yaw,Pitch,Roll,CameraDeltaYaw,CameraDeltaPitch,Msgbox,Plane position:&X&,&Y&,&Height,Msgbox,Plane orientation:&Yaw&,&Pitch&,&Roll,Msgbox,Camera offset:&,CameraDeltaYaw,&,&,CameraDeltaPitch,End Sub,Sub,SetPosition,(),Set,IPlane3=TE.interface(IPlane3),IPlane3.GetPosition X,Y,Height,Yaw,Pitch,Roll,CameraDeltaYaw,CameraDeltaPitch,IPlane3.SetPosition 1000,1000,1000,0,0,0,0,0,3320,End Sub,Sub,FlyTo,(),Set,IPlane3=TE.interface(IPlane3),IPlane3.FlyTo 946672.31,2113310.65,2000,100,0,0,FlyToTerrain,E
展开阅读全文