Ejemplo n.º 1
0
        public void Export_SimpleModel_ValidOutput()
        {
            string path = "temp.x3d";

            var runner = new CrossThreadTestRunner();

            runner.RunInSTA(
                delegate
            {
                Console.WriteLine(Thread.CurrentThread.GetApartmentState());

                var vp    = new Viewport3D();
                vp.Camera = CameraHelper.CreateDefaultCamera();
                vp.Width  = 1280;
                vp.Height = 720;
                vp.Children.Add(new DefaultLightsVisual3D());
                var box = new BoxVisual3D();
                box.UpdateModel();
                vp.Children.Add(box);

                using (var e = new X3DExporter(path))
                {
                    e.Export(vp);
                }
            });

            var result = Validate(path);

            Assert.IsNull(result, result);
        }
Ejemplo n.º 2
0
        public void Export_SimpleModel_ValidOutput()
        {
            string path = "temp.x3d";
            var e = new X3DExporter();
            using (var stream = File.Create(path))
            {
                this.ExportSimpleModel(e, stream);
            }

            var result = this.Validate(path);
            Assert.IsNull(result, result);
        }
Ejemplo n.º 3
0
        public void Export_SimpleModel_ValidOutput()
        {
            string path = "temp.x3d";

            using (var e = new X3DExporter(path))
            {
                ExportSimpleModel(e);
            }

            var result = this.Validate(path);

            Assert.IsNull(result, result);
        }
Ejemplo n.º 4
0
        public void Export_SimpleModel_ValidOutput()
        {
            string path = "temp.x3d";
            var    e    = new X3DExporter();

            using (var stream = File.Create(path))
            {
                this.ExportSimpleModel(e, stream);
            }

            var result = this.Validate(path);

            Assert.IsNull(result, result);
        }
Ejemplo n.º 5
0
        private void FileExportRaw()
        {
            var path = FileDialogService.SaveFileDialog(null, null, Exporters.Filter, ".png");

            if (path == null)
            {
                return;
            }
            //HelixView.Export(path);
            ///*
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            var ext = Path.GetExtension(path).ToLowerInvariant();

            switch (ext)
            {
            case ".png":
            case ".jpg":
                HelixView.Export(path);
                break;

            case ".xaml":
            {
                var e = new XamlExporter(path);
                e.Export(CurrentModel);
                e.Close();
                break;
            }

            case ".xml":
            {
                var e = new KerkytheaExporter(path);
                e.Export(HelixView.Viewport);
                e.Close();
                break;
            }

            case ".obj":
            {
                var patient = new Patient();
                var e       = new SmileObjExporter(path);
                //e.Export(CurrentModel);
                ((SmileObjExporter)e).rawVisual = RawVisual;
                ((SmileObjExporter)e).Export(RawVisual, patient);
                e.Close();
                break;
            }

            case ".objz":
            {
                var tmpPath = Path.ChangeExtension(path, ".obj");
                var e       = new ObjExporter(tmpPath);
                e.Export(CurrentModel);
                e.Close();
                GZipHelper.Compress(tmpPath);
                break;
            }

            case ".x3d":
            {
                var e = new X3DExporter(path);
                e.Export(CurrentModel);
                e.Close();
                break;
            }
            }
            showStatus(stopWatch, "Exported");
            //*/
        }