Пример #1
0
        private FreePoint compareFreePoints(RootFigureList figureList, FreePoint aPoint)
        {
            foreach (IFigure aFigure in figureList)
                if (aFigure is FreePoint && Math.Abs((aFigure as FreePoint).X - aPoint.X)<_delta && Math.Abs((aFigure as FreePoint).Y - aPoint.Y)<_delta)
                    return aFigure as FreePoint;

            return null;
        }
Пример #2
0
        private FreePoint compareFreePoints(RootFigureList figureList, FreePoint aPoint)
        {
            foreach (IFigure aFigure in figureList)
            {
                if (aFigure is FreePoint && Math.Abs((aFigure as FreePoint).X - aPoint.X) < _delta && Math.Abs((aFigure as FreePoint).Y - aPoint.Y) < _delta)
                {
                    return(aFigure as FreePoint);
                }
            }

            return(null);
        }
Пример #3
0
        public Drawing(Canvas canvas)
        {
            Check.NotNull(canvas, "canvas");

            ActionManager = new ActionManager();
            StyleManager = new StyleManager(this);

            Figures = new RootFigureList(this);

            OnAttachToCanvas += Drawing_OnAttachToCanvas;
            OnDetachFromCanvas += Drawing_OnDetachFromCanvas;

            Canvas = canvas;

            CoordinateSystem = new CoordinateSystem(this);
            CoordinateGrid = new CartesianGrid() { Drawing = this, Visible = Settings.Instance.ShowGrid };
            Figures.Add(CoordinateGrid);
            Version = Settings.CurrentDrawingVersion;
        }
Пример #4
0
        public Drawing(Canvas canvas)
        {
            Check.NotNull(canvas, "canvas");

            ActionManager = new ActionManager();
            StyleManager  = new StyleManager(this);

            Figures = new RootFigureList(this);

            OnAttachToCanvas   += Drawing_OnAttachToCanvas;
            OnDetachFromCanvas += Drawing_OnDetachFromCanvas;

            Canvas = canvas;

            CoordinateSystem = new CoordinateSystem(this);
            CoordinateGrid   = new CartesianGrid()
            {
                Drawing = this, Visible = Settings.Instance.ShowGrid
            };
            Figures.Add(CoordinateGrid);
            Version = Settings.CurrentDrawingVersion;
        }