[vtkusers] VTK 6 porting

Cory Quammen cquammen at cs.unc.edu
Fri Mar 15 12:56:25 EDT 2013


CC'ing the list so that others may contribute and benefit from the discussion

On Fri, Mar 15, 2013 at 12:43 PM, Frédéric Speisser
<speisser at kappaeng.com> wrote:
> Thank you Cory,
>
> But I don't use Cmake for generating my project...

With the number of libraries in VTK 6, your life will be a lot easier
if you use CMake to configure you project.

> I'm under Visual 10, i've already add
>
> VTK_USE_FILE
>
>   in my preprocessor definitions but it does not change anything ...

VTK_USE_FILE is a CMake variable that points to a file that has
configuration information for using your VTK build. You don't add it
to your preprocessor definitions. Instead, if you were using CMake to
configure your project, the CMake "include" command would import the
configuration information in the VTK_USE_FILE.

> Do you know what "appropriate compiler definitions to automatically
> initialize the object factory overrides" should I add in my VS project ?

Including the file pointed to by the VTK_USE_FILE variable in CMake,
the preprocessor definitions needed to get everything to work are
automatically added for you.

If you really do not want to move your project over to use CMake for
build configuration, then my advice would be to set up a small CMake
project that uses VTK and examine the compiler definitions that you
need to specify on the command line.

Cory

>
> Thanks.
>
>
>
> Frédéric
>
>
> Le 15/03/2013 17:35, Cory Quammen a écrit :
>
> After the line
>
> find_package( VTK ... )
>
> in your project's CMakeLists.txt file, you need to add the line
>
> include( ${VTK_USE_FILE} )
>
> - Cory
>
> On Fri, Mar 15, 2013 at 11:54 AM, Frédéric Speisser
> <speisser at kappaeng.com> wrote:
>
> Hello all,
>
> We want to port our application using Vtk 5.9 to Vtk 6.
> Some code working on 5.9 does not work in 6, simple example with following
> line :
>
> vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
>
> returns a NULL pointer ...
>
> Seems I must do something described here
> http://www.vtk.org/Wiki/VTK/Build_System_Migration :
>
>
> "The application code must list vtkRenderingOpenGL in its components to use
> OpenGL for rendering and include the VTK_USE_FILE to add compiler
> definitions. This ensures that the object factory for the vtkRenderingOpenGL
> module will be initialized and uses whenever classes from vtkRenderingCore
> are uses in your application code. If you notice the interface classes in
> these modules returning NULL pointers it is likely that one of these
> implementation modules providing appropriate overrides is missing from the
> dependency list."
>
> I'm already linking with vtkRenderingOpenGL-6.0.lib in my sample project but
> what should i do with "VTK_USE_FILE" ?
>
> Any hints would be wellcome, thanks a lot !
>
>
> Frédéric
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> --
> Cory Quammen
> Research Associate
> Department of Computer Science
> The University of North Carolina at Chapel Hill
> .
>
>



--
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill



More information about the vtkusers mailing list