//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { if (m_sceneControl.Action == Action3D.CreatePolygon) { //m_sceneControl.Scene.TrackingLayer.Clear(); //Geometry3D geometry = e.Geometry as Geometry3D; //if (geometry is GeoLine3D) //{ // m_sceneControl.Scene.TrackingLayer.Add(geometry, "line"); // return; //} //else if (geometry is GeoRegion3D) //{ // GeoRegion3D geoRegion3D = geometry as GeoRegion3D; // if (geoRegion3D[0].Count < 3) // { // return; // } // GeoStyle3D style3D = new GeoStyle3D(); // style3D.FillMode = FillMode3D.Line; // style3D.LineColor = Color.Yellow; // style3D.AltitudeMode = AltitudeMode.Absolute; // geoRegion3D.Style3D = style3D; // m_sceneControl.Scene.TrackingLayer.Add(geoRegion3D, "region"); //} } }
//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { if (m_sceneControl.Action == Action3D.CreatePolygon) { m_sceneControl.Scene.TrackingLayer.Clear(); Geometry3D geometry = e.Geometry as Geometry3D; if (geometry is GeoLine3D) { m_sceneControl.Scene.TrackingLayer.Add(geometry, "line"); return; } else if (geometry is GeoRegion3D) { GeoRegion3D geoRegion3D = geometry as GeoRegion3D; if (geoRegion3D[0].Count < 3) { return; } GeoStyle3D style3D = new GeoStyle3D(); style3D.LineColor = Color.Yellow; style3D.AltitudeMode = AltitudeMode.Absolute; geoRegion3D.Style3D = style3D; m_sceneControl.Scene.TrackingLayer.Add(geoRegion3D, "region"); } } }
//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { if (m_sceneControl.Action == Action3D.CreateRectangle) { if (!m_bIsShowSlopInfo) { if (m_slope != null) { GeoRegion3D geoRegion3D = e.Geometry as GeoRegion3D; if (geoRegion3D.PartCount > 0) { Rectangle2D rect = m_slope.CoverageArea; rect = geoRegion3D.Bounds; m_slope.CoverageArea = rect; } } } //显示坡度坡向信息 else { m_timer.Enabled = true; m_timer.Interval = 2000; m_timer.Tick -= new EventHandler(timer_tick); m_timer.Tick += new EventHandler(timer_tick); m_point3D = new Point3D(e.X, e.Y, e.Z); m_timer.Start(); } } }
void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { if (m_sceneControl.Action == Action3D.CreateLine) { if (m_bHasDone) { m_viewshed3D = CreateViewShed3D(); m_bHasDone = false; } if (m_viewshed3D != null) { GeoLine3D geoline3d = e.Geometry as GeoLine3D; if (geoline3d.PartCount > 0) { Point3Ds pts = geoline3d[0]; m_viewshed3D.ViewerPosition = pts[0]; updateObserverPosition(m_viewshed3D); m_viewshed3D.SetDistDirByPoint(pts[1]); updateParam(m_viewshed3D, false); } } } }
//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { m_sceneControl.Scene.TrackingLayer.Clear(); if (m_sceneControl.Action == Action3D.CreatePolygon) { Geometry3D geometry = e.Geometry as Geometry3D; if (geometry is GeoLine3D) { m_style3D.LineColor = m_limitColor; geometry.Style3D = m_style3D; m_sceneControl.Scene.TrackingLayer.Add(geometry, "line"); return; } else if (geometry is GeoRegion3D) { GeoRegion3D geoRegion3D = geometry as GeoRegion3D; if (geoRegion3D[0].Count < 3) { return; } m_style3D.FillForeColor = m_limitColor; geoRegion3D.Style3D = m_style3D; m_sceneControl.Scene.TrackingLayer.Add(geoRegion3D, "region"); } } }
/// <summary> /// 事件跟踪 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TrackingHandler(object sender, Tracking3DEventArgs e) { try { OutputMeasureResult(e); } catch (Exception ex) { Trace.WriteLine(ex.Message); } }
//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { //m_sceneControl.Scene.TrackingLayer.Clear(); //if (m_sceneControl.Action == Action3D.CreateLine) //{ // GeoLine3D geoline3d = e.Geometry as GeoLine3D; // if (geoline3d.PartCount > 0) // { // SetGeometry3DStyle(geoline3d); // m_sceneControl.Scene.TrackingLayer.Add(geoline3d, "Analysis"); // } //} }
//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { if (m_sceneControl.Action == Action3D.CreateRectangle) { if (m_contour != null) { GeoRegion3D geoRegion3D = e.Geometry as GeoRegion3D; if (geoRegion3D.PartCount > 0) { Rectangle2D rect = m_contour.CoverageArea; rect = geoRegion3D.Bounds; m_contour.CoverageArea = rect; } } } }
//鼠标移动事件 void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { m_sceneControl.Scene.TrackingLayer.Clear(); if (m_sceneControl.Action == Action3D.CreateLine) { GeoLine3D geoline3d = e.Geometry as GeoLine3D; if (geoline3d.PartCount > 0) { Rectangle2D rect = m_contour.CoverageArea; Point3Ds pts = geoline3d[0]; rect.Left = pts[0].X; rect.Top = pts[0].Y; rect.Right = pts[1].X; rect.Bottom = pts[1].Y; m_contour.CoverageArea = rect; } } }
private void TrackingSectionEvent(object sender, Tracking3DEventArgs e) { try { Point location = mSceneControl.PointToClient(Cursor.Position); location.Offset(30, 30); if (location.X > mSceneControl.Bounds.Width / 3 * 2) { location.X = mSceneControl.Bounds.Width / 3 * 2; } if (location.Y > mSceneControl.Bounds.Height) { location.Y = location.Y - 60; } } catch (Exception ex) { Trace.WriteLine(ex.Message); } }
void m_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { this.m_sceneControl.Scene.TrackingLayer.Clear(); if (m_sceneControl.Action == Action3D.CreatePolyline) { if (m_sightLine != null) { GeoLine3D geoline3d = e.Geometry as GeoLine3D; if (geoline3d != null && geoline3d.PartCount > 0) { Point3Ds pts = geoline3d[0]; m_sightLine.ViewerPosition = pts[0]; updateObservePosition(pts[0]); m_sightLine.RemoveAllTargetPoints(); for (int i = 1; i < pts.Count; ++i) { m_sightLine.AddTargetPoint(pts[i]); } } } } }
private void TrackingHandler(object sender, Tracking3DEventArgs e) { string actionStr = SmObjectLocator.getInstance().GlobeObject.Action.ToString().ToLower(); if (this.TempPoints3Ds.Count == 1) { m_tempPoint = new Point3D(e.X, e.Y, e.Z); TempPoints3Ds.Add(m_tempPoint); } switch (actionStr) { case "createline": if (this.TempPoints3Ds.Count == 2) { int index = SmObjectLocator.getInstance().GlobeObject.Scene.TrackingLayer.IndexOf(spatialTempTag); if (index >= 0) { SmObjectLocator.getInstance().GlobeObject.Scene.TrackingLayer.Remove(index); } GeoLine3D geoLine3D = new GeoLine3D(TempPoints3Ds); geoLine3D.Style3D = GetGeoStyle3D(); SmObjectLocator.getInstance().GlobeObject.Scene.TrackingLayer.Add(geoLine3D, spatialTempTag); TempPoints3Ds.Remove(1); } break; case "createpolygon": if (m_tempPoint != Point3D.Empty) { TempPoints3Ds.Remove(TempPoints3Ds.Count - 1); } m_tempPoint = new Point3D(e.X, e.Y, e.Z); TempPoints3Ds.Add(m_tempPoint); if (this.TempPoints3Ds.Count > 1) { int index = SmObjectLocator.getInstance().GlobeObject.Scene.TrackingLayer.IndexOf(spatialTempTag); if (index >= 0) { SmObjectLocator.getInstance().GlobeObject.Scene.TrackingLayer.Remove(index); } TempPoints3Ds.Add(TempPoints3Ds[0]); GeoLine3D geoLine3D = new GeoLine3D(TempPoints3Ds); geoLine3D.Style3D = GetGeoStyle3D(); SmObjectLocator.getInstance().GlobeObject.Scene.TrackingLayer.Add(geoLine3D, spatialTempTag); TempPoints3Ds.Remove(TempPoints3Ds.Count - 1); } break; default: break; } }
public void bd_sceneControl_Tracking(object sender, Tracking3DEventArgs e) { OutputMeasureArea(e); }
/// <summary> /// 标签中显示当前跟踪量算的结果 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TrackingHandler(object sender, Tracking3DEventArgs e) { try { OutputMeasureResult(e); } catch (Exception ex) { Trace.WriteLine(ex.Message); } }