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
48 changes: 47 additions & 1 deletion CMake/cdat_modules/vtk_external.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,53 @@ set(vtk_install "${cdat_EXTERNALS}")

set(GIT_CMD_STR GIT_REPOSITORY "${VTK_SOURCE}")

set(_vtk_modules "vtkRenderingImage;vtkRenderingVolume;vtkRenderingLabel;vtkRenderingFreeType;vtkRenderingFreeTypeOpenGL;vtkRenderingVolumeOpenGL;vtkRenderingCore;vtkRenderingOpenGL;vtkGeovisCore;vtkViewsCore;vtkViewsGeovis;vtkInteractionImage;vtkInteractionStyle;vtkInteractionWidgets;vtkCommonTransforms;vtkCommonCore;vtkCommonComputationalGeometry;vtkCommonExecutionModel;vtkCommonSystem;vtkCommonMisc;vtkFiltersFlowPaths;vtkFiltersStatistics;vtkFiltersAMR;vtkFiltersGeneric;vtkFiltersSources;vtkFiltersModeling;vtkFiltersExtraction;vtkFiltersSelection;vtkFiltersSMP;vtkFiltersCore;vtkFiltersHybrid;vtkFiltersTexture;vtkFiltersGeneral;vtkFiltersImaging;vtkFiltersGeometry;vtkIOImage;vtkIOCore;vtkIOExport;vtkIOImport;vtkIOGeometry;vtkImagingColor;vtkImagingSources;vtkImagingCore;vtkImagingGeneral;vtkImagingMath")
set(_vtk_modules
vtkRenderingImage
vtkRenderingVolume
vtkRenderingLabel
vtkRenderingFreeType
vtkRenderingFreeTypeOpenGL
vtkRenderingVolumeOpenGL
vtkRenderingCore
vtkRenderingOpenGL
vtkGeovisCore
vtkViewsCore
vtkViewsGeovis
vtkInteractionImage
vtkInteractionStyle
vtkInteractionWidgets
vtkCommonTransforms
vtkCommonCore
vtkCommonComputationalGeometry
vtkCommonExecutionModel
vtkCommonSystem
vtkCommonMisc
vtkFiltersFlowPaths
vtkFiltersStatistics
vtkFiltersAMR
vtkFiltersGeneric
vtkFiltersSources
vtkFiltersModeling
vtkFiltersExtraction
vtkFiltersSelection
vtkFiltersSMP
vtkFiltersCore
vtkFiltersHybrid
vtkFiltersTexture
vtkFiltersGeneral
vtkFiltersImaging
vtkFiltersGeometry
vtkIOImage
vtkIOCore
vtkIOExport
vtkIOImport
vtkIOGeometry
vtkImagingColor
vtkImagingSources
vtkImagingCore
vtkImagingGeneral
vtkImagingMath
)

if(NOT CDAT_BUILD_LEAN)
list(APPEND _vtk_modules "vtkIOFFMPEG")
Expand Down
81 changes: 54 additions & 27 deletions CMake/cdat_modules_extra/checkout_testdata.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
# If the current HEAD is not a named branch, use master.
# 5) Update the remote branches in the TESTDATA_DIR repo.
# 6) Check if the desired branch exists in TESTDATA_DIR's origin remote.
# If the desired remote branch does not exist, use master.
# 7) Check out the desired branch in TESTDATA_DIR repo.
# 8) Run 'git pull origin <branch>:<branch>' to update the repository.
# 7) Check if the desired branch exists in TESTDATA_DIR as a local branch.
# 8) If the neither the local or remote branch exist, use master.
# 9) Check out the local <branch> in TESTDATA_DIR repo.
# 10) If the remote branch exists, or we are using master, run
# 'git pull origin <branch>:<branch>' to fetch/update the local branch from
# the remote.
#
# Any failures are handled via non-fatal warnings. This is to allow the project
# to build when access to the repo is not available.
Expand Down Expand Up @@ -154,37 +157,57 @@ execute_process(COMMAND

if(NOT RESULT EQUAL 0)
message("Cannot update uvcdat-testdata checkout at \"${TESTDATA_DIR}\". "
"Error updating remote branches with 'git fetch --update-shallow --depth=1':\n."
"Error updating remote branches with "
"'git fetch --update-shallow --depth=1':\n."
"${OUTPUT}\n"
"Baseline images may be out of date.")
return()
endif()

# 6) Check if the desired branch exists in TESTDATA_DIR's origin remote.
# If the desired remote branch does not exist, use master.
execute_process(COMMAND
"${GIT_EXECUTABLE}" branch -r
"${GIT_EXECUTABLE}" branch -a --list "*${BRANCH}"
WORKING_DIRECTORY "${TESTDATA_DIR}"
RESULT_VARIABLE RESULT
ERROR_VARIABLE OUTPUT
OUTPUT_VARIABLE OUTPUT)

if(NOT RESULT EQUAL 0)
message("Cannot update uvcdat-testdata checkout at \"${TESTDATA_DIR}\". "
"Error updating remote branches with 'git fetch --update-shallow --depth=1':\n."
"${OUTPUT}\n"
"Error obtaining full branch list:\n${OUTPUT}"
"Baseline images may be out of date.")
return()
endif()

string(FIND "${OUTPUT}" "origin/${BRANCH}" POS)
if(POS EQUAL -1)
message("Remote branch 'origin/${BRANCH}' not found for repository at "
"'${TESTDATA_DIR}'. Using current master instead.")
message("Testing if remote branch 'origin/${BRANCH}' exists...")
string(FIND "${OUTPUT}" " remotes/origin/${BRANCH}\n" POS)
if(NOT POS EQUAL -1)
message("Remote branch exists.")
set(REMOTE_EXISTS "YES")
else()
message("Remote branch does not exist.")
set(REMOTE_EXISTS "NO")
endif()

# 7) Check if the desired branch exists locally:
message("Testing if local branch '${BRANCH}' exists...")
string(FIND "${OUTPUT}" " ${BRANCH}\n" POS) # Leading space in regex intended
if(NOT POS EQUAL -1)
message("Local branch exists.")
set(LOCAL_EXISTS "YES")
else()
message("Local branch does not exist.")
set(LOCAL_EXISTS "NO")
endif()

# 8) If the neither the local or remote branch exist, use master.
if(NOT REMOTE_EXISTS AND NOT LOCAL_EXISTS)
set(BRANCH "master")
set(REMOTE_EXISTS "YES")
set(LOCAL_EXISTS "YES")
endif()

# 7) Check out the desired branch in TESTDATA_DIR repo.
# 9) Check out the desired branch in TESTDATA_DIR repo.
message("Checking out branch '${BRANCH}' in repo '${TESTDATA_DIR}'.")
execute_process(COMMAND
"${GIT_EXECUTABLE}" checkout "${BRANCH}"
Expand All @@ -201,21 +224,25 @@ if(NOT RESULT EQUAL 0)
return()
endif()

# 8) Update the branch (in case it already existed during the checkout):
message("Updating \"${TESTDATA_DIR}:${BRANCH}\" from "
"\"${TESTDATA_URL}:${BRANCH}\"...")
execute_process(COMMAND
"${GIT_EXECUTABLE}" pull origin "${BRANCH}:${BRANCH}"
WORKING_DIRECTORY "${TESTDATA_DIR}"
RESULT_VARIABLE RESULT
ERROR_VARIABLE OUTPUT
OUTPUT_VARIABLE OUTPUT)
# 10) If the remote branch exists, or we are using master, run
# 'git pull origin <branch>:<branch>' to fetch/update the local branch from
# the remote.
if(REMOTE_EXISTS)
message("Updating \"${TESTDATA_DIR}:${BRANCH}\" from "
"\"${TESTDATA_URL}:${BRANCH}\"...")
execute_process(COMMAND
"${GIT_EXECUTABLE}" pull origin "${BRANCH}:${BRANCH}"
WORKING_DIRECTORY "${TESTDATA_DIR}"
RESULT_VARIABLE RESULT
ERROR_VARIABLE OUTPUT
OUTPUT_VARIABLE OUTPUT)

string(STRIP "${OUTPUT}" OUTPUT)
string(STRIP "${OUTPUT}" OUTPUT)

message("${OUTPUT}")
message("${OUTPUT}")

if(NOT RESULT EQUAL 0)
message("Error updating testdata repo! "
"Baseline images may be out of date.")
if(NOT RESULT EQUAL 0)
message("Error updating testdata repo! "
"Baseline images may be out of date.")
endif()
endif()
2 changes: 1 addition & 1 deletion Packages/vcs/Lib/Canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4029,8 +4029,8 @@ def close(self, *args, **kargs):
"""
if self.configurator:
self.endconfigure()
# Close the VCS Canvas
a = self.backend.close(*args, **kargs)
self.animate_info = []

return a

Expand Down
2 changes: 0 additions & 2 deletions Packages/vcs/Lib/VTKAnimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ def __init__(self, vcs_self):
self.renderers = []
self.last_size = None
self.modified_listener = None
import atexit
atexit.register(self.close)

def modified(self, obj, event):
# Use this to sync canvas sizes and to prevent configureEvent from
Expand Down
3 changes: 3 additions & 0 deletions Packages/vcs/Lib/VTKPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ def leftButtonReleaseEvent(self, obj, event):
self.clickRenderer = None

def configureEvent(self, obj, ev):
if not self.renWin:
return

cursor = self.renWin.GetCurrentCursor()
if sys.platform == "darwin" and ev == "ModifiedEvent" and cursor != self.oldCursor:
self.oldCursor = cursor
Expand Down
8 changes: 8 additions & 0 deletions Packages/vcs/Lib/animate_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ class AnimationController(animate_obj_old):
def __init__(self, vcs_self):
animate_obj_old.__init__(self, vcs_self)
self.create_thread = None
self.create_canvas = None
self.playback_thread = None

self.animation_created = False
Expand All @@ -779,6 +780,13 @@ def __init__(self, vcs_self):
self.AnimationPlayback = AnimationPlayback
self._number_of_frames = None

def close(self, preserve_pngs=False):
if self.create_canvas:
self.create_canvas.close()
self.create_canvas = None
self.animate_info = []
return super(AnimationController, self).close(preserve_pngs)

def set_signals(self, signals):
self.signals = signals

Expand Down
30 changes: 14 additions & 16 deletions Packages/vcs/Lib/vcsvtk/boxfillpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def _updateScalarData(self):
if self._gm.boxfill_type == "log10":
data = numpy.ma.log10(data)

self._data1 = self._context.trimData2D(data)
self._data2 = self._context.trimData2D(self._originalData2)
self._data1 = self._context().trimData2D(data)
self._data2 = self._context().trimData2D(self._originalData2)

def _updateContourLevelsAndColors(self):
"""Overrides baseclass implementation."""
Expand Down Expand Up @@ -174,7 +174,7 @@ def _plotInternal(self):

# create a new renderer for this mapper
# (we need one for each mapper because of camera flips)
self._context.fitToViewport(
self._context().fitToViewport(
act, [self._template.data.x1, self._template.data.x2,
self._template.data.y1, self._template.data.y2],
wc=[x1, x2, y1, y2], geo=self._vtkGeoTransform,
Expand All @@ -188,9 +188,9 @@ def _plotInternal(self):
z = self._originalData1.getAxis(-3)
else:
z = None
self._resultDict.update(self._context.renderTemplate(self._template,
self._data1,
self._gm, t, z))
self._resultDict.update(self._context().renderTemplate(self._template,
self._data1,
self._gm, t, z))

if getattr(self._gm, "legend", None) is not None:
self._contourLabels = self._gm.legend
Expand All @@ -217,17 +217,18 @@ def _plotInternal(self):
self._contourLevels.append(1.e20)

self._resultDict.update(
self._context.renderColorBar(self._template, self._contourLevels,
self._contourColors,
self._contourLabels,
self._colorMap))
self._context().renderColorBar(self._template, self._contourLevels,
self._contourColors,
self._contourLabels,
self._colorMap))

if self._context.canvas._continents is None:
if self._context().canvas._continents is None:
self._useContinents = False
if self._useContinents:
projection = vcs.elements["projection"][self._gm.projection]
self._context.plotContinents(x1, x2, y1, y2, projection,
self._dataWrapModulo, self._template)
self._context().plotContinents(x1, x2, y1, y2, projection,
self._dataWrapModulo,
self._template)

def _plotInternalBoxfill(self):
"""Implements the logic to render a non-custom boxfill."""
Expand Down Expand Up @@ -330,7 +331,6 @@ def _plotInternalCustomBoxfill(self):
tmpColors.append(C)

luts = []
cots = []
geos = []
wholeDataMin, wholeDataMax = vcs.minmax(self._originalData1)
for i, l in enumerate(tmpLevels):
Expand Down Expand Up @@ -362,7 +362,5 @@ def _plotInternalCustomBoxfill(self):
self._mappers.append(mapper)

self._resultDict["vtk_backend_luts"] = luts
if len(cots) > 0:
self._resultDict["vtk_backend_contours"] = cots
if len(geos) > 0:
self._resultDict["vtk_backend_geofilters"] = geos
24 changes: 11 additions & 13 deletions Packages/vcs/Lib/vcsvtk/isofillpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def _plotInternal(self):

luts = []
cots = []
geos = []
mappers = []
for i, l in enumerate(tmpLevels):
# Ok here we are trying to group together levels can be, a join
Expand Down Expand Up @@ -164,8 +163,6 @@ def _plotInternal(self):
self._resultDict["vtk_backend_luts"] = luts
if len(cots) > 0:
self._resultDict["vtk_backend_contours"] = cots
if len(geos) > 0:
self._resultDict["vtk_backend_geofilters"] = geos

numLevels = len(self._contourLevels)
if mappers == []: # ok didn't need to have special banded contours
Expand Down Expand Up @@ -221,7 +218,7 @@ def _plotInternal(self):

# create a new renderer for this mapper
# (we need one for each mapper because of cmaera flips)
self._context.fitToViewport(
self._context().fitToViewport(
act, [self._template.data.x1, self._template.data.x2,
self._template.data.y1, self._template.data.y2],
wc=[x1, x2, y1, y2], geo=self._vtkGeoTransform,
Expand All @@ -236,9 +233,9 @@ def _plotInternal(self):
else:
z = None

self._resultDict.update(self._context.renderTemplate(self._template,
self._data1,
self._gm, t, z))
self._resultDict.update(self._context().renderTemplate(self._template,
self._data1,
self._gm, t, z))

legend = getattr(self._gm, "legend", None)

Expand All @@ -263,13 +260,14 @@ def _plotInternal(self):
self._contourLevels.append(1.e20)

self._resultDict.update(
self._context.renderColorBar(self._template, self._contourLevels,
self._contourColors, legend,
self._colorMap))
self._context().renderColorBar(self._template, self._contourLevels,
self._contourColors, legend,
self._colorMap))

if self._context.canvas._continents is None:
if self._context().canvas._continents is None:
self._useContinents = False
if self._useContinents:
projection = vcs.elements["projection"][self._gm.projection]
self._context.plotContinents(x1, x2, y1, y2, projection,
self._dataWrapModulo, self._template)
self._context().plotContinents(x1, x2, y1, y2, projection,
self._dataWrapModulo,
self._template)
Loading