Commit cc8d1471 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

Now generate the object factory files in a function

This moves the logic for object factory override generation to a
central function, and removes lots of copy/paste code in our CMake.
Also removed/retired the OpenGL2 object factory stomping variation
as it is no longer needed and could produce unwanted side effects.

Change-Id: I4a5ee2db76f73d57eded1d9a9240cefc4918cd74
parent 7def3bbc
......@@ -11,3 +11,27 @@ macro(vtk_add_override base override)
list(APPEND vtk_module_overrides ${base})
set(vtk_module_${base}_override ${override})
endmacro()
# Create the relevant object factory files from the override list. This uses
# ${vtk-module} to construct the file names (${vtk-module}ObjectFactory.[h,cxx]
# in the current binary directory.
function(vtk_object_factory_configure override_list)
# Now we iterate and create that class file...
foreach(_class ${override_list})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes
"${_vtk_override_includes}\n#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
endfunction()
......@@ -26,26 +26,7 @@ set_source_files_properties(
foreach(_override ${parallel_overrides})
vtk_add_override(vtk${_override} vtkP${_override})
endforeach()
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
list(APPEND Module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
set_source_files_properties(
......
include(vtkMPI)
include(vtkObjectFactory)
set(Module_SRCS
vtkPNrrdReader.cxx
vtkMPIImageReader.cxx
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
set_source_files_properties(
${vtk-module}ObjectFactory
WRAP_EXCLUDE
)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
# Now to generate our object factory.
set( vtk_module_overrides
NrrdReader
)
foreach(_class ${vtk_module_overrides})
set(_override vtkP${_class})
set(_vtk_override_includes "${_vtk_override_includes} #include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"vtk${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_add_override(vtkNrrdReader vtkPNrrdReader)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_module_library(vtkIOMPIImage ${Module_SRCS})
vtk_mpi_link(${vtk-module})
include(vtkObjectFactory)
set(Module_SRCS
vtkPExodusIIReader.cxx
vtkPExodusIIWriter.cxx
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
# Now to generate our object factory.
set( vtk_module_overrides
ExodusIIWriter
)
foreach(_class ${vtk_module_overrides})
set(_override vtkP${_class})
set(_vtk_override_includes "${_vtk_override_includes} #include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"vtk${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_add_override(vtkExodusIIWriter vtkPExodusIIWriter)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_module_library(vtkIOParallelExodus ${Module_SRCS})
include(vtkObjectFactory)
set(Module_SRCS
vtkInteractorStyleDrawPolygon.cxx
vtkInteractorStyleFlight.cxx
......@@ -21,34 +23,11 @@ set(Module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
set_source_files_properties(
${vtk-module}ObjectFactory
WRAP_EXCLUDE
)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
# Now to generate our object factory.
set(vtk_module_overrides "vtkInteractorStyleSwitchBase")
set(vtk_module_vtkInteractorStyleSwitchBase_override "vtkInteractorStyleSwitch")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_module_library(vtkInteractionStyle ${Module_SRCS})
......@@ -17,26 +17,10 @@ foreach(_override ${_opengl_overrides})
vtk_add_override("vtk${_override}" "vtkOpenGL${_override}")
endforeach()
vtk_add_override("vtkAbstractContextBufferId" "vtkOpenGLContextBufferId")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
list(APPEND module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
vtk_module_library(${vtk-module} ${module_SRCS})
......@@ -25,27 +25,11 @@ foreach(_override ${_opengl_overrides})
vtk_add_override("vtk${_override}" "vtkOpenGL${_override}")
endforeach()
vtk_add_override("vtkAbstractContextBufferId" "vtkOpenGLContextBufferId")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
list(APPEND module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
vtk_module_library(${vtk-module} ${module_SRCS})
target_link_libraries(${vtk-module}
......
include(vtkObjectFactory)
set(Module_SRCS
vtkFreeTypeStringToImage.cxx
vtkFreeTypeUtilities.cxx
......@@ -47,26 +49,6 @@ set_source_files_properties(
# Override some rendering classes. Create object factory:
list(APPEND vtk_module_overrides "vtkTextRenderer")
set(vtk_module_vtkTextRenderer_override "vtkMathTextFreeTypeTextRenderer")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now let's create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_module_library(${vtk-module} ${Module_SRCS})
......@@ -2,6 +2,8 @@ find_package(FontConfig REQUIRED)
include_directories(${FONTCONFIG_INCLUDE_DIR})
include(vtkObjectFactory)
set(Module_SRCS
vtkFontConfigFreeTypeTools.cxx
${CMAKE_CURRENT_BINARY_DIR}/vtkRenderingFreeTypeFontConfigObjectFactory.cxx
......@@ -16,27 +18,7 @@ set_source_files_properties(
# Setup overrides
list(APPEND vtk_module_overrides "vtkFreeTypeTools")
set(vtk_module_vtkFreeTypeTools_override "vtkFontConfigFreeTypeTools")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_module_library(${vtk-module} ${Module_SRCS})
......
......@@ -5,5 +5,6 @@ vtk_module(vtkRenderingFreeTypeFontConfig
vtkChartsCore
vtkTestingRendering
vtkViewsContext2D
vtkRenderingContext${VTK_RENDERING_BACKEND}
EXCLUDE_FROM_WRAPPING
)
include(vtkObjectFactory)
set(Module_SRCS
vtkOpenGLFreeTypeTextMapper.cxx
)
set(vtk_module_overrides "vtkTextMapper")
set(vtk_module_vtkTextMapper_override "vtkOpenGLFreeTypeTextMapper")
vtk_object_factory_configure("${vtk_module_overrides}")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
list(APPEND Module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
set_source_files_properties(
${vtk-module}ObjectFactory.cxx
WRAP_EXCLUDE
)
set_source_files_properties(${vtk-module}ObjectFactory.cxx WRAP_EXCLUDE)
vtk_module_library(${vtk-module} ${Module_SRCS})
include(vtkObjectFactory)
set(Module_SRCS
vtkMatplotlibMathTextUtilities.cxx
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
set_source_files_properties(
${vtk-module}ObjectFactory
WRAP_EXCLUDE
)
set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
# Override some rendering classes. Create object factory:
list(APPEND vtk_module_overrides "vtkMathTextUtilities")
set(vtk_module_vtkMathTextUtilities_override "vtkMatplotlibMathTextUtilities")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_module_library(${vtk-module} ${Module_SRCS})
......@@ -397,26 +397,8 @@ foreach(_override ${opengl_overrides})
vtk_add_override(vtk${_override} vtkOpenGL${_override})
endforeach()
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure("${vtk_module_overrides}")
# Configure the module specific settings into a module configured header.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkRenderingOpenGLConfigure.h.in
......
......@@ -243,19 +243,7 @@ elseif(VTK_USE_CARBON)
)
endif()
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
vtk_object_factory_configure("${vtk_module_overrides}")
# Detect and clear OpenGL errors. If not then other classes/user code
# may detect VTK's OpenGL errors and vice-versa.
......@@ -265,13 +253,6 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/vtkOpenGLError.h.in
${CMAKE_CURRENT_BINARY_DIR}/vtkOpenGLError.h)
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkRenderingOpenGL2ObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
# Configure the module specific settings into a module configured header.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkRenderingOpenGLConfigure.h.in
${CMAKE_CURRENT_BINARY_DIR}/vtkRenderingOpenGLConfigure.h)
......
/*=========================================================================
Program: Visualization Toolkit
Module: @vtk-module@ObjectFactory.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "@vtk-module@ObjectFactory.h"
#include "vtkVersion.h"
#include "vtkObjectFactoryCollection.h"
// Include all of the classes we want to create overrides for.
@_vtk_override_includes@
vtkStandardNewMacro(@vtk-module@ObjectFactory)
// Now create the functions to create overrides with.
@_vtk_override_creates@
@vtk-module@ObjectFactory::@vtk-module@ObjectFactory()
{
@_vtk_override_do@
}
const char * @vtk-module@ObjectFactory::GetVTKSourceVersion()
{
return VTK_SOURCE_VERSION;
}
void @vtk-module@ObjectFactory::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
// Registration of object factories.
static unsigned int @vtk-module@Count;
@VTK-MODULE@_EXPORT void @vtk-module@_AutoInit_Construct()
{
if(++@vtk-module@Count == 1)
{
@vtk-module@ObjectFactory* factory = @vtk-module@ObjectFactory::New();
if (factory)
{
// for any factories that registered before we did,
// delete any common overrides from them so we win!
int numOverrides = factory->GetNumberOfOverrides();
vtkObjectFactoryCollection *ofc = vtkObjectFactory::GetRegisteredFactories();
vtkObjectFactory* ofactory;
vtkCollectionSimpleIterator osit;
for(ofc->InitTraversal(osit);
(ofactory = ofc->GetNextObjectFactory(osit));)
{
for (int i = 0; i < numOverrides; ++i)
{
ofactory->Disable(factory->GetClassOverrideName(i));
}
}
// vtkObjectFactory keeps a reference to the "factory",
vtkObjectFactory::RegisterFactory(factory);
factory->Delete();
}
}
}
@VTK-MODULE@_EXPORT void @vtk-module@_AutoInit_Destruct()
{
if(--@vtk-module@Count == 0)
{
// Do not call vtkObjectFactory::UnRegisterFactory because
// vtkObjectFactory.cxx statically unregisters all factories.
}
}
......@@ -66,31 +66,7 @@ endforeach()
vtk_add_override(vtkLineIntegralConvolution2D vtkPLineIntegralConvolution2D)
vtk_add_override(vtkSurfaceLICComposite vtkPSurfaceLICComposite)
vtk_add_override(vtkSurfaceLICPainter vtkPSurfaceLICPainter)
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(
${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h
)
configure_file(
${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
vtk_object_factory_configure("${vtk_module_overrides}")
include(vtkMPI)
......
......@@ -91,32 +91,10 @@ set(opengl_overrides
foreach(_override ${opengl_overrides})
vtk_add_override(vtk${_override} vtkOpenGL${_override})
endforeach()
vtk_object_factory_configure("${vtk_module_overrides}")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",