OpenIndy-Core  0.2.0.43
ellipse.h
Go to the documentation of this file.
1 #ifndef ELLIPSE_H
2 #define ELLIPSE_H
3 
4 #include <QObject>
5 #include <QtXml>
6 
7 #include "geometry.h"
8 #include "position.h"
9 #include "radius.h"
10 #include "direction.h"
11 
12 namespace oi{
13 
18 {
19  Q_OBJECT
20 
21 public:
22  Ellipse(const bool &isNominal, QObject *parent = 0);
23  Ellipse(const bool &isNominal, const Position &center, const Direction &normal, const double &a, const double &b, const Direction &semiMajorAxis, QObject *parent = 0);
24 
25  Ellipse(const Ellipse &copy, QObject *parent = 0);
26 
27  Ellipse &operator=(const Ellipse &copy);
28 
29  ~Ellipse();
30 
31  //########################################
32  //order of unknown parameters (Qxx-matrix)
33  //########################################
34 
36  unknownCenterX = 0,
46  unknownSemiMajorAxisK
47  };
48 
49  //###################################################################
50  //check wether this geometry has a direction, a position and a radius
51  //###################################################################
52 
53  bool hasDirection() const;
54  bool hasPosition() const;
55 
56  //#############################
57  //get or set ellipse parameters
58  //#############################
59 
60  const Direction &getDirection() const;
61  const Position &getPosition() const;
62 
63  const double &getA() const;
64  const double &getB() const;
65  const Direction &getSemiMajorAxisDirection() const;
66 
67  void setEllipse(const Position &center, const Direction &normal, const double &a, const double &b, const Direction &semiMajorAxis);
68 
69  //#############################
70  //get or set unknown parameters
71  //#############################
72 
73  virtual QMap<GeometryParameters, QString> getUnknownParameters(const QMap<DimensionType, UnitType> &displayUnits,
74  const QMap<DimensionType, int> &displayDigits) const;
75  virtual void setUnknownParameters(const QMap<GeometryParameters, double> &parameters);
76 
77  //###########################
78  //reexecute the function list
79  //###########################
80 
81  void recalc();
82 
83  //#################
84  //save and load XML
85  //#################
86 
87  QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
88  bool fromOpenIndyXML(QDomElement &xmlElem);
89 
90  //###############
91  //display methods
92  //###############
93 
94  QString getDisplayX(const UnitType &type, const int &digits, const bool &showDiff = false) const;
95  QString getDisplayY(const UnitType &type, const int &digits, const bool &showDiff = false) const;
96  QString getDisplayZ(const UnitType &type, const int &digits, const bool &showDiff = false) const;
97  QString getDisplayPrimaryI(const int &digits, const bool &showDiff = false) const;
98  QString getDisplayPrimaryJ(const int &digits, const bool &showDiff = false) const;
99  QString getDisplayPrimaryK(const int &digits, const bool &showDiff = false) const;
100  QString getDisplaySecondaryI(const int &digits, const bool &showDiff = false) const;
101  QString getDisplaySecondaryJ(const int &digits, const bool &showDiff = false) const;
102  QString getDisplaySecondaryK(const int &digits, const bool &showDiff = false) const;
103  QString getDisplayA(const UnitType &type, const int &digits, const bool &showDiff = false) const;
104  QString getDisplayB(const UnitType &type, const int &digits, const bool &showDiff = false) const;
105 
106 private:
107 
108  //##################
109  //ellipse attributes
110  //##################
111 
112  Position center; //center
113  Direction normal; //normal vector
114  double a; //semi-major axis length
115  double b; //semi-minor axis length
116  Direction semiMajorAxis; //semi-major axis direction
117 
118 };
119 
120 }
121 
122 #endif // ELLIPSE_H
The Position class.
Definition: position.h:16
Definition: ellipse.h:37
EllipseUnknowns
Definition: ellipse.h:35
Definition: ellipse.h:41
Definition: coordinatesystem.h:15
Definition: ellipse.h:39
Definition: ellipse.h:38
Definition: ellipse.h:40
The Geometry class.
Definition: geometry.h:26
Definition: ellipse.h:43
The Ellipse class.
Definition: ellipse.h:17
Definition: ellipse.h:45
Definition: ellipse.h:42
UnitType
Definition: types.h:354
Definition: direction.h:13
Definition: ellipse.h:44
#define OI_CORE_EXPORT
Definition: types.h:11