26 from wireframe_widget
import WireframeWidget
31 from PyQt5
import QtCore, QtWidgets
32 from scene_selection_helper
import SelHelper
33 from combo_options_widget
import ComboOptionsWidget
34 from custom_widget
import CustomWidget
35 from cpk_widget
import CPKWidget
36 from tube_widget
import TubeWidget
37 from simple_widget
import SimpleWidget
38 from sline_widget
import SlineWidget
39 from hsc_widget
import HSCWidget
40 from trace_widget
import TraceWidget
41 from line_trace_widget
import LineTraceWidget
45 ComboOptionsWidget.__init__(self, parent)
51 self.keep_action_.setCheckable(
True);
52 self.keep_action_.setChecked(
False)
53 self.keep_action_.setToolTip(
"Keep rendermodes and add current")
57 self.grid_layout_.addWidget(self.
keep_button_, 0, 1, 1, 1)
58 self.grid_layout_.addWidget(self.stacked_widget_, 1, 0, 1, 2)
62 self.entity_widgets_.append([
"",
EmptyMode()])
63 self.entity_widgets_.append([gfx.RenderMode.SIMPLE, SimpleWidget()])
64 self.entity_widgets_.append([gfx.RenderMode.CUSTOM, CustomWidget()])
65 self.entity_widgets_.append([gfx.RenderMode.CPK, CPKWidget()])
66 self.entity_widgets_.append([gfx.RenderMode.LINE_TRACE, LineTraceWidget()])
67 self.entity_widgets_.append([gfx.RenderMode.TRACE, TraceWidget()])
68 self.entity_widgets_.append([gfx.RenderMode.SLINE, SlineWidget()])
69 self.entity_widgets_.append([gfx.RenderMode.TUBE, TubeWidget()])
70 self.entity_widgets_.append([gfx.RenderMode.HSC, HSCWidget()])
74 self.img_widgets_.append([
"",
EmptyMode()])
75 self.img_widgets_.append([gfx.RenderMode.SIMPLE, WireframeWidget()])
76 self.img_widgets_.append([gfx.RenderMode.FILL,
EmptyMode(
"Fill",gfx.RenderMode.FILL)])
79 self.setMinimumSize(250,200)
83 scene_selection = gui.SceneSelection.Instance()
84 for i
in range(0,scene_selection.GetActiveNodeCount()):
85 node = scene_selection.GetActiveNode(i)
87 render_mode = item.GetRenderMode()
88 if render_mode
is not None:
89 node.SetRenderMode(render_mode)
90 if(scene_selection.GetActiveViewCount() > 0):
91 entity = scene_selection.GetViewEntity()
92 view = scene_selection.GetViewUnion()
93 render_mode = item.GetRenderMode()
94 if render_mode
is not None:
95 entity.SetRenderMode(item.GetRenderMode(),view,self.keep_action_.isChecked())
101 if hasattr(self,
"keep_button_"):
102 self.keep_button_.setEnabled(
True)
104 ComboOptionsWidget.setEnabled(self,
True)
106 cur_widget = self.GetCurrentWidget()
107 new_render_mode =
None
108 if cur_widget
is not None:
109 new_render_mode = cur_widget.GetRenderMode()
111 if SelHelper().CheckAllFlags(SelHelper.NO_SELECTION):
112 ComboOptionsWidget.setEnabled(self,
False)
117 self.RemoveWidget(w[0])
119 self.RemoveWidget(w[0])
121 scene_selection = gui.SceneSelection.Instance()
122 if scene_selection.GetActiveNodeCount() > 0 :
123 if hasattr(self,
"keep_button_"):
124 self.keep_button_.setEnabled(
False)
125 render_mode_valid =
True
127 for i
in range(0,scene_selection.GetActiveNodeCount()):
128 node = scene_selection.GetActiveNode(i)
129 if isinstance(scene_selection.GetActiveNode(i),
gfx.GfxObj):
130 if render_mode
is None:
131 render_mode = node.GetRenderMode()
132 elif render_mode != node.GetRenderMode():
133 render_mode_valid =
False
135 if SelHelper().CheckFlags(SelHelper.HAS_IMG | SelHelper.IS_ONE_TYPE):
137 self.AddWidget(w[0], w[1])
138 elif SelHelper().CheckMinOneFlag(SelHelper.HAS_ENTITY| SelHelper.HAS_VIEW)
and SelHelper().CheckNotFlags(SelHelper.HAS_IMG):
141 self.AddWidget(w[0], w[1])
143 ComboOptionsWidget.setEnabled(self,
False)
146 if SelHelper().CheckMinOneFlag(SelHelper.HAS_ENTITY| SelHelper.HAS_IMG)
and SelHelper().CheckNotFlags(SelHelper.HAS_VIEW):
147 if(render_mode_valid):
148 ComboOptionsWidget.ChangeSelectedItem(self,render_mode)
150 ComboOptionsWidget.ChangeSelectedItem(self,
"")
154 ComboOptionsWidget.ChangeSelectedItem(self,new_render_mode)
155 self.GetCurrentWidget().
Update()
161 def __init__(self, text="", render_mode=None, parent=None):
162 QtWidgets.QLabel.__init__(self, parent)
163 self.setMinimumSize(250,30)
167 text_label = QtWidgets.QLabel(text)
168 font = text_label.font()
170 grid = QtWidgets.QGridLayout()
171 grid.addWidget(text_label,0,0,1,1)
172 grid.addWidget(QtWidgets.QLabel(
"No Settings available"), 1, 0, 1, 3)
173 grid.setRowStretch(2,1)
175 self.setMinimumSize(250,60)
main class for all graphic objects
graphical rendering of mol::EntityHandle entites
isocontour rendering for 3D image data