A visual element that shows a pipe between two points.
Inheritance: MeshElement3D
        /// <summary>
        /// Adds an edge.
        /// </summary>
        /// <param name="p1">
        /// The start point.
        /// </param>
        /// <param name="p2">
        /// The end point.
        /// </param>
        private void AddEdge(Point3D p1, Point3D p2)
        {
            var fv = new PipeVisual3D();

            fv.BeginEdit();
            fv.Diameter = this.Diameter;
            fv.ThetaDiv = 10;
            fv.Fill     = this.Fill;
            fv.Point1   = p1;
            fv.Point2   = p2;
            fv.EndEdit();
            this.Children.Add(fv);
        }
Esempio n. 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 3:
                this.Tool3D = ((HelixToolkit.Wpf.PipeVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 3
0
        private void AddBases(ModelVisual3D model, int number, double turns, double length)
        {
            var b = turns * 2 * Math.PI;
            var l = length;
            var p1 = 0d;
            var p2 = 3.14;
            for (int i = 0; i < number; i++)
            {
                var u = (double)i / (number - 1);
                var bu = b * u;
                var x1 = Math.Cos(bu + p1) + Math.Cos(bu + p1);
                var y1 = Math.Sin(bu + p1) + Math.Sin(bu + p1);
                var z = u * l;
                var x2 = Math.Cos(bu + p2) + Math.Cos(bu + p2);
                var y2 = Math.Sin(bu + p2) + Math.Sin(bu + p2);
                var pt1 = new Point3D(x1, y1, z);
                var pt2 = new Point3D(x2, y2, z);
                var pt3 = new Point3D(0, 0, z);

                var j = r.Next(4);
                var brush1 = BaseBrush1[j];
                var brush2 = BaseBrush2[j];

                var ts = new PipeVisual3D
                             {
                                 Point1 = pt1,
                                 Point2 = pt3,
                                 Diameter = 0.4,
                                 Material = MaterialHelper.CreateMaterial(brush1)
                             };
                model.Children.Add(ts);

                var ts2 = new PipeVisual3D
                              {
                                  Point1 = pt3,
                                  Point2 = pt2,
                                  Diameter = 0.4,
                                  Material = MaterialHelper.CreateMaterial(brush2)
                              };
                model.Children.Add(ts2);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Adds an edge.
 /// </summary>
 /// <param name="p1">
 /// The start point.
 /// </param>
 /// <param name="p2">
 /// The end point.
 /// </param>
 private void AddEdge(Point3D p1, Point3D p2)
 {
     var fv = new PipeVisual3D();
     fv.BeginEdit();
     fv.Diameter = this.Diameter;
     fv.ThetaDiv = 10;
     fv.Fill = this.Fill;
     fv.Point1 = p1;
     fv.Point2 = p2;
     fv.EndEdit();
     this.Children.Add(fv);
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TextBoxSearchOffers = ((System.Windows.Controls.TextBox)(target));
                return;

            case 2:
                this.lbOffers = ((WpfFramework.Controls.MultiSelectListBox)(target));
                return;

            case 3:
                this.view3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 4:
                this.foo = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 5:
                this.rotate = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 6:
                this.view2dGcode = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 7:
                this.Tool3D = ((HelixToolkit.Wpf.PipeVisual3D)(target));
                return;

            case 8:
                this.view3dGcode = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 9:
                this.ToolGcode3D = ((HelixToolkit.Wpf.PipeVisual3D)(target));
                return;

            case 10:
                this.GcodeModel3d = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 11:
                this.rotateGcode = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 12:
                this.tbName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.cbGcode = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 14:
                this.cbkApplyEnergyCosts = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 15:
                this.ckbApplyTaxes = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 16:
                this.nudTaxRate = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

            case 17:
                this.TextBoxSearchPrinter = ((System.Windows.Controls.TextBox)(target));
                return;

            case 18:
                this.lbPrinters = ((WpfFramework.Controls.MultiSelectListBox)(target));
                return;

            case 19:
                this.TextBoxSearchMaterial = ((System.Windows.Controls.TextBox)(target));
                return;

            case 20:
                this.lbMaterials = ((WpfFramework.Controls.MultiSelectListBox)(target));
                return;

            case 21:
                this.TextBoxSearchStl = ((System.Windows.Controls.TextBox)(target));
                return;

            case 22:
                this.mslbStl = ((WpfFramework.Controls.MultiSelectListBox)(target));
                return;

            case 23:

            #line 1280 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

            case 24:

            #line 1294 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

            case 25:
                this.TextBoxSearchGcode = ((System.Windows.Controls.TextBox)(target));
                return;

            case 26:
                this.mslbGCode = ((WpfFramework.Controls.MultiSelectListBox)(target));
                return;

            case 27:

            #line 1544 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

            case 28:

            #line 1558 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }