Esempio n. 1
0
 public GrSplineBase(IGrObj parent)
     : base(parent)
 {
     Name = "Сплайн";
     this.DrawningRegion.DrawningContours.Add(
         new BasicContour()
     );
 }
Esempio n. 2
0
        public GrPoint(IGrObj parent, int x, int y)
            : base(parent)
        {
            BasicContour contour = new BasicContour();
            contour.DrawningPoints.Add(new Point(0, 0));
            this.DrawningRegion.DrawningContours.Add(contour);
            this.Trans.Move(x, y, false);

            Name = "Точка";
        }
Esempio n. 3
0
        protected internal override void OnObjectAdd(IGrObj grobj)
        {
            if (grobj is GrPoint)
            {
                _points.Add(grobj as GrPoint);
                _lpx = new double[_points.Count];
                _lpy = new double[_points.Count];

                base.OnObjectAdd(grobj);
            }
        }
Esempio n. 4
0
        public GrHermite(IGrObj parent, GrLine line1, GrLine line2)
            : base(parent)
        {
            _line1 = line1;
            _line2 = line2;

            Objects.Add(_line1);
            Objects.Add(_line2);

            Name = "Кривая Эрмита";
        }
Esempio n. 5
0
File: GrLine.cs Progetto: virl/fresk
        public GrLine(IGrObj parent, GrPoint p1, GrPoint p2)
            : base(parent)
        {
            this.DrawningRegion.DrawningContours.Add(new BasicContour());

            _p1 = p1;
            _p2 = p2;

            Objects.Add(_p1);
            Objects.Add(_p2);

            Name = "Отрезок";
        }
Esempio n. 6
0
 public TreePath GetPath(IGrObj node)
 {
     if (node == _root)
         return TreePath.Empty;
     else
     {
         Stack<object> stack = new Stack<object>();
         while (node != _root)
         {
             stack.Push(node);
             node = node.Parent;
         }
         return new TreePath(stack.ToArray());
     }
 }
Esempio n. 7
0
 public GrContour(IGrObj parent)
     : base(parent)
 {
     Name = "Контур";
     _pen = new Pen(Color.Black);
 }
Esempio n. 8
0
 public DrawEventArgs(DrawEventArgs args)
 {
     _gr = args._gr;
     _edited = args._edited;
     _draw = args._draw;
 }
Esempio n. 9
0
 public DrawEventArgs(Graphics gr, IGrObj edited, bool draw)
 {
     _gr = gr;
     _edited = edited;
     _draw = draw;
 }
Esempio n. 10
0
File: GrTso.cs Progetto: virl/fresk
 public GrTso(IGrObj parent)
     : base(parent)
 {
     Name = "ТМО";
 }
Esempio n. 11
0
 public GrBesie(IGrObj parent)
     : base(parent)
 {
     Name = "Кривая Безье";
 }
Esempio n. 12
0
 public void RemoveFromSelected(IGrObj grobj)
 {
     _sel.Remove(grobj);
     _grid.SelectedObjects = _sel.ToArray();
 }
Esempio n. 13
0
 public void AddToSelected(IGrObj grobj)
 {
     _sel.Add(grobj);
     _grid.SelectedObjects = _sel.ToArray();
 }
Esempio n. 14
0
 private IGrObj FindNode(IGrObj root, TreePath path, int level)
 {
     foreach (IGrObj node in root.Objects)
         if (node == path.FullPath[level])
         {
             if (level == path.FullPath.Length - 1)
                 return node;
             else
                 return FindNode(node, path, level + 1);
         }
     return null;
 }
Esempio n. 15
0
 internal void OnNodeRemoved(IGrObj parent, int index, IGrObj node)
 {
     if (NodesRemoved != null)
     {
         TreeModelEventArgs args = new TreeModelEventArgs(GetPath(parent), new int[] { index }, new object[] { node });
         NodesRemoved(this, args);
     }
 }