30 from PyQt4
import QtCore, QtGui
31 from color_select_widget
import ColorSelectWidget
36 QtGui.QWidget.__init__(self, parent)
42 uniform_label = QtGui.QLabel(self.
text_)
43 font = uniform_label.font()
48 top_layout = QtGui.QVBoxLayout()
50 grid = QtGui.QGridLayout()
52 grid.setRowStretch(1, 1)
53 grid.setRowStretch(3, 1)
54 grid.setColumnStretch(0,1)
55 grid.setColumnStretch(2,1)
57 top_layout.addWidget(uniform_label)
58 top_layout.addLayout(grid)
59 self.setLayout(top_layout)
63 self.setMinimumSize(250,150)
66 scene_selection = gui.SceneSelection.Instance()
67 for i
in range(0,scene_selection.GetActiveNodeCount()):
68 node = scene_selection.GetActiveNode(i)
69 if _img_present
and isinstance(node,
gfx.MapIso):
70 if self.color_select_widget_.GetGfxColor() != node.GetColor():
71 self.color_select_widget_.SetGfxColor(node.GetColor())
76 scene_selection = gui.SceneSelection.Instance()
77 for i
in range(0,scene_selection.GetActiveNodeCount()):
78 node = scene_selection.GetActiveNode(i)
81 if(scene_selection.GetActiveViewCount() > 0):
82 entity = scene_selection.GetViewEntity()
83 view = scene_selection.GetViewUnion()
87 gfx_color = self.color_select_widget_.GetGfxColor()
90 if self.parent_.GetCarbonsOnly():
91 node.SetColor(gfx_color,
"ele=C")
93 node.SetColor(gfx_color,
"")
94 elif _img_present
and isinstance(node,
gfx.MapIso):
95 node.SetColor(gfx_color)
99 gfx_color = self.color_select_widget_.GetGfxColor()
100 if self.parent_.GetCarbonsOnly():
107 self.color_select_widget_.SetSize(self.width()/2,self.height()/2)