Example #1
0
    def test_apply_delete_node_edit(self):
        item = QgsAnnotationMarkerItem(QgsPoint(12, 13))
        self.assertEqual(item.geometry().asWkt(), 'POINT(12 13)')

        self.assertEqual(item.applyEdit(QgsAnnotationItemEditOperationDeleteNode('', QgsVertexId(0, 0, 0), QgsPoint(12, 13))), Qgis.AnnotationItemEditOperationResult.ItemCleared)
Example #2
0
    def test_transform(self):
        item = QgsAnnotationMarkerItem(QgsPoint(12, 13))
        self.assertEqual(item.geometry().asWkt(), 'POINT(12 13)')

        self.assertEqual(item.applyEdit(QgsAnnotationItemEditOperationTranslateItem('', 100, 200)), Qgis.AnnotationItemEditOperationResult.Success)
        self.assertEqual(item.geometry().asWkt(), 'POINT(112 213)')
Example #3
0
    def test_apply_move_node_edit(self):
        item = QgsAnnotationMarkerItem(QgsPoint(12, 13))
        self.assertEqual(item.geometry().asWkt(), 'POINT(12 13)')

        self.assertEqual(item.applyEdit(QgsAnnotationItemEditOperationMoveNode('', QgsVertexId(0, 0, 1), QgsPoint(14, 13), QgsPoint(17, 18))), Qgis.AnnotationItemEditOperationResult.Success)
        self.assertEqual(item.geometry().asWkt(), 'POINT(17 18)')
Example #4
0
 def test_apply_add_node_edit(self):
     item = QgsAnnotationMarkerItem(QgsPoint(12, 13))
     self.assertEqual(item.applyEdit(QgsAnnotationItemEditOperationAddNode('', QgsPoint(13, 14))), Qgis.AnnotationItemEditOperationResult.Invalid)