]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/Workspace.cxx
Line widget added.
[cpPlugins.git] / lib / cpPlugins / Interface / Workspace.cxx
index d1d2c0daa7b412935ce6c4909b1ccdfc4b879c2d..90c26d5415ca430af81d910a7187f0274eb08cb2 100644 (file)
@@ -44,6 +44,24 @@ GetFilter( const std::string& name ) const
     return( NULL );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Workspace::
+TWidget* cpPlugins::Interface::Workspace::
+GetWidget( const std::string& name )
+{
+  TProcess* process = this->GetFilter( name );
+  return( dynamic_cast< TWidget* >( process ) );
+}
+
+// -------------------------------------------------------------------------
+const cpPlugins::Interface::Workspace::
+TWidget* cpPlugins::Interface::Workspace::
+GetWidget( const std::string& name ) const
+{
+  const TProcess* process = this->GetFilter( name );
+  return( dynamic_cast< const TWidget* >( process ) );
+}
+
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::Workspace::
 HasFilter( const std::string& name ) const
@@ -51,6 +69,14 @@ HasFilter( const std::string& name ) const
   return( this->m_Filters.find( name ) != this->m_Filters.end( ) );
 }
 
+// -------------------------------------------------------------------------
+bool cpPlugins::Interface::Workspace::
+HasWidget( const std::string& name ) const
+{
+  const TWidget* wdg = this->GetWidget( name );
+  return( wdg != NULL );
+}
+
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Workspace::
 TProcess* cpPlugins::Interface::Workspace::