public static void AddAndVisualize3DTileData(string str3DTileConn, string str3DTilePwd, TreeList parentTree, string treeNodeName, bool bNeedFly = false, bool bTempData = true) { try { DF3DApplication app = DF3DApplication.Application; if (app == null || app.Current3DMapControl == null) { return; } AxRenderControl d3 = app.Current3DMapControl; I3DTileLayer layer = d3.ObjectManager.Create3DTileLayer(str3DTileConn, str3DTilePwd, d3.ProjectTree.RootID); if (layer != null) { TreeNode3DTile node = new TreeNode3DTile(layer.Guid.ToString()) { Name = treeNodeName, CustomValue = layer, Temp = bTempData }; node.OwnNode = parentTree.AppendNode(new object[] { node.Name }, (TreeListNode)null); node.Visible = true; if (bNeedFly) { d3.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); } } } catch (Exception ex) { } }
private void AxRenderControl_RcMouseDragSelect(IPickResultCollection PickResults, gviModKeyMask Mask) { if (PickResults != null) { int i = 0; IPickResult t = null; while ((t = PickResults.Get(i)) != null) { if (t.Type == gviObjectType.gviObjectRenderPoint) { IRenderPoint temp = ((IRenderPointPickResult)t).Point; } if (t.Type == gviObjectType.gviObject3DTileLayer) { I3DTileLayer temp = ((I3DTileLayerPickResult)t).TileLayer; } if (t.Type == gviObjectType.gviObjectRenderModelPoint) { IRenderModelPoint temp = ((IRenderModelPointPickResult)t).ModelPoint; } } } }
private void init() { // 初始化RenderControl控件 IPropertySet ps = new PropertySet(); ps.SetProperty("RenderSystem", gviRenderSystem.gviRenderOpenGL); this.axRenderControl1.Initialize(true, ps); this.axRenderControl1.Camera.FlyTime = 1; rootId = this.axRenderControl1.ObjectManager.GetProjectTree().RootID; // 设置天空盒 if (System.IO.Directory.Exists(strMediaPath)) { string tmpSkyboxPath = strMediaPath + @"\skybox"; ISkyBox skybox = this.axRenderControl1.ObjectManager.GetSkyBox(0); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBack, tmpSkyboxPath + "\\1_BK.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBottom, tmpSkyboxPath + "\\1_DN.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageFront, tmpSkyboxPath + "\\1_FR.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageLeft, tmpSkyboxPath + "\\1_LF.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageRight, tmpSkyboxPath + "\\1_RT.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageTop, tmpSkyboxPath + "\\1_UP.jpg"); } else { MessageBox.Show("请不要随意更改SDK目录名"); return; } string tmpTileLayerPath = (strMediaPath + @"\sdk.tdb"); I3DTileLayer layer = this.axRenderControl1.ObjectManager.Create3DTileLayer(tmpTileLayerPath, "", rootId); //this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); }
private void listView1_MouseDoubleClick(object sender, MouseEventArgs e) { if (this.listView1.SelectedItems.Count == 0) { return; } myListNode item = (myListNode)this.listView1.SelectedItems[0]; item.Checked = true; switch (item.type) { case TreeNodeType.NT_TiltedLAYER: { I3DTileLayer layer = item.obj as I3DTileLayer; this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); } break; case TreeNodeType.NT_FeatureLayer: { IFeatureLayer layer = item.obj as IFeatureLayer; this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); } break; } }
private void MainForm_Load(object sender, System.EventArgs e) { // 初始化RenderControl控件 IPropertySet ps = new PropertySet(); ps.SetProperty("RenderSystem", gviRenderSystem.gviRenderOpenGL); this.axRenderControl1.Initialize(true, ps); this.axRenderControl1.Camera.FlyTime = 1; CommonUnity.RenderHelper = this.axRenderControl1; rootId = this.axRenderControl1.ObjectManager.GetProjectTree().RootID; // 设置天空盒 if(System.IO.Directory.Exists(strMediaPath)) { string tmpSkyboxPath = strMediaPath + @"\skybox"; ISkyBox skybox = this.axRenderControl1.ObjectManager.GetSkyBox(0); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBack, tmpSkyboxPath + "\\1_BK.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBottom, tmpSkyboxPath + "\\1_DN.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageFront, tmpSkyboxPath + "\\1_FR.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageLeft, tmpSkyboxPath + "\\1_LF.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageRight, tmpSkyboxPath + "\\1_RT.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageTop, tmpSkyboxPath + "\\1_UP.jpg"); } else { MessageBox.Show("请不要随意更改SDK目录名"); return; } this.axRenderControl1.Camera.VerticalFieldOfView = 60; // 加载瓦片图层 string tilePath = (strMediaPath + @"\sdk.tdb"); I3DTileLayer layer = this.axRenderControl1.ObjectManager.Create3DTileLayer(tilePath, "", rootId); this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); IGeometryFactory fac = new GeometryFactory(); positionPoint = fac.CreatePoint(gviVertexAttribute.gviVertexAttributeZ); videoConfig = this.axRenderControl1.TerrainVideoConfig; ConstructTable(); // 绑定键盘事件 this.axRenderControl1.RcKeyUp += new _IRenderControlEvents_RcKeyUpEventHandler(axRenderControl1_RcKeyUp); string filePath = Application.StartupPath + @"\adjust.txt"; if (File.Exists(filePath)) { streamWriter = new StreamWriter(filePath, true); } { this.helpProvider1.SetShowHelp(this.axRenderControl1, true); this.helpProvider1.SetHelpString(this.axRenderControl1, ""); this.helpProvider1.HelpNamespace = "TerrainVideo.html"; } }
public override void Run(object sender, EventArgs e) { //从图层树获取指定类型的实例 List <IRObject> list = ProjectTreeServices.GetRObjectsFromTree(gviObjectType.gviObject3DTileLayer); I3DTileLayer t = (I3DTileLayer)list[0]; new Form1($"Button1 -> listCount:{list.Count}").Show(); }
private void MainForm_Load(object sender, EventArgs e) { // 初始化RenderControl控件 IPropertySet ps = new PropertySet(); ps.SetProperty("RenderSystem", gviRenderSystem.gviRenderOpenGL); this.axRenderControl1.Initialize(true, ps); rootId = this.axRenderControl1.ObjectManager.GetProjectTree().RootID; this.axRenderControl1.Camera.FlyTime = 1; // 设置天空盒 if (System.IO.Directory.Exists(strMediaPath)) { string tmpSkyboxPath = strMediaPath + @"\skybox"; ISkyBox skybox = this.axRenderControl1.ObjectManager.GetSkyBox(0); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBack, tmpSkyboxPath + "\\1_BK.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBottom, tmpSkyboxPath + "\\1_DN.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageFront, tmpSkyboxPath + "\\1_FR.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageLeft, tmpSkyboxPath + "\\1_LF.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageRight, tmpSkyboxPath + "\\1_RT.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageTop, tmpSkyboxPath + "\\1_UP.jpg"); } else { MessageBox.Show("请不要随意更改SDK目录名"); return; } string tmpTdbPath = (strMediaPath + @"\sdk.tdb"); I3DTileLayer tilelayer = this.axRenderControl1.ObjectManager.Create3DTileLayer(tmpTdbPath, "", rootId); if (tilelayer != null) { IVector3 pos = new Vector3(); pos.Set(15404.97, 35575.28, 59); IEulerAngle ang = new EulerAngle(); ang.Set(0, -30, 0); this.axRenderControl1.Camera.LookAt(pos, 10, ang); } else { this.Text = "tilelayer create failed!"; } this.comboBox1.SelectedIndex = 2; this.axRenderControl1.RcCameraFlyFinished += new _IRenderControlEvents_RcCameraFlyFinishedEventHandler(axRenderControl1_RcCameraFlyFinished); { this.helpProvider1.SetShowHelp(this.axRenderControl1, true); this.helpProvider1.SetHelpString(this.axRenderControl1, ""); this.helpProvider1.HelpNamespace = "WalkGround.html"; } }
private void MainForm_Load(object sender, System.EventArgs e) { // 初始化RenderControl控件 IPropertySet ps = new PropertySet(); ps.SetProperty("RenderSystem", gviRenderSystem.gviRenderOpenGL); this.axRenderControl1.Initialize(true, ps); this.axRenderControl1.Camera.FlyTime = 1; rootId = this.axRenderControl1.ObjectManager.GetProjectTree().RootID; // 设置天空盒 if (System.IO.Directory.Exists(strMediaPath)) { string tmpSkyboxPath = strMediaPath + @"\skybox"; ISkyBox skybox = this.axRenderControl1.ObjectManager.GetSkyBox(0); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBack, tmpSkyboxPath + "\\1_BK.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBottom, tmpSkyboxPath + "\\1_DN.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageFront, tmpSkyboxPath + "\\1_FR.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageLeft, tmpSkyboxPath + "\\1_LF.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageRight, tmpSkyboxPath + "\\1_RT.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageTop, tmpSkyboxPath + "\\1_UP.jpg"); } else { MessageBox.Show("请不要随意更改SDK目录名"); return; } this.axRenderControl1.Camera.FlyTime = 1; // 加载瓦片图层 string tilelayerString = (strMediaPath + @"\sdk.tdb"); I3DTileLayer layer = this.axRenderControl1.ObjectManager.Create3DTileLayer(tilelayerString, "", rootId); this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); // 添加节点到界面控件上 myListNode item = new myListNode("tilelayer", TreeNodeType.NT_TiltedLAYER, layer); item.Checked = true; listView1.Items.Add(item); __layerSelected = layer; // 注册事件 this.axRenderControl1.RcObjectEditing += new _IRenderControlEvents_RcObjectEditingEventHandler(axRenderControl1_RcObjectEditing); this.axRenderControl1.RcObjectEditFinish += new _IRenderControlEvents_RcObjectEditFinishEventHandler(axRenderControl1_RcObjectEditFinish); { this.helpProvider1.SetShowHelp(this.axRenderControl1, true); this.helpProvider1.SetHelpString(this.axRenderControl1, ""); this.helpProvider1.HelpNamespace = "TileHole.html"; } }
private void listView1_ItemChecked(object sender, ItemCheckedEventArgs e) { myListNode item = (myListNode)e.Item; switch (item.type) { case TreeNodeType.NT_TiltedLAYER: I3DTileLayer ted = item.obj as I3DTileLayer; ted.VisibleMask = e.Item.Checked ? gviViewportMask.gviViewAllNormalView : gviViewportMask.gviViewNone; break; case TreeNodeType.NT_RenderGeomtry: IRenderGeometry geo = item.obj as IRenderGeometry; geo.VisibleMask = e.Item.Checked ? gviViewportMask.gviViewAllNormalView : gviViewportMask.gviViewNone; break; } }
/// <summary> /// 初始化 /// </summary> private void init() { // 初始化RenderControl控件 IPropertySet ps = new PropertySet(); ps.SetProperty("RenderSystem", gviRenderSystem.gviRenderOpenGL); //this.axRenderControl1.Initialize2("PROJCS[\"MacauProj\",GEOGCS[\"MacauGrid\",DATUM[\"D_International_1924\",SPHEROID[\"International_1924\",6378388.0,297.0]],PRIMEM[\"<custom>\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",20000.0],PARAMETER[\"False_Northing\",20000.0],PARAMETER[\"Central_Meridian\",113.5364694444],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",22.2123972222],UNIT[\"Meter\",1.0]]", ps); this.axRenderControl1.Initialize(false, ps); this.axRenderControl1.Camera.FlyTime = 1; rootId = this.axRenderControl1.ObjectManager.GetProjectTree().RootID; // 设置天空盒 if (System.IO.Directory.Exists(strMediaPath)) { string tmpSkyboxPath = strMediaPath + @"\skybox"; ISkyBox skybox = this.axRenderControl1.ObjectManager.GetSkyBox(0); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBack, tmpSkyboxPath + "\\1_BK.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBottom, tmpSkyboxPath + "\\1_DN.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageFront, tmpSkyboxPath + "\\1_FR.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageLeft, tmpSkyboxPath + "\\1_LF.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageRight, tmpSkyboxPath + "\\1_RT.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageTop, tmpSkyboxPath + "\\1_UP.jpg"); } else { MessageBox.Show("请不要随意更改SDK目录名"); return; } // 加载瓦片图层 string tilePath = (strMediaPath + @"\sdk.tdb"); I3DTileLayer layer = this.axRenderControl1.ObjectManager.Create3DTileLayer(tilePath, "", rootId); this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); { this.helpProvider1.SetShowHelp(this.axRenderControl1, true); this.helpProvider1.SetHelpString(this.axRenderControl1, ""); this.helpProvider1.HelpNamespace = "ShadowMapApplication.html"; } }
private void AxRenderControl_MouseClick(IPickResult IPickResult, IPoint IntersectPoint, gviModKeyMask Mask, gviMouseSelectMode EventSender) { if (IPickResult != null) { if (IPickResult.Type == gviObjectType.gviObjectRenderPoint) { IRenderPoint temp = ((IRenderPointPickResult)IPickResult).Point; } if (IPickResult.Type == gviObjectType.gviObject3DTileLayer) { I3DTileLayer temp = ((I3DTileLayerPickResult)IPickResult).TileLayer; } if (IPickResult.Type == gviObjectType.gviObjectRenderModelPoint) { IRenderModelPoint temp = ((IRenderModelPointPickResult)IPickResult).ModelPoint; } } }
private void listView1_ItemChecked(object sender, ItemCheckedEventArgs e) { myListNode item = (myListNode)e.Item; switch (item.type) { case TreeNodeType.NT_TiltedLAYER: { I3DTileLayer ted = item.obj as I3DTileLayer; ted.VisibleMask = e.Item.Checked ? gviViewportMask.gviViewAllNormalView : gviViewportMask.gviViewNone; } break; case TreeNodeType.NT_FeatureLayer: { IFeatureLayer layer = item.obj as IFeatureLayer; layer.VisibleMask = e.Item.Checked ? gviViewportMask.gviViewAllNormalView : gviViewportMask.gviViewNone; this.Text = layer.GeometryType.ToString() + ":" + layer.VisibleMask; } break; } }
private void listView1_MouseDoubleClick(object sender, MouseEventArgs e) { if (this.listView1.SelectedItems.Count == 0) { return; } myListNode item = (myListNode)this.listView1.SelectedItems[0]; item.Checked = true; switch (item.type) { case TreeNodeType.NT_TiltedLAYER: I3DTileLayer layer = item.obj as I3DTileLayer; layer.Highlight(System.Drawing.Color.Yellow); this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); break; case TreeNodeType.NT_RenderGeomtry: IRenderGeometry geo = item.obj as IRenderGeometry; this.axRenderControl1.Camera.FlyToObject(geo.Guid, gviActionCode.gviActionFlyTo); break; } }
private void MainForm_Load(object sender, System.EventArgs e) { // 初始化RenderControl控件 IPropertySet ps = new PropertySet(); ps.SetProperty("RenderSystem", gviRenderSystem.gviRenderOpenGL); this.axRenderControl1.Initialize(true, ps); this.axRenderControl1.Camera.FlyTime = 1; ICRSFactory crsfac = new CRSFactory(); _currentCRS = (crsfac.CreateFromWKT(this.axRenderControl1.GetCurrentCrsWKT())) as ISpatialCRS; rootId = this.axRenderControl1.ObjectManager.GetProjectTree().RootID; // 设置天空盒 if (System.IO.Directory.Exists(strMediaPath)) { string tmpSkyboxPath = strMediaPath + @"\skybox"; ISkyBox skybox = this.axRenderControl1.ObjectManager.GetSkyBox(0); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBack, tmpSkyboxPath + "\\1_BK.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageBottom, tmpSkyboxPath + "\\1_DN.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageFront, tmpSkyboxPath + "\\1_FR.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageLeft, tmpSkyboxPath + "\\1_LF.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageRight, tmpSkyboxPath + "\\1_RT.jpg"); skybox.SetImagePath(gviSkyboxImageIndex.gviSkyboxImageTop, tmpSkyboxPath + "\\1_UP.jpg"); } else { MessageBox.Show("请不要随意更改SDK目录名"); return; } this.axRenderControl1.Camera.FlyTime = 0; // 加载瓦片图层 string tilelayerString = (strMediaPath + @"\sdk.tdb"); I3DTileLayer layer = this.axRenderControl1.ObjectManager.Create3DTileLayer(tilelayerString, "", rootId); this.axRenderControl1.Camera.FlyToObject(layer.Guid, gviActionCode.gviActionFlyTo); // 添加节点到界面控件上 myListNode item = new myListNode("tilelayer", TreeNodeType.NT_TiltedLAYER, layer); item.Checked = true; listView1.Items.Add(item); #region 加载FDB try { IConnectionInfo ci = new ConnectionInfo(); ci.ConnectionType = gviConnectionType.gviConnectionFireBird2x; string tmpFDBPath = (strMediaPath + @"\SDKDEMO.FDB"); ci.Database = tmpFDBPath; IDataSourceFactory dsFactory = new DataSourceFactory(); IDataSource ds = dsFactory.OpenDataSource(ci); string[] setnames = (string[])ds.GetFeatureDatasetNames(); if (setnames.Length == 0) { return; } IFeatureDataSet dataset = ds.OpenFeatureDataset(setnames[0]); _datasetCRS = dataset.SpatialReference; //遍历FeatureClass string[] fcnames = (string[])dataset.GetNamesByType(gviDataSetType.gviDataSetFeatureClassTable); if (fcnames.Length == 0) { return; } fcMap = new Hashtable(fcnames.Length); fcuidMap = new Hashtable(fcnames.Length); foreach (string name in fcnames) { IFeatureClass fc = dataset.OpenFeatureClass(name); // 找到空间列字段 List <string> geoNames = new List <string>(); IFieldInfoCollection fieldinfos = fc.GetFields(); for (int i = 0; i < fieldinfos.Count; i++) { IFieldInfo fieldinfo = fieldinfos.Get(i); if (null == fieldinfo) { continue; } IGeometryDef geometryDef = fieldinfo.GeometryDef; if (null == geometryDef) { continue; } if (geometryDef.GeometryColumnType == gviGeometryColumnType.gviGeometryColumnPolygon) { geoNames.Add(fieldinfo.Name); } } fcMap.Add(fc, geoNames); fcuidMap.Add(fc.Guid, fc); } } catch (COMException ex) { System.Diagnostics.Trace.WriteLine(ex.Message); return; } #endregion //CreateFeautureLayer for 矢量贴地 foreach (IFeatureClass fc in fcMap.Keys) { List <string> geoNames = (List <string>)fcMap[fc]; if (geoNames.Count == 0) { continue; } #region 定义几何物体渲染风格 ICurveSymbol cs = new CurveSymbol(); cs.Color = System.Drawing.Color.Empty; //防止贴瓦片时出现绿色竖边 IValueMapGeometryRender geoRender = new ValueMapGeometryRender(); { IRangeRenderRule rangeRule = new RangeRenderRule(); rangeRule.LookUpField = "oid"; rangeRule.MaxValue = 1100; rangeRule.MinValue = 1000; rangeRule.IncludeMin = false; ISurfaceSymbol geoSymbol = new SurfaceSymbol(); geoSymbol.Color = System.Drawing.Color.Yellow; geoSymbol.BoundarySymbol = cs; IGeometryRenderScheme grs = new GeometryRenderScheme(); grs.AddRule(rangeRule); grs.Symbol = geoSymbol; geoRender.AddScheme(grs); } { IRangeRenderRule rangeRule = new RangeRenderRule(); rangeRule.LookUpField = "oid"; rangeRule.MaxValue = 1200; rangeRule.MinValue = 1100; rangeRule.IncludeMin = false; ISurfaceSymbol geoSymbol = new SurfaceSymbol(); geoSymbol.Color = System.Drawing.Color.Blue; geoSymbol.BoundarySymbol = cs; IGeometryRenderScheme grs = new GeometryRenderScheme(); grs.AddRule(rangeRule); grs.Symbol = geoSymbol; geoRender.AddScheme(grs); } { IRangeRenderRule rangeRule = new RangeRenderRule(); rangeRule.LookUpField = "oid"; rangeRule.MaxValue = 1300; rangeRule.MinValue = 1200; rangeRule.IncludeMin = false; ISurfaceSymbol geoSymbol = new SurfaceSymbol(); geoSymbol.Color = System.Drawing.Color.Green; geoSymbol.BoundarySymbol = cs; IGeometryRenderScheme grs = new GeometryRenderScheme(); grs.AddRule(rangeRule); grs.Symbol = geoSymbol; geoRender.AddScheme(grs); } { IRangeRenderRule rangeRule = new RangeRenderRule(); rangeRule.LookUpField = "oid"; rangeRule.MaxValue = 1400; rangeRule.MinValue = 1300; rangeRule.IncludeMin = false; ISurfaceSymbol geoSymbol = new SurfaceSymbol(); geoSymbol.Color = System.Drawing.Color.Goldenrod; geoSymbol.BoundarySymbol = cs; IGeometryRenderScheme grs = new GeometryRenderScheme(); grs.AddRule(rangeRule); grs.Symbol = geoSymbol; geoRender.AddScheme(grs); } { ISurfaceSymbol geoSymbol = new SurfaceSymbol(); geoSymbol.Color = System.Drawing.Color.Fuchsia; geoSymbol.BoundarySymbol = cs; IGeometryRenderScheme geoSchemeOther = new GeometryRenderScheme(); geoSchemeOther.Symbol = geoSymbol; geoRender.AddScheme(geoSchemeOther); } #endregion geoRender.HeightStyle = gviHeightStyle.gviHeightOnEverything; IFeatureLayer fcLayer = this.axRenderControl1.ObjectManager.CreateFeatureLayer(fc, geoNames[0], null, geoRender, rootId); if (fcLayer != null) { fcLayer.VisibleMask = gviViewportMask.gviViewNone; // 添加节点到界面控件上 myListNode item2 = new myListNode(fc.Name + "_" + geoNames[0], TreeNodeType.NT_FeatureLayer, fcLayer); item.Checked = false; listView1.Items.Add(item2); } else { MessageBox.Show("Create FeatureLayer Failed! " + this.axRenderControl1.GetLastError().ToString()); } } // 注册事件 this.axRenderControl1.RcMouseClickSelect += new Gvitech.CityMaker.Controls._IRenderControlEvents_RcMouseClickSelectEventHandler(axRenderControl1_RcMouseClickSelect); //设置highlight可用 this.axRenderControl1.HighlightHelper.VisibleMask = 1; { this.helpProvider1.SetShowHelp(this.axRenderControl1, true); this.helpProvider1.SetHelpString(this.axRenderControl1, ""); this.helpProvider1.HelpNamespace = "TileHole.html"; } }