|
- ArcGIS Engine 用SceneControl实现鼠标点击画3D点的例子:
- IPoint pt = new PointClass();
- ISceneGraph pSG = SC1.SceneGraph;
- ISceneViewer pSW = pSG.ActiveViewer;
- object pOwner;
- object pObject;
- pSG.Locate(pSW, e.x, e.y, esriScenePickMode.esriScenePickAll, true, out pt, out pOwner, out pObject);
- if (pt == null) return;
- IZAware pZAwareline = (IZAware)pt;
- ((IZAware)pZAwareline).ZAware = true;
- IGeometry geometry = (IGeometry)pt;
- IGraphicsContainer3D pGCon3D = SC1.Scene.BasicGraphicsLayer as IGraphicsContainer3D;
- IElement pElement = new MarkerElementClass();
- IRgbColor pColor=new RgbColorClass ();
- pColor .Red =255;
- ISimpleMarkerSymbol pSMS = new SimpleMarkerSymbolClass();
- pSMS.Size = 30;
- pSMS.Color = pColor;
- IMarkerElement pMarkerElement = new MarkerElementClass();
- pMarkerElement =(IMarkerElement ) pElement;
- pMarkerElement.Symbol = pSMS;
- pElement.Geometry = geometry;
- pGCon3D.AddElement(pElement);
- pSC1.SceneGraph.RefreshViewers();
复制代码 |
|