Skip to content

Commit 8e60550

Browse files
committed
Merge pull request #886 from UV-CDAT/vcs3D-fix-unexpected-error-884
Vcs3D fix unexpected error 884 looks good passes all ctest now both on my mac and linux.
2 parents e00618e + 70246cf commit 8e60550

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

Packages/DV3D/ImagePlaneWidget.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,8 @@ def SetLookupTable( self, table ):
998998

999999
def ConvertPositionToRelative( self, position ):
10001000
bounds = self.dataBounds[ self.PlaneOrientation*2:]
1001-
rpos = ( position - bounds[0] ) / ( bounds[1] - bounds[0] )
1001+
bsize = ( bounds[1] - bounds[0] )
1002+
rpos = 0.0 if ( bsize == 0.0 ) else ( position - bounds[0] ) / bsize
10021003
return rpos
10031004

10041005
def ConvertPositionFromRelative( self, relative_position ):
@@ -1012,7 +1013,7 @@ def SetSlicePositionFromRelative( self, rel_position ):
10121013
return position
10131014

10141015
def SetSlicePosition( self, position ):
1015-
print " SetSlicePosition: %s, bounds: %s " % ( str(position), str(self.dataBounds) )
1016+
# print " SetSlicePosition: %s, bounds: %s " % ( str(position), str(self.dataBounds) )
10161017
self.CurrentPosition = position
10171018
planeOrigin = list( self.PlaneSource.GetOrigin() )
10181019
planeOrigin[ self.PlaneOrientation ] = position

Packages/DV3D/RectilinearGridPlot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ def processSlicingCommand( self, args, config_function = None ):
366366
if plane_index == 2:
367367
slicePosition.setValue( 'relative', pos )
368368
pos = plane_widget.SetSlicePositionFromRelative( pos )
369-
slicePosition.setValues( [ pos ] )
369+
slicePosition.setValues( [ pos ] )
370+
plane_widget.SetSlicePosition( pos )
370371
state = config_function.getState()
371372
if state <> None:
372373
bbar = self.getPlotButtonbar()

testing/dv3d/TestDefinitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
'ScaleColormap': [-10.0, 10.0, 1],
1717
'BasemapOpacity': [0.5],
1818
'XSlider': ( -50.0, vcs.on ),
19-
'ZSlider': ( 10.0, vcs.on ),
19+
'ZSlider': ( 0.0, vcs.on ),
2020
'YSlider': ( 20.0, vcs.on ),
2121
} )
2222

testing/dv3d/TestManager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def build(self):
9595
plot_args.append( self.gm )
9696

9797
plot_kwargs = { 'cdmsfile': self.file.id, 'window_size': (900,600) }
98+
self.canvas.setantialiasing(False)
9899
self.canvas.plot( *plot_args, **plot_kwargs )
99100
self.plot = self.canvas.backend.plotApps[ self.gm ]
100101
# self.applyActions()
@@ -153,5 +154,5 @@ def writeCMakeDef( self, f ):
153154
if __name__ == '__main__':
154155
from TestDefinitions import testManager
155156
# testManager.runTests()
156-
# testManager.runTest( 'dv3d_slider_test', True )
157-
testManager.showTest( 'dv3d_constituents_test' )
157+
testManager.runTest( 'dv3d_slider_test', True )
158+
# testManager.showTest( 'dv3d_constituents_test' )
190 Bytes
Loading
49.6 KB
Loading

0 commit comments

Comments
 (0)