32 from PyQt5
import QtCore, QtWidgets, QtWidgets
33 from .scene_selection_helper
import SelHelper
34 from .gradient_editor_widget
import GradientEditor
35 from .uniform_color_widget
import UniformColorWidget
36 from .combo_options_widget
import ComboOptionsWidget
40 ComboOptionsWidget.__init__(self, parent)
43 self.
text_text_ =
"Color Options"
44 conly_label_ = QtWidgets.QLabel(
'carbons only')
58 qw = QtWidgets.QWidget(self)
59 gl = QtWidgets.QGridLayout(qw)
60 gl.addWidget(self.
conly_box_conly_box_, 0, 0, 1, 1)
61 gl.addWidget(conly_label_, 0, 1, 1, 4)
64 self.setMinimumSize(250,200)
67 scene_selection = gui.SceneSelection.Instance()
68 if hasattr(item,
"PrepareColoring"):
69 item.PrepareColoring()
70 for i
in range(0,scene_selection.GetActiveNodeCount()):
71 node = scene_selection.GetActiveNode(i)
72 item.ChangeColor(node)
74 if(scene_selection.GetActiveViewCount() > 0):
75 entity = scene_selection.GetViewEntity()
76 view = scene_selection.GetViewUnion()
77 item.ChangeViewColor(entity,view)
84 ComboOptionsWidget.setEnabled(self,
True)
86 if SelHelper().CheckAllFlags(SelHelper.NO_SELECTION):
87 ComboOptionsWidget.setEnabled(self,
False)
96 if SelHelper().CheckFlags(SelHelper.HAS_IMG | SelHelper.IS_ONE_TYPE):
99 elif SelHelper().CheckMinOneFlag(SelHelper.HAS_ENTITY| SelHelper.HAS_VIEW| SelHelper.HAS_SURFACE)
and SelHelper().CheckNotFlags(SelHelper.HAS_IMG):
103 ComboOptionsWidget.setEnabled(self,
False)
109 return self.
text_text_
117 QtWidgets.QWidget.__init__(self, parent)
125 text_label = QtWidgets.QLabel(text)
126 font = text_label.font()
129 grid = QtWidgets.QGridLayout()
130 grid.addWidget(text_label,0,0,1,1)
131 grid.addWidget(QtWidgets.QLabel(
"No Settings available"), 1, 0, 1, 3)
132 grid.setRowStretch(2,1)
134 self.setMinimumSize(250,60)
142 if self.
parent_parent_.GetCarbonsOnly():
143 node.ColorByElement(
"ele=C")
145 node.ColorByElement()
149 if self.
parent_parent_.GetCarbonsOnly():
156 return self.
text_text_
161 QtWidgets.QWidget.__init__(self, parent)
168 text_label = QtWidgets.QLabel(text)
169 font = text_label.font()
172 grid = QtWidgets.QGridLayout()
173 grid.addWidget(text_label,0,0,1,1)
174 grid.setRowStretch(2,1)
176 self.setMinimumSize(250,60)
184 if self.
parent_parent_.GetCarbonsOnly():
185 node.ColorByChain(
'ele=C')
191 if self.
parent_parent_.GetCarbonsOnly():
198 return self.
text_text_
202 QtWidgets.QWidget.__init__(self, parent)
209 text_label = QtWidgets.QLabel(text)
210 font = text_label.font()
213 grid = QtWidgets.QGridLayout()
214 grid.addWidget(text_label,0,0,1,1)
215 grid.setRowStretch(2,1)
217 self.setMinimumSize(250,60)
225 scene_selection = gui.SceneSelection.Instance()
226 entity_count = scene_selection.GetActiveNodeCount()
227 for i
in range(0,scene_selection.GetActiveNodeCount()):
229 color=self.
gradient_gradient_.GetColorAt(0.0)
231 color=self.
gradient_gradient_.GetColorAt(float(i) / entity_count)
232 node = scene_selection.GetActiveNode(i)
233 if self.
parent_parent_.GetCarbonsOnly():
234 node.SetColor(color,
'ele=C')
243 if self.parent_.GetCarbonsOnly():
250 return self.
text_text_
graphical rendering of mol::EntityHandle entites