Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SALOME internationalization: add textual resources for French language
[modules/smesh.git]
/
src
/
SMESHGUI
/
SMESHGUI_MeshPatternDlg.cxx
diff --git
a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
index 820b2ec91e8b08caa1c2f7704082165ae8f63ace..2f3a7a2350c2b2fd7e8f1178a1c9c7a9fdc0bc05 100755
(executable)
--- a/
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
+++ b/
src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
08
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
10
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-19,6
+19,7
@@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshPatternDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshPatternDlg.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
@@
-420,10
+421,10
@@
bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
ok = myNode2->isValid( msg, theMess ) && ok;
if( !ok ) {
if( theMess ) {
ok = myNode2->isValid( msg, theMess ) && ok;
if( !ok ) {
if( theMess ) {
- QString str( tr( "SMESH_INCORRECT_INPUT" ) );
- if ( !msg.isEmpty() )
- str += "\n" + msg;
- SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+
if ( !msg.isEmpty() )
+
str += "\n" + msg;
+
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;
}
}
return false;
}
@@
-440,14
+441,14
@@
bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
{
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
{
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"));
+
tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
if ( myName->text().isEmpty() ) {
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
return false;
}
if ( myName->text().isEmpty() ) {
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"));
+
tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
return false;
}
@@
-473,16
+474,16
@@
bool SMESHGUI_MeshPatternDlg::onApply()
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
- varIds[i++] = *it;
+
varIds[i++] = *it;
myType == Type_2d
myType == Type_2d
- ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
- : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
+
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
QStringList aParameters;
aParameters << myNode1->text();
if(myType == Type_3d )
QStringList aParameters;
aParameters << myNode1->text();
if(myType == Type_3d )
- aParameters << myNode2->text();
- myMesh->SetParameters(
SMESHGUI::JoinObjectParameters(aParameters
) );
+
aParameters << myNode2->text();
+ myMesh->SetParameters(
aParameters.join(":").toLatin1().constData(
) );
} else { // Applying a pattern to geometrical object
if (myType == Type_2d)
} else { // Applying a pattern to geometrical object
if (myType == Type_2d)
@@
-497,18
+498,19
@@
bool SMESHGUI_MeshPatternDlg::onApply()
//mySelectionMgr->clearSelected();
bool autoUpdate = SMESHGUI::automaticUpdate();
if (!isRefine() && autoUpdate) {
//mySelectionMgr->clearSelected();
bool autoUpdate = SMESHGUI::automaticUpdate();
if (!isRefine() && autoUpdate) {
- _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
- SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
- if (!anActor) {
- anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
- if (anActor) {
- SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
- SMESH::FitAll();
- }
- }
+
_PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
+
SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
+
if (!anActor) {
+
anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
+
if (anActor) {
+
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
+
SMESH::FitAll();
+
}
+
}
}
mySelectionMgr->clearSelected();
SMESH::UpdateView();
}
mySelectionMgr->clearSelected();
SMESH::UpdateView();
+ SMESHGUI::Modified();
mySMESHGUI->updateObjBrowser(true);
mySMESHGUI->updateObjBrowser(true);
@@
-517,7
+519,7
@@
bool SMESHGUI_MeshPatternDlg::onApply()
return true;
} else {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
return true;
} else {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"));
+
tr("SMESH_OPERATION_FAILED"));
return false;
}
} catch (const SALOME::SALOME_Exception& S_ex) {
return false;
}
} catch (const SALOME::SALOME_Exception& S_ex) {
@@
-565,17
+567,17
@@
void SMESHGUI_MeshPatternDlg::onHelp()
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+
QString platform;
#ifdef WIN32
#ifdef WIN32
- platform = "winapplication";
+
platform = "winapplication";
#else
#else
- platform = "application";
+
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+
tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+
arg(app->resourceMgr()->stringValue("ExternalBrowser",
+
platform)).
+
arg(myHelpFileName));
}
}
}
}
@@
-593,7
+595,7
@@
void SMESHGUI_MeshPatternDlg::onSelectionDone()
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
- return;
+
return;
// Retrieve mesh from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
// Retrieve mesh from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
@@
-624,11
+626,11
@@
void SMESHGUI_MeshPatternDlg::onSelectionDone()
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
- return;
+
return;
QString anIds;
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
QString anIds;
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
- anIds = "";
+
anIds = "";
myBusy = true;
mySelEdit[ Ids ]->setText(anIds);
myBusy = true;
mySelEdit[ Ids ]->setText(anIds);
@@
-638,7
+640,7
@@
void SMESHGUI_MeshPatternDlg::onSelectionDone()
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
if (aList.Extent() != 1)
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
if (aList.Extent() != 1)
- return;
+
return;
// Get geom object from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
// Get geom object from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
@@
-809,14
+811,14
@@
void SMESHGUI_MeshPatternDlg::onOpen()
QFile aFile(fName);
if (!aFile.open(QIODevice::ReadOnly)) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
QFile aFile(fName);
if (!aFile.open(QIODevice::ReadOnly)) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("ERROR_OF_OPENING"));
+
tr("ERROR_OF_OPENING"));
return;
}
QByteArray aDataArray = aFile.readAll();
if (aDataArray.isEmpty()) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
return;
}
QByteArray aDataArray = aFile.readAll();
if (aDataArray.isEmpty()) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("ERROR_OF_READING"));
+
tr("ERROR_OF_READING"));
return;
}
return;
}
@@
-1046,11
+1048,11
@@
void SMESHGUI_MeshPatternDlg::updateWgState()
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
if (keyPoints->length()) {
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
if (keyPoints->length()) {
- myNode1->setEnabled(true);
- myNode2->setEnabled(true);
- myNode1->setRange(1, keyPoints->length());
- myNode2->setRange(1, keyPoints->length());
- return;
+
myNode1->setEnabled(true);
+
myNode2->setEnabled(true);
+
myNode1->setRange(1, keyPoints->length());
+
myNode2->setRange(1, keyPoints->length());
+
return;
}
}
}
}
@@
-1075,13
+1077,13
@@
void SMESHGUI_MeshPatternDlg::activateSelection()
if (myType == Type_2d)
{
if (myType == Type_2d)
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
+
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+
aViewWindow->SetSelectionMode(FaceSelection);
}
else
{
}
else
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+
aViewWindow->SetSelectionMode(CellSelection);
}
}
else {
}
}
else {
@@
-1146,7
+1148,7
@@
bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName)
} catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
} catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("ERROR_OF_LOADING") );
+
tr("ERROR_OF_LOADING") );
return false;
}
}
return false;
}
}
@@
-1229,13
+1231,13
@@
vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid()
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
- varIds[i++] = *it;
+
varIds[i++] = *it;
pnts = myType == Type_2d
pnts = myType == Type_2d
- ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
- : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
+
: myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
} else {
pnts = myType == Type_2d
} else {
pnts = myType == Type_2d
- ? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
+
? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
: myPattern->ApplyTo3DBlock(myGeomObj[ Object ], myGeomObj[ Vertex1 ], myGeomObj[ Vertex2 ]);
}
: myPattern->ApplyTo3DBlock(myGeomObj[ Object ], myGeomObj[ Vertex1 ], myGeomObj[ Vertex2 ]);
}
@@
-1380,7
+1382,7
@@
void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText)
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
- newIndices.Add(e->GetID());
+
newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
}
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))