18
18
19
19
#include " qgsmaptoolvertexedit.h"
20
20
#include " qgsfeature.h"
21
+ #include " qgsvertexmarker.h"
21
22
#include < QRect>
22
23
#include < QRubberBand>
23
24
@@ -31,7 +32,8 @@ struct VertexEntry
31
32
bool selected;
32
33
QgsPoint point;
33
34
int equals;
34
- QgsRubberBand *vertexMarker;;
35
+ // QgsRubberBand *vertexMarker;
36
+ QgsVertexMarker* vertexMarker;
35
37
bool inRubberBand;
36
38
int rubberBandNr;
37
39
int index;
@@ -143,10 +145,18 @@ class SelectionFeature
143
145
*/
144
146
void cleanRubberBandsData ();
145
147
146
- void setMarkerCenter (QgsRubberBand* marker, QgsPoint center);
147
-
148
- QgsRubberBand* createRubberBandMarker (QgsPoint center);
148
+ /* *
149
+ * Function connecting all necessary thing to create vertex marker
150
+ * @param center center of marker
151
+ * @return created vertex marker
152
+ */
153
+ QgsVertexMarker* createVertexMarker (QgsPoint center);
149
154
155
+ /* *
156
+ * Getter for getting vector layer which selection is working
157
+ * @return used vector layer
158
+ */
159
+ QgsVectorLayer* vlayer ();
150
160
151
161
152
162
private:
@@ -183,6 +193,7 @@ class SelectionFeature
183
193
184
194
QgsFeature* mFeature ;
185
195
int mFeatureId ;
196
+ bool mFeatureSelected ;
186
197
QgsVectorLayer* mVlayer ;
187
198
QgsRubberBand* mRubberBand ;
188
199
QList<VertexEntry> mVertexMap ;
@@ -192,6 +203,7 @@ class SelectionFeature
192
203
/* *A maptool to move/deletes/adds vertices of line or polygon fetures*/
193
204
class QgsMapToolNodeTool : public QgsMapToolVertexEdit
194
205
{
206
+ Q_OBJECT
195
207
public:
196
208
QgsMapToolNodeTool ( QgsMapCanvas* canvas );
197
209
virtual ~QgsMapToolNodeTool ();
@@ -215,14 +227,51 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit
215
227
* Returns closest vertex to given point from selected feature
216
228
*/
217
229
QgsPoint getClosestVertex (QgsPoint point);
218
-
230
+
231
+ protected slots:
232
+ /* *
233
+ * Processing incomming signal of deleted feature (for deletion of selected feature)
234
+ * @param featureId id of deleted feature
235
+ */
236
+ void featureDeleted ( int featureId );
237
+
238
+ /* *
239
+ * Processing incomming signal of deleted feature (for deletion of selected feature)
240
+ * @param featureId id of deleted feature
241
+ */
242
+ void layerModified ( bool onlyGeometry );
243
+
244
+ /* *
245
+ * Processing when layers are changed problem when layer is closed
246
+ */
247
+ void layersChanged ();
219
248
220
249
private:
221
250
251
+ void connectSignals (QgsVectorLayer* vlayer);
252
+
222
253
/* * Deletes the rubber band pointers
223
254
and clears mRubberBands*/
224
255
void removeRubberBands ();
225
256
257
+ /* *
258
+ * Creating rubber band marker for movin of point
259
+ * @param center coordinates of point to be moved
260
+ * @param vlayer vector layer on which we are working
261
+ */
262
+ QgsRubberBand* createRubberBandMarker (QgsPoint center, QgsVectorLayer* vlayer);
263
+
264
+ /* *
265
+ * Function to check if selected feature exists and is same with original one
266
+ * @param vlayer vector layer for checking
267
+ */
268
+ bool checkCorrectnessOfFeature (QgsVectorLayer* vlayer);
269
+
270
+ /* *
271
+ * Creates rubberbands for moving points
272
+ */
273
+ void createMovingRubberBands ();
274
+
226
275
/* * The position of the vertex to move (in map coordinates) to exclude later from snapping*/
227
276
QList<QgsPoint> mExcludePoint ;
228
277
@@ -244,7 +293,7 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit
244
293
/* * flag if crtl is pressed */
245
294
bool mCtrl ;
246
295
247
- /* * flag if selection of another frature can occur */
296
+ /* * flag if selection of another feature can occur */
248
297
bool mSelectAnother ;
249
298
250
299
/* * feature id of another feature where user clicked */
@@ -262,6 +311,12 @@ class QgsMapToolNodeTool: public QgsMapToolVertexEdit
262
311
/* * rectangle defining area for selecting vertexes */
263
312
QRect* mRect ;
264
313
314
+ /* * flag that tells that tool is currently updating feature to do not act on change signal */
315
+ bool mChangingGeometry ;
316
+
317
+ /* * flag to tell if edition points */
318
+ bool mIsPoint ;
319
+
265
320
};
266
321
267
322
0 commit comments