diff --git a/PRIVATE b/PRIVATE index ddb0dae72..dc9722c3c 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit ddb0dae72af9012cca45d9fa5665da41815e88f7 +Subproject commit dc9722c3c9787bbb0f63308a7015b6709e6d4f94 diff --git a/processing/post/vtk_addGridData.py b/processing/post/vtk_addGridData.py index a1713afb1..c458b1f07 100755 --- a/processing/post/vtk_addGridData.py +++ b/processing/post/vtk_addGridData.py @@ -25,10 +25,6 @@ parser.add_option( '--vtk', dest = 'vtk', type = 'string', metavar = 'string', help = 'VTK file name') -parser.add_option( '--inplace', - dest = 'inplace', - action = 'store_true', - help = 'modify VTK file in-place') parser.add_option('-r', '--render', dest = 'render', action = 'store_true', @@ -49,7 +45,6 @@ parser.add_option('-c', '--color', parser.set_defaults(data = [], tensor = [], color = [], - inplace = False, render = False, ) @@ -64,24 +59,23 @@ if os.path.splitext(options.vtk)[1] == '.vtr': reader.Update() rGrid = reader.GetOutput() writer = vtk.vtkXMLRectilinearGridWriter() - writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtr' if options.inplace else '_added.vtr')) elif os.path.splitext(options.vtk)[1] == '.vtk': reader = vtk.vtkGenericDataObjectReader() reader.SetFileName(options.vtk) reader.Update() rGrid = reader.GetRectilinearGridOutput() writer = vtk.vtkXMLRectilinearGridWriter() - writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtr' if options.inplace else '_added.vtr')) elif os.path.splitext(options.vtk)[1] == '.vtu': reader = vtk.vtkXMLUnstructuredGridReader() reader.SetFileName(options.vtk) reader.Update() rGrid = reader.GetOutput() writer = vtk.vtkXMLUnstructuredGridWriter() - writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtu' if options.inplace else '_added.vtu')) else: parser.error('Unsupported VTK file type extension.') +writer.SetFileName(options.vtk) + Npoints = rGrid.GetNumberOfPoints() Ncells = rGrid.GetNumberOfCells() diff --git a/processing/post/vtk_addPointcloudData.py b/processing/post/vtk_addPointCloudData.py similarity index 96% rename from processing/post/vtk_addPointcloudData.py rename to processing/post/vtk_addPointCloudData.py index 369320d3d..5ab1d419e 100755 --- a/processing/post/vtk_addPointcloudData.py +++ b/processing/post/vtk_addPointCloudData.py @@ -23,10 +23,6 @@ parser.add_option( '--vtk', dest = 'vtk', type = 'string', metavar = 'string', help = 'VTK file name') -parser.add_option( '--inplace', - dest = 'inplace', - action = 'store_true', - help = 'modify VTK file in-place') parser.add_option('-r', '--render', dest = 'render', action = 'store_true', @@ -153,7 +149,7 @@ for name in filenames: writer = vtk.vtkXMLPolyDataWriter() writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() - writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtp' if options.inplace else '_added.vtp')) + writer.SetFileName(options.vtk) writer.SetInputData(Polydata) writer.Write() diff --git a/processing/post/vtk_addRectilinearGridData.py b/processing/post/vtk_addRectilinearGridData.py index 83a1451a0..e445214fd 100755 --- a/processing/post/vtk_addRectilinearGridData.py +++ b/processing/post/vtk_addRectilinearGridData.py @@ -25,10 +25,6 @@ parser.add_option( '--vtk', dest = 'vtk', type = 'string', metavar = 'string', help = 'VTK file name') -parser.add_option( '--inplace', - dest = 'inplace', - action = 'store_true', - help = 'modify VTK file in-place') parser.add_option('-r', '--render', dest = 'render', action = 'store_true', @@ -49,7 +45,6 @@ parser.add_option('-c', '--color', parser.set_defaults(data = [], tensor = [], color = [], - inplace = False, render = False, ) @@ -158,16 +153,14 @@ for name in filenames: elif mode == 'point': rGrid.GetPointData().AddArray(VTKarray[me]) rGrid.Modified() - if vtk.VTK_MAJOR_VERSION <= 5: rGrid.Update() # ------------------------------------------ output result --------------------------------------- writer = vtk.vtkXMLRectilinearGridWriter() writer.SetDataModeToBinary() writer.SetCompressorTypeToZLib() - writer.SetFileName(os.path.splitext(options.vtk)[0]+('.vtr' if options.inplace else '_added.vtr')) - if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(rGrid) - else: writer.SetInputData(rGrid) + writer.SetFileName(options.vtk) + writer.SetInputData(rGrid) writer.Write() # ------------------------------------------ render result ---------------------------------------