OpenIndy-Core  0.2.0.43
observation.h
Go to the documentation of this file.
1 #ifndef OBSERVATION_H
2 #define OBSERVATION_H
3 
4 #include <QObject>
5 #include <QList>
6 #include <math.h>
7 #include <QPointer>
8 
9 #include "element.h"
10 #include "geometry.h"
11 #include "oivec.h"
12 #include "statistic.h"
13 
14 class TrafoController;
15 
16 namespace oi{
17 
18 using namespace math;
19 
20 class Reading;
21 class Station;
22 class CoordinateSystem;
23 
28 {
29  friend class Reading;
30  friend class CoordinateSystem;
31  friend class TrafoController;
32  Q_OBJECT
33 
34 public:
35  explicit Observation(QObject *parent = 0);
36 
37  Observation(const Observation &copy, QObject *parent = 0);
38  Observation(const OiVec &xyz, bool isValid, QObject *parent = 0);
39 
40  Observation &operator=(const Observation &copy);
41 
42  ~Observation();
43 
44  //##################################
45  //get or set observations attributes
46  //##################################
47 
48  const OiVec &getXYZ() const;
49  void setXYZ(const OiVec &xyz);
50 
51  const OiVec &getOriginalXYZ() const;
52 
53  const OiVec &getSigmaXYZ() const;
54  void setSigmaXyz(const OiVec &sigmaXyz);
55 
56  const OiVec &getOriginalSigmaXyz() const;
57 
58  //##################################################
59  //get and set station, reading and target geometries
60  //##################################################
61 
62  const QPointer<Station> &getStation() const;
63  void setStation(const QPointer<Station> &station);
64 
65  const QList<QPointer<Geometry> > &getTargetGeometries() const;
66  void addTargetGeometry(const QPointer<Geometry> &targetGeometry);
67  void removeTargetGeometry(const QPointer<Geometry> &targetGeometry);
68  void removeTargetGeometry(const int &geomId);
69 
70  const QPointer<Reading> &getReading() const;
71 
72  //##########################
73  //get and set state booleans
74  //##########################
75 
76  const bool &getIsValid() const;
77 
78  void setIsSolved(const bool &isSolved);
79  const bool &getIsSolved() const;
80 
81  //###############
82  //display methods
83  //###############
84 
85  QString getDisplayId() const;
86  QString getDisplayStation() const;
87  QString getDisplayTargetGeometries() const;
88  QString getDisplayX(const UnitType &type, const int &digits) const;
89  QString getDisplayY(const UnitType &type, const int &digits) const;
90  QString getDisplayZ(const UnitType &type, const int &digits) const;
91  QString getDisplaySigmaX(const UnitType &type, const int &digits) const;
92  QString getDisplaySigmaY(const UnitType &type, const int &digits) const;
93  QString getDisplaySigmaZ(const UnitType &type, const int &digits) const;
94  QString getDisplayIsValid() const;
95  QString getDisplayIsSolved() const;
96 
97  //#################
98  //save and load XML
99  //#################
100 
101  QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
102  bool fromOpenIndyXML(QDomElement &xmlElem);
103 
104 private:
105 
106  //####################################################
107  //references to station, reading and target geometries
108  //####################################################
109 
110  QPointer<Station> station;
111 
112  QList< QPointer<Geometry> > targetGeometriesList;
113  QMap<int, QPointer<Geometry> > targetGeometriesMap;
114 
115  QPointer<Reading> reading;
116 
117  //###################################################
118  //booleans that indicate the state of the observation
119  //###################################################
120 
121  bool isValid; //defines if the reading can be transformed, without any function, to a xyz observation
122  bool isSolved; //defines wether this observation is valid in current coordinate system
123 
124  //#############################
125  //xyz coordinates and statistic
126  //#############################
127 
128  OiVec xyz; //the homogeneous coordinate vector in the current display coordinate system
129  OiVec originalXyz; //the homogeneous coordinate vector in the station system that produced this observation
130 
131  OiVec sigmaXyz; //the homogeneous stdev vector in the current display coordinate system
132  OiVec originalSigmaXyz; //the homogeneous stdev vector in the station system that produced this observation
133 
134 };
135 
136 }
137 
138 Q_DECLARE_METATYPE( oi::Observation* )
139 
140 #endif // OBSERVATION_H
The Element class.
Definition: element.h:17
The Observation class.
Definition: observation.h:27
The OiVec class.
Definition: oivec.h:22
Definition: coordinatesystem.h:15
The CoordinateSystem class.
Definition: coordinatesystem.h:25
UnitType
Definition: types.h:354
The Reading class.
Definition: reading.h:132
#define OI_CORE_EXPORT
Definition: types.h:11