From: Leonardo Florez-Valencia Date: Fri, 18 Sep 2015 17:38:44 +0000 (+0200) Subject: ... X-Git-Tag: v0.1~375 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7c7bc497af96e7b5845be9a2fc277036ec752be9;p=cpPlugins.git ... --- diff --git a/lib/cpPlugins/CMakeLists.txt b/lib/cpPlugins/CMakeLists.txt index 89f1e3c..fe78cf1 100644 --- a/lib/cpPlugins/CMakeLists.txt +++ b/lib/cpPlugins/CMakeLists.txt @@ -1,102 +1,6 @@ -SET(LIBRARY_NAME cpPlugins) - -## =============== -## = Source code = -## =============== - -FILE(GLOB Interface_LIB_HEADERS_H "Interface/*.h") -FILE(GLOB Interface_LIB_HEADERS_HPP "Interface/*.hpp") -FILE(GLOB Interface_LIB_HEADERS_HXX "Interface/*.hxx") -FILE(GLOB Interface_LIB_SOURCES_C "Interface/*.c") -FILE(GLOB Interface_LIB_SOURCES_CPP "Interface/*.cpp") -FILE(GLOB Interface_LIB_SOURCES_CXX "Interface/*.cxx") - -SET( - LIB_HEADERS_H - Plugins/ImageReader.h - Plugins/ImageWriter.h - Plugins/MeshReader.h - Plugins/MeshWriter.h - Plugins/MarchingCubes.h - Plugins/OtsuThresholdImageFilter.h - ) -SET( - LIB_SOURCES_CXX - Plugins/Host.cxx - Plugins/ImageReader.cxx - Plugins/ImageWriter.cxx - Plugins/MeshReader.cxx - Plugins/MeshWriter.cxx - Plugins/MarchingCubes.cxx - Plugins/OtsuThresholdImageFilter.cxx - ) - -## ===================== -## = Compilation rules = -## ===================== - -ADD_LIBRARY( - ${LIBRARY_NAME} - SHARED - ${Interface_LIB_SOURCES_C} - ${Interface_LIB_SOURCES_CPP} - ${Interface_LIB_SOURCES_CXX} - ${LIB_SOURCES_C} - ${LIB_SOURCES_CPP} - ${LIB_SOURCES_CXX} - ) -GENERATE_EXPORT_HEADER( - ${LIBRARY_NAME} - BASE_NAME ${LIBRARY_NAME} - EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT - EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/${LIBRARY_NAME}_Export.h - STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC - ) -TARGET_LINK_LIBRARIES( - ${LIBRARY_NAME} - ${ITK_LIBRARIES} - ${VTK_LIBRARIES} - cpPlugins_Pluma - ) - -## ======================== -## -- Installation rules -- -## ======================== - -INSTALL( - TARGETS ${LIBRARY_NAME} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static - ) - -SET( - local_install_dirs +SUBDIRS( Interface + Plugins ) -FOREACH(dir ${local_install_dirs}) - INSTALL( - DIRECTORY ${dir} - DESTINATION include/cpPlugins/Interface - FILES_MATCHING PATTERN "*.h" - ) - INSTALL( - DIRECTORY ${dir} - DESTINATION include/cpPlugins/Interface - FILES_MATCHING PATTERN "*.hxx" - ) - INSTALL( - DIRECTORY ${dir} - DESTINATION include/cpPlugins/Interface - FILES_MATCHING PATTERN "*.hpp" - ) -ENDFOREACH(dir) - -INSTALL( - FILES - ${PROJECT_BINARY_DIR}/lib/cpPlugins/Interface/${LIBRARY_NAME}_Export.h - DESTINATION include/cpPlugins/Interface - ) - ## eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/BaseProcessObjects.cxx b/lib/cpPlugins/Interface/BaseProcessObjects.cxx new file mode 100644 index 0000000..8f03de0 --- /dev/null +++ b/lib/cpPlugins/Interface/BaseProcessObjects.cxx @@ -0,0 +1,15 @@ +#include + +cpPlugins_Interface_Code_ProcessObject( SourceObject ); +cpPlugins_Interface_Code_ProcessObject( SinkObject ); +cpPlugins_Interface_Code_ProcessObject( FilterObject ); +cpPlugins_Interface_Code_ProcessObject( ImageSource ); +cpPlugins_Interface_Code_ProcessObject( MeshSource ); +cpPlugins_Interface_Code_ProcessObject( ImageSink ); +cpPlugins_Interface_Code_ProcessObject( MeshSink ); +cpPlugins_Interface_Code_ProcessObject( ImageToImageFitler ); +cpPlugins_Interface_Code_ProcessObject( ImageToMeshFitler ); +cpPlugins_Interface_Code_ProcessObject( MeshToImageFitler ); +cpPlugins_Interface_Code_ProcessObject( MeshToMeshFitler ); + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/BaseProcessObjects.h b/lib/cpPlugins/Interface/BaseProcessObjects.h new file mode 100644 index 0000000..687a00f --- /dev/null +++ b/lib/cpPlugins/Interface/BaseProcessObjects.h @@ -0,0 +1,58 @@ +#ifndef __CPPLUGINS__INTERFACE__BASEPROCESSOBJECTS__H__ +#define __CPPLUGINS__INTERFACE__BASEPROCESSOBJECTS__H__ + +#include +#include + +// ------------------------------------------------------------------------- +#define cpPlugins_Interface_Define_ProcessObject( O, S ) \ + class cpPlugins_Interface_EXPORT O \ + : public S \ + { \ + public: \ + typedef O Self; \ + typedef S Superclass; \ + typedef itk::SmartPointer< Self > Pointer; \ + typedef itk::SmartPointer< const Self > ConstPointer; \ + public: \ + itkTypeMacro( O, S ); \ + protected: \ + O( ); \ + virtual ~O( ); \ + private: \ + O( const Self& ); \ + Self& operator=( const Self& ); \ + } + +// ------------------------------------------------------------------------- +#define cpPlugins_Interface_Code_ProcessObject( O ) \ + cpPlugins::Interface::O::O( ) : Superclass( ) \ + { \ + this->m_ClassName = "cpPlugins::Interface::#O"; \ + this->m_ClassCategory = "#O"; \ + } \ + cpPlugins::Interface::O::~O( ) { } + +namespace cpPlugins +{ + namespace Interface + { + cpPlugins_Interface_Define_ProcessObject( SourceObject, ProcessObject ); + cpPlugins_Interface_Define_ProcessObject( SinkObject, ProcessObject ); + cpPlugins_Interface_Define_ProcessObject( FilterObject, ProcessObject ); + cpPlugins_Interface_Define_ProcessObject( ImageSource, SourceObject ); + cpPlugins_Interface_Define_ProcessObject( MeshSource, SourceObject ); + cpPlugins_Interface_Define_ProcessObject( ImageSink, SinkObject ); + cpPlugins_Interface_Define_ProcessObject( MeshSink, SinkObject ); + cpPlugins_Interface_Define_ProcessObject( ImageToImageFitler, FilterObject ); + cpPlugins_Interface_Define_ProcessObject( ImageToMeshFitler, FilterObject ); + cpPlugins_Interface_Define_ProcessObject( MeshToImageFitler, FilterObject ); + cpPlugins_Interface_Define_ProcessObject( MeshToMeshFitler, FilterObject ); + + } // ecapseman + +} // ecapseman + +#endif // __CPPLUGINS__INTERFACE__BASEPROCESSOBJECTS__H__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/CMakeLists.txt b/lib/cpPlugins/Interface/CMakeLists.txt index b498063..f8a6ff7 100644 --- a/lib/cpPlugins/Interface/CMakeLists.txt +++ b/lib/cpPlugins/Interface/CMakeLists.txt @@ -32,7 +32,8 @@ GENERATE_EXPORT_HEADER( TARGET_LINK_LIBRARIES( ${LIBRARY_NAME} cpPlugins_Pluma - cpPlugins_Extensions + ${ITK_LIBRARIES} + ${VTK_LIBRARIES} ) ## ======================== @@ -45,28 +46,21 @@ INSTALL( LIBRARY DESTINATION lib ARCHIVE DESTINATION lib/static ) -SET( - local_install_dirs - . +INSTALL( + DIRECTORY . + DESTINATION include/cpPlugins/Interface + FILES_MATCHING PATTERN "*.h" + ) +INSTALL( + DIRECTORY . + DESTINATION include/cpPlugins/Interface + FILES_MATCHING PATTERN "*.hxx" + ) +INSTALL( + DIRECTORY . + DESTINATION include/cpPlugins/Interface + FILES_MATCHING PATTERN "*.hpp" ) -FOREACH(dir ${local_install_dirs}) - INSTALL( - DIRECTORY ${dir} - DESTINATION include/cpPlugins/Interface - FILES_MATCHING PATTERN "*.h" - ) - INSTALL( - DIRECTORY ${dir} - DESTINATION include/cpPlugins/Interface - FILES_MATCHING PATTERN "*.hxx" - ) - INSTALL( - DIRECTORY ${dir} - DESTINATION include/cpPlugins/Interface - FILES_MATCHING PATTERN "*.hpp" - ) -ENDFOREACH(dir) - INSTALL( FILES ${PROJECT_BINARY_DIR}/lib/cpPlugins/Interface/${LIBRARY_NAME}_Export.h diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx index 808aa2b..da2cdf0 100644 --- a/lib/cpPlugins/Interface/DataObject.cxx +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -3,32 +3,34 @@ #include // ------------------------------------------------------------------------- -itk::DataObject* cpPlugins::Interface::DataObject:: -GetITKDataObject( ) -{ - return( this->m_ITKObject.GetPointer( ) ); -} +/* TODO + itk::DataObject* cpPlugins::Interface::DataObject:: + GetITKDataObject( ) + { + return( this->m_ITKObject.GetPointer( ) ); + } -// ------------------------------------------------------------------------- -const itk::DataObject* cpPlugins::Interface::DataObject:: -GetITKDataObject( ) const -{ - return( this->m_ITKObject.GetPointer( ) ); -} + // ------------------------------------------------------------------------- + const itk::DataObject* cpPlugins::Interface::DataObject:: + GetITKDataObject( ) const + { + return( this->m_ITKObject.GetPointer( ) ); + } -// ------------------------------------------------------------------------- -vtkDataObject* cpPlugins::Interface::DataObject:: -GetVTKDataObject( ) -{ - return( this->m_VTKObject.GetPointer( ) ); -} + // ------------------------------------------------------------------------- + vtkDataObject* cpPlugins::Interface::DataObject:: + GetVTKDataObject( ) + { + return( this->m_VTKObject.GetPointer( ) ); + } -// ------------------------------------------------------------------------- -const vtkDataObject* cpPlugins::Interface::DataObject:: -GetVTKDataObject( ) const -{ - return( this->m_VTKObject.GetPointer( ) ); -} + // ------------------------------------------------------------------------- + const vtkDataObject* cpPlugins::Interface::DataObject:: + GetVTKDataObject( ) const + { + return( this->m_VTKObject.GetPointer( ) ); + } +*/ // ------------------------------------------------------------------------- cpPlugins::Interface::Object* cpPlugins::Interface::DataObject:: diff --git a/lib/cpPlugins/Interface/DataObject.h b/lib/cpPlugins/Interface/DataObject.h index cc8d8bf..be40af5 100644 --- a/lib/cpPlugins/Interface/DataObject.h +++ b/lib/cpPlugins/Interface/DataObject.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #define ITK_MANUAL_INSTANTIATION @@ -17,7 +17,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT DataObject + class cpPlugins_Interface_EXPORT DataObject : public Object { public: @@ -30,13 +30,13 @@ namespace cpPlugins itkTypeMacro( DataObject, Object ); public: - virtual itk::DataObject* GetITKDataObject( ); - virtual const itk::DataObject* GetITKDataObject( ) const; - virtual void SetITKDataObject( itk::DataObject* o ) = 0; + /* TODO + virtual itk::DataObject* GetITKDataObject( ); + virtual const itk::DataObject* GetITKDataObject( ) const; - virtual vtkDataObject* GetVTKDataObject( ); - virtual const vtkDataObject* GetVTKDataObject( ) const; - virtual void SetVTKDataObject( vtkDataObject* o ) = 0; + virtual vtkDataObject* GetVTKDataObject( ); + virtual const vtkDataObject* GetVTKDataObject( ) const; + */ Object* GetSource( ); const Object* GetSource( ) const; diff --git a/lib/cpPlugins/Interface/FilterObject.cxx b/lib/cpPlugins/Interface/FilterObject.cxx deleted file mode 100644 index 24f7c50..0000000 --- a/lib/cpPlugins/Interface/FilterObject.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::FilterObject:: -FilterObject( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::FilterObject"; - this->m_ClassCategory = "BasicObject"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::FilterObject:: -~FilterObject( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/FilterObject.h b/lib/cpPlugins/Interface/FilterObject.h deleted file mode 100644 index 61d2ec4..0000000 --- a/lib/cpPlugins/Interface/FilterObject.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__FILTEROBJECT__H__ -#define __CPPLUGINS__INTERFACE__FILTEROBJECT__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT FilterObject - : public ProcessObject - { - public: - typedef FilterObject Self; - typedef ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( FilterObject, ProcessObject ); - - protected: - FilterObject( ); - virtual ~FilterObject( ); - - private: - // Purposely not implemented - FilterObject( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__FILTEROBJECT__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Image.cxx b/lib/cpPlugins/Interface/Image.cxx index 8ddd9cc..b0d18b0 100644 --- a/lib/cpPlugins/Interface/Image.cxx +++ b/lib/cpPlugins/Interface/Image.cxx @@ -1,177 +1,181 @@ #include -#include -#include +/* TODO + #include + #include -#define ITK_MANUAL_INSTANTIATION -#include -#include + #define ITK_MANUAL_INSTANTIATION + #include + #include -#include -#include -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include + #include + #include +*/ // ------------------------------------------------------------------------- -void cpPlugins::Interface::Image:: -SetITKDataObject( itk::DataObject* o ) -{ - bool r; - if( dynamic_cast< itk::ImageBase< 1 >* >( o ) != NULL ) - { - cpPlugins_Image_Array_Demangle( - itk::Vector, float, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Vector, double, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Point, float, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Point, double, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::CovariantVector, float, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::CovariantVector, double, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::SymmetricSecondRankTensor, float, 1, 1, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::SymmetricSecondRankTensor, double, 1, 1, o, _Type, r - ); - else r = this->_Dim< 1 >( o ); - } - else if( dynamic_cast< itk::ImageBase< 2 >* >( o ) != NULL ) - { - cpPlugins_Image_Demangle( - itk::RGBPixel< char >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBPixel< short >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBPixel< unsigned char >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBPixel< unsigned short >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< char >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< short >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< unsigned char >, 2, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< unsigned short >, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Vector, float, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Vector, double, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Point, float, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Point, double, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::CovariantVector, float, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::CovariantVector, double, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::SymmetricSecondRankTensor, float, 2, 2, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::SymmetricSecondRankTensor, double, 2, 2, o, _Type, r - ); - else r = this->_Dim< 2 >( o ); - } - else if( dynamic_cast< itk::ImageBase< 3 >* >( o ) != NULL ) - { - cpPlugins_Image_Demangle( - itk::RGBPixel< char >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBPixel< short >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBPixel< unsigned char >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBPixel< unsigned short >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< char >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< short >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< unsigned char >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::RGBAPixel< unsigned short >, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Vector, float, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Vector, double, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Point, float, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::Point, double, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::CovariantVector, float, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::CovariantVector, double, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::SymmetricSecondRankTensor, float, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Array_Demangle( - itk::SymmetricSecondRankTensor, double, 3, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::DiffusionTensor3D< float >, 3, o, _Type, r - ); - else cpPlugins_Image_Demangle( - itk::DiffusionTensor3D< double >, 3, o, _Type, r - ); - else r = this->_Dim< 3 >( o ); - } - else if( dynamic_cast< itk::ImageBase< 4 >* >( o ) != NULL ) - { - this->m_ITKObject = o; - this->m_VTKObject = NULL; - this->m_ITKvVTKConnection = NULL; +/* TODO + void cpPlugins::Interface::Image:: + SetITKDataObject( itk::DataObject* o ) + { + bool r; + if( dynamic_cast< itk::ImageBase< 1 >* >( o ) != NULL ) + { + cpPlugins_Image_Array_Demangle( + itk::Vector, float, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Vector, double, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Point, float, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Point, double, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::CovariantVector, float, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::CovariantVector, double, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::SymmetricSecondRankTensor, float, 1, 1, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::SymmetricSecondRankTensor, double, 1, 1, o, _Type, r + ); + else r = this->_Dim< 1 >( o ); + } + else if( dynamic_cast< itk::ImageBase< 2 >* >( o ) != NULL ) + { + cpPlugins_Image_Demangle( + itk::RGBPixel< char >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBPixel< short >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBPixel< unsigned char >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBPixel< unsigned short >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< char >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< short >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< unsigned char >, 2, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< unsigned short >, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Vector, float, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Vector, double, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Point, float, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Point, double, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::CovariantVector, float, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::CovariantVector, double, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::SymmetricSecondRankTensor, float, 2, 2, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::SymmetricSecondRankTensor, double, 2, 2, o, _Type, r + ); + else r = this->_Dim< 2 >( o ); + } + else if( dynamic_cast< itk::ImageBase< 3 >* >( o ) != NULL ) + { + cpPlugins_Image_Demangle( + itk::RGBPixel< char >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBPixel< short >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBPixel< unsigned char >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBPixel< unsigned short >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< char >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< short >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< unsigned char >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::RGBAPixel< unsigned short >, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Vector, float, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Vector, double, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Point, float, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::Point, double, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::CovariantVector, float, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::CovariantVector, double, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::SymmetricSecondRankTensor, float, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Array_Demangle( + itk::SymmetricSecondRankTensor, double, 3, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::DiffusionTensor3D< float >, 3, o, _Type, r + ); + else cpPlugins_Image_Demangle( + itk::DiffusionTensor3D< double >, 3, o, _Type, r + ); + else r = this->_Dim< 3 >( o ); + } + else if( dynamic_cast< itk::ImageBase< 4 >* >( o ) != NULL ) + { + this->m_ITKObject = o; + this->m_VTKObject = NULL; + this->m_ITKvVTKConnection = NULL; - } // fi -} + } // fi + } +*/ // ------------------------------------------------------------------------- void cpPlugins::Interface::Image:: -SetVTKDataObject( vtkDataObject* o ) +SetVTKImageData( vtkImageData* image ) { - // this->m_VTKObject = o; + // this->m_VTKObject = image; std::cerr << "Image: TODO this!!!!" << std::endl; std::exit( 1 ); } @@ -180,7 +184,9 @@ SetVTKDataObject( vtkDataObject* o ) vtkImageData* cpPlugins::Interface::Image:: GetVTKImageData( ) { - return( dynamic_cast< vtkImageData* >( this->GetVTKDataObject( ) ) ); + return( + dynamic_cast< vtkImageData* >( this->m_VTKObject.GetPointer( ) ) + ); } // ------------------------------------------------------------------------- @@ -188,7 +194,7 @@ const vtkImageData* cpPlugins::Interface::Image:: GetVTKImageData( ) const { return( - dynamic_cast< const vtkImageData* >( this->GetVTKDataObject( ) ) + dynamic_cast< const vtkImageData* >( this->m_VTKObject.GetPointer( ) ) ); } @@ -208,67 +214,69 @@ cpPlugins::Interface::Image:: } // ------------------------------------------------------------------------- -template< unsigned int D > -bool cpPlugins::Interface::Image:: -_Dim( itk::DataObject* o ) -{ - bool r; - cpPlugins_Image_Demangle( - char, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - short, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - int, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - long, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - unsigned char, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - unsigned short, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - unsigned int, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - unsigned long, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - float, D, o, _Type, r - ); - else cpPlugins_Image_Demangle( - double, D, o, _Type, r - ); - else - { - this->m_ITKObject = o; - this->m_VTKObject = NULL; - this->m_ITKvVTKConnection = NULL; +/* TODO + template< unsigned int D > + bool cpPlugins::Interface::Image:: + _Dim( itk::DataObject* o ) + { + bool r; + cpPlugins_Image_Demangle( + char, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + short, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + int, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + long, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + unsigned char, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + unsigned short, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + unsigned int, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + unsigned long, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + float, D, o, _Type, r + ); + else cpPlugins_Image_Demangle( + double, D, o, _Type, r + ); + else + { + this->m_ITKObject = o; + this->m_VTKObject = NULL; + this->m_ITKvVTKConnection = NULL; - } // fi - return( true ); -} + } // fi + return( true ); + } -// ------------------------------------------------------------------------- -template< class I > -bool cpPlugins::Interface::Image:: -_Type( itk::DataObject* o ) -{ - typedef itk::ImageToVTKImageFilter< I > _F; + // ------------------------------------------------------------------------- + template< class I > + bool cpPlugins::Interface::Image:: + _Type( itk::DataObject* o ) + { + typedef itk::ImageToVTKImageFilter< I > _F; - typename _F::Pointer f = _F::New( ); - f->SetInput( dynamic_cast< I* >( o ) ); - f->Update( ); + typename _F::Pointer f = _F::New( ); + f->SetInput( dynamic_cast< I* >( o ) ); + f->Update( ); - this->m_ITKObject = o; - this->m_VTKObject = f->GetOutput( ); - this->m_ITKvVTKConnection = f; + this->m_ITKObject = o; + this->m_VTKObject = f->GetOutput( ); + this->m_ITKvVTKConnection = f; - return( true ); -} + return( true ); + } +*/ // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Image.h b/lib/cpPlugins/Interface/Image.h index 68367fd..6902b70 100644 --- a/lib/cpPlugins/Interface/Image.h +++ b/lib/cpPlugins/Interface/Image.h @@ -1,9 +1,7 @@ #ifndef __CPPLUGINS__INTERFACE__IMAGE__H__ #define __CPPLUGINS__INTERFACE__IMAGE__H__ -#include -#include -#include +#include #include #define ITK_MANUAL_INSTANTIATION @@ -12,14 +10,16 @@ class vtkImageData; // ------------------------------------------------------------------------- -#define cpPlugins_Image_Demangle( p, d, o, f, r ) \ - if( dynamic_cast< itk::Image< p, d >* >( o ) != NULL ) \ - r = this->f< itk::Image< p, d > >( o ) +/* TODO + #define cpPlugins_Image_Demangle( p, d, o, f, r ) \ + if( dynamic_cast< itk::Image< p, d >* >( o ) != NULL ) \ + r = this->f< itk::Image< p, d > >( o ) -// ------------------------------------------------------------------------- -#define cpPlugins_Image_Array_Demangle( a, p, da, di, o, f, r ) \ - if( dynamic_cast< itk::Image< a< p, da >, di >* >( o ) != NULL ) \ - r = this->f< itk::Image< a< p, da >, di > >( o ) + // ------------------------------------------------------------------------- + #define cpPlugins_Image_Array_Demangle( a, p, da, di, o, f, r ) \ + if( dynamic_cast< itk::Image< a< p, da >, di >* >( o ) != NULL ) \ + r = this->f< itk::Image< a< p, da >, di > >( o ) +*/ // ------------------------------------------------------------------------- namespace cpPlugins @@ -28,7 +28,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT Image + class cpPlugins_Interface_EXPORT Image : public DataObject { public: @@ -42,9 +42,21 @@ namespace cpPlugins itkTypeMacro( Image, DataObject ); public: - virtual void SetITKDataObject( itk::DataObject* o ); - virtual void SetVTKDataObject( vtkDataObject* o ); + /* + virtual void SetITKDataObject( itk::DataObject* o ); + virtual void SetVTKDataObject( vtkDataObject* o ); + */ + + template< class I > + inline void SetITKImage( itk::DataObject* object ); + + template< class I > + inline I* GetITKImage( ); + template< class I > + inline const I* GetITKImage( ) const; + + virtual void SetVTKImageData( vtkImageData* image ); virtual vtkImageData* GetVTKImageData( ); virtual const vtkImageData* GetVTKImageData( ) const; @@ -52,11 +64,13 @@ namespace cpPlugins Image( ); virtual ~Image( ); - template< unsigned int D > - bool _Dim( itk::DataObject* o ); + /* TODO + template< unsigned int D > + bool _Dim( itk::DataObject* o ); - template< class I > - bool _Type( itk::DataObject* o ); + template< class I > + bool _Type( itk::DataObject* o ); + */ private: // Purposely not implemented @@ -71,6 +85,8 @@ namespace cpPlugins } // ecapseman +#include + #endif // __CPPLUGINS__INTERFACE__IMAGE__H__ // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Image.hxx b/lib/cpPlugins/Interface/Image.hxx new file mode 100644 index 0000000..bd8ee04 --- /dev/null +++ b/lib/cpPlugins/Interface/Image.hxx @@ -0,0 +1,48 @@ +#ifndef __CPPLUGINS__INTERFACE__IMAGE__HXX__ +#define __CPPLUGINS__INTERFACE__IMAGE__HXX__ + +#define ITK_MANUAL_INSTANTIATION +#include + +// ------------------------------------------------------------------------- +template< class I > +void cpPlugins::Interface::Image:: +SetITKImage( itk::DataObject* object ) +{ + // Check if input object has the desired type + I* image = dynamic_cast< I* >( object ); + if( image == NULL ) + return; + + // Connect it to VTK + typename itk::ImageToVTKImageFilter< I >::Pointer f = + itk::ImageToVTKImageFilter< I >::New( ); + f->SetInput( image ); + f->Update( ); + + // Keep objects + this->m_ITKObject = object; + this->m_VTKObject = f->GetOutput( ); + this->m_ITKvVTKConnection = f; + this->Modified( ); +} + +// ------------------------------------------------------------------------- +template< class I > +I* cpPlugins::Interface::Image:: +GetITKImage( ) +{ + return( dynamic_cast< I* >( this->m_ITKObject.GetPointer( ) ) ); +} + +// ------------------------------------------------------------------------- +template< class I > +const I* cpPlugins::Interface::Image:: +GetITKImage( ) const +{ + return( dynamic_cast< const I* >( this->m_ITKObject.GetPointer( ) ) ); +} + +#endif // __CPPLUGINS__INTERFACE__IMAGE__HXX__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageSink.cxx b/lib/cpPlugins/Interface/ImageSink.cxx deleted file mode 100644 index 3eda9e9..0000000 --- a/lib/cpPlugins/Interface/ImageSink.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageSink:: -ImageSink( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::ImageSink"; - this->m_ClassCategory = "ImageSink"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageSink:: -~ImageSink( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageSink.h b/lib/cpPlugins/Interface/ImageSink.h deleted file mode 100644 index 7af9056..0000000 --- a/lib/cpPlugins/Interface/ImageSink.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__IMAGESINK__H__ -#define __CPPLUGINS__INTERFACE__IMAGESINK__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT ImageSink - : public SinkObject - { - public: - typedef ImageSink Self; - typedef SinkObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( ImageSink, SinkObject ); - - protected: - ImageSink( ); - virtual ~ImageSink( ); - - private: - // Purposely not implemented - ImageSink( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__IMAGESINK__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageSource.cxx b/lib/cpPlugins/Interface/ImageSource.cxx deleted file mode 100644 index 8fd69b6..0000000 --- a/lib/cpPlugins/Interface/ImageSource.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageSource:: -ImageSource( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::ImageSource"; - this->m_ClassCategory = "ImageSource"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageSource:: -~ImageSource( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageSource.h b/lib/cpPlugins/Interface/ImageSource.h deleted file mode 100644 index f5b8396..0000000 --- a/lib/cpPlugins/Interface/ImageSource.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__IMAGESOURCE__H__ -#define __CPPLUGINS__INTERFACE__IMAGESOURCE__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT ImageSource - : public SourceObject - { - public: - typedef ImageSource Self; - typedef SourceObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( ImageSource, SourceObject ); - - protected: - ImageSource( ); - virtual ~ImageSource( ); - - private: - // Purposely not implemented - ImageSource( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__IMAGESOURCE__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageToImageFilter.cxx b/lib/cpPlugins/Interface/ImageToImageFilter.cxx deleted file mode 100644 index 80e8779..0000000 --- a/lib/cpPlugins/Interface/ImageToImageFilter.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageToImageFilter:: -ImageToImageFilter( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::ImageToImageFilter"; - this->m_ClassCategory = "ImageToImageFilter"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageToImageFilter:: -~ImageToImageFilter( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageToImageFilter.h b/lib/cpPlugins/Interface/ImageToImageFilter.h deleted file mode 100644 index 0858362..0000000 --- a/lib/cpPlugins/Interface/ImageToImageFilter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__IMAGETOIMAGEFILTER__H__ -#define __CPPLUGINS__INTERFACE__IMAGETOIMAGEFILTER__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT ImageToImageFilter - : public FilterObject - { - public: - typedef ImageToImageFilter Self; - typedef FilterObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( ImageToImageFilter, FilterObject ); - - protected: - ImageToImageFilter( ); - virtual ~ImageToImageFilter( ); - - private: - // Purposely not implemented - ImageToImageFilter( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__IMAGETOIMAGEFILTER__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageToMeshFilter.cxx b/lib/cpPlugins/Interface/ImageToMeshFilter.cxx deleted file mode 100644 index ad53521..0000000 --- a/lib/cpPlugins/Interface/ImageToMeshFilter.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageToMeshFilter:: -ImageToMeshFilter( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::ImageToMeshFilter"; - this->m_ClassCategory = "ImageToMeshFilter"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::ImageToMeshFilter:: -~ImageToMeshFilter( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/ImageToMeshFilter.h b/lib/cpPlugins/Interface/ImageToMeshFilter.h deleted file mode 100644 index 499a5e9..0000000 --- a/lib/cpPlugins/Interface/ImageToMeshFilter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__IMAGETOMESHFILTER__H__ -#define __CPPLUGINS__INTERFACE__IMAGETOMESHFILTER__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT ImageToMeshFilter - : public FilterObject - { - public: - typedef ImageToMeshFilter Self; - typedef FilterObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( ImageToMeshFilter, FilterObject ); - - protected: - ImageToMeshFilter( ); - virtual ~ImageToMeshFilter( ); - - private: - // Purposely not implemented - ImageToMeshFilter( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__IMAGETOMESHFILTER__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Interface.h b/lib/cpPlugins/Interface/Interface.h index 555bbae..a51f8be 100644 --- a/lib/cpPlugins/Interface/Interface.h +++ b/lib/cpPlugins/Interface/Interface.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include @@ -16,7 +16,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT Interface + class cpPlugins_Interface_EXPORT Interface { public: typedef std::vector< ObjectProvider* > TProviders; diff --git a/lib/cpPlugins/Interface/Mesh.cxx b/lib/cpPlugins/Interface/Mesh.cxx index c052e6a..55114dd 100644 --- a/lib/cpPlugins/Interface/Mesh.cxx +++ b/lib/cpPlugins/Interface/Mesh.cxx @@ -4,6 +4,30 @@ // ------------------------------------------------------------------------- void cpPlugins::Interface::Mesh:: +SetVTKMesh( vtkPolyData* mesh ) +{ + this->m_VTKObject = mesh; + this->Modified( ); +} + +// ------------------------------------------------------------------------- +vtkPolyData* cpPlugins::Interface::Mesh:: +GetVTKMesh( ) +{ + return( dynamic_cast< vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) ); +} + +// ------------------------------------------------------------------------- +const vtkPolyData* cpPlugins::Interface::Mesh:: +GetVTKMesh( ) const +{ + return( + dynamic_cast< const vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) + ); +} + +/* +void cpPlugins::Interface::Mesh:: SetITKDataObject( itk::DataObject* o ) { // TODO: conversion!!! @@ -40,6 +64,7 @@ GetVTKPolyData( ) const dynamic_cast< const vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) ); } +*/ // ------------------------------------------------------------------------- cpPlugins::Interface::Mesh:: @@ -57,6 +82,7 @@ cpPlugins::Interface::Mesh:: } // ------------------------------------------------------------------------- +/* TODO template< unsigned int D > void cpPlugins::Interface::Mesh:: _ITK_2_VTK_0( itk::DataObject* o ) @@ -83,5 +109,6 @@ void cpPlugins::Interface::Mesh:: _VTK_2_ITK_1( itk::DataObject* o ) { } +*/ // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Mesh.h b/lib/cpPlugins/Interface/Mesh.h index ae72928..11a52e8 100644 --- a/lib/cpPlugins/Interface/Mesh.h +++ b/lib/cpPlugins/Interface/Mesh.h @@ -1,7 +1,7 @@ #ifndef __CPPLUGINS__INTERFACE__MESH__H__ #define __CPPLUGINS__INTERFACE__MESH__H__ -#include +#include #include class vtkPolyData; @@ -12,7 +12,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT Mesh + class cpPlugins_Interface_EXPORT Mesh : public DataObject { public: @@ -26,27 +26,44 @@ namespace cpPlugins itkTypeMacro( Mesh, DataObject ); public: - virtual void SetITKDataObject( itk::DataObject* o ); - virtual void SetVTKDataObject( vtkDataObject* o ); + template< class M > + inline void SetITKMesh( itk::DataObject* object ); - vtkPolyData* GetVTKPolyData( ); - const vtkPolyData* GetVTKPolyData( ) const; + template< class M > + inline M* GetITKMesh( ); + + template< class M > + inline const M* GetITKMesh( ) const; + + virtual void SetVTKMesh( vtkPolyData* mesh ); + virtual vtkPolyData* GetVTKMesh( ); + virtual const vtkPolyData* GetVTKMesh( ) const; + + /* TODO + virtual void SetITKDataObject( itk::DataObject* o ); + virtual void SetVTKDataObject( vtkDataObject* o ); + + vtkPolyData* GetVTKPolyData( ); + const vtkPolyData* GetVTKPolyData( ) const; + */ protected: Mesh( ); virtual ~Mesh( ); - template< unsigned int D > - void _ITK_2_VTK_0( itk::DataObject* o ); + /* TODO + template< unsigned int D > + void _ITK_2_VTK_0( itk::DataObject* o ); - template< class P, unsigned int D > - void _ITK_2_VTK_1( itk::DataObject* o ); + template< class P, unsigned int D > + void _ITK_2_VTK_1( itk::DataObject* o ); - template< unsigned int D > - void _VTK_2_ITK_0( itk::DataObject* o ); + template< unsigned int D > + void _VTK_2_ITK_0( itk::DataObject* o ); - template< class P, unsigned int D > - void _VTK_2_ITK_1( itk::DataObject* o ); + template< class P, unsigned int D > + void _VTK_2_ITK_1( itk::DataObject* o ); + */ private: // Purposely not implemented @@ -58,6 +75,8 @@ namespace cpPlugins } // ecapseman +#include + #endif // __CPPLUGINS__INTERFACE__MESH__H__ // eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Mesh.hxx b/lib/cpPlugins/Interface/Mesh.hxx new file mode 100644 index 0000000..980321d --- /dev/null +++ b/lib/cpPlugins/Interface/Mesh.hxx @@ -0,0 +1,35 @@ +#ifndef __CPPLUGINS__INTERFACE__MESH__HXX__ +#define __CPPLUGINS__INTERFACE__MESH__HXX__ + +// ------------------------------------------------------------------------- +template< class M > +void cpPlugins::Interface::Mesh:: +SetITKMesh( itk::DataObject* object ) +{ + std::cerr << "SetITKMesh: TODO" << std::endl; + std::exit( 1 ); +} + +// ------------------------------------------------------------------------- +template< class M > +M* cpPlugins::Interface::Mesh:: +GetITKMesh( ) +{ + std::cerr << "GetITKMesh: TODO" << std::endl; + std::exit( 1 ); + return( NULL ); +} + +// ------------------------------------------------------------------------- +template< class M > +const M* cpPlugins::Interface::Mesh:: +GetITKMesh( ) const +{ + std::cerr << "GetITKMesh (const): TODO" << std::endl; + std::exit( 1 ); + return( NULL ); +} + +#endif // __CPPLUGINS__INTERFACE__MESH__HXX__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshSink.cxx b/lib/cpPlugins/Interface/MeshSink.cxx deleted file mode 100644 index e27259e..0000000 --- a/lib/cpPlugins/Interface/MeshSink.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshSink:: -MeshSink( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::MeshSink"; - this->m_ClassCategory = "MeshSink"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshSink:: -~MeshSink( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshSink.h b/lib/cpPlugins/Interface/MeshSink.h deleted file mode 100644 index a23b55a..0000000 --- a/lib/cpPlugins/Interface/MeshSink.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__MESHSINK__H__ -#define __CPPLUGINS__INTERFACE__MESHSINK__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT MeshSink - : public SinkObject - { - public: - typedef MeshSink Self; - typedef SinkObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( MeshSink, SinkObject ); - - protected: - MeshSink( ); - virtual ~MeshSink( ); - - private: - // Purposely not implemented - MeshSink( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__MESHSINK__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshSource.cxx b/lib/cpPlugins/Interface/MeshSource.cxx deleted file mode 100644 index 91d7ed3..0000000 --- a/lib/cpPlugins/Interface/MeshSource.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshSource:: -MeshSource( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::MeshSource"; - this->m_ClassCategory = "MeshSource"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshSource:: -~MeshSource( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshSource.h b/lib/cpPlugins/Interface/MeshSource.h deleted file mode 100644 index 5c1257f..0000000 --- a/lib/cpPlugins/Interface/MeshSource.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__MESHSOURCE__H__ -#define __CPPLUGINS__INTERFACE__MESHSOURCE__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT MeshSource - : public SourceObject - { - public: - typedef MeshSource Self; - typedef SourceObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( MeshSource, SourceObject ); - - protected: - MeshSource( ); - virtual ~MeshSource( ); - - private: - // Purposely not implemented - MeshSource( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__MESHSOURCE__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshToImageFilter.cxx b/lib/cpPlugins/Interface/MeshToImageFilter.cxx deleted file mode 100644 index 394b9f9..0000000 --- a/lib/cpPlugins/Interface/MeshToImageFilter.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshToImageFilter:: -MeshToImageFilter( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::MeshToImageFilter"; - this->m_ClassCategory = "MeshToImageFilter"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshToImageFilter:: -~MeshToImageFilter( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshToImageFilter.h b/lib/cpPlugins/Interface/MeshToImageFilter.h deleted file mode 100644 index 97947d1..0000000 --- a/lib/cpPlugins/Interface/MeshToImageFilter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__MESHTOIMAGEFILTER__H__ -#define __CPPLUGINS__INTERFACE__MESHTOIMAGEFILTER__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT MeshToImageFilter - : public FilterObject - { - public: - typedef MeshToImageFilter Self; - typedef FilterObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( MeshToImageFilter, FilterObject ); - - protected: - MeshToImageFilter( ); - virtual ~MeshToImageFilter( ); - - private: - // Purposely not implemented - MeshToImageFilter( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__MESHTOIMAGEFILTER__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshToMeshFilter.cxx b/lib/cpPlugins/Interface/MeshToMeshFilter.cxx deleted file mode 100644 index df88b17..0000000 --- a/lib/cpPlugins/Interface/MeshToMeshFilter.cxx +++ /dev/null @@ -1,18 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshToMeshFilter:: -MeshToMeshFilter( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::MeshToMeshFilter"; - this->m_ClassCategory = "MeshToMeshFilter"; -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::MeshToMeshFilter:: -~MeshToMeshFilter( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/MeshToMeshFilter.h b/lib/cpPlugins/Interface/MeshToMeshFilter.h deleted file mode 100644 index aa3cf11..0000000 --- a/lib/cpPlugins/Interface/MeshToMeshFilter.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__MESHTOMESHFILTER__H__ -#define __CPPLUGINS__INTERFACE__MESHTOMESHFILTER__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT MeshToMeshFilter - : public FilterObject - { - public: - typedef MeshToMeshFilter Self; - typedef FilterObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( MeshToMeshFilter, FilterObject ); - - protected: - MeshToMeshFilter( ); - virtual ~MeshToMeshFilter( ); - - private: - // Purposely not implemented - MeshToMeshFilter( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__MESHTOMESHFILTER__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h index ef8cab8..bcb7e60 100644 --- a/lib/cpPlugins/Interface/Object.h +++ b/lib/cpPlugins/Interface/Object.h @@ -3,7 +3,7 @@ #include #include -#include +#include #define ITK_MANUAL_INSTANTIATION #include @@ -11,17 +11,17 @@ // ------------------------------------------------------------------------- #define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ - class cpPlugins_EXPORT TYPE##Provider \ + class cpPlugins_Interface_EXPORT TYPE##Provider \ : public pluma::Provider \ { \ - private: \ +private: \ friend class pluma::Pluma; \ static const unsigned int PLUMA_INTERFACE_VERSION; \ static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \ static const std::string PLUMA_PROVIDER_TYPE; \ std::string plumaGetType( ) const \ { return( PLUMA_PROVIDER_TYPE ); } \ - public: \ +public: \ unsigned int getVersion( ) const \ { return( PLUMA_INTERFACE_VERSION ); } @@ -31,7 +31,7 @@ // ------------------------------------------------------------------------- #define CPPLUGINS_PROVIDER_HEADER( TYPE ) \ CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ - virtual TYPE::Pointer create( ) const = 0; \ + virtual TYPE::Pointer create( ) const = 0; \ CPPLUGINS_PROVIDER_HEADER_END // ------------------------------------------------------------------------- @@ -58,7 +58,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT Object + class cpPlugins_Interface_EXPORT Object : public itk::Object { public: diff --git a/lib/cpPlugins/Interface/Parameters.h b/lib/cpPlugins/Interface/Parameters.h index def98e7..0e54f0f 100644 --- a/lib/cpPlugins/Interface/Parameters.h +++ b/lib/cpPlugins/Interface/Parameters.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include namespace cpPlugins { @@ -13,7 +13,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT Parameters + class cpPlugins_Interface_EXPORT Parameters { // ------------------------------------------------------------------- friend std::ostream& operator<<( diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h index 742db57..31a9e62 100644 --- a/lib/cpPlugins/Interface/ProcessObject.h +++ b/lib/cpPlugins/Interface/ProcessObject.h @@ -1,13 +1,11 @@ #ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ #define __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ -#include +#include #include #include #include -#include - #define ITK_MANUAL_INSTANTIATION #include @@ -17,7 +15,7 @@ namespace cpPlugins { /** */ - class cpPlugins_EXPORT ProcessObject + class cpPlugins_Interface_EXPORT ProcessObject : public Object { public: @@ -50,13 +48,7 @@ namespace cpPlugins virtual ~ProcessObject( ); template< class O > - void _MakeOutput( unsigned int idx ) - { - if( idx >= this->m_Outputs.size( ) ) - return; - this->m_Outputs[ idx ] = O::New( ); - this->m_Outputs[ idx ]->SetSource( this ); - } + inline void _MakeOutput( unsigned int idx ); virtual std::string _GenerateData( ) = 0; @@ -78,562 +70,567 @@ namespace cpPlugins } // ecapseman -// ------------------------------------------------------------------------- -#define cpPlugins_Image_Demangle_Methods( c ) \ - std::string _DemangleImageDimension( itk::DataObject* o ); \ - std::string _DemangleImagePixel( unsigned int d, itk::DataObject* o ); +#include -// ------------------------------------------------------------------------- -#define cpPlugins_Image_Demangle_Methods_Code( c, f ) \ - std::string c::_DemangleImageDimension( itk::DataObject* o ) \ - { \ - std::string r = ""; \ - if( dynamic_cast< itk::ImageBase< 1 >* >( o ) != NULL ) \ - { \ - cpPlugins_Image_Array_Demangle( \ - itk::Vector, float, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, double, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, float, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, double, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, float, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, double, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, float, 1, 1, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, double, 1, 1, o, f, r \ - ); \ - else r = this->_DemangleImagePixel( 1, o ); \ - } \ - else if( dynamic_cast< itk::ImageBase< 2 >* >( o ) != NULL ) \ - { \ - cpPlugins_Image_Demangle( \ - itk::RGBPixel< char >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< short >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< unsigned char >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< unsigned short >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< char >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< short >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< unsigned char >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< unsigned short >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, float, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, double, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, float, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, double, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, float, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, double, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, float, 2, 2, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, double, 2, 2, o, f, r \ - ); \ - else r = this->_DemangleImagePixel( 2, o ); \ - } \ - else if( dynamic_cast< itk::ImageBase< 3 >* >( o ) != NULL ) \ - { \ - cpPlugins_Image_Demangle( \ - itk::RGBPixel< char >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< short >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< unsigned char >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< unsigned short >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< char >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< short >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< unsigned char >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< unsigned short >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, float, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, double, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, float, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, double, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, float, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, double, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, float, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, double, 3, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::DiffusionTensor3D< float >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::DiffusionTensor3D< double >, 3, o, f, r \ - ); \ - else r = this->_DemangleImagePixel( 3, o ); \ - } \ - else if( dynamic_cast< itk::ImageBase< 4 >* >( o ) != NULL ) \ - { \ - cpPlugins_Image_Demangle( \ - itk::RGBPixel< char >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< short >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< unsigned char >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBPixel< unsigned short >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< char >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< short >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< unsigned char >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::RGBAPixel< unsigned short >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, float, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Vector, double, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, float, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::Point, double, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, float, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::CovariantVector, double, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, float, 4, 4, o, f, r \ - ); \ - else cpPlugins_Image_Array_Demangle( \ - itk::SymmetricSecondRankTensor, double, 4, 4, o, f, r \ - ); \ - else r = this->_DemangleImagePixel( 4, o ); \ - } \ - else \ - r = \ - std::string( #c ) + \ - std::string( ": Image dimension not supported." ); \ - return( r ); \ - } \ - std::string c::_DemangleImagePixel( \ - unsigned int d, itk::DataObject* o \ - ) \ - { \ - std::string r = ""; \ - if( d == 1 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< float >, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< double >, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::Offset< 1 >, 1, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else if( d == 2 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< float >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< double >, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::Offset< 2 >, 2, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else if( d == 3 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< float >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< double >, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::Offset< 3 >, 3, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else if( d == 4 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< float >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - std::complex< double >, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - itk::Offset< 4 >, 4, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else \ - r = \ - std::string( #c ) + \ - std::string( ": Image dimension not supported." ); \ - return( r ); \ - } // ------------------------------------------------------------------------- -#define cpPlugins_Image_Demangle_Methods_Code_Only_Scalars( c, f ) \ - std::string c::_DemangleImageDimension( itk::DataObject* o ) \ - { \ - std::string r = ""; \ - if( dynamic_cast< itk::ImageBase< 1 >* >( o ) != NULL ) \ - r = this->_DemangleImagePixel( 1, o ); \ - else if( dynamic_cast< itk::ImageBase< 2 >* >( o ) != NULL ) \ - r = this->_DemangleImagePixel( 2, o ); \ - else if( dynamic_cast< itk::ImageBase< 3 >* >( o ) != NULL ) \ - r = this->_DemangleImagePixel( 3, o ); \ - else if( dynamic_cast< itk::ImageBase< 4 >* >( o ) != NULL ) \ - r = this->_DemangleImagePixel( 4, o ); \ - else \ - r = \ - std::string( #c ) + \ - std::string( ": Image dimension not supported." ); \ - return( r ); \ - } \ - std::string c::_DemangleImagePixel( \ - unsigned int d, itk::DataObject* o \ - ) \ - { \ - std::string r = ""; \ - if( d == 1 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 1, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 1, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else if( d == 2 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 2, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 2, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else if( d == 3 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 3, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 3, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else if( d == 4 ) \ - { \ - cpPlugins_Image_Demangle( \ - char, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - short, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - int, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - long, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned char, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned short, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned int, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - unsigned long, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - float, 4, o, f, r \ - ); \ - else cpPlugins_Image_Demangle( \ - double, 4, o, f, r \ - ); \ - else r = std::string( #c ) + std::string( ": Image type." ); \ - } \ - else \ - r = \ - std::string( #c ) + \ - std::string( ": Image dimension not supported." ); \ - return( r ); \ - } +/* TODO + #define cpPlugins_Image_Demangle_Methods( c ) \ + std::string _DemangleImageDimension( itk::DataObject* o ); \ + std::string _DemangleImagePixel( unsigned int d, itk::DataObject* o ); + + // ------------------------------------------------------------------------- + #define cpPlugins_Image_Demangle_Methods_Code( c, f ) \ + std::string c::_DemangleImageDimension( itk::DataObject* o ) \ + { \ + std::string r = ""; \ + if( dynamic_cast< itk::ImageBase< 1 >* >( o ) != NULL ) \ + { \ + cpPlugins_Image_Array_Demangle( \ + itk::Vector, float, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, double, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, float, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, double, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, float, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, double, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, float, 1, 1, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, double, 1, 1, o, f, r \ + ); \ + else r = this->_DemangleImagePixel( 1, o ); \ + } \ + else if( dynamic_cast< itk::ImageBase< 2 >* >( o ) != NULL ) \ + { \ + cpPlugins_Image_Demangle( \ + itk::RGBPixel< char >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< short >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< unsigned char >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< unsigned short >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< char >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< short >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< unsigned char >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< unsigned short >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, float, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, double, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, float, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, double, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, float, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, double, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, float, 2, 2, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, double, 2, 2, o, f, r \ + ); \ + else r = this->_DemangleImagePixel( 2, o ); \ + } \ + else if( dynamic_cast< itk::ImageBase< 3 >* >( o ) != NULL ) \ + { \ + cpPlugins_Image_Demangle( \ + itk::RGBPixel< char >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< short >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< unsigned char >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< unsigned short >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< char >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< short >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< unsigned char >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< unsigned short >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, float, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, double, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, float, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, double, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, float, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, double, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, float, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, double, 3, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::DiffusionTensor3D< float >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::DiffusionTensor3D< double >, 3, o, f, r \ + ); \ + else r = this->_DemangleImagePixel( 3, o ); \ + } \ + else if( dynamic_cast< itk::ImageBase< 4 >* >( o ) != NULL ) \ + { \ + cpPlugins_Image_Demangle( \ + itk::RGBPixel< char >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< short >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< unsigned char >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBPixel< unsigned short >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< char >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< short >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< unsigned char >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::RGBAPixel< unsigned short >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, float, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Vector, double, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, float, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::Point, double, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, float, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::CovariantVector, double, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, float, 4, 4, o, f, r \ + ); \ + else cpPlugins_Image_Array_Demangle( \ + itk::SymmetricSecondRankTensor, double, 4, 4, o, f, r \ + ); \ + else r = this->_DemangleImagePixel( 4, o ); \ + } \ + else \ + r = \ + std::string( #c ) + \ + std::string( ": Image dimension not supported." ); \ + return( r ); \ + } \ + std::string c::_DemangleImagePixel( \ + unsigned int d, itk::DataObject* o \ + ) \ + { \ + std::string r = ""; \ + if( d == 1 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< float >, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< double >, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::Offset< 1 >, 1, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else if( d == 2 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< float >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< double >, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::Offset< 2 >, 2, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else if( d == 3 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< float >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< double >, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::Offset< 3 >, 3, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else if( d == 4 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< float >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + std::complex< double >, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + itk::Offset< 4 >, 4, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else \ + r = \ + std::string( #c ) + \ + std::string( ": Image dimension not supported." ); \ + return( r ); \ + } + + // ------------------------------------------------------------------------- + #define cpPlugins_Image_Demangle_Methods_Code_Only_Scalars( c, f ) \ + std::string c::_DemangleImageDimension( itk::DataObject* o ) \ + { \ + std::string r = ""; \ + if( dynamic_cast< itk::ImageBase< 1 >* >( o ) != NULL ) \ + r = this->_DemangleImagePixel( 1, o ); \ + else if( dynamic_cast< itk::ImageBase< 2 >* >( o ) != NULL ) \ + r = this->_DemangleImagePixel( 2, o ); \ + else if( dynamic_cast< itk::ImageBase< 3 >* >( o ) != NULL ) \ + r = this->_DemangleImagePixel( 3, o ); \ + else if( dynamic_cast< itk::ImageBase< 4 >* >( o ) != NULL ) \ + r = this->_DemangleImagePixel( 4, o ); \ + else \ + r = \ + std::string( #c ) + \ + std::string( ": Image dimension not supported." ); \ + return( r ); \ + } \ + std::string c::_DemangleImagePixel( \ + unsigned int d, itk::DataObject* o \ + ) \ + { \ + std::string r = ""; \ + if( d == 1 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 1, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 1, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else if( d == 2 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 2, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 2, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else if( d == 3 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 3, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 3, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else if( d == 4 ) \ + { \ + cpPlugins_Image_Demangle( \ + char, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + short, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + int, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + long, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned char, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned short, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned int, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + unsigned long, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + float, 4, o, f, r \ + ); \ + else cpPlugins_Image_Demangle( \ + double, 4, o, f, r \ + ); \ + else r = std::string( #c ) + std::string( ": Image type." ); \ + } \ + else \ + r = \ + std::string( #c ) + \ + std::string( ": Image dimension not supported." ); \ + return( r ); \ + } +*/ #endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__H__ diff --git a/lib/cpPlugins/Interface/ProcessObject.hxx b/lib/cpPlugins/Interface/ProcessObject.hxx new file mode 100644 index 0000000..6dcbb7d --- /dev/null +++ b/lib/cpPlugins/Interface/ProcessObject.hxx @@ -0,0 +1,17 @@ +#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__ +#define __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__ + +// ------------------------------------------------------------------------- +template< class O > +void cpPlugins::Interface::ProcessObject:: +_MakeOutput( unsigned int idx ) +{ + if( idx >= this->m_Outputs.size( ) ) + return; + this->m_Outputs[ idx ] = O::New( ); + this->m_Outputs[ idx ]->SetSource( this ); +} + +#endif // __CPPLUGINS__INTERFACE__PROCESSOBJECT__HXX__ + +// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/SinkObject.cxx b/lib/cpPlugins/Interface/SinkObject.cxx deleted file mode 100644 index 6fdaf4c..0000000 --- a/lib/cpPlugins/Interface/SinkObject.cxx +++ /dev/null @@ -1,19 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::SinkObject:: -SinkObject( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::SinkObject"; - this->m_ClassCategory = "BasicObject"; - this->SetNumberOfOutputs( 0 ); -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::SinkObject:: -~SinkObject( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/SinkObject.h b/lib/cpPlugins/Interface/SinkObject.h deleted file mode 100644 index 644f26a..0000000 --- a/lib/cpPlugins/Interface/SinkObject.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__SINKOBJECT__H__ -#define __CPPLUGINS__INTERFACE__SINKOBJECT__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT SinkObject - : public ProcessObject - { - public: - typedef SinkObject Self; - typedef ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( SinkObject, ProcessObject ); - - protected: - SinkObject( ); - virtual ~SinkObject( ); - - private: - // Purposely not implemented - SinkObject( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__SINKOBJECT__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/SourceObject.cxx b/lib/cpPlugins/Interface/SourceObject.cxx deleted file mode 100644 index bcead3a..0000000 --- a/lib/cpPlugins/Interface/SourceObject.cxx +++ /dev/null @@ -1,19 +0,0 @@ -#include - -// ------------------------------------------------------------------------- -cpPlugins::Interface::SourceObject:: -SourceObject( ) - : Superclass( ) -{ - this->m_ClassName = "cpPlugins::Interface::SourceObject"; - this->m_ClassCategory = "BasicObject"; - this->SetNumberOfInputs( 0 ); -} - -// ------------------------------------------------------------------------- -cpPlugins::Interface::SourceObject:: -~SourceObject( ) -{ -} - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/SourceObject.h b/lib/cpPlugins/Interface/SourceObject.h deleted file mode 100644 index 034d788..0000000 --- a/lib/cpPlugins/Interface/SourceObject.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__ -#define __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__ - -#include -#include - -namespace cpPlugins -{ - namespace Interface - { - /** - */ - class cpPlugins_EXPORT SourceObject - : public ProcessObject - { - public: - typedef SourceObject Self; - typedef ProcessObject Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - public: - itkTypeMacro( SourceObject, ProcessObject ); - - protected: - SourceObject( ); - virtual ~SourceObject( ); - - private: - // Purposely not implemented - SourceObject( const Self& ); - Self& operator=( const Self& ); - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__ - -// eof - $RCSfile$ diff --git a/lib/cpPlugins/Interface/Instances_itkImage.cxx b/lib/cpPlugins/Plugins/Instances_itkImage.cxx similarity index 100% rename from lib/cpPlugins/Interface/Instances_itkImage.cxx rename to lib/cpPlugins/Plugins/Instances_itkImage.cxx diff --git a/lib/cpPlugins/Interface/Instances_itkMesh.cxx b/lib/cpPlugins/Plugins/Instances_itkMesh.cxx similarity index 100% rename from lib/cpPlugins/Interface/Instances_itkMesh.cxx rename to lib/cpPlugins/Plugins/Instances_itkMesh.cxx