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
22class GeoTreeModel;
23class Model;
24class PntsModel;
26class PolylinesModel;
27class SurfaceModel;
28class TreeModel;
29
36class GEOModels : public QObject
37{
38 Q_OBJECT
39
40public:
41 explicit GEOModels(GeoLib::GEOObjects& geo_objects,
42 QObject* parent = nullptr);
43 ~GEOModels() override;
44
47
48public 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 std::vector<std::string> getGeometryNames() const;
78
79 const std::vector<GeoLib::Point*>* getPointVec(const std::string& name) const;
80
81 void appendSurfaceVec(std::string const& name);
82 void removeSurfaceVec(std::string const& name);
83
84 void renameGeometry(std::string const& old_name,
85 std::string const& new_name);
86
88 void addNameForElement(std::string const& geometry_name,
89 GeoLib::GEOTYPE const object_type,
90 std::size_t const id,
91 std::string const& new_name);
92
94 void addNameForObjectPoints(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, const std::string &geo_object_name, const std::string &new_name);
95
98 void connectPolylineSegments(const std::string& geoName,
99 std::vector<std::size_t> const& indexlist,
100 double const proximity,
101 std::string const& ply_name,
102 bool const closePly,
103 bool const triangulatePly);
104
105protected:
108
109private:
111
112signals:
115
116 void stationVectorAdded(StationTreeModel* model, std::string name);
117 void stationVectorRemoved(StationTreeModel* model, std::string name);
118};
119
121{
122public:
123 explicit GEOModelsCallbacks(GEOModels& geo_models) : _geo_models(geo_models)
124 {
125 }
126
127 void addPointVec(std::string const& name) override
128 {
130 }
131
132 void removePointVec(std::string const& name) override
133 {
135 }
136
137 void addStationVec(std::string const& name) override
138 {
140 };
141
142 void removeStationVec(std::string const& name) override
143 {
145 };
146
147 void addPolylineVec(std::string const& name) override
148 {
150 };
151
152 void appendPolylineVec(std::string const& name) override
153 {
155 };
156
157 void removePolylineVec(std::string const& name) override
158 {
160 };
161
162 void addSurfaceVec(std::string const& name) override
163 {
165 };
166
167 void appendSurfaceVec(std::string const& name) override
168 {
170 };
171
172 void removeSurfaceVec(std::string const& name) override
173 {
175 };
176
177 void renameGeometry(std::string const& old_name,
178 std::string const& new_name) override
179 {
180 _geo_models.renameGeometry(old_name, new_name);
181 }
182
183private:
185};
Definition of the GEOObjects class.
Definition of the GEOTYPE enumeration.
void appendSurfaceVec(std::string const &name) override
Definition GEOModels.h:167
void removeSurfaceVec(std::string const &name) override
Definition GEOModels.h:172
void appendPolylineVec(std::string const &name) override
Definition GEOModels.h:152
void addSurfaceVec(std::string const &name) override
Definition GEOModels.h:162
void removePolylineVec(std::string const &name) override
Definition GEOModels.h:157
void addStationVec(std::string const &name) override
Definition GEOModels.h:137
void removeStationVec(std::string const &name) override
Definition GEOModels.h:142
void addPolylineVec(std::string const &name) override
Definition GEOModels.h:147
void removePointVec(std::string const &name) override
Definition GEOModels.h:132
GEOModelsCallbacks(GEOModels &geo_models)
Definition GEOModels.h:123
void renameGeometry(std::string const &old_name, std::string const &new_name) override
Definition GEOModels.h:177
GEOModels & _geo_models
Definition GEOModels.h:184
void addPointVec(std::string const &name) override
Definition GEOModels.h:127
GEOModels connects the data management class GEOObjects and the GUI. It inherits from GeoLib::GEOObje...
Definition GEOModels.h:37
std::vector< std::string > getGeometryNames() const
GeoLib::GEOObjects & _geo_objects
Definition GEOModels.h:110
void stationVectorAdded(StationTreeModel *model, std::string name)
void addStationVec(std::string const &name)
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.
void appendSurfaceVec(std::string const &name)
StationTreeModel * getStationModel()
Definition GEOModels.h:46
void renameGeometry(std::string const &old_name, std::string const &new_name)
void addSurfaceVec(std::string const &name)
void removePointVec(std::string const &name)
void addPointVec(std::string const &name)
StationTreeModel * _stationModel
Definition GEOModels.h:107
void stationVectorRemoved(StationTreeModel *model, std::string name)
void geoDataAdded(GeoTreeModel *, std::string, GeoLib::GEOTYPE)
void removeStationVec(std::string const &name)
void geoDataRemoved(GeoTreeModel *, std::string, GeoLib::GEOTYPE)
GeoTreeModel * getGeoModel()
Definition GEOModels.h:45
const std::vector< GeoLib::Point * > * getPointVec(const std::string &name) const
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.
~GEOModels() override
Definition GEOModels.cpp:34
void removePolylineVec(std::string const &name)
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)
void appendPolylineVec(std::string const &name)
void removeSurfaceVec(std::string const &name)
virtual void removeGeometry(std::string const &geo_name, GeoLib::GEOTYPE const type)
Definition GEOModels.cpp:86
void addPolylineVec(std::string const &name)
GeoTreeModel * _geoModel
Definition GEOModels.h:106
Container class for geometric objects.
Definition GEOObjects.h:57
A model for the GeoTreeView implementing a tree as a double-linked list.
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:23