Skip to content

Commit

Permalink
Issue #6 #8, suppress Future warning at InsertNextPoint2
Browse files Browse the repository at this point in the history
  • Loading branch information
thompson318 committed Jan 16, 2020
1 parent 645abad commit f201731
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sksurgerytrackervisualisation/shapes/dynamic_point_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ability to dynamically add points
"""

from numpy import hstack, ones, int64, arange, ascontiguousarray
from numpy import hstack, ones, int64, arange, ascontiguousarray, warnings
from vtk import (vtkPoints, vtkCellArray, vtkPolyData, vtkPolyDataMapper,
VTK_ID_TYPE)
from vtk.util import numpy_support
Expand Down Expand Up @@ -69,6 +69,7 @@ def add_point(self, point):
:param: A 3 tuple representing the point coordinate
"""

self._vtk_points.InsertNextPoint(point)
with warnings.catch_warnings(): #see issue #8
warnings.simplefilter("ignore", FutureWarning)
self._vtk_points.InsertNextPoint(point)
self._update_actor()

0 comments on commit f201731

Please sign in to comment.