Esempio n. 1
0
    def update_shape(self, view):
        self.e.render_handles(self.opt_model)
        for key, graphics_handle in self.e.handles.items():
            poly = np.array(graphics_handle.polydata)
            poly_gbl, bbox = transform_poly(graphics_handle.tfrm, poly)
            if graphics_handle.polytype == 'polygon':
                p = view.create_polygon(poly_gbl,
                                        fill_color=self.render_color(),
                                        zorder=2.5)
            elif graphics_handle.polytype == 'polyline':
                hilite_kwargs = {
                    'color': lo_rgb['profile'],
                    'linewidth': lo_lw['hilite'],
                    'linestyle': '-'
                }
                priority = 2.

                if key == 'ct':
                    priority = 3.
                    hilite_kwargs['color'] = lo_rgb['ct']
                p = view.create_polyline(poly_gbl,
                                         hilite=hilite_kwargs,
                                         zorder=priority)
            else:
                break
            self.handles[key] = GUIHandle(p, bbox)
        return self.handles
Esempio n. 2
0
 def update_shape(self, view):
     self.e.render_handles(self.opt_model)
     for key, graphics_handle in self.e.handles.items():
         poly = np.array(graphics_handle.polydata)
         poly_gbl, bbox = transform_poly(graphics_handle.tfrm, poly)
         if graphics_handle.polytype == 'polygon':
             p = view.create_polygon(poly_gbl,
                                     fill_color=self.render_color(),
                                     zorder=2.5)
         elif graphics_handle.polytype == 'polyline':
             priority = 2.
             hc = 'red'
             if key == 'ct':
                 priority = 3.
                 hc = 'blue'
             p = view.create_polyline(poly_gbl, hilite=hc, zorder=priority)
         else:
             break
         self.handles[key] = GUIHandle(p, bbox)
     return self.handles