28 _geo_objects._callbacks = std::make_unique<GEOModelsCallbacks>(*
this);
42 if (
auto const stations =
_geo_objects.getStationVec(geo_name);
47 _stationModel->addStationList(QString::fromStdString(geo_name),
53 if (
auto const points =
_geo_objects.getPointVecObj(geo_name);
58 _geoModel->addPointList(QString::fromStdString(geo_name), *points);
61 if (
auto const lines =
_geo_objects.getPolylineVecObj(geo_name);
66 _geoModel->addPolylineList(QString::fromStdString(geo_name),
71 if (
auto const surfaces =
_geo_objects.getSurfaceVecObj(geo_name);
76 _geoModel->addSurfaceList(QString::fromStdString(geo_name),
82 ERR(
"GEOModels::updateGeometry() - Geometry '{:s}' not found.",
108 const std::string& name)
const
115 _geoModel->addPointList(QString::fromStdString(name),
143 _geoModel->addPolylineList(QString::fromStdString(name),
162 _geoModel->addSurfaceList(QString::fromStdString(name),
179 std::string
const& new_name)
181 _geoModel->renameGeometry(old_name, new_name);
186 const std::string& geoName, std::vector<std::size_t>
const& indexlist,
187 double const proximity, std::string
const& ply_name,
bool const closePly,
188 bool const triangulatePly)
194 auto const& polylines = plyVec->
getVector();
195 std::vector<GeoLib::Polyline*> ply_list;
196 std::transform(indexlist.begin(), indexlist.end(),
197 std::back_inserter(ply_list),
198 [polylines](
auto const& ply_index)
199 { return polylines[ply_index]; });
210 std::vector<GeoLib::Polyline*> connected_ply;
212 connected_ply.push_back(new_line);
222 "Creating a surface by triangulation of the polyline "
227 std::vector<GeoLib::Surface*> new_sfc;
228 new_sfc.push_back(sfc.release());
235 "\t Creating a surface by triangulation of the "
242 if (!ply_name.empty())
260 std::size_t
const id,
261 std::string
const& new_name)
266 ->setNameForElement(
id, new_name);
271 ->setNameForElement(
id, new_name);
276 ->setNameForElement(
id, new_name);
279 ERR(
"GEOModels::addNameForElement() - Unknown GEOTYPE {:s}.",
285 const std::string& geo_object_name,
286 const std::string& new_name)
289 _geo_objects.getGeoObject(geometry_name, object_type, geo_object_name);
295 for (std::size_t i = 0; i < nPoints; i++)
299 new_name +
"_Point" + std::to_string(ply->getPointID(i)));
306 for (std::size_t i = 0; i < nTriangles; i++)
310 (*tri)[0], new_name +
"_Point" + std::to_string((*tri)[0]));
312 (*tri)[1], new_name +
"_Point" + std::to_string((*tri)[1]));
314 (*tri)[2], new_name +
"_Point" + std::to_string((*tri)[2]));
318 ERR(
"GEOModels::addNameForObjectPoints() - Unknown GEOTYPE {:s}.",
Definition of the GEOModels class.
Definition of the GeoTreeModel class.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the OGSError class.
Definition of the StationTreeModel class.
std::vector< std::string > getGeometryNames() const
GeoLib::GEOObjects & _geo_objects
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)
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
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)
const std::vector< GeoLib::Point * > * getPointVec(const std::string &name) const
void updateGeometry(const std::string &geo_name)
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.
void removePolylineVec(std::string const &name)
GEOModels(GeoLib::GEOObjects &geo_objects, QObject *parent=nullptr)
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)
void addPolylineVec(std::string const &name)
Container class for geometric objects.
This class manages pointers to Points in a std::vector along with a name. It also handles the deletio...
void setNameForElement(std::size_t id, std::string const &name) override
Sets the given name for the element of the given ID.
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
static Polyline * constructPolylineFromSegments(const std::vector< Polyline * > &ply_vec, double prox=0.0)
std::size_t getNumberOfPoints() const
A Surface is represented by Triangles. It consists of a reference to a vector of (pointers to) points...
std::size_t getNumberOfTriangles() const
void setNameOfElementByID(std::size_t id, std::string const &element_name)
Return the name of an element based on its ID.
std::vector< T * > const & getVector() const
Class Triangle consists of a reference to a point vector and a vector that stores the indices in the ...
A model for the GeoTreeView implementing a tree as a double-linked list.
static void box(const QString &e)
A model for the StationTreeView implementing a tree as a double-linked list.
std::unique_ptr< GeoLib::Surface > createSurfaceWithEarClipping(GeoLib::Polyline const &line)
std::string convertGeoTypeToString(GEOTYPE geo_type)
TemplateVec< GeoLib::Polyline > PolylineVec
class PolylineVec encapsulate a std::vector of Polylines additional one can give the vector of polyli...