Commit d4fa331c authored by David E. DeMarle's avatar David E. DeMarle

Merge branch 'changes-for-paraview-export-now' into 'master'

changes for ParaView 5.7 export now

See merge request !126
parents add7f47d f2454630
Pipeline #134341 failed with stage
in 0 seconds
......@@ -525,7 +525,7 @@ def make_cinema_store(proxies,
"color"+proxy_name, 'vis', [proxy_name])
fnp = ""
if forcetime:
if forcetime is not False:
# time specified, use it, being careful to append if already a list
tvalues.append(forcetime)
tprop = store.make_parameter('time', tvalues)
......@@ -830,7 +830,11 @@ def explore(cs, proxies, iSave=True, currentTime=None, userDefined={},
nearfar_values.append([x for x in cam.GetClippingRange()])
viewangle_values.append(cam.GetViewAngle())
except (KeyError):
pass
eye_values.append([x for x in eye])
at_values.append([x for x in at])
up_values.append([x for x in up])
nearfar_values.append([x for x in cam.GetClippingRange()])
viewangle_values.append(cam.GetViewAngle())
cs.add_metadata({'camera_eye': eye_values})
cs.add_metadata({'camera_at': at_values})
cs.add_metadata({'camera_up': up_values})
......@@ -907,7 +911,7 @@ def explore_customized_array_selection(
return numVals
def export_scene(baseDirName, viewSelection, trackSelection, arraySelection):
def export_scene(baseDirName, viewSelection, trackSelection, arraySelection, forcetime=False):
'''
This explores a set of user-defined views and tracks. export_scene is
called from vtkCinemaExport. The expected order of parameters is as
......@@ -942,6 +946,7 @@ def export_scene(baseDirName, viewSelection, trackSelection, arraySelection):
atLeastOneViewExported = False
cinema_dirs = []
new_files = {}
for viewName, viewParams in viewSelection.iteritems():
extension = os.path.splitext(viewParams[0])[1]
......@@ -1003,7 +1008,7 @@ def export_scene(baseDirName, viewSelection, trackSelection, arraySelection):
arrayRanges = {}
disableValues = cinemaParams.get('noValues', False)
cs = make_cinema_store(p, filePath, view, forcetime=False,
cs = make_cinema_store(p, filePath, view, forcetime=forcetime,
userDefined=userDefValues,
specLevel=specLevel,
camType=camType,
......@@ -1025,6 +1030,8 @@ def export_scene(baseDirName, viewSelection, trackSelection, arraySelection):
progressObject=progObj)
progObj.EndEvent()
new_files[viewName] = cs.get_new_files()
view.LockBounds = 0
if pid == 0:
......@@ -1040,7 +1047,7 @@ def export_scene(baseDirName, viewSelection, trackSelection, arraySelection):
# restore initial state
paraview.simple.SetActiveView(initialView)
restore_visibility(pvstate)
print ("Finished exporting Cinema database!")
return new_files
def prepare_selection(trackSelection, arraySelection):
......
......@@ -26,6 +26,7 @@ class FileStore(store.Store):
self.cached_searches = {}
self.cached_files = {}
self.metadata = {}
self.__new_files = []
def create(self):
"""creates a new file store"""
......@@ -187,6 +188,9 @@ class FileStore(store.Store):
super(FileStore, self).insert(document)
fname = self._get_filename(document.descriptor, readingFile=False)
if not os.path.exists(fname):
self.__new_files.append((document.descriptor,fname))
dirname = os.path.dirname(fname)
if not os.path.exists(dirname):
# In batch mode '-sym', the dir might be created by a different
......@@ -312,3 +316,6 @@ class FileStore(store.Store):
""" optimization of find()[0] for an important case where caller
knows exactly what to retrieve."""
return self._load_data(q)
def get_new_files(self):
return self.__new_files
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment