void _3DControl_RcMouseClickSelect(object sender, _IRenderControlEvents_RcMouseClickSelectEvent e) { if (e.intersectPoint == null) { return; } if (e.eventSender == gviMouseSelectMode.gviMouseSelectClick) { if (!bStart) { this.seObserX.Text = e.intersectPoint.X.ToString(); this.seObserY.Text = e.intersectPoint.Y.ToString(); this.seObserZ.Text = e.intersectPoint.Z.ToString(); bStart = true; } else { this.seObjX.Text = e.intersectPoint.X.ToString(); this.seObjY.Text = e.intersectPoint.Y.ToString(); this.seObjZ.Text = e.intersectPoint.Z.ToString(); bStart = false; DrawRegion(); } } else if (e.eventSender == gviMouseSelectMode.gviMouseSelectMove) { if (bStart) { this.seObjX.Text = e.intersectPoint.X.ToString(); this.seObjY.Text = e.intersectPoint.Y.ToString(); this.seObjZ.Text = e.intersectPoint.Z.ToString(); DrawRegion(); } } }
private void _3DControl_RcMouseClickSelect(object sender, _IRenderControlEvents_RcMouseClickSelectEvent e) { try { if (e.intersectPoint != null) { IPoint pt1 = this._geoFactory.CreateGeometry(gviGeometryType.gviGeometryPoint, gviVertexAttribute.gviVertexAttributeZ) as IPoint; pt1.X = e.intersectPoint.X; pt1.Y = e.intersectPoint.Y; pt1.Z = e.intersectPoint.Z; if (e.eventSender == gviMouseSelectMode.gviMouseSelectClick) { if (!this._isStarted) { this.Close(); if (this._onStartDraw != null) { this._onStartDraw(); } this._polyline = this._geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolyline, gviVertexAttribute.gviVertexAttributeZ) as IPolyline; this._rPolyline = this._objectManager.CreateRenderPolyline(this._polyline, this._curveSymbol, this._rootID); this._polyline.AppendPoint(pt1); IPoint pt2 = pt1.Clone() as IPoint; pt2.X += 0.000001; this._polyline.AppendPoint(pt2); this._isStarted = true; this._isFinished = false; } else { this._polyline.AppendPoint(pt1); } } else if (e.eventSender == gviMouseSelectMode.gviMouseSelectMove) { if (_rPoint != null) { this._objectManager.DeleteObject(_rPoint.Guid); System.Runtime.InteropServices.Marshal.ReleaseComObject(_rPoint); _rPoint = null; } _rPoint = this._objectManager.CreateRenderPoint(pt1, this._simplePointSymbol, this._rootID); if (this._isStarted) { this._polyline.UpdatePoint(this._polyline.PointCount - 1, pt1); this._rPolyline.SetFdeGeometry(this._polyline); } } } } catch (Exception ex) { LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace); } }
private void axRenderControl1_RcMouseClickSelect(object sender, _IRenderControlEvents_RcMouseClickSelectEvent e) { try { if (e.eventSender != i3dMouseSelectMode.i3dMouseSelectClick) { return; } if (e.pickResult != null) { string id = string.Empty; switch (e.pickResult) { case IRenderPointPickResult renderPoint: id = renderPoint.Point.ClientData; break; case IRenderModelPointPickResult modelPoint: id = modelPoint.ModelPoint.ClientData; break; } if (string.IsNullOrEmpty(id)) { return; } //var type = (NotationType)GetNotationById(id).Type; //SelectNotationFinished?.Invoke((id, type)); var angle = SetAngle(0, -50, 0); SetCamera(e.intersectPoint.Position, angle, true, 100); } } catch (Exception ex) { LoggerHelper.Logger.Error(ex, "执行axRenderControl1_RcMouseClickSelect错误"); throw ex; } }
private void _3DControl_RcMouseClickSelect(object sender, _IRenderControlEvents_RcMouseClickSelectEvent e) { try { if (e.intersectPoint != null) { IPoint pt1 = this._geoFactory.CreateGeometry(gviGeometryType.gviGeometryPoint, gviVertexAttribute.gviVertexAttributeZ) as IPoint; pt1.X = e.intersectPoint.X; pt1.Y = e.intersectPoint.Y; pt1.Z = e.intersectPoint.Z; if (e.eventSender == gviMouseSelectMode.gviMouseSelectClick) { if (!this._isStarted) { this.Close(); if (this._onStartDraw != null) { this._onStartDraw(); } this._polygon = this._geoFactory.CreateGeometry(gviGeometryType.gviGeometryPolygon, gviVertexAttribute.gviVertexAttributeZ) as IPolygon; this._polygon.ExteriorRing.AppendPoint(pt1); IPoint pt2 = pt1.Clone() as IPoint; pt2.X += 0.015; this._polygon.ExteriorRing.AppendPoint(pt2); ISurfaceSymbol ss = new SurfaceSymbolClass(); ss.Color = Convert.ToUInt32(SystemInfo.Instance.FillColor, 16); ICurveSymbol cs = new CurveSymbolClass(); cs.Color = Convert.ToUInt32(SystemInfo.Instance.LineColor, 16); ss.BoundarySymbol = cs; _rPolygon = this._3DControl.ObjectManager.CreateRenderPolygon(this._polygon, ss, this._3DControl.ProjectTree.RootID); _rPolygon.HeightStyle = this._heightStyle; //this._polygon.ExteriorRing.Close(); this._isStarted = true; this._isFinished = false; } else { this._polygon.ExteriorRing.AppendPoint(pt1); this._polygon.ExteriorRing.Close(); this._rPolygon.SetFdeGeometry(this._polygon); } } else if (e.eventSender == gviMouseSelectMode.gviMouseSelectMove) { if (_rPoint != null) { this._objectManager.DeleteObject(_rPoint.Guid); System.Runtime.InteropServices.Marshal.ReleaseComObject(_rPoint); _rPoint = null; } _rPoint = this._objectManager.CreateRenderPoint(pt1, this._simplePointSymbol, this._rootID); if (this._isStarted) { this._polygon.ExteriorRing.UpdatePoint(this._polygon.ExteriorRing.PointCount - 1, pt1); this._rPolygon.SetFdeGeometry(this._polygon); } } } } catch (Exception ex) { LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace); } }
private void axRenderControl1_RcMouseClickSelect(object sender, _IRenderControlEvents_RcMouseClickSelectEvent e) { FeatureLayerPick(e.pickResult, e.intersectPoint, e.eventSender); }