OGS
PolylineWithSegmentMarker.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6namespace GeoLib
7{
13
14void PolylineWithSegmentMarker::markSegment(std::size_t seg_num, bool mark_val)
15{
16 _marker[seg_num] = mark_val;
17}
18
19bool PolylineWithSegmentMarker::isSegmentMarked(std::size_t seg_num) const
20{
21 return _marker[seg_num];
22}
23
25{
26 if (Polyline::addPoint(pnt_id))
27 {
28 _marker.push_back(false);
29 return true;
30 }
31 return false;
32}
33
34bool PolylineWithSegmentMarker::insertPoint(std::size_t pos, std::size_t pnt_id)
35{
36 if (Polyline::insertPoint(pos, pnt_id))
37 {
38 _marker.insert(_marker.begin() + pos, _marker[pos]);
39 return true;
40 }
41 return false;
42}
43
44} // namespace GeoLib
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:29
std::size_t getNumberOfSegments() const
Definition Polyline.cpp:103
virtual bool insertPoint(std::size_t pos, std::size_t pnt_id)
Definition Polyline.cpp:44
virtual bool addPoint(std::size_t pnt_id)
Definition Polyline.cpp:24
Polyline(const std::vector< Point * > &pnt_vec)
Definition Polyline.cpp:17