create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / file / rocksim / export / TransitionDTO.java
1 package net.sf.openrocket.file.rocksim.export;
2
3 import net.sf.openrocket.file.rocksim.RocksimCommonConstants;
4 import net.sf.openrocket.rocketcomponent.Transition;
5
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;
10
11 /**
12  * This class models a transition XML element in Rocksim file format.
13  */
14 @XmlRootElement(name = RocksimCommonConstants.TRANSITION)
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class TransitionDTO extends AbstractTransitionDTO {
17
18
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;
31
32     /**
33      * Default constructor.
34      */
35     public TransitionDTO() {
36     }
37
38     /**
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.
41      *
42      * @param theORTransition  the OR transition
43      */
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);
52
53
54     }
55     public double getFrontShoulderLen() {
56         return frontShoulderLen;
57     }
58
59     public void setFrontShoulderLen(double theFrontShoulderLen) {
60         frontShoulderLen = theFrontShoulderLen;
61     }
62
63     public double getRearShoulderLen() {
64         return rearShoulderLen;
65     }
66
67     public void setRearShoulderLen(double theRearShoulderLen) {
68         rearShoulderLen = theRearShoulderLen;
69     }
70
71     public double getFrontShoulderDia() {
72         return frontShoulderDia;
73     }
74
75     public void setFrontShoulderDia(double theFrontShoulderDia) {
76         frontShoulderDia = theFrontShoulderDia;
77     }
78
79     public double getRearShoulderDia() {
80         return rearShoulderDia;
81     }
82
83     public void setRearShoulderDia(double theRearShoulderDia) {
84         rearShoulderDia = theRearShoulderDia;
85     }
86
87     public double getFrontDia() {
88         return frontDia;
89     }
90
91     public void setFrontDia(double theFrontDia) {
92         frontDia = theFrontDia;
93     }
94
95     public double getRearDia() {
96         return rearDia;
97     }
98
99     public void setRearDia(double theRearDia) {
100         rearDia = theRearDia;
101     }
102 }