C#
Development licensing | Deployment licensing |
---|---|
Engine Developer Kit | ArcView: 3D Analyst |
ArcEditor: 3D Analyst | |
ArcInfo: 3D Analyst | |
Engine Runtime: 3D |
How to use
See Using the samples for help on compiling, setting up the debugger, and running the sample (either an exe or dll).
Running the sample
- Open Visual Studio's integrated development environment (IDE).
- Click Debug and click Start Debugging, or compile the sample and run the created .exe.
Using the sample
- When the sample starts, you will see x,y,z axes rendered in an embedded SceneControl and buttons on the right side of the form.当示例开始时,您将看到嵌入SceneControl中呈现的x、y、z轴以及窗体右侧的按钮。
- Click a button on the right side of the Windows form's user interface (UI) to render the selected example in the embedded SceneControl with the x,y,z axes (left in place to clarify where the multipatch is positioned in 3D space). The geometry is rendered with a solid fill color and the outline that makes up the multipatch geometry is rendered for illustrative purposes.单击Windows窗体用户界面(UI)右侧的按钮,以在嵌入的SceneControl中使用x、y、z轴呈现所选示例(左对齐以明确多批次在三维空间中的位置)。几何体使用实心填充颜色渲染,构成多批次几何体的轮廓渲染用于说明目的。
- The header for the sections of buttons indicates the type of geometry that is rendered, and each of the numbered buttons corresponds to a different example of that type of geometry. For example, clicking the 1 button on the Composite section displays two cylinders and two pyramids. Clicking the 3 button on the Composite section results in the house shown in the following illustration. Each click clears the screen allowing the just clicked item to appear.按钮部分的标题指示渲染的几何体类型,每个编号的按钮对应于该类型几何体的不同示例。例如,单击“组合”部分上的1按钮将显示两个圆柱体和两个棱锥体。单击组合截面上的3按钮将生成下图所示的房子。每次单击都会清除屏幕,使刚刚单击的项目显示出来。
- To rotate the displayed multipatch, click and drag on the SceneControl. Move left and right to move around in the same horizontal plane, and move the mouse up and down to rotate vertically.要旋转显示的多批次,请单击并拖动SceneControl。左右移动可在同一水平面内移动,上下移动鼠标可垂直旋转。
- To zoom out, right-click and hold down the mouse button while moving the mouse away from you.要缩小,请右键单击并按住鼠标键,同时将鼠标移离您。
- To zoom in, righ-click and hold down the mouse button while moving the mouse towards you.要放大,右键单击并按住鼠标键,同时向您移动鼠标。
Illustration showing multipatch example UI after adding geometries.
Additional information
If you are working in a 2D environment, the code to create the multipatch items are the same. Write your class to draw them, as the one used in this example draws in 3D. If you are working in 2D with these multipoint items, no extension (neither 3D Analyst for ArcView, ArcEditor, and ArcGIS Desktop, nor 3D for ArcGIS Engine) is required.
VB
Public Function CreateSimpleBoreHoleSurface(pTopCentre As IPoint, pBottomCentre As IPoint, pRadius As Double) As IMultiPatch 'pTopCentre 为顶面中心点 ,pBottomCentre 为底面中心点 ,pRadius 为钻孔半径 Dim pPatchs As IMultiPatch Dim pGCol As IGeometryCollection Dim pZAware As IZAware Dim pStrip As IPointCollection Dim pPnt As IPoint Dim pX As Double, pY As Double Dim i As Long 'Dim pPnts As ITriangleStrip pPatchs = New MultiPatch pZAware = pPatchs pZAware.ZAware = True pGCol = pPatchs 'pPnts = New TriangleStrip pStrip = New TriangleStrip For i = 0 To 12 '计算顶面点坐标 pPnt = New Point pX = pTopCentre.X + pRadius * Cos(i * 30 * PI / 180) pY = pTopCentre.Y + pRadius * Sin(i * 30 * PI / 180) '建立顶面点 pPnt = New Point pPnt.PutCoords(pX, pY) pPnt.Z = pTopCentre.Z '把顶面点加入三角形带中 pStrip.AddPoint(pPnt) '计算底面点坐标 pPnt = New Point pX = pBottomCentre.X + pRadius * Cos(i * 30 * PI / 180) pY = pBottomCentre.Y + pRadius * Sin(i * 30 * PI / 180) '建立底面点 pPnt = New Point pPnt.PutCoords(pX, pY) pPnt.Z = pBottomCentre.Z '把底面点加入三角形带中 pStrip.AddPoint(pPnt) Next i '把三角形带加入到元素集合中 pGCol.AddGeometry(pStrip) CreateSimpleBoreHoleSurface = pPatchs End Function
>>二维geodatabase数据存储,三维显示
>>可不可以把创建的Multipatch图元保存到multipatch图层呢?https://www.doc88.com/p-5814402346230.html
>>Multipatch类与geometry类的关系