Skip to content

Commit

Permalink
Merge pull request #1095 from UV-CDAT/vcs3D-hide_3d_controls_for_2d_p…
Browse files Browse the repository at this point in the history
…lots

Vcs3 d hide 3d controls for 2d plots
  • Loading branch information
doutriaux1 committed Mar 4, 2015
2 parents 267e6cd + cd9ef58 commit 33a751c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
11 changes: 8 additions & 3 deletions Packages/DV3D/ButtonBarWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__( self, iren, **args ):
self.children = args.get( 'children', [] )
self.toggle = args.get( 'toggle', False )
self.parents = args.get( 'parents', [] )
self.visible = args.get( 'visible', True )
self.numberOfStates = args.get( 'nstates', ( 2 if self.toggle else len( self.names ) ) )
self.id = args.get( 'id', self.names[0] if self.numberOfStates else None )
self.key = args.get( 'key', None )
Expand All @@ -65,6 +66,9 @@ def __init__( self, iren, **args ):
# if self.id == 'ToggleVolumePlot':
# print "."

def setVisibility(self, visibility ):
self.visible = visibility

def processButtonEvent(self, *args ):
print '-----> processButtonEvent: ', str( args )

Expand Down Expand Up @@ -195,7 +199,7 @@ def size(self):
return self.image_size

def On(self):
if self.active:
if self.active and self.visible:
self.buttonWidget.On()
# print " Button %s on " % self.id

Expand All @@ -205,8 +209,9 @@ def Off(self):
# print " Button %s off " % self.id

def activate(self):
self.active = True
self.buttonWidget.On()
if self.visible:
self.active = True
self.buttonWidget.On()
# print " Button %s on " % self.id

def deactivate(self):
Expand Down
5 changes: 4 additions & 1 deletion Packages/DV3D/DV3DPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,10 @@ def buildPlotButtons( self, **args ):
self.buttonBarHandler.DefaultGroup = 'SliceRoundRobin'
if (self.type == '3d_vector') or not enable_3d_plots:
sliderLabels= 'Slice Position' if enable_3d_plots else []
b = bbar.addSliderButton( names=['ZSlider'], key='z', toggle=True, group='SliceRoundRobin', sliderLabels=sliderLabels, label="Slicing", state = 1, interactionHandler=self.processSlicingCommand )
b = bbar.addSliderButton( names=['ZSlider'], key='z', visible=enable_3d_plots, toggle=True, group='SliceRoundRobin', sliderLabels=sliderLabels, label="Slicing", state = 1, interactionHandler=self.processSlicingCommand )
if not enable_3d_plots:
vs_button = self.buttonBarHandler.findButton( 'VerticalScaling' )
if vs_button is not None: vs_button.setVisibility( False )
else:
b = bbar.addConfigButton( names=['SliceRoundRobin'], key='p', interactionHandler=bbar.sliceRoundRobin )
b = bbar.addSliderButton( names=['XSlider'], key='x', toggle=True, group='SliceRoundRobin', sliderLabels='X Slice Position', label="Slicing", position=[0,3], interactionHandler=self.processSlicingCommand )
Expand Down
10 changes: 5 additions & 5 deletions Packages/DV3D/StructuredGridPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ def buildBaseMap(self):
self.mapManager = MapManager( roi = self.roi )
self.renderer.AddActor( self.mapManager.getBaseMapActor() )

# if self.baseMapActor <> None: self.renderer.RemoveActor( self.baseMapActor )
# world_map = None
# map_border_size = 20
#
# self.y0 = -90.0
# if self.baseMapActor <> None: self.renderer.RemoveActor( self.baseMapActor )
# world_map = None
# map_border_size = 20
#
# self.y0 = -90.0
# self.x0 = 0.0
# dataPosition = None
# if world_map == None:
Expand Down
2 changes: 1 addition & 1 deletion testing/dv3d/TestDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'BasemapOpacity': [0.5],
'XSlider': ( vcs.off ),
'ZSlider': ( vcs.off ),
'YSlider': ( vcs.off ),
'YSlider': ( vcs.off ),
} )

# vcsTest( 'dv3d_constituents_test', file="geos5-sample.nc", vars = [ 'uwnd' ], type="3d_scalar", template="default",
Expand Down

0 comments on commit 33a751c

Please sign in to comment.