#include <cstring>
#include <fstream>
#include <iostream>
+#include <sstream>
#include <string>
// -------------------------------------------------------------------------
std::size_t pos = fname.find_last_of( "." );
if( pos != std::string::npos )
fname = fname.substr( 0, pos );
-
+
return( fname );
}
} // fi
output_code << "#include <Pluma/Connector.hpp>" << std::endl;
+ output_code
+ << "#include <cpPlugins/Interface/ProcessObjectProvider.h>"
+ << std::endl;
+ for( int i = 3; i < argc; ++i )
+ output_code << "#include \"" << argv[ i ] << "\"" << std::endl;
+ output_code << std::endl;
+
+ std::istringstream nspaces( argv[ 2 ] );
+ std::string nspace;
+ unsigned int number_of_nspaces = 0;
+ while( std::getline( nspaces, nspace, ':' ) )
+ {
+ if( nspace != "" )
+ {
+ output_code << "namespace " << nspace << std::endl << "{" << std::endl;
+ number_of_nspaces++;
+
+ } // fi
+
+ } // elihw
+
for( int i = 3; i < argc; ++i )
- output_code << "#include <" << argv[ i ] << ">" << std::endl;
+ output_code
+ << "CPPLUGINS_INHERIT_PROVIDER( "
+ << GetFileName( argv[ i ] ) << " );" << std::endl;
+
+ for( unsigned int i = 0; i < number_of_nspaces; ++i )
+ output_code << "}" << std::endl;
+ output_code << std::endl;
+
+
output_code
- << std::endl
<< "PLUMA_CONNECTOR" << std::endl
<< "bool connect( pluma::Host& host )" << std::endl
- << "{" << std::endl
- << " using namespace " << argv[ 2 ] << ";" << std::endl;
+ << "{" << std::endl;
for( int i = 3; i < argc; ++i )
output_code
<< " host.add( new "
+ << argv[ 2 ] << "::"
<< GetFileName( argv[ i ] )
<< "Provider( ) );"
<< std::endl;
<< " return( true );" << std::endl
<< "}" << std::endl;
+ output_code << std::endl << "// eof - $RCSfile$" << std::endl << std::endl;
+
// Finish
output_code.close( );
return( 0 );
#include <cpPlugins/Interface/Interface.h>
+#include <cpPlugins/Interface/ProcessObjectProvider.h>
#include <algorithm>
#include <cstdlib>
#include <fstream>
{
namespace Interface
{
+ // Some forward declarations
+ class ProcessObjectProvider;
+
/**
*/
class cpPlugins_Interface_EXPORT Interface
#ifndef __CPPLUGINS__INTERFACE__MACROS__H__
#define __CPPLUGINS__INTERFACE__MACROS__H__
-#include <Pluma/Pluma.hpp>
#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
#include <cpPlugins/Interface/Config.h>
virtual const char* GetClassName( ) const { return( #N ); } \
virtual const char* GetClassCategory( ) const { return( #C ); }
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
- class cpPlugins_Interface_EXPORT TYPE##Provider \
- : public pluma::Provider \
- { \
-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: \
- unsigned int getVersion( ) const \
- { return( PLUMA_INTERFACE_VERSION ); }
-
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_HEADER_END };
-
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_HEADER( TYPE ) \
- CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \
- virtual TYPE::Pointer create( ) const = 0; \
- CPPLUGINS_PROVIDER_HEADER_END
-
-// -------------------------------------------------------------------------
-#define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \
- PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion )
-
-// -------------------------------------------------------------------------
-#define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \
- class TYPE##Provider \
- : public cpPlugins::Interface::ProcessObjectProvider \
- { \
- public: \
- cpPlugins::Interface::ProcessObject::Pointer create( ) const \
- { \
- TYPE::Pointer a = TYPE::New( ); \
- cpPlugins::Interface::ProcessObject::Pointer b = a.GetPointer( ); \
- return( b ); \
- } \
- };
-
/**
* Based upon: http://www.itk.org/Wiki/Proposals:Explicit_Instantiation
*/
this->Modified( );
}
-// -------------------------------------------------------------------------
-CPPLUGINS_PROVIDER_SOURCE( cpPlugins::Interface::ProcessObject, 1, 1 );
-
// eof - $RCSfile$
_TDataContainer m_Outputs;
};
- /**
- * Plugin provider
- */
- CPPLUGINS_PROVIDER_HEADER( ProcessObject );
-
} // ecapseman
} // ecapseman
--- /dev/null
+#include <cpPlugins/Interface/ProcessObjectProvider.h>
+
+// -------------------------------------------------------------------------
+PLUMA_PROVIDER_SOURCE( cpPlugins::Interface::ProcessObject, 1, 1 );
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __CPPLUGINS__INTERFACE__PROCESSOBJECTPROVIDER__H__
+#define __CPPLUGINS__INTERFACE__PROCESSOBJECTPROVIDER__H__
+
+#include <Pluma/Pluma.hpp>
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
+#include <cpPlugins/Interface/Config.h>
+#include <cpPlugins/Interface/ProcessObject.h>
+
+// -------------------------------------------------------------------------
+#define CPPLUGINS_INHERIT_PROVIDER( T ) \
+ class T##Provider \
+ : public cpPlugins::Interface::ProcessObjectProvider \
+ { \
+ public: \
+ cpPlugins::Interface::ProcessObject::Pointer create( ) const \
+ { \
+ T::Pointer a = T::New( ); \
+ cpPlugins::Interface::ProcessObject::Pointer b = a.GetPointer( ); \
+ return( b ); \
+ } \
+ };
+
+// -------------------------------------------------------------------------
+namespace cpPlugins
+{
+ namespace Interface
+ {
+ /**
+ */
+ class cpPlugins_Interface_EXPORT ProcessObjectProvider
+ : public pluma::Provider
+ {
+ friend class pluma::Pluma;
+
+ private:
+ 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:
+ unsigned int getVersion( ) const
+ { return( PLUMA_INTERFACE_VERSION ); }
+
+ virtual ProcessObject::Pointer create( ) const = 0;
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#endif // __CPPLUGINS__INTERFACE__PROCESSOBJECTPROVIDER__H__
+
+// eof - $RCSfile$
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( BinaryErodeImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( BinaryThresholdImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( Cutter );
-
} // ecapseman
} // ecapseman
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( DoubleFloodImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( ExtractSliceImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( FloodFillImageFilter );
-
} // ecapseman
} // ecapseman
#endif // cpPlugins_Interface_QT4
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( MacheteFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( MacheteImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( MarchingCubes );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( MedianImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( OtsuThresholdImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( RGBImageToOtherChannelsFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( SignedMaurerDistanceMapImageFilter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( SphereMeshSource );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( DicomSeriesReader );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( ImageReader );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( ImageWriter );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( MeshReader );
-
} // ecapseman
} // ecapseman
Self& operator=( const Self& );
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( MeshWriter );
-
} // ecapseman
} // ecapseman
bool m_Configured;
};
- // ---------------------------------------------------------------------
- CPPLUGINS_INHERIT_PROVIDER( SeedWidget );
-
} // ecapseman
} // ecapseman