OpenIndy-Core  0.2.0.43
sphere.h
Go to the documentation of this file.
1 #ifndef SPHERE_H
2 #define SPHERE_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  Sphere(const bool &isNominal, QObject *parent = 0);
23  Sphere(const bool &isNominal, const Position &center, const Radius &radius, QObject *parent = 0);
24 
25  Sphere(const Sphere &copy, QObject *parent = 0);
26 
27  Sphere &operator=(const Sphere &copy);
28 
29  ~Sphere();
30 
31  //########################################
32  //order of unknown parameters (Qxx-matrix)
33  //########################################
34 
36  unknownCenterX = 0,
39  unknownRadius
40  };
41 
42  //###################################################################
43  //check wether this geometry has a direction, a position and a radius
44  //###################################################################
45 
46  bool hasPosition() const;
47  bool hasRadius() const;
48 
49  //############################
50  //get or set sphere parameters
51  //############################
52 
53  const Radius &getRadius() const;
54  const Position &getPosition() const;
55 
56  void setSphere(const Position &center, const Radius &radius);
57 
58  //#############################
59  //get or set unknown parameters
60  //#############################
61 
62  virtual QMap<GeometryParameters, QString> getUnknownParameters(const QMap<DimensionType, UnitType> &displayUnits,
63  const QMap<DimensionType, int> &displayDigits) const;
64  virtual void setUnknownParameters(const QMap<GeometryParameters, double> &parameters);
65 
66  //###########################
67  //reexecute the function list
68  //###########################
69 
70  void recalc();
71 
72  //#################
73  //save and load XML
74  //#################
75 
76  QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
77  bool fromOpenIndyXML(QDomElement &xmlElem);
78 
79  //###############
80  //display methods
81  //###############
82 
83  QString getDisplayX(const UnitType &type, const int &digits, const bool &showDiff = false) const;
84  QString getDisplayY(const UnitType &type, const int &digits, const bool &showDiff = false) const;
85  QString getDisplayZ(const UnitType &type, const int &digits, const bool &showDiff = false) const;
86  QString getDisplayRadiusA(const UnitType &type, const int &digits, const bool &showDiff = false) const;
87 
88 private:
89 
90  //#################
91  //sphere attributes
92  //#################
93 
94  Position center; //center
95  Radius radius; //radius
96 
97 };
98 
99 }
100 
101 #endif // SPHERE_H
The Position class.
Definition: position.h:16
Definition: coordinatesystem.h:15
Definition: sphere.h:38
The Radius class.
Definition: radius.h:13
The Geometry class.
Definition: geometry.h:26
The Sphere class.
Definition: sphere.h:17
SphereUnknowns
Definition: sphere.h:35
Definition: sphere.h:37
UnitType
Definition: types.h:354
#define OI_CORE_EXPORT
Definition: types.h:11