OGS
GeoLib::GEOObjects Class Referencefinal

Detailed Description

Container class for geometric objects.

This class contains all the methods necessary for the I/O of geometric objects. Said objects are Points, polylines, Surfaces and Stations and they are stored in vectors (arrays) which are identified by a unique name. For a hierarchical definition, surfaces are bounded by polylines and polylines are defined by points. Therefore, a vector of surfaces references a vector polylines and a vector of polylines references a vector of points, respectively. For identification purposes, all of these vectors have the same name, i.e. the polyline- vector named "aaa" references a point vector "aaa". However, this name ("aaa") is unique among all the vectors of the same class, i.e. there exists only one point- vector with this name, etc. Note: The fact that vectors are uniquely named and the same name is assigned to related objects is automatically handled by this class.

For each of these object-classes exists an "add", "remove" and "get"-method which allows for loading/unloading as well as accessing the data, respectively. E.g. for points these methods are "addPointVec(name)", "getPointVec(name)" and "removePointVec(name)". For some objects, additional methods might exist if necessary.

Definition at line 45 of file GEOObjects.h.

#include <GEOObjects.h>

Classes

struct  Callbacks

Public Member Functions

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()))
void addPointVec (std::vector< Point * > &&points, std::string &name, double const eps=std::sqrt(std::numeric_limits< double >::epsilon()))
const std::vector< Point * > * getPointVec (const std::string &name) const
const PointVecgetPointVecObj (const std::string &name) const
PointVecgetPointVecObj (const std::string &name)
 Returns a pointer to a PointVec object for the given name.
bool removePointVec (const std::string &name)
void addStationVec (std::vector< Point * > &&stations, std::string &name)
 Adds a vector of stations with the given name and colour to GEOObjects.
const std::vector< GeoLib::Point * > * getStationVec (const std::string &name) const
 Returns the station vector with the given name.
bool removeStationVec (const std::string &name)
 Removes the station vector with the given name from GEOObjects.
void addPolylineVec (std::vector< Polyline * > &&lines, std::string const &name, PolylineVec::NameIdMap &&ply_names)
bool appendPolylineVec (const std::vector< Polyline * > &polylines, const std::string &name)
const std::vector< Polyline * > * getPolylineVec (const std::string &name) const
const PolylineVecgetPolylineVecObj (const std::string &name) const
PolylineVecgetPolylineVecObj (const std::string &name)
 Returns a pointer to a PolylineVec object for the given name.
bool removePolylineVec (const std::string &name)
void addSurfaceVec (std::vector< Surface * > &&sfc, const std::string &name, SurfaceVec::NameIdMap &&sfc_names)
bool appendSurfaceVec (const std::vector< Surface * > &surfaces, const std::string &name)
const std::vector< Surface * > * getSurfaceVec (const std::string &name) const
 Returns the surface vector with the given name as a const.
SurfaceVecgetSurfaceVecObj (const std::string &name)
 Returns the surface vector with the given name.
bool removeSurfaceVec (const std::string &name)
const SurfaceVecgetSurfaceVecObj (const std::string &name) const
std::vector< std::string > getGeometryNames () const
 Returns the names of all geometry vectors.
std::string getElementNameByID (const std::string &geometry_name, GeoLib::GEOTYPE type, std::size_t id) const
void getStationVectorNames (std::vector< std::string > &names) const
 Returns the names of all station vectors.
bool isUniquePointVecName (std::string &name) const
int mergeGeometries (std::vector< std::string > const &geo_names, std::string &merged_geo_name)
void renameGeometry (std::string const &old_name, std::string const &new_name)
const GeoLib::GeoObjectgetGeoObject (const std::string &geo_name, GeoLib::GEOTYPE type, const std::string &geo_obj_name) const
GeoLib::GeoObject const * getGeoObject (const std::string &geo_name, const std::string &geo_obj_name) const
 Return named (by the tuple geo_name and geo_obj_name) geo object.
 GEOObjects ()
 ~GEOObjects ()
std::size_t exists (const std::string &geometry_name) const
bool isPntVecUsed (const std::string &name) const
std::vector< PointVec * > const & getPoints () const
 Read access to points w/o using a name.
std::vector< PolylineVec * > const & getPolylines () const
 Read access to polylines w/o using a name.
std::vector< SurfaceVec * > const & getSurfaces () const
 Read access to surfaces w/o using a name.

Public Attributes

std::unique_ptr< Callbacks_callbacks {new Callbacks}
std::function< void(std::string const &)> addPolylineVecCallback
std::function< void(std::string const &)> appendPolylineVecCallback
std::function< void(std::string const &)> removePolylineVecCallback
std::function< void(std::string const &)> addSurfaceVecCallback
std::function< void(std::string const &)> appendSurfaceVecCallback
std::function< void(std::string const &)> removeSurfaceVecCallback

Private Member Functions

void mergePoints (std::vector< std::string > const &geo_names, std::string &merged_geo_name, std::vector< std::size_t > &pnt_offsets)
void mergePolylines (std::vector< std::string > const &geo_names, std::string const &merged_geo_name, std::vector< std::size_t > const &pnt_offsets)
void mergeSurfaces (std::vector< std::string > const &geo_names, std::string const &merged_geo_name, std::vector< std::size_t > const &pnt_offsets)

Private Attributes

std::vector< PointVec * > _pnt_vecs
std::vector< PolylineVec * > _ply_vecs
std::vector< SurfaceVec * > _sfc_vecs

Constructor & Destructor Documentation

◆ GEOObjects()

GeoLib::GEOObjects::GEOObjects ( )
default

constructor

Referenced by getPointVecObj(), getPolylineVecObj(), and getSurfaceVecObj().

◆ ~GEOObjects()

GeoLib::GEOObjects::~GEOObjects ( )

destructor

Definition at line 30 of file GEOObjects.cpp.

31{
32 // delete all SurfaceVecs, PolylineVec, and PointVecs
34}
std::vector< PointVec * > _pnt_vecs
Definition GEOObjects.h:356
std::vector< PolylineVec * > _ply_vecs
Definition GEOObjects.h:358
std::vector< SurfaceVec * > _sfc_vecs
Definition GEOObjects.h:360
void cleanupVectorElements(std::vector< T * > &items)
Definition Algorithm.h:249

References _ply_vecs, _pnt_vecs, _sfc_vecs, and BaseLib::cleanupVectorElements().

Member Function Documentation

◆ addPointVec() [1/2]

void GeoLib::GEOObjects::addPointVec ( std::vector< Point * > && points,
std::string & name,
double const eps = std::sqrt(std::numeric_limits<double>::epsilon()) )

Adds a vector of points with the given name to GEOObjects. This is an overloaded version without the need to pass a name-to-id-map.

Parameters
pointsvector of pointers to points
namethe project name
epsrelative tolerance value for testing of point uniqueness

Definition at line 55 of file GEOObjects.cpp.

57{
58 addPointVec(std::move(points), name, {}, eps);
59}
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()))

References addPointVec().

◆ addPointVec() [2/2]

void GeoLib::GEOObjects::addPointVec ( std::vector< Point * > && points,
std::string & name,
PointVec::NameIdMap && pnt_id_name_map,
double const eps = std::sqrt(std::numeric_limits<double>::epsilon()) )

Adds a vector of points with the given name to GEOObjects.

Parameters
pointsvector of pointers to points
namethe project name
pnt_id_name_mapnames corresponding to the points
epsrelative tolerance value for testing of point uniqueness

Definition at line 36 of file GEOObjects.cpp.

40{
42 if (points.empty())
43 {
44 DBUG(
45 "GEOObjects::addPointVec(): Failed to create PointVec, because "
46 "there aren't any points in the given vector.");
47 return;
48 }
49 _pnt_vecs.push_back(new PointVec(name, std::move(points),
50 std::move(pnt_id_name_map),
52 _callbacks->addPointVec(name);
53}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
bool isUniquePointVecName(std::string &name) const
std::unique_ptr< Callbacks > _callbacks
Definition GEOObjects.h:292

References _callbacks, _pnt_vecs, DBUG(), isUniquePointVecName(), and GeoLib::PointVec::POINT.

Referenced by FileIO::PetrelInterface::PetrelInterface(), addPointVec(), convertMeshNodesToGeometry(), anonymous_namespace{convertMeshToGeo.cpp}::convertMeshNodesToGeoPoints(), convertPoints(), FileIO::SwmmInterface::convertSwmmInputToGeometry(), createGeometries(), GeoLib::Grid< POINT >::createGridGeometry(), FileIO::createSurface(), generatePolylineGeometry(), generateQuadGeometry(), generateSinglePointGeometry(), FileIO::GMSH::GMSHAdaptiveMeshDensity::getQuadTreeGeometry(), main(), mergeGeometries(), mergePoints(), FileIO::FEFLOWGeoInterface::readFEFLOWFile(), FileIO::Legacy::readGLIFileV4(), and FileIO::TetGenInterface::readTetGenGeometry().

◆ addPolylineVec()

void GeoLib::GEOObjects::addPolylineVec ( std::vector< Polyline * > && lines,
std::string const & name,
PolylineVec::NameIdMap && ply_names )

Adds a vector of polylines with the given name to GEOObjects.

Parameters
linesThe lines vector.
nameThe geometry to which the given Polyline objects should be added.
ply_namesmap of names and ids that are corresponding to the polylines

Definition at line 141 of file GEOObjects.cpp.

144{
145 auto lines_end = std::remove_if(
146 lines.begin(), lines.end(),
147 [](auto const* polyline) { return polyline->getNumberOfPoints() < 2; });
148 lines.erase(lines_end, lines.end());
149
150 if (lines.empty())
151 {
152 return;
153 }
154
155 _ply_vecs.push_back(
156 new PolylineVec(name, std::move(lines), std::move(ply_names)));
157 _callbacks->addPolylineVec(name);
158}
TemplateVec< GeoLib::Polyline > PolylineVec
class PolylineVec encapsulate a std::vector of Polylines additional one can give the vector of polyli...
Definition PolylineVec.h:16

References _callbacks, and _ply_vecs.

Referenced by FileIO::SwmmInterface::convertSwmmInputToGeometry(), createGeometries(), GeoLib::Grid< POINT >::createGridGeometry(), FileIO::createSurface(), generatePolylineGeometry(), generateQuadGeometry(), FileIO::GMSH::GMSHAdaptiveMeshDensity::getQuadTreeGeometry(), mergeGeometries(), mergePolylines(), FileIO::FEFLOWGeoInterface::readFEFLOWFile(), and FileIO::Legacy::readGLIFileV4().

◆ addStationVec()

void GeoLib::GEOObjects::addStationVec ( std::vector< Point * > && stations,
std::string & name )

Adds a vector of stations with the given name and colour to GEOObjects.

Definition at line 112 of file GEOObjects.cpp.

114{
116 _pnt_vecs.push_back(new PointVec(name, std::move(stations),
119 _callbacks->addStationVec(name);
120}
std::map< std::string, std::size_t > NameIdMap
Definition TemplateVec.h:30

References _callbacks, _pnt_vecs, isUniquePointVecName(), and GeoLib::PointVec::STATION.

Referenced by convertPoints(), and GeoLib::geoPointsToStations().

◆ addSurfaceVec()

void GeoLib::GEOObjects::addSurfaceVec ( std::vector< Surface * > && sfc,
const std::string & name,
SurfaceVec::NameIdMap && sfc_names )

Adds a vector of surfaces with the given name to GEOObjects.

Definition at line 229 of file GEOObjects.cpp.

232{
233 _sfc_vecs.push_back(
234 new SurfaceVec(name, std::move(sfc), std::move(sfc_names)));
235 _callbacks->addSurfaceVec(name);
236}
TemplateVec< GeoLib::Surface > SurfaceVec
Definition SurfaceVec.h:17

References _callbacks, and _sfc_vecs.

Referenced by appendSurfaceVec(), mergeSurfaces(), FileIO::Legacy::readGLIFileV4(), and FileIO::TetGenInterface::readTetGenGeometry().

◆ appendPolylineVec()

bool GeoLib::GEOObjects::appendPolylineVec ( const std::vector< Polyline * > & polylines,
const std::string & name )

copies the pointers to the polylines in the vector to the PolylineVec with provided name. the pointers are managed by the GEOObjects, i.e. GEOObjects will delete the Polylines at the end of its scope

Parameters
polylinesthe vector with polylines
namethe name of the internal PolylineVec
Returns
true if the polylines are appended, false if the PolylineVec with the corresponding name does not exist

Definition at line 160 of file GEOObjects.cpp.

162{
163 // find an already existing PolylineVec object the given polylines will be
164 // appended to
165 auto polyline_vec_it = findVectorByName(_ply_vecs, name);
166 if (polyline_vec_it == _ply_vecs.end())
167 {
168 return false;
169 }
170 for (auto* polyline : polylines)
171 {
172 (*polyline_vec_it)->push_back(polyline);
173 }
174 _callbacks->appendPolylineVec(name);
175 return true;
176}
auto findVectorByName(Container const &container, std::string const &name)

References _callbacks, _ply_vecs, and GeoLib::findVectorByName().

◆ appendSurfaceVec()

bool GeoLib::GEOObjects::appendSurfaceVec ( const std::vector< Surface * > & surfaces,
const std::string & name )

Copies the surfaces in the vector to the SurfaceVec with the given name.

Parameters
surfacesthe vector with surfaces
namethe name of the internal PolylineVec
Returns
true if the surfaces are appended, false if the SurfaceVec with the corresponding name does not exist and the surfaces are added.

Definition at line 238 of file GEOObjects.cpp.

240{
241 auto surface_vec_to_append_it = findVectorByName(_sfc_vecs, name);
242 if (surface_vec_to_append_it != _sfc_vecs.end())
243 {
244 for (auto& surface : surfaces)
245 {
246 (*surface_vec_to_append_it)->push_back(surface);
247 }
248 _callbacks->appendSurfaceVec(name);
249 return true;
250 }
251
252 // the copy is needed because addSurfaceVec is passing it to SurfaceVec
253 // ctor, which needs write access to the surface vector.
254 std::vector<GeoLib::Surface*> sfc(begin(surfaces), end(surfaces));
255 addSurfaceVec(std::move(sfc), name, SurfaceVec::NameIdMap{});
256 return false;
257}
void addSurfaceVec(std::vector< Surface * > &&sfc, const std::string &name, SurfaceVec::NameIdMap &&sfc_names)

References _callbacks, _sfc_vecs, addSurfaceVec(), and GeoLib::findVectorByName().

◆ exists()

std::size_t GeoLib::GEOObjects::exists ( const std::string & geometry_name) const

Returns std::numeric_limits<std::size_t>::max() if no geometry of the given name exists or the index of the geometry in _pnt_vecs otherwise

Definition at line 733 of file GEOObjects.cpp.

734{
735 if (auto const it = findVectorByName(_pnt_vecs, geometry_name);
736 it != _pnt_vecs.end())
737 {
738 return std::distance(_pnt_vecs.begin(), it);
739 }
740
741 // HACK for enabling conversion of files without loading the associated
742 // geometry
743 if (_pnt_vecs.size() > 0 &&
744 _pnt_vecs[0]->getName() == "conversionTestRun#1")
745 {
746 return 1;
747 }
748
749 return std::numeric_limits<std::size_t>::max();
750}

References _pnt_vecs, and GeoLib::findVectorByName().

Referenced by getPointVec(), and getPointVecObj().

◆ getElementNameByID()

std::string GeoLib::GEOObjects::getElementNameByID ( const std::string & geometry_name,
GeoLib::GEOTYPE type,
std::size_t id ) const

Definition at line 344 of file GEOObjects.cpp.

347{
348 std::string name;
349 switch (type)
350 {
352 this->getPointVecObj(geometry_name)->getNameOfElementByID(id, name);
353 break;
355 this->getPolylineVecObj(geometry_name)
356 ->getNameOfElementByID(id, name);
357 break;
359 this->getSurfaceVecObj(geometry_name)
360 ->getNameOfElementByID(id, name);
361 }
362 return name;
363}
const PointVec * getPointVecObj(const std::string &name) const
SurfaceVec * getSurfaceVecObj(const std::string &name)
Returns the surface vector with the given name.
Definition GEOObjects.h:197
const PolylineVec * getPolylineVecObj(const std::string &name) const
bool getNameOfElementByID(std::size_t id, std::string &element_name) const

References GeoLib::TemplateVec< T >::getNameOfElementByID(), getPointVecObj(), getPolylineVecObj(), getSurfaceVecObj(), GeoLib::POINT, GeoLib::POLYLINE, and GeoLib::SURFACE.

◆ getGeometryNames()

std::vector< std::string > GeoLib::GEOObjects::getGeometryNames ( ) const

Returns the names of all geometry vectors.

Definition at line 331 of file GEOObjects.cpp.

332{
333 std::vector<std::string> names;
334 for (auto const* point : _pnt_vecs)
335 {
336 if (point->getType() == PointVec::PointType::POINT)
337 {
338 names.push_back(point->getName());
339 }
340 }
341 return names;
342}
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:220

References _pnt_vecs, and GeoLib::PointVec::POINT.

Referenced by GMSHPrefsDialog::GMSHPrefsDialog(), OGSFileConverter::convertGML2GLI(), FileIO::createSurface(), isUniquePointVecName(), main(), FileIO::readGeometryFromFile(), FileIO::XmlPrjInterface::write(), and FileIO::Legacy::writeAllDataToGLIFileV4().

◆ getGeoObject() [1/2]

GeoLib::GeoObject const * GeoLib::GEOObjects::getGeoObject ( const std::string & geo_name,
const std::string & geo_obj_name ) const

Return named (by the tuple geo_name and geo_obj_name) geo object.

Definition at line 705 of file GEOObjects.cpp.

707{
708 GeoLib::GeoObject const* geo_obj(
709 getGeoObject(geo_name, GeoLib::GEOTYPE::POINT, geo_obj_name));
710
711 if (!geo_obj)
712 {
713 geo_obj =
714 getGeoObject(geo_name, GeoLib::GEOTYPE::POLYLINE, geo_obj_name);
715 }
716
717 if (!geo_obj)
718 {
719 geo_obj =
720 getGeoObject(geo_name, GeoLib::GEOTYPE::SURFACE, geo_obj_name);
721 }
722
723 if (!geo_obj)
724 {
725 DBUG(
726 "GEOObjects::getGeoObject(): Could not find '{:s}' in geometry "
727 "{:s}.",
728 geo_obj_name, geo_name);
729 }
730 return geo_obj;
731}
const GeoLib::GeoObject * getGeoObject(const std::string &geo_name, GeoLib::GEOTYPE type, const std::string &geo_obj_name) const

References DBUG(), getGeoObject(), GeoLib::POINT, GeoLib::POLYLINE, and GeoLib::SURFACE.

◆ getGeoObject() [2/2]

const GeoLib::GeoObject * GeoLib::GEOObjects::getGeoObject ( const std::string & geo_name,
GeoLib::GEOTYPE type,
const std::string & geo_obj_name ) const

Returns the geo object for a geometric item of the given name and type for the associated geometry.

Definition at line 648 of file GEOObjects.cpp.

652{
653 GeoLib::GeoObject* geo_obj(nullptr);
654 switch (type)
655 {
657 {
658 GeoLib::PointVec const* pnt_vec(getPointVecObj(geo_name));
659 if (pnt_vec)
660 {
661 geo_obj = const_cast<GeoLib::GeoObject*>(
662 dynamic_cast<GeoLib::GeoObject const*>(
663 pnt_vec->getElementByName(geo_obj_name)));
664 }
665 break;
666 }
668 {
669 GeoLib::PolylineVec const* ply_vec(getPolylineVecObj(geo_name));
670 if (ply_vec)
671 {
672 geo_obj = const_cast<GeoLib::GeoObject*>(
673 dynamic_cast<GeoLib::GeoObject const*>(
674 ply_vec->getElementByName(geo_obj_name)));
675 }
676 break;
677 }
679 {
680 GeoLib::SurfaceVec const* sfc_vec(getSurfaceVecObj(geo_name));
681 if (sfc_vec)
682 {
683 geo_obj = const_cast<GeoLib::GeoObject*>(
684 dynamic_cast<GeoLib::GeoObject const*>(
685 sfc_vec->getElementByName(geo_obj_name)));
686 }
687 break;
688 }
689 default:
690 ERR("GEOObjects::getGeoObject(): geometric type not handled.");
691 return nullptr;
692 };
693
694 if (!geo_obj)
695 {
696 DBUG(
697 "GEOObjects::getGeoObject(): Could not find {:s} '{:s}' in "
698 "geometry.",
700 geo_obj_name);
701 }
702 return geo_obj;
703}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
std::string convertGeoTypeToString(GEOTYPE geo_type)
Definition GeoType.cpp:12

References GeoLib::convertGeoTypeToString(), DBUG(), ERR(), GeoLib::TemplateVec< T >::getElementByName(), getPointVecObj(), getPolylineVecObj(), getSurfaceVecObj(), GeoLib::POINT, GeoLib::POLYLINE, and GeoLib::SURFACE.

Referenced by getGeoObject().

◆ getPoints()

std::vector< PointVec * > const & GeoLib::GEOObjects::getPoints ( ) const
inline

Read access to points w/o using a name.

Definition at line 286 of file GEOObjects.h.

286{ return _pnt_vecs; }

References _pnt_vecs.

Referenced by MeshGeoToolsLib::constructAdditionalMeshesFromGeoObjects(), and anonymous_namespace{ProjectData.cpp}::readMeshes().

◆ getPointVec()

const std::vector< Point * > * GeoLib::GEOObjects::getPointVec ( const std::string & name) const

Returns the point vector with the given name.

Definition at line 61 of file GEOObjects.cpp.

63{
64 std::size_t const idx = this->exists(name);
65 if (idx != std::numeric_limits<std::size_t>::max())
66 {
67 return &_pnt_vecs[idx]->getVector();
68 }
69
70 DBUG("GEOObjects::getPointVec() - No entry found with name '{:s}'.", name);
71 return nullptr;
72}
std::size_t exists(const std::string &geometry_name) const

References _pnt_vecs, DBUG(), and exists().

Referenced by MeshToolsLib::convertMeshToGeo(), createGeometries(), GeoLib::Grid< POINT >::createGridGeometry(), FileIO::createSurface(), main(), mergeGeometries(), FileIO::TetGenInterface::readTetGenGeometry(), and FileIO::TetGenInterface::writeTetGenSmesh().

◆ getPointVecObj() [1/2]

PointVec * GeoLib::GEOObjects::getPointVecObj ( const std::string & name)
inline

Returns a pointer to a PointVec object for the given name.

Definition at line 104 of file GEOObjects.h.

105 {
106 return const_cast<PointVec*>(
107 static_cast<const GEOObjects&>(*this).getPointVecObj(name));
108 }

References GEOObjects().

◆ getPointVecObj() [2/2]

const PointVec * GeoLib::GEOObjects::getPointVecObj ( const std::string & name) const

search and returns the PointVec object with the given name.

Parameters
namethe name of the PointVec object
Returns
the PointVec object stored in GEOObjects

Definition at line 74 of file GEOObjects.cpp.

75{
76 std::size_t const idx = this->exists(name);
77 if (idx != std::numeric_limits<std::size_t>::max())
78 {
79 return _pnt_vecs[idx];
80 }
81
82 DBUG("GEOObjects::getPointVecObj() - No entry found with name '{:s}'.",
83 name);
84 return nullptr;
85}

References _pnt_vecs, DBUG(), and exists().

Referenced by MeshToolsLib::convertMeshToGeo(), FileIO::SwmmInterface::convertSwmmInputToGeometry(), generatePolylineGeometry(), generateQuadGeometry(), GeoLib::geoPointsToStations(), getElementNameByID(), getGeoObject(), FileIO::GMSH::GMSHAdaptiveMeshDensity::getQuadTreeGeometry(), main(), mergePoints(), mergePolylines(), mergeSurfaces(), FileIO::Legacy::readGLIFileV4(), FileIO::TetGenInterface::readTetGenGeometry(), FileIO::Legacy::writeAllDataToGLIFileV4(), writeBCsAndGeometry(), and FileIO::Legacy::writeGLIFileV4().

◆ getPolylines()

std::vector< PolylineVec * > const & GeoLib::GEOObjects::getPolylines ( ) const
inline

Read access to polylines w/o using a name.

Definition at line 288 of file GEOObjects.h.

288{ return _ply_vecs; }

References _ply_vecs.

Referenced by MeshGeoToolsLib::constructAdditionalMeshesFromGeoObjects(), and anonymous_namespace{ProjectData.cpp}::readMeshes().

◆ getPolylineVec()

const std::vector< Polyline * > * GeoLib::GEOObjects::getPolylineVec ( const std::string & name) const

Returns the polyline vector with the given name.

Definition at line 178 of file GEOObjects.cpp.

180{
181 std::size_t size(_ply_vecs.size());
182 for (std::size_t i = 0; i < size; i++)
183 {
184 if (_ply_vecs[i]->getName() == name)
185 {
186 return &_ply_vecs[i]->getVector();
187 }
188 }
189
190 DBUG("GEOObjects::getPolylineVec() - No entry found with name '{:s}'.",
191 name);
192 return nullptr;
193}
std::string getName(std::string const &line)
Returns the name/title from the "Zone"-description.
constexpr int size(int const displacement_dim)
Vectorized tensor size for given displacement dimension.

References _ply_vecs, DBUG(), and getName().

Referenced by main(), mergePolylines(), and FileIO::Legacy::readGLIFileV4().

◆ getPolylineVecObj() [1/2]

PolylineVec * GeoLib::GEOObjects::getPolylineVecObj ( const std::string & name)
inline

Returns a pointer to a PolylineVec object for the given name.

Definition at line 165 of file GEOObjects.h.

166 {
167 return const_cast<PolylineVec*>(
168 static_cast<const GEOObjects&>(*this).getPolylineVecObj(name));
169 }

References GEOObjects().

◆ getPolylineVecObj() [2/2]

const PolylineVec * GeoLib::GEOObjects::getPolylineVecObj ( const std::string & name) const

Returns a pointer to a PolylineVec object for the given name as a const.

Parameters
namethe name of the vector of polylines
Returns
PolylineVec object

Definition at line 195 of file GEOObjects.cpp.

196{
197 std::size_t size(_ply_vecs.size());
198 for (std::size_t i = 0; i < size; i++)
199 {
200 if (_ply_vecs[i]->getName() == name)
201 {
202 return _ply_vecs[i];
203 }
204 }
205
206 DBUG("GEOObjects::getPolylineVecObj() - No entry found with name '{:s}'.",
207 name);
208 return nullptr;
209}

References _ply_vecs, DBUG(), and getName().

Referenced by getElementNameByID(), getGeoObject(), main(), GeoLib::markUnusedPoints(), mergePolylines(), FileIO::Legacy::readGLIFileV4(), FileIO::Legacy::writeAllDataToGLIFileV4(), and FileIO::Legacy::writeGLIFileV4().

◆ getStationVec()

const std::vector< GeoLib::Point * > * GeoLib::GEOObjects::getStationVec ( const std::string & name) const

Returns the station vector with the given name.

Definition at line 122 of file GEOObjects.cpp.

124{
125 auto const it =
126 std::find_if(begin(_pnt_vecs), end(_pnt_vecs),
127 [&name](PointVec const* const p)
128 {
129 return p->getName() == name &&
130 p->getType() == PointVec::PointType::STATION;
131 });
132 if (it != end(_pnt_vecs))
133 {
134 return &(*it)->getVector();
135 }
136 DBUG("GEOObjects::getStationVec() - No entry found with name '{:s}'.",
137 name);
138 return nullptr;
139}

References _pnt_vecs, DBUG(), GeoLib::TemplateVec< T >::getName(), GeoLib::PointVec::getType(), and GeoLib::PointVec::STATION.

Referenced by FileIO::Legacy::writeAllDataToGLIFileV4().

◆ getStationVectorNames()

void GeoLib::GEOObjects::getStationVectorNames ( std::vector< std::string > & names) const

Returns the names of all station vectors.

Definition at line 320 of file GEOObjects.cpp.

321{
322 for (auto const* point : _pnt_vecs)
323 {
324 if (point->getType() == PointVec::PointType::STATION)
325 {
326 names.push_back(point->getName());
327 }
328 }
329}

References _pnt_vecs, and GeoLib::PointVec::STATION.

Referenced by GMSHPrefsDialog::GMSHPrefsDialog(), FileIO::XmlPrjInterface::write(), and FileIO::Legacy::writeAllDataToGLIFileV4().

◆ getSurfaces()

std::vector< SurfaceVec * > const & GeoLib::GEOObjects::getSurfaces ( ) const
inline

Read access to surfaces w/o using a name.

Definition at line 290 of file GEOObjects.h.

290{ return _sfc_vecs; }

References _sfc_vecs.

Referenced by MeshGeoToolsLib::constructAdditionalMeshesFromGeoObjects(), and anonymous_namespace{ProjectData.cpp}::readMeshes().

◆ getSurfaceVec()

const std::vector< Surface * > * GeoLib::GEOObjects::getSurfaceVec ( const std::string & name) const

Returns the surface vector with the given name as a const.

Definition at line 259 of file GEOObjects.cpp.

261{
262 auto surface_vec_it = findVectorByName(_sfc_vecs, name);
263 if (surface_vec_it != _sfc_vecs.end())
264 {
265 return &(*surface_vec_it)->getVector();
266 }
267 DBUG("GEOObjects::getSurfaceVec() - No entry found with name '{:s}'.",
268 name);
269 return nullptr;
270}

References _sfc_vecs, DBUG(), and GeoLib::findVectorByName().

Referenced by main(), mergeSurfaces(), and FileIO::TetGenInterface::writeTetGenSmesh().

◆ getSurfaceVecObj() [1/2]

SurfaceVec * GeoLib::GEOObjects::getSurfaceVecObj ( const std::string & name)
inline

Returns the surface vector with the given name.

Definition at line 197 of file GEOObjects.h.

198 {
199 return const_cast<SurfaceVec*>(
200 static_cast<const GEOObjects&>(*this).getSurfaceVecObj(name));
201 }

References GEOObjects().

Referenced by getElementNameByID(), getGeoObject(), GeoLib::markUnusedPoints(), mergeSurfaces(), FileIO::Legacy::writeAllDataToGLIFileV4(), and FileIO::Legacy::writeGLIFileV4().

◆ getSurfaceVecObj() [2/2]

const SurfaceVec * GeoLib::GEOObjects::getSurfaceVecObj ( const std::string & name) const

Returns a pointer to a SurfaceVec object for the given name. The class SurfaceVec stores the relation between surfaces and the names of the surfaces.

Parameters
namethe name of the vector of surfaces (the project name)
Returns
SurfaceVec object

Definition at line 288 of file GEOObjects.cpp.

289{
290 auto surface_vec_it = findVectorByName(_sfc_vecs, name);
291 if (surface_vec_it != _sfc_vecs.end())
292 {
293 return *surface_vec_it;
294 }
295 DBUG("GEOObjects::getSurfaceVecObj() - No entry found with name '{:s}'.",
296 name);
297 return nullptr;
298}

References _sfc_vecs, DBUG(), and GeoLib::findVectorByName().

◆ isPntVecUsed()

bool GeoLib::GEOObjects::isPntVecUsed ( const std::string & name) const

Checks if the point vector with the given name is referenced in a polyline- or surface vector.

Definition at line 313 of file GEOObjects.cpp.

314{
315 // search for dependent PolylineVecs or SurfaceVecs
316 return findVectorByName(_ply_vecs, name) != _ply_vecs.end() ||
317 findVectorByName(_sfc_vecs, name) != _sfc_vecs.end();
318}

References _ply_vecs, _sfc_vecs, and GeoLib::findVectorByName().

Referenced by removePointVec().

◆ isUniquePointVecName()

bool GeoLib::GEOObjects::isUniquePointVecName ( std::string & name) const

Determines if the given name is unique among all the names in point vectors and creates a new name if this is not the case. The new name is then simply "name + x", where x>1 is the smallest number that creates a unique name (i.e. "name-2", "name-3", etc.)

Parameters
nameOriginal name of the list, this name might be changed within this method if necessary.
Returns
true if the name was unique, false if a new name has been generated

Definition at line 300 of file GEOObjects.cpp.

301{
302 std::vector<std::string> const existing_names = getGeometryNames();
303 auto const& unique_name = BaseLib::getUniqueName(existing_names, name);
304
305 if (unique_name != name)
306 {
307 name = unique_name;
308 return false;
309 }
310 return true;
311}
std::vector< std::string > getGeometryNames() const
Returns the names of all geometry vectors.
std::string getUniqueName(std::vector< std::string > const &existing_names, std::string const &input_name)
Append '-' and a number such that the name is unique.

References getGeometryNames(), and BaseLib::getUniqueName().

Referenced by addPointVec(), and addStationVec().

◆ mergeGeometries()

int GeoLib::GEOObjects::mergeGeometries ( std::vector< std::string > const & geo_names,
std::string & merged_geo_name )

Method mergeGeometries merges the geometries that are given by the names in the vector. Stations points are not included in the resulting merged geometry.

Parameters
geo_namesthe names of the geometries that are to be merged
merged_geo_namethe name of the resulting geometry
Returns
0 if success, 1 if no point-list is found for at least one of the geometries and 2 if the mergelist only contains less than two geometry

Definition at line 365 of file GEOObjects.cpp.

367{
368 const std::size_t n_geo_names(geo_names.size());
369
370 if (n_geo_names < 2)
371 {
372 return 2;
373 }
374
375 std::vector<std::size_t> pnt_offsets(n_geo_names, 0);
376
377 mergePoints(geo_names, merged_geo_name, pnt_offsets);
378
379 mergePolylines(geo_names, merged_geo_name, pnt_offsets);
380
381 mergeSurfaces(geo_names, merged_geo_name, pnt_offsets);
382
383 return 0;
384}
void mergeSurfaces(std::vector< std::string > const &geo_names, std::string const &merged_geo_name, std::vector< std::size_t > const &pnt_offsets)
void mergePolylines(std::vector< std::string > const &geo_names, std::string const &merged_geo_name, std::vector< std::size_t > const &pnt_offsets)
void mergePoints(std::vector< std::string > const &geo_names, std::string &merged_geo_name, std::vector< std::size_t > &pnt_offsets)

References mergePoints(), mergePolylines(), and mergeSurfaces().

Referenced by GeoLib::Grid< POINT >::createGridGeometry(), FileIO::createSurface(), and main().

◆ mergePoints()

void GeoLib::GEOObjects::mergePoints ( std::vector< std::string > const & geo_names,
std::string & merged_geo_name,
std::vector< std::size_t > & pnt_offsets )
private

Method merges points from different geometries into one geometry. This is a helper method for GEOObjects::mergeGeometries().

Parameters
geo_namesThe vector of names of the geometries to merge.
merged_geo_nameThe (new) name of the geometry resulting from merging.
pnt_offsetsoffsets in the merged vector storing the points

Definition at line 386 of file GEOObjects.cpp.

389{
390 const std::size_t n_geo_names(geo_names.size());
391
392 std::vector<GeoLib::Point*> merged_points;
393 PointVec::NameIdMap merged_pnt_names;
394
395 for (std::size_t j(0); j < n_geo_names; ++j)
396 {
397 GeoLib::PointVec const* const pnt_vec(
398 this->getPointVecObj(geo_names[j]));
399 if (pnt_vec == nullptr)
400 {
401 continue;
402 }
403 auto const& pnts(pnt_vec->getVector());
404
405 // do not consider stations
406 if (dynamic_cast<GeoLib::Station*>(pnts[0]))
407 {
408 continue;
409 }
410
411 std::size_t const n_pnts(pnts.size());
412 for (std::size_t k(0); k < n_pnts; ++k)
413 {
414 merged_points.push_back(
415 new GeoLib::Point(*pnts[k], pnt_offsets[j] + k));
416 std::string const& item_name(pnt_vec->getItemNameByID(k));
417 if (!item_name.empty())
418 {
419 merged_pnt_names.insert(
420 std::make_pair(item_name, pnt_offsets[j] + k));
421 }
422 }
423 if (n_geo_names - 1 > j)
424 {
425 pnt_offsets[j + 1] = n_pnts + pnt_offsets[j];
426 }
427 }
428
429 addPointVec(std::move(merged_points), merged_geo_name,
430 std::move(merged_pnt_names), 1e-6);
431}

References addPointVec(), GeoLib::PointVec::getItemNameByID(), getPointVecObj(), and GeoLib::TemplateVec< T >::getVector().

Referenced by mergeGeometries().

◆ mergePolylines()

void GeoLib::GEOObjects::mergePolylines ( std::vector< std::string > const & geo_names,
std::string const & merged_geo_name,
std::vector< std::size_t > const & pnt_offsets )
private

Method merges GeoLib::Polylines from different geometries into one geometry. There isn't a check if the polyline is unique within the given data sets. If there are two polylines with the same name, the second occurrence will lost their name. This is a helper for GEOObjects::mergeGeometries() and should be used only after GEOObjects::mergePoints() is executed.

Parameters
geo_namesThe vector of names of the geometries to merge.
merged_geo_nameThe (new) name of the geometry resulting from merging.
pnt_offsetsoffsets in the merged vector storing the points.

Definition at line 433 of file GEOObjects.cpp.

436{
437 const std::size_t n_geo_names(geo_names.size());
438 std::vector<std::size_t> ply_offsets(n_geo_names, 0);
439
440 std::vector<GeoLib::Polyline*> merged_polylines;
441 PolylineVec::NameIdMap merged_ply_names;
442
443 auto const& merged_points(getPointVecObj(merged_geo_name)->getVector());
444 std::vector<std::size_t> const& id_map(
445 this->getPointVecObj(merged_geo_name)->getIDMap());
446
447 for (std::size_t j(0); j < n_geo_names; j++)
448 {
449 const std::vector<GeoLib::Polyline*>* plys(
450 this->getPolylineVec(geo_names[j]));
451 if (plys)
452 {
453 std::string tmp_name;
454 for (std::size_t k(0); k < plys->size(); k++)
455 {
456 auto* kth_ply_new(new GeoLib::Polyline(merged_points));
457 GeoLib::Polyline const* const kth_ply_old((*plys)[k]);
458 const std::size_t size_of_kth_ply(
459 kth_ply_old->getNumberOfPoints());
460 // copy point ids from old ply to new ply (considering the
461 // offset)
462 for (std::size_t i(0); i < size_of_kth_ply; i++)
463 {
464 kth_ply_new->addPoint(
465 id_map[pnt_offsets[j] + kth_ply_old->getPointID(i)]);
466 }
467 merged_polylines.push_back(kth_ply_new);
468 if (this->getPolylineVecObj(geo_names[j])
469 ->getNameOfElementByID(k, tmp_name))
470 {
471 merged_ply_names.emplace(tmp_name, ply_offsets[j] + k);
472 }
473 }
474 if (n_geo_names - 1 > j)
475 {
476 ply_offsets[j + 1] = plys->size() + ply_offsets[j];
477 }
478 }
479 }
480
481 if (!merged_polylines.empty())
482 {
483 this->addPolylineVec(std::move(merged_polylines), merged_geo_name,
484 std::move(merged_ply_names));
485 }
486}
void addPolylineVec(std::vector< Polyline * > &&lines, std::string const &name, PolylineVec::NameIdMap &&ply_names)
const std::vector< Polyline * > * getPolylineVec(const std::string &name) const

References addPolylineVec(), GeoLib::Polyline::getNumberOfPoints(), GeoLib::Polyline::getPointID(), getPointVecObj(), getPolylineVec(), and getPolylineVecObj().

Referenced by mergeGeometries().

◆ mergeSurfaces()

void GeoLib::GEOObjects::mergeSurfaces ( std::vector< std::string > const & geo_names,
std::string const & merged_geo_name,
std::vector< std::size_t > const & pnt_offsets )
private

Method merges GeoLib::Surfaces from different geometries into one geometry. There isn't a check if the GeoLib::Surface is unique within the given data sets. This is a helper for GEOObjects::mergeGeometries() and should be used only after GEOObjects::mergePoints() is executed.

Parameters
geo_namesThe vector of names of the geometries to merge.
merged_geo_nameThe (new) name of the geometry resulting from merging.
pnt_offsetsoffsets in the merged vector storing the points.

Definition at line 488 of file GEOObjects.cpp.

491{
492 auto const& merged_points(getPointVecObj(merged_geo_name)->getVector());
493 std::vector<std::size_t> const& id_map(
494 this->getPointVecObj(merged_geo_name)->getIDMap());
495
496 const std::size_t n_geo_names(geo_names.size());
497 std::vector<std::size_t> sfc_offsets(n_geo_names, 0);
498 std::vector<GeoLib::Surface*> merged_sfcs;
499 SurfaceVec::NameIdMap merged_sfc_names;
500 for (std::size_t j(0); j < n_geo_names; j++)
501 {
502 const std::vector<GeoLib::Surface*>* sfcs(
503 this->getSurfaceVec(geo_names[j]));
504 if (sfcs)
505 {
506 std::string tmp_name;
507 for (std::size_t k(0); k < sfcs->size(); k++)
508 {
509 auto* kth_sfc_new(new GeoLib::Surface(merged_points));
510 GeoLib::Surface const* const kth_sfc_old((*sfcs)[k]);
511 const std::size_t size_of_kth_sfc(
512 kth_sfc_old->getNumberOfTriangles());
513 // clone surface elements using new ids
514 for (std::size_t i(0); i < size_of_kth_sfc; i++)
515 {
516 const GeoLib::Triangle* tri((*kth_sfc_old)[i]);
517 const std::size_t id0(id_map[pnt_offsets[j] + (*tri)[0]]);
518 const std::size_t id1(id_map[pnt_offsets[j] + (*tri)[1]]);
519 const std::size_t id2(id_map[pnt_offsets[j] + (*tri)[2]]);
520 kth_sfc_new->addTriangle(id0, id1, id2);
521 }
522 merged_sfcs.push_back(kth_sfc_new);
523
524 if (this->getSurfaceVecObj(geo_names[j])
525 ->getNameOfElementByID(k, tmp_name))
526 {
527 merged_sfc_names.emplace(tmp_name, sfc_offsets[j] + k);
528 }
529 }
530 if (n_geo_names - 1 > j)
531 {
532 sfc_offsets[j + 1] = sfcs->size() + sfc_offsets[j];
533 }
534 }
535 }
536 if (!merged_sfcs.empty())
537 {
538 this->addSurfaceVec(std::move(merged_sfcs), merged_geo_name,
539 std::move(merged_sfc_names));
540 }
541}
const std::vector< Surface * > * getSurfaceVec(const std::string &name) const
Returns the surface vector with the given name as a const.

References addSurfaceVec(), GeoLib::Surface::getNumberOfTriangles(), getPointVecObj(), getSurfaceVec(), and getSurfaceVecObj().

Referenced by mergeGeometries().

◆ removePointVec()

bool GeoLib::GEOObjects::removePointVec ( const std::string & name)

If there exists no dependencies the point vector with the given name from GEOObjects will be removed and the method returns true, else the return value is false.

Definition at line 87 of file GEOObjects.cpp.

88{
89 if (isPntVecUsed(name))
90 {
91 DBUG(
92 "GEOObjects::removePointVec() - There are still Polylines or "
93 "Surfaces depending on these points.");
94 return false;
95 }
96
97 for (auto it(_pnt_vecs.begin()); it != _pnt_vecs.end(); ++it)
98 {
99 if ((*it)->getName() == name)
100 {
101 _callbacks->removePointVec(name);
102 delete *it;
103 _pnt_vecs.erase(it);
104 return true;
105 }
106 }
107 DBUG("GEOObjects::removePointVec() - No entry found with name '{:s}'.",
108 name);
109 return false;
110}
bool isPntVecUsed(const std::string &name) const

References _callbacks, _pnt_vecs, DBUG(), and isPntVecUsed().

Referenced by consolidateGeometry(), OGSFileConverter::convertGLI2GML(), OGSFileConverter::convertGML2GLI(), FileIO::SwmmInterface::convertSwmmInputToGeometry(), FileIO::createSurface(), and removeStationVec().

◆ removePolylineVec()

bool GeoLib::GEOObjects::removePolylineVec ( const std::string & name)

If no Surfaces depends on the vector of Polylines with the given name it will be removed and the method returns true, else the return value is false.

Definition at line 211 of file GEOObjects.cpp.

212{
213 _callbacks->removePolylineVec(name);
214 auto it = std::find_if(_ply_vecs.begin(), _ply_vecs.end(),
215 [&name](PolylineVec const* const v)
216 { return v->getName() == name; });
217 if (it != _ply_vecs.end())
218 {
219 delete *it;
220 _ply_vecs.erase(it);
221 return true;
222 }
223
224 DBUG("GEOObjects::removePolylineVec() - No entry found with name '{:s}'.",
225 name);
226 return false;
227}

References _callbacks, _ply_vecs, and DBUG().

Referenced by consolidateGeometry(), OGSFileConverter::convertGLI2GML(), OGSFileConverter::convertGML2GLI(), and FileIO::createSurface().

◆ removeStationVec()

bool GeoLib::GEOObjects::removeStationVec ( const std::string & name)
inline

Removes the station vector with the given name from GEOObjects.

Definition at line 124 of file GEOObjects.h.

125 {
126 _callbacks->removeStationVec(name);
127 return removePointVec(name);
128 }
bool removePointVec(const std::string &name)

References _callbacks, and removePointVec().

◆ removeSurfaceVec()

bool GeoLib::GEOObjects::removeSurfaceVec ( const std::string & name)

removes the vector of Surfaces with the given name

Definition at line 272 of file GEOObjects.cpp.

273{
274 _callbacks->removeSurfaceVec(name);
275 auto const it = findVectorByName(_sfc_vecs, name);
276 if (it != _sfc_vecs.end())
277 {
278 delete *it;
279 _sfc_vecs.erase(it);
280 return true;
281 }
282
283 DBUG("GEOObjects::removeSurfaceVec() - No entry found with name '{:s}'.",
284 name);
285 return false;
286}

References _callbacks, _sfc_vecs, DBUG(), and GeoLib::findVectorByName().

Referenced by OGSFileConverter::convertGLI2GML(), OGSFileConverter::convertGML2GLI(), and FileIO::createSurface().

◆ renameGeometry()

void GeoLib::GEOObjects::renameGeometry ( std::string const & old_name,
std::string const & new_name )

Renames an existing geometry, i.e. renames the internal PointVec, PolylineVec and the SurfaceVec objects from old_name to new_name. If no such PointVec, PolylineVec and SurfaceVec objects exist nothing will happen.

Definition at line 543 of file GEOObjects.cpp.

545{
546 _callbacks->renameGeometry(old_name, new_name);
547
548 auto rename = [&old_name, &new_name](auto const& container)
549 {
550 auto it = findVectorByName(container, old_name);
551 if (it != container.end())
552 {
553 (*it)->setName(new_name);
554 }
555 };
556
557 rename(_pnt_vecs);
558 rename(_ply_vecs);
559 rename(_sfc_vecs);
560}

References _callbacks, _ply_vecs, _pnt_vecs, _sfc_vecs, and GeoLib::findVectorByName().

Referenced by FileIO::createSurface().

Member Data Documentation

◆ _callbacks

◆ _ply_vecs

std::vector<PolylineVec*> GeoLib::GEOObjects::_ply_vecs
private

◆ _pnt_vecs

std::vector<PointVec*> GeoLib::GEOObjects::_pnt_vecs
private

◆ _sfc_vecs

std::vector<SurfaceVec*> GeoLib::GEOObjects::_sfc_vecs
private

◆ addPolylineVecCallback

std::function<void(std::string const&)> GeoLib::GEOObjects::addPolylineVecCallback
Initial value:
=
[](std::string const& ) {}

Definition at line 294 of file GEOObjects.h.

295 {};

◆ addSurfaceVecCallback

std::function<void(std::string const&)> GeoLib::GEOObjects::addSurfaceVecCallback
Initial value:
=
[](std::string const& ) {}

Definition at line 303 of file GEOObjects.h.

304 {};

◆ appendPolylineVecCallback

std::function<void(std::string const&)> GeoLib::GEOObjects::appendPolylineVecCallback
Initial value:
=
[](std::string const& ) {}

Definition at line 297 of file GEOObjects.h.

298 {};

◆ appendSurfaceVecCallback

std::function<void(std::string const&)> GeoLib::GEOObjects::appendSurfaceVecCallback
Initial value:
=
[](std::string const& ) {}

Definition at line 306 of file GEOObjects.h.

307 {};

◆ removePolylineVecCallback

std::function<void(std::string const&)> GeoLib::GEOObjects::removePolylineVecCallback
Initial value:
=
[](std::string const& ) {}

Definition at line 300 of file GEOObjects.h.

301 {};

◆ removeSurfaceVecCallback

std::function<void(std::string const&)> GeoLib::GEOObjects::removeSurfaceVecCallback
Initial value:
=
[](std::string const& ) {}

Definition at line 309 of file GEOObjects.h.

310 {};

The documentation for this class was generated from the following files: