Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Packages/DV3D/ButtonBarWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ def processStateChangeEvent( self, button_id, key, state, force = False ):
positions = [ position_index ] if position_index else range(4)
for pindex in positions: self.releaseSlider( pindex )
configFunct.processInteractionEvent( [ "InitConfig", 0, False, self ] )
self.handler.restoreInteractionState( state )
if (self.name <> "Configure"): self.handler.restoreInteractionState( state )

# config_function = self.configurableFunctions.get( button_id, None )
# if config_function: config_function.processStateChangeEvent( state )
# button = self.buttons.get( button_id, None )
Expand Down
2 changes: 1 addition & 1 deletion Packages/DV3D/DV3DPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def saveAnimation(self):

def changeButtonActivation(self, button_name, activate, state = None ):
button = self.buttonBarHandler.findButton( button_name )
print " changeButtonActivation[%s], activate = %s, state = %s" % ( button_name, str(activate), str(state) )
# print " changeButtonActivation[%s], activate = %s, state = %s" % ( button_name, str(activate), str(state) )
if button:
if activate: button.activate()
else: button.deactivate()
Expand Down
24 changes: 13 additions & 11 deletions Packages/DV3D/RectilinearGridPlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def __init__( self, **args ):
self.cs_bbar = None
self.probeFilter = None
self.cursorActor = vtk.vtkActor()
self.clipPlanes = vtk.vtkPlanes()

self.pipelineDebug = False

Expand All @@ -136,7 +137,6 @@ def __init__( self, **args ):
self.clipping_enabled = False
self.cropRegion = None
self.cropZextent = None
self.clipper = None
self.volRenderConfig = [ 'Default', 'False' ]
self.transFunctGraphVisible = False
self.transferFunctionConfig = None
Expand Down Expand Up @@ -429,18 +429,19 @@ def processScaleChange( self, old_spacing, new_spacing ):
if ( self.planeWidgetZ <> None ) and self.planeWidgetZ.IsVisible():
# print " Update planeWidgetZ "
self.planeWidgetZ.UpdateInputs()

def initializeClipper(self):
if( self.cropRegion == None ):
self.cropRegion = self.getVolumeBounds()
if self.clipper:
if ( self.renderWindowInteractor <> None ):
self.clipper.SetInteractor( self.renderWindowInteractor )
self.clipper.PlaceWidget( self.cropRegion )
self.clipper.GetPlanes( self.clipPlanes )

def activateEvent( self, caller, event ):
StructuredGridPlot.activateEvent( self, caller, event )
if self.clipper and ( self.cropRegion == None ):
self.renwin = self.renderer.GetRenderWindow( )
if self.renwin <> None:
if ( self.renderWindowInteractor <> None ):
self.clipper.SetInteractor( self.renderWindowInteractor )
self.cropRegion = self.getVolumeBounds()
self.clipper.PlaceWidget( self.cropRegion )
self.clipPlanes = vtk.vtkPlanes()
self.clipper.GetPlanes( self.clipPlanes )
self.initializeClipper()
self.render()

def getVolumeBounds( self, **args ):
Expand Down Expand Up @@ -1045,6 +1046,7 @@ def processToggleClippingCommand( self, args, config_function ):
elif args and args[0] == "Init":
plane_positions = config_function.initial_value
if (plane_positions <> None):
if not self.cropRegion: self.initializeClipper()
for ip, pval in enumerate( plane_positions ):
self.cropRegion[ip] = pval
self.clipper.PlaceWidget( self.cropRegion )
Expand All @@ -1064,7 +1066,7 @@ def endClip( self, caller=None, event=None ):
def executeClip( self, caller=None, event=None ):
np = 6
self.clipper.GetPlanes( self.clipPlanes )
if not self.cropRegion: self.cropRegion = [0.0]*np
if not self.cropRegion: self.initializeClipper()
for ip in range( np ):
plane = self.clipPlanes.GetPlane( ip )
o = plane.GetOrigin()
Expand Down
2 changes: 1 addition & 1 deletion testing/dv3d/TestManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,5 @@ def writeCMakeDef( self, f ):
if __name__ == '__main__':
from TestDefinitions import testManager
# testManager.runTests()
testManager.runTest( 'dv3d_hovmoller_test', True )
testManager.runTest( 'dv3d_constituents_test', True )
# testManager.showTest( 'dv3d_constituents_test' )