17 _geo_objects._callbacks = std::make_unique<GEOModelsCallbacks>(*
this);
31 if (
auto const stations =
_geo_objects.getStationVec(geo_name);
36 _stationModel->addStationList(QString::fromStdString(geo_name),
42 if (
auto const points =
_geo_objects.getPointVecObj(geo_name);
47 _geoModel->addPointList(QString::fromStdString(geo_name), *points);
50 if (
auto const lines =
_geo_objects.getPolylineVecObj(geo_name);
55 _geoModel->addPolylineList(QString::fromStdString(geo_name),
60 if (
auto const surfaces =
_geo_objects.getSurfaceVecObj(geo_name);
65 _geoModel->addSurfaceList(QString::fromStdString(geo_name),
71 ERR(
"GEOModels::updateGeometry() - Geometry '{:s}' not found.",
97 const std::string& name)
const
104 _geoModel->addPointList(QString::fromStdString(name),
132 _geoModel->addPolylineList(QString::fromStdString(name),
151 _geoModel->addSurfaceList(QString::fromStdString(name),
168 std::string
const& new_name)
170 _geoModel->renameGeometry(old_name, new_name);
175 const std::string& geoName, std::vector<std::size_t>
const& indexlist,
176 double const proximity, std::string
const& ply_name,
bool const closePly,
177 bool const triangulatePly)
183 auto const& polylines = plyVec->
getVector();
184 std::vector<GeoLib::Polyline*> ply_list;
185 std::transform(indexlist.begin(), indexlist.end(),
186 std::back_inserter(ply_list),
187 [polylines](
auto const& ply_index)
188 { return polylines[ply_index]; });
199 std::vector<GeoLib::Polyline*> connected_ply;
201 connected_ply.push_back(new_line);
211 "Creating a surface by triangulation of the polyline "
216 std::vector<GeoLib::Surface*> new_sfc;
217 new_sfc.push_back(sfc.release());
224 "\t Creating a surface by triangulation of the "
231 if (!ply_name.empty())
249 std::size_t
const id,
250 std::string
const& new_name)
255 ->setNameForElement(
id, new_name);
260 ->setNameForElement(
id, new_name);
265 ->setNameForElement(
id, new_name);
268 ERR(
"GEOModels::addNameForElement() - Unknown GEOTYPE {:s}.",
274 const std::string& geo_object_name,
275 const std::string& new_name)
278 _geo_objects.getGeoObject(geometry_name, object_type, geo_object_name);
284 for (std::size_t i = 0; i < nPoints; i++)
288 new_name +
"_Point" + std::to_string(ply->getPointID(i)));
295 for (std::size_t i = 0; i < nTriangles; i++)
299 (*tri)[0], new_name +
"_Point" + std::to_string((*tri)[0]));
301 (*tri)[1], new_name +
"_Point" + std::to_string((*tri)[1]));
303 (*tri)[2], new_name +
"_Point" + std::to_string((*tri)[2]));
307 ERR(
"GEOModels::addNameForObjectPoints() - Unknown GEOTYPE {:s}.",
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)
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...