Updates will be applied April 15th at 12pm EDT (UTC-0400). GitLab could be a little slow between 12 - 12:45pm EDT.

Commit 4403edb5 authored by Berk Geveci's avatar Berk Geveci

Cleaned up dependencies between modules.

Some of the module dependencies were somewhat weird, like
IOImage depending on IOGeometry and Rendering depending on
XML which contains all XML reader. Fixed the depency problems
by creating XMLParser and Movie modules and moving some
classes to them. I also moved many classes to RenderingCore
because they were only needed there.
One other minor change is to change vtkProperty to use
vtkImageReader2Factor such that it didn't explicitely depend
on bunch of reader. This will allow us to add/remove readers
to IOImage more easily.

Change-Id: Iaaa2edffd31193c13a4ef59e5be5b3eeada3501e
parent 97f18b53
vtk_module(vtkIOFFMPEG
DEPENDS
vtkIOGeometry
vtkIOMovie
TEST_DEPENDS
vtkTestingCore
vtkImagingSources
......
......@@ -11,11 +11,10 @@ SET(Module_SRCS
vtkFacetWriter.cxx
vtkFLUENTReader.cxx
vtkGAMBITReader.cxx
vtkGaussianCubeReader.cxx
vtkGenericDataObjectReader.cxx
vtkGenericDataObjectWriter.cxx
vtkGenericMovieWriter.cxx
vtkIVWriter.cxx
vtkMaterialLibrary.cxx
vtkMCubesReader.cxx
vtkMCubesWriter.cxx
vtkMFIXReader.cxx
......@@ -47,13 +46,10 @@ SET(Module_SRCS
vtkStructuredPointsReader.cxx
vtkStructuredPointsWriter.cxx
vtkShaderCodeLibrary.cxx
vtkXYZMolReader.cxx
)
set_source_files_properties(
vtkGenericMovieWriter
vtkMoleculeReaderBase
ABSTRACT
)
......
......@@ -7,8 +7,6 @@ vtk_module(vtkIOGeometry
vtkCommonMisc
vtkIOCore
vtkzlib
COMPILE_DEPENDS
vtkUtilitiesMaterialLibrary
TEST_DEPENDS
vtkIOAMR
vtkFiltersGeometry
......
......@@ -24,13 +24,13 @@
#ifndef __vtkGaussianCubeReader_h
#define __vtkGaussianCubeReader_h
#include "vtkIOImageModule.h" // For export macro
#include "vtkIOGeometryModule.h" // For export macro
#include "vtkMoleculeReaderBase.h"
class vtkImageData;
class vtkTransform;
class VTKIOIMAGE_EXPORT vtkGaussianCubeReader : public vtkMoleculeReaderBase
class VTKIOGEOMETRY_EXPORT vtkGaussianCubeReader : public vtkMoleculeReaderBase
{
public:
static vtkGaussianCubeReader *New();
......
......@@ -3,8 +3,6 @@ set(Module_SRCS
vtkBMPWriter.cxx
vtkDEMReader.cxx
vtkDICOMImageReader.cxx
#vtkFFMPEGWriter.cxx
vtkGaussianCubeReader.cxx
vtkGESignaReader.cxx
vtkImageExport.cxx
vtkImageImport.cxx
......@@ -20,7 +18,6 @@ set(Module_SRCS
vtkMedicalImageReader2.cxx
vtkMetaImageReader.cxx
vtkMetaImageWriter.cxx
#vtkMPEG2Writer.cxx # Do we want to continue supporting?
vtkPNGReader.cxx
vtkPNGWriter.cxx
vtkPNMReader.cxx
......@@ -34,22 +31,9 @@ set(Module_SRCS
vtkNrrdReader.cxx
)
if(vtkIOImage_vtkoggtheora)
list(APPEND Module_SRCS vtkOggTheoraWriter.cxx)
endif()
if(WIN32)
# Should we force this on Windows?
list(APPEND Module_SRCS vtkAVIWriter.cxx)
endif()
set_source_files_properties(
vtkVolumeReader
ABSTRACT
)
vtk_module_library(vtkIOImage ${Module_SRCS})
if(WIN32)
target_link_libraries(vtkIOImage vfw32)
endif()
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^XL$")
set(vtkIOImage_vtkoggtheora vtkoggtheora)
endif()
vtk_module(vtkIOImage
GROUPS
StandAlone
DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonSystem
vtkCommonMath
vtkCommonMisc
vtkCommonTransforms
vtkIOGeometry
vtkIOCore
vtkjpeg
vtkpng
vtktiff
vtkMetaIO
${vtkIOImage_vtkoggtheora}
vtkDICOMParser
TEST_DEPENDS
vtkTestingCore
......
set(Module_SRCS
vtkGenericMovieWriter.cxx
#vtkMPEG2Writer.cxx # Do we want to continue supporting?
)
if(vtkIOImage_vtkoggtheora)
list(APPEND Module_SRCS vtkOggTheoraWriter.cxx)
endif()
if(WIN32)
# Should we force this on Windows?
list(APPEND Module_SRCS vtkAVIWriter.cxx)
endif()
vtk_module_library(vtkIOMovie ${Module_SRCS})
if(WIN32)
target_link_libraries(vtkIOMovie vfw32)
endif()
\ No newline at end of file
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^XL$")
set(vtkIOMovie_vtkoggtheora vtkoggtheora)
endif()
vtk_module(vtkIOMovie
GROUPS
StandAlone
DEPENDS
vtkCommonDataModel
vtkCommonExecutionModel
vtkCommonSystem
vtkIOCore
${vtkIOMovie_vtkoggtheora}
)
......@@ -23,12 +23,12 @@
#ifndef __vtkAVIWriter_h
#define __vtkAVIWriter_h
#include "vtkIOImageModule.h" // For export macro
#include "vtkIOImageMovie.h" // For export macro
#include "vtkGenericMovieWriter.h"
class vtkAVIWriterInternal;
class VTKIOIMAGE_EXPORT vtkAVIWriter : public vtkGenericMovieWriter
class VTKIOMOVIE_EXPORT vtkAVIWriter : public vtkGenericMovieWriter
{
public:
static vtkAVIWriter *New();
......
......@@ -25,12 +25,12 @@
#ifndef __vtkGenericMovieWriter_h
#define __vtkGenericMovieWriter_h
#include "vtkIOGeometryModule.h" // For export macro
#include "vtkIOMovieModule.h" // For export macro
#include "vtkImageAlgorithm.h"
class vtkImageData;
class VTKIOGEOMETRY_EXPORT vtkGenericMovieWriter : public vtkImageAlgorithm
class VTKIOMOVIE_EXPORT vtkGenericMovieWriter : public vtkImageAlgorithm
{
public:
vtkTypeMacro(vtkGenericMovieWriter,vtkImageAlgorithm);
......
......@@ -41,14 +41,14 @@
#ifndef __vtkMPEG2Writer_h
#define __vtkMPEG2Writer_h
#include "vtkIOImageModule.h" // For export macro
#include "vtkIOMovieModule.h" // For export macro
#include "vtkGenericMovieWriter.h"
class vtkMPEG2WriterInternal;
class vtkImageData;
struct MPEG2_structure;
class VTKIOIMAGE_EXPORT vtkMPEG2Writer : public vtkGenericMovieWriter
class VTKIOMovie_EXPORT vtkMPEG2Writer : public vtkGenericMovieWriter
{
public:
static vtkMPEG2Writer *New();
......
......@@ -27,12 +27,12 @@
#ifndef __vtkOggTheoraWriter_h
#define __vtkOggTheoraWriter_h
#include "vtkIOImageModule.h" // For export macro
#include "vtkIOMovieModule.h" // For export macro
#include "vtkGenericMovieWriter.h"
class vtkOggTheoraWriterInternal;
class VTKIOIMAGE_EXPORT vtkOggTheoraWriter : public vtkGenericMovieWriter
class VTKIOMOVIE_EXPORT vtkOggTheoraWriter : public vtkGenericMovieWriter
{
public:
static vtkOggTheoraWriter *New();
......
......@@ -2,7 +2,6 @@ set(Module_SRCS
vtkRTXMLPolyDataReader.cxx
vtkXMLCompositeDataReader.cxx
vtkXMLCompositeDataWriter.cxx
vtkXMLDataParser.cxx
vtkXMLDataReader.cxx
vtkXMLDataSetWriter.cxx
vtkXMLFileReadTester.cxx
......@@ -14,13 +13,9 @@ set(Module_SRCS
vtkXMLHyperOctreeWriter.cxx
vtkXMLImageDataReader.cxx
vtkXMLImageDataWriter.cxx
vtkXMLMaterial.cxx
vtkXMLMaterialParser.cxx
vtkXMLMaterialReader.cxx
vtkXMLMultiBlockDataReader.cxx
vtkXMLMultiBlockDataWriter.cxx
vtkXMLMultiGroupDataReader.cxx
vtkXMLParser.cxx
vtkXMLPDataReader.cxx
vtkXMLPDataSetWriter.cxx
vtkXMLPDataWriter.cxx
......@@ -43,7 +38,6 @@ set(Module_SRCS
vtkXMLReader.cxx
vtkXMLRectilinearGridReader.cxx
vtkXMLRectilinearGridWriter.cxx
vtkXMLShader.cxx
vtkXMLStructuredDataReader.cxx
vtkXMLStructuredDataWriter.cxx
vtkXMLStructuredGridReader.cxx
......@@ -52,7 +46,6 @@ set(Module_SRCS
vtkXMLUnstructuredDataWriter.cxx
vtkXMLUnstructuredGridReader.cxx
vtkXMLUnstructuredGridWriter.cxx
vtkXMLUtilities.cxx
vtkXMLWriterC.cxx
vtkXMLWriter.cxx
)
......
......@@ -2,12 +2,8 @@ vtk_module(vtkIOXML
GROUPS
StandAlone
DEPENDS
vtkCommonDataModel
vtkCommonSystem
vtkCommonMisc
vtkIOCore
vtkIOXMLParser
vtkIOGeometry
vtkexpat
TEST_DEPENDS
vtkTestingCore
vtkImagingSources
......
set(Module_SRCS
vtkXMLDataParser.cxx
vtkXMLParser.cxx
vtkXMLUtilities.cxx )
vtk_module_library(vtkIOXMLParser ${Module_SRCS})
vtk_module(vtkIOXMLParser
GROUPS
StandAlone
DEPENDS
vtkCommonDataModel
vtkCommonSystem
vtkCommonMisc
vtkIOCore
vtkexpat
)
......@@ -26,14 +26,14 @@
#ifndef __vtkXMLDataParser_h
#define __vtkXMLDataParser_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkIOXMLParserModule.h" // For export macro
#include "vtkXMLParser.h"
#include "vtkXMLDataElement.h"//For inline definition.
class vtkInputStream;
class vtkDataCompressor;
class VTKIOXML_EXPORT vtkXMLDataParser : public vtkXMLParser
class VTKIOXMLPARSER_EXPORT vtkXMLDataParser : public vtkXMLParser
{
public:
vtkTypeMacro(vtkXMLDataParser,vtkXMLParser);
......
......@@ -24,7 +24,7 @@
#ifndef __vtkXMLParser_h
#define __vtkXMLParser_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkIOXMLParserModule.h" // For export macro
#include "vtkObject.h"
extern "C"
......@@ -34,7 +34,7 @@ extern "C"
void vtkXMLParserCharacterDataHandler(void*, const char*, int);
}
class VTKIOXML_EXPORT vtkXMLParser : public vtkObject
class VTKIOXMLPARSER_EXPORT vtkXMLParser : public vtkObject
{
public:
vtkTypeMacro(vtkXMLParser,vtkObject);
......
......@@ -21,12 +21,12 @@
#ifndef __vtkXMLUtilities_h
#define __vtkXMLUtilities_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkIOXMLParserModule.h" // For export macro
#include "vtkObject.h"
class vtkXMLDataElement;
class VTKIOXML_EXPORT vtkXMLUtilities : public vtkObject
class VTKIOXMLPARSER_EXPORT vtkXMLUtilities : public vtkObject
{
public:
static vtkXMLUtilities* New();
......
......@@ -59,6 +59,7 @@ set(Module_SRCS
vtkMapper2D.cxx
vtkMapperCollection.cxx
vtkMapper.cxx
vtkMaterialLibrary.cxx
vtkObserverMediator.cxx
vtkPainter.cxx
vtkPainterDeviceAdapter.cxx
......@@ -88,6 +89,7 @@ set(Module_SRCS
vtkScalarsToColorsPainter.cxx
vtkSelectVisiblePoints.cxx
vtkShader.cxx # vtkXMLShader
vtkShaderCodeLibrary.cxx
vtkShaderDeviceAdapter.cxx
vtkShaderDeviceAdapter2.cxx
vtkShaderProgram.cxx # vtkXMLShaderProgram
......@@ -104,6 +106,10 @@ set(Module_SRCS
vtkVolumeCollection.cxx
vtkVolume.cxx
vtkVolumeProperty.cxx
vtkXMLMaterial.cxx
vtkXMLMaterialParser.cxx
vtkXMLMaterialReader.cxx
vtkXMLShader.cxx
vtkWindowLevelLookupTable.cxx
vtkWindowToImageFilter.cxx
......
......@@ -9,7 +9,9 @@ vtk_module(vtkRenderingCore
vtkFiltersGeometry
vtkFiltersExtraction
vtkIOImage
vtkIOXML
vtkIOXMLParser
COMPILE_DEPENDS
vtkUtilitiesMaterialLibrary
TEST_DEPENDS
vtkTestingCore
vtkTestingRendering
......
......@@ -21,10 +21,10 @@
#ifndef __vtkMaterialLibrary_h
#define __vtkMaterialLibrary_h
#include "vtkIOGeometryModule.h" // For export macro
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
class VTKIOGEOMETRY_EXPORT vtkMaterialLibrary : public vtkObject
class VTKRENDERINGCORE_EXPORT vtkMaterialLibrary : public vtkObject
{
public:
static vtkMaterialLibrary* New();
......
......@@ -15,20 +15,16 @@
#include "vtkProperty.h"
#include "vtkActor.h"
#include "vtkBMPReader.h"
#include "vtkObjectFactory.h"
#include "vtkImageData.h"
#include "vtkImageReader2.h"
#include "vtkJPEGReader.h"
#include "vtkPNGReader.h"
#include "vtkPNMReader.h"
#include "vtkImageReader2Factory.h"
#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkShaderProgram.h"
#include "vtkSmartPointer.h"
#include "vtkStdString.h"
#include "vtkTexture.h"
#include "vtkTIFFReader.h"
#include "vtkXMLDataElement.h"
#include "vtkXMLMaterial.h"
#include "vtkXMLMaterialParser.h"
......@@ -851,45 +847,19 @@ void vtkProperty::LoadTexture(vtkXMLDataElement* elem )
return;
}
const char* format = elem->GetAttribute("format");
vtkStdString string_format;
if (!format)
{
// determine format from file extension.
string_format = vtksys::SystemTools::GetFilenameLastExtension(location);
format = string_format.c_str();
}
char* filename = vtkXMLShader::LocateFile(location);
vtkImageReader2* reader;
if (strcmp(format, "bmp") == 0)
{
reader = vtkBMPReader::New();
}
else if (strcmp(format, "jpg") == 0 || strcmp(format, "jpeg") == 0)
{
reader = vtkJPEGReader::New();
}
else if (strcmp(format, "png") == 0)
{
reader = vtkPNGReader::New();
}
else if (strcmp(format, "tiff") == 0 || strcmp(format, "tif") == 0)
{
reader = vtkTIFFReader::New();
}
else if (strcmp(format, "ppm") == 0)
{
reader = vtkPNMReader::New();
}
else
vtkImageReader2* reader =
vtkImageReader2Factory::CreateImageReader2(filename);
if (!reader)
{
vtkErrorMacro("Invalid format='" << format << "' for element with name="
vtkErrorMacro("Invalid format for element with name="
<< name);
return;
}
char* filename = vtkXMLShader::LocateFile(location);
if (filename)
{
reader->SetFileName(filename);
......
......@@ -22,10 +22,10 @@
#ifndef __vtkShaderCodeLibrary_h
#define __vtkShaderCodeLibrary_h
#include "vtkIOGeometryModule.h" // For export macro
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
class VTKIOGEOMETRY_EXPORT vtkShaderCodeLibrary : public vtkObject
class VTKRENDERINGCORE_EXPORT vtkShaderCodeLibrary : public vtkObject
{
public:
static vtkShaderCodeLibrary* New();
......
......@@ -24,14 +24,14 @@
#ifndef __vtkXMLMaterial_h
#define __vtkXMLMaterial_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
class vtkXMLDataElement;
class vtkXMLMaterialInternals;
class vtkXMLShader;
class VTKIOXML_EXPORT vtkXMLMaterial : public vtkObject
class VTKRENDERINGCORE_EXPORT vtkXMLMaterial : public vtkObject
{
public:
static vtkXMLMaterial* New();
......
......@@ -68,13 +68,13 @@
#ifndef __vtkXMLMaterialParser_h
#define __vtkXMLMaterialParser_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkXMLParser.h"
class vtkXMLMaterial;
class vtkXMLMaterialParserInternals;
class VTKIOXML_EXPORT vtkXMLMaterialParser : public vtkXMLParser
class VTKRENDERINGCORE_EXPORT vtkXMLMaterialParser : public vtkXMLParser
{
public:
static vtkXMLMaterialParser *New();
......
......@@ -41,14 +41,14 @@
#ifndef __vtkXMLMaterialReader_h
#define __vtkXMLMaterialReader_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
class vtkXMLDataElement;
class vtkXMLMaterial;
class vtkXMLMaterialParser;
class VTKIOXML_EXPORT vtkXMLMaterialReader : public vtkObject
class VTKRENDERINGCORE_EXPORT vtkXMLMaterialReader : public vtkObject
{
public:
vtkTypeMacro(vtkXMLMaterialReader,vtkObject);
......
......@@ -24,12 +24,12 @@
#ifndef __vtkXMLShader_h
#define __vtkXMLShader_h
#include "vtkIOXMLModule.h" // For export macro
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
class vtkXMLDataElement;
class VTKIOXML_EXPORT vtkXMLShader : public vtkObject
class VTKRENDERINGCORE_EXPORT vtkXMLShader : public vtkObject
{
public:
static vtkXMLShader* New();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment