]> gerrit.simantics Code Review - simantics/3d.git/blob - 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
1 package org.simantics.g3d.csg.wizard;\r
2 \r
3 import java.util.Deque;\r
4 \r
5 import org.eclipse.core.runtime.preferences.InstanceScope;\r
6 import org.eclipse.jface.operation.IRunnableWithProgress;\r
7 import org.eclipse.jface.preference.IPersistentPreferenceStore;\r
8 import org.eclipse.ui.preferences.ScopedPreferenceStore;\r
9 import org.simantics.g3d.csg.Activator;\r
10 import org.simantics.g3d.wizard.ModelExportWizard;\r
11 import org.simantics.g3d.wizard.ModelExportWizardPage;\r
12 \r
13 public class CSGBRepExportWizard extends ModelExportWizard<CSGExportModel> {\r
14 \r
15         public static final String RECENT_CSG_EXPORT_LOCATIONS = "RECENT_CSG_EXPORT_LOCATIONS";\r
16         public static final String CSG_EXPORT_OVERWRITE = "CSG_EXPORT_OVERWRITE";\r
17     \r
18         public CSGBRepExportWizard() {\r
19                 setWindowTitle("Export CSG Model to Brep");\r
20                 setNeedsProgressMonitor(true);\r
21         }\r
22         \r
23         @Override\r
24         protected CSGExportModel createExportModel(Deque<String> recentExportPaths) {\r
25                 return new CSGExportModel(recentExportPaths);\r
26         }\r
27         \r
28         @Override\r
29         protected ModelExportWizardPage<CSGExportModel> createExportPage(CSGExportModel exportModel) {\r
30                 return new CSGExportPage(exportModel);\r
31         }\r
32         \r
33         @Override\r
34         protected IRunnableWithProgress createExportRunnable(CSGExportModel exportModel) {\r
35                 return new CSGBrepModelExporter(exportModel);\r
36         }\r
37         \r
38         @Override\r
39         protected String getExportLocationId() {\r
40                 return RECENT_CSG_EXPORT_LOCATIONS;\r
41         }\r
42         \r
43         @Override\r
44         protected String getExportOverwriteId() {\r
45                 return CSG_EXPORT_OVERWRITE;\r
46         }\r
47         \r
48 \r
49         @Override\r
50         protected IPersistentPreferenceStore getPreferenceStore() {\r
51                 return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID);\r
52         }\r
53         \r
54 \r
55 \r
56 }\r