OGS
GEOModels.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <QObject>
7
8#include "GeoLib/GEOObjects.h"
9#include "GeoLib/GeoType.h"
10
11class GeoTreeModel;
12class Model;
13class PntsModel;
15class PolylinesModel;
16class SurfaceModel;
17class TreeModel;
18
25class GEOModels : public QObject
26{
27 Q_OBJECT
28
29public:
30 explicit GEOModels(GeoLib::GEOObjects& geo_objects,
31 QObject* parent = nullptr);
32 ~GEOModels() override;
33
36
37public slots:
43 void updateGeometry(const std::string &geo_name);
44
47 virtual void removeGeometry(std::string const& geo_name,
48 GeoLib::GEOTYPE const type);
49
50 void addPointVec(std::string const& name);
51
52 void removePointVec(std::string const& name);
53
54 void addStationVec(std::string const& name);
55
56 void removeStationVec(std::string const& name);
57
58 void addPolylineVec(std::string const& name);
59
60 void appendPolylineVec(std::string const& name);
61
62 void removePolylineVec(std::string const& name);
63
64 void addSurfaceVec(std::string const& name);
65
66 std::vector<std::string> getGeometryNames() const;
67
68 const std::vector<GeoLib::Point*>* getPointVec(const std::string& name) const;
69
70 void appendSurfaceVec(std::string const& name);
71 void removeSurfaceVec(std::string const& name);
72
73 void renameGeometry(std::string const& old_name,
74 std::string const& new_name);
75
77 void addNameForElement(std::string const& geometry_name,
78 GeoLib::GEOTYPE const object_type,
79 std::size_t const id,
80 std::string const& new_name);
81
83 void addNameForObjectPoints(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, const std::string &geo_object_name, const std::string &new_name);
84
87 void connectPolylineSegments(const std::string& geoName,
88 std::vector<std::size_t> const& indexlist,
89 double const proximity,
90 std::string const& ply_name,
91 bool const closePly,
92 bool const triangulatePly);
93
94protected:
97
98private:
100
101signals:
104
105 void stationVectorAdded(StationTreeModel* model, std::string name);
106 void stationVectorRemoved(StationTreeModel* model, std::string name);
107};
108
110{
111public:
112 explicit GEOModelsCallbacks(GEOModels& geo_models) : _geo_models(geo_models)
113 {
114 }
115
116 void addPointVec(std::string const& name) override
117 {
118 _geo_models.addPointVec(name);
119 }
120
121 void removePointVec(std::string const& name) override
122 {
123 _geo_models.removePointVec(name);
124 }
125
126 void addStationVec(std::string const& name) override
127 {
128 _geo_models.addStationVec(name);
129 };
130
131 void removeStationVec(std::string const& name) override
132 {
133 _geo_models.removeStationVec(name);
134 };
135
136 void addPolylineVec(std::string const& name) override
137 {
138 _geo_models.addPolylineVec(name);
139 };
140
141 void appendPolylineVec(std::string const& name) override
142 {
143 _geo_models.appendPolylineVec(name);
144 };
145
146 void removePolylineVec(std::string const& name) override
147 {
148 _geo_models.removePolylineVec(name);
149 };
150
151 void addSurfaceVec(std::string const& name) override
152 {
153 _geo_models.addSurfaceVec(name);
154 };
155
156 void appendSurfaceVec(std::string const& name) override
157 {
158 _geo_models.appendSurfaceVec(name);
159 };
160
161 void removeSurfaceVec(std::string const& name) override
162 {
163 _geo_models.removeSurfaceVec(name);
164 };
165
166 void renameGeometry(std::string const& old_name,
167 std::string const& new_name) override
168 {
169 _geo_models.renameGeometry(old_name, new_name);
170 }
171
172private:
174};
void appendSurfaceVec(std::string const &name) override
Definition GEOModels.h:156
void removeSurfaceVec(std::string const &name) override
Definition GEOModels.h:161
void appendPolylineVec(std::string const &name) override
Definition GEOModels.h:141
void addSurfaceVec(std::string const &name) override
Definition GEOModels.h:151
void removePolylineVec(std::string const &name) override
Definition GEOModels.h:146
void addStationVec(std::string const &name) override
Definition GEOModels.h:126
void removeStationVec(std::string const &name) override
Definition GEOModels.h:131
void addPolylineVec(std::string const &name) override
Definition GEOModels.h:136
void removePointVec(std::string const &name) override
Definition GEOModels.h:121
GEOModelsCallbacks(GEOModels &geo_models)
Definition GEOModels.h:112
void renameGeometry(std::string const &old_name, std::string const &new_name) override
Definition GEOModels.h:166
GEOModels & _geo_models
Definition GEOModels.h:173
void addPointVec(std::string const &name) override
Definition GEOModels.h:116
GEOModels connects the data management class GEOObjects and the GUI. It inherits from GeoLib::GEOObje...
Definition GEOModels.h:26
std::vector< std::string > getGeometryNames() const
Definition GEOModels.cpp:92
GeoLib::GEOObjects & _geo_objects
Definition GEOModels.h:99
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:35
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:96
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:34
const std::vector< GeoLib::Point * > * getPointVec(const std::string &name) const
Definition GEOModels.cpp:96
void updateGeometry(const std::string &geo_name)
Definition GEOModels.cpp:29
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:23
void removePolylineVec(std::string const &name)
GEOModels(GeoLib::GEOObjects &geo_objects, QObject *parent=nullptr)
Definition GEOModels.cpp:14
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:75
void addPolylineVec(std::string const &name)
GeoTreeModel * _geoModel
Definition GEOModels.h:95
Container class for geometric objects.
Definition GEOObjects.h:46
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:19
GEOTYPE
Definition GeoType.h:12