OpenIndy-Core  0.2.0.43
featurecontainer.h
Go to the documentation of this file.
1 #ifndef FEATURECONTAINER_H
2 #define FEATURECONTAINER_H
3 
4 #include <QPointer>
5 #include <QString>
6 #include <QList>
7 #include <QStringList>
8 #include <QMap>
9 #include <QMultiMap>
10 
11 #include "featurewrapper.h"
12 #include "feature.h"
13 #include "coordinatesystem.h"
14 #include "station.h"
15 #include "trafoparam.h"
16 #include "types.h"
17 
18 namespace oi{
19 
27 
28 public:
30 
32 
33  //###############
34  //access features
35  //###############
36 
37  //getter to access feature lists
38  const QList<QPointer<FeatureWrapper> > &getFeaturesList() const;
39  const QList<QPointer<CoordinateSystem> > &getCoordinateSystemsList() const;
40  QList<QPointer<CoordinateSystem> > getStationSystemsList() const;
41  const QList<QPointer<Station> > &getStationsList() const;
42  const QList<QPointer<TrafoParam> > &getTransformationParametersList() const;
43  const QList<QPointer<FeatureWrapper> > &getGeometriesList() const;
44 
45  //getter to get a list of all feature ids, names, groups and measurement configs
46  const QList<int> &getFeatureIdList() const;
47  const QStringList &getFeatureNameList() const;
48  const QStringList &getFeatureGroupList() const;
49  const QList<QPair<QString, bool> > &getUsedMeasurementConfigs() const;
50 
51  //getter to access features by id, name, group, type or mConfig
52  QPointer<FeatureWrapper> getFeatureById(const int &featureId) const;
53  QList<QPointer<FeatureWrapper> > getFeaturesByName(const QString &name) const;
54  QList<QPointer<FeatureWrapper> > getFeaturesByGroup(const QString &group) const;
55  QList<QPointer<FeatureWrapper> > getFeaturesByType(const FeatureTypes &type) const;
56  QList<QPointer<Geometry> > getGeometriesByMConfig(const QPair<QString, bool> &mConfig) const;
57 
58  //######################
59  //get number of features
60  //######################
61 
62  int getFeatureCount() const;
63  int getGeometryCount() const;
64  int getFeatureCount(const FeatureTypes &type) const;
65  int getFeatureCount(const QString &group) const;
66  int getFeatureCount(const QPair<QString, bool> &mConfig) const;
67 
68  //######################
69  //add or remove features
70  //######################
71 
72  bool addFeature(const QPointer<FeatureWrapper> &feature);
73  bool removeFeature(const int &featureId);
74 
75  void checkAndClean(const int &featureId, const QString &name, const QString &group, const FeatureTypes &type);
76 
77  void removeAll();
78 
79  //##########################################################
80  //callbacks on feature changes to update keys of helper maps
81  //##########################################################
82 
83  bool featureNameChanged(const int &featureId, const QString &oldName);
84  bool featureGroupChanged(const int &featureId, const QString &oldGroup);
85  bool geometryMeasurementConfigChanged(const int &featureId, const QString &oldMConfig, bool oldIsSaved);
86 
87 private:
88 
89  //######################
90  //feature lists and maps
91  //######################
92 
93  //feature lists (useful to provide lists of features by category (geometries, stations etc.))
94  QList<QPointer<FeatureWrapper> > featuresList; //list of all features in OpenIndy
95  QList<QPointer<CoordinateSystem> > coordSystems; //list of all non-station coordinate systems
96  QList<QPointer<Station> > stationsList; //list of all stations (each station has pointer to its coordinate system)
97  QList<QPointer<TrafoParam> > trafoParamsList; //list of all trafo params
98  QList<QPointer<FeatureWrapper> > geometriesList; //list of all geometry features
99 
100  //feature maps (useful to quickly find a feature with a given id, name, group etc.)
101  QMap<int, QPointer<FeatureWrapper> > featuresIdMap; //map of all features in OpenIndy with their id as key
102  QMultiMap<QString, QPointer<FeatureWrapper> > featuresNameMap; //map of all features in OpenIndy with their name as key
103  QMultiMap<QString, QPointer<FeatureWrapper> > featuresGroupMap; //map of all features in OpenIndy with their group as key
104  QMultiMap<FeatureTypes, QPointer<FeatureWrapper> > featuresTypeMap; // map of all features in OpenIndy with their type as key
105  QMultiMap<QPair<QString, bool>, QPointer<Geometry> > geometriesMConfigMap; //map of all geometries in OpenIndy with their measurement config name and saved state as key
106 
107  //lists with ids, names, groups and measurement configs
108  QList<int> featureIds;
109  QStringList featureNames;
110  QStringList featureGroups;
111  QList<QPair<QString, bool> > usedMConfigs;
112 
113 };
114 
115 }
116 
117 #endif // FEATURECONTAINER_H
FeatureTypes
all OpenIndy feature types
Definition: types.h:95
Definition: coordinatesystem.h:15
The FeatureContainer class Works as a container for all features in an OiJob. The features are stored...
Definition: featurecontainer.h:26
#define OI_CORE_EXPORT
Definition: types.h:11