create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / file / rocksim / export / StreamerDTO.java
1 package net.sf.openrocket.file.rocksim.export;
2
3 import net.sf.openrocket.file.rocksim.RocksimCommonConstants;
4 import net.sf.openrocket.rocketcomponent.Streamer;
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 streamer.
13  */
14 @XmlRootElement(name = RocksimCommonConstants.STREAMER)
15 @XmlAccessorType(XmlAccessType.FIELD)
16 public class StreamerDTO extends BasePartDTO {
17
18     @XmlElement(name = RocksimCommonConstants.WIDTH)
19         private double width = 0d;
20         @XmlElement(name = RocksimCommonConstants.DRAG_COEFFICIENT)
21         private double dragCoefficient = 0.75d;
22
23     /**
24      * The default constructor.
25      */
26     public StreamerDTO() {
27     }
28
29     /**
30      * Copy constructor.  This constructor fully populates this instance with values taken from the OR component.
31      *
32      * @param theORStreamer  the OR streamer component
33      */
34     public StreamerDTO(Streamer theORStreamer) {
35         super(theORStreamer);
36         setWidth(theORStreamer.getStripWidth() * RocksimCommonConstants.ROCKSIM_TO_OPENROCKET_LENGTH);
37         setDragCoefficient(theORStreamer.getCD());
38     }
39
40     public double getWidth() {
41         return width;
42     }
43
44     public void setWidth(double theWidth) {
45         width = theWidth;
46     }
47
48     public double getDragCoefficient() {
49         return dragCoefficient;
50     }
51
52     public void setDragCoefficient(double theDragCoefficient) {
53         dragCoefficient = theDragCoefficient;
54     }
55 }