OGS
GMSHPolygonTree.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <vector>
14 #include <string>
15 
17 #include "GMSHPoint.h"
18 #include "GMSHLine.h"
19 
21 
22 namespace GeoLib
23 {
24 class GEOObjects;
25 class Polygon;
26 class PolylineWithSegmentMarker;
27 class PolygonWithSegmentMarker;
28 }
29 
30 namespace FileIO
31 {
32 namespace GMSH
33 {
34 
36 public:
39  std::string const& geo_name,
40  GMSHMeshDensityStrategy& mesh_density_strategy);
41  ~GMSHPolygonTree() override;
42 
44  void markSharedSegments();
45 
53  bool insertStation(GeoLib::Point const* station);
68 
75 
80  void createGMSHPoints(std::vector<GMSHPoint*> & gmsh_pnts) const;
81 
82  virtual void writeLineLoop(std::size_t& line_offset,
83  std::size_t& sfc_offset, std::ostream& out,
84  bool const write_physical) const;
85  void writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
86  virtual void writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const;
87  void writeStations(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
88  void writeAdditionalPointData(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const;
89 
90 private:
92  std::vector<GeoLib::Point const*>& pnts) const;
94  std::vector<GeoLib::Point const*>& stations) const;
97  GeoLib::Polyline::SegmentIterator const& seg_it);
98 
100  std::string const& _geo_name;
101  std::vector<GeoLib::Point const*> _stations;
102  std::vector<GeoLib::PolylineWithSegmentMarker*> _plys;
103  std::vector<GMSHLine*> _gmsh_lines_for_constraints;
104 
106 };
107 
108 } // end namespace GMSH
109 } // end namespace FileIO
Definition of the SimplePolygonTree class.
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:61
This class computes and stores the topological relations between polygons. Every node of the SimplePo...
const SimplePolygonTree * parent() const
Polygon const & polygon() const