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