X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FPovExporter.java;h=ee30841d6d779f7790b95006a58a75eda7759433;hp=cec38a2ef0d4efef537246dca164aa587e614e57;hb=4d5796d02a15808311c09448d79e6e7d1de9d636;hpb=140e9d165f85c3d4f0435a311e091209313faa2a diff --git a/tim/prune/save/PovExporter.java b/tim/prune/save/PovExporter.java index cec38a2..ee30841 100644 --- a/tim/prune/save/PovExporter.java +++ b/tim/prune/save/PovExporter.java @@ -32,6 +32,7 @@ import tim.prune.config.Config; import tim.prune.data.NumberUtils; import tim.prune.data.Track; import tim.prune.function.Export3dFunction; +import tim.prune.gui.DialogCloser; import tim.prune.load.GenericFileFilter; import tim.prune.threedee.LineDialog; import tim.prune.threedee.ThreeDModel; @@ -161,6 +162,7 @@ public class PovExporter extends Export3dFunction } _fontName = new JTextField(defaultFont, 12); _fontName.setAlignmentX(Component.LEFT_ALIGNMENT); + _fontName.addKeyListener(new DialogCloser(_dialog)); centralPanel.add(_fontName); //coordinates of camera JLabel cameraXLabel = new JLabel(I18nManager.getText("dialog.exportpov.camerax")); @@ -310,7 +312,7 @@ public class PovExporter extends Export3dFunction { FileWriter writer = null; // find out the line separator for this system - String lineSeparator = System.getProperty("line.separator"); + final String lineSeparator = System.getProperty("line.separator"); try { // create and scale model @@ -375,7 +377,7 @@ public class PovExporter extends Export3dFunction private void writeStartOfFile(FileWriter inWriter, double inModelSize, String inLineSeparator) throws IOException { - inWriter.write("// Pov file produced by Prune - see http://activityworkshop.net/"); + inWriter.write("// Pov file produced by GpsPrune - see http://activityworkshop.net/"); inWriter.write(inLineSeparator); inWriter.write(inLineSeparator); // Select font based on user input @@ -434,7 +436,7 @@ public class PovExporter extends Export3dFunction " sphere {", " <0, 0, 0>, 0.3", // size should depend on model size " texture {", - " pigment {color rgb <0.2 1.0 0.2>}", + " pigment {color rgb <0.1 0.6 0.1>}", // dark green " finish { phong 1 }", " }", " }", @@ -442,7 +444,7 @@ public class PovExporter extends Export3dFunction " sphere {", " <0, 0, 0>, 0.3", // size should depend on model size " texture {", - " pigment {color rgb <0.6 1.0 0.2>}", + " pigment {color rgb <0.4 0.9 0.2>}", // green " finish { phong 1 }", " }", " }", @@ -450,7 +452,7 @@ public class PovExporter extends Export3dFunction " sphere {", " <0, 0, 0>, 0.3", // size should depend on model size " texture {", - " pigment {color rgb <1.0 1.0 0.1>}", + " pigment {color rgb <0.7 0.8 0.2>}", // yellow " finish { phong 1 }", " }", " }", @@ -458,7 +460,7 @@ public class PovExporter extends Export3dFunction " sphere {", " <0, 0, 0>, 0.3", // size should depend on model size " texture {", - " pigment {color rgb <1.0 1.0 1.0>}", + " pigment {color rgb <0.5 0.8 0.6>}", // greeny " finish { phong 1 }", " }", " }", @@ -466,7 +468,15 @@ public class PovExporter extends Export3dFunction " sphere {", " <0, 0, 0>, 0.3", // size should depend on model size " texture {", - " pigment {color rgb <0.1 1.0 1.0>}", + " pigment {color rgb <0.2 0.9 0.9>}", // cyan + " finish { phong 1 }", + " }", + " }", + "#declare track_sphere5 =", + " sphere {", + " <0, 0, 0>, 0.3", // size should depend on model size + " texture {", + " pigment {color rgb <1.0 1.0 1.0>}", // white " finish { phong 1 }", " }", " }", @@ -531,7 +541,7 @@ public class PovExporter extends Export3dFunction * @param inLineSeparator line separator to use * @throws IOException on file writing error */ - private void writeLatLongLines(FileWriter inWriter, ThreeDModel inModel, String inLineSeparator) + private static void writeLatLongLines(FileWriter inWriter, ThreeDModel inModel, String inLineSeparator) throws IOException { inWriter.write("// Latitude and longitude lines:"); @@ -561,7 +571,7 @@ public class PovExporter extends Export3dFunction * @param inLineSeparator line separator to use * @throws IOException on file writing error */ - private void writeDataPointsBallsAndSticks(FileWriter inWriter, ThreeDModel inModel, String inLineSeparator) + private static void writeDataPointsBallsAndSticks(FileWriter inWriter, ThreeDModel inModel, String inLineSeparator) throws IOException { inWriter.write("// Data points:"); @@ -603,7 +613,7 @@ public class PovExporter extends Export3dFunction * @param inLineSeparator line separator to use * @throws IOException on file writing error */ - private void writeDataPointsTubesAndWalls(FileWriter inWriter, ThreeDModel inModel, String inLineSeparator) + private static void writeDataPointsTubesAndWalls(FileWriter inWriter, ThreeDModel inModel, String inLineSeparator) throws IOException { inWriter.write("// Data points:"); @@ -755,7 +765,7 @@ public class PovExporter extends Export3dFunction */ private static byte checkHeightCode(byte inCode) { - final byte maxHeightCode = 4; + final byte maxHeightCode = 5; if (inCode < 0) return 0; if (inCode > maxHeightCode) return maxHeightCode; return inCode;