From 908e6359ff255891e58e0710ddeca45c0d4f3839 Mon Sep 17 00:00:00 2001 From: Billy Olsen Date: Sat, 25 Jul 2020 18:18:46 -0700 Subject: [PATCH] Add BoxBounded interface to TubeFinSet TubeFinSets cause rocket size within the panel to be a bit off. Add the BoxBounded interface to provide a tight BoundingBox. Signed-off-by: Billy Olsen --- .../net/sf/openrocket/rocketcomponent/TubeFinSet.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/TubeFinSet.java b/core/src/net/sf/openrocket/rocketcomponent/TubeFinSet.java index 76b833584..936a6d584 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/TubeFinSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/TubeFinSet.java @@ -12,11 +12,12 @@ import net.sf.openrocket.rocketcomponent.position.AxialMethod; import net.sf.openrocket.rocketcomponent.position.AxialPositionable; import net.sf.openrocket.rocketcomponent.position.RadiusMethod; import net.sf.openrocket.startup.Application; +import net.sf.openrocket.util.BoundingBox; import net.sf.openrocket.util.Coordinate; import net.sf.openrocket.util.MathUtil; import net.sf.openrocket.util.Transformation; -public class TubeFinSet extends ExternalComponent implements RingInstanceable, AxialPositionable { +public class TubeFinSet extends ExternalComponent implements AxialPositionable, BoxBounded, RingInstanceable { private static final Translator trans = Application.getTranslator(); private final static double DEFAULT_RADIUS = 0.025; @@ -314,6 +315,14 @@ public class TubeFinSet extends ExternalComponent implements RingInstanceable, A return bounds; } + @Override + public BoundingBox getInstanceBoundingBox() { + BoundingBox box = new BoundingBox(); + box.update(new Coordinate(0, -outerRadius, -outerRadius)); + box.update(new Coordinate(length, outerRadius, outerRadius)); + return box; + } + /** * Return the radius of the BodyComponent the fin set is situated on. Currently * only supports SymmetricComponents and returns the radius at the starting point of the