23 from PyQt4
import QtGui
26 RENDERMODE_ATTRIBUTE_NAME =
"RenderMode"
27 KEEP_ATTRIBUTE_NAME =
"Keep"
28 FLAGS_ATTRIBUTE_NAME =
"Flags"
30 def __init__(self, render_mode, selection, flags, keep=False):
64 if (entity
is not None)
and isinstance(entity,
gfx.Entity):
68 group.SetAttribute(RenderOp.RENDERMODE_ATTRIBUTE_NAME, str(self.
GetRenderMode().name))
69 group.SetAttribute(RenderOp.KEEP_ATTRIBUTE_NAME, str(int(self.
IsKept())))
76 if (group.HasAttribute(RenderOp.RENDERMODE_ATTRIBUTE_NAME)
77 and group.HasAttribute(RenderOp.KEEP_ATTRIBUTE_NAME)):
78 render_mode = getattr(gfx.RenderMode, group.GetAttribute(RenderOp.RENDERMODE_ATTRIBUTE_NAME))
79 keep = bool(int(group.GetAttribute(RenderOp.KEEP_ATTRIBUTE_NAME)))
81 if group.HasAttribute(RenderOp.FLAGS_ATTRIBUTE_NAME):
82 flags = int(group.GetAttribute(RenderOp.FLAGS_ATTRIBUTE_NAME))
83 selection = group.GetTextData()
84 render_op =
RenderOp(render_mode,selection,flags,keep)
graphical rendering of mol::EntityHandle entites