VTK issueshttps://gitlab.kitware.com/vtk/vtk/-/issues2020-03-23T09:40:52-04:00https://gitlab.kitware.com/vtk/vtk/-/issues/17814Improving polygon earcut2020-03-23T09:40:52-04:00Gerald CardaImproving polygon earcutI found some issues related to vtkTriangleFilter and self-touching (not intersecting) polygons. After looking at the source code I ended up at 'CanRemoveVertex()' in vtkPolygon.cxx. The code uses a call to 'Intersection()' in vtkLine.cxx...I found some issues related to vtkTriangleFilter and self-touching (not intersecting) polygons. After looking at the source code I ended up at 'CanRemoveVertex()' in vtkPolygon.cxx. The code uses a call to 'Intersection()' in vtkLine.cxx. The current code fails in the case of a return value != 0 (Note that Intersection() uses some defines for the result while CanRemoveVertex() just does a numerical compare).
In the special case of self-touching the current test will always fail and the higher level Triangulate() returns an empty result.
This behaviour could be fixed if 'CanRemoveVertex()' would do a special case handling:
VTK_NO_INTERSECTION
valid earcut, this is the current implementation
Proposed change:
VTK_YES_INTERSECTION
invalid earcut, originaly covered by != 0
VTK_ON_LINE
this has two sub-cases
1) We are 'outside' the polygon in respect to the other line (in/out based on direction). This means we are hit a self-touching line we can ignore -> valid earcut
2) We are 'inside' the polygon in respect to the other line. This a -> invalid earcut
I hope the above notes are understandable. I can provide a small Python script showing a none working triangulation with the current code (double self-touching edge polygon).
You can uncomment the z-value hack to play a trick on Intersection(). Note this is not a work-around as it creates other unwanted cases (but it works for the current example).
```python
#!/usr/bin/env python
from vtk import *
# define test polygon ---------------------------------------------------------
# 20 ______4______ 3 concave polygon CCW
# |17____|____6 | Self-touching two edges
# | |_________| | 4,19 at same coords
# |16 __|__ 7 | 5,18 at same coords
# | 13| 9 |10 | 9,14 at same coords
# | 12|_____|11 |
# |_____________|
# 1 2
x=[0,6,6,3,3,5,5,3,3,4,4,2,2,3,3,1,1,3,3,0]
y=[0,0,6,6,5,5,4,4,3,3,1,1,3,3,4,4,5,5,6,6]
npts = len(x)
# creation of the source ------------------------------------------------------
points = vtkPoints()
polygon = vtkPolygon()
polygon.GetPointIds().SetNumberOfIds( npts )
z = 0.0
for i in range( npts ):
points.InsertNextPoint( x[i], y[i], 0 ) # xy plane aligned
# points.InsertNextPoint( x[i], y[i], z )
# z = z + 0.001
polygon.GetPointIds().SetId(i, i)
polys = vtkCellArray()
polys.InsertNextCell(polygon)
polyData = vtkPolyData()
polyData.SetPoints(points)
polyData.SetPolys(polys)
result = polyData # set inital result
# filter the polydata ---------------------------------------------------------
#pdflt = vtkDelaunay2D()
#pdflt.SetSourceData( polyData )
pdflt = vtkTriangleFilter()
pdflt.SetInputData( polyData )
pdflt.Update()
result = pdflt.GetOutput()
# info ------------------------------------------------------------------------
numpoints = result.GetNumberOfPoints()
print( '#points = ', numpoints )
numpolys = result.GetNumberOfPolys()
print( '#polys = ', numpolys )
# map it ----------------------------------------------------------------------
mapper = vtkPolyDataMapper()
mapper.SetInputData( result )
# render it -------------------------------------------------------------------
actor = vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetRepresentationToWireframe()
render = vtkRenderer()
render.AddActor(actor)
renwin = vtkRenderWindow()
renwin.AddRenderer(render)
rwiact = vtkRenderWindowInteractor()
rwiact.SetRenderWindow(renwin)
rwiact.SetInteractorStyle(vtkInteractorStyleTrackballCamera())
rwiact.Initialize()
rwiact.Start()
```
As an alternate solution I could implement a improved ear-cutting function outside VTK (this makes less sense for me).
Best regards
Geraldhttps://gitlab.kitware.com/vtk/vtk/-/issues/17812XDMF file with a reference loop crashes ParaView2020-03-20T21:05:22-04:00Ben BoeckelXDMF file with a reference loop crashes ParaViewSee the report [on Discourse](https://discourse.paraview.org/t/xdmf-reader-crashes-entity-reference-loop/3518).See the report [on Discourse](https://discourse.paraview.org/t/xdmf-reader-crashes-entity-reference-loop/3518).https://gitlab.kitware.com/vtk/vtk/-/issues/17808vtkRenderer::ResetCamera reset the view angle2020-03-19T12:42:20-04:00Mathieu Westphal (Kitware)vtkRenderer::ResetCamera reset the view anglevtkRenderer::ResetCamera intentionally set the View Angle at 30 :
https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/Core/vtkRenderer.cxx#L1099
```
// Reset the perspective zoom factors, otherwise subsequent zooms will cause...vtkRenderer::ResetCamera intentionally set the View Angle at 30 :
https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/Core/vtkRenderer.cxx#L1099
```
// Reset the perspective zoom factors, otherwise subsequent zooms will cause
// the view angle to become very small and cause bad depth sorting.
this->ActiveCamera->SetViewAngle(30.0);
```
This comment does not seem to make sense to me, zooming/unzooming is done via a dolly, not via changing the view angle. So this call should be removed imo.
@allisonvacanti : You wrote this in 2013, so if you remember, that would be great.https://gitlab.kitware.com/vtk/vtk/-/issues/17807Document vtkActor's UserTransform and UserMatrix limitations2022-12-20T14:05:57-05:00Andras LassoDocument vtkActor's UserTransform and UserMatrix limitationsIt seems that lighting may be incorrect if UserTransform of a vtkActor is modified (normals need to be transformed manually, etc. - see more details [here](https://discourse.vtk.org/t/mirroring-and-normals/2767)).
It would be nice if VT...It seems that lighting may be incorrect if UserTransform of a vtkActor is modified (normals need to be transformed manually, etc. - see more details [here](https://discourse.vtk.org/t/mirroring-and-normals/2767)).
It would be nice if VTK documentation would clarify what is expected when someone modifies an actor’s UserTransform or UserMatrix. Is their usage recommended at all, and if yes, what the limitations are (e.g., normal vectors have to be changed accordingly).https://gitlab.kitware.com/vtk/vtk/-/issues/17803vtkMaskPoints does not passes through cell data2020-03-16T13:13:21-04:00Allen SandersonvtkMaskPoints does not passes through cell data*vtkMaskPoints is a filter that passes through points and **point attributes** from input dataset. (Other geometry is not passed through.) *
>
Emphasis added. When it comes to a mesh that is a VTK_VERTEX, there can be either point or ...*vtkMaskPoints is a filter that passes through points and **point attributes** from input dataset. (Other geometry is not passed through.) *
>
Emphasis added. When it comes to a mesh that is a VTK_VERTEX, there can be either point or cell data. It does not matter as they are the same. Regardless both point and cell data should be passed through. The vtkMaskPoints does not pass through cell data. It should.https://gitlab.kitware.com/vtk/vtk/-/issues/17802vtkStripper segfaults in presence of zero-extent lines2020-03-16T22:06:06-04:00Norman SpecificusvtkStripper segfaults in presence of zero-extent lines`vtkStripper` sometimes crashes with a segmentation fault for lines with zero-extent. I did not find a reliable pattern to reproduce this problem in 100%. But on my machine, the seg-fault occurred in 70-80% of the times.
The problem may...`vtkStripper` sometimes crashes with a segmentation fault for lines with zero-extent. I did not find a reliable pattern to reproduce this problem in 100%. But on my machine, the seg-fault occurred in 70-80% of the times.
The problem may generalize to other input as well.
System: MacOS 10.14.5
VTK: 8.1.2
```python
import vtk
import numpy as np
p = vtk.vtkPoints()
p.InsertNextPoint(np.random.rand(3))
p.InsertNextPoint(np.random.rand(3))
p.InsertNextPoint(np.random.rand(3))
c = vtk.vtkCellArray()
cell = vtk.vtkLine()
cell.GetPointIds().SetId(0,0)
cell.GetPointIds().SetId(1,1)
c.InsertNextCell(cell)
cell = vtk.vtkLine()
cell.GetPointIds().SetId(0,1)
cell.GetPointIds().SetId(1,2)
c.InsertNextCell(cell)
cell = vtk.vtkLine()
cell.GetPointIds().SetId(0,2)
cell.GetPointIds().SetId(1,0)
c.InsertNextCell(cell)
# This is the culprit - a line with zero extent.
# Just adding this line (and not the three other lines),
# will not lead to the exception. Only the presence of
# valid lines and zero-extent lines cause a problem.
cell = vtk.vtkLine()
cell.GetPointIds().SetId(0,0) # Start and end point
cell.GetPointIds().SetId(1,0) # are the same (pId=0)
c.InsertNextCell(cell)
poly = vtk.vtkPolyData()
poly.SetPoints(p)
poly.SetLines(c)
s = vtk.vtkStripper()
s.SetInputData(poly)
s.Update() # The crash is produced here.
```
Here is a typical stack trace for the segfault.
```
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libvtkCommonDataModel-8.1.1.dylib 0x0000000102b22490 vtkPolyData::GetPointCells(long long, vtkIdList*) + 192
1 libvtkFiltersCore-8.1.1.dylib 0x000000010329b15b vtkStripper::RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 6779
2 libvtkCommonExecutionModel-8.1.1.dylib 0x0000000102ed1275 vtkExecutive::CallAlgorithm(vtkInformation*, int, vtkInformationVector**, vtkInformationVector*) + 69
3 libvtkCommonExecutionModel-8.1.1.dylib 0x0000000102ecbb5d vtkDemandDrivenPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 61
4 libvtkCommonExecutionModel-8.1.1.dylib 0x0000000102ec741b vtkCompositeDataPipeline::ExecuteData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 107
5 libvtkCommonExecutionModel-8.1.1.dylib 0x0000000102ecb2f7 vtkDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 1175
6 libvtkCommonExecutionModel-8.1.1.dylib 0x0000000102ef1a1b vtkStreamingDemandDrivenPipeline::ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*) + 539
7 libvtkCommonExecutionModel-8.1.1.dylib 0x0000000102ef1f9b vtkStreamingDemandDrivenPipeline::Update(int, vtkInformationVector*) + 283
8 libvtkCommonExecutionModelPython36D-8.1.1.dylib 0x0000000102e34f23 PyvtkAlgorithm_Update(_object*, _object*) + 387
9 org.python.python 0x000000010141d7cb _PyCFunction_FastCallDict + 491
10 org.python.python 0x000000010149f747 call_function + 439
11 org.python.python 0x000000010149beb7 _PyEval_EvalFrameDefault + 27559
12 org.python.python 0x00000001014a01af _PyEval_EvalCodeWithName + 2447
13 org.python.python 0x0000000101495244 PyEval_EvalCode + 100
14 org.python.python 0x00000001014cb381 PyRun_FileExFlags + 209
15 org.python.python 0x00000001014cabf2 PyRun_SimpleFileExFlags + 882
16 org.python.python 0x00000001014e4b12 Py_Main + 3554
17 org.python.python 0x00000001013c3df8 0x1013c3000 + 3576
18 libdyld.dylib 0x00007fff681083d5 start + 1
```https://gitlab.kitware.com/vtk/vtk/-/issues/17800Floating point exceptions in Mesa in Debug build2020-03-09T08:52:33-04:00Kyle EdwardsFloating point exceptions in Mesa in Debug buildWhen building VTK in Debug mode, lots of tests throw floating point exceptions from inside Mesa when using software rendering. These exceptions are not thrown in Release mode due to the following code in `CMake/vtkTestingRenderingDriver....When building VTK in Debug mode, lots of tests throw floating point exceptions from inside Mesa when using software rendering. These exceptions are not thrown in Release mode due to the following code in `CMake/vtkTestingRenderingDriver.cmake`:
```c++
#ifndef NDEBUG
vtkFloatingPointExceptions::Enable();
#endif
```
There should be a flag that controls this behavior (and turns off the exceptions by default) orthogonal to the VTK build type.https://gitlab.kitware.com/vtk/vtk/-/issues/17795vtkImageViewer shouldn't crash when no render window2020-03-05T21:17:25-05:00Florent TOMIvtkImageViewer shouldn't crash when no render windowHello,
In vtkImageViewer2, "RenderWindow" member is almost always checked before use. The almost being when not checked in "vtkImageViewer2::Render" when the window size is set.
Even though the class is meant for displaying (hence embed...Hello,
In vtkImageViewer2, "RenderWindow" member is almost always checked before use. The almost being when not checked in "vtkImageViewer2::Render" when the window size is set.
Even though the class is meant for displaying (hence embedding the render window), a crash behaviour shouldn't be allowed (in my opinion). Maybe add a log (error or warning) ?
How to reproduce:
- Setup a classic "vtkImageViewer2" use case (like in [ReadDICOMSeries example](https://lorensen.github.io/VTKExamples/site/Cxx/IO/ReadDICOMSeries/))
- Call "SetRenderWindow" with nullptr
- It will crash at first renderhttps://gitlab.kitware.com/vtk/vtk/-/issues/17792Division by zero in vtkPlaneWidget::MoveOrigin2020-02-25T12:06:04-05:00Kirill VolyanskiyDivision by zero in vtkPlaneWidget::MoveOriginSometimes it happens that motion vector is zero and the plane widget crashes. So it is necessary to add check for zero v norm.
Like this
if (vN < 1e-6) return;Sometimes it happens that motion vector is zero and the plane widget crashes. So it is necessary to add check for zero v norm.
Like this
if (vN < 1e-6) return;https://gitlab.kitware.com/vtk/vtk/-/issues/17791Missing covalent radius causes crazy bonds2020-02-21T05:39:16-05:00JellbyMissing covalent radius causes crazy bondsSome elements have no covalent radius defined in the Blue Obelisk database, which causes too many bonds created by the `vtkSimpleBondPerceiver`. And with "too many" I mean bonds with *everything*:
![molecule with too many bonds](https:/...Some elements have no covalent radius defined in the Blue Obelisk database, which causes too many bonds created by the `vtkSimpleBondPerceiver`. And with "too many" I mean bonds with *everything*:
![molecule with too many bonds](https://discourse.vtk.org/uploads/default/original/2X/c/c366d1b915bb325e54a4109518c504a35f17be34.png)
Covalent radii should have reasonable default values, or `vtkSimpleBondPerceiver` should use reasonable default values when no data is available.
(see https://discourse.vtk.org/t/sensible-default-for-covalent-radius/2648)https://gitlab.kitware.com/vtk/vtk/-/issues/17790[vtk8.90] vtkCutter not show scalar information2020-03-16T12:55:48-04:00Yue JIN[vtk8.90] vtkCutter not show scalar informationI use vtkCutter to show a section of an unstructuredgrid. My code works well in vtk 8.2. But in vtk 8.9, the actor of vtkCutter becomes white like shown in the picture attached. All these actors are rendered in QVTKOpenGLNativeWidget.
![...I use vtkCutter to show a section of an unstructuredgrid. My code works well in vtk 8.2. But in vtk 8.9, the actor of vtkCutter becomes white like shown in the picture attached. All these actors are rendered in QVTKOpenGLNativeWidget.
![vktcutter](/uploads/1da2432001d58a9c3dffdf6487c6b8f0/vktcutter.png)https://gitlab.kitware.com/vtk/vtk/-/issues/17789Contour scaling not working in vtkOrientedGlyphContourRepresentation2020-02-27T05:57:43-05:00Gerald LodronContour scaling not working in vtkOrientedGlyphContourRepresentationat line 514 of vtkOrientedGlyphContourRepresentation.cxx:
```
worldPos[0] = centroid[0] + ratio * ( ref[0] - centroid[0] );
worldPos[1] = centroid[0] + ratio * ( ref[1] - centroid[1] );
worldPos[2] = centroid[0] + ratio * ( ref[2]...at line 514 of vtkOrientedGlyphContourRepresentation.cxx:
```
worldPos[0] = centroid[0] + ratio * ( ref[0] - centroid[0] );
worldPos[1] = centroid[0] + ratio * ( ref[1] - centroid[1] );
worldPos[2] = centroid[0] + ratio * ( ref[2] - centroid[2] );
```
should be:
```
worldPos[0] = centroid[0] + ratio * ( ref[0] - centroid[0] );
worldPos[1] = centroid[1] + ratio * ( ref[1] - centroid[1] );
worldPos[2] = centroid[2] + ratio * ( ref[2] - centroid[2] );
```
for some reason the right button event onto a node of the vtkContourWidget's polygon also doesnt work/doesnt call callback. I added the lines
```
GetEventTranslator()->RemoveTranslation( vtkCommand::RightButtonPressEvent );
GetEventTranslator()->RemoveTranslation( vtkCommand::RightButtonReleaseEvent );
GetEventTranslator()->SetTranslation(
vtkCommand::RightButtonPressEvent,
vtkEvent::NoModifier, 103, 0, NULL,
vtkWidgetEvent::AddFinalPoint );
GetEventTranslator()->SetTranslation(
vtkCommand::RightButtonPressEvent,
vtkEvent::ShiftModifier, 103, 0, NULL,
vtkWidgetEvent::Scale );
GetEventTranslator()->SetTranslation(
vtkCommand::RightButtonReleaseEvent,
vtkEvent::NoModifier, 103, 0, NULL,
vtkWidgetEvent::EndScale );
GetEventTranslator()->SetTranslation(
vtkCommand::RightButtonReleaseEvent,
vtkEvent::ShiftModifier, 103, 0, NULL,
vtkWidgetEvent::EndScale );
```
to get it working if i use scaling with shift modifier, but it should work without shift modifier as intended... so there are 2 issues....https://gitlab.kitware.com/vtk/vtk/-/issues/17788vtkSliderRepresentation2D doesn't scale correctly to window changes2021-08-24T01:16:50-04:00Yue JINvtkSliderRepresentation2D doesn't scale correctly to window changesIf vtkSliderWidget uses vtkSliderRepresentation2D and is not horizontally aligned, any changes to the aspect ratio of the render-window will lead to wrong scaling of the widget. This doesn't happen if the widget is horizontally aligned i...If vtkSliderWidget uses vtkSliderRepresentation2D and is not horizontally aligned, any changes to the aspect ratio of the render-window will lead to wrong scaling of the widget. This doesn't happen if the widget is horizontally aligned in the view.
This issue was first found more than 10 years ago, but it still exists in version 8.9:
https://gitlab.kitware.com/vtk/vtk/issues/8270
https://gitlab.kitware.com/vtk/vtk/issues/4382
I use many vtkSliderWidgets in my application. Hope that this bug can be fixed.https://gitlab.kitware.com/vtk/vtk/-/issues/17787vtkWebViewPort: vtkOpenGLCamera has no attribute 'ResetCamera'2020-02-18T21:30:02-05:00Arnaud BotellavtkWebViewPort: vtkOpenGLCamera has no attribute 'ResetCamera'I am using the `vkWebViewPort` and the rpc `"viewport.camera.reset"`. Here is the error I get:
```"AttributeError("'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLCamera' object has no attribute 'ResetCamera'",)"```
I cannot find how the `Res...I am using the `vkWebViewPort` and the rpc `"viewport.camera.reset"`. Here is the error I get:
```"AttributeError("'vtkmodules.vtkRenderingOpenGL2.vtkOpenGLCamera' object has no attribute 'ResetCamera'",)"```
I cannot find how the `ResetCamera` method referenced [here](https://gitlab.kitware.com/vtk/vtk/blob/master/Web/Python/vtkmodules/web/protocols.py#L147) is supposed to work.
Thanks for your help.https://gitlab.kitware.com/vtk/vtk/-/issues/17783EdgeVisibilityOn producing wrong result2021-04-15T04:16:30-04:00Rodrigo MologniEdgeVisibilityOn producing wrong resultI would like to understand why the back edges of the cells are shown when the edges visibility of the grid is on (`EdgesVisibilityOn`). This problem does not occur when I set the grid representation to wireframe (`SetRepresentationToWire...I would like to understand why the back edges of the cells are shown when the edges visibility of the grid is on (`EdgesVisibilityOn`). This problem does not occur when I set the grid representation to wireframe (`SetRepresentationToWireframe`).
| EdgeVisibilityOn | SetRepresentationToWireframe |
| ------ | ------ |
| ![EdgeVisibilityOn](/uploads/afffb1a357e560bda4e4902a9fa248ea/EdgeVisibilityOn.png)| ![SetRepresentationToWireframe](/uploads/d870bbe3393a71ecb54d04ceea792cea/SetRepresentationToWireframe.png)|
In `EdgeVisibilityOn`:
```
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().EdgeVisibilityOn()
renderer = vtk.vtkRenderer()
renderer.AddActor(actor)
```
In `SetRepresentationToWireframe`:
```
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor2 = vtk.vtkActor()
actor2.SetMapper(mapper)
actor2.GetProperty().SetRepresentationToWireframe()
actor2.GetProperty().SetColor(0, 0, 0)
renderer = vtk.vtkRenderer()
renderer.AddActor(actor)
renderer.AddActor(actor2)
```https://gitlab.kitware.com/vtk/vtk/-/issues/17781PySide2 [linux]: polygons aren't shaded correctly when rendered in pyside22020-02-10T22:05:36-05:00simon klemencPySide2 [linux]: polygons aren't shaded correctly when rendered in pyside2## System
* Linux (Arch) Kernel 5.5.2
* VTK 8.2 (anaconda)
* PySide2 5.13.2 (anaconda)
## Problem:
Polygon faces aren't rendered correctly.
The issue came with vtk 8.1.2 -> 8.2.0
## Steps to reproduce:
* download [t...## System
* Linux (Arch) Kernel 5.5.2
* VTK 8.2 (anaconda)
* PySide2 5.13.2 (anaconda)
## Problem:
Polygon faces aren't rendered correctly.
The issue came with vtk 8.1.2 -> 8.2.0
## Steps to reproduce:
* download [test.py](/uploads/fa265f05ec8a8ba64b562762c620b467/test.py)
* install vtk with pyside 2 on linux
```
conda install vtk=8.2 pyside2
python test.py
```
i tried different combinations of inverted orientation / culling,..https://gitlab.kitware.com/vtk/vtk/-/issues/17779UTF-8 filename support for Windows via vtksys2023-11-20T11:59:25-05:00David GobbiUTF-8 filename support for Windows via vtksysIn !6122 the default KWSys encoding for VTK on Windows was changed to UTF-8 in `Utilities/KWSys/CMakeLists.txt`:
set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
This causes `vtksys::Encoding::ToWide()` and `vtksys::Encoding::ToWin...In !6122 the default KWSys encoding for VTK on Windows was changed to UTF-8 in `Utilities/KWSys/CMakeLists.txt`:
set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
This causes `vtksys::Encoding::ToWide()` and `vtksys::Encoding::ToWindowsExtendedPath()` to decode their arguments as UTF-8 instead of using the Windows system locale. The benefit is that it allows VTK users to access filenames that contain Unicode characters that aren't within their locale's character set. The goal is, for example, to allow a VTK user in the USA to easily access a filename that contains Chinese characters.
Of course, in order for this to work, VTK must access the filesystem via `vtksys`, or if this isn't possible, then VTK must at least use `vtksys::Encoding::ToWindowsExtendedPath()` to convert UTF-8 strings to the wide strings that Windows uses to natively support Unicode on its filesystems.
Stuff that has been done: !6122 !6291 !6301 !6422 !6426
- change `fopen()` to `vtksys::SystemTools::Fopen()`
- change `ifstream/ofstream` to `vtksys::ifstream/ofstream`
- use `vtksys::Encoding::ToWindowsExtendedPath()` where the above is impossible/inconvenient
**Stuff that hasn't been done:**
The changes above covered VTK classes that access files via fopen() and C++ streams. However, they didn't touch VTK classes that use third-party libraries such as hdf5, netcdf, or libz to access files.
VTKs third-party IO libraries fit into three categories:
1. libraries that require the files to already be open: jpeg, png, ...
2. libraries that provide 'wide string' APIs for use on Windows: hdf5, zlib, tiff, ...
3. libraries that only allow narrow strings encoded in the current locale: netcdf, ...
For (1), nothing need be done, as these are covered by the previous batch of changes.
For (2), it will be necessary to change the VTK classes that use these libraries so that they apply `vtksys::Encoding::ToWindowsExtendedPath()` and call the 'wide' variant of the library APIs. Examples are the vtkNIFTIImageReader/Writer (for zlib), and all VTK classes that use hdf5.
For (3), there is no good solution at this time. If a library accepts neither UTF-8 nor wide strings, the options are:
- accept only narrow strings in the locale encoding, instead of accepting UTF-8, or
- accept UTF-8 and attempt to convert it to a narrow string in the locale encoding (generate an error on failure)
The first option really isn't acceptable, because VTK users shouldn't be expected to consult the documentation for individual VTK classes to see whether they expect UTF-8 vs. the locale encoding. And this is assuming that the documentation actually provides this information and is kept up-to-date.
The second option is better, because it at least allows users to work with UTF-8 filenames that only use characters from their local language. Also, if illegal characters are encountered, they can be informed via an error message that this is the reason they are unable to open the file.
**Addendum: vtkDirectory**
The vtkDirectory class currently uses the Windows C library functions '\_findfirst()' and '\_findnext()' and narrow strings.https://gitlab.kitware.com/vtk/vtk/-/issues/17778vtkIdFilter should (optionally) pass data arrays2020-02-03T19:16:06-05:00Joachim PouderouxvtkIdFilter should (optionally) pass data arrays`vtkIdFilter` can generate point & cell data ids but it has no option to pass the input data arrays to the output.
We should add an option to pass the existing data arrays into the output mesh.
How to reproduce with ParaView:
- Create...`vtkIdFilter` can generate point & cell data ids but it has no option to pass the input data arrays to the output.
We should add an option to pass the existing data arrays into the output mesh.
How to reproduce with ParaView:
- Create a Wavelet
- Apply the Generate Ids filter
=> Output does not contains the RTData point scalar array.https://gitlab.kitware.com/vtk/vtk/-/issues/17777vtkExtractSelection is not copying FieldData2020-01-30T00:26:31-05:00Mathieu Westphal (Kitware)vtkExtractSelection is not copying FieldDatavtkExtractSelection does not seem to copy field data associated with the selection.
Steps to reproduce (with ParaView)
* Open ParaView
* Open can.ex2, check all arrays, Apply
* Color by "Element Block Ids"
* Select a few cells
* Ex...vtkExtractSelection does not seem to copy field data associated with the selection.
Steps to reproduce (with ParaView)
* Open ParaView
* Open can.ex2, check all arrays, Apply
* Color by "Element Block Ids"
* Select a few cells
* Extract Selection, Apply
* "Element Block Ids" is not present in outputhttps://gitlab.kitware.com/vtk/vtk/-/issues/17773Should we migrate from jsoncpp?2020-01-24T10:59:30-05:00Ben BoeckelShould we migrate from jsoncpp?There are a number of JSON libraries out there. I'd like to keep VTK on just one. ADIS is using RapidJSON in !6402, but I'd like to know our future before merging/requiring a second one. There are 5 ParaView modules and 6 VTK modules usi...There are a number of JSON libraries out there. I'd like to keep VTK on just one. ADIS is using RapidJSON in !6402, but I'd like to know our future before merging/requiring a second one. There are 5 ParaView modules and 6 VTK modules using `VTK::jsoncpp` today for an idea of the porting burden.
I know SMTK has been happy with nlohmann_json. RapidJSON was apparently chosen originally for other projects because it supported JSON Schema validation, but there is [this project](https://github.com/pboettch/json-schema-validator) built on nlohmann for that (if VTK ever needs it).
Whatever we choose, I don't want to repeat our XML library explosion with JSON libraries as well. The third party packages are hard enough to wrangle without adding even more :) .
Cc: @chuck.atkins @robertmaynard @berkgeveci @utkarsh.ayachit @tjcorona @caitlin.ross