OGS
DuplicateGeometry.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <memory>
14 #include <string>
15 #include <vector>
16 
17 namespace GeoLib
18 {
19 class GEOObjects;
20 class Point;
21 class Polyline;
22 class Surface;
23 
27 class DuplicateGeometry final
28 {
29 
30 public:
38  std::string const& input_name,
39  std::string output_name);
40 
41  // Returns the (possibly modified) output name of the new geometry.
42  std::string const& getFinalizedOutputName() const { return _output_name; }
43  // Returns a reference to the copied point vector for modification
44  std::vector<GeoLib::Point*>& getPointVectorCopy();
45  // Returns a reference to the copied polyline vector for modification
46  std::vector<GeoLib::Polyline*>& getPolylineVectorCopy();
47  // Returns a reference to the copied surface vector for modification
48  std::vector<GeoLib::Surface*>& getSurfaceVectorCopy();
49 
50 private:
51  // creates a deep copy of the designated geometry
52  void duplicate(std::string const& input_name);
53 
54  // creates a deep copy of the polyline vector
55  std::unique_ptr<std::vector<GeoLib::Polyline*>> copyPolylinesVector(
56  std::vector<GeoLib::Polyline*> const& polylines) const;
57 
58  // creates a deep copy of the surface vector
59  std::unique_ptr<std::vector<GeoLib::Surface*>> copySurfacesVector(
60  std::vector<GeoLib::Surface*> const& surfaces) const;
61 
62  std::string _output_name;
64 
65 }; // class
66 
67 } // namespace GeoLib
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::string const & getFinalizedOutputName() const
std::vector< GeoLib::Polyline * > & getPolylineVectorCopy()
Container class for geometric objects.
Definition: GEOObjects.h:61
TemplateElement< PointRule1 > Point
Definition: Point.h:20