gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
阅读:2271回复:8

基于AE(SceneControl)的要素信息查询源代码

楼主#
更多 发布于:2007-03-06 14:29
<P>实现在SceneControl的信息查询.</P>
<P>代码下载:</P>
<P><a href="attachment/2007-3/20073614284291257.rar">2007-3/20073614284291257.rar</a><BR></P>
<P>部分代码:</P>
<DIV >Private Sub ArcSceneControl_OnMouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)<BR>              ArcSceneControl.SceneGraph.IsNavigating = False<BR>              Call Identify3DMap(X, Y)<BR>end sub<BR><BR>'输入:当前3D地图,x坐标,y坐标,引用公共变量M_pFeatureArray<BR>'输出:对3D地图上的目标选中,调用frmidentify显示选中目标的信息<BR>'功能:单点查询<BR>'程序:tjh 2005.1.29<BR>Private Sub Identify3DMap(X As Long, Y As Long)<BR>    <BR>    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''<BR>    <BR>        'QI for IBasicMap from IScene<BR>      Dim pBasicMap As IBasicMap<BR>      Set pBasicMap = ArcSceneControl.SceneGraph.Scene<BR>      'QI for IScreenDisplay from ISceneGraph<BR>      Dim pScreenDisplay As IScreenDisplay<BR>      Set pScreenDisplay = ArcSceneControl.SceneGraph<BR>   <BR>      'Translate screen coordinates into mulitple 3D objects<BR>      Dim pHit3DSet As IHit3DSet<BR>      ArcSceneControl.SceneGraph.LocateMultiple ArcSceneControl.SceneGraph.ActiveViewer, X, Y, esriScenePickGeography, False, pHit3DSet<BR>      <BR>      'Reduce the hit set to the top<BR>      'most hits and one hit per layer<BR>      pHit3DSet.Topmost 1.5<BR>      pHit3DSet.OnePerLayer<BR>      pHit3DSet.Topmost 1.1<BR>      <BR>      'Get an array of hits<BR>      Dim pArray As IArray<BR>      Set pArray = pHit3DSet.Hits<BR>      If pArray.Count = 0 Then Exit Sub<BR>    <BR>      'Loop through each hit<BR>      Dim i As Integer<BR>      ReDim M_pFeatureArray(0)<BR>      For i = 0 To pArray.Count - 1<BR>        <BR>        'Get the hit<BR>        Dim pHit3D As IHit3D<BR>        Set pHit3D = pArray.Element(i)<BR>        'Get the hit location<BR>        Dim pPoint As IPoint<BR>        Set pPoint = pHit3D.Point<BR>        If pPoint Is Nothing Then Exit Sub<BR>        'Get the layer that was hit<BR>        If Not TypeOf pHit3D.Owner Is ILayer Then Exit Sub<BR>        Dim pLayer As ILayer<BR>        Set pLayer = pHit3D.Owner<BR>        'Get the feature that was hit<BR>        Dim pObject As IUnknown<BR>        Set pObject = pHit3D.object<BR>        <BR>        'Add to identify dialog<BR>        ReDim Preserve M_pFeatureArray(UBound(M_pFeatureArray) + 1)<BR>        Dim pFeature As iFeature<BR>        Set pFeature = pHit3D.object<BR>        Set M_pFeatureArray(UBound(M_pFeatureArray) - 1).iFeature = pFeature<BR>        M_pFeatureArray(UBound(M_pFeatureArray) - 1).iLayerName = CStr(pLayer.Name)<BR>    <BR>      Next i<BR>    <BR>     '''''''''''''''''''''''''''''''''''''''''''''''''<BR>     If frmIdentify.Visible = False Then<BR>        frmIdentify.Show 0<BR>     End If<BR>      frmIdentify.SetFocus<BR>     Call frmIdentify.InitTreeView<BR>End Sub</DIV>
喜欢0 评分0
GIS麦田守望者,期待与您交流。
败事有余
路人甲
路人甲
  • 注册日期2006-12-31
  • 发帖数39
  • QQ
  • 铜币247枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-03-06 14:44
希望可以发一点 java+AE 来实现的例子。<img src="images/post/smile/dvbbs/em08.gif" />
举报 回复(0) 喜欢(0)     评分
败事有余
路人甲
路人甲
  • 注册日期2006-12-31
  • 发帖数39
  • QQ
  • 铜币247枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2007-03-06 14:45
<P>希望你可以发一些关于java+AE 开发的一些例子或一些学习资料。</P>
<P>谢谢</P><img src="images/post/smile/dvbbs/em08.gif" />
举报 回复(0) 喜欢(0)     评分
wisdomy04
路人甲
路人甲
  • 注册日期2006-06-17
  • 发帖数26
  • QQ
  • 铜币265枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2007-03-08 15:08
<P>大哥你以上代码我调试不能通过,</P>
<P>公共变量M_pFeatureArray是如何定义的,</P>
<P>Set M_pFeatureArray(UBound(M_pFeatureArray) - 1).iFeature = pFeature<BR>M_pFeatureArray(UBound(M_pFeatureArray) - 1).iLayerName = CStr(pLayer.Name)</P>
<P>以上代码中iFeature,iLayerName属性是如何实现的,</P>
<P>我的邮箱<a href="mailtwisdomy04@163.com" target="_blank" >wisdomy04@163.com</A>,把你调试成功的发给我可以不</P>
<P>感激不尽,,,<BR></P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
4楼#
发布于:2007-03-08 15:42
<TABLE width="100%">

<TR>
<TD class=subtitle colSpan=6>内容摘要</TD></TR>
<TR>
<TD class=txt colSpan=6>如何实现3D环境中的3D查询功能</TD></TR>
<TR>
<TD class=subtitle colSpan=6>过程描述</TD></TR>
<TR>
<TD class=txt colSpan=6>
<P>Public Type m_pObjArray<BR>      iFeature As iFeature<BR>      iLayerName As String<BR>End Type<BR>Public M_pFeatureArray() As m_pObjArray</P>
<P>Private Sub Identify3DMap(X As Long, Y As Long)<BR>    <BR>    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''<BR><BR>    <BR>        'QI for IBasicMap from IScene<BR>      Dim pBasicMap As IBasicMap<BR>      Set pBasicMap = ArcSceneControl.SceneGraph.Scene<BR>      'QI for IScreenDisplay from ISceneGraph<BR>      Dim pScreenDisplay As IScreenDisplay<BR>      Set pScreenDisplay = ArcSceneControl.SceneGraph<BR>   <BR>      'Translate screen coordinates into mulitple 3D objects<BR>      Dim pHit3DSet As IHit3DSet<BR>      ArcSceneControl.SceneGraph.LocateMultiple ArcSceneControl.SceneGraph.ActiveViewer, X, Y, esriScenePickGeography, False, pHit3DSet<BR>      <BR>      'Reduce the hit set to the top<BR>      'most hits and one hit per layer<BR>      pHit3DSet.Topmost 1.5<BR>      pHit3DSet.OnePerLayer<BR>      pHit3DSet.Topmost 1.1<BR>      <BR>      'Get an array of hits<BR>      Dim pArray As IArray<BR>      Set pArray = pHit3DSet.Hits<BR>      If pArray.Count = 0 Then Exit Sub<BR>    <BR>      'Loop through each hit<BR>      Dim i As Integer<BR>      ReDim M_pFeatureArray(0)<BR>      For i = 0 To pArray.Count - 1<BR>        <BR>        'Get the hit<BR>        Dim pHit3D As IHit3D<BR>        Set pHit3D = pArray.Element(i)<BR>        'Get the hit location<BR>        Dim pPoint As IPoint<BR>        Set pPoint = pHit3D.Point<BR>        If pPoint Is Nothing Then Exit Sub<BR>        'Get the layer that was hit<BR>        If Not TypeOf pHit3D.Owner Is ILayer Then Exit Sub<BR>        Dim pLayer As ILayer<BR>        Set pLayer = pHit3D.Owner<BR>        'Get the feature that was hit<BR>        Dim pObject As IUnknown<BR>        Set pObject = pHit3D.object<BR>        <BR>        'Add to identify dialog<BR>        ReDim Preserve M_pFeatureArray(UBound(M_pFeatureArray) + 1)<BR>        Dim pFeature As iFeature<BR>        Set pFeature = pHit3D.object<BR>        Set M_pFeatureArray(UBound(M_pFeatureArray) - 1).iFeature = pFeature<BR>        M_pFeatureArray(UBound(M_pFeatureArray) - 1).iLayerName = CStr(pLayer.Name)<BR>    <BR>      Next i<BR>    <BR>     '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''<BR>     If frmIdentify.Visible = False Then<BR>        frmIdentify.Show 0<BR>     End If<BR>      frmIdentify.SetFocus<BR>     Call frmIdentify.InitTreeView<BR>End Sub<BR></P></TD></TR></TABLE>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
whmwxhanshan123
路人甲
路人甲
  • 注册日期2006-06-17
  • 发帖数3108
  • QQ
  • 铜币6445枚
  • 威望0点
  • 贡献值0点
  • 银元0个
5楼#
发布于:2007-03-08 20:10
<img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
gqs20000
路人甲
路人甲
  • 注册日期2005-01-06
  • 发帖数14
  • QQ
  • 铜币274枚
  • 威望0点
  • 贡献值0点
  • 银元0个
6楼#
发布于:2007-06-02 09:31
ok
举报 回复(0) 喜欢(0)     评分
whmwxhanshan123
路人甲
路人甲
  • 注册日期2006-06-17
  • 发帖数3108
  • QQ
  • 铜币6445枚
  • 威望0点
  • 贡献值0点
  • 银元0个
7楼#
发布于:2007-06-04 17:25
<img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
siddy
路人甲
路人甲
  • 注册日期2006-12-18
  • 发帖数9
  • QQ
  • 铜币136枚
  • 威望0点
  • 贡献值0点
  • 银元0个
8楼#
发布于:2007-06-04 19:39
<P>这几天正在看这方面的东西!!</P><img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部