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 auto new_pnts = std::make_unique<std::vector<GeoLib::Point*>>();
44 new_pnts->reserve(pnts->size());
45 std::transform(pnts->cbegin(), pnts->cend(), std::back_inserter(*new_pnts),
47 { return new GeoLib::Point(*point); });
48 auto pnt_name_id_map = std::make_unique<std::map<std::string, std::size_t>>(
52 std::move(pnt_name_id_map));
54 std::vector<GeoLib::Polyline*>
const* plys(
59 auto ply_name_id_map =
60 std::make_unique<std::map<std::string, std::size_t>>(
64 std::move(ply_name_id_map));
67 std::vector<GeoLib::Surface*>
const* sfcs(
72 auto sfc_name_id_map =
73 std::make_unique<std::map<std::string, std::size_t>>(
77 std::move(sfc_name_id_map));
81 std::unique_ptr<std::vector<GeoLib::Polyline*>>
83 std::vector<GeoLib::Polyline*>
const& polylines)
const
85 std::size_t
const n_plys = polylines.size();
87 std::make_unique<std::vector<GeoLib::Polyline*>>(n_plys,
nullptr);
89 for (std::size_t i = 0; i < n_plys; ++i)
91 if (polylines[i] ==
nullptr)
97 std::size_t
const nLinePnts(polylines[i]->getNumberOfPoints());
98 for (std::size_t j = 0; j < nLinePnts; ++j)
100 (*new_lines)[i]->addPoint(polylines[i]->getPointID(j));
107 std::vector<Surface*>
const& surfaces)
const
109 std::size_t
const n_sfc = surfaces.size();
111 std::make_unique<std::vector<GeoLib::Surface*>>(n_sfc,
nullptr);
113 for (std::size_t i = 0; i < n_sfc; ++i)
115 if (surfaces[i] ==
nullptr)
122 std::size_t
const n_tris(surfaces[i]->getNumberOfTriangles());
123 for (std::size_t j = 0; j < n_tris; ++j)
136 return const_cast<std::vector<GeoLib::Point*>&
>(
142 return const_cast<std::vector<GeoLib::Polyline*>&
>(
148 return const_cast<std::vector<GeoLib::Surface*>&
>(
Definition of the GEOObjects class.
Definition of the Point class.
void ERR(char const *fmt, Args const &... args)
Definition of the PolyLine class.
std::vector< GeoLib::Surface * > & getSurfaceVectorCopy()
void duplicate(std::string const &input_name)
std::unique_ptr< std::vector< GeoLib::Polyline * > > copyPolylinesVector(std::vector< GeoLib::Polyline * > const &polylines) const
GeoLib::GEOObjects & _geo_objects
std::unique_ptr< std::vector< GeoLib::Surface * > > copySurfacesVector(std::vector< GeoLib::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()
Container class for geometric objects.
void addSurfaceVec(std::unique_ptr< std::vector< Surface * >> sfc, const std::string &name, std::unique_ptr< std::map< std::string, std::size_t >> sfc_names=nullptr)
const std::vector< Point * > * getPointVec(const std::string &name) const
const PointVec * getPointVecObj(const std::string &name) const
void addPointVec(std::unique_ptr< std::vector< Point * >> points, std::string &name, std::unique_ptr< std::map< std::string, std::size_t >> pnt_id_name_map=nullptr, double eps=std::sqrt(std::numeric_limits< double >::epsilon()))
const std::vector< Surface * > * getSurfaceVec(const std::string &name) const
Returns the surface vector with the given name as a const.
SurfaceVec * getSurfaceVecObj(const std::string &name)
Returns the surface vector with the given name.
const PolylineVec * getPolylineVecObj(const std::string &name) const
const std::vector< Polyline * > * getPolylineVec(const std::string &name) const
void addPolylineVec(std::unique_ptr< std::vector< Polyline * >> lines, const std::string &name, std::unique_ptr< std::map< std::string, std::size_t >> ply_names=nullptr)
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...
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