Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vcs3D features for v2.1.1 #951

Merged
merged 67 commits into from Feb 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f21bf6c
Fix scripting var input from file
ThomasMaxwell Dec 5, 2014
e810977
Fix scripting var input from file
ThomasMaxwell Dec 5, 2014
ddf9e24
Merge branch 'vcs3D_features_for_v2.3' of git://github.com/UV-CDAT/uv…
ThomasMaxwell Dec 5, 2014
75cb439
Update dual input plot
ThomasMaxwell Dec 5, 2014
56c7ca8
Fix input ordering
ThomasMaxwell Dec 9, 2014
6b6100d
Fix dual input plot
ThomasMaxwell Dec 10, 2014
53a57fb
Remove baseline images
ThomasMaxwell Dec 10, 2014
7e77446
Debug dual input issue
ThomasMaxwell Dec 10, 2014
2eee810
Remove baseline images
ThomasMaxwell Dec 11, 2014
4515bf2
Fix scripting var input from file
ThomasMaxwell Dec 5, 2014
a5eb1a2
Update dual input plot
ThomasMaxwell Dec 5, 2014
98eba4c
Fix input ordering
ThomasMaxwell Dec 9, 2014
1d7e925
Fix dual input plot
ThomasMaxwell Dec 10, 2014
c8d6208
Debug dual input issue
ThomasMaxwell Dec 10, 2014
6ea5209
Remove baseline images
ThomasMaxwell Dec 11, 2014
e74092a
Merge branch 'vcs3D_features_for_v2.3' of git://github.com/UV-CDAT/uv…
ThomasMaxwell Dec 11, 2014
581af8d
Fix isosurface of single input
ThomasMaxwell Dec 12, 2014
dccfaa0
Fix colormap scaling for dual inputs
ThomasMaxwell Dec 12, 2014
5b7baed
Fix constituents selection init
ThomasMaxwell Dec 12, 2014
8f4db9f
Fix constit state sync with constit buttons
ThomasMaxwell Dec 16, 2014
3a037e4
Remove diagnostics
ThomasMaxwell Dec 16, 2014
bd4b5b1
Add provenance for constituents
ThomasMaxwell Dec 17, 2014
c376e0e
Implement constituent init read from vistrail
ThomasMaxwell Dec 17, 2014
bf99886
Implement constituent init read from vistrail
ThomasMaxwell Dec 17, 2014
68eb318
Fix Surface & Slice vis init
ThomasMaxwell Dec 22, 2014
0d4b9b9
Fix plot button init and isosurface animation
ThomasMaxwell Dec 23, 2014
597e078
Remove .idea files
ThomasMaxwell Dec 30, 2014
98ad44d
Catch animation run speed error
ThomasMaxwell Dec 30, 2014
1cabda4
Add diagnostics
ThomasMaxwell Dec 30, 2014
a1721a9
Clear cell plot parameters upon cell clear
ThomasMaxwell Jan 2, 2015
29beec3
fix getInitValues
ThomasMaxwell Jan 6, 2015
9c4ff52
Ignore pycharm files
ThomasMaxwell Jan 7, 2015
24f6498
Merge branch 'master' into vcs3D_features_for_v2.1.1
ThomasMaxwell Jan 7, 2015
bbca7bc
Remove diagnostics
ThomasMaxwell Jan 7, 2015
9a8ca3d
Remove more diagnostics
ThomasMaxwell Jan 7, 2015
6b372ac
Hook up config panel
ThomasMaxwell Jan 14, 2015
69f1afb
Fix config panel
ThomasMaxwell Jan 14, 2015
2cb3442
Fix config panel for slicers
ThomasMaxwell Jan 15, 2015
1cb050c
Partial fix to z slice coords
ThomasMaxwell Jan 15, 2015
b4e7194
Fix z slice position
ThomasMaxwell Jan 16, 2015
c4cb50b
Fix z slider position init
ThomasMaxwell Jan 17, 2015
e704bc6
Fix z slider rel position
ThomasMaxwell Jan 19, 2015
4255a62
Improve slicer efficiency
ThomasMaxwell Jan 19, 2015
b0e1eaa
Fix Hovmoller slice init
ThomasMaxwell Jan 21, 2015
535d323
Revert image plane widget and fix exceptions
ThomasMaxwell Jan 22, 2015
75fbc72
Create visibility toggle for widgets, visibility off for snapshots
ThomasMaxwell Jan 26, 2015
cc507f8
Create automated ctest generation.
ThomasMaxwell Jan 27, 2015
c2aa924
Set zslice range min to 0.01
ThomasMaxwell Jan 27, 2015
aafe5d0
Complete auto test function generation
ThomasMaxwell Jan 28, 2015
46e05bb
Decrease max vector density to avoid bogging down
ThomasMaxwell Jan 28, 2015
2834f0e
Merge branch 'master' into vcs3D_features_for_v2.1.1
ThomasMaxwell Jan 30, 2015
cb9f4ec
Merge branch 'escape-install-py' into vcs3D_features_for_v2.1.1
ThomasMaxwell Jan 30, 2015
3d2118d
Streamline testing
ThomasMaxwell Jan 30, 2015
9107111
Fix ctest update
ThomasMaxwell Jan 30, 2015
0d4b129
Fix vcsTest error
ThomasMaxwell Feb 2, 2015
c0033ea
Add features to automated testing capabilities
ThomasMaxwell Feb 3, 2015
e8ddcf2
fix update_baseline_repo
ThomasMaxwell Feb 4, 2015
f20e482
Add README file
ThomasMaxwell Feb 4, 2015
00c01ce
Add ctests and improve auto ctest generation
ThomasMaxwell Feb 4, 2015
b308b89
Merge branch 'master' into vcs3D_features_for_v2.1.1
ThomasMaxwell Feb 10, 2015
4d7ef29
Fix logowidget exception
ThomasMaxwell Feb 11, 2015
dce2089
Merge branch 'master' into vcs3D_features_for_v2.1.1
ThomasMaxwell Feb 11, 2015
c08f720
Merge branch 'master' into vcs3D_features_for_v2.1.1
ThomasMaxwell Feb 12, 2015
3739225
Merge branch 'master' into vcs3D_features_for_v2.1.1
ThomasMaxwell Feb 19, 2015
b59eb3d
Fix seg fault in constituents test
ThomasMaxwell Feb 24, 2015
e439c52
Merge master
ThomasMaxwell Feb 25, 2015
58dec73
Remove remaining merge conflict
ThomasMaxwell Feb 25, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -56,3 +56,6 @@ logs/
site.cfg
sources/
version
/.hooks-config
/.idea

5 changes: 0 additions & 5 deletions .hooks-config

This file was deleted.

14 changes: 10 additions & 4 deletions Packages/DV3D/Application.py
Expand Up @@ -42,9 +42,9 @@ def update( self, tmpl ):
if self.plot <> None:
self.plot.updateModule()

def onClosing(self):
def onClosing(self, cell ):
if self.plot <> None:
self.plot.onClosing()
self.plot.onClosing( cell )

def applyAction( self, action ):
if self.plot <> None:
Expand Down Expand Up @@ -85,5 +85,11 @@ def terminate( self ):

def start(self):
iren = self.plot.renderWindow.GetInteractor()
iren.Start()

iren.Start()

def hideWidgets(self):
self.plot.hideWidgets()

def showWidgets(self):
self.plot.showWidgets()

130 changes: 102 additions & 28 deletions Packages/DV3D/ButtonBarWidget.py

Large diffs are not rendered by default.

191 changes: 145 additions & 46 deletions Packages/DV3D/ConfigurationFunctions.py
Expand Up @@ -222,6 +222,11 @@ def get_parameter_name( serialized_value ):
namelist = deserialize_address( serialized_value )
return namelist[0]

def get_parameter_cell( serialized_value ):
namelist = deserialize_address( serialized_value )
if ( len( namelist ) < 2) or ( len(namelist[1]) < 3 ): return None
return eval( namelist[1] )

class ConfigManager:


Expand All @@ -243,10 +248,17 @@ def __init__( self, **args ):
self.parameters[basename] = self.getParameter( basename )
self.initialized = False

def clear( self, cell ):
for parm_address in self.parameters.keys():
pcell = get_parameter_cell( parm_address )
if (pcell == cell) or (pcell == None):
del self.parameters[ parm_address ]

def getParameter( self, param_name, **args ):
cell = args.get( 'cell', '' )
# print ' <<---------------------------------------------------->> Get Parameter: ', param_name, ' cell = ', cell
if cell: param_name = serialize_address( cell, param_name )
if cell:
param_name = serialize_address( cell, param_name )
cparm = self.parameters.get( param_name, None )
if cparm == None:
if self.parent is None:
Expand Down Expand Up @@ -281,18 +293,32 @@ def setParameter( self, param_name, data, **args ):
except ValueError: pass
# pdata = data if hasattr( data, '__iter__' ) else [ data ]
param.setInitValue( data )
# print ' <<---------------------------------------------------->> Set Parameter: ', param_name, " = ", str( data )
# print ' <<---------------------------------------------------->> Set Parameter: ', param_name, " = ", str( data )

def getParameterValue(self, param_name, **args ):
param = self.getParameter( param_name, **args )
if ( param == None ): return None
if param_name == 'Camera':
value = str( param.values )
else:
value = str( param.getValues() )
if param.getState(): value = value + ", vcs.on"
pval = param.getValues()
if hasattr( pval, '__iter__' ) and ( len( pval ) == 0 ):
value = 'vcs.on' if param.getState() else None
else:
value = str( pval )
if param.getState(): value = "( %s, vcs.on )" % value
return value

def getParameterDescription(self, param_name, **args ):
param = self.getParameter( param_name, **args )
if ( param == None ): return None
rv = {}
ignorable = args.get( 'ignorable', [] )
for key in param.values:
if not key in ignorable:
rv[key] = param.values[key]
return str( rv ) if ( len(rv) > 0 ) else None

def getConfigurableFunction(self, name, **args ):
rv = self.configurableFunctions.get( name, None )
if rv == None:
Expand Down Expand Up @@ -510,14 +536,16 @@ def addCategory(self, cat_name ):
class ConfigParameter:

def __init__(self, name, **args ):
self.name = name
self.name = name
# print "Create ConfigParameter, name = ", name
self.values = {}
self.children = set()
self.ValueChanged = SIGNAL( 'ValueChanged' )
self.varname = args.get( 'varname', name )
self.ptype = args.get( 'ptype', name )
self.parent = args.get( 'parent', None )
self.parent = args.get( 'parent', None )
self.stateKeyList = []
self.debug = False
if self.parent<> None:
self.parent.addChild( self )
self.values.update( self.parent.values )
Expand Down Expand Up @@ -575,23 +603,27 @@ def unpack( self, value_strs ):
print>>sys.stderr, " Error: parameter structure mismatch in %s ( %d vs %d )" % ( self.name, len( value_strs ), len( self.values.keys() ) ); sys.stderr.flush()
for ( key, str_val ) in zip( self.valueKeyList, value_strs ):
self.values[key] = deserialize_value( str_val )
# print " && Unpack parameter %s: %s " % ( self.name, str( self.values ) ); sys.stdout.flush()
if self.debug: print " && Unpack parameter %s: %s " % ( self.name, str( self.values ) )

def __len__(self):
return len(self.values)

def __getitem__(self, key):
if hasattr( key, 'id' ): key = key.id
return self.values.get( key, None )

def __setitem__(self, key, value ):
self.values[key] = value
if hasattr( key, 'id' ): key = key.id
self.values[key] = value
if self.debug: print "Parameter[%s]: set value item[%s]: %s " % ( self.name, key, str(value))
self.addValueKey( key )

def childUpdate( self, source, key, val ):
self.setValue( key, val )

def __call__(self, **args ):
self.values.update( args )
if self.debug: print " && Update parameter %s: %s " % ( self.name, str( self.values ) )
args1 = [ self.ptype ]
for item in args.items():
args1.extend( list(item) )
Expand All @@ -615,23 +647,31 @@ def getParameterType(self):

def initialize( self, config_str ):
self.values = eval( config_str )
if self.debug: print " && initialize parameter %s: %s " % ( self.name, str( self.values ) )
self.sort()

def serialize( self ):
return str( self.values )

def getValue( self, key=0, default_value=None ):
if key == None: return default_value
if key is None: return default_value
if hasattr( key, 'id' ): key = key.id
return self.values.get( key, default_value )

def getState( self ):
return self.values.get( 'state', None )

def getInitValue( self, default_value=None ):
ival = self.getValue( 'init' )
if ( ival == None ) and ( self.parent <> None ):
ival = self.parent.getInitValue()
return default_value if ( ival == None ) else ival
ival = self.getValue( 'relative' )
if ival == None:
ival = self.getValue( 'init' )
if ival == None:
ival = self.getValues()
if len( ival ) == 0:
ival = self.parent.getInitValue() if ( self.parent <> None ) else None
if ( ival == None ):
return default_value
return ival

def setInitValue( self, value, update = False ):
if type( value ) == dict:
Expand All @@ -647,26 +687,49 @@ def setInitValue( self, value, update = False ):
self.setValue( 'init', value, update )
self.setValues( [ value ] )


def setValue( self, key, val, update=False ):
self.values[ key ] = val
self.addValueKey( key )
if update:
args1 = [ self.ptype, key, val, self.name]
self.ValueChanged( args1 )
if self.parent <> None:
self.parent.childUpdate( self, key, val, )

if hasattr( key, 'id' ): key = key.id
tval = val[0] if isinstance( val, list ) else val
if isinstance( tval, str ) and ( tval[0] == '{' ): tval = eval(tval)
if isinstance( tval, dict ):
self.updateValues( tval, update )
else:
if self.debug:
print "Parameter[%s]: set value[%s]: %s " % ( self.name, key, str(val))
self.values[ key ] = val
self.addValueKey( key )
if update:
args1 = [ self.ptype, key, val, self.name]
self.ValueChanged( args1 )
if self.parent <> None:
self.parent.childUpdate( self, key, val, )

def updateValues( self, value_map, update ):
for (key, val1) in value_map.items():
val0 = self.values.get( key, None )
if val0 <> val1:
self.setValue( key, val1, update )

def signalUpdate( self ):
args = [ self.ptype, self.getValues(), self.name]
self.ValueChanged( args )

def setValues( self, values, update=False ):
for key,value in enumerate( values ):
if hasattr( key, 'id' ): key = key.id
self.setValue( key, value )
if not self.parent is None:
self.parent.setValue( key, value )

def initValues( self, values, update=False ):
for key,value in enumerate( values ):
if hasattr( key, 'id' ): key = key.id
val0 = self.values.get( key, None )
if val0 == None:
self.setValue( key, value )
if not self.parent is None:
self.parent.setValue( key, value )

def getValues( self ):
vals = []
for index in range( 0, 100 ):
Expand Down Expand Up @@ -712,21 +775,44 @@ def setRange(self, range ):

def getRange( self ):
return ( self.rmin, self.rmax )


class WrappedList:

def __init__(self,name):
self.name = name
self.list = []

def __get__(self):
return self.list

def __set__(self, value):
print "Set list %s: %s " % ( self.name, str( value ) )
self.list = value

def __len__(self):
return len( self.list )

def __getitem__( self, key ):
return self.list[key]

def __setitem__(self, key, value ):
print "Set list value %s[%s]: %s " % ( self.name, str(key), str( value ) )
self.list[key] = value


class ConfigurableFunction:

Default = 0
Slider = 1
ConfigurableFunctions = {}
Slider = 1
ConfigurableFunctions = {}

def __init__( self, manager, name, **args ):
self.name = name
self.initial_value = []
self.persist = args.get( 'persist', True )
self.manager = manager
# if name == 'XSlider':
# print "."
self.value = self.manager.addParameter( name, **args )
self.initial_value = []
# print " Create ConfigurableFunction %s, parm value = %s " % ( self.name, str(self.value) )
self.type = 'generic'
self.kwargs = args
self.cfg_state = None
Expand All @@ -744,14 +830,16 @@ def __init__( self, manager, name, **args ):
self.group = args.get( 'group', None )
self._persisted = True
self.interactionHandler = args.get( 'interactionHandler', None )

def updateInitialization( self, default_init_val=None ):
ival = self.value.getInitValue()
if ival <> None:
self.initial_value = ival
elif (self.initial_value == None):
self.initial_value = default_init_val
return self.initial_value

# def updateInitialization( self, default_init_val=None ):
# ival = self.value.getInitValue()
# if ival <> None:
# self.initial_value = ival
# elif (self.initial_value == None):
# self.initial_value = default_init_val
# if self.name == 'ZSlider':
# print 'updateInitialization: ', str( self.initial_value )
# return self.initial_value

def getState(self):
return self.value.getValue('state')
Expand Down Expand Up @@ -850,21 +938,17 @@ def __init__( self, manager, name, **args ):
self.UpdateSlidingSignal =SIGNAL('updateSliding')
self.type = 'slider'
self._range_bounds = args.get( 'range_bounds', None )
self._slider_bounds = None
self._slider_bounds_relative = True
self._initial_range = None
self.position = args.get( 'position', None )
if self.initial_value <> None:
for index, value in enumerate( self.initial_value ):
self.value.setValue( index, value )

def getPosition(self):
return self.position[0] if self.position else None

def scaleRange( self, scale_factor ):
if self._initial_range == None:
self._initial_range = self._range_bounds
if self._initial_range <> None:
self._range_bounds = [ irv * scale_factor for irv in self._initial_range ]

def getValueLength(self):
return len( self.sliderLabels )

Expand All @@ -873,7 +957,21 @@ def getRangeBounds(self):

def setRangeBounds(self, value):
self._range_bounds = copy.copy( value )


def getSliderBounds(self):
if self._slider_bounds == None:
self.setSliderBoundsToRange()
return copy.copy( self._slider_bounds )

def setSliderBoundsToRange( self ):
self._slider_bounds = copy.copy( self._range_bounds )
self._slider_bounds_relative = False

def setSliderBoundsToRelative( self ):
self._slider_bounds = [ 0.01, 1.0 ]
self._slider_bounds_relative = True


def getTitle( dsid, name, attributes, showUnits=False ):
long_name = attributes.get( 'long_name', attributes.get( 'standard_name', name ) )
if not showUnits: return "%s:%s" % ( dsid, long_name )
Expand Down Expand Up @@ -1256,7 +1354,8 @@ def addMetadata( self, metadata ):
dataVector = self.fieldData.GetAbstractArray( 'metadata' )
if dataVector == None:
cname = getClassName( self )
if cname <> "InputSpecs": print " Can't get Metadata for class %s " % cname
if cname <> "InputSpecs":
print " Can't get Metadata for class %s " % cname
else:
enc_mdata = encodeToString( metadata )
dataVector.InsertNextValue( enc_mdata )
Expand Down