1) Add references into SMESH dialogs to the corresponding help pages from GUI documentation.

2) Remove unused classes.
This commit is contained in:
mkr 2006-03-24 14:10:23 +00:00
parent 0f5a1c3229
commit dedd4df95a
79 changed files with 1075 additions and 1837 deletions

View File

@ -70,8 +70,6 @@ LIB_SRC = SMESHGUI.cxx \
SMESHGUI_Swig.cxx \
SMESHGUI_MoveNodesDlg.cxx \
SMESHGUI_AddMeshElementDlg.cxx \
SMESHGUI_EditHypothesesDlg.cxx \
SMESHGUI_CreateHypothesesDlg.cxx \
SMESHGUI_XmlHandler.cxx \
SMESHGUI_Filter.cxx \
SMESHGUI_FilterDlg.cxx \
@ -98,7 +96,6 @@ LIB_SRC = SMESHGUI.cxx \
SMESHGUI_FilterUtils.cxx \
SMESHGUI_PatternUtils.cxx \
SMESHGUI_HypothesesUtils.cxx \
SMESHGUI_PrecisionDlg.cxx \
SMESHGUI_VTKUtils.cxx \
SMESHGUI_Selection.cxx \
SMESHGUI_CreatePolyhedralVolumeDlg.cxx \
@ -131,8 +128,6 @@ LIB_MOC = \
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 \
@ -148,7 +143,6 @@ LIB_MOC = \
SMESHGUI_TranslationDlg.h \
SMESHGUI_SymmetryDlg.h \
SMESHGUI_SewingDlg.h \
SMESHGUI_PrecisionDlg.h \
SMESHGUI_MergeNodesDlg.h \
SMESHGUI_EditMeshDlg.h \
SMESHGUI_CreatePolyhedralVolumeDlg.h \

View File

@ -42,8 +42,6 @@
#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"
@ -62,7 +60,6 @@
#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"

View File

@ -39,6 +39,7 @@
#include "SMESH_Actor.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SVTK_Selection.h"
#include "SVTK_Selector.h"
@ -243,20 +244,34 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
}
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));
@ -326,6 +341,11 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
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);
/***************************************************************/
@ -400,6 +420,7 @@ void SMESHGUI_AddMeshElementDlg::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(SelectButtonC1A1, SIGNAL(clicked()), SLOT(SetEditCurrentArgument()));
connect(LineEditC1A1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
@ -503,6 +524,23 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
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 :

View File

@ -106,6 +106,7 @@ private:
QPushButton * buttonOk;
QPushButton * buttonCancel;
QPushButton * buttonApply;
QPushButton * buttonHelp;
QGroupBox * GroupC1;
QLabel * TextLabelC1A1;
QPushButton * SelectButtonC1A1;
@ -113,11 +114,14 @@ private:
QCheckBox * Reverse;
QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -11,6 +11,7 @@
#include "SMESH_Actor.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SVTK_Selection.h"
#include "SVTK_Selector.h"
@ -421,6 +422,10 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM
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);
@ -456,30 +461,37 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
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;
}
@ -521,6 +533,7 @@ void SMESHGUI_AddQuadraticElementDlg::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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
@ -636,6 +649,23 @@ void SMESHGUI_AddQuadraticElementDlg::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 :

View File

@ -78,7 +78,10 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton * buttonHelp;
QString myHelpFileName;
private slots:
void onTextChange(const QString&);
@ -89,6 +92,7 @@ private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCorners() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -37,6 +37,7 @@
#include "SUIT_Session.h"
#include "SUIT_OverrideCursor.h"
#include "SUIT_MessageBox.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_InteractiveObject.hxx"
@ -324,6 +325,10 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule,
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);
@ -344,6 +349,8 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule,
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()));
@ -357,6 +364,7 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule,
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 */
@ -425,6 +433,23 @@ void SMESHGUI_ClippingDlg::ClickOnCancel()
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

View File

@ -111,8 +111,10 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
bool myIsSelectPlane;
QString myHelpFileName;
public slots:
@ -126,6 +128,7 @@ public slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
};
#endif // DIALOGBOX_TRANSPARENCYDLG_H

View File

@ -1,296 +0,0 @@
// 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);
}
}

View File

@ -1,94 +0,0 @@
// 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

View File

@ -40,7 +40,10 @@
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
#include "SUIT_FileDlg.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
#include "LightApp_DataOwner.h"
#include "LightApp_SelectionMgr.h"
@ -105,6 +108,8 @@ SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule,
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
myHelpFileName = "pattern_mapping.htm";
Init(theType);
}
@ -185,6 +190,7 @@ QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent)
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
mySaveBtn = new QPushButton(tr("SAVE" ), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame);
myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
@ -194,10 +200,12 @@ QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent)
aLay->addWidget(mySaveBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
return aFrame;
}
@ -463,6 +471,23 @@ void SMESHGUI_CreatePatternDlg::onClose()
emit Close();
}
//=================================================================================
// function : onHelp()
// purpose :
//=================================================================================
void SMESHGUI_CreatePatternDlg::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 : loadFromObject()
// purpose : Load pattern from geom object corresponding to the mesh/submesh

View File

@ -90,6 +90,7 @@ private slots:
void onOk();
void onSave();
void onClose();
void onHelp();
void onDeactivate();
@ -116,6 +117,7 @@ private:
QPushButton* myOkBtn;
QPushButton* mySaveBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
QButtonGroup* myTypeGrp;
QRadioButton* mySwitch2d;
@ -141,6 +143,8 @@ private:
SMESH::SMESH_Pattern_var myPattern;
bool myIsLoaded;
QString myHelpFileName;
};
#endif

View File

@ -40,6 +40,8 @@
#include "SMDS_Mesh.hxx"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Study.h"
@ -249,6 +251,11 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
buttonOk->setAutoDefault( TRUE );
buttonOk->setDefault( TRUE );
GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
buttonHelp->setText(tr("SMESH_BUT_HELP" ));
buttonHelp->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupButtons, 2, 0 );
/***************************************************************/
@ -315,6 +322,8 @@ SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI
RadioButton1->setChecked( TRUE );
mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
myHelpFileName = "/files/adding_nodes_and_elements.htm#?"; //Adding_polyhedrons
Init();
}
@ -348,6 +357,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) );
connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) ) ;
connect(buttonApply, SIGNAL( clicked() ), SLOT(ClickOnApply() ) );
connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp() ) );
connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
connect(SelectElementsButton, SIGNAL( clicked() ), SLOT( SetEditCurrentArgument() ) ) ;
@ -560,6 +570,23 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
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 :

View File

@ -98,6 +98,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupContent;
QLabel* TextLabelIds;
QPushButton* SelectElementsButton;
@ -106,6 +107,8 @@ private:
QLabel* myFacesByNodesLabel;
QPushButton* AddButton;
QPushButton* RemoveButton;
QString myHelpFileName;
public slots:
@ -119,6 +122,7 @@ private:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -34,8 +34,11 @@
#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"
@ -90,6 +93,8 @@ SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
aDlgLay->setStretchFactor(aMainFrame, 1);
myHelpFileName = "deleting_groups.htm";
Init();
}
@ -122,6 +127,7 @@ QFrame* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent)
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);
@ -131,11 +137,13 @@ QFrame* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent)
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;
}
@ -241,6 +249,23 @@ void SMESHGUI_DeleteGroupDlg::onClose()
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

View File

@ -67,6 +67,7 @@ private slots:
void onOk();
bool onApply();
void onClose();
void onHelp();
void onDeactivate();
@ -83,6 +84,7 @@ private:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
QListBox* myListBox;
SMESHGUI* mySMESHGUI;
@ -90,6 +92,8 @@ private:
QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
bool myBlockSelection;
QString myHelpFileName;
};
#endif

View File

@ -44,7 +44,7 @@ class SMESHGUI_Dialog : public LightApp_Dialog
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();

View File

@ -1,960 +0,0 @@
// 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);
}

View File

@ -1,151 +0,0 @@
// 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

View File

@ -28,6 +28,9 @@
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SALOME_ListIO.hxx"
@ -103,6 +106,10 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
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);
@ -149,6 +156,8 @@ SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
DlgLayout->addWidget(GroupMesh, 1, 0);
myHelpFileName = "/files/merging_nodes.htm";// merging_elements.htm
Init(); // Initialisations
}
@ -178,6 +187,7 @@ void SMESHGUI_EditMeshDlg::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(SelectButton, SIGNAL(clicked()), this, SLOT(SelectionIntoArgument()));
@ -242,6 +252,23 @@ void SMESHGUI_EditMeshDlg::ClickOnCancel()
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

View File

@ -80,6 +80,7 @@ class SMESHGUI_EditMeshDlg : public QDialog
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupMesh;
QLabel* TextLabelMesh;
@ -92,10 +93,13 @@ class SMESHGUI_EditMeshDlg : public QDialog
QGridLayout* GroupButtonsLayout;
QGridLayout* GroupMeshLayout;
QString myHelpFileName;
private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SelectionIntoArgument();
void DeactivateActiveDialog();
void ActivateThisDialog();

View File

@ -48,6 +48,9 @@
#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"
@ -295,10 +298,14 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
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);
@ -330,6 +337,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
myElementsFilter = new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
myPathMeshFilter = new SMESH_TypeFilter (MESH);
myHelpFileName = "extrusion_along_a_path.htm";
Init();
/***************************************************************/
@ -337,6 +346,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
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()));
@ -654,6 +664,23 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnOk()
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

View File

@ -142,6 +142,9 @@ private:
QPushButton* OkButton;
QPushButton* ApplyButton;
QPushButton* CloseButton;
QPushButton* HelpButton;
QString myHelpFileName;
protected slots:
void reject();
@ -150,6 +153,7 @@ private slots:
void ConstructorsClicked (int);
void ClickOnOk();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog();

View File

@ -46,6 +46,9 @@
#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"
@ -134,6 +137,10 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
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);
@ -246,6 +253,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
myHelpFileName = "extrusion.htm";
Init();
/***************************************************************/
@ -253,6 +262,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
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()));
@ -438,6 +448,23 @@ void SMESHGUI_ExtrusionDlg::ClickOnCancel()
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 :

View File

@ -111,6 +111,9 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QString myHelpFileName;
private slots:
void ConstructorsClicked (int);
@ -118,6 +121,7 @@ private slots:
void ClickOnOk();
bool ClickOnApply();
void ClickOnCancel();
void ClickOnHelp();
void SetEditCurrentArgument();
void SelectionIntoArgument();
void DeactivateActiveDialog();

View File

@ -44,6 +44,8 @@
#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SalomeApp_Tools.h"
@ -1695,6 +1697,8 @@ void SMESHGUI_FilterDlg::construct (const QValueList<int>& theTypes)
aDlgLay->setStretchFactor(myMainFrame, 1);
myHelpFileName = "selection_filter_library.htm";
Init(myTypes);
}
@ -1790,11 +1794,13 @@ QFrame* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent)
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();
@ -1939,6 +1945,23 @@ void SMESHGUI_FilterDlg::onClose()
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

View File

@ -221,7 +221,7 @@ class SMESHGUI_FilterDlg : public QDialog
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*,
@ -251,6 +251,7 @@ private slots:
void onOk();
bool onApply();
void onClose();
void onHelp();
void onDeactivate();
void onSelectionDone();
void onCriterionChanged (const int, const int);
@ -309,6 +310,8 @@ private:
QMap< int, SMESH::Filter_var > myFilter;
QMap< int, bool > myInsertState;
QMap< int, int > myApplyToState;
QString myHelpFileName;
};
#endif

View File

@ -34,6 +34,9 @@
#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>
@ -144,6 +147,8 @@ void SMESHGUI_FilterLibraryDlg::construct (const QValueList<int>& theTypes,
aDlgLay->setStretchFactor(myMainFrame, 1);
myHelpFileName = "selection_filter_library.htm";
Init(myTypes, myMode);
}
@ -244,11 +249,13 @@ QFrame* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent)
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)
@ -461,6 +468,23 @@ void SMESHGUI_FilterLibraryDlg::onClose()
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

View File

@ -53,7 +53,7 @@ class SMESHGUI_FilterLibraryDlg : public QDialog
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;
@ -94,6 +94,7 @@ private slots:
void onOk();
bool onApply();
void onClose();
void onHelp();
void onDeactivate();
@ -152,6 +153,7 @@ private:
QString myCurrFilterName;
int myCurrFilter;
QString myHelpFileName;
};
#endif

View File

@ -43,8 +43,11 @@
#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"
@ -130,6 +133,9 @@ SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
myCurrentLineEdit = myMeshGroupLine;
setSelectionMode(5);
}
bool isEditMode = !CORBA::is_nil( myGroupOnGeom );
myHelpFileName = isEditMode ? "/files/editing_groups.htm" : "/files/creating_groups.htm";
}
//=================================================================================
@ -332,11 +338,15 @@ void SMESHGUI_GroupDlg::initDialog(bool create)
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);
@ -377,6 +387,7 @@ void SMESHGUI_GroupDlg::initDialog(bool create)
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);
@ -1544,6 +1555,23 @@ void SMESHGUI_GroupDlg::onClose()
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

View File

@ -87,6 +87,7 @@ private slots:
void onOK();
void onClose();
bool onApply();
void onHelp();
void onDeactivate();
void onListSelectionChanged();
@ -167,6 +168,8 @@ private:
SMESHGUI_FilterDlg* myFilterDlg;
bool myCreate, myIsBusy;
QString myHelpFileName;
};
#endif // DIALOGBOX_GROUP_H

View File

@ -35,6 +35,10 @@
#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"
@ -72,9 +76,18 @@ SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode
{
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();
@ -139,6 +152,7 @@ QFrame* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent)
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);
@ -148,11 +162,13 @@ QFrame* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent)
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;
}
@ -291,6 +307,23 @@ void SMESHGUI_GroupOpDlg::onClose()
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

View File

@ -70,6 +70,7 @@ private slots:
void onOk();
bool onApply();
void onClose();
void onHelp();
void onDeactivate();
void onSelectionDone();
@ -87,6 +88,7 @@ private:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
QLineEdit* myNameEdit;
QLineEdit* myEdit1;
@ -104,6 +106,8 @@ private:
SMESH::SMESH_GroupBase_var myGroup1;
SMESH::SMESH_GroupBase_var myGroup2;
QString myHelpFileName;
};
#endif

View File

@ -8,8 +8,15 @@
#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>
@ -344,7 +351,7 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam& , QW
SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent )
: QtxDialog( parent, "", true, true, QtxDialog::OKCancel ),
: QtxDialog( parent, "", true, true ),
myCreator( creator )
{
setMinimumSize( 300, height() );
@ -366,6 +373,29 @@ SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreato
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()
@ -387,6 +417,21 @@ void SMESHGUI_HypothesisDlg::accept()
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 );

View File

@ -113,11 +113,13 @@ public:
protected slots:
virtual void accept();
void onHelp();
private:
SMESHGUI_GenericHypothesisCreator* myCreator;
QVBoxLayout* myLayout;
QLabel *myIconLabel, *myTypeLabel;
QString myHelpFileName;
};
/*!

View File

@ -41,6 +41,10 @@
#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"
@ -129,6 +133,10 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
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);
@ -257,6 +265,7 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
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()));
@ -281,6 +290,8 @@ SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char*
// Init Mesh field from selection
SelectionIntoArgument();
myHelpFileName = "/files/merging_nodes.htm";
}
//=================================================================================
@ -364,6 +375,23 @@ void SMESHGUI_MergeNodesDlg::ClickOnCancel()
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 :

View File

@ -98,6 +98,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupMesh;
QGroupBox* GroupCoincident;
QGroupBox* GroupEdit;
@ -112,12 +113,15 @@ private:
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();

View File

@ -34,8 +34,11 @@
#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"
@ -344,12 +347,15 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule,
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);
@ -359,6 +365,7 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule,
// 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()));
@ -368,6 +375,8 @@ SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule,
// init dialog with current selection
onSelectionChanged();
myHelpFileName = "/files/viewing_mesh_info.htm#?";
}
//=================================================================================
@ -524,3 +533,20 @@ void SMESHGUI_MeshInfosDlg::onStartSelection()
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"));
}
}

View File

@ -61,6 +61,7 @@ private slots:
void DeactivateActiveDialog() ;
void ActivateThisDialog();
void onStartSelection();
void onHelp();
private:
SMESHGUI* mySMESHGUI;
@ -104,8 +105,11 @@ private:
QLabel* myGroupType;
QLabel* myGroupNb;
QGroupBox* myButtonsGroup;
QPushButton* myOkBtn;
QGroupBox* myButtonsGroup;
QPushButton* myOkBtn;
QPushButton* myHelpBtn;
QString myHelpFileName;
};
#endif // SMESHGUI_MESHINFOSDLG_H

View File

@ -208,6 +208,11 @@ void SMESHGUI_MeshOp::startOperation()
}
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();
@ -1501,12 +1506,12 @@ void SMESHGUI_MeshOp::onPublishShapeByMeshDlg()
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 );

View File

@ -46,10 +46,13 @@
#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"
@ -129,6 +132,8 @@ SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myHelpFileName = "pattern_mapping.htm";
Init();
}
@ -290,6 +295,7 @@ QFrame* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent)
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);
@ -299,10 +305,12 @@ QFrame* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent)
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;
}
@ -472,6 +480,23 @@ void SMESHGUI_MeshPatternDlg::onClose()
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

View File

@ -82,6 +82,7 @@ private slots:
void onOk();
bool onApply();
void onClose();
void onHelp();
void onDeactivate();
@ -125,6 +126,7 @@ private:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
QButtonGroup* myTypeGrp;
QRadioButton* mySwitch2d;
@ -171,6 +173,8 @@ private:
SMESHGUI_CreatePatternDlg* myCreationDlg;
SMESH::SMESH_Pattern_var myPattern;
SALOME_Actor* myPreviewActor;
QString myHelpFileName;
};
#endif

View File

@ -40,8 +40,11 @@
#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"
@ -114,6 +117,8 @@ SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule,
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myHelpFileName = "/files/displacing_nodes.htm";
Init();
}
@ -129,6 +134,7 @@ QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent)
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);
@ -138,10 +144,12 @@ QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent)
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;
}
@ -331,6 +339,23 @@ void SMESHGUI_MoveNodesDlg::onClose()
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 :

View File

@ -66,6 +66,7 @@ private slots:
void onOk();
bool onApply();
void onClose();
void onHelp();
void onDeactivate();
@ -90,6 +91,7 @@ private:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
QLineEdit* myId;
SMESHGUI_SpinBox* myX;
@ -103,6 +105,8 @@ private:
SALOME_Actor* myPreviewActor;
SMESH_Actor* myMeshActor;
bool myBusy;
QString myHelpFileName;
};
#endif // DIALOGBOX_MOVE_NODES_H

View File

@ -43,8 +43,11 @@
#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"
@ -233,6 +236,7 @@ QFrame* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent)
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);
@ -242,6 +246,7 @@ QFrame* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent)
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
return aFrame;
}
@ -333,6 +338,7 @@ void SMESHGUI_MultiEditDlg::Init()
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()));
@ -474,6 +480,23 @@ void SMESHGUI_MultiEditDlg::onClose()
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
@ -1034,6 +1057,7 @@ SMESHGUI_ChangeOrientationDlg
SMESHGUI_MultiEditDlg(theModule, SMESHGUI_FaceFilter, true, theName)
{
setCaption(tr("CAPTION"));
myHelpFileName = "/files/changing_orientation_of_elements.htm";
}
SMESHGUI_ChangeOrientationDlg::~SMESHGUI_ChangeOrientationDlg()
@ -1072,6 +1096,8 @@ SMESHGUI_UnionOfTrianglesDlg
myMaxAngleSpin->SetValue(30.0);
myCriterionGrp->show();
myHelpFileName = "/files/uniting_a_set_of_triangles.htm";
}
SMESHGUI_UnionOfTrianglesDlg::~SMESHGUI_UnionOfTrianglesDlg()
@ -1110,6 +1136,8 @@ SMESHGUI_CuttingOfQuadsDlg
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()

View File

@ -86,6 +86,7 @@ protected slots:
void onOk();
virtual bool onApply();
virtual void onClose();
void onHelp();
void onDeactivate();
void onSelectionDone();
@ -121,6 +122,7 @@ protected:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
SMESH_Actor* myActor;
SMESH::SMESH_Mesh_var myMesh;
@ -156,6 +158,8 @@ protected:
int myFilterType;
bool myBusy;
int myEntityType;
QString myHelpFileName;
};
/*!

View File

@ -49,6 +49,7 @@
#include "SUIT_Desktop.h"
#include "SalomeApp_Study.h"
#include "SalomeApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SVTK_Selector.h"
@ -256,6 +257,10 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
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);
@ -325,6 +330,8 @@ SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0);
myHelpFileName = "/files/adding_nodes_and_elements.htm#Adding_nodes";
/* Initialisation and display */
Init();
}
@ -364,6 +371,7 @@ void SMESHGUI_NodesDlg::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)));
@ -475,6 +483,23 @@ void SMESHGUI_NodesDlg::ClickOnCancel()
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

View File

@ -101,12 +101,16 @@ private:
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() ;

View File

@ -13,7 +13,9 @@
#include <SMESHGUI_Dialog.h>
#include <SalomeApp_Study.h>
#include <SalomeApp_Application.h>
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
@ -31,6 +33,7 @@
SMESHGUI_Operation::SMESHGUI_Operation()
: LightApp_Operation()
{
myHelpFileName = "";
}
//=======================================================================
@ -62,6 +65,7 @@ void SMESHGUI_Operation::startOperation()
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() ) );
@ -71,6 +75,9 @@ void SMESHGUI_Operation::startOperation()
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
@ -156,6 +163,23 @@ void SMESHGUI_Operation::onCancel()
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 :

View File

@ -47,10 +47,13 @@ protected:
virtual bool isValid( SUIT_Operation* ) const;
QString myHelpFileName;
protected slots:
virtual void onOk();
virtual bool onApply();
virtual void onCancel();
void onHelp();
};
#endif

View File

@ -1,202 +0,0 @@
// 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());
}

View File

@ -1,97 +0,0 @@
// 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

View File

@ -39,6 +39,8 @@
#include "SUIT_ResourceMgr.h"
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewModel.h"
@ -46,6 +48,7 @@
#include "SALOME_ListIO.hxx"
#include "SalomeApp_Tools.h"
#include "SalomeApp_Application.h"
#include "utilities.h"
// OCCT Includes
@ -131,6 +134,10 @@ SMESHGUI_RemoveElementsDlg
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);
@ -177,6 +184,8 @@ SMESHGUI_RemoveElementsDlg
GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupC1, 1, 0);
myHelpFileName = "/files/removing_nodes_and_elements.htm#?";
Init(); /* Initialisations */
}
@ -209,6 +218,7 @@ void SMESHGUI_RemoveElementsDlg::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(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
@ -296,6 +306,23 @@ void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
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 :

View File

@ -94,17 +94,21 @@ private:
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() ;

View File

@ -39,6 +39,10 @@
#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"
@ -130,6 +134,10 @@ SMESHGUI_RemoveNodesDlg
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);
@ -176,6 +184,8 @@ SMESHGUI_RemoveNodesDlg
GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupC1, 1, 0);
myHelpFileName = "/files/removing_nodes_and_elements.htm#?";
Init(); /* Initialisations */
}
@ -208,6 +218,7 @@ void SMESHGUI_RemoveNodesDlg::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(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
@ -294,6 +305,23 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
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 :

View File

@ -97,17 +97,21 @@ private:
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() ;

View File

@ -38,6 +38,9 @@
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SALOME_ListIO.hxx"
@ -92,10 +95,14 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const cha
/***************************************************************/
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);
@ -126,6 +133,10 @@ SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const cha
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);
@ -203,6 +214,7 @@ void SMESHGUI_RenumberingDlg::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(SelectButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
@ -298,6 +310,23 @@ void SMESHGUI_RenumberingDlg::ClickOnCancel()
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

View File

@ -89,10 +89,13 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupMesh;
QLabel* TextLabelMesh;
QPushButton* SelectButton;
QLineEdit* LineEditMesh;
QString myHelpFileName;
private slots:
@ -100,6 +103,7 @@ private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -41,6 +41,10 @@
#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"
@ -131,6 +135,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
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);
@ -311,12 +319,15 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char*
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()));
@ -499,6 +510,23 @@ void SMESHGUI_RevolutionDlg::ClickOnCancel()
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 :

View File

@ -100,6 +100,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* GroupAxis;
QLabel* TextLabelElements;
@ -131,12 +132,15 @@ private:
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();

View File

@ -42,6 +42,9 @@
#include "SUIT_Desktop.h"
#include "SUIT_Session.h"
#include "SUIT_MessageBox.h"
#include "SalomeApp_Application.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewWindow.h"
@ -136,6 +139,10 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
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);
@ -300,12 +307,15 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* nam
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()));
@ -452,6 +462,23 @@ void SMESHGUI_RotationDlg::ClickOnCancel()
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 :

View File

@ -98,6 +98,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* GroupAxis;
QLabel* TextLabelElements;
@ -126,12 +127,15 @@ private:
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();

View File

@ -293,7 +293,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
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 );

View File

@ -36,10 +36,13 @@
#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"
@ -141,6 +144,10 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
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);
@ -286,12 +293,15 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
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()));
@ -601,6 +611,23 @@ void SMESHGUI_SewingDlg::ClickOnCancel()
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 :

View File

@ -94,6 +94,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* SubGroup1;
QGroupBox* SubGroup2;
@ -119,12 +120,15 @@ private:
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() ;

View File

@ -37,9 +37,11 @@
#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"
@ -158,6 +160,7 @@ QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent)
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);
@ -167,6 +170,7 @@ QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent)
aLay->addWidget(myApplyBtn);
aLay->addItem(aSpacer);
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
return aFrame;
}
@ -222,6 +226,7 @@ void SMESHGUI_SingleEditDlg::Init()
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()));
@ -268,6 +273,23 @@ void SMESHGUI_SingleEditDlg::onClose()
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
@ -525,6 +547,7 @@ SMESHGUI_TrianglesInversionDlg
: SMESHGUI_SingleEditDlg(theModule,theName)
{
setCaption(tr("CAPTION"));
myHelpFileName = "/files/diagonal_iversion_of_elements.htm";
}
SMESHGUI_TrianglesInversionDlg::~SMESHGUI_TrianglesInversionDlg()
@ -549,6 +572,7 @@ SMESHGUI_UnionOfTwoTrianglesDlg
: SMESHGUI_SingleEditDlg(theModule,theName)
{
setCaption(tr("CAPTION"));
myHelpFileName = "/files/uniting_two_triangles.htm";
}
SMESHGUI_UnionOfTwoTrianglesDlg::~SMESHGUI_UnionOfTwoTrianglesDlg()

View File

@ -64,6 +64,7 @@ protected slots:
void onOk();
virtual bool onApply();
void onClose();
void onHelp();
void onDeactivate();
@ -85,12 +86,15 @@ protected:
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
QLineEdit* myEdge;
SMESH_Actor* myActor;
LightApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector;
SMESHGUI* mySMESHGUI;
QString myHelpFileName;
};
/*!

View File

@ -45,8 +45,11 @@
#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"
@ -138,6 +141,10 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
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);
@ -267,6 +274,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
myMeshOrSubMeshOrGroupFilter =
new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
myHelpFileName = "/files/smoothing.htm";
Init();
/***************************************************************/
@ -274,6 +283,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* n
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()));
@ -427,6 +437,23 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel()
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 :

View File

@ -100,6 +100,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QLabel* TextLabelElements;
QPushButton* SelectElementsButton;
@ -115,6 +116,8 @@ private:
QLabel* TextLabelAspectRatio;
SMESHGUI_SpinBox* SpinBox_AspectRatio;
QCheckBox * CheckBoxParametric;
QString myHelpFileName;
private slots:
@ -122,6 +125,7 @@ private slots:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -41,6 +41,9 @@
#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"
@ -144,12 +147,15 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul
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);
@ -157,6 +163,7 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul
// 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()));
@ -170,6 +177,8 @@ SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModul
myMeshFilter = new SMESH_TypeFilter (MESH);
mySelectionMgr->installFilter(myMeshFilter);
onSelectionChanged();
myHelpFileName = "/files/viewing_mesh_info.htm#?";
}
//=================================================================================
@ -441,3 +450,20 @@ void SMESHGUI_StandardMeshInfosDlg::onStartSelection()
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"));
}
}

View File

@ -62,6 +62,7 @@ private slots:
void DeactivateActiveDialog() ;
void ActivateThisDialog();
void onStartSelection();
void onHelp();
private:
SMESHGUI* mySMESHGUI;
@ -83,6 +84,9 @@ private:
QGroupBox* myButtonsGroup;
QPushButton* myOkBtn;
QPushButton* myHelpBtn;
QString myHelpFileName;
};
#endif // SMESHGUI_STANDARDMESHINFOSDLG_H

View File

@ -42,6 +42,10 @@
#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"
@ -142,6 +146,10 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
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);
@ -294,12 +302,15 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* nam
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()));
@ -515,6 +526,23 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel()
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 :

View File

@ -100,6 +100,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QGroupBox* GroupMirror;
QLabel* TextLabelElements;
@ -125,6 +126,8 @@ private:
SMESHGUI_SpinBox* SpinBox_DZ;
QCheckBox* CheckBoxCopy;
QString myHelpFileName;
private slots:
@ -132,6 +135,7 @@ private:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -42,6 +42,10 @@
#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"
@ -132,6 +136,10 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
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);
@ -274,12 +282,15 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const cha
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()));
@ -477,6 +488,23 @@ void SMESHGUI_TranslationDlg::ClickOnCancel()
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 :

View File

@ -98,6 +98,7 @@ private:
QPushButton* buttonOk;
QPushButton* buttonCancel;
QPushButton* buttonApply;
QPushButton* buttonHelp;
QGroupBox* GroupArguments;
QLabel* TextLabelElements;
QPushButton* SelectElementsButton;
@ -120,6 +121,8 @@ private:
QLabel* TextLabel2_3;
SMESHGUI_SpinBox* SpinBox2_3;
QCheckBox* CheckBoxCopy;
QString myHelpFileName;
private slots:
@ -127,6 +130,7 @@ private:
void ClickOnOk();
void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument() ;
void SelectionIntoArgument() ;
void DeactivateActiveDialog() ;

View File

@ -35,12 +35,15 @@
#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"
@ -129,9 +132,15 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule,
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);
@ -141,11 +150,14 @@ SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule,
// 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();
}
@ -167,6 +179,23 @@ void SMESHGUI_TransparencyDlg::ClickOnOk()
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

View File

@ -63,14 +63,18 @@ private :
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();

View File

@ -32,6 +32,7 @@
#include <qxml.h>
#include <map>
#include <list>
class SMESHGUI_XmlHandler : public QXmlDefaultHandler
{

View File

@ -52,6 +52,10 @@ msgstr "&No"
msgid "SMESH_BUT_CANCEL"
msgstr "&Cancel"
#Help
msgid "SMESH_BUT_HELP"
msgstr "&Help"
#Add
msgid "SMESH_BUT_ADD"
msgstr "A&dd"