arcgis三维开发帮助文档(vb)内容摘要:

Path(m_pPointCollection,m_sceneGraph)。 m_l++。 } else m_l=0。 } //画运动点的 DrawTarget(m_pNext,m_sceneGraph)的实现 void CMGis3DView:rawTarget(IPointPtr pRadarLocation, ISceneGraphPtr pScenGraph) { IGeometryPtr pGeometry。 pGeometry=pRadarLocation。 IElementPtr pElement(CLSID_MarkerElement)。 m_pElement=pElement。 m_pElementput_Geometry(pGeometry)。 IMarkerElementPtr pMarkerElement(m_pElement)。 //create RGB color IRgbColorPtr pRGB(CLSID_RgbColor)。 pRGBput_Red(220)。 pRGBput_Green(0)。 pRGBput_Blue(0)。 //以下为创建 3DMarker IMarker3DPlacementPtr pMarker3DPlacement。 IMarker3DSymbolPtr pMarker3DSymbol(CLSID_Marker3DSymbol)。 pMarker3DSymbolCreateFromFile(CComBSTR(_T (D:\\GisEx\\data\\3dmodel_texture\\multigen_models\\streetscene\\)))。 pMarker3DSymbolRestrictAccessToShape()。 IMarkerSymbolPtr pMarkerSymbol(CLSID_Marker3DSymbol)。 pMarkerSymbolput_Color(pRGB)。 pMarker3DPlacement=pMarker3DSymbol。 pMarker3DPlacementput_Depth(1)。 pMarker3DPlacementput_Units(esriMeters)。 pMarker3DPlacementput_Size(300)。 pMarker3DPlacementput_Color(pRGB)。 pMarkerSymbol=pMarker3DPlacement。 pMarkerElementput_Symbol(pMarkerSymbol)。 m_pTargetsPointsAddElement(m_pElement)。 m_pGcon3DAddElement(m_pElement)。 } //画运动点的轨迹函数的实现 void CMGis3DView:rawPath(IPointCollectionPtr pPointCollection, ISceneGraphPtr pSceneGraph) { double tx,ty,tz,tz2。 IGeometryPtr pGeoIn。 IGeometryPtr pGeoOut。 IPointPtr pS(CLSID_Point)。 IPointPtr pE(CLSID_Point)。 long c。 pSputref_SpatialReference(m_pSpRe)。 pEputref_SpatialReference(m_pSpRe)。 pSProject(m_pSpRe)。 pEProject(m_pSpRe)。 double zFactor。 m_sceneget_ExaggerationFactor(amp。 zFactor)。 //从点集获取两点并给曲线 pPath m_pPointCollectionget_PointCount(amp。 c)。 m_pPointCollectionget_Point(c1,amp。 pS)。 m_pPointCollectionget_Point(c2,amp。 pE)。 IPolycurvePtr pPath(CLSID_Polyline)。 pPathSmooth(2)。 pPathput_FromPoint(pS)。 pPathput_ToPoint(pE)。 pGeoIn=pPath。 //设置曲线参照 tin 表面输出。 问题:本在定时器函数中设定了各点的 z 坐标,但z 坐标不起作用,为什么。 请指点。 m_pSufInterpolateShape(pGeoIn,amp。 pGeoOut)。 //用于使轨迹在 tin 表面运动。 pGeoInputref_SpatialReference(m_pSpRe)。 pGeoInProject(m_pSpRe)。 IElementPtr pElement(CLSID_LineElement)。 pElementput_Geometry(pGeoOut)。 //以下设置线型 ILineElementPtr pLineElement(pElement)。 IRgbColorPtr pRGB(CLSID_RgbColor)。 pRGBput_Red(255)。 pRGBput_Green(128)。 pRGBput_Blue(128)。 ISimpleLine3DSymbolPtr pSLnSymbol(CLSID_SimpleLine3DSymbol)。 pSLnSymbolput_Style(esriS3DLSTube)。 ILineSymbolPtr pl(pSLnSymbol)。 plput_Color(pRGB)。 plput_Width(5)。 pLineElementput_Symbol(pl)。 m_pGcon3DAddElement((IElementPtr)pLineElement)。 m_sceneGraphRefreshViewers()。 } 1 刷新这样效果最佳 esriViewGraphics, pElement, Nothing 2 你的飞行器没必要每次增加、删除,直接使用 UpdateElement 3 你的轨迹没浮起来是没对轨迹的所有点使用 IZAware 这个吧,或是你的 POINT 的 Z 没值吧 谢谢指点 ,我在 scenecontrol 中没发现有 PartialRefresh()啊 还有在 graphiccontainer3d 中没发 现有 updateelement. IActiveView:artialRefresh uses its knowledge of the cache layout to invalidate as little as possible IGraphicsContainer Interface ...... UpdateElement The graphic element39。 s properties have changed. IGraphicsContainer3D Interface 中没发现有 UpdateElement 在 下有 PartialRefresh 这个函数 在 AxtocControl 中关联 AxSceneContro 时可以用 l AxSceneControl 中打印地图 DrawToMetafile Method (esri3DAnalyst) Draws the contents of the viewer to a device. Syntax (hDC, resolutionFactor, left, top, right, bottom, bOffScreen ) 下面这种获得 hdc 的办法不知道对你是否有用 Image image = new Bitmap(800, 600)。 g = (image)。 tagRECT rect = new tagRECT()。 = = 0。 = 800。 = 600。 // 填充背景色 (白色 ) (, 0, 0, 800, 600)。 (().ToInt32(), 0, ref rect, null, null)。 ()。 就是用 DrawToMetafile (hDC, resolutionFactor, left, top, right, bottom, bOffScreen ) Print Active View Description: This sample demonstrates how to print a map programmatically. It will work from either Data View or Page Layout View. The PrintActiveView subroutine demonstrates the minimum steps necessary to output a correctly scaled page to the application39。 s current printer. The PrintActiveView2() subroutine demonstrates how to reproduce the full functionality of ArcMap39。 s print mand, including using a Win32 API device context functions to detect and pensate for the physical offset of the print device. Products: ArcView: VBA Platforms: Windows Minimum ArcGIS Release: How to use: [VBA] Paste this code into the Visual Basic editor and select Run Sub from the Run menu. Private Declare Function GetDeviceCaps Lib gdi32 (ByVal hDC As Long, ByVal nIndex As Long) As Long Private Declare Function CreateIC Lib gdi32 Alias CreateICA (ByVal lpDriverName As String, ByVal lpDeviceName As String, _ ByVal lpOutput As String, ByVal lpInitData As Long) As Long Public Sub PrintActiveView() Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pMxApp As IMxApplication Set pMxApp = 39。 Create a readonly reference to the application39。 s current printer Dim pPrinter As IPrinter Set pPrinter = 39。 Initialize the three bounds variables used for printing. Leave VisibleBounds 39。 set to Nothing for n。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。