~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/app/qgsmaptooldeletepart.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
    qgsmaptooldeletepart.h  - delete a part from multipart geometry
 
3
    ---------------------
 
4
    begin                : April 2009
 
5
    copyright            : (C) 2009 by Richard Kostecky
 
6
    email                : csf dot kostej at mail dot com
 
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
 
 
16
#ifndef QGSMAPTOOLDELETEPART_H
 
17
#define QGSMAPTOOLDELETEPART_H
 
18
 
 
19
#include "qgsmaptoolvertexedit.h"
 
20
 
 
21
class QgsVertexMarker;
 
22
 
 
23
/**Map tool to delete vertices from line/polygon features*/
 
24
class QgsMapToolDeletePart: public QgsMapToolVertexEdit
 
25
{
 
26
    Q_OBJECT
 
27
 
 
28
  public:
 
29
    QgsMapToolDeletePart( QgsMapCanvas* canvas );
 
30
    virtual ~QgsMapToolDeletePart();
 
31
 
 
32
    void canvasMoveEvent( QMouseEvent * e );
 
33
 
 
34
    void canvasPressEvent( QMouseEvent * e );
 
35
 
 
36
    void canvasReleaseEvent( QMouseEvent * e );
 
37
 
 
38
    //! called when map tool is being deactivated
 
39
    void deactivate();
 
40
 
 
41
  private:
 
42
    QgsVertexMarker* mCross;
 
43
 
 
44
    //! delete part of a geometry
 
45
    void deletePart( int fId, int beforeVertexNr, QgsVectorLayer* vlayer );
 
46
 
 
47
    //! find out part number of geometry given the snapped vertex number
 
48
    int partNumberOfVertex( QgsGeometry* g, int beforeVertexNr );
 
49
 
 
50
};
 
51
 
 
52
#endif