]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/BaseMPRWindow.h
Widget integration (step 6/6): Interactive architecture finished. Needs to be tested...
[cpPlugins.git] / lib / cpPlugins / Interface / BaseMPRWindow.h
index d0509671da4676f607e378eff898a5c88ae27bbe..9507d6f2a713310984d675d7de3ea6e1c5e9f0eb 100644 (file)
@@ -6,9 +6,9 @@
 
 #ifdef cpPlugins_Interface_QT4
 
+#include <map>
 #include <set>
 #include <string>
-#include <vector>
 
 #include <QApplication>
 #include <QMenu>
@@ -41,15 +41,26 @@ namespace cpPlugins
       typedef cpPlugins::Interface::Image         TImage;
       typedef cpPlugins::Interface::Mesh          TMesh;
 
-      typedef std::vector< TImage::Pointer > TImages;
-      typedef std::vector< TMesh::Pointer >  TMeshes;
-      typedef std::set< std::string >     TOrderedStringContainer;
+      typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
+      typedef TMPRObjects::TCursorCommand     TCursorCommand;
+      typedef TMPRObjects::TMouseCommand      TMouseCommand;
+      typedef TMPRObjects::TMouseWheelCommand TMouseWheelCommand;
+      typedef TMPRObjects::TKeyCommand        TKeyCommand;
+
+      typedef std::map< std::string, TImage::Pointer >          TImages;
+      typedef std::map< std::string, TMesh::Pointer >           TMeshes;
+      typedef std::set< std::string >           TOrderedStringContainer;
       typedef std::map< std::string, std::set< std::string > > TFilters;
 
     public:
       explicit BaseMPRWindow( QWidget* parent = 0 );
       virtual ~BaseMPRWindow( );
 
+      void AddCursorCommand( TCursorCommand command, void* data )
+      {
+        this->m_MPRObjects->AddCursorCommand( command, data );
+      }
+
       void DialogLoadPlugins( );
       void AssociatePluginsToMenu(
         QMenu* menu, QObject* obj, const char* slot
@@ -68,21 +79,45 @@ namespace cpPlugins
 
       bool LoadPlugins( const std::string& fname );
       void LoadPlugins( );
-      bool LoadImage( );
-      bool LoadMesh( );
+      std::string LoadImage( );
+      std::string LoadMesh( );
 
       void ExecuteFilter(
         const std::string& name,
-        int input_id, int output_id = -1
+        const std::string& input_id,
+        const std::string& output_id
         );
 
+      TProcessObject::Pointer CreateFilter( const std::string& name )
+      {
+        return( this->m_Interface.CreateProcessObject( name ) );
+      }
+
+      void AddImage( const std::string& name, TImage* image );
+      TImage* GetImage( std::string& name ) const
+      {
+        TImages::const_iterator i = this->m_Images.find( name );
+        if( i != this->m_Images.end( ) )
+          return( i->second );
+        else
+          return( NULL );
+      }
+
+      double GetWindow( ) const
+      {
+        return( this->m_MPRObjects->GetWindow( ) );
+      }
+      double GetLevel( ) const
+      {
+        return( this->m_MPRObjects->GetLevel( ) );
+      }
+
       void ClearAll( );
 
     protected:
       void _UpdatePlugins( );
 
     protected:
-      typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
       vtkSmartPointer< TMPRObjects > m_MPRObjects;
 
       QVTKWidget* m_XVTK;