def run_bag_overnemen(self): """copy polygon of bag feature""" UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) layerName = PC.bagpand_layername() ilayer = UC.getlayer_byname(layerName) request = QC.QgsFeatureRequest().setFilterExpression( '"identificatie" = ' + "'{}'".format(self.objectId)) ifeature = next(ilayer.getFeatures(request)) self.copy_bag_bouwlaag(ilayer, ifeature)
def run_terrein_toevoegen(self): objectId = self.object_id.text() possibleSnapFeatures = UC.get_possible_snapFeatures_object(self.snapLayerNames, objectId) self.drawTool.parent = self self.drawTool.layer = UC.getlayer_byname(PC.OBJECT["terreinlayername"]) UG.set_lengte_oppervlakte_visibility(self, True, True, True, True) self.drawTool.possibleSnapFeatures = possibleSnapFeatures self.drawTool.canvas = self.canvas self.drawTool.onGeometryAdded = self.place_object_terrein self.drawTool.captureMode = 2 self.canvas.setMapTool(self.drawTool)
def run_bouwlaag_tekenen(self): """draw a floor with the basic functionality of QGIS""" drawTool = self.parent.drawTool possibleSnapFeatures = UC.get_possible_snapFeatures_bouwlaag( self.snapLayerNames, self.objectId) layer = UC.getlayer_byname(PC.PAND["bouwlaaglayername"]) drawTool.layer = layer drawTool.possibleSnapFeatures = possibleSnapFeatures drawTool.canvas = self.canvas drawTool.onGeometryAdded = self.draw_feature drawTool.captureMode = 2 self.canvas.setMapTool(drawTool) UG.set_lengte_oppervlakte_visibility(self, True, True, True, True) drawTool.parent = self
def __init__(self, parent=None, objectId=None, formeleNaam=None): super(oivRepressiefObjectWidget, self).__init__(parent) self.setupUi(self) self.parent = parent self.iface = parent.iface self.canvas = parent.canvas self.object_id.setVisible(False) self.selectTool = parent.selectTool self.pointTool = parent.pointTool self.drawTool = parent.drawTool self.moveTool = parent.moveTool self.identifyTool = parent.identifyTool self.object_id.setText(str(objectId)) self.formelenaam.setText(formeleNaam) UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) self.initActions()
def initUI(self): """intitiate the UI elemets on the widget""" UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) self.object_id.setVisible(False) self.move.clicked.connect(self.run_move_point) self.identify.clicked.connect(self.run_edit_tool) self.select.clicked.connect(self.run_select_tool) self.delete_f.clicked.connect(self.run_delete_tool) self.pan.clicked.connect(self.activatePan) self.terug.clicked.connect(self.close_object_tekenen_show_base) actionList, self.editableLayerNames, self.moveLayerNames = UG.get_actions( PC.OBJECT["configtable"]) self.initActions(actionList) self.helpBtn, self.floatBtn, titleBar = QT.getTitleBar() self.setTitleBarWidget(titleBar) self.helpBtn.clicked.connect( lambda: UC.open_url(PC.HELPURL["objecttekenenhelp"])) self.floatBtn.clicked.connect(lambda: self.setFloating(True))
def run_bouwlaag_overnemen(self): """copy floor from another floor""" UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) self.label1.setVisible(True) self.label2.setVisible(True) self.label3.setVisible(True) self.bouwlaag.setVisible(True) for var in vars(self): typeVar = type(vars(self)[var]) if typeVar == PQtW.QCheckBox: vars(self)[var].setVisible(True) # append combobox with unique existing floors self.bouwlagen_to_combobox() self.copy.setVisible(True) # connect signal to slot self.parent.selectTool.expectedLayerName = PC.PAND["bouwlaaglayername"] self.bouwlaag.currentIndexChanged.connect( self.set_layer_subset_bouwlaag) self.parent.selectTool.geomSelected.connect(self.copy_bag_bouwlaag)
def initUI(self): self.bouwlaag_bag.clicked.connect(self.run_bag_overnemen) self.bouwlaag_tekenen.clicked.connect(self.run_bouwlaag_tekenen) self.bouwlaag_overnemen.clicked.connect(self.run_bouwlaag_overnemen) self.terug.clicked.connect(self.close_bouwlaag) self.copy.clicked.connect(self.run_select_bouwlaag) self.label1.setVisible(False) self.label2.setVisible(False) self.label3.setVisible(False) self.teken_bouwlaag.setEnabled(False) UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) self.bouwlaag_max.setVisible(False) self.bouwlaag.setVisible(False) self.copy.setVisible(False) self.helpBtn, self.floatBtn, titleBar = QT.getTitleBar() self.setTitleBarWidget(titleBar) self.helpBtn.clicked.connect( lambda: UC.open_url(PC.HELPURL["bouwlaaghelp"])) self.floatBtn.clicked.connect(lambda: self.setFloating(True)) for var in vars(self): typeVar = type(vars(self)[var]) if typeVar == PQtW.QCheckBox: vars(self)[var].setVisible(False)
def run_tekenen(self, _dummy, runLayer, feature_id): """activate the right draw action""" #welke pictogram is aangeklikt en wat is de bijbehorende tekenlaag snapLayerNames = [] self.identifier = feature_id self.drawLayer = UC.getlayer_byname(runLayer) self.drawLayerType = UC.check_layer_type(self.drawLayer) self.parentLayerName = CH.get_parentlayer_bl(runLayer) objectId = self.pand_id.text() #aan welke lagen kan worden gesnapt? baglayerName = PC.bagpand_layername() snapLayerNames = DW.BLSNAPLAYERS if baglayerName not in snapLayerNames: snapLayerNames.append(baglayerName) possibleSnapFeatures = UC.get_possible_snapFeatures_bouwlaag( snapLayerNames, objectId) if self.drawLayerType == "Point": pointTool = self.parent.pointTool pointTool.snapPt = None pointTool.snapping = False pointTool.startRotate = False pointTool.possibleSnapFeatures = possibleSnapFeatures if self.identifier in DW.BLSNAPSYMBOLS: pointTool.snapping = True pointTool.layer = self.drawLayer self.canvas.setMapTool(pointTool) UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) pointTool.onGeometryAdded = self.place_feature else: drawTool = self.parent.drawTool if self.drawLayerType == "LineString": drawTool.captureMode = 1 UG.set_lengte_oppervlakte_visibility(self, True, True, False, True) else: drawTool.captureMode = 2 UG.set_lengte_oppervlakte_visibility(self, True, True, True, True) drawTool.layer = self.drawLayer drawTool.possibleSnapFeatures = possibleSnapFeatures drawTool.canvas = self.canvas drawTool.onGeometryAdded = self.place_feature self.canvas.setMapTool(drawTool) drawTool.parent = self
def run_tekenen(self, _dummy, runLayer, featureId): #welke pictogram is aangeklikt en wat is de bijbehorende tekenlaag self.identifier = featureId self.drawLayer = UC.getlayer_byname(runLayer) self.drawLayerType = UC.check_layer_type(self.drawLayer) self.parentLayerName = CH.get_parentlayer_ob(runLayer) objectId = self.object_id.text() possibleSnapFeatures = UC.get_possible_snapFeatures_object( DH.ROSNAPLAYERS, objectId) if self.drawLayerType == "Point": pointTool = self.parent.pointTool pointTool.snapPt = None pointTool.snapping = False pointTool.startRotate = False pointTool.possibleSnapFeatures = possibleSnapFeatures if self.identifier in DH.ROSNAPSYMBOLS: pointTool.snapping = True pointTool.layer = self.drawLayer self.canvas.setMapTool(pointTool) UG.set_lengte_oppervlakte_visibility(self, False, False, False, False) pointTool.onGeometryAdded = self.place_feature else: drawTool = self.parent.drawTool if self.drawLayerType == "LineString": drawTool.captureMode = 1 UG.set_lengte_oppervlakte_visibility(self, True, True, False, True) else: drawTool.captureMode = 2 UG.set_lengte_oppervlakte_visibility(self, True, True, True, True) drawTool.layer = self.drawLayer drawTool.possibleSnapFeatures = possibleSnapFeatures drawTool.canvas = self.canvas drawTool.onGeometryAdded = self.place_feature self.canvas.setMapTool(drawTool) drawTool.parent = self