[#1509] Make InnerTube InsideColorComponent
This commit is contained in:
parent
54f8276c53
commit
2814827bcc
@ -26,7 +26,7 @@ import net.sf.openrocket.util.MathUtil;
|
|||||||
*
|
*
|
||||||
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
|
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
|
||||||
*/
|
*/
|
||||||
public class InnerTube extends ThicknessRingComponent implements AxialPositionable, BoxBounded, Clusterable, RadialParent, MotorMount {
|
public class InnerTube extends ThicknessRingComponent implements AxialPositionable, BoxBounded, Clusterable, RadialParent, MotorMount, InsideColorComponent {
|
||||||
private static final Translator trans = Application.getTranslator();
|
private static final Translator trans = Application.getTranslator();
|
||||||
private static final Logger log = LoggerFactory.getLogger(InnerTube.class);
|
private static final Logger log = LoggerFactory.getLogger(InnerTube.class);
|
||||||
|
|
||||||
@ -38,6 +38,8 @@ public class InnerTube extends ThicknessRingComponent implements AxialPositionab
|
|||||||
private boolean isActingMount;
|
private boolean isActingMount;
|
||||||
private MotorConfigurationSet motors;
|
private MotorConfigurationSet motors;
|
||||||
|
|
||||||
|
private InsideColorComponentHandler insideColorComponentHandler = new InsideColorComponentHandler(this);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main constructor.
|
* Main constructor.
|
||||||
*/
|
*/
|
||||||
@ -447,6 +449,16 @@ public class InnerTube extends ThicknessRingComponent implements AxialPositionab
|
|||||||
return this.motors.toDebug();
|
return this.motors.toDebug();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InsideColorComponentHandler getInsideColorComponentHandler() {
|
||||||
|
return this.insideColorComponentHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setInsideColorComponentHandler(InsideColorComponentHandler handler) {
|
||||||
|
this.insideColorComponentHandler = handler;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addConfigListener(RocketComponent listener) {
|
public boolean addConfigListener(RocketComponent listener) {
|
||||||
boolean success = super.addConfigListener(listener);
|
boolean success = super.addConfigListener(listener);
|
||||||
|
@ -7,6 +7,7 @@ import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
|
|||||||
import com.jogamp.opengl.glu.GLU;
|
import com.jogamp.opengl.glu.GLU;
|
||||||
import com.jogamp.opengl.glu.GLUquadric;
|
import com.jogamp.opengl.glu.GLUquadric;
|
||||||
|
|
||||||
|
import net.sf.openrocket.rocketcomponent.InnerTube;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -98,6 +99,8 @@ public class ComponentRenderer {
|
|||||||
|
|
||||||
if (c instanceof BodyTube) {
|
if (c instanceof BodyTube) {
|
||||||
renderTube(gl, (BodyTube) c, which);
|
renderTube(gl, (BodyTube) c, which);
|
||||||
|
} else if (c instanceof InnerTube) {
|
||||||
|
renderTube(gl, (InnerTube) c, which);
|
||||||
} else if (c instanceof LaunchLug) {
|
} else if (c instanceof LaunchLug) {
|
||||||
renderLug(gl, (LaunchLug) c, which);
|
renderLug(gl, (LaunchLug) c, which);
|
||||||
} else if ( c instanceof RailButton ){
|
} else if ( c instanceof RailButton ){
|
||||||
@ -257,6 +260,10 @@ public class ComponentRenderer {
|
|||||||
renderTube(gl, which, t.getOuterRadius(), t.getInnerRadius(), t.getLength());
|
renderTube(gl, which, t.getOuterRadius(), t.getInnerRadius(), t.getLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderTube(GL2 gl, InnerTube t, Surface which) {
|
||||||
|
renderTube(gl, which, t.getOuterRadius(), t.getInnerRadius(), t.getLength());
|
||||||
|
}
|
||||||
|
|
||||||
private void renderRing(GL2 gl, RingComponent r) {
|
private void renderRing(GL2 gl, RingComponent r) {
|
||||||
|
|
||||||
gl.glRotated(90, 0, 1.0, 0);
|
gl.glRotated(90, 0, 1.0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user