-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloop_widget.py
More file actions
73 lines (60 loc) · 2.22 KB
/
loop_widget.py
File metadata and controls
73 lines (60 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#! python3
"""Main Loop widget used in the plugin dock.
This module exposes `LoopWidget` which provides the primary user
interface for interacting with LoopStructural features inside QGIS.
"""
from PyQt5.QtWidgets import QTabWidget, QVBoxLayout, QWidget
from .modelling.modelling_widget import ModellingWidget
from .visualisation.visualisation_widget import VisualisationWidget
class LoopWidget(QWidget):
"""Main dock widget that contains modelling and visualisation tools.
The widget composes multiple tabs and controls used to construct and
inspect geological models.
"""
def __init__(
self, parent=None, *, mapCanvas=None, logger=None, data_manager=None, model_manager=None
):
"""Initialize the Loop widget.
Parameters
----------
*args, **kwargs
Forwarded to the parent widget constructor.
"""
super().__init__(parent)
self.mapCanvas = mapCanvas
self.logger = logger
self.data_manager = data_manager
self.model_manager = model_manager
mainLayout = QVBoxLayout(self)
self.setLayout(mainLayout)
tabWidget = QTabWidget(self)
tabWidget.setTabPosition(QTabWidget.South)
mainLayout.addWidget(tabWidget)
self.modelling_widget = ModellingWidget(
self,
mapCanvas=self.mapCanvas,
logger=self.logger,
data_manager=self.data_manager,
model_manager=self.model_manager,
)
self.visualisation_widget = VisualisationWidget(
self, mapCanvas=self.mapCanvas, logger=self.logger, model_manager=self.model_manager
)
tabWidget.addTab(self.modelling_widget, "Modelling")
tabWidget.addTab(self.visualisation_widget, "Visualisation")
def get_modelling_widget(self):
"""Return the modelling widget instance.
Returns
-------
ModellingWidget
The modelling widget.
"""
return self.modelling_widget
def get_visualisation_widget(self):
"""Return the visualisation widget instance.
Returns
-------
VisualisationWidget
The visualisation widget.
"""
return self.visualisation_widget