ArcGIS 10中的三维效率不错,运行很快是需要做优化的,其中非常重要的一点就是内存缓存的设置。在ArcGLobe中通过GlobeOption我就可以弹出选项卡,通过页面来设置各个需要内存的分配比例。那么ArcGIS Engine自己写的程序又是如何进行内存分配呢?下面分享ArcGIS Engine设置Memory Cache的方法。
Sub MemoryLimits()
Dim pDoc As IGMxDocument: Set pDoc = ThisDocument
Dim pScene As IScene: Set pScene = pDoc.Scene
Dim pGlobe As IGlobe: Set pGlobe = pScene
Dim pGP As IGlobeDisplay: Set pGP = pGlobe.GlobeDisplay
Dim pOptions2 As IGlobeAdvancedOptions2: Set pOptions2 = pGP.AdvancedOptions
Debug.Print "esriGlobeTileMemory:"
Dim iLimit As Long, sglCurrent As Single
Dim i As Integer, iTotal As Integer
For i = 0 To 6
pOptions2.GetTileMemory i, iLimit, sglCurrent
Debug.Print ConvertI(i), iLimit, sglCurrent
' pOptions2.SetTileMemory i, iLimit + 10
' Debug.Print i, iLimit, sglCurrent
iTotal = iTotal + iLimit
Next i
Debug.Print "Total Size of Memory Cache: ", iTotal
End Sub
Function ConvertI(i As Integer) As String
Select Case i
Case 0
ConvertI = "Image"
Case 1
ConvertI = "Elevation"
Case 2
ConvertI = "Point"
Case 3
ConvertI = "Line"
Case 4
ConvertI = "3DGeom"
Case 5
ConvertI = "3DTexture"
Case 6
ConvertI = "Text"
End Select
End Function
http://www.gisall.com/html/07/5607-3958.html