OpenIndy-Core  0.2.0.43
geometry.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_H
2 #define GEOMETRY_H
3 
4 #include <QObject>
5 #include <QPointer>
6 #include <QList>
7 #include <QtXml>
8 
9 #include "feature.h"
10 #include "measurementconfig.h"
11 #include "statistic.h"
12 #include "simulationmodel.h"
13 #include "radius.h"
14 #include "direction.h"
15 #include "position.h"
16 
17 namespace oi{
18 
19 class Observation;
20 class CoordinateSystem;
21 
27 {
28  friend class Geometry;
29  friend class OiJob;
30  Q_OBJECT
31 
32 public:
33  explicit Geometry(const bool &isNominal, QObject *parent = 0);
34 
35  Geometry(const Geometry &copy, QObject *parent = 0);
36 
37  Geometry &operator=(const Geometry &copy);
38 
39  virtual ~Geometry();
40 
41  //##############################
42  //get or set geometry attributes
43  //##############################
44 
45  const bool &getIsCommon() const;
46  void setCommonState(const bool &isCommon);
47 
48  const bool &getIsNominal() const;
49 
50  const QList<QPointer<Geometry> > &getNominals() const;
51  bool addNominal(const QPointer<Geometry> &nominal);
52  bool removeNominal(const QPointer<Geometry> &nominal);
53 
54  const QPointer<Geometry> &getActual() const;
55  bool setActual(const QPointer<Geometry> &actual);
56 
57  const QList<QPointer<Observation> > &getObservations() const;
58  void addObservation(const QPointer<Observation> &obs);
59  void removeObservation(const QPointer<Observation> &obs);
60 
61  const QPointer<CoordinateSystem> &getNominalSystem() const;
62  bool setNominalSystem(const QPointer<CoordinateSystem> &nomSys);
63 
64  const MeasurementConfig &getMeasurementConfig() const;
65  void setMeasurementConfig(const MeasurementConfig &myConfig);
66 
67  const Statistic &getStatistic() const;
68  void setStatistic(const Statistic &myStatistic);
69 
70  const SimulationData &getSimulationData();
71  void setSimulationData(const SimulationData &s);
72 
73  const QList<ReadingTypes> &getUsedReadingTypes() const;
74 
75  //###################################################################
76  //check wether this geometry has a direction, a position and a radius
77  //###################################################################
78 
79  virtual bool hasDirection() const;
80  virtual bool hasPosition() const;
81  virtual bool hasRadius() const;
82 
83  //#############################################################
84  //getter to access radius, direction and position of a geometry
85  //#############################################################
86 
87  virtual const Radius &getRadius() const;
88  virtual const Direction &getDirection() const;
89  virtual const Position &getPosition() const;
90 
91  //#############################
92  //get or set unknown parameters
93  //#############################
94 
95  virtual QMap<GeometryParameters, QString> getUnknownParameters(const QMap<DimensionType, UnitType> &displayUnits,
96  const QMap<DimensionType, int> &displayDigits) const;
97  virtual void setUnknownParameters(const QMap<GeometryParameters, double> &parameters);
98 
99  //###########################
100  //reexecute the function list
101  //###########################
102 
103  virtual void recalc();
104 
105  //#################
106  //save and load XML
107  //#################
108 
109  virtual QDomElement toOpenIndyXML(QDomDocument &xmlDoc) const;
110  virtual bool fromOpenIndyXML(QDomElement &xmlElem);
111 
112  //###############
113  //display methods
114  //###############
115 
116  QString getDisplayStDev(const UnitType &type, const int &digits) const;
117 
118  QString getDisplayMeasurementConfig() const;
119  QString getDisplayObservations() const;
120 
121 signals:
122 
123  //########################################
124  //signals to inform about geometry changes
125  //########################################
126 
127  void geomIsCommonChanged(const int &featureId);
128  void geomNominalsChanged(const int &featureId);
129  void geomActualChanged(const int &featureId);
130  void geomObservationsChanged(const int &featureId);
131  void geomNominalSystemChanged(const int &featureId);
132  void geomStatisticChanged(const int &featureId);
133  void geomSimulationDataChanged(const int &featureId);
134  void geomMeasurementConfigChanged(const int &featureId, const QString &oldMConfig, bool oldIsSaved);
135  void geomParametersChanged(const int &featureId);
136 
137 protected:
138 
139  //###################
140  //geometry attributes
141  //###################
142 
143  bool isCommon;
144 
145  bool isNominal;
146  QList< QPointer<Geometry> > nominals;
147 
148  QPointer<Geometry> actual;
149  QPointer<CoordinateSystem> nominalSystem;
150 
151  QList<QPointer<Observation> > observations;
152 
155 
156  QList<ReadingTypes> usedReadingTypes;
157 
158  //current measurement config that is used to create readings until the user selects another one
159  MeasurementConfig activeMeasurementConfig; //only for this geometry instance
160 
161 private:
162 
163  //############################################################################
164  //helper variables used for geometries without a radius, direction or position
165  //############################################################################
166 
167  Position dummyPosition;
168  Direction dummyDirection;
169  Radius dummyRadius;
170 
171 };
172 
173 }
174 
175 #endif // GEOMETRY_H
The Feature class.
Definition: feature.h:20
QList< ReadingTypes > usedReadingTypes
Definition: geometry.h:156
The Position class.
Definition: position.h:16
SimulationData simulationData
Definition: geometry.h:154
MeasurementConfig activeMeasurementConfig
Definition: geometry.h:159
Definition: coordinatesystem.h:15
The MeasurementConfig class Contains all the configuration parameters needed to start a measurement...
Definition: measurementconfig.h:15
QList< QPointer< Observation > > observations
Definition: geometry.h:151
bool isCommon
Definition: geometry.h:143
The Radius class.
Definition: radius.h:13
The Geometry class.
Definition: geometry.h:26
The Statistic class.
Definition: statistic.h:29
bool isNominal
Definition: geometry.h:145
Statistic statistic
Definition: geometry.h:153
The SimulationData class Save simulation results for a geometry.
Definition: simulationmodel.h:84
UnitType
Definition: types.h:354
Definition: direction.h:13
QPointer< Geometry > actual
Definition: geometry.h:148
#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
QPointer< CoordinateSystem > nominalSystem
Definition: geometry.h:149
QList< QPointer< Geometry > > nominals
Definition: geometry.h:146