23 from PyQt5
import QtCore, QtWidgets
29 QtWidgets.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 QtWidgets.QWidget.setEnabled(self,
True)
69 QtWidgets.QWidget.setEnabled(self,
False)
graphical rendering of mol::EntityHandle entites