diff --git a/core/src/main/java/info/openrocket/core/file/rocksim/importt/PodHandler.java b/core/src/main/java/info/openrocket/core/file/rocksim/importt/PodHandler.java index 1fd71c9d6..527966416 100644 --- a/core/src/main/java/info/openrocket/core/file/rocksim/importt/PodHandler.java +++ b/core/src/main/java/info/openrocket/core/file/rocksim/importt/PodHandler.java @@ -18,7 +18,7 @@ import java.util.HashMap; public class PodHandler extends PositionDependentHandler { /** - * The OpenRocket BodyTube. + * The OpenRocket Pod. */ private final RocketComponent parent; private final PodSet podSet; diff --git a/core/src/main/resources/l10n/messages_ar.properties b/core/src/main/resources/l10n/messages_ar.properties index 8aba2669c..b2b80f334 100644 --- a/core/src/main/resources/l10n/messages_ar.properties +++ b/core/src/main/resources/l10n/messages_ar.properties @@ -989,7 +989,7 @@ ComponentCfgDlg.MultiComponentEdit.ttip = :أنت تقوم بتعديل ا ComponentCfgDlg.Modify = تعديل ComponentCfgDlg.ModifyComponents = تعديل المكونات -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = فصل ComponentAssemblyConfig.tab.Separation.ttip = خيارات فصل المرحلة ComponentAssemblyConfig.separation.lbl.title = :حدد متى تنفصل هذه المرحلة diff --git a/core/src/main/resources/l10n/messages_cs.properties b/core/src/main/resources/l10n/messages_cs.properties index c80c94083..8ee527c59 100644 --- a/core/src/main/resources/l10n/messages_cs.properties +++ b/core/src/main/resources/l10n/messages_cs.properties @@ -675,7 +675,7 @@ CenteringRingCfg.tab.Generalproperties = Obecn ComponentCfgDlg.configuration = konfigurace ComponentCfgDlg.Modify = Uprav -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Oddelen ComponentAssemblyConfig.tab.Separation.ttip = Vlastnosti oddelen stupne ComponentAssemblyConfig.separation.lbl.title = Oznac kdy se m tento stupn oddelit: diff --git a/core/src/main/resources/l10n/messages_de.properties b/core/src/main/resources/l10n/messages_de.properties index e417033ab..102db8ece 100644 --- a/core/src/main/resources/l10n/messages_de.properties +++ b/core/src/main/resources/l10n/messages_de.properties @@ -732,7 +732,7 @@ CenteringRingCfg.tab.Generalproperties = Allgemeine Eigenschaften ComponentCfgDlg.configuration = Konfiguration ComponentCfgDlg.Modify = Verndern -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Stufentrennung ComponentAssemblyConfig.tab.Separation.ttip = Stufentrennungs-Optionen ComponentAssemblyConfig.separation.lbl.title = Auswhlen, wenn diese Stufe getrennt wird: diff --git a/core/src/main/resources/l10n/messages_es.properties b/core/src/main/resources/l10n/messages_es.properties index ef0a336e8..cacc19f7e 100644 --- a/core/src/main/resources/l10n/messages_es.properties +++ b/core/src/main/resources/l10n/messages_es.properties @@ -1056,7 +1056,7 @@ StageAction.Stage = Etapa ComponentAssemblyConfig.separation.lbl.plus = m\u00e1s ComponentAssemblyConfig.separation.lbl.seconds = segundos ComponentAssemblyConfig.separation.lbl.title = Seleccione el instante de separaci\u00f3n de esta etapa: -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Separaci\u00f3n ComponentAssemblyConfig.tab.Separation.ttip = Opciones de separaci\u00f3n de etapa diff --git a/core/src/main/resources/l10n/messages_fr.properties b/core/src/main/resources/l10n/messages_fr.properties index 488322aaf..41c03ef7c 100644 --- a/core/src/main/resources/l10n/messages_fr.properties +++ b/core/src/main/resources/l10n/messages_fr.properties @@ -1049,7 +1049,7 @@ StageAction.Stage = Etage ComponentAssemblyConfig.separation.lbl.plus = plus ComponentAssemblyConfig.separation.lbl.seconds = secondes ComponentAssemblyConfig.separation.lbl.title = Choisir lorsque cet \u00E9tage se s\u00E9pare: -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = S\u00E9paration ComponentAssemblyConfig.tab.Separation.ttip = Options de s\u00E9paration de l'\u00E9tage diff --git a/core/src/main/resources/l10n/messages_it.properties b/core/src/main/resources/l10n/messages_it.properties index 8633a11bf..67271b83b 100644 --- a/core/src/main/resources/l10n/messages_it.properties +++ b/core/src/main/resources/l10n/messages_it.properties @@ -734,7 +734,7 @@ CenteringRingCfg.tab.Generalproperties = Proprieta' generali ComponentCfgDlg.configuration = (configurazione) ComponentCfgDlg.Modify = Modifica -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Separazione ComponentAssemblyConfig.tab.Separation.ttip = Opzioni della separazione dello stadio ComponentAssemblyConfig.separation.lbl.title = Seleziona quando questo stadio separa: diff --git a/core/src/main/resources/l10n/messages_ja.properties b/core/src/main/resources/l10n/messages_ja.properties index da7f6a90f..6bd18b21b 100644 --- a/core/src/main/resources/l10n/messages_ja.properties +++ b/core/src/main/resources/l10n/messages_ja.properties @@ -764,7 +764,7 @@ CenteringRingCfg.tab.Generalproperties = \u4E00\u822C ComponentCfgDlg.configuration = \u30B3\u30F3\u30D5\u30A3\u30AE\u30E5\u30EC\u30FC\u30B7\u30E7\u30F3 ComponentCfgDlg.Modify = \u5909\u66F4 -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = \u5206\u96E2 ComponentAssemblyConfig.tab.Separation.ttip = \u30B9\u30C6\u30FC\u30B8\u5206\u96E2\u30AA\u30D7\u30B7\u30E7\u30F3 ComponentAssemblyConfig.separation.lbl.title = \u30B9\u30C6\u30FC\u30B8\u304C\u5206\u96E2\u3059\u308B\u6642\u523B\u306E\u9078\u629E\uFF1A diff --git a/core/src/main/resources/l10n/messages_nl.properties b/core/src/main/resources/l10n/messages_nl.properties index b29d9c9c9..cc8da870e 100644 --- a/core/src/main/resources/l10n/messages_nl.properties +++ b/core/src/main/resources/l10n/messages_nl.properties @@ -940,7 +940,7 @@ CenteringRingCfg.tab.Generalproperties = Algemene eigenschappen ComponentCfgDlg.configuration = configuratie ComponentCfgDlg.Modify = Wijzigen -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Afscheiding ComponentAssemblyConfig.tab.Separation.ttip = Etape afscheidingsopties ComponentAssemblyConfig.separation.lbl.title = Selecteer wanneer deze etape afscheidt: @@ -949,7 +949,7 @@ ComponentAssemblyConfig.separation.lbl.seconds = seconden ComponentAssemblyConfig.parallel.radius = Radiale Afstand ComponentAssemblyConfig.parallel.angle = Hoek ComponentAssemblyConfig.parallel.count = Aantal kopieën -StageConfig.parallel.offset = Offset-waarde +ComponentAssemblyConfig.parallel.offset = Offset-waarde !EllipticalFinSetConfig EllipticalFinSetCfg.Nbroffins = Aantal vinnen: diff --git a/core/src/main/resources/l10n/messages_pl.properties b/core/src/main/resources/l10n/messages_pl.properties index c677e482b..e8419cd44 100644 --- a/core/src/main/resources/l10n/messages_pl.properties +++ b/core/src/main/resources/l10n/messages_pl.properties @@ -679,7 +679,7 @@ ComponentInfo.EngineBlock = Blokada silnika unieruchamia silnik wewn\u01 ComponentCfgDlg.configuration = konfiguracja ComponentCfgDlg.Modify = Zmodyfikuj - !StageConfig + !ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Separacja ComponentAssemblyConfig.tab.Separation.ttip = Opcje oddzielenia cz\u0142onu ComponentAssemblyConfig.separation.lbl.title = Ustal moment oddzielenia cz\u0142onu: diff --git a/core/src/main/resources/l10n/messages_ru.properties b/core/src/main/resources/l10n/messages_ru.properties index 501905bec..30e644adf 100644 --- a/core/src/main/resources/l10n/messages_ru.properties +++ b/core/src/main/resources/l10n/messages_ru.properties @@ -969,7 +969,7 @@ ComponentCfgDlg.MultiComponentEdit.ttip = \u0412\u044B \u0440\u0435\u0434\ ComponentCfgDlg.Modify = \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C ComponentCfgDlg.ModifyComponents = \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u044B -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = \u0420\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u0435 ComponentAssemblyConfig.tab.Separation.ttip = \u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u0441\u0442\u0443\u043F\u0435\u043D\u0435\u0439 ComponentAssemblyConfig.separation.lbl.title = \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u043A\u043E\u0433\u0434\u0430 \u044D\u0442\u0430 \u0441\u0442\u0443\u043F\u0435\u043D\u044C \u043E\u0442\u0434\u0435\u043B\u044F\u0435\u0442\u0441\u044F: diff --git a/core/src/main/resources/l10n/messages_uk_UA.properties b/core/src/main/resources/l10n/messages_uk_UA.properties index c5921c339..a7c2c7d09 100644 --- a/core/src/main/resources/l10n/messages_uk_UA.properties +++ b/core/src/main/resources/l10n/messages_uk_UA.properties @@ -837,7 +837,7 @@ CenteringRingCfg.tab.Generalproperties = General properties ComponentCfgDlg.configuration = configuration ComponentCfgDlg.Modify = Modify -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = Separation ComponentAssemblyConfig.tab.Separation.ttip = Stage separation options ComponentAssemblyConfig.separation.lbl.title = Select when this stage separates: diff --git a/core/src/main/resources/l10n/messages_zh_CN.properties b/core/src/main/resources/l10n/messages_zh_CN.properties index 5274108bf..81cf30543 100644 --- a/core/src/main/resources/l10n/messages_zh_CN.properties +++ b/core/src/main/resources/l10n/messages_zh_CN.properties @@ -1124,7 +1124,7 @@ StageAction.Stage = \u7EA7 ComponentAssemblyConfig.separation.lbl.plus = \u52A0 ComponentAssemblyConfig.separation.lbl.seconds = \u79D2 ComponentAssemblyConfig.separation.lbl.title = \u8BBE\u5B9A\u5206\u79BB\u65F6\u673A: -!StageConfig +!ComponentAssemblyConfig ComponentAssemblyConfig.tab.Separation = \u5206\u79BB ComponentAssemblyConfig.tab.Separation.ttip = \u591A\u7EA7\u5206\u79BB\u9009\u9879 diff --git a/swing/src/main/java/info/openrocket/swing/file/wavefrontobj/OBJOptionChooser.java b/swing/src/main/java/info/openrocket/swing/file/wavefrontobj/OBJOptionChooser.java index c10ffb561..eb54f0989 100644 --- a/swing/src/main/java/info/openrocket/swing/file/wavefrontobj/OBJOptionChooser.java +++ b/swing/src/main/java/info/openrocket/swing/file/wavefrontobj/OBJOptionChooser.java @@ -18,11 +18,13 @@ import info.openrocket.core.file.wavefrontobj.ObjUtils; import javax.swing.AbstractButton; import javax.swing.BorderFactory; +import javax.swing.DefaultListCellRenderer; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; +import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSeparator; @@ -32,6 +34,7 @@ import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.Color; +import java.awt.Component; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -56,6 +59,8 @@ public class OBJOptionChooser extends JPanel { private final JCheckBox exportAsSeparateFiles; private final JCheckBox removeOffset; private final JCheckBox triangulate; + private final JLabel tmLabel; + private final JComboBox triangulationMethod; private final JCheckBox sRGB; private final JComboBox LOD; private final DoubleModel scalingModel; @@ -226,11 +231,15 @@ public class OBJOptionChooser extends JPanel { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { + tmLabel.setEnabled(true); + triangulationMethod.setEnabled(true); // Disable the export appearance, it is not supported in combination with triangulate exportAppearance.setEnabled(false); exportAppearance.setSelected(false); exportAppearance.setToolTipText(trans.get("OBJOptionChooser.checkbox.exportAppearance.ttip.triangulate")); } else { + tmLabel.setEnabled(false); + triangulationMethod.setEnabled(false); // Re-enable exportAppearance.setEnabled(true); exportAppearance.setSelected(opts.isExportAppearance()); @@ -239,6 +248,17 @@ public class OBJOptionChooser extends JPanel { } }); + //// Triangulation method + this.tmLabel = new JLabel(trans.get("OBJOptionChooser.lbl.triangulationMethod")); + this.tmLabel.setToolTipText(trans.get("OBJOptionChooser.lbl.triangulationMethod.ttip")); + advancedOptionsPanel.add(this.tmLabel, "spanx, split 2"); + this.triangulationMethod = new JComboBox<>(ObjUtils.TriangulationMethod.values()); + this.triangulationMethod.setToolTipText(trans.get("OBJOptionChooser.lbl.triangulationMethod.ttip")); + this.triangulationMethod.setRenderer(new TriangulationMethodRenderer()); + destroyTheMagic(triangulationMethod); + addOptimizationListener(triangulationMethod); + advancedOptionsPanel.add(triangulationMethod, "growx, wrap unrel"); + //// Level of detail JLabel LODLabel = new JLabel(trans.get("OBJOptionChooser.lbl.LevelOfDetail")); LODLabel.setToolTipText(trans.get("OBJOptionChooser.lbl.LevelOfDetail.ttip")); @@ -397,6 +417,7 @@ public class OBJOptionChooser extends JPanel { if (!opts.isTriangulate()) { this.exportAppearance.setSelected(opts.isExportAppearance()); } + this.triangulationMethod.setSelectedItem(opts.getTriangulationMethod()); this.sRGB.setSelected(opts.isUseSRGB()); this.scalingModel.setValue(opts.getScaling()); @@ -425,6 +446,7 @@ public class OBJOptionChooser extends JPanel { opts.setExportAsSeparateFiles(exportAsSeparateFiles.isSelected()); opts.setRemoveOffset(removeOffset.isSelected()); opts.setTriangulate(triangulate.isSelected()); + opts.setTriangulationMethod((ObjUtils.TriangulationMethod) triangulationMethod.getSelectedItem()); opts.setUseSRGB(sRGB.isSelected()); opts.setScaling((float) scalingModel.getValue()); opts.setLOD((ObjUtils.LevelOfDetail) LOD.getSelectedItem()); @@ -444,6 +466,7 @@ public class OBJOptionChooser extends JPanel { options.setRemoveOffset(true); options.setScaling(1000); options.setTriangulate(true); + options.setTriangulationMethod(ObjUtils.TriangulationMethod.DELAUNAY); options.setLOD(ObjUtils.LevelOfDetail.HIGH_QUALITY); loadOptions(options); @@ -456,6 +479,7 @@ public class OBJOptionChooser extends JPanel { */ private boolean isOptimizedFor3DPrinting(OBJExportOptions options) { return !options.isExportMotors() && !options.isExportAppearance() && options.isTriangulate() && + options.getTriangulationMethod() == ObjUtils.TriangulationMethod.DELAUNAY && options.getLOD() == ObjUtils.LevelOfDetail.HIGH_QUALITY && options.isRemoveOffset() && options.getScaling() == 1000; } @@ -584,6 +608,22 @@ public class OBJOptionChooser extends JPanel { } } + private static class TriangulationMethodRenderer extends DefaultListCellRenderer { + + @Override + public Component getListCellRendererComponent(JList list, Object value, + int index, boolean isSelected, boolean cellHasFocus) { + + JComponent comp = (JComponent) super.getListCellRendererComponent(list, + value, index, isSelected, cellHasFocus); + + if (index > -1 && value instanceof ObjUtils.TriangulationMethod) { + list.setToolTipText(((ObjUtils.TriangulationMethod) value).getTooltip()); + } + return comp; + } + } + /*private void coordTransComboAction(ItemEvent e, JComboBox otherCombo) { if (e.getStateChange() != ItemEvent.SELECTED) { return;