/// <summary> /// Constructor /// </summary> /// <param name="cc">Object for holding any displayed dialogs</param> /// <param name="action">The action that initiated this command</param> /// <param name="start">Point initially selected at start of command</param> internal NewCircularArcUI(IControlContainer cc, IUserAction action, PointFeature start) : base(cc, action, start) { m_IsShortArc = true; m_Circles = null; m_NewArcCircle = null; m_Geom = null; }
internal override void MouseMove(IPosition p) { base.MouseMove(p); // Remember current geometry m_Geom = CreateIntersectGeometry(); // If we got something, it's possible the end position doesn't exactly // match the end location determined by base.MouseMove. if (m_Geom!=null) base.LastMousePosition = m_Geom.EC; }
/// <summary> /// Performs the data processing associated with this editing operation. /// </summary> /// <param name="ctx">The context in which the geometry is being calculated.</param> internal override void CalculateGeometry(EditingContext ctx) { IPosition p = Calculate(); PointGeometry pg = PointGeometry.Create(p); m_NewPoint.ApplyPointGeometry(ctx, pg); // If the extension line was a circular arc, we also need to define it's geometry. // This COULD have been defined at an earlier stage (e.g. as part of CreateFeature), // but it's more consistent to do it as part of this method. if (m_NewLine is ArcFeature) { ArcFeature arc = m_ExtendLine.GetArcBase(); Circle circle = arc.Circle; Debug.Assert(circle != null); bool iscw = arc.IsClockwise; if (!m_IsExtendFromEnd) iscw = !iscw; ArcGeometry geom = new ArcGeometry(circle, m_NewLine.StartPoint, m_NewLine.EndPoint, iscw); (m_NewLine as ArcFeature).Geometry = geom; } }
/// <summary> Creates an arc using the 1st ArcGeometry constructor. </summary> private void CreateArc1() { var arc = new ArcGeometry(); arc.Commit(); }
/// <summary> /// 解析指定的XML对象 /// </summary> /// <param name="messageXML"></param> private void ParseXML(XmlReader xmlReader) { Geometry2D shape = null; switch (xmlReader.Name) { case "ArcGeometry": shape = new ArcGeometry(); break; case "BeamGeometry": shape = new BeamGeometry(); break; case "CircleGeometry": shape = new CircleGeometry(); break; case "CSectionGeometry": shape = new CSectionGeometry(); break; case "EllipseGeometry": shape = new EllipseGeometry(); break; case "FloorGeometry": shape = new FloorGeometry(); break; case "LineGeometry": shape = new LineGeometry(); break; case "MeasureGeometry": shape = new MeasureGeometry(); break; case "MemberGeometry": shape = new MemberGeometry(); break; case "OSBGeometry": shape = new OSBGeometry(); break; case "PointGeometry": shape = new PointGeometry(); break; case "PolygonGeometry": shape = new PolygonGeometry(); break; case "PolylineGeometry": shape = new PolylineGeometry(); break; case "RectangleGeometry": shape = new RectangleGeometry(); break; case "SteelBeamGeometry": shape = new SteelBeamGeometry(); break; case "TextGeometry": shape = new TextGeometry(); break; case "WallGeometry": shape = new WallGeometry(); break; } if (shape != null) { //将信息写入数据流中 shape.ReadXML(xmlReader); //将图形添加都界面上 this.drawingKernel.AddShape(shape); } }