batwings
fc2fd2a011
Merge branch 'feature-stagerecovery' into integration
...
Conflicts:
core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java
2012-10-24 10:22:48 -05:00
batwings
5d65b591e1
Merge branch 'feature-rocketconfig' into integration
...
Conflicts:
core/src/net/sf/openrocket/file/openrocket/importt/OpenRocketLoader.java
core/src/net/sf/openrocket/file/openrocket/savers/RocketComponentSaver.java
2012-10-24 09:26:29 -05:00
kruland2607
5deae1d3db
Found the missing pieces to make decals work.
2012-10-23 22:13:22 -05:00
kruland2607
04ee758e6a
Fix up failures from the previous merges.
2012-10-23 21:56:35 -05:00
Kevin Ruland
4466bc3f8a
Added FIXME for overwriting. Fixed warnings.
2012-10-23 16:25:47 -05:00
Kevin Ruland
207a768ded
If the exported file can no longer be found, fall back to other means of loading the decal.
2012-10-23 16:25:40 -05:00
Kevin Ruland
03bc001bbd
Implement simple export mechanism for decals. The 3d view will pull from the exported file for the duration of the editing session.
2012-10-23 16:25:33 -05:00
Kevin Ruland
a73358bd27
Added isExportable which tests if a decal is currently available from the container file. Refactored the code some. Use the FileUtils readBytes[] method.
2012-10-23 16:25:24 -05:00
Kevin Ruland
c9212c2b40
Added a couple of handy stream utilities. copy copies the contents of an InputStream to an OutputStream. readBytes returns the contents of an InputStream as a byte[].
2012-10-23 16:25:14 -05:00
Kevin Ruland
6cf525467c
Fix bug in base function - need to use the StorageOptions passed in instead of those stored in the OpenRocketDocument.
2012-10-23 16:25:07 -05:00
Kevin Ruland
fddf6cc0c7
Modified the AppearancePanel decal selector to have a combo box which follows the ComponentPreset pattern. The first entry in the combo box contains "none" entry which clears the decal associated with the component. The last entry in the combo box is "choose from file" which opens a file picker to select an image from the file system. The entries in between contain all the decals currently used by components in the document which facilitates reusing decals on the model.
2012-10-23 16:24:58 -05:00
Kevin Ruland
4cdf1e8e87
Modified the AppearancePanel decal selector to have a combo box which follows the ComponentPreset pattern. The first entry in the combo box contains "none" entry which clears the decal associated with the component. The last entry in the combo box is "choose from file" which opens a file picker to select an image from the file system. The entries in between contain all the decals currently used by components in the document which facilitates reusing decals on the model.
2012-10-23 16:24:50 -05:00
Kevin Ruland
bdca67fb7a
Added method to list all the decals currently used by the components in the document.
2012-10-23 16:24:42 -05:00
Kevin Ruland
82679233f9
Rework GeneralRocketSaver to allow for proper behavior when overwriting container files. The problem was that the SaveFileWorker was opening the container file for writing before the saver was able to extract all the decals contained in it. This resulted in a failure and the output file had zero length. To fix this issue, the saver will first write to a new temporary file, then if the write is successful, it will copy the old file out of the way, copy the temporary file over it, then finally remove the old file. This results in a much more failure resistant writing process in all scenarios (even when not saving with decals).
...
In order to make this change, the SaveFileWorker could no longer pass in an OutputStream (since it shouldn't have to worry about all the file copies). The progress update mechanism had to be reworked to use an explict callback object instead of being built into the OutputStream.
2012-10-23 16:23:47 -05:00
Kevin Ruland
d40a36d09b
We need to pull the bytes out of the input stream so we can close the input stream. It seems the Jogl Texture loader does not close the input stream. When loading textures from a zip file, this leaves the zip file open and prevents saving/ moving the file.
2012-10-23 16:23:40 -05:00
Kevin Ruland
3195b8d5df
If reading from an ork container format, change the StorageOptions to reflect IncludeDecals = true.
2012-10-23 16:23:31 -05:00
Kevin Ruland
4757ce82f2
Update comments in saveAsRocksim(File) method noting that the saved state flag in OpenRocketDocument should not be switched to true after a successful save.
2012-10-23 16:23:23 -05:00
Kevin Ruland
3c7afcc2fb
Update the state of the Include Decals button based on the current StorageOptions.
2012-10-23 16:23:16 -05:00
Kevin Ruland
e78f5b27f1
Added example file with decals.
2012-10-23 16:23:09 -05:00
Kevin Ruland
26370cd416
Change name of output file.
2012-10-23 16:23:02 -05:00
Kevin Ruland
f92cb2c8d6
Some refactoring: changed name of variable "filename" to "displayName" in BasicFrame to indicate that the string is used for presentation in the opening dialog and not as the name of a File to option. Moved the call to OpenRocketDocument.setFile() and setSaved() into OpenFileWorker instead of BasicFrame so the File object doesn't need to get passed around so much. Modified the RocketSaver interface to not require the filename since it doesn't need it anymore.
2012-10-23 16:22:47 -05:00
Kevin Ruland
e9060272e4
Created a GeneralRocketSaver object which is analogous to GeneralRocketLoader. Based on the StorageOptions, it determines how to save the file using a RocksimSaver or OpenRocketSaver as appropriate. Modified RocksimSaver and OpenRocketSaver so they only operate on OutputStreams. Removed methods from RocketSaver interface which operated on File. Fixed bug in DecalRegistry where it wouldn't handle absolute filenames. Fixed bug in BasicFrame where it would display ugly stuff for the filename.
2012-10-23 16:19:37 -05:00
Bill Kuker
4fe9dc4eef
Fix to provide a FileInfo to the GeneralRocketLoader
2012-10-23 16:13:49 -05:00
Kevin Ruland
d0569e5759
Fixed loading decals from example file. Added FileInfo class which is used to describe data about the file - what the URL is to it and it's parent directory (if appropriate). The FileInfo class is pushed into the DecalRegistry to facilitate loading decals from the correct location. Added the Apocalypse with decals as an example file.
2012-10-23 16:13:35 -05:00
Kevin Ruland
05d1b91d90
Sizable commit with lots of changes to support decals in openrocket files. Added support for zip container support. Changed Decal to hold a String instead of URL. Refactored GeneralRocketLoader out of the RocketLoader hierarchy so the GeneralRocketLoader knows about files and RocketLoader only knows about streams. Changed the OpenRocket file format to 1.6 and added <appearance> and it's children for ambient light and decals. Implemented a DecalRegistry which is a member of the OpenRocketDocument. This class is used to get InputStreams for decals by their names.
2012-10-23 15:54:45 -05:00
Kevin Ruland
49c9329fde
Added option to include decals when saving a file.
2012-10-23 15:12:49 -05:00
Kevin Ruland
1490f48f29
Switch to use the GeneralRocketLoader. It loads rkt files just fine and in a few commits, RocksimLoader won't know what to do with a File.
2012-10-23 15:12:42 -05:00
Bill Kuker
4ab28bbf54
Make the default checkbox text work the right way: check box's text, not a separate label
2012-10-23 15:12:35 -05:00
Bill Kuker
6a2ebb6851
Add translatable text names to the texture wrap mode enum
2012-10-23 15:12:28 -05:00
Bill Kuker
74783afe3f
Cache model bounds for performance
2012-10-23 15:12:21 -05:00
Bill Kuker
d1d6e3c2a3
Repaint on render type change.
2012-10-23 15:12:14 -05:00
Bill Kuker
b8cd9dab42
Remove figure tab from RocketComponentConfig
2012-10-23 15:12:06 -05:00
Bill Kuker
4f28eea758
Change view type from buttons to drop-down, include 3d figure & realistic
2012-10-23 15:11:53 -05:00
Bill Kuker
a2afb106d5
Add ability to change RenderStrategy on the fly.
2012-10-23 15:08:36 -05:00
Bill Kuker
f5c309d2cc
Move lighting setup into RenderStrategies
2012-10-23 15:08:18 -05:00
Bill Kuker
fc848db00e
Null out appearance when default for material is selected
2012-10-23 15:04:47 -05:00
Bill Kuker
1b55457636
Repeat texture along length, not just circumference.
2012-10-23 15:04:39 -05:00
Bill Kuker
1bf7cc32b9
Honor RockSim flipS & flipT.
2012-10-23 15:04:32 -05:00
Bill Kuker
40cac0f8fd
Use a single static JColorChooser instance to keep recent colors populated.
2012-10-23 15:04:25 -05:00
Bill Kuker
0cd27951e1
Fix backwards textures
2012-10-23 15:04:18 -05:00
Bill Kuker
d22cefa248
Carry init & dispose methods down into RenderStrategy, so that textures can be disposed of and reloaded.
2012-10-23 15:04:04 -05:00
Bill Kuker
dc66d2a93e
English l10n on appearance config
2012-10-23 14:53:38 -05:00
Bill Kuker
d47101676b
Give a better indication that the button this colorIcon is on is disabled: Draw an empty outline rectangle if disabled, a filled rectangle if enabled.
2012-10-23 14:53:31 -05:00
Bill Kuker
8ceaa74666
Brighten up the figure
2012-10-23 14:53:25 -05:00
Bill Kuker
41dc9dc34b
Make the test texture model work out of SVN, without paths to my desktop.
2012-10-23 14:53:17 -05:00
Bill Kuker
97b2ad36bd
Better texture filtering
2012-10-23 14:53:11 -05:00
Bill Kuker
3c0ad074ef
Having Ambient and Diffuse sum to more than one causes inconsistencies with textures. It looks like it is clamping the color from lighting before it multiplies it with the texture.
2012-10-23 14:53:04 -05:00
Bill Kuker
68954b0ed5
Are UseSingleColor and SimpleColorModel synonyms? Hope so!
2012-10-23 14:52:57 -05:00
Bill Kuker
00ff011f4d
Separate specular color
2012-10-23 14:52:50 -05:00
Bill Kuker
5dd804bed0
Trying to get material and lighting right
2012-10-23 14:52:42 -05:00