OGS
PolygonWithSegmentMarker.cpp
Go to the documentation of this file.
1 
11 
12 namespace GeoLib
13 {
15  GeoLib::Polyline const& polyline)
16  : GeoLib::Polygon(polyline, true),
17  _marker(polyline.getNumberOfPoints(), false)
18 {
19 }
20 
21 void PolygonWithSegmentMarker::markSegment(std::size_t seg_num, bool mark_val)
22 {
23  _marker[seg_num] = mark_val;
24 }
25 
26 bool PolygonWithSegmentMarker::isSegmentMarked(std::size_t seg_num) const
27 {
28  return _marker[seg_num];
29 }
30 
31 bool PolygonWithSegmentMarker::addPoint(std::size_t pnt_id)
32 {
33  if (Polyline::addPoint(pnt_id))
34  {
35  _marker.push_back(false);
36  return true;
37  }
38  return false;
39 }
40 
41 bool PolygonWithSegmentMarker::insertPoint(std::size_t pos, std::size_t pnt_id)
42 {
43  if (Polyline::insertPoint(pos, pnt_id))
44  {
45  _marker.insert(_marker.begin() + pos, _marker[pos]);
46  return true;
47  }
48  return false;
49 }
50 
51 } // namespace GeoLib
bool isSegmentMarked(std::size_t seg_num) const
PolygonWithSegmentMarker(GeoLib::Polyline const &polyline)
bool insertPoint(std::size_t pos, std::size_t pnt_id) override
bool addPoint(std::size_t pnt_id) override
void markSegment(std::size_t seg_num, bool mark_val=true)
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
Definition: Polyline.h:53
virtual bool insertPoint(std::size_t pos, std::size_t pnt_id)
Definition: Polyline.cpp:55
virtual bool addPoint(std::size_t pnt_id)
Definition: Polyline.cpp:35