6.1.1.3.1.5. thyrsis.gui.injection_widget module

Crisis interface to define simulation with a mininumum of user interface

class thyrsis.gui.injection_widget.InjectionWidget(type_, canvas, attr=None, parent=None)

Bases: PyQt5.QtWidgets.QWidget

Widget to define the injection properties

attributes()

return a dic of attributes

Returns

dictionnary of injection attributes

Return type

dict

static circle(x, y, area)

Create a circle QgsGeometry

Parameters
  • x (float) – x coordinate

  • y (float) – y coordinate

  • area (float) – area value

Returns

circle

Return type

QgsGeometry

enterEvent(event)

display rubberband

Parameters

event (string) – event description

Returns

None

Return type

None

leaveEvent(event)

clear rubberband

Parameters

event (string) – event description

Returns

None

Return type

None

class thyrsis.gui.injection_widget.RaiiRubberBand(canvas, geom_type)

Bases: object

Decorator that ensures that rubberband is properly removed

addGeometry(geom, layer)

Add a geometry as rubberband

Parameters
  • geom (QgsGeometry) – geometry

  • layer (QgsVectorLayer) – layer

Returns

None

Return type

None

addPoint(point)

set the database property

Parameters

point (QgsPoint) – point geometry

Returns

None

Return type

None

asGeometry()

return the rubberband as a QgsGeometry

Returns

rubberband geometry

Return type

QgsGeometry