Ejemplo n.º 1
0
 /// <summary>
 /// Exports to xaml.
 /// </summary>
 /// <param name="view">
 /// The view.
 /// </param>
 /// <param name="fileName">
 /// Name of the file.
 /// </param>
 private static void ExportXaml(Viewport3D view, string fileName)
 {
     using (var e = new XamlExporter(fileName))
     {
         e.Export(view);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Exports to xaml.
        /// </summary>
        /// <param name="view">
        /// The viewport.
        /// </param>
        /// <param name="fileName">
        /// Name of the file.
        /// </param>
        private static void ExportXaml(this Viewport3D view, string fileName)
        {
            var e = new XamlExporter();

            using (var stream = File.Create(fileName))
            {
                e.Export(view, stream);
            }
        }
Ejemplo n.º 3
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");
            //*/
        }