this->m_PluginsPath = info.canonicalPath( ).toStdString( );
this->_LoadPluginsFromPath( this->m_PluginsPath );
}
- else
+ /*
+ else
this->_UpdateLoadedPlugins( );
+ */
} // fi
+ QDir exec_dir( "." );
+ if( exec_dir.exists( ) )
+ this->_LoadPluginsFromPath( exec_dir.canonicalPath( ).toStdString( ) );
/* TODO
this->m_Interface = new cpPlugins::Interface( );
{
try
{
- this->m_Interface.LoadPluginFile( fIt->toStdString( ) );
+ this->m_Interface.LoadPluginFile(
+ ( dir.absolutePath( ) + QDir::separator( ) + *fIt ).toStdString( )
+ );
}
- catch( ... )
+ catch( std::exception& err )
{
// Just ignore un-loadable libraries
- }
+ } // yrt
- } // yrt
+ } // rof
this->_UpdateLoadedPlugins( );
}
"Error loading default plugins",
"No plugins loaded: remember to load some!!!"
);
+ this->_UnBlock( );
return;
} // fi
: public QObject
{
protected:
- virtual bool eventFilter( QObject* obj, QEvent* event ) override;
+ virtual bool eventFilter( QObject* obj, QEvent* event ) ITK_OVERRIDE;
};
-/*
- class PipelineEditor;
- struct PipelineEditor_Application
- {
- QApplication Application;
- PipelineEditor Window;
- PipelineEditor_Blocker Blocker;
- PipelineEditor_Application( int argc, char* argv[] );
- void Show( );
- int Exec( );
- void Block( );
- void UnBlock( );
- };
-*/
-
// -------------------------------------------------------------------------
namespace Ui
{
virtual ~ImageToVTKImageFilter();
private:
- ImageToVTKImageFilter(const Self&) = delete;
- void operator=(const Self&) = delete;
+ ImageToVTKImageFilter(const Self&) ITK_DELETE_FUNCTION;
+ void operator=(const Self&) ITK_DELETE_FUNCTION;
ExporterFilterPointer m_Exporter;
vtkImageImport * m_Importer;
virtual ~VTKImageToImageFilter();
private:
- VTKImageToImageFilter(const Self&) = delete;
- void operator=(const Self&) = delete;
+ VTKImageToImageFilter(const Self&) ITK_DELETE_FUNCTION;
+ void operator=(const Self&) ITK_DELETE_FUNCTION;
typedef vtkSmartPointer<vtkImageExport> ImageExportPointer;
ImageExportPointer m_Exporter;
void SetMPRViewer( TMPRWidget* v );
void SetSingleInteractor( vtkRenderWindowInteractor* i );
- virtual bool IsInteractive( ) override;
+ virtual bool IsInteractive( ) ITK_OVERRIDE;
virtual void SetInteractionObjects(
const std::vector< void* >& objs
- ) override;
+ ) ITK_OVERRIDE;
protected:
BaseWidget( );
* Some functions
* =========================================================================
*/
+#include <iostream>
namespace cpPlugins
{
struct PathHelper
// ---------------------------------------------------------------------
inline static std::string CanonicalPath( const std::string& path )
{
+ std::string ret = "";
#ifdef cpPlugins_SYS_WINDOWS
TCHAR buffer[ 4096 ] = TEXT( "" );
TCHAR** lppPart = { NULL };
GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
- return( std::string( buffer ) );
+ ret = std::string( buffer );
#else // cpPlugins_SYS_WINDOWS
- return( std::string( realpath( path.c_str( ), NULL ) ) );
+ char* canonical_path = realpath( path.c_str( ), NULL );
+ if( canonical_path != NULL )
+ {
+ ret = canonical_path;
+ free( canonical_path );
+
+ } // fi
#endif // cpPlugins_SYS_WINDOWS
+ return( ret );
}
};
cpPlugins_Id_Macro( Image, Object );
public:
- virtual void SetITK( itk::LightObject* o ) override;
- virtual void SetVTK( vtkObjectBase* o ) override;
+ virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE;
+ virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE;
protected:
Image( );
{
// Open library with its canonical path name
auto canonical_fn = cpPlugins::PathHelper::CanonicalPath( filename );
+ if( canonical_fn == "" )
+ throw std::runtime_error(
+ std::string( "cpPlugins::Interface: Library \"" ) +
+ filename +
+ std::string( "\" does not exist." )
+ );
void* hnd = Self::_DLOpen( canonical_fn );
if( hnd == NULL )
throw std::runtime_error(
std::string( "cpPlugins::Interface: Could not load library \"" ) +
- canonical_fn +
+ filename +
std::string( "\"" )
);
cpPlugins_Id_Macro( Mesh, Object );
public:
- virtual void SetITK( itk::LightObject* o ) override;
- virtual void SetVTK( vtkObjectBase* o ) override;
+ virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE;
+ virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE;
protected:
Mesh( );
QPointF GetViewCoords( ) const;
#endif // cpPlugins_QT4
- virtual void Modified( ) const override;
- virtual itk::ModifiedTimeType GetMTime( ) const override;
+ virtual void Modified( ) const ITK_OVERRIDE;
+ virtual itk::ModifiedTimeType GetMTime( ) const ITK_OVERRIDE;
virtual void SetITK( itk::LightObject* o );
virtual void SetVTK( vtkObjectBase* o );
--- /dev/null
+#ifndef __CPPLUGINS_CONFIG__H__
+#define __CPPLUGINS_CONFIG__H__
+
+#include <itkMacro.h>
+
+#ifndef ITK_DELETE_FUNCTION
+# define ITK_DELETE_FUNCTION
+#endif // ITK_DELETE_FUNCTION
+
+#ifndef ITK_OVERRIDE
+# define ITK_OVERRIDE
+#endif // ITK_OVERRIDE
+
+#endif // __CPPLUGINS_CONFIG__H__
+
+// eof - $RCSfile$
+f cpPlugins_Config.h
i complex
i map
i string
public:
// Qt dialog creation
- virtual cpPlugins::ParametersQtDialog* CreateQtDialog( ) override;
+ virtual cpPlugins::ParametersQtDialog* CreateQtDialog( ) ITK_OVERRIDE;
protected:
DicomSeriesReader( );
ImageReader( );
virtual ~ImageReader( );
- virtual std::string _GenerateData( ) override;
+ virtual std::string _GenerateData( ) ITK_OVERRIDE;
template< unsigned int _Dim >
inline std::string _GD0( itk::ImageIOBase* io );
ImageWriter( );
virtual ~ImageWriter( );
- virtual std::string _GenerateData( ) override;
+ virtual std::string _GenerateData( ) ITK_OVERRIDE;
template< class _TInput >
inline std::string _GD0( _TInput* image );