OGS
DuplicateGeometry.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <memory>
7#include <string>
8#include <vector>
9
10namespace GeoLib
11{
12class GEOObjects;
13class Point;
14class Polyline;
15class Surface;
16
21{
22public:
31 std::string const& input_name,
32 std::string output_name);
33
34 // Returns the (possibly modified) output name of the new geometry.
35 std::string const& getFinalizedOutputName() const { return _output_name; }
36 // Returns a reference to the copied point vector for modification
37 std::vector<GeoLib::Point*>& getPointVectorCopy();
38 // Returns a reference to the copied polyline vector for modification
39 std::vector<GeoLib::Polyline*>& getPolylineVectorCopy();
40 // Returns a reference to the copied surface vector for modification
41 std::vector<GeoLib::Surface*>& getSurfaceVectorCopy();
42
43private:
44 // creates a deep copy of the designated geometry
45 void duplicate(std::string const& input_name);
46
47 // creates a deep copy of the polyline vector
48 std::vector<GeoLib::Polyline*> copyPolylinesVector(
49 std::vector<GeoLib::Polyline*> const& polylines) const;
50
51 // creates a deep copy of the surface vector
52 std::vector<Surface*> copySurfacesVector(
53 std::vector<Surface*> const& surfaces) const;
54
55 std::string _output_name;
57
58}; // class
59
60} // namespace GeoLib
std::vector< GeoLib::Surface * > & getSurfaceVectorCopy()
void duplicate(std::string const &input_name)
GeoLib::GEOObjects & _geo_objects
std::string const & getFinalizedOutputName() const
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.
Definition GEOObjects.h:46
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
Definition Polyline.h:29
A Surface is represented by Triangles. It consists of a reference to a vector of (pointers to) points...