2 #include "ui_MainWnd.h"
8 // -------------------------------------------------------------------------
13 // this->m_Plugins.UnloadAll( );
14 // this->m_BaseClasses.clear( );
15 // this->m_SegmentationClasses.clear( );
16 // this->m_SegmentationFilterClasses.clear( );
17 // this->m_MeshFilterClasses.clear( );
19 // // Read file and load plugins
20 // std::ifstream in( this->m_PluginsConfigurationFile.c_str( ) );
23 // this->m_LastOpenedFile = this->m_PluginsConfigurationFile;
24 // std::string line, actual_section = "";
25 // std::getline( in, line );
26 // while( !( in.eof( ) ) )
28 // std::string clean_line = line;
30 // std::remove_if( clean_line.begin( ), clean_line.end( ), isspace ),
33 // if( clean_line[ 0 ] != '#' )
36 // clean_line != "sectionplugins" &&
37 // clean_line != "sectionbase_classes" &&
38 // clean_line != "sectionsegmentation_classes" &&
39 // clean_line != "sectionsegmentation_filter_classes" &&
40 // clean_line != "sectionmesh_filter_classes"
43 // if( clean_line != "" )
45 // if( actual_section == "sectionplugins" )
47 // if( !( this->m_Plugins.Load( clean_line ) ) )
49 // QMessageBox::warning(
51 // tr( "Ignoring plugin" ),
52 // tr( clean_line.c_str( ) )
60 // clean_line.substr( clean_line.find_last_of( ":" ) + 1 );
61 // if( actual_section == "sectionbase_classes" )
62 // this->m_BaseClasses[ name ] = clean_line;
63 // else if( actual_section == "sectionsegmentation_classes" )
64 // this->m_SegmentationClasses[ name ] = clean_line;
65 // else if( actual_section == "sectionsegmentation_filter_classes" )
66 // this->m_SegmentationFilterClasses[ name ] = clean_line;
67 // else if( actual_section == "sectionmesh_filter_classes" )
68 // this->m_MeshFilterClasses[ name ] = clean_line;
74 // else if( clean_line != "" )
76 // if( clean_line[ 0 ] != '#' )
77 // actual_section = clean_line;
82 // std::getline( in, line );
87 // // Check classes existence
88 // if( !( this->_CheckClassesInPlugins( this->m_BaseClasses ) ) )
90 // QMessageBox::critical(
92 // tr( "Could not load all base plugins." ),
93 // tr( "Could not load all base plugins... Closing application!" )
99 // // Needed object from plugins
100 // this->_AddPluginActions(
101 // this->m_SegmentationClasses, this->m_UI->menuSegmentInputImage,
102 // SLOT( _triggered_actionSegmentImage( ) )
104 // this->_AddPluginActions(
105 // this->m_SegmentationFilterClasses, this->m_UI->menuFilterSegmentedImage,
106 // SLOT( _triggered_actionFilterSegmentation( ) )
108 // this->_AddPluginActions(
109 // this->m_MeshFilterClasses, this->m_UI->menuProcessMesh,
110 // SLOT( _triggered_actionProcessMesh( ) )
113 // // Historic objects
116 // -------------------------------------------------------------------------
118 _CheckClassesInPlugins( const TStringMap& classes )
121 // TStringMap::const_iterator cIt = classes.begin( );
122 // for( ; cIt != classes.end( ); ++cIt )
124 // TPluginObject* o = this->m_Plugins.CreateObject( cIt->second );
134 // -------------------------------------------------------------------------
137 const TStringMap& classes, QMenu* menu, const char* method
140 // TStringMap::const_iterator clIt = classes.begin( );
141 // for( ; clIt != classes.end( ); ++clIt )
143 // QAction* action = menu->addAction( QString( clIt->first.c_str( ) ) );
144 // QObject::connect( action, SIGNAL( triggered( ) ), this, method );