]> SALOME platform Git repositories - samples/sierpinsky.git/blobdiff - src/SierpinskyGUI/SierpinskyGUI.cxx
Salome HOME
updated copyright message
[samples/sierpinsky.git] / src / SierpinskyGUI / SierpinskyGUI.cxx
index eb872682ec92a23f080f131f51e7efef9a3d41bd..0139ce4afdda657f713ff2ee465d0e31ca4cacea 100644 (file)
@@ -1,19 +1,40 @@
+// Copyright (C) 2005-2023  OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 ///////////////////////////////////////////////////////////
 // File    : SierpinskyGUI.cxx
 // Author  : Vadim SANDLER (OCN)
 // Created : 13/07/05
-// Copyright (C) 2005 Open CASCADE
 ///////////////////////////////////////////////////////////
 
 #include "SierpinskyGUI.h"
 
+#include <SIERPINSKY_version.h>
+
 #include <SUIT_MessageBox.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
 #include <SalomeApp_Application.h>
+#include <SVTK_ViewModel.h>
 #include <SALOME_LifeCycleCORBA.hxx>
 #include <SierpinskyGUI_RunDlg.h>
-
-#include <SUIT_Desktop.h>
+#include <utilities.h>
 
 /*!
  * Constructor
@@ -30,7 +51,7 @@ SIERPINSKY_ORB::SIERPINSKY_ptr SierpinskyGUI::InitSIERPINSKYGen( SalomeApp_Appli
 {
   SIERPINSKY_ORB::SIERPINSKY_ptr clr;
   try{
-    Engines::Component_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","SIERPINSKY" );
+    Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","SIERPINSKY" );
     clr = SIERPINSKY_ORB::SIERPINSKY::_narrow(comp);
   }
   catch (CORBA::Exception&){
@@ -56,7 +77,7 @@ void SierpinskyGUI::initialize( CAM_Application* app )
 
   // create actions
   QPixmap aPixmap = aResourceMgr->loadPixmap( "SIERPINSKY",tr( "ICON_RUN_DLG" ) );
-  createAction( 901, tr( "Run Dialog" ), QIconSet(aPixmap), tr( "RUN" ), tr( "CAPTION" ), 0, aParent, false,
+  createAction( 901, tr( "Run Dialog" ), QIcon(aPixmap), tr( "RUN" ), tr( "CAPTION" ), 0, aParent, false,
                this, SLOT( OnRun() ) );
 
   // create menus
@@ -78,6 +99,22 @@ QString SierpinskyGUI::engineIOR() const
   return QString( anIOR.in() );
 }
 
+/*!
+ * Required dockable windows
+ */
+void SierpinskyGUI::windows( QMap<int, int>& wmap ) const
+{
+  wmap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+}
+
+/*!
+ * Required viewers list
+ */
+void SierpinskyGUI::viewManagers( QStringList& vmlist ) const
+{
+  vmlist.append( SVTK_Viewer::Type() );
+}
+
 /*!
  * Module's activation
  */
@@ -114,13 +151,19 @@ SierpinskyGUI::~SierpinskyGUI()
 void SierpinskyGUI::OnRun()
 {
   QWidget* aParent = getApp()->desktop();
-  SierpinskyGUI_RunDlg* aDlg = new SierpinskyGUI_RunDlg( aParent );
+  SierpinskyGUI_RunDlg* aDlg = new SierpinskyGUI_RunDlg( aParent, this );
   aDlg->exec();
 }
 
 extern "C" {
+  SIERPINSKY_EXPORT
   CAM_Module* createModule()
   {
     return new SierpinskyGUI();
   }
+  SIERPINSKY_EXPORT
+  char* getModuleVersion()
+  {
+    return (char*)SIERPINSKY_VERSION_STR;
+  }
 }