26 : QObject(parent), _geo_objects(geo_objects)
82 ERR(
"GEOModels::updateGeometry() - Geometry '{:s}' not found.",
108 const std::string& name)
const
179 std::string
const& 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)
279 ERR(
"GEOModels::addNameForElement() - Unknown GEOTYPE {:s}.",
285 const std::string& geo_object_name,
286 const std::string& new_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.
std::vector< std::string > getGeometryNames() const
Returns the names of all geometry vectors.
bool appendSurfaceVec(const std::vector< Surface * > &surfaces, const std::string &name)
const std::vector< Point * > * getPointVec(const std::string &name) const
const PointVec * getPointVecObj(const std::string &name) const
bool removePointVec(const std::string &name)
bool removeSurfaceVec(const std::string &name)
SurfaceVec * getSurfaceVecObj(const std::string &name)
Returns the surface vector with the given name.
std::unique_ptr< Callbacks > _callbacks
bool isPntVecUsed(const std::string &name) const
const PolylineVec * getPolylineVecObj(const std::string &name) const
bool appendPolylineVec(const std::vector< Polyline * > &polylines, const std::string &name)
const GeoLib::GeoObject * getGeoObject(const std::string &geo_name, GeoLib::GEOTYPE type, const std::string &geo_obj_name) const
const std::vector< GeoLib::Point * > * getStationVec(const std::string &name) const
Returns the station vector with the given name.
bool removePolylineVec(const std::string &name)
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
The class TemplateVec takes a unique name and manages a std::vector of pointers to data elements of t...
void setNameOfElementByID(std::size_t id, std::string const &element_name)
Return the name of an element based on its ID.
virtual void setNameForElement(std::size_t id, std::string const &name)
Sets the given name for the element of the given 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.
void appendPolylines(const std::string &name, GeoLib::PolylineVec const &polylineVec)
Appends polylines to the "Polyline"-subtree.
void addSurfaceList(QString geoName, GeoLib::SurfaceVec const &surfaceVec)
Adds a subtree "Surfaces" to an existing geometry with the given name.
void addPointList(QString geoName, GeoLib::PointVec const &pointVec)
void renameGeometry(std::string const &old_name, std::string const &new_name)
void appendSurfaces(const std::string &name, GeoLib::SurfaceVec const &surfaceVec)
Appends surfaces to the "Surface"-subtree.
void addPolylineList(QString geoName, GeoLib::PolylineVec const &polylineVec)
Adds a subtree "Polylines" to an existing geometry with the given name.
void removeGeoList(const std::string &name, GeoLib::GEOTYPE type)
static void box(const QString &e)
A model for the StationTreeView implementing a tree as a double-linked list.
void addStationList(QString listName, const std::vector< GeoLib::Point * > *stations)
void removeStationList(QModelIndex index)
std::unique_ptr< GeoLib::Surface > createSurfaceWithEarClipping(GeoLib::Polyline const &line)
std::string convertGeoTypeToString(GEOTYPE geo_type)