OGS
PolylineWithSegmentMarker.cpp
Go to the documentation of this file.
1 
16 
17 namespace GeoLib
18 {
20  GeoLib::Polyline const& polyline)
21  : GeoLib::Polyline(polyline), _marker(polyline.getNumberOfSegments(), false)
22 {
23 }
24 
25 void PolylineWithSegmentMarker::markSegment(std::size_t seg_num, bool mark_val)
26 {
27  _marker[seg_num] = mark_val;
28 }
29 
30 bool PolylineWithSegmentMarker::isSegmentMarked(std::size_t seg_num) const
31 {
32  return _marker[seg_num];
33 }
34 
35 bool PolylineWithSegmentMarker::addPoint(std::size_t pnt_id)
36 {
37  if (Polyline::addPoint(pnt_id))
38  {
39  _marker.push_back(false);
40  return true;
41  }
42  return false;
43 }
44 
45 bool PolylineWithSegmentMarker::insertPoint(std::size_t pos, std::size_t pnt_id)
46 {
47  if (Polyline::insertPoint(pos, pnt_id))
48  {
49  _marker.insert(_marker.begin() + pos, _marker[pos]);
50  return true;
51  }
52  return false;
53 }
54 
55 } // namespace GeoLib
Definition of the PolylineWithSegmentMarker class.
bool isSegmentMarked(std::size_t seg_num) const
void markSegment(std::size_t seg_num, bool mark_val=true)
PolylineWithSegmentMarker(GeoLib::Polyline const &polyline)
bool insertPoint(std::size_t pos, std::size_t pnt_id) override
bool addPoint(std::size_t pnt_id) override
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