GlobeControl选择矢量要素
通过GlobeControl提供的接口对加载在GlobeControl上的矢量特征要素进行操作的代码如下:
IPoint ppPoint = new PointClass();
(ppPoint as IZAware).ZAware = true;
object ppObject;
object ppOwner;
axGlobeCtrl.GlobeDisplay.Locate(axGlobeCtrl.GlobeDisplay.ActiveViewer, e.x, e.y, false, false, out ppPoint, out ppOwner, out ppObject);
//如果为空返回
if (ppPoint == null || ppOwner == null)
return;
IElement element = ppObject as IElement; //element包含了选择的矢量要素
// IPoint point = element.Geometry as IPoint; //选择并标记矢量要素
IGlobeGraphicsLayer layer = ppOwner as IGlobeGraphicsLayer;
IGraphicsSelection graphicsSelection = layer as IGraphicsSelection;
graphicsSelection.SelectElement(element);
axGlobeCtrl.GlobeDisplay.
RefreshViewers();
引用地址:http://bbs.fovly.com/thread-43-1-1.html
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步