23 from PyQt4
import QtCore, QtGui
29 QtGui.QWidget.__init__(self, parent)
34 raise NotImplementedError,
"Subclasses must define GetText()"
37 raise NotImplementedError,
"Subclasses must define GetRenderMode()"
43 self.entities_.clear()
45 scene_selection = gui.SceneSelection.Instance()
46 if scene_selection.GetActiveNodeCount() == 0
and scene_selection.GetActiveViewCount() == 0:
47 self.setEnabled(
False)
50 if scene_selection.GetActiveNodeCount() > 0 :
51 for i
in range(0,scene_selection.GetActiveNodeCount()):
52 entity = scene_selection.GetActiveNode(i)
54 self.entities_.add(entity)
56 self.setEnabled(
False)
59 if scene_selection.GetActiveViewCount() > 0 :
60 entity = scene_selection.GetViewEntity()
61 self.entities_.add(entity)
63 if len(self.entities_)>0:
64 entity = self.entities_.pop()
65 self.options_=entity.GetOptions(self.GetRenderMode())
66 self.UpdateGui(self.options_)
67 QtGui.QWidget.setEnabled(self,
True)
69 QtGui.QWidget.setEnabled(self,
False)
graphical rendering of mol::EntityHandle entites