Changeset 1632

Show
Ignore:
Timestamp:
02/12/10 12:47:43 (6 months ago)
Author:
mturk
Message:

Fixed some issues with the transfer function editor widget -- made the range
editors have better formatting, made the aspect ratio for the volume rendered
image fixed at 1.0.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/yt/extensions/volume_rendering/transfer_function_widget.py

    r1559 r1632  
    3333from enthought.traits.ui.api import \ 
    3434    View, Item, HSplit, VSplit, ListEditor, InstanceEditor, ValueEditor, \ 
    35     HGroup, VGroup, CodeEditor, TextEditor 
     35    HGroup, VGroup, CodeEditor, TextEditor, RangeEditor 
    3636from enthought.chaco.api import Plot, ArrayPlotData 
    3737from enthought.enable.component_editor import ComponentEditor 
     
    5656    traits_view = View(VGroup( 
    5757                         HGroup( 
    58                     Item('center'), 
    59                     Item('rwidth', label='Width') 
     58                    Item('center', editor=RangeEditor(format='%0.4f')), 
     59                    Item('rwidth', label='Width', 
     60                               editor=RangeEditor(format='%0.4f')), 
     61                         ), 
     62                         HGroup( 
     63                    Item('red', editor=RangeEditor(format='%0.4f')), 
     64                    Item('green', editor=RangeEditor(format='%0.4f')), 
     65                    Item('blue', editor=RangeEditor(format='%0.4f')), 
     66                    Item('alpha', editor=RangeEditor(format='%0.4f')) 
    6067                               ), 
    61                          HGroup( 
    62                     Item('red'), 
    63                     Item('green'), 
    64                     Item('blue'), 
    65                     Item('alpha') 
    66                                ), 
    67                              ), 
     68                       show_border=True,), 
    6869                       ) 
    6970 
     
    128129                                      show_label=False, resizable=True), 
    129130                             ), 
    130                          Item('vr_image_plot', editor=ComponentEditor(), 
    131                                       show_label=False, resizable=True, 
     131                         Item('vr_image_plot', editor=ComponentEditor(size=(512,512)), 
     132                                      show_label=False, resizable=False, 
    132133                                      width=512, height=512)), 
    133134                         Item("gaussians", style='custom', 
     
    177178 
    178179    def _vr_image_plot_default(self): 
    179         plot = Plot(self.vr_image_data, default_origin="top left") 
     180        plot = Plot(self.vr_image_data, default_origin="top left", 
     181                    size=(512,512)) 
     182        plot.aspect_ratio = 1.0 
    180183        #plot.x_axis.orientation = "top" 
    181184        img_plot = plot.img_plot("vr_image_data")[0]