def start_to_rotate(self, event):
     """init tempRubberband indicating rotation"""
     layerPt = self.toMapCoordinates(event.pos())
     self.tempRubberBand = RH.init_rubberband("moveandrotatepoint",
                                              self.canvas, 'line')
     self.tempRubberBand.show()
     self.tempRubberBand.addPoint(layerPt)
     self.startRotate = True
 def start_to_rotate(self, event):
     """indien roteren -> init temprubberband"""
     mapPt, dummy = self.transformCoordinates(event.pos())
     self.tempRubberBand = RH.init_rubberband("moveandrotatepoint",
                                              self.canvas, 'line')
     self.tempRubberBand.show()
     self.tempRubberBand.addPoint(mapPt)
     self.startRotate = True
Beispiel #3
0
 def startCapturing(self):
     """bij starten van het tekenen intialiseer de rubberbands"""
     if self.bandType() == QC.QgsWkbTypes.PolygonGeometry:
         rbType = 'polygon'
     else:
         rbType = 'line'
     #rubberband voor de al vastgelegde punten
     self.rubberBand = RH.init_rubberband("drawn", self.canvas, rbType)
     self.rubberBand.show()
     #gestippelde rubberband -> voor het tekenen
     self.tempRubberBand = RH.init_rubberband("newpoint", self.canvas,
                                              rbType)
     self.tempRubberBandExt = RH.init_rubberband("drawinghelpers",
                                                 self.canvas, "line")
     self.tempRubberBandExt.show()
     self.tempRubberBand.show()
     #2x loodrechte hulp tekenlijnen
     self.perpRubberBand = RH.init_rubberband("drawinghelpers", self.canvas,
                                              "line")
     self.perpRubberBand2 = RH.init_rubberband("drawinghelpers",
                                               self.canvas, "line")
     self.perpRubberBand.show()
     self.perpRubberBand2.show()
     self.parallelRubberBand = RH.init_rubberband("drawinghelpers",
                                                  self.canvas, "line")
     self.parallelRubberBand.show()
     #round distance rubberband
     self.roundRubberBand = RH.init_rubberband("drawinghelpers",
                                               self.canvas, "line")
     self.roundRubberBand.show()
     self.parent.straal.valueChanged.connect(self.draw_help_circle)
     self.parent.straal_button.clicked.connect(self.enable_roundrubberband)
     self.capturing = True
 def canvasMoveEvent(self, event):
     """als verslepen -> verplaats de indicatieve marker"""
     layerPt = self.toMapCoordinates(event.pos())
     if self.tempRubberBand is None:
         self.tempRubberBand = RH.init_rubberband("moveandrotatepoint",
                                                  self.canvas, 'line')
     if self.dragging:
         self.point = layerPt
         self.vertexMarker.setCenter(layerPt)
     #als roteren -> teken de tempRubberband als lijn
     if self.startRotate:
         self.tempRubberBand.movePoint(layerPt)
Beispiel #5
0
 def place_rubberband(self, xmin, xmax, ymin, ymax):
     """place rubberband on the canvas"""
     try:
         self.rubberBand.reset()
         self.canvas.scene().removeItem(self.rubberBand)
     except:  #pylint: disable=bare-except
         pass
     self.rubberBand = RH.init_rubberband('grid', self.canvas, 'polygon')
     tempRect = QC.QgsRectangle(QC.QgsPointXY(xmin, ymin),
                                QC.QgsPointXY(xmax, ymax))
     tempGeom = QC.QgsGeometry.fromRect(tempRect)
     crs = QC.QgsCoordinateReferenceSystem(GH.PROJECTCRS)
     self.rubberBand.reset()
     self.rubberBand.setToGeometry(tempGeom, crs)
     self.rubberBand.show()
Beispiel #6
0
 def run_grid(self):
     """after choosing single grid or kaartblad set things in motion"""
     if self.type_single_grid.isChecked():
         self.kaartblad_frame.setVisible(False)
         self.grid_frame.setVisible(True)
         self.make_grid.clicked.connect(self.create_grid)
     else:
         self.grid_frame.setVisible(False)
         self.kaartblad_frame.setVisible(True)
         self.format_combo.addItems(GH.PAPERSIZES)
         self.preview.clicked.connect(self.create_preview)
         self.make_kaartblad.clicked.connect(
             lambda: self.create_kaartblad(True))
         self.make_kaartblad_only.clicked.connect(
             lambda: self.create_kaartblad(False))
         self.rubberBand = RH.init_rubberband('grid', self.canvas,
                                              'polygon')