OGS
GMSHPolygonTree.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 <vector>
7#include <string>
8
10#include "GMSHPoint.h"
11#include "GMSHLine.h"
12
14
15namespace GeoLib
16{
17class GEOObjects;
18class Polygon;
21}
22
23namespace FileIO
24{
25namespace GMSH
26{
27
29public:
32 std::string const& geo_name,
33 GMSHMeshDensityStrategy& mesh_density_strategy);
34 ~GMSHPolygonTree() override;
35
37 void markSharedSegments();
38
46 bool insertStation(GeoLib::Point const* station);
61
68
73 void createGMSHPoints(std::vector<GMSHPoint*> & gmsh_pnts) const;
74
75 virtual void writeLineLoop(std::size_t& line_offset,
76 std::size_t& sfc_offset, std::ostream& out,
77 bool const write_physical) const;
78 void writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
79 virtual void writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
80 void writeStations(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
81 void writeAdditionalPointData(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
82
83private:
85 std::vector<GeoLib::Point const*>& pnts) const;
87 std::vector<GeoLib::Point const*>& stations) const;
91
93 std::string const& _geo_name;
94 std::vector<GeoLib::Point const*> _stations;
95 std::vector<GeoLib::PolylineWithSegmentMarker*> _plys;
96 std::vector<GMSHLine*> _gmsh_lines_for_constraints;
97
99};
100
101} // end namespace GMSH
102} // end namespace FileIO
void writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream &out) const
std::vector< GeoLib::PolylineWithSegmentMarker * > _plys
GMSHMeshDensityStrategy & _mesh_density_strategy
void insertPolyline(GeoLib::PolylineWithSegmentMarker *ply)
virtual void writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream &out) const
std::string const & _geo_name
void writeAdditionalPointData(std::size_t &pnt_id_offset, std::size_t sfc_number, std::ostream &out) const
std::vector< GeoLib::Point const * > _stations
GMSHPolygonTree(GeoLib::PolygonWithSegmentMarker *polygon, GMSHPolygonTree *parent, GeoLib::GEOObjects &geo_objs, std::string const &geo_name, GMSHMeshDensityStrategy &mesh_density_strategy)
void getStationsInsideSubPolygons(std::vector< GeoLib::Point const * > &stations) const
void writeStations(std::size_t &pnt_id_offset, std::size_t sfc_number, std::ostream &out) const
void createGMSHPoints(std::vector< GMSHPoint * > &gmsh_pnts) const
void getPointsFromSubPolygons(std::vector< GeoLib::Point const * > &pnts) const
void checkIntersectionsSegmentExistingPolylines(GeoLib::PolylineWithSegmentMarker *ply, GeoLib::Polyline::SegmentIterator const &seg_it)
GeoLib::GEOObjects & _geo_objs
bool insertStation(GeoLib::Point const *station)
std::vector< GMSHLine * > _gmsh_lines_for_constraints
virtual void writeLineLoop(std::size_t &line_offset, std::size_t &sfc_offset, std::ostream &out, bool const write_physical) const
Container class for geometric objects.
Definition GEOObjects.h:46
This class computes and stores the topological relations between polygons. Every node of the SimplePo...
const SimplePolygonTree * parent() const
Polygon const & polygon() const