OpenIndy-Core  0.2.0.43
trafoparam.h
Go to the documentation of this file.
1 #ifndef TRAFOPARAM_H
2 #define TRAFOPARAM_H
3 
4 #include <QObject>
5 #include <QPointer>
6 #include <QtCore/qmath.h>
7 #include <QDateTime>
8 
9 #include "feature.h"
10 #include "statistic.h"
11 #include "oivec.h"
12 #include "oimat.h"
13 
14 namespace oi{
15 
16 using namespace math;
17 
18 class CoordinateSystem;
19 
24 {
25  friend class OiJob;
26  Q_OBJECT
27 
28 public:
29  explicit TrafoParam(QObject *parent = 0);
30 
31  TrafoParam(const TrafoParam &copy, QObject *parent = 0);
32 
33  TrafoParam &operator=(const TrafoParam &copy);
34 
35  ~TrafoParam();
36 
37  //#################################
38  //get or set trafo param attributes
39  //#################################
40 
41  const bool &getIsUsed() const;
42  void setIsUsed(const bool &isUsed);
43 
44  const QPointer<CoordinateSystem> &getStartSystem() const;
45  const QPointer<CoordinateSystem> &getDestinationSystem() const;
46  bool setCoordinateSystems(const QPointer<CoordinateSystem> &from,
47  const QPointer<CoordinateSystem> &to);
48 
49  const bool &getIsMovement() const;
50  void setIsMovement(const bool &isMovement);
51 
52  const QDateTime &getValidTime() const;
53  void setValidTime(const QDateTime &validTime);
54 
55  const Statistic &getStatistic() const;
56  void setStatistic(const Statistic &statistic);
57 
58  const bool &getIsDatumTrafo();
59  void setIsDatumTrafo(const bool &isDatumTrafo);
60 
61  //####################################
62  //get or set transformation parameters
63  //####################################
64 
65  const OiMat &getHomogenMatrix() const;
66  const OiVec &getTranslation() const;
67  const OiVec &getRotation() const;
68  const OiVec &getScale() const;
69 
70  bool setTransformationParameters(const OiVec &rotation, const OiVec &translation, const OiVec &scale);
71  bool setTransformationParameters(const OiMat &rotation, const OiMat &translation, const OiMat &scale);
72  bool setTransformationParameters(const OiMat &homogenMatrix);
73  //bool setQuaternion(OiVec quaternion);
74 
75  //#############################
76  //get or set unknown parameters
77  //#############################
78 
79  virtual QMap<TrafoParamParameters, QString> getUnknownParameters(const QMap<DimensionType, UnitType> &displayUnits,
80  const QMap<DimensionType, int> &displayDigits) const;
81  virtual void setUnknownParameters(const QMap<TrafoParamParameters, double> &parameters);
82 
83  //###########################
84  //reexecute the function list
85  //###########################
86 
87  void recalc();
88 
89  //#################
90  //save and load XML
91  //#################
92 
93  QDomElement toOpenIndyXML(QDomDocument &xmlDoc);
94  bool fromOpenIndyXML(QDomElement &xmlElem);
95 
96  //###############
97  //display methods
98  //###############
99 
100  QString getDisplayStDev(const UnitType &type, const int &digits) const;
101 
102  QString getDisplayStartSystem() const;
103  QString getDisplayDestinationSystem() const;
104  QString getDisplayTranslationX(const UnitType &type, const int &digits) const;
105  QString getDisplayTranslationY(const UnitType &type, const int &digits) const;
106  QString getDisplayTranslationZ(const UnitType &type, const int &digits) const;
107  QString getDisplayRotationX(const UnitType &type, const int &digits) const;
108  QString getDisplayRotationY(const UnitType &type, const int &digits) const;
109  QString getDisplayRotationZ(const UnitType &type, const int &digits) const;
110  QString getDisplayScaleX(const int &digits) const;
111  QString getDisplayScaleY(const int &digits) const;
112  QString getDisplayScaleZ(const int &digits) const;
113  QString getDisplayIsUsed() const;
114  QString getDisplayValidTime() const;
115  QString getDisplayIsMovement() const;
116  QString getDisplayIsDatumTransformation() const;
117 
118 signals:
119 
120  //###########################################
121  //signals to inform about trafo param changes
122  //###########################################
123 
124  void transformationParameterChanged(const int &tpId);
125  void coordinateSystemsChanged(const int &tpId);
126  void isUsedChanged(const int &tpId);
127  void validTimeChanged(const int &tpId);
128  void isMovementChanged(const int &tpId);
129 
130 private:
131 
132  //##############################
133  //general trafo param attributes
134  //##############################
135 
136  QPointer<CoordinateSystem> from;
137  QPointer<CoordinateSystem> to;
138 
139  Statistic statistic;
140 
141  bool isDatumTrafo;
142  bool isUsed; //true if this trafo param object is used for transformation (false if not)
143 
144  bool isMovement;
145  QDateTime validTime; //used for movements to decide which observations shall be "moved"
146 
147  //#########################
148  //transformation parameters
149  //#########################
150 
151  OiVec translation;
152  OiVec rotation;
153  OiVec scale;
154 
155  OiMat homogenMatrix;
156 
157 };
158 
159 }
160 
161 #endif // TRAFOPARAM_H
The Feature class.
Definition: feature.h:20
The TrafoParam class.
Definition: trafoparam.h:23
The OiVec class.
Definition: oivec.h:22
Definition: coordinatesystem.h:15
The OiMat class.
Definition: oimat.h:58
The Statistic class.
Definition: statistic.h:29
UnitType
Definition: types.h:354
#define OI_CORE_EXPORT
Definition: types.h:11
The OiJob class Represents an OpenIndy job (holds all features and active states) ...
Definition: oijob.h:30