26 std::string
const& input_name,
27 std::string output_name)
28 : _output_name(std::move(output_name)), _geo_objects(geo_objects)
35 std::vector<GeoLib::Point*>
const*
const pnts(
39 ERR(
"Geometry '{:s}' not found.", input_name);
43 std::vector<GeoLib::Point*> new_pnts{};
44 new_pnts.reserve(pnts->size());
45 std::transform(pnts->cbegin(), pnts->cend(), std::back_inserter(new_pnts),
47 { return new GeoLib::Point(*point); });
52 std::move(pnt_name_id_map));
54 std::vector<GeoLib::Polyline*>
const* plys(
63 std::move(ply_name_id_map));
66 std::vector<GeoLib::Surface*>
const* sfcs(
75 std::move(sfc_name_id_map));
80 std::vector<GeoLib::Polyline*>
const& polylines)
const
82 std::size_t
const n_plys = polylines.size();
83 std::vector<GeoLib::Polyline*> new_lines{n_plys,
nullptr};
85 for (std::size_t i = 0; i < n_plys; ++i)
87 if (polylines[i] ==
nullptr)
93 std::size_t
const nLinePnts(polylines[i]->getNumberOfPoints());
94 for (std::size_t j = 0; j < nLinePnts; ++j)
96 new_lines[i]->addPoint(polylines[i]->getPointID(j));
103 std::vector<Surface*>
const& surfaces)
const
105 std::size_t
const n_sfc = surfaces.size();
106 std::vector<GeoLib::Surface*> new_surfaces{n_sfc,
nullptr};
108 for (std::size_t i = 0; i < n_sfc; ++i)
110 if (surfaces[i] ==
nullptr)
117 std::size_t
const n_tris(surfaces[i]->getNumberOfTriangles());
118 for (std::size_t j = 0; j < n_tris; ++j)
131 return const_cast<std::vector<GeoLib::Point*>&
>(
137 return const_cast<std::vector<GeoLib::Polyline*>&
>(
143 return const_cast<std::vector<GeoLib::Surface*>&
>(
Definition of the GEOObjects class.
Definition of the Point class.
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the PolyLine class.
std::vector< GeoLib::Surface * > & getSurfaceVectorCopy()
void duplicate(std::string const &input_name)
GeoLib::GEOObjects & _geo_objects
std::vector< Surface * > copySurfacesVector(std::vector< Surface * > const &surfaces) const
DuplicateGeometry(GeoLib::GEOObjects &geo_objects, std::string const &input_name, std::string output_name)
std::vector< GeoLib::Point * > & getPointVectorCopy()
std::vector< GeoLib::Polyline * > & getPolylineVectorCopy()
std::vector< GeoLib::Polyline * > copyPolylinesVector(std::vector< GeoLib::Polyline * > const &polylines) const
Container class for geometric objects.
void addPolylineVec(std::vector< Polyline * > &&lines, std::string const &name, PolylineVec::NameIdMap &&ply_names)
const std::vector< Point * > * getPointVec(const std::string &name) const
void addPointVec(std::vector< Point * > &&points, std::string &name, PointVec::NameIdMap &&pnt_id_name_map, double const eps=std::sqrt(std::numeric_limits< double >::epsilon()))
const PointVec * getPointVecObj(const std::string &name) const
SurfaceVec * getSurfaceVecObj(const std::string &name)
Returns the surface vector with the given name.
const std::vector< Surface * > * getSurfaceVec(const std::string &name) const
Returns the surface vector with the given name as a const.
void addSurfaceVec(std::vector< Surface * > &&sfc, const std::string &name, SurfaceVec::NameIdMap &&sfc_names)
const PolylineVec * getPolylineVecObj(const std::string &name) const
const std::vector< Polyline * > * getPolylineVec(const std::string &name) const
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
A Surface is represented by Triangles. It consists of a reference to a vector of (pointers to) points...
std::map< std::string, std::size_t > NameIdMap
NameIdMap::const_iterator getNameIDMapBegin() const
Returns the begin of the name id mapping structure.
NameIdMap::const_iterator getNameIDMapEnd() const
Returns the end of the name id mapping structure.
Class Triangle consists of a reference to a point vector and a vector that stores the indices in the ...
const Point * getPoint(std::size_t i) const
const access operator to access the i-th triangle Point
std::size_t getID() const