OGS
GeoLib::PolygonWithSegmentMarker Class Referencefinal

Detailed Description

Definition at line 16 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 (const MathLib::Point3d &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 More...
 
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 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 More...
 
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
Location getLocationOfPoint (std::size_t k, MathLib::Point3d const &pnt) const
 
- Protected Attributes inherited from GeoLib::Polyline
const std::vector< Point * > & _ply_pnts
 
std::vector< std::size_t > _ply_pnt_ids
 

Constructor & Destructor Documentation

◆ PolygonWithSegmentMarker()

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

Definition at line 14 of file PolygonWithSegmentMarker.cpp.

16  : GeoLib::Polygon(polyline, true),
17  _marker(polyline.getNumberOfPoints(), false)
18 {
19 }

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 31 of file PolygonWithSegmentMarker.cpp.

32 {
33  if (Polyline::addPoint(pnt_id))
34  {
35  _marker.push_back(false);
36  return true;
37  }
38  return false;
39 }
virtual bool addPoint(std::size_t pnt_id)
Definition: Polyline.cpp:35

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 41 of file PolygonWithSegmentMarker.cpp.

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 }
virtual bool insertPoint(std::size_t pos, std::size_t pnt_id)
Definition: Polyline.cpp:55

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 26 of file PolygonWithSegmentMarker.cpp.

27 {
28  return _marker[seg_num];
29 }

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 21 of file PolygonWithSegmentMarker.cpp.

22 {
23  _marker[seg_num] = mark_val;
24 }

References _marker.

Member Data Documentation

◆ _marker

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

Definition at line 50 of file PolygonWithSegmentMarker.h.

Referenced by addPoint(), insertPoint(), isSegmentMarked(), and markSegment().


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