25 RENDERMODE_ATTRIBUTE_NAME =
"RenderMode"
26 KEEP_ATTRIBUTE_NAME =
"Keep"
27 FLAGS_ATTRIBUTE_NAME =
"Flags"
29 def __init__(self, render_mode, selection, flags, keep=False):
63 if (entity
is not None)
and isinstance(entity,
gfx.Entity):
67 group.SetAttribute(RenderOp.RENDERMODE_ATTRIBUTE_NAME, str(self.
GetRenderMode().name))
68 group.SetAttribute(RenderOp.KEEP_ATTRIBUTE_NAME, str(int(self.
IsKept())))
75 if (group.HasAttribute(RenderOp.RENDERMODE_ATTRIBUTE_NAME)
76 and group.HasAttribute(RenderOp.KEEP_ATTRIBUTE_NAME)):
77 render_mode = getattr(gfx.RenderMode, group.GetAttribute(RenderOp.RENDERMODE_ATTRIBUTE_NAME))
78 keep = bool(int(group.GetAttribute(RenderOp.KEEP_ATTRIBUTE_NAME)))
80 if group.HasAttribute(RenderOp.FLAGS_ATTRIBUTE_NAME):
81 flags = int(group.GetAttribute(RenderOp.FLAGS_ATTRIBUTE_NAME))
82 selection = group.GetTextData()
83 render_op =
RenderOp(render_mode,selection,flags,keep)
graphical rendering of mol::EntityHandle entites