Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_CreatePolyhedralVolumeDlg.cxx
index 02ac5a08dba68cc6459ba0f262daeca24d6ba254..5a8f950a7310deb0432e4475b4bafdae2d363282 100644 (file)
 #include "SMDS_Mesh.hxx"
 
 #include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
 
 #include "SalomeApp_Application.h"
 #include "SalomeApp_Study.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_MessageBox.h"
+#include "LightApp_Application.h"
 #include "LightApp_SelectionMgr.h"
 #include "utilities.h"
 
@@ -112,12 +115,12 @@ class TPolySimulation{
       myPreviewActor->SetMapper( myMapper );
       myPreviewActor->SetRepresentation( 3 );
 
-      float anRGB[3];
+      vtkFloatingPointType anRGB[3];
       vtkProperty* aProp = vtkProperty::New();
       GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
       aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
       myPreviewActor->SetProperty( aProp );
-      float aFactor,aUnits;
+      vtkFloatingPointType aFactor,aUnits;
       myPreviewActor->SetResolveCoincidentTopology(true);
       myPreviewActor->GetPolygonOffsetParameters(aFactor,aUnits);
       myPreviewActor->SetPolygonOffsetParameters(aFactor,0.2*aUnits);
@@ -249,6 +252,11 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
   buttonOk->setAutoDefault( TRUE );
   buttonOk->setDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
+  buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+  buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
+
   SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupButtons, 2, 0 );
 
   /***************************************************************/
@@ -315,6 +323,8 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
   RadioButton1->setChecked( TRUE );
  
   mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
+
+  myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polyhedrons?";
   
   Init();
 }
@@ -348,6 +358,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
   connect(buttonOk, SIGNAL( clicked() ),     SLOT( ClickOnOk() ) );
   connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) ) ;
   connect(buttonApply, SIGNAL( clicked() ),  SLOT(ClickOnApply() ) );
+  connect(buttonHelp, SIGNAL(clicked()),     SLOT(ClickOnHelp() ) );
 
   connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
   connect(SelectElementsButton, SIGNAL( clicked() ), SLOT( SetEditCurrentArgument() ) ) ;
@@ -560,6 +571,23 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
   reject() ;
 }
 
+//=================================================================================
+// function : ClickOnHelp()
+// purpose  :
+//=================================================================================
+void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp()
+{
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) 
+    app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+  else {
+    SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+                          QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                          arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
+                          QObject::tr("BUT_OK"));
+  }
+}
+
 //=======================================================================
 //function : onTextChange
 //purpose  :