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