https://gitlab.opengeosys.org/ogs/ogs.git
Tip revision: 66fcfd349efce4d5f7430cfbd77552ccfca3ce6f authored by Dmitri Naumov on 27 August 2020, 15:48:08 UTC
[T/RM] Liakopoulos; Add test_definition and ctest.
[T/RM] Liakopoulos; Add test_definition and ctest.
Tip revision: 66fcfd3
PolylineWithSegmentMarker.cpp
/**
* \file
* \author Thomas Fischer
* \date Apr 3, 2012
* \brief Implementation of the PolylineWithSegmentMarker class.
*
* \copyright
* Copyright (c) 2012-2020, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "PolylineWithSegmentMarker.h"
namespace GeoLib {
PolylineWithSegmentMarker::PolylineWithSegmentMarker(
GeoLib::Polyline const& polyline)
: GeoLib::Polyline(polyline), _marker(polyline.getNumberOfSegments(), false)
{
}
void PolylineWithSegmentMarker::markSegment(std::size_t seg_num, bool mark_val)
{
_marker[seg_num] = mark_val;
}
bool PolylineWithSegmentMarker::isSegmentMarked(std::size_t seg_num) const
{
return _marker[seg_num];
}
bool PolylineWithSegmentMarker::addPoint(std::size_t pnt_id)
{
if (Polyline::addPoint(pnt_id)) {
_marker.push_back(false);
return true;
}
return false;
}
bool PolylineWithSegmentMarker::insertPoint(std::size_t pos, std::size_t pnt_id)
{
if (Polyline::insertPoint(pos, pnt_id)) {
_marker.insert(_marker.begin()+pos, _marker[pos]);
return true;
}
return false;
}
} // namespace GeoLib