1 package net.sf.openrocket.file.rocksim.export;
3 import net.sf.openrocket.file.rocksim.RocksimCommonConstants;
4 import net.sf.openrocket.rocketcomponent.Transition;
6 import javax.xml.bind.annotation.XmlAccessType;
7 import javax.xml.bind.annotation.XmlAccessorType;
8 import javax.xml.bind.annotation.XmlElement;
9 import javax.xml.bind.annotation.XmlRootElement;
12 * This class models a transition XML element in Rocksim file format.
14 @XmlRootElement(name = RocksimCommonConstants.TRANSITION)
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class TransitionDTO extends AbstractTransitionDTO {
19 @XmlElement(name = RocksimCommonConstants.FRONT_SHOULDER_LEN)
20 private double frontShoulderLen = 0d;
21 @XmlElement(name = RocksimCommonConstants.REAR_SHOULDER_LEN)
22 private double rearShoulderLen = 0d;
23 @XmlElement(name = RocksimCommonConstants.FRONT_SHOULDER_DIA)
24 private double frontShoulderDia = 0d;
25 @XmlElement(name = RocksimCommonConstants.REAR_SHOULDER_DIA)
26 private double rearShoulderDia = 0d;
27 @XmlElement(name = RocksimCommonConstants.FRONT_DIA)
28 private double frontDia = 0d;
29 @XmlElement(name = RocksimCommonConstants.REAR_DIA)
30 private double rearDia = 0d;
33 * Default constructor.
35 public TransitionDTO() {
39 * Copy constructor. This TransitionDTO instance will be as equivalent as possible to the OR <code>tran</code>
40 * once the constructor returns. No further modification (invoking setters) is necessary.
42 * @param theORTransition the OR transition
44 public TransitionDTO(Transition theORTransition) {
45 super(theORTransition);
46 setFrontDia(theORTransition.getForeRadius() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
47 setRearDia(theORTransition.getAftRadius() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
48 setFrontShoulderDia(theORTransition.getForeShoulderRadius() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
49 setFrontShoulderLen(theORTransition.getForeShoulderLength() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
50 setRearShoulderDia(theORTransition.getAftShoulderRadius() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
51 setRearShoulderLen(theORTransition.getAftShoulderLength() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
55 public double getFrontShoulderLen() {
56 return frontShoulderLen;
59 public void setFrontShoulderLen(double theFrontShoulderLen) {
60 frontShoulderLen = theFrontShoulderLen;
63 public double getRearShoulderLen() {
64 return rearShoulderLen;
67 public void setRearShoulderLen(double theRearShoulderLen) {
68 rearShoulderLen = theRearShoulderLen;
71 public double getFrontShoulderDia() {
72 return frontShoulderDia;
75 public void setFrontShoulderDia(double theFrontShoulderDia) {
76 frontShoulderDia = theFrontShoulderDia;
79 public double getRearShoulderDia() {
80 return rearShoulderDia;
83 public void setRearShoulderDia(double theRearShoulderDia) {
84 rearShoulderDia = theRearShoulderDia;
87 public double getFrontDia() {
91 public void setFrontDia(double theFrontDia) {
92 frontDia = theFrontDia;
95 public double getRearDia() {
99 public void setRearDia(double theRearDia) {
100 rearDia = theRearDia;