diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java index f3eb9e8d3..1b00fd5f4 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/TubeFinSetShapes.java @@ -10,72 +10,102 @@ import net.sf.openrocket.util.Coordinate; import net.sf.openrocket.util.Transformation; +/** + * The TubeFinSetShapes is used for retrieving shapes of the TubeFins on a + * Rocket from multiple view points. The returned shapes will be translated + * and transformed to the correct locations for rendering the rocket in the + * 2D view space. + */ public class TubeFinSetShapes extends RocketComponentShape { + /** + * Returns an array of RocketcomponentShapes that describe the shape of + * the TubeFinSet when viewed from the side of the rocket. TubeFins will + * appear as a Rectangle from the side view + * + * @param component the TubeFinSet to get the shapes for + * @param transformation the transformation to apply to the shapes + * @return an array of RocketComponentShapes that are used to draw the + * TubeFinSet from the side. + */ public static RocketComponentShape[] getShapesSide( final RocketComponent component, final Transformation transformation) { - TubeFinSet finset = (net.sf.openrocket.rocketcomponent.TubeFinSet)component; + TubeFinSet finSet = (TubeFinSet) component; - int fins = finset.getFinCount(); - double length = finset.getLength(); - double outerRadius = finset.getOuterRadius(); - double bodyRadius = finset.getBodyRadius(); - // old version - Oct, 19 2015 - //Coordinate[] instanceOffsets = new Coordinate[]{ transformation.transform( componentAbsoluteLocation )}; - //instanceOffsets = component.shiftCoordinates(instanceOffsets); - - // new version - Coordinate[] start = transformation.transform( component.getLocations()); + final double outerRadius = finSet.getOuterRadius(); + final double length = finSet.getLength(); + Coordinate[] locations = transformLocations(finSet, transformation); + Transformation finRotation = finSet.getFinRotationTransformation(); - Transformation baseRotation = finset.getBaseRotationTransformation(); - Transformation finRotation = finset.getFinRotationTransformation(); - - // Translate & rotate the coordinates - for (int i=0; i