]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d.csg/src/org/simantics/g3d/csg/wizard/CSGBRepExportWizard.java
3D framework (Simca 2012)
[simantics/3d.git] / org.simantics.g3d.csg / src / org / simantics / g3d / csg / wizard / CSGBRepExportWizard.java
diff --git a/org.simantics.g3d.csg/src/org/simantics/g3d/csg/wizard/CSGBRepExportWizard.java b/org.simantics.g3d.csg/src/org/simantics/g3d/csg/wizard/CSGBRepExportWizard.java
new file mode 100644 (file)
index 0000000..44a227a
--- /dev/null
@@ -0,0 +1,56 @@
+package org.simantics.g3d.csg.wizard;\r
+\r
+import java.util.Deque;\r
+\r
+import org.eclipse.core.runtime.preferences.InstanceScope;\r
+import org.eclipse.jface.operation.IRunnableWithProgress;\r
+import org.eclipse.jface.preference.IPersistentPreferenceStore;\r
+import org.eclipse.ui.preferences.ScopedPreferenceStore;\r
+import org.simantics.g3d.csg.Activator;\r
+import org.simantics.g3d.wizard.ModelExportWizard;\r
+import org.simantics.g3d.wizard.ModelExportWizardPage;\r
+\r
+public class CSGBRepExportWizard extends ModelExportWizard<CSGExportModel> {\r
+\r
+       public static final String RECENT_CSG_EXPORT_LOCATIONS = "RECENT_CSG_EXPORT_LOCATIONS";\r
+       public static final String CSG_EXPORT_OVERWRITE = "CSG_EXPORT_OVERWRITE";\r
+    \r
+       public CSGBRepExportWizard() {\r
+               setWindowTitle("Export CSG Model to Brep");\r
+               setNeedsProgressMonitor(true);\r
+       }\r
+       \r
+       @Override\r
+       protected CSGExportModel createExportModel(Deque<String> recentExportPaths) {\r
+               return new CSGExportModel(recentExportPaths);\r
+       }\r
+       \r
+       @Override\r
+       protected ModelExportWizardPage<CSGExportModel> createExportPage(CSGExportModel exportModel) {\r
+               return new CSGExportPage(exportModel);\r
+       }\r
+       \r
+       @Override\r
+       protected IRunnableWithProgress createExportRunnable(CSGExportModel exportModel) {\r
+               return new CSGBrepModelExporter(exportModel);\r
+       }\r
+       \r
+       @Override\r
+       protected String getExportLocationId() {\r
+               return RECENT_CSG_EXPORT_LOCATIONS;\r
+       }\r
+       \r
+       @Override\r
+       protected String getExportOverwriteId() {\r
+               return CSG_EXPORT_OVERWRITE;\r
+       }\r
+       \r
+\r
+       @Override\r
+       protected IPersistentPreferenceStore getPreferenceStore() {\r
+               return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);\r
+       }\r
+       \r
+\r
+\r
+}\r