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