protected static void WireTransformChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is WireVisual3D) { WireVisual3D dt = (WireVisual3D)d; dt.contours(dt.brush); /* * Point3DCollection contours = new Point3DCollection(); * contours.Add(dt.brace1.ToWorld(dt.brace1.centroid())); * contours.Add(dt.brace2.ToWorld(dt.brace2.centroid())); * * dt.Children.Clear(); * * TubeVisual3D tube = new TubeVisual3D { Diameter = 1.02, Path = contours, Fill = dt.brush }; * dt.Children.Add(tube); */ } }
internal void drawWire(List <BraceVisual3D> bracesModel) { //clearWires(); for (var i = 1; i < bracesModel.Count; i++) { BraceVisual3D brace1 = bracesModel[i - 1]; BraceVisual3D brace2 = bracesModel[i]; //brace1.SetMesh(brace1.ToWorldMesh()); //brace2.SetMesh(brace2.ToWorldMesh()); //brace1.SetMesh(brace1.ToLocalMesh(brace1.GetMesh())); //brace2.SetMesh(brace1.ToLocalMesh(brace2.GetMesh())); WireVisual3D wv = new WireVisual3D((i % 2 == 0? Brushes.Green: Brushes.Blue), brace1, brace2); //this.Children.Add(wv); wc.Children.Add(wv); } }
internal void removeWire(BraceVisual3D brace) { //List<Visual3D> list = this.Children.ToList(); List <Visual3D> list = wc.Children.ToList(); foreach (var t in list) { if (t is WireVisual3D) { WireVisual3D wv = (WireVisual3D)t; if (brace.Id == wv.Brace1.Id) { //this.Children.Remove(t); wc.Children.Remove(t); } else if (brace.Id == wv.Brace2.Id) { //this.Children.Remove(t); wc.Children.Remove(t); } } } }
public void hide(WireVisual3D wire) { this.Children.Remove(wire); }
public void show(WireVisual3D wire) { this.Children.Add(wire); }
internal void drawWire(List<BraceVisual3D> bracesModel) { //clearWires(); for (var i = 1; i < bracesModel.Count; i++) { BraceVisual3D brace1 = bracesModel[i - 1]; BraceVisual3D brace2 = bracesModel[i]; //brace1.SetMesh(brace1.ToWorldMesh()); //brace2.SetMesh(brace2.ToWorldMesh()); //brace1.SetMesh(brace1.ToLocalMesh(brace1.GetMesh())); //brace2.SetMesh(brace1.ToLocalMesh(brace2.GetMesh())); WireVisual3D wv = new WireVisual3D((i % 2 == 0? Brushes.Green: Brushes.Blue), brace1, brace2); //this.Children.Add(wv); wc.Children.Add(wv); } }