A visual element that shows the Utah teapot test model.
Inheritance: MeshElement3D
        private void Create3DViewPort()
        {
            var hvp3d = new HelixViewport3D();
            Viewport3D vp3d = new Viewport3D();
            var lights = new DefaultLights();
            var tp = new Teapot();

            hvp3d.Children.Add(lights);
            hvp3d.Children.Add(tp);

            vp3d = hvp3d.Viewport;
            tata.Children.Add(vp3d); // comenter ca pour test

            /* MEGA TEST DE L'ESPACE SUBSAHARIEN */

            RenderTargetBitmap bmp = new RenderTargetBitmap(800, 800, 96, 96, PixelFormats.Pbgra32);
            var rect = new Rect(0, 0, 800, 800);
            vp3d.Measure(new Size(800, 800));
            vp3d.Arrange(rect);
            vp3d.InvalidateVisual();
            
            bmp.Render(vp3d);

            PngBitmapEncoder png = new PngBitmapEncoder();
            png.Frames.Add(BitmapFrame.Create(bmp));

            String filepath = "C:\\Users\\Remi\\Desktop\\canardmasque.png";
            using (Stream stm = File.Create(filepath))
            {
                png.Save(stm);
            }
        }
Esempio n. 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\MainWindow.xaml"
                ((DressUp_1._1.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 5 "..\..\MainWindow.xaml"
                ((DressUp_1._1.MainWindow)(target)).Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.camera = ((System.Windows.Controls.Image)(target));
                return;

            case 3:
                this.canvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 4:

            #line 13 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Color_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 14 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Depth_Click);

            #line default
            #line hidden
                return;

            case 6:

            #line 15 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Infrared_Click);

            #line default
            #line hidden
                return;

            case 7:

            #line 16 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Body_Click);

            #line default
            #line hidden
                return;

            case 8:

            #line 17 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Collection_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.dressbtn = ((System.Windows.Controls.Button)(target));

            #line 19 "..\..\MainWindow.xaml"
                this.dressbtn.Click += new System.Windows.RoutedEventHandler(this.Dressbtn_Click_1);

            #line default
            #line hidden
                return;

            case 10:
                this.shirt = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 11:
                this.helixPort = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 12:
                this.tea = ((HelixToolkit.Wpf.Teapot)(target));
                return;

            case 13:
                this.CollectionShirts = ((System.Windows.Controls.Grid)(target));
                return;

            case 14:
                this.shirt1 = ((System.Windows.Controls.Button)(target));

            #line 51 "..\..\MainWindow.xaml"
                this.shirt1.Click += new System.Windows.RoutedEventHandler(this.shirt1_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.shirt2 = ((System.Windows.Controls.Button)(target));

            #line 52 "..\..\MainWindow.xaml"
                this.shirt2.Click += new System.Windows.RoutedEventHandler(this.shirt2_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.shirt3 = ((System.Windows.Controls.Button)(target));

            #line 53 "..\..\MainWindow.xaml"
                this.shirt3.Click += new System.Windows.RoutedEventHandler(this.shirt3_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.shirt4 = ((System.Windows.Controls.Button)(target));

            #line 54 "..\..\MainWindow.xaml"
                this.shirt4.Click += new System.Windows.RoutedEventHandler(this.shirt4_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.right = ((System.Windows.Controls.Button)(target));

            #line 55 "..\..\MainWindow.xaml"
                this.right.Click += new System.Windows.RoutedEventHandler(this.right_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.arrow = ((System.Windows.Media.ImageBrush)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 3
0
        public void InitGraphics(Control destControl, TreeView destTreeControl)
        {
            _destControl = destControl;
            _treeControl = destTreeControl;
            hVp3D = new HelixViewport3D();
            var host = new ElementHost();
            host.Dock = DockStyle.Fill;
            host.Child = hVp3D;
            _destControl.Controls.Add(host);

            BindMouseHandler();

            var lights = new DefaultLights();
            hVp3D.Children.Add(lights);

            var teaPot = new Teapot();
            hVp3D.Children.Add(teaPot);
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.rotationSlider = ((System.Windows.Controls.Slider)(target));

            #line 26 "..\..\MainWindow.xaml"
                this.rotationSlider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.RX = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 3:
                this.RY = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 4:
                this.RZ = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 5:
                this.Xpos = ((System.Windows.Controls.Slider)(target));

            #line 39 "..\..\MainWindow.xaml"
                this.Xpos.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Xpos_ValueChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.Ypos = ((System.Windows.Controls.Slider)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.Ypos.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Xpos_ValueChanged);

            #line default
            #line hidden
                return;

            case 7:
                this.Zpos = ((System.Windows.Controls.Slider)(target));

            #line 42 "..\..\MainWindow.xaml"
                this.Zpos.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Xpos_ValueChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.z = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 9:
                this.tea = ((HelixToolkit.Wpf.Teapot)(target));
                return;
            }
            this._contentLoaded = true;
        }