Пример #1
0
        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);
                 */
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
                    }
                }
            }
        }
Пример #4
0
 public void hide(WireVisual3D wire)
 {
     this.Children.Remove(wire);        
 }
Пример #5
0
 public void show(WireVisual3D wire)
 {
     this.Children.Add(wire);
 }
Пример #6
0
        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);
            }
        }
Пример #7
0
 public void hide(WireVisual3D wire)
 {
     this.Children.Remove(wire);
 }
Пример #8
0
 public void show(WireVisual3D wire)
 {
     this.Children.Add(wire);
 }