/// <summary> /// Exports to X3D. /// </summary> /// <param name="view"> /// The view. /// </param> /// <param name="fileName"> /// Name of the file. /// </param> private static void ExportX3D(Viewport3D view, string fileName) { using (var e = new X3DExporter(fileName)) { e.Export(view); } }
/// <summary> /// Exports to an X3D file. /// </summary> /// <param name="view"> /// The viewport. /// </param> /// <param name="fileName"> /// Name of the file. /// </param> private static void ExportX3D(this Viewport3D view, string fileName) { var e = new X3DExporter(); using (var stream = File.Create(fileName)) { e.Export(view, stream); } }
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"); //*/ }