Salome HOME
PAL10237. Add a button assigning a set of hypotheses
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_NodesDlg.cxx
index 69801bb651cb5085d8b2e7fdd6233523c1078568..3f20596c5afcc88d9693e344c939456d0a73d884 100644 (file)
@@ -178,15 +178,13 @@ namespace SMESH {
       aProp->SetRepresentationToPoints();
 
       float anRGB[3];
-      anRGB[0] = GetFloat("SMESH:SettingsNodeColorRed",0)/255.;
-      anRGB[1] = GetFloat("SMESH:SettingsNodeColorGreen",255)/255.;
-      anRGB[2] = GetFloat("SMESH:SettingsNodeColorBlue",0)/255.;
-      aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+      GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
+      aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
 
-      float aPointSize = GetFloat("SMESH:SettingsNodesSize",3);
-      aProp->SetPointSize(aPointSize);
+      float aPointSize = GetFloat( "SMESH:node_size", 3 );
+      aProp->SetPointSize( aPointSize );
 
-      myPreviewActor->SetProperty(aProp);
+      myPreviewActor->SetProperty( aProp );
       aProp->Delete();
 
       myViewWindow->AddActor(myPreviewActor);
@@ -232,12 +230,11 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
   mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
   mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
-  myViewWindow(SMESH::GetViewWindow(theModule)),
   mySMESHGUI(theModule)
 {
-  mySimulation = new SMESH::TNodeSimulation(myViewWindow);
+  mySimulation = new SMESH::TNodeSimulation(SMESH::GetViewWindow( mySMESHGUI ));
 
-  QPixmap image0 (SMESHGUI::resourceMgr()->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
+  QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
   if (!name)
     setName("SMESHGUI_NodesDlg");
   resize(303, 185);
@@ -384,7 +381,8 @@ void SMESHGUI_NodesDlg::Init ()
 
   // set selection mode
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument();
 }
@@ -470,7 +468,8 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
 void SMESHGUI_NodesDlg::ClickOnCancel()
 {
   disconnect(mySelectionMgr, 0, this, 0);
-  myViewWindow->SetSelectionMode(ActorSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(ActorSelection);
 
   mySimulation->SetVisibility(false);
   SMESH::SetPointRepresentation(false);
@@ -573,7 +572,8 @@ void SMESHGUI_NodesDlg::ActivateThisDialog()
   GroupButtons->setEnabled(true);
 
   SMESH::SetPointRepresentation(true);
-  myViewWindow->SetSelectionMode(NodeSelection);
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode(NodeSelection);
 
   SelectionIntoArgument();
 }