OGS
GeoLib::PolygonWithSegmentMarker Class Referencefinal

Detailed Description

Definition at line 11 of file PolygonWithSegmentMarker.h.

#include <PolygonWithSegmentMarker.h>

Inheritance diagram for GeoLib::PolygonWithSegmentMarker:
[legend]
Collaboration diagram for GeoLib::PolygonWithSegmentMarker:
[legend]

Public Member Functions

 PolygonWithSegmentMarker (GeoLib::Polyline const &polyline)
void markSegment (std::size_t seg_num, bool mark_val=true)
bool isSegmentMarked (std::size_t seg_num) const
bool addPoint (std::size_t pnt_id) override
bool insertPoint (std::size_t pos, std::size_t pnt_id) override
Public Member Functions inherited from GeoLib::Polygon
 Polygon (const Polyline &ply, bool init=true)
 Polygon (Polygon const &other)
Polygonoperator= (Polygon const &rhs)=delete
 ~Polygon () override
bool initialise ()
bool isPntInPolygon (MathLib::Point3d const &pnt) const
bool containsSegment (GeoLib::LineSegment const &segment) const
bool isPolylineInPolygon (const Polyline &ply) const
bool isPartOfPolylineInPolygon (const Polyline &ply) const
bool getNextIntersectionPointPolygonLine (GeoLib::LineSegment const &seg, GeoLib::Point &intersection_pnt, std::size_t &seg_num) const
std::list< Polygon * > const & computeListOfSimplePolygons ()
Public Member Functions inherited from GeoLib::Polyline
 Polyline (const std::vector< Point * > &pnt_vec)
 Polyline (const Polyline &ply)
Polylineoperator= (Polyline const &other)=delete
 ~Polyline () override=default
GEOTYPE getGeoType () const override
 return a geometry type
void removePoint (std::size_t pos)
void closePolyline ()
std::size_t getNumberOfPoints () const
std::size_t getNumberOfSegments () const
bool isClosed () const
bool isCoplanar () const
bool isPointIDInPolyline (std::size_t pnt_id) const
std::size_t getPointID (std::size_t const i) const
void setPointID (std::size_t idx, std::size_t id)
const PointgetPoint (std::size_t i) const
 returns the i-th point contained in the polyline
SegmentIterator begin () const
SegmentIterator end () const
std::vector< Point * > const & getPointsVec () const
double getDistanceAlongPolyline (const MathLib::Point3d &pnt, const double epsilon_radius) const
Public Member Functions inherited from GeoLib::GeoObject
virtual ~GeoObject ()=default

Private Attributes

std::vector< bool > _marker

Additional Inherited Members

Static Public Member Functions inherited from GeoLib::Polyline
static PolylineconstructPolylineFromSegments (const std::vector< Polyline * > &ply_vec, double prox=0.0)
Protected Member Functions inherited from GeoLib::Polyline
void reverseOrientation ()
std::vector< std::size_t > const & getPolylinePointIDs () const
Protected Attributes inherited from GeoLib::Polyline
const std::vector< Point * > & _ply_pnts

Constructor & Destructor Documentation

◆ PolygonWithSegmentMarker()

GeoLib::PolygonWithSegmentMarker::PolygonWithSegmentMarker ( GeoLib::Polyline const & polyline)
explicit

Definition at line 8 of file PolygonWithSegmentMarker.cpp.

10 : GeoLib::Polygon(polyline, true),
11 _marker(polyline.getNumberOfPoints(), false)
12{
13}

References GeoLib::Polygon::Polygon(), _marker, and GeoLib::Polyline::getNumberOfPoints().

Member Function Documentation

◆ addPoint()

bool GeoLib::PolygonWithSegmentMarker::addPoint ( std::size_t pnt_id)
overridevirtual

Method calls

See also
Polyline::addPoint() and initializes the mark of the corresponding line segment.
Polyline::addPoint()

Reimplemented from GeoLib::Polyline.

Definition at line 25 of file PolygonWithSegmentMarker.cpp.

26{
27 if (Polyline::addPoint(pnt_id))
28 {
29 _marker.push_back(false);
30 return true;
31 }
32 return false;
33}
virtual bool addPoint(std::size_t pnt_id)
Definition Polyline.cpp:24

References _marker, and GeoLib::Polyline::addPoint().

◆ insertPoint()

bool GeoLib::PolygonWithSegmentMarker::insertPoint ( std::size_t pos,
std::size_t pnt_id )
overridevirtual

Method calls the

See also
Polyline::insertPoint() and initializes the inserted line segment with the same value the previous line segment had.
Polyline::insertPoint()

Reimplemented from GeoLib::Polyline.

Definition at line 35 of file PolygonWithSegmentMarker.cpp.

36{
37 if (Polyline::insertPoint(pos, pnt_id))
38 {
39 _marker.insert(_marker.begin() + pos, _marker[pos]);
40 return true;
41 }
42 return false;
43}
virtual bool insertPoint(std::size_t pos, std::size_t pnt_id)
Definition Polyline.cpp:44

References _marker, and GeoLib::Polyline::insertPoint().

◆ isSegmentMarked()

bool GeoLib::PolygonWithSegmentMarker::isSegmentMarked ( std::size_t seg_num) const

Method returns the value of the mark for the given segment.

Parameters
seg_numsegment number
Returns
either true if the segment is marked or false else

Definition at line 20 of file PolygonWithSegmentMarker.cpp.

21{
22 return _marker[seg_num];
23}

References _marker.

◆ markSegment()

void GeoLib::PolygonWithSegmentMarker::markSegment ( std::size_t seg_num,
bool mark_val = true )

Method marks the segment (default mark is true).

Parameters
seg_numthe segment number that should be marked
mark_valthe value of the flag (true or false)

Definition at line 15 of file PolygonWithSegmentMarker.cpp.

16{
17 _marker[seg_num] = mark_val;
18}

References _marker.

Member Data Documentation

◆ _marker

std::vector<bool> GeoLib::PolygonWithSegmentMarker::_marker
private

The documentation for this class was generated from the following files: