/// <summary> /// /// </summary> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <param name="x3"></param> /// <param name="y3"></param> /// <param name="style"></param> /// <param name="point"></param> /// <param name="isStroked"></param> /// <param name="isFilled"></param> /// <param name="name"></param> /// <returns></returns> public static XQBezier Create( double x1, double y1, double x2, double y2, double x3, double y3, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string name = "") { return(new XQBezier() { Name = name, Style = style, IsStroked = isStroked, IsFilled = isFilled, Data = new Data() { Bindings = ImmutableArray.Create <ShapeBinding>(), Properties = ImmutableArray.Create <ShapeProperty>() }, Point1 = XPoint.Create(x1, y1, point), Point2 = XPoint.Create(x2, y2, point), Point3 = XPoint.Create(x3, y3, point) }); }
/// <summary> /// /// </summary> public override void ToStateOne() { _topLeftHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_topLeftHelperPoint); _bottomRightHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_bottomRightHelperPoint); }
/// <summary> /// /// </summary> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <param name="style"></param> /// <param name="point"></param> /// <param name="isStroked"></param> /// <param name="isFilled"></param> /// <param name="text"></param> /// <param name="name"></param> /// <returns></returns> public static XRectangle Create( double x1, double y1, double x2, double y2, ShapeStyle style, BaseShape point, bool isStroked = true, bool isFilled = false, string text = null, string name = "") { return(new XRectangle() { Name = name, Style = style, IsStroked = isStroked, IsFilled = isFilled, Data = new Data() { Bindings = ImmutableArray.Create <ShapeBinding>(), Properties = ImmutableArray.Create <ShapeProperty>() }, TopLeft = XPoint.Create(x1, y1, point), BottomRight = XPoint.Create(x2, y2, point), Text = text, IsGrid = false, OffsetX = 30.0, OffsetY = 30.0, CellWidth = 30.0, CellHeight = 30.0 }); }
/// <summary> /// /// </summary> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <param name="style"></param> /// <param name="point"></param> /// <param name="path"></param> /// <param name="isStroked"></param> /// <param name="isFilled"></param> /// <param name="text"></param> /// <param name="name"></param> /// <returns></returns> public static XImage Create( double x1, double y1, double x2, double y2, ShapeStyle style, BaseShape point, string path, bool isStroked = false, bool isFilled = false, string text = null, string name = "") { return(new XImage() { Name = name, Style = style, IsStroked = isStroked, IsFilled = isFilled, Data = new Data() { Bindings = ImmutableArray.Create <ShapeBinding>(), Properties = ImmutableArray.Create <ShapeProperty>() }, TopLeft = XPoint.Create(x1, y1, point), BottomRight = XPoint.Create(x2, y2, point), Path = path, Text = text }); }
/// <summary> /// /// </summary> public override void ToStateOne() { _startHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_startHelperPoint); _endHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_endHelperPoint); }
/// <summary> /// /// </summary> /// <param name="x"></param> /// <param name="y"></param> public override void LeftDown(double x, double y) { double sx = _editor.Project.Options.SnapToGrid ? Editor.Snap(x, _editor.Project.Options.SnapX) : x; double sy = _editor.Project.Options.SnapToGrid ? Editor.Snap(y, _editor.Project.Options.SnapY) : y; switch (_currentState) { case State.None: { _shape = XPoint.Create(sx, sy, _editor.Project.Options.PointShape); if (_editor.Project.Options.TryToConnect) { if (!_editor.TryToSplitLine(x, y, _shape, true)) { _editor.AddWithHistory(_shape); } } else { _editor.AddWithHistory(_shape); } } break; } }
/// <summary> /// /// </summary> public override void ToStateTwo() { _style = _editor.Project.Options.HelperStyle; _line12 = XLine.Create(0, 0, _style, null); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_line12); _helperPoint2 = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_helperPoint2); }
/// <summary> /// /// </summary> public override void ToStateOne() { _style = _editor.Project.Options.HelperStyle; _helperPoint1 = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_helperPoint1); _helperPoint4 = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_helperPoint4); }
/// <summary> /// /// </summary> public override void ToStateThree() { _line43 = XLine.Create(0, 0, _style, null); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_line43); _line23 = XLine.Create(0, 0, _style, null); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_line23); _helperPoint3 = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_helperPoint3); }
/// <summary> /// /// </summary> public override void ToStateOne() { _style = _editor.Project.Options.HelperStyle; _ellipse = XEllipse.Create(0, 0, _style, null); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_ellipse); _p1HelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_p1HelperPoint); _p2HelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_p2HelperPoint); _centerHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_centerHelperPoint); }
/// <summary> /// /// </summary> public override void ToStateThree() { if (_ellipse != null) { _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Remove(_ellipse); _ellipse = null; } _endLine = XLine.Create(0, 0, _style, null); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_endLine); _endHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_endHelperPoint); }
/// <summary> /// Creates a new instance of the XPoint class. /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="isStandalone"></param> /// <returns></returns> public XPoint Point( double x = 30, double y = 30, bool isStandalone = false) { var point = XPoint.Create( x, y, Context.Editor.Project.Options.PointShape); if (isStandalone) { Context.Editor.AddWithHistory(point); } return(point); }
/// <summary> /// /// </summary> public override void ToStateTwo() { if (_p1HelperPoint != null) { _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Remove(_p1HelperPoint); _p1HelperPoint = null; } if (_p2HelperPoint != null) { _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Remove(_p2HelperPoint); _p2HelperPoint = null; } _startLine = XLine.Create(0, 0, _style, null); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_startLine); _startHelperPoint = XPoint.Create(0, 0, _editor.Project.Options.PointShape); _editor.Project.CurrentContainer.HelperLayer.Shapes = _editor.Project.CurrentContainer.HelperLayer.Shapes.Add(_startHelperPoint); }
/// <summary> /// /// </summary> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <param name="style"></param> /// <param name="point"></param> /// <param name="isStroked"></param> /// <param name="name"></param> /// <returns></returns> public static XLine Create( double x1, double y1, double x2, double y2, ShapeStyle style, BaseShape point, bool isStroked = true, string name = "") { return(new XLine() { Name = name, Style = style, IsStroked = isStroked, IsFilled = false, Data = new Data() { Bindings = ImmutableArray.Create <ShapeBinding>(), Properties = ImmutableArray.Create <ShapeProperty>() }, Start = XPoint.Create(x1, y1, point), End = XPoint.Create(x2, y2, point) }); }
/// <summary> /// /// </summary> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <param name="style"></param> /// <param name="point"></param> /// <param name="text"></param> /// <param name="isStroked"></param> /// <param name="name"></param> /// <returns></returns> public static XText Create( double x1, double y1, double x2, double y2, ShapeStyle style, BaseShape point, string text, bool isStroked = true, string name = "") { return(new XText() { Name = name, Style = style, IsStroked = isStroked, Data = new Data() { Bindings = ImmutableArray.Create <ShapeBinding>(), Properties = ImmutableArray.Create <ShapeProperty>() }, TopLeft = XPoint.Create(x1, y1, point), BottomRight = XPoint.Create(x2, y2, point), Text = text }); }