Set of line segments in the plane.
More...
#include <segment.h>
|
| SegmentSet2 () |
| Empty.
|
|
| SegmentSet2 (const QVector< Vector2 > &, const QVector< int > &) |
| Create a set of line segments from a list of vertices and a indexes.
|
|
QVector< Segment2 > | GetSegments () const |
| Get the set of line segments.
|
|
Segment2 | GetSegment (int) const |
| Return the k-th segment.
|
|
Vector2 | Vertex (int) const |
| Return the k-th vertex.
|
|
bool | IsEmpty () const |
| Check is the set of segments is empty.
|
|
int | SegmentSize () const |
| Return the number of segments.
|
|
Polygons2 | GetPolygons () const |
| Get the subset of closed polygons.
|
|
void | Draw (QGraphicsScene &, const QPen &=QPen()) const |
| Draw a set of line segments.
|
|
|
QVector< Vector2 > | vertices |
| Vertices.
|
|
QVector< int > | indices |
| Segment vertex indices.
|
|
Set of line segments in the plane.
Segments are stored as set of vertexes, and an index array.
This structure is effective for generating the contours of a ScalarField2.
- See also
- ScalarField2::LineSegments
◆ SegmentSet2()
SegmentSet2::SegmentSet2 |
( |
const QVector< Vector2 > & | v, |
|
|
const QVector< int > & | i ) |
|
explicit |
Create a set of line segments from a list of vertices and a indexes.
Indices should be a multiple of two; the number of segments is derived from the size of the array.
- See also
- Mesh2
- Parameters
-
v | Set of vertices. |
i | Indexes that represent the segments. |
◆ Draw()
void SegmentSet2::Draw |
( |
QGraphicsScene & | scene, |
|
|
const QPen & | pen = QPen() ) const |
Draw a set of line segments.
- Parameters
-
scene | Graphics scene. |
pen | The pen. |
◆ GetPolygons()
Get the subset of closed polygons.
Detects all loops in the structure and create closed polygons, open polylines are not returned.
◆ GetSegment()
Segment2 SegmentSet2::GetSegment |
( |
int | k | ) |
const |
|
inline |
Return the k-th segment.
- Parameters
-
◆ Vertex()
Vector2 SegmentSet2::Vertex |
( |
int | k | ) |
const |
|
inline |
Return the k-th vertex.
- Parameters
-