Skip to content

Commit 4176e6c

Browse files
committed
Merge pull request #912 from UV-CDAT/vcs3D-fix-animation-exception
Vcs3 d fix animation exception
2 parents fad53bd + 539e063 commit 4176e6c

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

Packages/DV3D/ButtonBarWidget.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ def processStateChangeEvent( self, button_id, key, state, force = False ):
533533
positions = [ position_index ] if position_index else range(4)
534534
for pindex in positions: self.releaseSlider( pindex )
535535
configFunct.processInteractionEvent( [ "InitConfig", 0, False, self ] )
536-
self.handler.restoreInteractionState( state )
536+
if (self.name <> "Configure"): self.handler.restoreInteractionState( state )
537+
537538
# config_function = self.configurableFunctions.get( button_id, None )
538539
# if config_function: config_function.processStateChangeEvent( state )
539540
# button = self.buttons.get( button_id, None )

Packages/DV3D/DV3DPlot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def saveAnimation(self):
394394

395395
def changeButtonActivation(self, button_name, activate, state = None ):
396396
button = self.buttonBarHandler.findButton( button_name )
397-
print " changeButtonActivation[%s], activate = %s, state = %s" % ( button_name, str(activate), str(state) )
397+
# print " changeButtonActivation[%s], activate = %s, state = %s" % ( button_name, str(activate), str(state) )
398398
if button:
399399
if activate: button.activate()
400400
else: button.deactivate()

Packages/DV3D/RectilinearGridPlot.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def __init__( self, **args ):
119119
self.cs_bbar = None
120120
self.probeFilter = None
121121
self.cursorActor = vtk.vtkActor()
122+
self.clipPlanes = vtk.vtkPlanes()
122123

123124
self.pipelineDebug = False
124125

@@ -136,7 +137,6 @@ def __init__( self, **args ):
136137
self.clipping_enabled = False
137138
self.cropRegion = None
138139
self.cropZextent = None
139-
self.clipper = None
140140
self.volRenderConfig = [ 'Default', 'False' ]
141141
self.transFunctGraphVisible = False
142142
self.transferFunctionConfig = None
@@ -429,18 +429,19 @@ def processScaleChange( self, old_spacing, new_spacing ):
429429
if ( self.planeWidgetZ <> None ) and self.planeWidgetZ.IsVisible():
430430
# print " Update planeWidgetZ "
431431
self.planeWidgetZ.UpdateInputs()
432+
433+
def initializeClipper(self):
434+
if( self.cropRegion == None ):
435+
self.cropRegion = self.getVolumeBounds()
436+
if self.clipper:
437+
if ( self.renderWindowInteractor <> None ):
438+
self.clipper.SetInteractor( self.renderWindowInteractor )
439+
self.clipper.PlaceWidget( self.cropRegion )
440+
self.clipper.GetPlanes( self.clipPlanes )
432441

433442
def activateEvent( self, caller, event ):
434443
StructuredGridPlot.activateEvent( self, caller, event )
435-
if self.clipper and ( self.cropRegion == None ):
436-
self.renwin = self.renderer.GetRenderWindow( )
437-
if self.renwin <> None:
438-
if ( self.renderWindowInteractor <> None ):
439-
self.clipper.SetInteractor( self.renderWindowInteractor )
440-
self.cropRegion = self.getVolumeBounds()
441-
self.clipper.PlaceWidget( self.cropRegion )
442-
self.clipPlanes = vtk.vtkPlanes()
443-
self.clipper.GetPlanes( self.clipPlanes )
444+
self.initializeClipper()
444445
self.render()
445446

446447
def getVolumeBounds( self, **args ):
@@ -1045,6 +1046,7 @@ def processToggleClippingCommand( self, args, config_function ):
10451046
elif args and args[0] == "Init":
10461047
plane_positions = config_function.initial_value
10471048
if (plane_positions <> None):
1049+
if not self.cropRegion: self.initializeClipper()
10481050
for ip, pval in enumerate( plane_positions ):
10491051
self.cropRegion[ip] = pval
10501052
self.clipper.PlaceWidget( self.cropRegion )
@@ -1064,7 +1066,7 @@ def endClip( self, caller=None, event=None ):
10641066
def executeClip( self, caller=None, event=None ):
10651067
np = 6
10661068
self.clipper.GetPlanes( self.clipPlanes )
1067-
if not self.cropRegion: self.cropRegion = [0.0]*np
1069+
if not self.cropRegion: self.initializeClipper()
10681070
for ip in range( np ):
10691071
plane = self.clipPlanes.GetPlane( ip )
10701072
o = plane.GetOrigin()

testing/dv3d/TestManager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,5 @@ def writeCMakeDef( self, f ):
154154
if __name__ == '__main__':
155155
from TestDefinitions import testManager
156156
# testManager.runTests()
157-
testManager.runTest( 'dv3d_hovmoller_test', True )
157+
testManager.runTest( 'dv3d_constituents_test', True )
158158
# testManager.showTest( 'dv3d_constituents_test' )

0 commit comments

Comments
 (0)