2) Remove unused classes.
SMESHGUI_Swig.cxx \
SMESHGUI_MoveNodesDlg.cxx \
SMESHGUI_AddMeshElementDlg.cxx \
- SMESHGUI_EditHypothesesDlg.cxx \
- SMESHGUI_CreateHypothesesDlg.cxx \
SMESHGUI_XmlHandler.cxx \
SMESHGUI_Filter.cxx \
SMESHGUI_FilterDlg.cxx \
SMESHGUI_FilterUtils.cxx \
SMESHGUI_PatternUtils.cxx \
SMESHGUI_HypothesesUtils.cxx \
- SMESHGUI_PrecisionDlg.cxx \
SMESHGUI_VTKUtils.cxx \
SMESHGUI_Selection.cxx \
SMESHGUI_CreatePolyhedralVolumeDlg.cxx \
SMESHGUI_Preferences_SelectionDlg.h \
SMESHGUI_MoveNodesDlg.h \
SMESHGUI_AddMeshElementDlg.h \
- SMESHGUI_EditHypothesesDlg.h \
- SMESHGUI_CreateHypothesesDlg.h \
SMESHGUI_FilterDlg.h \
SMESHGUI_FilterLibraryDlg.h \
SMESHGUI_SingleEditDlg.h \
SMESHGUI_TranslationDlg.h \
SMESHGUI_SymmetryDlg.h \
SMESHGUI_SewingDlg.h \
- SMESHGUI_PrecisionDlg.h \
SMESHGUI_MergeNodesDlg.h \
SMESHGUI_EditMeshDlg.h \
SMESHGUI_CreatePolyhedralVolumeDlg.h \
#include "SMESHGUI_MoveNodesDlg.h"
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI_AddQuadraticElementDlg.h"
-#include "SMESHGUI_EditHypothesesDlg.h"
-#include "SMESHGUI_CreateHypothesesDlg.h"
#include "SMESHGUI_FilterDlg.h"
#include "SMESHGUI_FilterLibraryDlg.h"
#include "SMESHGUI_SingleEditDlg.h"
#include "SMESHGUI_MergeNodesDlg.h"
#include "SMESHGUI_EditMeshDlg.h"
#include "SMESHGUI_MeshPatternDlg.h"
-#include "SMESHGUI_PrecisionDlg.h"
#include "SMESHGUI_Selection.h"
#include "SMESHGUI_CreatePolyhedralVolumeDlg.h"
#include "SMESHGUI_MeshOp.h"
#include "SMESH_Actor.h"
#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SVTK_Selection.h"
#include "SVTK_Selector.h"
}
QString elemName;
- if (myNbNodes == 2)
+ if (myNbNodes == 2) {
elemName = "EDGE";
- else if (myNbNodes == 3)
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_edges";
+ }
+ else if (myNbNodes == 3) {
elemName = "TRIANGLE";
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_triangles";
+ }
else if (myNbNodes == 4)
- if (myElementType == SMDSAbs_Face)
+ if (myElementType == SMDSAbs_Face) {
elemName = "QUADRANGLE";
- else
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_quadrangles";
+ }
+ else {
elemName = "TETRAS";
- else if (myNbNodes == 8)
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_tetrahedrons";
+ }
+ else if (myNbNodes == 8) {
elemName = "HEXAS";
- else if (myElementType == SMDSAbs_Face){
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_hexahedrons";
+ }
+ else if (myElementType == SMDSAbs_Face) {
elemName = "POLYGON";
myIsPoly = true;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polygons";
+ }
+ else if (myElementType == SMDSAbs_Volume) {
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_polyhedrons";
}
QString iconName = tr(QString("ICON_DLG_%1").arg(elemName));
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_AddMeshElementDlgLayout->addWidget(GroupButtons, 2, 0);
/***************************************************************/
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(SelectButtonC1A1, SIGNAL(clicked()), SLOT(SetEditCurrentArgument()));
connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
return;
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_AddMeshElementDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton * buttonOk;
QPushButton * buttonCancel;
QPushButton * buttonApply;
+ QPushButton * buttonHelp;
QGroupBox * GroupC1;
QLabel * TextLabelC1A1;
QPushButton * SelectButtonC1A1;
QCheckBox * Reverse;
+ QString myHelpFileName;
+
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SMESH_Actor.h"
#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SVTK_Selection.h"
#include "SVTK_Selector.h"
buttonOk->setAutoDefault(TRUE);
buttonOk->setDefault(TRUE);
aGroupButtonsLayout->addWidget(buttonOk, 0, 0);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ aGroupButtonsLayout->addWidget(buttonHelp, 0, 4);
aDialogLayout->addWidget(GroupButtons, 2, 0);
case QUAD_EDGE:
aNumRows = 1;
myNbCorners = 2;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_edges
break;
case QUAD_TRIANGLE:
aNumRows = 3;
myNbCorners = 3;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_triangles
break;
case QUAD_QUADRANGLE:
aNumRows = 4;
myNbCorners = 4;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_quadrangles
break;
case QUAD_TETRAHEDRON:
aNumRows = 6;
myNbCorners = 4;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_tetrahedrons
break;
case QUAD_PYRAMID:
aNumRows = 8;
myNbCorners = 5;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?";
break;
case QUAD_PENTAHEDRON:
aNumRows = 9;
myNbCorners = 6;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?";
break;
case QUAD_HEXAHEDRON:
aNumRows = 12;
myNbCorners = 8;
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_hexahedrons
break;
}
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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
return;
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
-
+ QPushButton * buttonHelp;
+
+ QString myHelpFileName;
+
private slots:
void onTextChange(const QString&);
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCorners() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SUIT_Session.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_MessageBox.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_InteractiveObject.hxx"
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_ClippingDlgLayout->addWidget(GroupPlanes, 0, 0);
SMESHGUI_ClippingDlgLayout->addWidget(GroupParameters, 1, 0);
myIsSelectPlane = false;
onSelectionChanged();
+ myHelpFileName = "clipping.htm";
+
// signals and slots connections :
connect(ComboBoxPlanes, SIGNAL(activated(int)), this, SLOT(onSelectPlane(int)));
connect(buttonNew, SIGNAL(clicked()), this, SLOT(ClickOnNew()));
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
/* to close dialog if study frame change */
close();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_ClippingDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : onSelectionChanged()
// purpose : Called when selection is changed
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
bool myIsSelectPlane;
+ QString myHelpFileName;
public slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
};
#endif // DIALOGBOX_TRANSPARENCYDLG_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 CEA
-//
-// 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.
-//
-// 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.org
-//
-//
-//
-// File : SMESHGUI_CreateHypothesesDlg.cxx
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-
-#include "SMESHGUI_CreateHypothesesDlg.h"
-
-#include "SMESHGUI_HypothesesUtils.h"
-#include "SMESHGUI_Hypotheses.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI.h"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-
-#include "SALOME_ListIteratorOfListIO.hxx"
-
-#include "utilities.h"
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qheader.h>
-
-using namespace std;
-
-//=================================================================================
-// function : SMESHGUI_CreateHypothesesDlg()
-// purpose : Constructs a SMESHGUI_CreateHypothesesDlg which is a child of 'parent', with the
-// name 'name' and widget flags set to 'f'.
-// The dialog will by default be modeless, unless you set 'modal' to
-// TRUE to construct a modal dialog.
-//=================================================================================
-SMESHGUI_CreateHypothesesDlg::SMESHGUI_CreateHypothesesDlg (SMESHGUI* theModule,
- const char* name,
- bool modal,
- bool isAlgo)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- myIsAlgo(isAlgo),
- mySMESHGUI( theModule )
-{
- if (!name)
- setName("SMESHGUI_CreateHypothesesDlg");
- setCaption(isAlgo ? tr("SMESH_CREATE_ALGORITHMS" ) : tr("SMESH_CREATE_HYPOTHESES" ));
- setSizeGripEnabled(TRUE);
-
- QGridLayout* SMESHGUI_CreateHypothesesDlgLayout = new QGridLayout(this);
- SMESHGUI_CreateHypothesesDlgLayout->setSpacing(6);
- SMESHGUI_CreateHypothesesDlgLayout->setMargin(11);
-
- /***************************************************************/
- GroupAlgorithms = new QGroupBox(this, "GroupAlgorithms");
- GroupAlgorithms->setTitle(isAlgo ? tr("SMESH_AVAILABLE_ALGORITHMS") : tr("SMESH_AVAILABLE_HYPOTHESES"));
- GroupAlgorithms->setColumnLayout(0, Qt::Vertical);
- GroupAlgorithms->layout()->setSpacing(0);
- GroupAlgorithms->layout()->setMargin(0);
-
- QGridLayout* hypLayout = new QGridLayout(GroupAlgorithms->layout());
- hypLayout->setGeometry(QRect(12, 18, 139, 250));
- hypLayout->setAlignment(Qt::AlignTop);
- hypLayout->setSpacing(6);
- hypLayout->setMargin(11);
-
- ListAlgoDefinition = new QListView(GroupAlgorithms, "ListAlgoDefinition");
- ListAlgoDefinition->setMinimumSize(400, 200);
- ListAlgoDefinition->addColumn("");
- ListAlgoDefinition->header()->hide();
- ListAlgoDefinition->setSelectionMode(QListView::Single);
- ListAlgoDefinition->setResizeMode(QListView::AllColumns);
- ListAlgoDefinition->setRootIsDecorated(true);
-
- hypLayout->addWidget(ListAlgoDefinition, 0, 0);
- SMESHGUI_CreateHypothesesDlgLayout->addWidget(GroupAlgorithms, 0, 0);
-
- /***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
-
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_CREATE" ));
- buttonApply->setAutoDefault(TRUE);
- buttonApply->setDefault(FALSE);
- buttonApply->setEnabled(FALSE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
-
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
-
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- buttonCancel->setDefault(TRUE);
- buttonCancel->setEnabled(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
-
- SMESHGUI_CreateHypothesesDlgLayout->addWidget(GroupButtons, 1, 0);
- /***************************************************************/
-
- Init();
-}
-
-//=================================================================================
-// function : ~SMESHGUI_CreateHypothesesDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-SMESHGUI_CreateHypothesesDlg::~SMESHGUI_CreateHypothesesDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::Init()
-{
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
-
- InitAlgoDefinition();
-
- /* signals and slots connections */
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply()));
-
-// connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
- connect(ListAlgoDefinition, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
- connect(ListAlgoDefinition, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(onDoubleClicked(QListViewItem*)));
-
- this->show();
-}
-
-//=================================================================================
-// function : ClickOnCancel()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::ClickOnCancel()
-{
- close();
-}
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::ClickOnApply()
-{
- if (mySMESHGUI->isActiveStudyLocked())
- return;
- QListViewItem* item = ListAlgoDefinition->selectedItem();
- if (!item)
- return;
- QString aHypType = item->text(1);
- MESSAGE("Apply " << aHypType);
- char* sHypType = (char*)aHypType.latin1();
-
- HypothesisData* aHypData = SMESH::GetHypothesisData(sHypType);
- if (!aHypData)
- return;
- QString aClientLibName = aHypData->ClientLibName;
- MESSAGE("Client lib name = " << aClientLibName);
-
- if (aClientLibName == "") {
- // Call hypothesis creation server method (without GUI)
- QString aHypName = aHypData->Label;
- SMESH::CreateHypothesis(sHypType, aHypName, myIsAlgo);
- } else {
- // Get hypotheses creator client (GUI)
- SMESHGUI_GenericHypothesisCreator* aCreator =
- SMESH::GetHypothesisCreator(sHypType);
-
- if( aCreator )
- // Create hypothesis/algorithm
- aCreator->create( myIsAlgo, this );
- else
- {
- // report about error
- }
- }
-
-// buttonApply->setEnabled(FALSE);
- return;
-}
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::ActivateThisDialog()
-{
- mySMESHGUI->EmitSignalDeactivateDialog();
- GroupButtons->setEnabled(true);
- return;
-}
-
-//=================================================================================
-// function : enterEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::enterEvent (QEvent*)
-{
- ActivateThisDialog();
- return;
-}
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::closeEvent (QCloseEvent* e)
-{
- mySMESHGUI->ResetState();
- QDialog::closeEvent(e);
-}
-
-//=================================================================================
-// function : onSelectionChanged()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::onSelectionChanged()
-{
- QListViewItem* item = ListAlgoDefinition->selectedItem();
- buttonApply->setEnabled(item && item->depth() > 0);
-}
-
-//=================================================================================
-// function : onDoubleClicked()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::onDoubleClicked (QListViewItem* i)
-{
- if (i && i->depth() > 0)
- this->ClickOnApply();
-}
-
-//=================================================================================
-// function : InitAlgoDefinition()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreateHypothesesDlg::InitAlgoDefinition()
-{
- ListAlgoDefinition->clear();
- QStringList HypList = SMESH::GetAvailableHypotheses(myIsAlgo);
- for (int i = 0; i < HypList.count(); ++i) {
- HypothesisData* aHypData = SMESH::GetHypothesisData(HypList[i]);
- QListViewItem* parentItem = 0;
- QListViewItem* childItem = ListAlgoDefinition->firstChild();
- while (childItem) {
- if (childItem->text(0) == aHypData->PluginName) {
- parentItem = childItem;
- break;
- }
- childItem = childItem->nextSibling();
- }
- if (!parentItem)
- parentItem = new QListViewItem(ListAlgoDefinition, aHypData->PluginName);
- parentItem->setOpen(true);
- QListViewItem* aItem = new QListViewItem(parentItem, aHypData->Label, HypList[i]);
- QPixmap aPixMap (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr(aHypData->IconId)));
- if (!aPixMap.isNull())
- aItem->setPixmap(0, aPixMap);
- }
-}
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 CEA
-//
-// 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.
-//
-// 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.org
-//
-//
-//
-// File : SMESHGUI_CreateHypothesesDlg.h
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-
-#ifndef DIALOGBOX_CREATE_HYPOTHESES_H
-#define DIALOGBOX_CREATE_HYPOTHESES_H
-
-// QT Includes
-#include <qvariant.h>
-#include <qdialog.h>
-#include <qstringlist.h>
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-#include <map>
-#include <string>
-
-class QButtonGroup;
-class QGroupBox;
-class QPushButton;
-class QListView;
-class QListViewItem;
-class SMESHGUI;
-
-//=================================================================================
-// class : SMESHGUI_CreateHypothesesDlg
-// purpose :
-//=================================================================================
-class SMESHGUI_CreateHypothesesDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_CreateHypothesesDlg (SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- bool isAlgo = FALSE);
- ~SMESHGUI_CreateHypothesesDlg ();
-
-private:
-
- void Init() ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
-
- void InitAlgoDefinition();
-
- SMESHGUI* mySMESHGUI;
- bool myIsAlgo;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
-
- QGroupBox* GroupAlgorithms;
- QListView* ListAlgoDefinition;
-
-private slots:
-
- void ClickOnCancel();
- void ClickOnApply();
- void ActivateThisDialog() ;
-
- void onSelectionChanged();
- void onDoubleClicked(QListViewItem*);
-};
-
-#endif // DIALOGBOX_CREATE_HYPOTHESES_H
#include "SUIT_ResourceMgr.h"\r
#include "SUIT_Desktop.h"\r
#include "SUIT_FileDlg.h"\r
+#include "SUIT_Session.h"\r
+#include "SUIT_MessageBox.h"\r
\r
+#include "SalomeApp_Application.h"\r
#include "SalomeApp_Study.h"\r
#include "LightApp_DataOwner.h"\r
#include "LightApp_SelectionMgr.h"\r
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))\r
mySelector = aViewWindow->GetSelector();\r
\r
+ myHelpFileName = "pattern_mapping.htm";\r
+\r
Init(theType);\r
}\r
\r
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);\r
mySaveBtn = new QPushButton(tr("SAVE" ), aFrame);\r
myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame);\r
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);\r
\r
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);\r
\r
aLay->addWidget(mySaveBtn);\r
aLay->addItem(aSpacer);\r
aLay->addWidget(myCloseBtn);\r
+ aLay->addWidget(myHelpBtn);\r
\r
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));\r
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));\r
connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave()));\r
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));\r
\r
return aFrame;\r
}\r
emit Close();\r
}\r
\r
+//=================================================================================\r
+// function : onHelp()\r
+// purpose :\r
+//=================================================================================\r
+void SMESHGUI_CreatePatternDlg::onHelp()\r
+{\r
+ SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());\r
+ if (app) \r
+ app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);\r
+ else {\r
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),\r
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").\r
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),\r
+ QObject::tr("BUT_OK"));\r
+ }\r
+}\r
+\r
//=======================================================================\r
// function : loadFromObject()\r
// purpose : Load pattern from geom object corresponding to the mesh/submesh\r
void onOk();
void onSave();
void onClose();
+ void onHelp();
void onDeactivate();
QPushButton* myOkBtn;
QPushButton* mySaveBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
QButtonGroup* myTypeGrp;
QRadioButton* mySwitch2d;
SMESH::SMESH_Pattern_var myPattern;
bool myIsLoaded;
+
+ QString myHelpFileName;
};
#endif
#include "SMDS_Mesh.hxx"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
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 );
/***************************************************************/
RadioButton1->setChecked( TRUE );
mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
+
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_polyhedrons
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() ) ) ;
reject() ;
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupContent;
QLabel* TextLabelIds;
QPushButton* SelectElementsButton;
QLabel* myFacesByNodesLabel;
QPushButton* AddButton;
QPushButton* RemoveButton;
+
+ QString myHelpFileName;
public slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SMESH_TypeFilter.hxx"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SALOME_ListIO.hxx"
aDlgLay->setStretchFactor(aMainFrame, 1);
+ myHelpFileName = "deleting_groups.htm";
+
Init();
}
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
+ aLay->addWidget(myHelpBtn);
// connect signals and slots
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
return aFrame;
}
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_DeleteGroupDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : onSelectionDone()
// purpose : SLOT called when selection changed
void onOk();
bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
QListBox* myListBox;
SMESHGUI* mySMESHGUI;
QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
bool myBlockSelection;
+
+ QString myHelpFileName;
};
#endif
Q_OBJECT
public:
- SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false, const int = OK | Close | Apply );
+ SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false, const int = OK | Close | Apply | Help );
virtual ~SMESHGUI_Dialog();
virtual void show();
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESHGUI_EditHypothesesDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-
-#include "SMESHGUI_EditHypothesesDlg.h"
-
-#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESHGUI_HypothesesUtils.h"
-
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_NumberFilter.hxx"
-
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEDSClient_AttributeIOR.hxx"
-#include "SALOMEDSClient_AttributeName.hxx"
-
-#include "SUIT_Session.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Operation.h"
-#include "SUIT_Desktop.h"
-
-#include "utilities.h"
-
-#include "SVTK_ViewModel.h"
-
-// QT Includes
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-
-using namespace std;
-
-//VRV: porting on Qt 3.0.5
-#if QT_VERSION >= 0x030005
-#include <qlistbox.h>
-#endif
-//VRV: porting on Qt 3.0.5
-
-class ListBoxIOR : public QListBoxText
-{
-public:
- enum { RTTI_IOR = 1000 };
-
-public:
- ListBoxIOR (QListBox* listbox,
- const char* ior,
- const QString& text = QString::null)
- : QListBoxText(listbox, text), myIOR(ior) {}
- virtual ~ListBoxIOR() {};
- virtual int rtti() const { return RTTI_IOR; }
- const char* GetIOR() { return myIOR.c_str(); }
-
-private:
- string myIOR;
-};
-
-#define ALLOW_CHANGE_SHAPE 0
-
-int findItem (QListBox* listBox, const string& ior)
-{
- for (int i = 0; i < listBox->count(); i++) {
- if (listBox->item(i)->rtti() == ListBoxIOR::RTTI_IOR) {
- ListBoxIOR* anItem = (ListBoxIOR*)(listBox->item(i));
- if (anItem && ior == string(anItem->GetIOR()))
- return i;
- }
- }
- return -1;
-}
-
-//=================================================================================
-// function : SMESHGUI_EditHypothesesDlg()
-// purpose : Constructs a SMESHGUI_EditHypothesesDlg which is a child of 'parent', with the
-// name 'name' and widget flags set to 'f'.
-// The dialog will by default be modeless, unless you set 'modal' to
-// TRUE to construct a modal dialog.
-//=================================================================================
-SMESHGUI_EditHypothesesDlg::SMESHGUI_EditHypothesesDlg (SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- myImportedMesh(false),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
-{
- QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_EditHypothesesDlg");
- setCaption(tr("SMESH_EDIT_HYPOTHESES"));
- setSizeGripEnabled(TRUE);
- QGridLayout* SMESHGUI_EditHypothesesDlgLayout = new QGridLayout(this);
- SMESHGUI_EditHypothesesDlgLayout->setSpacing(6);
- SMESHGUI_EditHypothesesDlgLayout->setMargin(11);
-
- /***************************************************************/
- GroupC1 = new QGroupBox(tr("SMESH_ARGUMENTS"), this, "GroupC1");
- GroupC1->setColumnLayout(0, Qt::Vertical);
- GroupC1->layout()->setSpacing(0);
- GroupC1->layout()->setMargin(0);
- QGridLayout* GroupC1Layout = new QGridLayout(GroupC1->layout());
- GroupC1Layout->setAlignment(Qt::AlignTop);
- GroupC1Layout->setSpacing(6);
- GroupC1Layout->setMargin(11);
-
- TextLabelC1A1 = new QLabel(tr("SMESH_OBJECT_MESHorSUBMESH"), GroupC1, "TextLabelC1A1");
- GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
- SelectButtonC1A1 = new QPushButton(GroupC1, "SelectButtonC1A1");
- SelectButtonC1A1->setPixmap(image0);
- GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
- LineEditC1A1 = new QLineEdit(GroupC1, "LineEditC1A1");
- LineEditC1A1->setReadOnly(true);
- GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
-
- TextLabelC1A2 = new QLabel(tr("SMESH_OBJECT_GEOM"), GroupC1, "TextLabelC1A2");
- GroupC1Layout->addWidget(TextLabelC1A2, 1, 0);
- SelectButtonC1A2 = new QPushButton(GroupC1, "SelectButtonC1A2");
- SelectButtonC1A2->setPixmap(image0);
- SelectButtonC1A2->setToggleButton(FALSE);
- GroupC1Layout->addWidget(SelectButtonC1A2, 1, 1);
- LineEditC1A2 = new QLineEdit(GroupC1, "LineEditC1A2");
- LineEditC1A2->setReadOnly(true);
- GroupC1Layout->addWidget(LineEditC1A2, 1, 2);
-
- SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupC1, 0, 0);
-
- /***************************************************************/
- GroupHypotheses = new QGroupBox(tr("SMESH_HYPOTHESES"), this, "GroupHypotheses");
- GroupHypotheses->setColumnLayout(0, Qt::Vertical);
- GroupHypotheses->layout()->setSpacing(0);
- GroupHypotheses->layout()->setMargin(0);
- QGridLayout* grid_3 = new QGridLayout(GroupHypotheses->layout());
- grid_3->setAlignment(Qt::AlignTop);
- grid_3->setSpacing(6);
- grid_3->setMargin(11);
-
- TextHypDefinition = new QLabel(tr("SMESH_AVAILABLE"), GroupHypotheses, "TextHypDefinition");
- grid_3->addWidget(TextHypDefinition, 0, 0);
-
- ListHypDefinition = new QListBox(GroupHypotheses, "ListHypDefinition");
- ListHypDefinition->setMinimumSize(100, 100);
- grid_3->addWidget(ListHypDefinition, 1, 0);
-
- TextHypAssignation = new QLabel(tr("SMESH_EDIT_USED"), GroupHypotheses, "TextHypAssignation");
- grid_3->addWidget(TextHypAssignation, 0, 1);
-
- ListHypAssignation = new QListBox(GroupHypotheses, "ListHypAssignation");
- ListHypAssignation->setMinimumSize(100, 100);
- grid_3->addWidget(ListHypAssignation, 1, 1);
-
- SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupHypotheses, 1, 0);
-
- /***************************************************************/
- GroupAlgorithms = new QGroupBox(tr("SMESH_ADD_ALGORITHM"), this, "GroupAlgorithms");
- GroupAlgorithms->setColumnLayout(0, Qt::Vertical);
- GroupAlgorithms->layout()->setSpacing(0);
- GroupAlgorithms->layout()->setMargin(0);
- QGridLayout* grid_4 = new QGridLayout(GroupAlgorithms->layout());
- grid_4->setAlignment(Qt::AlignTop);
- grid_4->setSpacing(6);
- grid_4->setMargin(11);
-
- TextAlgoDefinition = new QLabel(tr("SMESH_AVAILABLE"), GroupAlgorithms, "TextAlgoDefinition");
- grid_4->addWidget(TextAlgoDefinition, 0, 0);
-
- ListAlgoDefinition = new QListBox(GroupAlgorithms, "ListAlgoDefinition");
- ListAlgoDefinition->setMinimumSize(100, 100);
- grid_4->addWidget(ListAlgoDefinition, 1, 0);
-
- TextAlgoAssignation = new QLabel(tr("SMESH_EDIT_USED"), GroupAlgorithms, "TextAlgoAssignation");
- grid_4->addWidget(TextAlgoAssignation, 0, 1);
-
- ListAlgoAssignation = new QListBox(GroupAlgorithms, "ListAlgoAssignation");
- ListAlgoAssignation ->setMinimumSize(100, 100);
- grid_4->addWidget(ListAlgoAssignation, 1, 1);
-
- SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupAlgorithms, 2, 0);
-
- /***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- QGridLayout* GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
-
- buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons, "buttonOk");
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(FALSE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
-
- buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons, "buttonApply");
- buttonApply->setAutoDefault(TRUE);
- buttonApply->setDefault(FALSE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
-
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
-
- buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons, "buttonCancel");
- buttonCancel->setAutoDefault(TRUE);
- buttonCancel->setDefault(TRUE);
- buttonCancel->setEnabled(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
-
- SMESHGUI_EditHypothesesDlgLayout->addWidget(GroupButtons, 4, 0);
-
- /***************************************************************/
- Init();
-}
-
-//=================================================================================
-// function : ~SMESHGUI_EditHypothesesDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-SMESHGUI_EditHypothesesDlg::~SMESHGUI_EditHypothesesDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::Init()
-{
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
-
- InitHypDefinition();
- InitAlgoDefinition();
-
- //myGeomFilter = new SALOME_TypeFilter ("GEOM");
- TColStd_MapOfInteger allTypesMap;
- for (int i = 0; i < 10; i++)
- allTypesMap.Add(i);
- myGeomFilter = new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE, 0, allTypesMap);
- myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
-
- myGeomShape = GEOM::GEOM_Object::_nil();
- myMesh = SMESH::SMESH_Mesh::_nil();
- mySubMesh = SMESH::SMESH_subMesh::_nil();
-
- /* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
-
- connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(SelectButtonC1A2, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
-
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
- connect(ListHypAssignation, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(removeItem(QListBoxItem*)));
- connect(ListAlgoAssignation, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(removeItem(QListBoxItem*)));
-
- connect(ListHypDefinition, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(addItem(QListBoxItem*)));
- connect(ListAlgoDefinition, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(addItem(QListBoxItem*)));
-
- this->show();
-
- LineEditC1A1->setFocus();
- myEditCurrentArgument = LineEditC1A1;
- mySelectionMgr->clearFilters();
- mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
-
- SelectionIntoArgument();
-
- UpdateControlState();
-}
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::ClickOnOk()
-{
- if (ClickOnApply())
- ClickOnCancel();
-}
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-bool SMESHGUI_EditHypothesesDlg::ClickOnApply()
-{
- if (mySMESHGUI->isActiveStudyLocked())
- return false;
-
- bool aRes = false;
-
- SUIT_OverrideCursor wc;
-
- SUIT_Operation* op = new SUIT_Operation
- (SUIT_Session::session()->activeApplication());
-
- // start transaction
- op->start();
-
- if (!myMesh->_is_nil())
- aRes = StoreMesh();
- else if (!mySubMesh->_is_nil())
- aRes = StoreSubMesh();
-
- if (true/*aRes*/) { // abort desynchronizes contents of a Study and a mesh on server
- // commit transaction
- op->commit();
- InitHypAssignation();
- InitAlgoAssignation();
- } else {
- // abort transaction
- op->abort();
- }
-
- UpdateControlState();
- mySMESHGUI->updateObjBrowser();
-
- return aRes;
-}
-
-//=================================================================================
-// function : ClickOnCancel()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::ClickOnCancel()
-{
- close();
-}
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection as changed or other case
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::SelectionIntoArgument()
-{
- QString aString = "";
-
- SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
-
- int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
-
- if (myEditCurrentArgument == LineEditC1A1) {
- if (nbSel != 1) {
- myMesh = SMESH::SMESH_Mesh::_nil();
- mySubMesh = SMESH::SMESH_subMesh::_nil();
- aString = "";
- } else {
- Handle(SALOME_InteractiveObject) IO = aList.First();
- myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
- if (myMesh->_is_nil()) {
- mySubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO);
- if (mySubMesh->_is_nil()) {
- aString = "";
- }
- }
- }
- myEditCurrentArgument->setText(aString);
-
- // InitGeom() will try to retrieve a shape from myMesh or mySubMesh
- myGeomShape = GEOM::GEOM_Object::_nil();
- InitGeom();
-
- myImportedMesh = myGeomShape->_is_nil();
-
- InitHypAssignation();
- InitAlgoAssignation();
-
- } else if (myEditCurrentArgument == LineEditC1A2) {
- if (nbSel != 1) {
- myGeomShape = GEOM::GEOM_Object::_nil();
- } else {
- Handle(SALOME_InteractiveObject) IO = aList.First();
- myGeomShape = SMESH::IObjectToInterface<GEOM::GEOM_Object>(IO);
- }
- InitGeom();
- }
-
- UpdateControlState();
-}
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::SetEditCurrentArgument()
-{
- QPushButton* send = (QPushButton*)sender();
- if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus();
- myEditCurrentArgument = LineEditC1A1;
- mySelectionMgr->clearFilters();
- mySelectionMgr->installFilter(myMeshOrSubMeshFilter);
- } else if (send == SelectButtonC1A2) {
- LineEditC1A2->setFocus();
- myEditCurrentArgument = LineEditC1A2;
- mySelectionMgr->clearFilters();
- mySelectionMgr->installFilter(myGeomFilter);
- }
- SelectionIntoArgument();
-}
-
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::DeactivateActiveDialog()
-{
- if (GroupC1->isEnabled()) {
- disconnect(mySelectionMgr, 0, this, 0);
- GroupC1->setEnabled(false);
- GroupButtons->setEnabled(false);
- }
-}
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::ActivateThisDialog()
-{
- mySMESHGUI->EmitSignalDeactivateDialog();
- GroupC1->setEnabled(true);
- GroupButtons->setEnabled(true);
- connect (mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-}
-
-//=================================================================================
-// function : enterEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::enterEvent (QEvent*)
-{
- if (!GroupC1->isEnabled())
- ActivateThisDialog();
-}
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::closeEvent (QCloseEvent* e)
-{
- disconnect(mySelectionMgr, 0, this, 0);
- mySMESHGUI->ResetState();
- mySelectionMgr->clearFilters();
- QDialog::closeEvent(e);
-}
-
-//=======================================================================
-// function : IsOld()
-// purpose :
-//=======================================================================
-bool SMESHGUI_EditHypothesesDlg::IsOld (QListBoxItem* hypItem)
-{
- if (hypItem->rtti() == ListBoxIOR::RTTI_IOR) {
- ListBoxIOR* hyp = (ListBoxIOR*) hypItem;
- return (myMapOldHypos.find(hyp->GetIOR()) != myMapOldHypos.end() ||
- myMapOldAlgos.find(hyp->GetIOR()) != myMapOldAlgos.end());
- }
-
- return false;
-}
-
-//=================================================================================
-// function : removeItem()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::removeItem (QListBoxItem* item)
-{
- const QObject* aSender = sender();
-
- if (!item) return;
-
- if (aSender == ListHypAssignation) {
- myNbModification += IsOld(item) ? 1 : -1;
- ListHypAssignation->removeItem(ListHypAssignation->index(item));
- }
- else if (aSender == ListAlgoAssignation) {
- myNbModification += IsOld(item) ? 1 : -1;
- ListAlgoAssignation->removeItem(ListAlgoAssignation->index(item));
- }
-
- UpdateControlState();
-}
-
-//=================================================================================
-// function : addItem()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::addItem (QListBoxItem* item)
-{
- const QObject* aSender = sender();
-
- if (!item) return;
-
- ListBoxIOR* i = 0;
- if (item->rtti() == ListBoxIOR::RTTI_IOR)
- i = (ListBoxIOR*)item;
- if (!i) return;
-
- bool isFound = false;
-
- ListBoxIOR* anItem;
- if (aSender == ListHypDefinition) {
- for (int j = 0, n = ListHypAssignation->count(); !isFound && j < n; j++) {
- if (ListHypAssignation->item(j)->rtti() == ListBoxIOR::RTTI_IOR) {
- anItem = (ListBoxIOR*)ListHypAssignation->item(j);
- isFound = !strcmp(anItem->GetIOR(), i->GetIOR());
- }
- }
- if (!isFound)
- anItem = new ListBoxIOR (ListHypAssignation,
- CORBA::string_dup(i->GetIOR()),
- CORBA::string_dup(i->text().latin1()));
-
- } else if (aSender == ListAlgoDefinition) {
- for (int j = 0, n = ListAlgoAssignation->count(); !isFound && j < n; j++) {
- if (ListAlgoAssignation->item(j)->rtti() == ListBoxIOR::RTTI_IOR) {
- anItem = (ListBoxIOR*)ListAlgoAssignation->item(j);
- isFound = !strcmp(anItem->GetIOR(), i->GetIOR());
- }
- }
- if (!isFound)
- anItem = new ListBoxIOR (ListAlgoAssignation,
- CORBA::string_dup(i->GetIOR()),
- CORBA::string_dup(i->text().latin1()));
- } else {
- }
-
- if (!isFound)
- myNbModification += IsOld(item) ? -1 : 1;
-
- UpdateControlState();
-}
-
-//=================================================================================
-// function : InitHypDefinition()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::InitHypDefinition()
-{
- ListHypDefinition->clear();
-
- _PTR(SComponent) father = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
- if (!father)
- return;
-
- _PTR(SObject) HypothesisRoot;
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeName) aName;
- _PTR(AttributeIOR) anIOR;
-
- //int Tag_HypothesisRoot = 1;
- if (father->FindSubObject(1, HypothesisRoot)) {
- _PTR(ChildIterator) it =
- SMESH::GetActiveStudyDocument()->NewChildIterator(HypothesisRoot);
- ListBoxIOR* anItem;
- for (; it->More();it->Next()) {
- _PTR(SObject) Obj = it->Value();
- if (Obj->FindAttribute(anAttr, "AttributeName")) {
- aName = anAttr;
- if (Obj->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = anAttr;
- anItem = new ListBoxIOR (ListHypDefinition,
- anIOR->Value().c_str(),
- aName->Value().c_str());
- }
- }
- }
- }
-}
-
-//=================================================================================
-// function : InitHypAssignation()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::InitHypAssignation()
-{
- myNbModification = 0;
-
- myMapOldHypos.clear();
- ListHypAssignation->clear();
- if (myImportedMesh)
- return;
-
- _PTR(SObject) aMorSM, AHR, aRef;
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeName) aName;
- _PTR(AttributeIOR) anIOR;
-
- if (!myMesh->_is_nil())
- aMorSM = SMESH::FindSObject(myMesh);
- else if (!mySubMesh->_is_nil())
- aMorSM = SMESH::FindSObject(mySubMesh);
-
- if (aMorSM && aMorSM->FindSubObject(2, AHR)) {
- _PTR(ChildIterator) it =
- SMESH::GetActiveStudyDocument()->NewChildIterator(AHR);
- for (; it->More();it->Next()) {
- _PTR(SObject) Obj = it->Value();
- if (Obj->ReferencedObject(aRef)) {
- if (aRef->FindAttribute(anAttr, "AttributeName")) {
- aName = anAttr;
- if (aRef->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = anAttr;
- ListBoxIOR* anItem = new ListBoxIOR (ListHypAssignation,
- anIOR->Value().c_str(),
- aName->Value().c_str());
- myMapOldHypos[ anIOR->Value() ] = ListHypAssignation->index(anItem);
- }
- }
- }
- }
- }
-}
-
-//=================================================================================
-// function : InitAlgoDefinition()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::InitAlgoDefinition()
-{
- ListAlgoDefinition->clear();
-
- _PTR(SComponent) father = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
- if (!father)
- return;
-
- _PTR(SObject) AlgorithmsRoot;
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeName) aName;
- _PTR(AttributeIOR) anIOR;
-
- if (father->FindSubObject (2, AlgorithmsRoot)) {
- _PTR(ChildIterator) it =
- SMESH::GetActiveStudyDocument()->NewChildIterator(AlgorithmsRoot);
- ListBoxIOR* anItem;
- for (; it->More();it->Next()) {
- _PTR(SObject) Obj = it->Value();
- if (Obj->FindAttribute(anAttr, "AttributeName")) {
- aName = anAttr;
- if (Obj->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = anAttr;
- anItem = new ListBoxIOR (ListAlgoDefinition,
- anIOR->Value().c_str(),
- aName->Value().c_str());
- }
- }
- }
- }
-}
-
-//=================================================================================
-// function : InitAlgoAssignation()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::InitAlgoAssignation()
-{
- myMapOldAlgos.clear();
- ListAlgoAssignation->clear();
- if (myImportedMesh)
- return;
-
- _PTR(SObject) aMorSM, AHR, aRef;
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeName) aName;
- _PTR(AttributeIOR) anIOR;
-
- if (!myMesh->_is_nil())
- aMorSM = SMESH::FindSObject(myMesh);
- else if (!mySubMesh->_is_nil())
- aMorSM = SMESH::FindSObject(mySubMesh);
-
- if (aMorSM && aMorSM->FindSubObject(3, AHR)) {
- _PTR(ChildIterator) it =
- SMESH::GetActiveStudyDocument()->NewChildIterator(AHR);
- for (; it->More();it->Next()) {
- _PTR(SObject) Obj = it->Value();
- if (Obj->ReferencedObject(aRef)) {
- if (aRef->FindAttribute(anAttr, "AttributeName")) {
- aName = anAttr;
- if (aRef->FindAttribute(anAttr, "AttributeIOR")) {
- anIOR = anAttr;
- ListBoxIOR* anItem = new ListBoxIOR (ListAlgoAssignation,
- anIOR->Value().c_str(),
- aName->Value().c_str());
- myMapOldAlgos[ anIOR->Value() ] = ListAlgoAssignation->index(anItem);
- }
- }
- }
- }
- }
-}
-
-//=================================================================================
-// function : InitGeom()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::InitGeom()
-{
- LineEditC1A2->setText("");
-
- if (myGeomShape->_is_nil() && !myMesh->_is_nil()) {
- _PTR(SObject) aMesh = SMESH::FindSObject(myMesh);
- if (aMesh)
- myGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aMesh);
- }
- if (myGeomShape->_is_nil() && !mySubMesh->_is_nil()) {
- _PTR(SObject) aSubMesh = SMESH::FindSObject(mySubMesh);
- if (aSubMesh)
- myGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aSubMesh);
- }
-
- _PTR(GenericAttribute) anAttr;
- _PTR(AttributeName) aName;
- if (!myGeomShape->_is_nil() && (!myMesh->_is_nil() || !mySubMesh->_is_nil())) {
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- //_PTR(SObject) aSO = aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomShape));
- _PTR(SObject) aSO = aStudy->FindObjectID(myGeomShape->GetStudyEntry());
- if (aSO) {
- if (aSO->FindAttribute(anAttr, "AttributeName")) {
- aName = anAttr;
- LineEditC1A2->setText(QString(aName->Value().c_str()));
- }
- }
- }
-}
-
-//=================================================================================
-// function : UpdateControlState()
-// purpose :
-//=================================================================================
-void SMESHGUI_EditHypothesesDlg::UpdateControlState()
-{
- // asl the check of "count" is commented because of PAL9787
- bool isEnabled = (!myMesh->_is_nil() && !myGeomShape->_is_nil() /*&&
- ListHypAssignation->count() && ListAlgoAssignation->count()*/ )
- ||
- (!mySubMesh->_is_nil() && !myGeomShape->_is_nil() /*&&
- (ListHypAssignation->count() || ListAlgoAssignation->count())*/);
-
- buttonOk ->setEnabled(myNbModification && isEnabled && !myImportedMesh);
- buttonApply->setEnabled(myNbModification && isEnabled && !myImportedMesh);
-
- SelectButtonC1A2 ->setEnabled(ALLOW_CHANGE_SHAPE && !myImportedMesh);
- LineEditC1A2 ->setEnabled(ALLOW_CHANGE_SHAPE && !myImportedMesh);
- ListHypDefinition ->setEnabled(!myImportedMesh);
- ListHypAssignation ->setEnabled(!myImportedMesh);
- ListAlgoDefinition ->setEnabled(!myImportedMesh);
- ListAlgoAssignation->setEnabled(!myImportedMesh);
-}
-
-//=================================================================================
-// function : StoreMesh()
-// purpose :
-//=================================================================================
-bool SMESHGUI_EditHypothesesDlg::StoreMesh()
-{
- MapIOR anOldHypos, aNewHypos;
- if (myGeomShape->_is_nil())
- return false;
-
- // 1. Check whether the geometric shape has changed
- _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh);
- GEOM::GEOM_Object_var aIniGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aMeshSO);
- bool bShapeChanged = aIniGeomShape->_is_nil() ||
- !aIniGeomShape->_is_equivalent(myGeomShape);
- if (bShapeChanged) {
- // VSR : TODO : Set new shape - not supported yet by SMESH engine
- // 1. remove all old hypotheses and algorithms and also submeshes
- // 2. set new shape
- }
-
- int nbFail = 0;
- MapIOR::iterator it;
-
- // 2. remove not used hypotheses from the mesh
- for (it = myMapOldHypos.begin(); it != myMapOldHypos.end(); ++it) {
- string ior = it->first;
- int index = findItem(ListHypAssignation, ior);
- if (index < 0) {
- SMESH::SMESH_Hypothesis_var aHyp =
- SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()) {
- if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aMeshSO, aHyp))
- nbFail++;
- }
- }
- }
-
- // 3. remove not used algorithms from the mesh
- for (it = myMapOldAlgos.begin(); it != myMapOldAlgos.end(); ++it) {
- string ior = it->first;
- int index = findItem(ListAlgoAssignation, ior);
- if (index < 0) {
- SMESH::SMESH_Hypothesis_var aHyp =
- SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()) {
- if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aMeshSO, aHyp))
- nbFail++;
- }
- }
- }
-
- // 4. Add new algorithms
- for (int i = 0; i < ListAlgoAssignation->count(); i++) {
- if (ListAlgoAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) {
- ListBoxIOR* anItem = (ListBoxIOR*)(ListAlgoAssignation->item(i));
- if (anItem) {
- string ior = anItem->GetIOR();
- if (myMapOldAlgos.find(ior) == myMapOldAlgos.end()) {
- SMESH::SMESH_Hypothesis_var aHyp =
- SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()) {
- if (!SMESH::AddHypothesisOnMesh(myMesh, aHyp))
- nbFail++;
- }
- }
- }
- }
- }
-
- // 5. Add new hypotheses
- for (int i = 0; i < ListHypAssignation->count(); i++) {
- if (ListHypAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) {
- ListBoxIOR* anItem = (ListBoxIOR*)(ListHypAssignation->item(i));
- if (anItem) {
- string ior = anItem->GetIOR();
- if (myMapOldHypos.find(ior) == myMapOldHypos.end()) {
- SMESH::SMESH_Hypothesis_var aHyp =
- SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()) {
- if (!SMESH::AddHypothesisOnMesh(myMesh, aHyp))
- nbFail++;
- }
- }
- }
- }
- }
- return (nbFail == 0);
-}
-
-//=================================================================================
-// function : StoreSubMesh()
-// purpose :
-//=================================================================================
-bool SMESHGUI_EditHypothesesDlg::StoreSubMesh()
-{
- MapIOR anOldHypos, aNewHypos;
- if (myGeomShape->_is_nil())
- return false;
-
- // 1. Check whether the geometric shape has changed
- _PTR(SObject) aSubMeshSO = SMESH::FindSObject(mySubMesh);
- GEOM::GEOM_Object_var aIniGeomShape = SMESH::GetShapeOnMeshOrSubMesh(aSubMeshSO);
- bool bShapeChanged = aIniGeomShape->_is_nil() || !aIniGeomShape->_is_equivalent(myGeomShape);
- if (bShapeChanged) {
- // VSR : TODO : Set new shape - not supported yet by engine
- // 1. remove all old hypotheses and algorithms
- // 2. set new shape
- }
- int nbFail = 0;
- MapIOR::iterator it;
-
- // 2. remove not used hypotheses from the submesh
- for (it = myMapOldHypos.begin(); it != myMapOldHypos.end(); ++it) {
- string ior = it->first;
- int index = findItem(ListHypAssignation, ior);
- if (index < 0) {
- SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()) {
- if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aSubMeshSO, aHyp))
- nbFail++;
- }
- }
- }
-
- // 3. remove not used algorithms from the submesh
- for (it = myMapOldAlgos.begin(); it != myMapOldAlgos.end(); ++it) {
- string ior = it->first;
- int index = findItem(ListAlgoAssignation, ior);
- if (index < 0) {
- SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()){
- if (!SMESH::RemoveHypothesisOrAlgorithmOnMesh(aSubMeshSO, aHyp))
- nbFail++;
- }
- }
- }
-
- // 4. Add new algorithms
- for (int i = 0; i < ListAlgoAssignation->count(); i++) {
- if (ListAlgoAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) {
- ListBoxIOR* anItem = (ListBoxIOR*)(ListAlgoAssignation->item(i));
- if (anItem) {
- string ior = anItem->GetIOR();
- if (myMapOldAlgos.find(ior) == myMapOldAlgos.end()) {
- SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()){
- if (!SMESH::AddHypothesisOnSubMesh(mySubMesh, aHyp))
- nbFail++;
- }
- }
- }
- }
- }
-
- // 5. Add new hypotheses
- for (int i = 0; i < ListHypAssignation->count(); i++) {
- if (ListHypAssignation->item(i)->rtti() == ListBoxIOR::RTTI_IOR) {
- ListBoxIOR* anItem = (ListBoxIOR*)(ListHypAssignation->item(i));
- if (anItem) {
- string ior = anItem->GetIOR();
- if (myMapOldHypos.find(ior) == myMapOldHypos.end()) {
- SMESH::SMESH_Hypothesis_var aHyp = SMESH::IORToInterface<SMESH::SMESH_Hypothesis>(ior.c_str());
- if (!aHyp->_is_nil()){
- if (!SMESH::AddHypothesisOnSubMesh(mySubMesh, aHyp))
- nbFail++;
- }
- }
- }
- }
- }
- return (nbFail == 0);
-}
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESHGUI_EditHypothesesDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-
-#ifndef DIALOGBOX_EDIT_HYPOTHESES_H
-#define DIALOGBOX_EDIT_HYPOTHESES_H
-
-//#include "SMESH_TypeFilter.hxx"
-#include "SUIT_SelectionFilter.h"
-#include "LightApp_SelectionMgr.h"
-
-// QT Includes
-#include <qdialog.h>
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-#include <map>
-#include <string>
-
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QListBox;
-class QListBoxItem;
-class SMESHGUI;
-
-typedef map<std::string, int> MapIOR;
-
-//=================================================================================
-// class : SMESHGUI_EditHypothesesDlg
-// purpose :
-//=================================================================================
-class SMESHGUI_EditHypothesesDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_EditHypothesesDlg (SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_EditHypothesesDlg();
-
-protected:
- virtual void closeEvent (QCloseEvent*);
- virtual void enterEvent (QEvent*);
-
-private:
- void Init();
-
- void InitHypDefinition();
- void InitAlgoDefinition();
- void InitHypAssignation();
- void InitAlgoAssignation();
-
- void InitGeom();
-
- void UpdateControlState();
-
- bool StoreMesh();
- bool StoreSubMesh();
-
- bool IsOld(QListBoxItem* hypItem);
-
-private:
- SMESHGUI* mySMESHGUI;
- LightApp_SelectionMgr* mySelectionMgr;
-
- GEOM::GEOM_Object_var myGeomShape;
- QLineEdit* myEditCurrentArgument;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH::SMESH_subMesh_var mySubMesh;
-
- //Handle(SALOME_TypeFilter) myGeomFilter;
- //Handle(SMESH_TypeFilter) myMeshOrSubMeshFilter;
- SUIT_SelectionFilter* myGeomFilter;
- SUIT_SelectionFilter* myMeshOrSubMeshFilter;
-
- MapIOR myMapOldHypos, myMapOldAlgos;
- int myNbModification;
-
- bool myImportedMesh;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonApply;
- QPushButton* buttonCancel;
-
- QGroupBox* GroupC1;
- QLabel* TextLabelC1A1;
- QPushButton* SelectButtonC1A1;
- QLineEdit* LineEditC1A1;
- QLabel* TextLabelC1A2;
- QPushButton* SelectButtonC1A2;
- QLineEdit* LineEditC1A2;
-
- QGroupBox* GroupHypotheses;
- QLabel* TextHypDefinition;
- QListBox* ListHypDefinition;
- QLabel* TextHypAssignation;
- QListBox* ListHypAssignation;
-
- QGroupBox* GroupAlgorithms;
- QLabel* TextAlgoDefinition;
- QListBox* ListAlgoDefinition;
- QLabel* TextAlgoAssignation;
- QListBox* ListAlgoAssignation;
-
-private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
-
- void removeItem(QListBoxItem*);
- void addItem(QListBoxItem*);
-};
-
-#endif // DIALOGBOX_EDIT_HYPOTHESES_H
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SALOME_ListIO.hxx"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton (GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
DlgLayout->addWidget(GroupMesh, 1, 0);
+ myHelpFileName = "/files/merging_nodes.htm";// merging_elements.htm
+
Init(); // Initialisations
}
connect(buttonOk , SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SelectButton, SIGNAL(clicked()), this, SLOT(SelectionIntoArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_EditMeshDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupMesh;
QLabel* TextLabelMesh;
QGridLayout* GroupButtonsLayout;
QGridLayout* GroupMeshLayout;
+ QString myHelpFileName;
+
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SelectionIntoArgument();
void DeactivateActiveDialog();
void ActivateThisDialog();
#include "SUIT_OverrideCursor.h"
#include "SUIT_Desktop.h"
#include "SUIT_MessageBox.h"
+#include "SUIT_Session.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
CloseButton = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
CloseButton->setAutoDefault(true);
+ HelpButton = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ HelpButton->setAutoDefault(true);
+
// layouting
GroupButtonsLayout->addWidget(OkButton, 0, 0);
GroupButtonsLayout->addWidget(ApplyButton, 0, 1);
GroupButtonsLayout->addWidget(CloseButton, 0, 3);
+ GroupButtonsLayout->addWidget(HelpButton, 0, 4);
GroupButtonsLayout->addColSpacing(2, 10);
GroupButtonsLayout->setColStretch(2, 10);
myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
myPathMeshFilter = new SMESH_TypeFilter (MESH);
+ myHelpFileName = "extrusion_along_a_path.htm";
+
Init();
/***************************************************************/
connect(OkButton, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(CloseButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(ApplyButton, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(HelpButton, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : reject()
// purpose : Called when dialog box is closed
QPushButton* OkButton;
QPushButton* ApplyButton;
QPushButton* CloseButton;
+ QPushButton* HelpButton;
+
+ QString myHelpFileName;
protected slots:
void reject();
void ConstructorsClicked (int);
void ClickOnOk();
bool ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog();
#include "SUIT_OverrideCursor.h"
#include "SUIT_Desktop.h"
#include "SUIT_MessageBox.h"
+#include "SUIT_Session.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+ myHelpFileName = "extrusion.htm";
+
Init();
/***************************************************************/
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
// to update state of the Ok & Apply buttons
connect(SpinBox_Dx, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_ExtrusionDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+
+ QString myHelpFileName;
private slots:
void ConstructorsClicked (int);
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();
+ void ClickOnHelp();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog();
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Tools.h"
aDlgLay->setStretchFactor(myMainFrame, 1);
+ myHelpFileName = "selection_filter_library.htm";
+
Init(myTypes);
}
myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp);
myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
+ myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose()));
connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose()));
connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply()));
+ connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
updateMainButtons();
return;
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_FilterDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_FilterDlg::onDeactivate
// Purpose : SLOT called when dialog must be deativated
enum { Mesh, Selection, Dialog, None };
// Buttons
- enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close };
+ enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close, BTN_Help };
public:
SMESHGUI_FilterDlg( SMESHGUI*,
void onOk();
bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
void onSelectionDone();
void onCriterionChanged (const int, const int);
QMap< int, SMESH::Filter_var > myFilter;
QMap< int, bool > myInsertState;
QMap< int, int > myApplyToState;
+
+ QString myHelpFileName;
};
#endif
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_FileDlg.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
// QT Includes
#include <qapplication.h>
aDlgLay->setStretchFactor(myMainFrame, 1);
+ myHelpFileName = "selection_filter_library.htm";
+
Init(myTypes, myMode);
}
myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp);
myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
+ myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose()));
connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose()));
connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply()));
+ connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
QMap<int, QPushButton*>::iterator anIter;
for (anIter = myButtons.begin(); anIter != myButtons.end(); ++anIter)
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_FilterLibraryDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_FilterLibraryDlg::onDeactivate
// Purpose : SLOT called when dialog must be deativated
Q_OBJECT
// Buttons
- enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close };
+ enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close, BTN_Help };
class Dialog;
void onOk();
bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
QString myCurrFilterName;
int myCurrFilter;
+ QString myHelpFileName;
};
#endif
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SalomeApp_Tools.h"
+#include "SalomeApp_Application.h"
#include "SALOMEDSClient_Study.hxx"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
myCurrentLineEdit = myMeshGroupLine;
setSelectionMode(5);
}
+
+ bool isEditMode = !CORBA::is_nil( myGroupOnGeom );
+ myHelpFileName = isEditMode ? "/files/editing_groups.htm" : "/files/creating_groups.htm";
}
//=================================================================================
QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
aCloseBtn->setAutoDefault(true);
+ QPushButton* aHelpBtn = new QPushButton(aButtons, "help");
+ aHelpBtn->setText(tr("SMESH_BUT_HELP"));
+ aHelpBtn->setAutoDefault(true);
aBtnLayout->addWidget(aOKBtn);
aBtnLayout->addWidget(aApplyBtn);
aBtnLayout->addStretch();
aBtnLayout->addWidget(aCloseBtn);
+ aBtnLayout->addWidget(aHelpBtn);
/***************************************************************/
aMainLayout->addWidget(meshGroupLab, 0, 0);
connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
+ connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
/* Init selection */
mySMESHGUI->SetActiveDialogBox(this);
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_GroupDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : SMESHGUI_GroupDlg::onDeactivate
// purpose : SLOT called when dialog must be deativated
void onOK();
void onClose();
bool onApply();
+ void onHelp();
void onDeactivate();
void onListSelectionChanged();
SMESHGUI_FilterDlg* myFilterDlg;
bool myCreate, myIsBusy;
+
+ QString myHelpFileName;
};
#endif // DIALOGBOX_GROUP_H
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SVTK_Selection.h"
{
myMode = theMode;
- if (myMode == UNION) setCaption(tr("UNION_OF_TWO_GROUPS"));
- else if (myMode == INTERSECT) setCaption(tr("INTERSECTION_OF_TWO_GROUPS"));
- else setCaption(tr("CUT_OF_TWO_GROUPS"));
+ if (myMode == UNION) {
+ setCaption(tr("UNION_OF_TWO_GROUPS"));
+ myHelpFileName = "/files/using_operations_on_groups.htm#Union";
+ }
+ else if (myMode == INTERSECT) {
+ setCaption(tr("INTERSECTION_OF_TWO_GROUPS"));
+ myHelpFileName = "/files/using_operations_on_groups.htm#Intersection";
+ }
+ else {
+ setCaption(tr("CUT_OF_TWO_GROUPS"));
+ myHelpFileName = "/files/using_operations_on_groups.htm#Cut";
+ }
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
+ aLay->addWidget(myHelpBtn);
// connect signals and slots
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
return aFrame;
}
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_GroupOpDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_GroupOpDlg::onSelectionDone
// Purpose : SLOT called when selection changed
void onOk();
bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
void onSelectionDone();
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
QLineEdit* myNameEdit;
QLineEdit* myEdit1;
SMESH::SMESH_GroupBase_var myGroup1;
SMESH::SMESH_GroupBase_var myGroup2;
+ QString myHelpFileName;
+
};
#endif
#include <SALOMEDSClient_Study.hxx>
#include <utilities.h>
+#include <SMESHGUI.h>
+
#include <QtxIntSpinBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+
+#include <SalomeApp_Application.h>
+
#include <qframe.h>
#include <qlayout.h>
#include <qlineedit.h>
SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent )
-: QtxDialog( parent, "", true, true, QtxDialog::OKCancel ),
+: QtxDialog( parent, "", true, true ),
myCreator( creator )
{
setMinimumSize( 300, height() );
titLay->addStretch( 1 );
myLayout->addWidget( titFrame, 0 );
+
+ QString aHypType = creator->hypType();
+ if ( aHypType == "LocalLength" )
+ myHelpFileName = "/files/arithmetic_1d.htm#?";
+ else if ( aHypType == "Arithmetic1D")
+ myHelpFileName = "/files/arithmetic_1d.htm#?";
+ else if ( aHypType == "MaxElementArea")
+ myHelpFileName = "/files/max._element_area_hypothesis.htm";
+ else if ( aHypType == "MaxElementVolume")
+ myHelpFileName = "/files/max._element_volume_hypothsis.htm";
+ else if ( aHypType == "StartEndLength")
+ myHelpFileName = "/files/arithmetic_1d.htm#?";
+ else if ( aHypType == "Deflection1D")
+ myHelpFileName = "/files/arithmetic_1d.htm#?";
+ else if ( aHypType == "AutomaticLength")
+ myHelpFileName = "/files/arithmetic_1d.htm#?";
+ else if ( aHypType == "NumberOfSegments")
+ myHelpFileName = "/files/arithmetic_1d.htm#?";
+ else
+ myHelpFileName = "";
+
+ connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
+
}
SMESHGUI_HypothesisDlg::~SMESHGUI_HypothesisDlg()
QtxDialog::accept();
}
+void SMESHGUI_HypothesisDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ SMESHGUI* aSMESHGUI = dynamic_cast<SMESHGUI*>( app->activeModule() );
+ app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->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"));
+ }
+}
+
void SMESHGUI_HypothesisDlg::setHIcon( const QPixmap& p )
{
myIconLabel->setPixmap( p );
protected slots:
virtual void accept();
+ void onHelp();
private:
SMESHGUI_GenericHypothesisCreator* myCreator;
QVBoxLayout* myLayout;
QLabel *myIconLabel, *myTypeLabel;
+ QString myHelpFileName;
};
/*!
#include "GEOMBase.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect()));
// Init Mesh field from selection
SelectionIntoArgument();
+
+ myHelpFileName = "/files/merging_nodes.htm";
}
//=================================================================================
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_MergeNodesDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : onEditNodesGroup()
// purpose :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupMesh;
QGroupBox* GroupCoincident;
QGroupBox* GroupEdit;
QListView* ListCoincident;
QListBox* ListEdit;
SMESHGUI_SpinBox* SpinBoxTolerance;
+
+ QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply();
+ void ClickOnHelp();
void updateControls();
void onDetect();
void onSelectNodesGroup();
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Application.h"
#include "SALOMEDSClient_Study.hxx"
#include "SALOME_ListIO.hxx"
myButtonsGroupLayout->setAlignment(Qt::AlignTop);
myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11);
- // buttons --> OK button
+ // buttons --> OK and Help buttons
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn");
myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE);
- myButtonsGroupLayout->addStretch();
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn");
+ myHelpBtn->setAutoDefault(TRUE);
+
myButtonsGroupLayout->addWidget(myOkBtn);
myButtonsGroupLayout->addStretch();
+ myButtonsGroupLayout->addWidget(myHelpBtn);
aTopLayout->addLayout(aSelectLayout);
aTopLayout->addWidget(myWGStack);
// connect signals
connect(myOkBtn, SIGNAL(clicked()), this, SLOT(close()));
+ connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
connect(mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
// init dialog with current selection
onSelectionChanged();
+
+ myHelpFileName = "/files/viewing_mesh_info.htm#?";
}
//=================================================================================
myStartSelection = true;
mySelectLab->setText(tr("INF_SELECT_OBJECT"));
}
+
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_MeshInfosDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
void DeactivateActiveDialog() ;
void ActivateThisDialog();
void onStartSelection();
+ void onHelp();
private:
SMESHGUI* mySMESHGUI;
QLabel* myGroupType;
QLabel* myGroupNb;
- QGroupBox* myButtonsGroup;
- QPushButton* myOkBtn;
+ QGroupBox* myButtonsGroup;
+ QPushButton* myOkBtn;
+ QPushButton* myHelpBtn;
+
+ QString myHelpFileName;
};
#endif // SMESHGUI_MESHINFOSDLG_H
}
connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& )));
connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool )));
+
+ if ( myToCreate )
+ if ( myIsMesh ) myHelpFileName = "/files/constructing_meshes.htm";
+ else myHelpFileName = "/files/constructing_submeshes.htm";
+ else myHelpFileName = "files/reassigning_hypotheses_and_algorithms.htm";
}
SMESHGUI_SelectionOp::startOperation();
if ( !aGeomVar->_is_nil() )
{
QString ID = aGeomVar->GetStudyEntry();
- if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID )) {
+ if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.latin1() )) {
SMESH::SMESH_Mesh_ptr aMeshPtr = myShapeByMeshDlg->GetMesh();
if ( !CORBA::is_nil( aMeshPtr )) {
if (_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshPtr )) {
myDlg->activateObject( SMESHGUI_MeshDlg::Mesh );
- myDlg->selectObject( aMeshSO->GetName(), SMESHGUI_MeshDlg::Mesh, aMeshSO->GetID() );
+ myDlg->selectObject( aMeshSO->GetName().c_str(), SMESHGUI_MeshDlg::Mesh, aMeshSO->GetID().c_str() );
}
}
myDlg->activateObject( SMESHGUI_MeshDlg::Geom );
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
#include "SUIT_FileDlg.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "LightApp_SelectionMgr.h"
#include "SalomeApp_Tools.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
#include "SALOMEDS_SObject.hxx"
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+ myHelpFileName = "pattern_mapping.htm";
+
Init();
}
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
+ aLay->addWidget(myHelpBtn);
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
return aFrame;
}
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_MeshPatternDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_MeshPatternDlg::onSelectionDone
// Purpose : SLOT called when selection changed
void onOk();
bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
QButtonGroup* myTypeGrp;
QRadioButton* mySwitch2d;
SMESHGUI_CreatePatternDlg* myCreationDlg;
SMESH::SMESH_Pattern_var myPattern;
SALOME_Actor* myPreviewActor;
+
+ QString myHelpFileName;
};
#endif
#include "SMDS_MeshNode.hxx"
#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Application.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewModel.h"
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+ myHelpFileName = "/files/displacing_nodes.htm";
+
Init();
}
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
+ aLay->addWidget(myHelpBtn);
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
return aFrame;
}
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_MoveNodesDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_MoveNodesDlg::onTextChange
// Purpose :
void onOk();
bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
QLineEdit* myId;
SMESHGUI_SpinBox* myX;
SALOME_Actor* myPreviewActor;
SMESH_Actor* myMeshActor;
bool myBusy;
+
+ QString myHelpFileName;
};
#endif // DIALOGBOX_MOVE_NODES_H
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Application.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
myOkBtn = new QPushButton (tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton (tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton (tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
+ aLay->addWidget(myHelpBtn);
return aFrame;
}
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_MultiEditDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_MultiEditDlg::onSelectionDone
// Purpose : SLOT called when selection changed
SMESHGUI_MultiEditDlg(theModule, SMESHGUI_FaceFilter, true, theName)
{
setCaption(tr("CAPTION"));
+ myHelpFileName = "/files/changing_orientation_of_elements.htm";
}
SMESHGUI_ChangeOrientationDlg::~SMESHGUI_ChangeOrientationDlg()
myMaxAngleSpin->SetValue(30.0);
myCriterionGrp->show();
+
+ myHelpFileName = "/files/uniting_a_set_of_triangles.htm";
}
SMESHGUI_UnionOfTrianglesDlg::~SMESHGUI_UnionOfTrianglesDlg()
connect(myGroupChoice , SIGNAL(clicked(int)) , this, SLOT(onCriterionRB()));
connect(myComboBoxFunctor, SIGNAL(activated(int)) , this, SLOT(onPreviewChk()));
connect(this , SIGNAL(ListContensChanged()), this, SLOT(onPreviewChk()));
+
+ myHelpFileName = "/files/cutting_quadrangles.htm";
}
SMESHGUI_CuttingOfQuadsDlg::~SMESHGUI_CuttingOfQuadsDlg()
void onOk();
virtual bool onApply();
virtual void onClose();
+ void onHelp();
void onDeactivate();
void onSelectionDone();
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
SMESH_Actor* myActor;
SMESH::SMESH_Mesh_var myMesh;
int myFilterType;
bool myBusy;
int myEntityType;
+
+ QString myHelpFileName;
};
/*!
#include "SUIT_Desktop.h"
#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SVTK_Selector.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0);
+ myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_nodes";
+
/* Initialisation and display */
Init();
}
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SpinBox_X, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
connect(SpinBox_Y, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_NodesDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
QPushButton* buttonApply;
QPushButton* buttonOk;
QPushButton* buttonCancel;
+ QPushButton* buttonHelp;
+
+ QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply();
+ void ClickOnHelp();
void DeactivateActiveDialog() ;
void ActivateThisDialog() ;
void SelectionIntoArgument() ;
#include <SMESHGUI_Dialog.h>
#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
+#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
SMESHGUI_Operation::SMESHGUI_Operation()
: LightApp_Operation()
{
+ myHelpFileName = "";
}
//=======================================================================
disconnect( dlg(), SIGNAL( dlgApply() ), this, SLOT( onApply() ) );
disconnect( dlg(), SIGNAL( dlgCancel() ), this, SLOT( onCancel() ) );
disconnect( dlg(), SIGNAL( dlgClose() ), this, SLOT( onCancel() ) );
+ disconnect( dlg(), SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
if( dlg()->testButtonFlags( QtxDialog::OK ) )
connect( dlg(), SIGNAL( dlgOk() ), this, SLOT( onOk() ) );
if( dlg()->testButtonFlags( QtxDialog::Cancel ) )
connect( dlg(), SIGNAL( dlgCancel() ), this, SLOT( onCancel() ) );
+
+ if( dlg()->testButtonFlags( QtxDialog::Help ) )
+ connect( dlg(), SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
//if( dlg()->testButtonFlags( QtxDialog::Close ) )
//if dialog hasn't close, cancel, no and etc buttons, dlgClose will be emitted when dialog is closed not by OK
abort();
}
+//=======================================================================
+// name : onHelp
+// Purpose :
+//=======================================================================
+void SMESHGUI_Operation::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(getSMESHGUI() ? app->moduleName(getSMESHGUI()->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"));
+ }
+}
+
//=======================================================================
// name : initDialog
// Purpose :
virtual bool isValid( SUIT_Operation* ) const;
+ QString myHelpFileName;
+
protected slots:
virtual void onOk();
virtual bool onApply();
virtual void onCancel();
+ void onHelp();
};
#endif
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESHGUI_PrecisionDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#include "SMESHGUI_PrecisionDlg.h"
-
-#include "SMESHGUI.h"
-#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_Utils.h"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-
-#include <qgroupbox.h>
-#include <qpushbutton.h>
-#include <qcheckbox.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-
-#define SPACING 5
-#define MARGIN 10
-#define DEFAULT_VAL 10
-#define RANGE 128
-
-/*!
- * Class : SMESHGUI_PrecisionDlg
- * Description : Dialog to specify precision of mesh quality controls
- */
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg
-// Purpose : Constructor
-//=======================================================================
-SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg ( SMESHGUI* theModule )
- : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_PrecisionDlg", true,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- mySMESHGUI( theModule )
-{
- setCaption(tr("CAPTION"));
-
- QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
-
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
-
- aDlgLay->addWidget(aMainFrame);
- aDlgLay->addWidget(aBtnFrame);
-
- aDlgLay->setStretchFactor(aMainFrame, 1);
-
- setMinimumWidth((int)(QFontMetrics(font()).width(tr("CAPTION")) * 1.5));
-
- Init();
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::~SMESHGUI_PrecisionDlg
-// Purpose : Destructor
-//=======================================================================
-SMESHGUI_PrecisionDlg::~SMESHGUI_PrecisionDlg()
-{
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::createButtonFrame
-// Purpose : Create frame containing buttons
-//=======================================================================
-QFrame* SMESHGUI_PrecisionDlg::createButtonFrame (QWidget* theParent)
-{
- QGroupBox* aGrp = new QGroupBox (1, Qt::Vertical, theParent);
- aGrp->setFrameStyle(QFrame::NoFrame);
- aGrp->setInsideMargin(0);
-
- myOKBtn = new QPushButton (tr("SMESH_BUT_OK"), aGrp);
-
- QLabel* aLbl = new QLabel (aGrp);
- aLbl->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-
- myCancelBtn = new QPushButton (tr("SMESH_BUT_CANCEL"), aGrp);
-
- connect(myOKBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCancelBtn, SIGNAL(clicked()), SLOT(onClose()));
-
- return aGrp;
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg:: createMainFrame
-// Purpose : Create frame containing dialog's input fields
-//=======================================================================
-QFrame* SMESHGUI_PrecisionDlg::createMainFrame (QWidget* theParent)
-{
- QGroupBox* aGrp = new QGroupBox(2, Qt::Horizontal, theParent);
- new QLabel (tr("PRECISION"), aGrp);
- mySpinBox = new QSpinBox (0, RANGE, 1, aGrp);
- myNotUseChk = new QCheckBox (tr("NOT_USE"), aGrp);
-
- connect(myNotUseChk, SIGNAL(toggled(bool)), SLOT(onNotUse()));
-
- return aGrp;
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::Init
-// Purpose : Initialize dialog fields
-//=======================================================================
-void SMESHGUI_PrecisionDlg::Init()
-{
- bool isOk = false;
- int aVal = DEFAULT_VAL;
- SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- if (mgr && mgr->hasValue("SMESH", "controls_precision")) {
- QString aStr = mgr->stringValue("SMESH", "controls_precision");
- aVal = aStr.toInt(&isOk);
- }
-
- mySpinBox->setValue(isOk ? aVal : DEFAULT_VAL);
- myNotUseChk->setChecked(!isOk);
-
- onNotUse();
-
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::onOk
-// Purpose : SLOT. Called when OK button pressed
-//=======================================================================
-void SMESHGUI_PrecisionDlg::onOk()
-{
- SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- if (myNotUseChk->isChecked()) {
- if (mgr) {
- mgr->remove("SMESH", "controls_precision");
- }
- SMESH::SetControlsPrecision(-1);
- } else {
- mySpinBox->clearFocus();
- int aVal = mySpinBox->value();
- if (mgr) {
- mgr->setValue("SMESH", "controls_precision", QString("%1").arg(aVal));
- }
- SMESH::SetControlsPrecision(aVal);
- }
-
- disconnect(mySMESHGUI, 0, this, 0);
- mySMESHGUI->ResetState() ;
- accept();
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::onClose
-// Purpose : SLOT. Called when "Cancel" button pressed
-//=======================================================================
-void SMESHGUI_PrecisionDlg::onClose()
-{
- disconnect( mySMESHGUI, 0, this, 0);
- reject();
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::closeEvent
-// Purpose :
-//=======================================================================
-void SMESHGUI_PrecisionDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
-//=======================================================================
-// name : SMESHGUI_PrecisionDlg::onNotUse
-// Purpose : SLOT. Called when state of "Do not use" check box changed
-//=======================================================================
-void SMESHGUI_PrecisionDlg::onNotUse()
-{
- mySpinBox->setEnabled(!myNotUseChk->isChecked());
-}
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// 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.
-//
-// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESHGUI_PrecisionDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-
-#ifndef SMESHGUI_PrecisionDlg_H
-#define SMESHGUI_PrecisionDlg_H
-
-#include <qdialog.h>
-
-class QSpinBox;
-class QPushButton;
-class QCheckBox;
-class QFrame;
-class SMESHGUI;
-
-/*
- Class : SMESHGUI_PrecisionDlg
- Description : Dialog to specify precision of mesh quality controls
-*/
-
-class SMESHGUI_PrecisionDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_PrecisionDlg( SMESHGUI* );
-
- virtual ~SMESHGUI_PrecisionDlg();
-
- void Init();
-
-private slots:
-
- void onOk();
- void onClose();
- void onNotUse();
-
-private:
-
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame( QWidget* );
- void closeEvent( QCloseEvent* );
-
-private:
- SMESHGUI* mySMESHGUI;
- QSpinBox* mySpinBox;
- QPushButton* myOKBtn;
- QPushButton* myCancelBtn;
- QCheckBox* myNotUseChk;
-
-};
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewModel.h"
#include "SALOME_ListIO.hxx"
#include "SalomeApp_Tools.h"
+#include "SalomeApp_Application.h"
#include "utilities.h"
// OCCT Includes
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupC1, 1, 0);
+ myHelpFileName = "/files/removing_nodes_and_elements.htm#?";
+
Init(); /* Initialisations */
}
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
return;
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_RemoveElementsDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupC1;
QLabel* TextLabelC1A1;
QPushButton* SelectButtonC1A1;
QLineEdit* LineEditC1A1;
+ QString myHelpFileName;
+
private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewModel.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupC1, 1, 0);
+ myHelpFileName = "/files/removing_nodes_and_elements.htm#?";
+
Init(); /* Initialisations */
}
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_RemoveNodesDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupC1;
QLabel* TextLabelC1A1;
QPushButton* SelectButtonC1A1;
QLineEdit* LineEditC1A1;
+ QString myHelpFileName;
+
private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SALOME_ListIO.hxx"
/***************************************************************/
GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- if (unit == 0)
+ if (unit == 0) {
GroupConstructors->setTitle(tr("SMESH_NODES" ));
- else if (unit == 1)
+ myHelpFileName = "/files/renumbering_nodes_and_elements.htm#?";
+ }
+ else if (unit == 1) {
GroupConstructors->setTitle(tr("SMESH_ELEMENTS" ));
+ myHelpFileName = "/files/renumbering_nodes_and_elements.htm#?";
+ }
GroupConstructors->setExclusive(TRUE);
GroupConstructors->setColumnLayout(0, Qt::Vertical);
GroupConstructors->layout()->setSpacing(0);
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_RenumberingDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupMesh;
QLabel* TextLabelMesh;
QPushButton* SelectButton;
QLineEdit* LineEditMesh;
+
+ QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SMDS_Mesh.hxx"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+ myHelpFileName = "revolution.htm";
+
Init();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_RevolutionDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* GroupAxis;
QLabel* TextLabelElements;
QLabel* TextLabelTolerance;
SMESHGUI_SpinBox* SpinBox_Tolerance;
+ QString myHelpFileName;
+
private slots:
void ConstructorsClicked (int constructorId);
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog();
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE"));
buttonCancel->setAutoDefault(TRUE);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+ myHelpFileName = "/files/rotation.htm";
+
Init();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_RotationDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* GroupAxis;
QLabel* TextLabelElements;
SMESHGUI_SpinBox* SpinBox_Angle;
QCheckBox* CheckBoxCopy;
+ QString myHelpFileName;
+
private slots:
void ConstructorsClicked (int constructorId);
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog();
if ( !io.IsNull() ) {
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io) ; // m,sm,gr->m
if ( !mesh->_is_nil() ) {*/
- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ) );
+ _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).latin1() );
//FindSObject( mesh );
if ( so ) {
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
#include "SMESH_Actor.h"
#include "SMDS_Mesh.hxx"
+#include "SUIT_Session.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
#include "SUIT_MessageBox.h"
+#include "SalomeApp_Application.h"
+
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_Selector.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE"));
buttonCancel->setAutoDefault(TRUE);
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+ myHelpFileName = "/files/sewing_meshes.htm";
+
Init();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectButton1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_SewingDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* SubGroup1;
QGroupBox* SubGroup2;
QCheckBox* CheckBoxPolygons;
QCheckBox* CheckBoxPolyedrs;
+ QString myHelpFileName;
+
private slots:
void ConstructorsClicked(int constructorId);
void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument(bool isSelectionChanged = true) ;
void DeactivateActiveDialog() ;
#include "SMDS_Mesh.hxx"
#include "LightApp_SelectionMgr.h"
+#include "SalomeApp_Application.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_MessageBox.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewWindow.h"
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
+ aLay->addWidget(myHelpBtn);
return aFrame;
}
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_SingleEditDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : findTriangles()
//purpose : find triangles sharing theNode1-theNode2 link
: SMESHGUI_SingleEditDlg(theModule,theName)
{
setCaption(tr("CAPTION"));
+ myHelpFileName = "/files/diagonal_iversion_of_elements.htm";
}
SMESHGUI_TrianglesInversionDlg::~SMESHGUI_TrianglesInversionDlg()
: SMESHGUI_SingleEditDlg(theModule,theName)
{
setCaption(tr("CAPTION"));
+ myHelpFileName = "/files/uniting_two_triangles.htm";
}
SMESHGUI_UnionOfTwoTrianglesDlg::~SMESHGUI_UnionOfTwoTrianglesDlg()
void onOk();
virtual bool onApply();
void onClose();
+ void onHelp();
void onDeactivate();
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
QLineEdit* myEdge;
SMESH_Actor* myActor;
LightApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI;
+
+ QString myHelpFileName;
};
/*!
#include "SUIT_ResourceMgr.h"
#include "SUIT_OverrideCursor.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
+#include "SalomeApp_Application.h"
+
#include "SVTK_ViewModel.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewWindow.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+ myHelpFileName = "/files/smoothing.htm";
+
Init();
/***************************************************************/
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_SmoothingDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QLabel* TextLabelElements;
QPushButton* SelectElementsButton;
QLabel* TextLabelAspectRatio;
SMESHGUI_SpinBox* SpinBox_AspectRatio;
QCheckBox * CheckBoxParametric;
+
+ QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SALOME_ListIO.hxx"
myButtonsGroupLayout->setAlignment(Qt::AlignTop);
myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11);
- // buttons --> OK button
+ // buttons --> OK and Help buttons
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn");
myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE);
- myButtonsGroupLayout->addStretch();
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn");
+ myHelpBtn->setAutoDefault(TRUE);
+
myButtonsGroupLayout->addWidget(myOkBtn);
myButtonsGroupLayout->addStretch();
+ myButtonsGroupLayout->addWidget(myHelpBtn);
aDlgLayout->addWidget(myButtonsGroup, 2, 0);
// connect signals
connect( myOkBtn, SIGNAL(clicked()), this, SLOT(close()));
+ connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
connect( mySelectBtn, SIGNAL(clicked()), this, SLOT(onStartSelection()));
connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
myMeshFilter = new SMESH_TypeFilter (MESH);
mySelectionMgr->installFilter(myMeshFilter);
onSelectionChanged();
+
+ myHelpFileName = "/files/viewing_mesh_info.htm#?";
}
//=================================================================================
onSelectionChanged();
myStartSelection = true;
}
+
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_StandardMeshInfosDlg::onHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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"));
+ }
+}
void DeactivateActiveDialog() ;
void ActivateThisDialog();
void onStartSelection();
+ void onHelp();
private:
SMESHGUI* mySMESHGUI;
QGroupBox* myButtonsGroup;
QPushButton* myOkBtn;
+ QPushButton* myHelpBtn;
+
+ QString myHelpFileName;
};
#endif // SMESHGUI_STANDARDMESHINFOSDLG_H
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
+ myHelpFileName = "/files/symmetry.htm";
+
Init();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_SymmetryDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* GroupMirror;
QLabel* TextLabelElements;
SMESHGUI_SpinBox* SpinBox_DZ;
QCheckBox* CheckBoxCopy;
+
+ QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_Selection.h"
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter(aListOfFilters, SMESH_LogicalFilter::LO_OR);
+ myHelpFileName = "/files/translation.htm";
+
Init();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_TranslationDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 :
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
+ QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QLabel* TextLabelElements;
QPushButton* SelectElementsButton;
QLabel* TextLabel2_3;
SMESHGUI_SpinBox* SpinBox2_3;
QCheckBox* CheckBoxCopy;
+
+ QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
+ void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;
#include "SUIT_Desktop.h"
#include "SUIT_OverrideCursor.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SALOME_InteractiveObject.hxx"
#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SVTK_ViewWindow.h"
buttonOk->setText(tr("SMESH_BUT_CLOSE"));
buttonOk->setAutoDefault(TRUE);
buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0);
- GroupButtonsLayout->addWidget(buttonOk, 0, 1);
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP"));
+ buttonHelp->setAutoDefault(TRUE);
+
+ //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0);
+ GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+ GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 2);
+ //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
SMESHGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
SMESHGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
// signals and slots connections : after ValueHasChanged()
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency()));
connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
+ myHelpFileName = "transparency.htm";
+
this->show();
}
close();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_TransparencyDlg::ClickOnHelp()
+{
+ SalomeApp_Application* app = (SalomeApp_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 : SetTransparency()
// purpose : Called when value of slider change
SVTK_ViewWindow* myViewWindow;
QPushButton* buttonOk;
+ QPushButton* buttonHelp;
QLabel* TextLabelOpaque;
QLabel* ValueLab;
QLabel* TextLabelTransparent;
QSlider* Slider1;
+ QString myHelpFileName;
+
public slots:
void ClickOnOk();
+ void ClickOnHelp();
void ValueHasChanged();
void SetTransparency();
void onSelectionChanged();
#include <qxml.h>
#include <map>
+#include <list>
class SMESHGUI_XmlHandler : public QXmlDefaultHandler
{
msgid "SMESH_BUT_CANCEL"
msgstr "&Cancel"
+#Help
+msgid "SMESH_BUT_HELP"
+msgstr "&Help"
+
#Add
msgid "SMESH_BUT_ADD"
msgstr "A&dd"