FreeformFinSetTest.testFreeformCMComputation_triangleOnTransition
was broken with the last merge. This change updates the expected
area for the fin tab to be the area of the triangle under the
curve as well as update the new CG contants in the tests.
Identified in #631
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Remove the openrocket.log file that is errantly in the tree.
Update .gitignore to not include openrocket.log in the future.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
MotorRowFilterTest lives in the wrong package and causes Eclipse
to fail building. Oddly, it still builds using the ant commandline,
but since it declares it should be in the package
net.sf.openrocket.gui.dialogs.motor.thrustcurve this change moves
it to the location it declares.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
When calculating the subject dimensions, use the height as the
radius of the circle which intersects all four corners of the
BoundingBox in the Y, Z plane for both the rear view and the
side view. The rear view was already doing this, but it was
non-obvious that the side view should also be using this to
calculate the height.
It becomes obvious if we think about a winged rocket, i.e. a
rocket who's fins in the Z direction are larger than those in
the Y direction. In this configuration, a height based off of
the fins in along the Y-axis alone will result in a "Fit" scaling
which encapuslates the Y-axis fins. However, rotating that
rocket will move the larger wings (the Z-axis fins) into the
view, but the height will not allow for the wings to draw properly
on the screen.
Thusly, using the radius from the circle intersecting the bounding
box along the Y, Z plane will ensure that the widest point from the
body will be able to fit within the side view, regardless of the
rotation around the X axis.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Use the FinSet.getBoundingBox() when computing the bounds for the
current configuration in FlightConfiguration.calculateBounds().
The FinSet already contains a BoundingBox method, however it returns
a larger BoundingBox than necessary to encapsulate the component.
Change the FinSet.getBoundingBox() to create a bounding box of the
smallest size to ensure a tight bounds for the FinSet. This is done
by taking each of the locations for the component and determining
where the fin tip point is and updating the BoundingBox with this
location.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Use the information provided in the getActiveInstances() in order to
calculate the length of the rocket. This change takes each component
instance and uses the component bounds and the instance's transform
in order to determine the instance's actual bounds. The length is
then calculated as the difference between the min and max X values,
using the BoundingBox.
Note, this particular change special-cases a few of the components
in order to get the right length. It is preferred to revisit each
special case in subsequent patches in order to keep this patch set
minimal for the time being.
The length calculations are already stressed during unit tests, but
the results are a bit more accurate and thus the unit tests are
updated to reflect the new values.
Fixes#452
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
- Close hooks are now called for all methods of closing a dialog ('close', 'X', and escape)
- Adds a rocket.removeComponentChangeListener to close hook
- removes redundant / buggy methods
Analysis from Justin Hanney indicates that the CPU is constantly
processing paint events in the ScaleScrollPane.Ruler. Change the
updateSize method to not revalidate and repaint since the
paintComponent method also invokes the updateSize to ensure it is
drawing components of the right size.
This change also refactors the ChangeListener implementation to
have the RulerClass implement the method instead of using an
anonymous class for event handling when ruler units change.
Additionally, this change adds a revalidate call to the scrollPane
to fix an issue where the ruler is not repainted when switching views
from 3D to 2D.
Fixes#615
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Fixes the stage selection buttons to only be active when the stage
is active and properly reflect the displayed stage state.
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
Use the curConfig.getLength() for the length displayed in the
RocketPanel rather than calculating it based off the bounds.
The length method provided by the FlightConfiguration takes
everything into account that is needed (active stages, etc)
to calculate the length.
Closes#452
Signed-off-by: Billy Olsen <billy.olsen@gmail.com>