29 from PyQt5
import QtCore, QtWidgets
31 from .preset_widget
import PresetWidget
35 QtWidgets.QStackedWidget.__init__(self, parent)
40 self.setContentsMargins(0,0,0,0)
41 self.setMinimumSize(self.
preset_widget_preset_widget_.minimumSize())
45 scene_selection = gui.SceneSelection.Instance()
48 for i
in range(0,scene_selection.GetActiveNodeCount()):
49 node = scene_selection.GetActiveNode(i)
52 if (
not _img_present)
or (
not isinstance(node,
gfx.MapIso)):
56 self.setMinimumSize(self.
map_widget_map_widget_.minimumSize())
57 self.resize(self.
map_widget_map_widget_.minimumSize())
58 self.setMinimumSize(self.
map_widget_map_widget_.minimumSize())
62 self.setMinimumSize(self.
preset_widget_preset_widget_.minimumSize())
64 self.setMinimumSize(self.
preset_widget_preset_widget_.minimumSize())
67 self.setEnabled(
False)
72 QtWidgets.QWidget.__init__(self, parent)
77 self.
fontfont.setBold(
True)
85 grid = QtWidgets.QGridLayout()
86 grid.setContentsMargins(0,5,0,0)
90 grid.setRowStretch(3, 1)
97 self.setMinimumSize(250,200)
100 scene_selection = gui.SceneSelection.Instance()
101 if(scene_selection.GetActiveNodeCount()==1):
102 node = scene_selection.GetActiveNode(0)
103 if _img_present
and isinstance(node,
gfx.MapIso):
112 self.
fontfont.setBold(
True)
114 self.setEnabled(
True)
116 self.
fontfont.setBold(
False)
117 self.
map_level_label_map_level_label_.setText(
"Map uniformly filled with level %s"%node.GetLevel())
119 self.setEnabled(
False)
121 self.setEnabled(
False)
123 self.setEnabled(
False)
126 scene_selection = gui.SceneSelection.Instance()
127 if(scene_selection.GetActiveNodeCount()==1):
128 node = scene_selection.GetActiveNode(0)
139 levelUpdated = QtCore.pyqtSignal(int, name=
"levelUpdated")
140 levelModified = QtCore.pyqtSignal(int, name=
"levelModified")
143 QtWidgets.QWidget.__init__(self, parent)
148 QtWidgets.QWidget.__init__(self, parent)
161 self.
bins_bins_ = bins
177 if self.isEnabled()
and self.
bins_bins_
is not None:
178 painter = QtWidgets.QPainter()
179 if painter.begin(self):
189 painter.setBrush(QtCore.Qt.white)
190 painter.setPen(QtCore.Qt.white)
198 bin_cnt = len(self.
bins_bins_)
199 bin_width = (size.width()-2* self.
border_offset_border_offset_) / float(bin_cnt)
201 for b
in self.
bins_bins_:
206 painter.setBrush(QtCore.Qt.black)
207 painter.setPen(QtCore.Qt.black)
208 for i
in range(0,bin_cnt):
209 bin_height = self.
bins_bins_[i]
212 painter.drawRect(self.
border_offset_border_offset_ + (i*bin_width),
223 painter.setBrush(QtCore.Qt.red)
224 painter.setPen(QtCore.Qt.red)
225 painter.drawRect((width / tot_len) * cur_len,
233 painter.setBrush(QtCore.Qt.gray)
234 painter.setPen(QtCore.Qt.gray)
235 pos=self.mapFromGlobal(QtWidgets.QCursor.pos())
236 painter.drawRect(pos.x(),
246 self.
level_level_ = self.
minimum_minimum_ + float(event.x())/width * tot_len
257 level = self.
minimum_minimum_ + float(event.x())/width * tot_len
graphical rendering of mol::EntityHandle entites
isocontour rendering for 3D image data