1
/***************************************************************************
2
qgsgeometry.h - Vertex Index into a QgsGeometry
3
-----------------------------------------------
5
Copyright : (C) 2005 by Brendan Morley
6
email : morb at ozemail dot com dot au
7
***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************/
15
/* $Id: qgsgeometryvertexindex.h 5568 2006-07-08 01:32:45Z morb_au $ */
17
#ifndef QGSGEOMETRYVERTEXINDEX_H
18
#define QGSGEOMETRYVERTEXINDEX_H
26
* A QgsVertexIndex identifies a particular vertex in a given OGC Geometry.
27
* The left hand int (counting from 0) refers to the vertex number in
28
* the "innermost" line-string or linear-ring.
29
* The next int is the n'th line-string or linear-ring in a multi-line-string
30
* or polygon, and so on to the multi-geometry level if applicable
32
* @author Brendan Morley
35
class QgsGeometryVertexIndex {
40
QgsGeometryVertexIndex();
42
/** copy constructor will prompt a deep copy of the object */
43
QgsGeometryVertexIndex( QgsGeometryVertexIndex const & rhs );
45
/** assignments will prompt a deep copy of the object */
46
QgsGeometryVertexIndex & operator=( QgsGeometryVertexIndex const & rhs );
49
~QgsGeometryVertexIndex();
51
/** Pushes an int onto the last (rightmost) element of the index */
52
void push_back(int& i);
54
/** Gets the last (rightmost) element of the index */
57
/** Gets the i'th element of the index.
58
i=0 refers to the "innermost" line-string or linear-ring.
60
int get_at(int i) const;
62
/** Resets the index */
65
/** Increments the last (rightmost) element of the index */
66
void increment_back();
68
/** Decrements the last (rightmost) element of the index */
69
void decrement_back();
71
/** assign i to the last (rightmost) element of the index */
72
void assign_back(int& i);
74
/** Returns this index as a string - useful for "printf debugging" */
80
std::vector<int> mIndex;
83
}; // class QgsGeometryVertexIndex