Salome HOME
Using files from package LightApp instead of files from package SalomeApp
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreatePatternDlg.cxx
index 28bb9ad0c5e05707628d1398d5994fee150ab6d1..fdf604ae7bc73a13b865078ff1b1f4508536d489 100755 (executable)
@@ -42,8 +42,8 @@
 #include "SUIT_FileDlg.h"\r
 \r
 #include "SalomeApp_Study.h"\r
-#include "SalomeApp_DataOwner.h"\r
-#include "SalomeApp_SelectionMgr.h"\r
+#include "LightApp_DataOwner.h"\r
+#include "LightApp_SelectionMgr.h"\r
 #include "SalomeApp_Tools.h"\r
 \r
 #include "SALOMEDS_SObject.hxx"\r
@@ -88,9 +88,7 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI*   theModule,
      : QDialog( SMESH::GetDesktop( theModule ), theName, false,\r
                 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),\r
      mySMESHGUI( theModule ),\r
-     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),\r
-     myViewWindow( SMESH::GetViewWindow( theModule ) ),\r
-     mySelector( myViewWindow->GetSelector() )\r
+     mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )\r
 {\r
   setCaption(tr("CAPTION"));\r
 \r
@@ -104,6 +102,9 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI*   theModule,
 \r
   aDlgLay->setStretchFactor(aMainFrame, 1);\r
 \r
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+    mySelector = aViewWindow->GetSelector();\r
+\r
   Init(theType);\r
 }\r
 \r
@@ -289,7 +290,7 @@ void SMESHGUI_CreatePatternDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr)
     _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in());\r
     //Handle(SALOME_InteractiveObject) anIObj =\r
     //  new SALOME_InteractiveObject(aSobj->GetID().c_str(), "SMESH");\r
-    SUIT_DataOwnerPtr anIObj (new SalomeApp_DataOwner(aSobj->GetID().c_str()));\r
+    SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str()));\r
 \r
     isValidMesh = mySelectionMgr->isOk(anIObj);\r
   }\r
@@ -386,7 +387,8 @@ void SMESHGUI_CreatePatternDlg::onSave()
                                tr("ERROR_OF_SAVING"), QMessageBox::Ok);\r
     } else {\r
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
-      myViewWindow->SetSelectionMode(ActorSelection);\r
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+       aViewWindow->SetSelectionMode(ActorSelection);\r
       disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
@@ -435,7 +437,8 @@ void SMESHGUI_CreatePatternDlg::onOk()
       return;\r
     } else {\r
       //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
-      myViewWindow->SetSelectionMode(ActorSelection);\r
+      if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+       aViewWindow->SetSelectionMode(ActorSelection);\r
       disconnect(mySelectionMgr, 0, this, 0);\r
       disconnect(mySMESHGUI, 0, this, 0);\r
       mySMESHGUI->ResetState();\r
@@ -454,7 +457,8 @@ void SMESHGUI_CreatePatternDlg::onOk()
 //=======================================================================\r
 void SMESHGUI_CreatePatternDlg::onClose()\r
 {\r
-  myViewWindow->SetSelectionMode(ActorSelection);\r
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+    aViewWindow->SetSelectionMode(ActorSelection);\r
   disconnect(mySelectionMgr, 0, this, 0);\r
   disconnect(mySMESHGUI, 0, this, 0);\r
   mySMESHGUI->ResetState();\r
@@ -682,7 +686,8 @@ void SMESHGUI_CreatePatternDlg::activateSelection()
 {\r
   mySelectionMgr->clearFilters();\r
   //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);\r
-  myViewWindow->SetSelectionMode(ActorSelection);\r
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
+    aViewWindow->SetSelectionMode(ActorSelection);\r
 \r
   if (myType == Type_2d) {\r
     mySelectionMgr->installFilter(new SMESH_NumberFilter\r