1 package net.sf.openrocket.file.rocksim.export;
3 import net.sf.openrocket.file.rocksim.importt.RocksimHandler;
4 import net.sf.openrocket.file.rocksim.importt.RocksimNoseConeCode;
5 import net.sf.openrocket.rocketcomponent.Transition;
7 import javax.xml.bind.annotation.XmlAccessType;
8 import javax.xml.bind.annotation.XmlAccessorType;
9 import javax.xml.bind.annotation.XmlElement;
13 @XmlAccessorType(XmlAccessType.FIELD)
14 public class AbstractTransitionDTO extends BasePartDTO {
15 @XmlElement(name = "ShapeCode")
16 private int shapeCode = 1;
17 @XmlElement(name = "ConstructionType")
18 private int constructionType = 1;
19 @XmlElement(name = "WallThickness")
20 private double wallThickness = 0d;
21 @XmlElement(name = "ShapeParameter")
22 private double shapeParameter = 0d;
24 protected AbstractTransitionDTO() {
28 protected AbstractTransitionDTO(Transition nc) {
30 setConstructionType(nc.isFilled() ? 0 : 1);
31 setShapeCode(RocksimNoseConeCode.toCode(nc.getType()));
33 if (Transition.Shape.POWER.equals(nc.getType()) ||
34 Transition.Shape.HAACK.equals(nc.getType()) ||
35 Transition.Shape.PARABOLIC.equals(nc.getType())) {
36 setShapeParameter(nc.getShapeParameter());
39 setWallThickness(nc.getThickness() * RocksimHandler.ROCKSIM_TO_OPENROCKET_LENGTH);
43 public int getShapeCode() {
47 public void setShapeCode(int theShapeCode) {
48 shapeCode = theShapeCode;
51 public int getConstructionType() {
52 return constructionType;
55 public void setConstructionType(int theConstructionType) {
56 constructionType = theConstructionType;
59 public double getWallThickness() {
63 public void setWallThickness(double theWallThickness) {
64 wallThickness = theWallThickness;
67 public double getShapeParameter() {
68 return shapeParameter;
71 public void setShapeParameter(double theShapeParameter) {
72 shapeParameter = theShapeParameter;