~ubuntu-branches/ubuntu/trusty/qgis/trusty

« back to all changes in this revision

Viewing changes to src/core/qgsgeometryvertexindex.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
             qgsgeometry.h - Vertex Index into a QgsGeometry
3
 
             -----------------------------------------------
4
 
Date                 : 08 May 2005
5
 
Copyright            : (C) 2005 by Brendan Morley
6
 
email                : morb at ozemail dot com dot au
7
 
 ***************************************************************************
8
 
 *                                                                         *
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.                                   *
13
 
 *                                                                         *
14
 
 ***************************************************************************/
15
 
/* $Id: qgsgeometryvertexindex.h 5568 2006-07-08 01:32:45Z morb_au $ */
16
 
 
17
 
#ifndef QGSGEOMETRYVERTEXINDEX_H
18
 
#define QGSGEOMETRYVERTEXINDEX_H
19
 
 
20
 
#include <vector>
21
 
 
22
 
#include <qstring.h>
23
 
 
24
 
 
25
 
 /**
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
31
 
  *
32
 
  * @author Brendan Morley
33
 
  */
34
 
 
35
 
class QgsGeometryVertexIndex {
36
 
 
37
 
  public:
38
 
  
39
 
    //! Constructor
40
 
    QgsGeometryVertexIndex();
41
 
    
42
 
    /** copy constructor will prompt a deep copy of the object */
43
 
    QgsGeometryVertexIndex( QgsGeometryVertexIndex const & rhs );
44
 
    
45
 
    /** assignments will prompt a deep copy of the object */
46
 
    QgsGeometryVertexIndex & operator=( QgsGeometryVertexIndex const & rhs );
47
 
 
48
 
    //! Destructor
49
 
    ~QgsGeometryVertexIndex();
50
 
    
51
 
    /** Pushes an int onto the last (rightmost) element of the index */
52
 
    void push_back(int& i);
53
 
 
54
 
    /** Gets the last (rightmost) element of the index */
55
 
    int back() const;
56
 
 
57
 
    /** Gets the i'th element of the index.
58
 
        i=0 refers to the "innermost" line-string or linear-ring.
59
 
     */
60
 
    int get_at(int i) const;
61
 
 
62
 
    /** Resets the index */
63
 
    void clear();
64
 
 
65
 
    /** Increments the last (rightmost) element of the index */
66
 
    void increment_back();
67
 
 
68
 
    /** Decrements the last (rightmost) element of the index */
69
 
    void decrement_back();
70
 
 
71
 
    /** assign i to the last (rightmost) element of the index */
72
 
    void assign_back(int& i);
73
 
 
74
 
    /** Returns this index as a string - useful for "printf debugging" */
75
 
    QString toString();
76
 
 
77
 
 
78
 
  private:
79
 
 
80
 
    std::vector<int> mIndex;
81
 
 
82
 
 
83
 
}; // class QgsGeometryVertexIndex
84
 
 
85
 
#endif