OpenIndy-Core  0.2.0.43
line.h
Go to the documentation of this file.
1 #ifndef LINE_H
2 #define LINE_H
3 
4 #include <QObject>
5 #include <QtXml>
6 
7 #include "geometry.h"
8 #include "position.h"
9 #include "direction.h"
10 
11 namespace oi{
12 
17 {
18  Q_OBJECT
19 public:
20  Line(const bool &isNominal, QObject *parent = 0);
21  Line(const bool &isNominal, const Position &xyz, const Direction &axis, QObject *parent = 0);
22 
23  Line(const Line &copy, QObject *parent = 0);
24 
25  Line &operator=(const Line &copy);
26 
27  ~Line();
28 
29  //########################################
30  //order of unknown parameters (Qxx-matrix)
31  //########################################
32 
39  unknownAxisK
40  };
41 
42  //###################################################################
43  //check wether this geometry has a direction, a position and a radius
44  //###################################################################
45 
46  bool hasDirection() const;
47  bool hasPosition() const;
48 
49  //##########################
50  //get or set line parameters
51  //##########################
52 
53  const Direction &getDirection() const;
54  const Position &getPosition() const;
55 
56  void setLine(const Position &xyz, const Direction &axis);
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 getDisplayPrimaryI(const int &digits, const bool &showDiff = false) const;
87  QString getDisplayPrimaryJ(const int &digits, const bool &showDiff = false) const;
88  QString getDisplayPrimaryK(const int &digits, const bool &showDiff = false) const;
89 
90 private:
91 
92  //###############
93  //line attributes
94  //###############
95 
96  Position xyz; //an arbitrary point on the line
97  Direction axis; //direction vector
98 
99 };
100 
101 }
102 
103 #endif // LINE_H
Definition: line.h:35
The Line class.
Definition: line.h:16
The Position class.
Definition: position.h:16
Definition: line.h:36
Definition: coordinatesystem.h:15
Definition: line.h:38
Definition: line.h:34
The Geometry class.
Definition: geometry.h:26
LineUnknowns
Definition: line.h:33
Definition: line.h:37
UnitType
Definition: types.h:354
Definition: direction.h:13
#define OI_CORE_EXPORT
Definition: types.h:11