Beispiel #1
0
 def change_color (self, event=None):
     debug ("In Axes::change_color ()")
     clr = self.axes.GetProperty ().GetColor ()
     init_clr = "#%02x%02x%02x"%(clr[0]*255, clr[1]*255, clr[2]*255)
     color = tkColorChooser.askcolor (title="Change axes color", 
                                      initialcolor=init_clr)
     if color[1] is not None:
         clr = Common.tk_2_vtk_color (color[0])
         self.axes.GetProperty ().SetColor (*clr)
         if hasattr(self.axes, "GetAxisTitleTextProperty"):
             self.axes.GetAxisTitleTextProperty().SetColor(clr)
             self.axes.GetAxisLabelTextProperty().SetColor(clr)
         self.renwin.Render ()
Beispiel #2
0
 def set_stream_color (self, event=None):
     debug ("In PointStreamer::set_stream_color ()")
     clr = self.stream_act.GetProperty ().GetColor ()
     init_clr = "#%02x%02x%02x"%(clr[0]*255, clr[1]*255, clr[2]*255)
     color = tkColorChooser.askcolor (title="Change axes color", 
                                      initialcolor=init_clr)
     if color[1] is not None:
         Common.state.busy ()
         clr = Common.tk_2_vtk_color (color[0])
         self.stream_act.GetProperty ().SetColor (*clr)
         self.renwin.Render ()        
         Common.state.idle ()
         if self.color_mode != -1:
             msg = "Warning: This setting will have effect only if "\
                   "the coloring mode is set to 'No Coloring'."
             Common.print_err (msg)
Beispiel #3
0
 def change_color (self, event=None): 
     """ Called when the user changes the color of the actor."""
     debug ("In Module::change_color ()")
     clr = self.actor.GetProperty ().GetColor ()
     init_clr = "#%02x%02x%02x"%(clr[0]*255, clr[1]*255, clr[2]*255)
     color = tkColorChooser.askcolor (title="Change object color", 
                                      initialcolor=init_clr)
     if color[1] is not None:
         Common.state.busy ()
         clr = Common.tk_2_vtk_color (color[0])
         self.actor.GetProperty ().SetColor (*clr)
         self.renwin.Render ()        
         Common.state.idle ()
         if self.scalar_on_var.get () != 0:
             msg = "Warning: This setting will have effect only if "\
                   "there is no ScalarVisibility."
             Common.print_err (msg)