public GrSplineBase(IGrObj parent) : base(parent) { Name = "Сплайн"; this.DrawningRegion.DrawningContours.Add( new BasicContour() ); }
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 = "Точка"; }
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); } }
public GrHermite(IGrObj parent, GrLine line1, GrLine line2) : base(parent) { _line1 = line1; _line2 = line2; Objects.Add(_line1); Objects.Add(_line2); Name = "Кривая Эрмита"; }
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 = "Отрезок"; }
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()); } }
public GrContour(IGrObj parent) : base(parent) { Name = "Контур"; _pen = new Pen(Color.Black); }
public DrawEventArgs(DrawEventArgs args) { _gr = args._gr; _edited = args._edited; _draw = args._draw; }
public DrawEventArgs(Graphics gr, IGrObj edited, bool draw) { _gr = gr; _edited = edited; _draw = draw; }
public GrTso(IGrObj parent) : base(parent) { Name = "ТМО"; }
public GrBesie(IGrObj parent) : base(parent) { Name = "Кривая Безье"; }
public void RemoveFromSelected(IGrObj grobj) { _sel.Remove(grobj); _grid.SelectedObjects = _sel.ToArray(); }
public void AddToSelected(IGrObj grobj) { _sel.Add(grobj); _grid.SelectedObjects = _sel.ToArray(); }
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; }
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); } }