[vtk-developers] vtkImageReader2Factory missing in VTK modular

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Apr 13 16:12:25 EDT 2012


On Fri, Apr 13, 2012 at 4:06 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Fri, Apr 13, 2012 at 12:47 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>> vtkImageReader2Factory is in IO/Image but is commented out of the
>> CMakeLists.txt. I tried uncommenting but it needs IO/MINC and when I
>> add that dependency it causes a circular dependency.
>
> In the long term, it might be necessary to have vtkMINCReader register
> itself with the factory at run-time.  The temporary fix would be to simply
> add "#if 0" blocks around all vtkImageReader2Factory.cxx code that
> needs vtkMINCReader. That will at least allow the factory to be compiled.
>
We have the auto init stuff that works with static builds etc. If you
look at the SQL modules you will see that MySQL, PostgreSQL and ODBC
all register with the central factory style class using the auto init
code. Would that be a reasonable pattern to use here?

The problem we hit when modularizing is that any of these factory
patterns make modularization very difficult. The other alternative is
a factory module with this class that depends on all possible modules
that contain classes that it should be able to construct.

Marcus



More information about the vtk-developers mailing list