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)
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)')
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)')
def test_apply_add_node_edit(self): item = QgsAnnotationMarkerItem(QgsPoint(12, 13)) self.assertEqual(item.applyEdit(QgsAnnotationItemEditOperationAddNode('', QgsPoint(13, 14))), Qgis.AnnotationItemEditOperationResult.Invalid)