I have downloaded VTK 9.2.0.rc1 and built it using Visual Studio 2022 without errors. I also downloaded vtk_examples (as of July 8) from github.
In trying to build vtk_examples using VS 2022, the projects in the GeometricObjects and Rendering Cxx directories fail to build because they cannot find any of the vtk include files… This seems to be an error of some sort in the CMakeLists files used to generate these projects, because all other projects seem to be able to find the header files without problems. I have compared CMakeLists files for the failed and for successful builds and can’t see what could be wrong.
Also, there was a recent commit comment about replacing SetColor with SetColorF. This has broken the build of projects where this is used.
Some advice on how to fix the CMake errors in GeometricObjects and Rendering would be appreciated.
The removed function had been deprecated since 9.1. Consumers should have been getting warnings about its deprecation; was this not happening (without explicit suppression of the warnings)?
As for the examples, they are tested regularly. @lassoan?
86>ChartsOn3DScene.cxx
86>G:\VTK\vtk-examples\src\Cxx\Plotting\ChartsOn3DScene.cxx(103,11): error C2039: ‘SetColorF’: is not a member of ‘vtkPlot’
86>G:\VTK\Charts\Core\vtkPlot.h(47): message : see declaration of ‘vtkPlot’
86>G:\VTK\vtk-examples\src\Cxx\Plotting\ChartsOn3DScene.cxx(108,11): error C2039: ‘SetColorF’: is not a member of ‘vtkPlot’
86>G:\VTK\Charts\Core\vtkPlot.h(47): message : see declaration of ‘vtkPlot’
86>G:\VTK\vtk-examples\src\Cxx\Plotting\ChartsOn3DScene.cxx(113,11): error C2039: ‘SetColorF’: is not a member of ‘vtkPlot’
86>G:\VTK\Charts\Core\vtkPlot.h(47): message : see declaration of ‘vtkPlot’
86>Done building project “ChartsOn3DScene.vcxproj” – FAILED.
vtkPlot.h (from the 9.2.0.rc1 Charts/Core directory contains this:
@amaclean I guess VTKExamples would need to keep using the old API for a while (optionally, use the new SetColorF API if VTK is found to be recent enough).
Thanks, Andras, that was my intention to work around this bug. What about the build problems with Rendering and GeometricObjects? I can figure out how to build them standalone as Visual Studio projects, but it would be nice to fix whatever is wrong with the CMake scripts.
I could not find a way to D/L the 9.1 version - all of the links from the web site lead to the github page for 9.2.0.rc1. Older version links are for 8.x or older.
@DStranz You should be able to build OK now. I can verify that building GeometricObjects and Rendering are now OK in both WIndows and Linux. Also I have introduced a check for the VTK version in Plotting so that SetColorF() or SetColor() can be used.
Only three files were flagging the use of the deprecated SetColor(), however I also provided a check for the deprecated version on the other files.
@ben I had only noticed this a week or so ago when building against the master. From memory, only three examples were flagging the deprecation warning: BarChart.cxx, ChartsOn3DScene.cxx and FunctionalBagPlot.cxx. The other plotting examples were already using SetColorF.
Unfortunately, Rendering and GeometricObjects are still broken in the version I D/L this morning. I did a clean install after wiping out all previous vtk-examples source and build trees, reconfiguring and regenerating the VS 2022 projects.
Can’t copy the error output except as a screen shot.
OK, enabling those items seemed to fix the problem. I have not rebuilt all of the examples, but building AmbientSpheres (from Rendering) and Arrow (from GeometricObjects) was successful so I presume the others will build also. Thanks for the help.
but the vtkPlot.h header file for 9.2.0.rc1 does not contain the SetColorF() method, only SetColor().
OK, I’m confused. I have downloaded the VTK source distribution from here: https://vtk.org/download/ which claims to be giving me VTK 9.2.0.rc1. In this source code, vtkPlot.h does not contain the SetColorF method.If I look at the same file in git on gitlab.kitware.com, that does contain the SetColorF methods, with the deprecation warning (for version 9.3.0).
So it seems that the #if statement should be testing against a higher version of VTK than 90020220630.