PLaSK library
Loading...
Searching...
No Matches
plask::SegmentsIterator Struct Reference

Iterate over segments. More...

Collaboration diagram for plask::SegmentsIterator:
[legend]

Public Member Functions

 SegmentsIterator (const std::vector< std::vector< Vec< 2, int > > > &segments)
 Construct iterator.
 
bool next ()
 Go to next segment.
 

Public Attributes

const std::vector< std::vector< Vec< 2, int > > > & segments
 
Vec< 2, intfirst
 
Vec< 2, intsecond
 
std::size_t seg_nr
 
std::ptrdiff_t point_nr
 

Detailed Description

Iterate over segments.

SegmentsIterator it(segments); while (it.next()) { //use it.first, it.second }

Definition at line 300 of file lattice.cpp.

Constructor & Destructor Documentation

◆ SegmentsIterator()

plask::SegmentsIterator::SegmentsIterator ( const std::vector< std::vector< Vec< 2, int > > > &  segments)
inline

Construct iterator.

After first next() call iterator will point to the first point.

Parameters
segmentsvector of closed polygons, each consist of number of successive verticles, one side is between last and first vertex. These polygons are xored. Sides must not cross each other.

Definition at line 313 of file lattice.cpp.

Member Function Documentation

◆ next()

bool plask::SegmentsIterator::next ( )
inline

Go to next segment.

Set new values of first, second.

Returns
true only if next segment exists.

Definition at line 320 of file lattice.cpp.

Member Data Documentation

◆ first

Vec<2, int> plask::SegmentsIterator::first

Definition at line 303 of file lattice.cpp.

◆ point_nr

std::ptrdiff_t plask::SegmentsIterator::point_nr

Definition at line 306 of file lattice.cpp.

◆ second

Vec<2, int> plask::SegmentsIterator::second

Definition at line 303 of file lattice.cpp.

◆ seg_nr

std::size_t plask::SegmentsIterator::seg_nr

Definition at line 305 of file lattice.cpp.

◆ segments

const std::vector<std::vector<Vec<2, int> > >& plask::SegmentsIterator::segments

Definition at line 301 of file lattice.cpp.


The documentation for this struct was generated from the following file: