OGS
GEOModels.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <QObject>
18 
19 #include "GeoLib/GEOObjects.h"
20 #include "GeoLib/GeoType.h"
21 
22 class GeoTreeModel;
23 class Model;
24 class PntsModel;
25 class StationTreeModel;
26 class PolylinesModel;
27 class SurfaceModel;
28 class TreeModel;
29 
36 class GEOModels : public QObject
37 {
38  Q_OBJECT
39 
40 public:
41  explicit GEOModels(GeoLib::GEOObjects& geo_objects,
42  QObject* parent = nullptr);
43  ~GEOModels() override;
44 
47 
48 public slots:
54  void updateGeometry(const std::string &geo_name);
55 
58  virtual void removeGeometry(std::string const& geo_name,
59  GeoLib::GEOTYPE const type);
60 
61  void addPointVec(std::string const& name);
62 
63  void removePointVec(std::string const& name);
64 
65  void addStationVec(std::string const& name);
66 
67  void removeStationVec(std::string const& name);
68 
69  void addPolylineVec(std::string const& name);
70 
71  void appendPolylineVec(std::string const& name);
72 
73  void removePolylineVec(std::string const& name);
74 
75  void addSurfaceVec(std::string const& name);
76 
77  void appendSurfaceVec(std::string const& name);
78  void removeSurfaceVec(std::string const& name);
79 
80  void renameGeometry(std::string const& old_name,
81  std::string const& new_name);
82 
84  void addNameForElement(std::string const& geometry_name,
85  GeoLib::GEOTYPE const object_type,
86  std::size_t const id,
87  std::string const& new_name);
88 
90  void addNameForObjectPoints(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, const std::string &geo_object_name, const std::string &new_name);
91 
94  void connectPolylineSegments(const std::string& geoName,
95  std::vector<std::size_t> const& indexlist,
96  double const proximity,
97  std::string const& ply_name,
98  bool const closePly,
99  bool const triangulatePly);
100 
101 protected:
104 
105 private:
107 
108 signals:
111 
112  void stationVectorAdded(StationTreeModel* model, std::string name);
113  void stationVectorRemoved(StationTreeModel* model, std::string name);
114 };
115 
117 {
118 public:
119  explicit GEOModelsCallbacks(GEOModels& geo_models) : _geo_models(geo_models)
120  {
121  }
122 
123  void addPointVec(std::string const& name) override
124  {
126  }
127 
128  void removePointVec(std::string const& name) override
129  {
131  }
132 
133  void addStationVec(std::string const& name) override
134  {
136  };
137 
138  void removeStationVec(std::string const& name) override
139  {
141  };
142 
143  void addPolylineVec(std::string const& name) override
144  {
146  };
147 
148  void appendPolylineVec(std::string const& name) override
149  {
151  };
152 
153  void removePolylineVec(std::string const& name) override
154  {
156  };
157 
158  void addSurfaceVec(std::string const& name) override
159  {
161  };
162 
163  void appendSurfaceVec(std::string const& name) override
164  {
166  };
167 
168  void removeSurfaceVec(std::string const& name) override
169  {
171  };
172 
173  void renameGeometry(std::string const& old_name,
174  std::string const& new_name) override
175  {
176  _geo_models.renameGeometry(old_name, new_name);
177  }
178 
179 private:
181 };
Definition of the GEOObjects class.
Definition of the GEOTYPE enumeration.
void appendSurfaceVec(std::string const &name) override
Definition: GEOModels.h:163
void removeSurfaceVec(std::string const &name) override
Definition: GEOModels.h:168
void appendPolylineVec(std::string const &name) override
Definition: GEOModels.h:148
void addSurfaceVec(std::string const &name) override
Definition: GEOModels.h:158
void removePolylineVec(std::string const &name) override
Definition: GEOModels.h:153
void addStationVec(std::string const &name) override
Definition: GEOModels.h:133
void removeStationVec(std::string const &name) override
Definition: GEOModels.h:138
void addPolylineVec(std::string const &name) override
Definition: GEOModels.h:143
void removePointVec(std::string const &name) override
Definition: GEOModels.h:128
GEOModelsCallbacks(GEOModels &geo_models)
Definition: GEOModels.h:119
void renameGeometry(std::string const &old_name, std::string const &new_name) override
Definition: GEOModels.h:173
GEOModels & _geo_models
Definition: GEOModels.h:180
void addPointVec(std::string const &name) override
Definition: GEOModels.h:123
GEOModels connects the data management class GEOObjects and the GUI. It inherits from GeoLib::GEOObje...
Definition: GEOModels.h:37
GeoTreeModel * getGeoModel()
Definition: GEOModels.h:45
GeoLib::GEOObjects & _geo_objects
Definition: GEOModels.h:106
void stationVectorAdded(StationTreeModel *model, std::string name)
void addStationVec(std::string const &name)
Definition: GEOModels.cpp:118
StationTreeModel * getStationModel()
Definition: GEOModels.h:46
void addNameForObjectPoints(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, const std::string &geo_object_name, const std::string &new_name)
Adds a generic name to all points that are part of the specified geo-object.
Definition: GEOModels.cpp:273
void appendSurfaceVec(std::string const &name)
Definition: GEOModels.cpp:157
void renameGeometry(std::string const &old_name, std::string const &new_name)
Definition: GEOModels.cpp:168
void addSurfaceVec(std::string const &name)
Definition: GEOModels.cpp:150
void removePointVec(std::string const &name)
Definition: GEOModels.cpp:110
void addPointVec(std::string const &name)
Definition: GEOModels.cpp:103
StationTreeModel * _stationModel
Definition: GEOModels.h:103
void stationVectorRemoved(StationTreeModel *model, std::string name)
void geoDataAdded(GeoTreeModel *, std::string, GeoLib::GEOTYPE)
void removeStationVec(std::string const &name)
Definition: GEOModels.cpp:125
void geoDataRemoved(GeoTreeModel *, std::string, GeoLib::GEOTYPE)
void updateGeometry(const std::string &geo_name)
Definition: GEOModels.cpp:40
void addNameForElement(std::string const &geometry_name, GeoLib::GEOTYPE const object_type, std::size_t const id, std::string const &new_name)
Adds the name 'new_name' for the geo-object specified by the parameters.
Definition: GEOModels.cpp:248
~GEOModels() override
Definition: GEOModels.cpp:34
void removePolylineVec(std::string const &name)
Definition: GEOModels.cpp:144
GEOModels(GeoLib::GEOObjects &geo_objects, QObject *parent=nullptr)
Definition: GEOModels.cpp:25
void connectPolylineSegments(const std::string &geoName, std::vector< std::size_t > const &indexlist, double const proximity, std::string const &ply_name, bool const closePly, bool const triangulatePly)
Definition: GEOModels.cpp:175
void appendPolylineVec(std::string const &name)
Definition: GEOModels.cpp:138
void removeSurfaceVec(std::string const &name)
Definition: GEOModels.cpp:162
virtual void removeGeometry(std::string const &geo_name, GeoLib::GEOTYPE const type)
Definition: GEOModels.cpp:86
void addPolylineVec(std::string const &name)
Definition: GEOModels.cpp:131
GeoTreeModel * _geoModel
Definition: GEOModels.h:102
Container class for geometric objects.
Definition: GEOObjects.h:61
A model for the GeoTreeView implementing a tree as a double-linked list.
Definition: GeoTreeModel.h:41
A model for the StationTreeView implementing a tree as a double-linked list.
A hierarchical model for a tree implemented as a double-linked list.
Definition: TreeModel.h:30
GEOTYPE
Definition: GeoType.h:25