vtkObjectFactory.cxx.in 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*=========================================================================
  2. Program: Visualization Toolkit
  3. Module: @_vtk_object_factory_library_name@ObjectFactory.cxx
  4. Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  5. All rights reserved.
  6. See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
  7. This software is distributed WITHOUT ANY WARRANTY; without even
  8. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. PURPOSE. See the above copyright notice for more information.
  10. =========================================================================*/
  11. #include "@_vtk_object_factory_library_name@ObjectFactory.h"
  12. #include "vtkVersion.h"
  13. // Include all of the classes we want to create overrides for.
  14. @_vtk_object_factory_includes@
  15. vtkStandardNewMacro(@_vtk_object_factory_library_name@ObjectFactory);
  16. // Now create the functions to create overrides with.
  17. @_vtk_object_factory_functions@
  18. @_vtk_object_factory_library_name@ObjectFactory::@_vtk_object_factory_library_name@ObjectFactory()
  19. {
  20. @_vtk_object_factory_calls@
  21. }
  22. const char * @_vtk_object_factory_library_name@ObjectFactory::GetVTKSourceVersion()
  23. {
  24. return VTK_SOURCE_VERSION;
  25. }
  26. void @_vtk_object_factory_library_name@ObjectFactory::PrintSelf(ostream &os, vtkIndent indent)
  27. {
  28. this->Superclass::PrintSelf(os, indent);
  29. }
  30. // Registration of object factories.
  31. static unsigned int @_vtk_object_factory_library_name@Count = 0;
  32. @_vtk_object_factory_configure_EXPORT_MACRO@ void @_vtk_object_factory_library_name@_AutoInit_Construct()
  33. {
  34. if(++@_vtk_object_factory_library_name@Count == 1)
  35. {
  36. @_vtk_object_factory_configure_INITIAL_CODE@
  37. @_vtk_object_factory_library_name@ObjectFactory* factory = @_vtk_object_factory_library_name@ObjectFactory::New();
  38. if (factory)
  39. {
  40. // vtkObjectFactory keeps a reference to the "factory",
  41. vtkObjectFactory::RegisterFactory(factory);
  42. factory->Delete();
  43. }
  44. }
  45. }