create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / file / rocksim / export / NoseConeDTO.java
1 package net.sf.openrocket.file.rocksim.export;
2
3 import net.sf.openrocket.file.rocksim.RocksimCommonConstants;
4 import net.sf.openrocket.rocketcomponent.NoseCone;
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 Rocksim XML Element for a nose cone.
13  */
14 @XmlRootElement(name = RocksimCommonConstants.NOSE_CONE)
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class NoseConeDTO extends AbstractTransitionDTO {
17
18
19     @XmlElement(name = RocksimCommonConstants.BASE_DIA)
20     private double baseDia = 0d;
21     @XmlElement(name = RocksimCommonConstants.SHOULDER_LEN)
22     private double shoulderLen = 0d;
23     @XmlElement(name = RocksimCommonConstants.SHOULDER_OD)
24     private double shoulderOD = 0d;
25
26     /**
27      * Default constructor.
28      */
29     public NoseConeDTO() {
30     }
31
32     /**
33      * Full copy constructor.  Fully populates this instance with values taken from the OR NoseCone instance.
34      *
35      * @param nc  the OR nose cone
36      */
37     public NoseConeDTO(NoseCone nc) {
38         super(nc);
39         setBaseDia(nc.getAftRadius() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
40         setShoulderLen(nc.getAftShoulderLength() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
41         setShoulderOD(nc.getAftShoulderRadius() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_RADIUS);
42     }
43
44     public double getBaseDia() {
45         return baseDia;
46     }
47
48     public void setBaseDia(double theBaseDia) {
49         baseDia = theBaseDia;
50     }
51
52     public double getShoulderLen() {
53         return shoulderLen;
54     }
55
56     public void setShoulderLen(double theShoulderLen) {
57         shoulderLen = theShoulderLen;
58     }
59
60     public double getShoulderOD() {
61         return shoulderOD;
62     }
63
64     public void setShoulderOD(double theShoulderOD) {
65         shoulderOD = theShoulderOD;
66     }
67 }