OGS
GeoLib::PolylineWithSegmentMarker Class Referencefinal

Detailed Description

This is a polyline with the possibility to mark some segments. Thus class PolylineWithSegmentMarker is derived from class Polyline.

Definition at line 26 of file PolylineWithSegmentMarker.h.

#include <PolylineWithSegmentMarker.h>

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

Public Member Functions

 PolylineWithSegmentMarker (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::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

◆ PolylineWithSegmentMarker()

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

Definition at line 19 of file PolylineWithSegmentMarker.cpp.

21 : GeoLib::Polyline(polyline), _marker(polyline.getNumberOfSegments(), false)
22{
23}
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
Definition Polyline.h:40

Member Function Documentation

◆ addPoint()

bool GeoLib::PolylineWithSegmentMarker::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 35 of file PolylineWithSegmentMarker.cpp.

36{
37 if (Polyline::addPoint(pnt_id))
38 {
39 _marker.push_back(false);
40 return true;
41 }
42 return false;
43}
virtual bool addPoint(std::size_t pnt_id)
Definition Polyline.cpp:35

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

◆ insertPoint()

bool GeoLib::PolylineWithSegmentMarker::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 45 of file PolylineWithSegmentMarker.cpp.

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

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

Referenced by FileIO::GMSH::GMSHPolygonTree::checkIntersectionsSegmentExistingPolylines(), and FileIO::GMSH::GMSHPolygonTree::insertPolyline().

◆ isSegmentMarked()

bool GeoLib::PolylineWithSegmentMarker::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 30 of file PolylineWithSegmentMarker.cpp.

31{
32 return _marker[seg_num];
33}

References _marker.

Referenced by FileIO::GMSH::GMSHPolygonTree::insertPolyline().

◆ markSegment()

void GeoLib::PolylineWithSegmentMarker::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 25 of file PolylineWithSegmentMarker.cpp.

26{
27 _marker[seg_num] = mark_val;
28}

References _marker.

Referenced by FileIO::GMSH::GMSHPolygonTree::insertPolyline().

Member Data Documentation

◆ _marker

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

Definition at line 59 of file PolylineWithSegmentMarker.h.

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


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