std::string definitions_buffer;
if( !( cpPlugins_bash::Read( definitions_buffer, definitions_filename ) ) )
{
- std::cout
+ std::cerr
<< argv[ 0 ]
<< ": Error reading definitions file \"" << definitions_filename
<< "\"" << std::endl;
std::string definitions_buffer;
if( !( cpPlugins_bash::Read( definitions_buffer, definitions_filename ) ) )
{
- std::cout
+ std::cerr
<< argv[ 0 ]
<< ": Error reading definitions file \"" << definitions_filename
<< "\"" << std::endl;
public:\r
typedef itk::SmartPointer< _TFilterObserver > Pointer;\r
typedef itk::SmartPointer< const _TFilterObserver > ConstPointer;\r
- itkNewMacro( _TFilterObserver );\r
+ cpPluginsNewMacro( _TFilterObserver );\r
public:\r
void Execute( itk::Object* c, const itk::EventObject& e )\r
{ this->Execute( const_cast< const itk::Object* >( c ), e ); }\r
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( BoundingBox, DataObject );
cpPlugins_Id_Macro( BoundingBox, Object );
cpPlugins_Compatibility_Macro;
f = nf.GetPointer( );
} // fi
-
- std::string name = "<noname>";
- if( this->m_Source != NULL )
- name = this->m_Source->GetName( );
-
- std::cout << "HOLALALAL: " << name << " " << image << " " << f->GetInput( ) << std::endl;
-
f->SetInput( image );
f->Update( );
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( Image, cpPlugins::BaseObjects::DataObject );
cpPlugins_Id_Macro( Image, Object );
cpPlugins_Compatibility_Macro;
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( Mesh, DataObject );
cpPlugins_Id_Macro( Mesh, Object );
cpPlugins_Compatibility_Macro;
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( PolyLineParametricPath, cpPlugins::BaseObjects::DataObject );
cpPlugins_Id_Macro( PolyLineParametricPath, Object );
cpPlugins_Compatibility_Macro;
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( Simple3DCurve, cpPlugins::BaseObjects::DataObject );
cpPlugins_Id_Macro( Simple3DCurve, Object );
cpPlugins_Compatibility_Macro;
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( Skeleton, cpPlugins::BaseObjects::DataObject );
cpPlugins_Id_Macro( Skeleton, Object );
cpPlugins_Compatibility_Macro;
typedef itk::SmartPointer< const Self > ConstPointer;
public:
- itkNewMacro( Self );
+ cpPluginsNewMacro( Self );
itkTypeMacro( DataObject, Object );
cpPlugins_Id_Macro( DataObject, Object );
void cpPlugins::BaseObjects::ProcessObject::
Modified( ) const
{
- std::cout << "Modified: " << this->m_Name << std::endl;
this->Superclass::Modified( );
cpPlugins::BaseObjects::Events::Modified evt;
* =========================================================================
*/
+#define cpPluginsNewMacro( x ) \
+ static Pointer New( ) \
+ { \
+ Pointer smartPtr = new x( ); \
+ smartPtr->UnRegister( ); \
+ return( smartPtr ); \
+ } \
+ virtual itk::LightObject::Pointer \
+ CreateAnother( ) const cpPlugins_OVERRIDE \
+ { \
+ itk::LightObject::Pointer smartPtr; \
+ smartPtr = x::New( ).GetPointer( ); \
+ return( smartPtr ); \
+ } \
+ Pointer Clone( ) const \
+ { \
+ Pointer rval = \
+ dynamic_cast< x* >( this->InternalClone( ).GetPointer( ) ); \
+ return( rval ); \
+ }
+
#define cpPlugins_Id_Macro( _class, _category ) \
public: \
virtual const char* GetClassName( ) const cpPlugins_OVERRIDE \
typedef itk::SmartPointer< Self > Pointer; \
typedef itk::SmartPointer< const Self > ConstPointer; \
public: \
- itkNewMacro( Self ); \
+ cpPluginsNewMacro( Self ); \
itkTypeMacro( _cls, _scls ); \
public: \
virtual const char* GetClassName( ) const cpPlugins_OVERRIDE \
cpPlugins::Interface::Plugins::
CreateFilter( const std::string& category, const std::string& name )
{
- std::cout << "1" << std::endl;
typedef void* ( *_TCreator )( );
- std::cout << "2" << std::endl;
typedef cpPlugins::BaseObjects::ProcessObject::Pointer _TPtr;
- std::cout << "3" << std::endl;
_TPtr o = NULL;
- std::cout << "4" << std::endl;
auto cat = this->m_Filters.find( category );
- std::cout << "5" << std::endl;
if( cat != this->m_Filters.end( ) )
{
- std::cout << "6" << std::endl;
auto nam = cat->second.find( name );
- std::cout << "7" << std::endl;
if( nam != cat->second.end( ) )
{
- std::cout << "8" << std::endl;
void* l_hnd = nam->second.second.first;
- std::cout << "9" << std::endl;
void* f_hnd = nam->second.second.second;
- std::cout << "10" << std::endl;
if( l_hnd == NULL )
{
- std::cout << "11" << std::endl;
l_hnd = cpPlugins::OS::DLLManager::LoadPlugins( nam->second.first );
- std::cout << "12" << std::endl;
nam->second.second.first = l_hnd;
- std::cout << "13" << std::endl;
} // fi
if( f_hnd == NULL )
{
- std::cout << "14" << std::endl;
f_hnd =
cpPlugins::OS::DLLManager::LoadCreator( l_hnd, category, name );
- std::cout << "15" << std::endl;
nam->second.second.second = f_hnd;
- std::cout << "16" << std::endl;
} // fi
- std::cout << "17" << std::endl;
_TCreator creator = reinterpret_cast< _TCreator >( f_hnd );
- std::cout << "18" << std::endl;
if( creator != NULL )
{
- std::cout << "19 " << creator << " " << f_hnd << std::endl;
void* a = creator( );
- std::cout << "20" << std::endl;
- std::cout << "20 " << creator << " " << a << std::endl;
- std::cout << "21" << std::endl;
o = reinterpret_cast< _TPtr* >( a )->GetPointer( );
- std::cout << "22" << std::endl;
o->SetName( name );
- std::cout << "23" << std::endl;
o->SetPluginName( nam->second.first );
- std::cout << "24" << std::endl;
} // fi
} // fi
} // fi
- std::cout << "25" << std::endl;
if( o.IsNull( ) )
throw std::runtime_error(
std::string( "Could not create a valid ProcessObject of type \"" ) +
category + std::string( ":" ) +
name + std::string( "\"" )
);
- std::cout << "26" << std::endl;
return( o );
}
#include <cpPlugins/Interface/Workspace.h>
#include <cpPlugins/BaseObjects/Widget.h>
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Workspace::
-Pointer cpPlugins::Interface::Workspace::
-New( )
-{
- Pointer smartPtr = new Self;
- smartPtr->UnRegister( );
- return( smartPtr );
-}
-
-// -------------------------------------------------------------------------
-itk::LightObject::Pointer cpPlugins::Interface::Workspace::
-CreateAnother( ) const
-{
- itk::LightObject::Pointer smartPtr;
- smartPtr = Self::New( ).GetPointer( );
- return( smartPtr );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Workspace::
-Pointer cpPlugins::Interface::Workspace::
-Clone( ) const
-{
- Pointer rval =
- dynamic_cast< Self* >( this->InternalClone( ).GetPointer( ) );
- return( rval );
-}
-
// -------------------------------------------------------------------------
void cpPlugins::Interface::Workspace::
Clear( )
*/
public:
+ cpPluginsNewMacro( Self );
itkTypeMacro( Workspace, itk::Object );
public:
- // Factory methods
- static Pointer New( );
- virtual itk::LightObject::Pointer CreateAnother( ) const cpPlugins_OVERRIDE;
- Pointer Clone( ) const;
-
// Workspace IO
void Load( const std::string& fname );
void Save( const std::string& fname ) const;