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
INT PAL 0052683: Parameter "Color group" in the "Create Group" dialog box is empty
[modules/smesh.git]
/
src
/
SMESHGUI
/
SMESHGUI_GroupDlg.cxx
diff --git
a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx
b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx
index 60095ebe2a7651a7ec543801ba34316e50278c05..4b33a586b5462396fb917097c7853be4b042fdcf 100644
(file)
--- a/
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
+++ b/
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
5
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
@@
-61,7
+61,6
@@
#include <LightApp_SelectionMgr.h>
#include <SALOME_ListIO.hxx>
#include <LightApp_SelectionMgr.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SVTK_ViewWindow.h>
#include <SVTK_ViewWindow.h>
@@
-520,7
+519,7
@@
QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
bool isUnique = false;
while (!isUnique) {
aName = theOperation + "_" + QString::number(++aNumber);
bool isUnique = false;
while (!isUnique) {
aName = theOperation + "_" + QString::number(++aNumber);
- isUnique = (aSet.count(
aName.toUtf8().data(
)) == 0);
+ isUnique = (aSet.count(
std::string(SMESH::toUtf8(aName)
)) == 0);
}
return aName;
}
return aName;
@@
-536,7
+535,7
@@
void SMESHGUI_GroupDlg::setDefaultName() const
do
{
aResName = aPrefix + QString::number( i++ );
do
{
aResName = aPrefix + QString::number( i++ );
- anObj = aStudy->FindObject(
aResName.toUtf8().data(
) );
+ anObj = aStudy->FindObject(
SMESH::toUtf8(aResName
) );
}
while ( anObj );
myName->setText(aResName);
}
while ( anObj );
myName->setText(aResName);
@@
-595,14
+594,14
@@
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
myNameChanged = true;
myName->blockSignals(true);
myNameChanged = true;
myName->blockSignals(true);
- myName->setText(
QString
::fromUtf8(theGroup->GetName()));
+ myName->setText(
SMESH
::fromUtf8(theGroup->GetName()));
myName->blockSignals(false);
myName->home(false);
SALOMEDS::Color aColor = theGroup->GetColor();
setGroupColor( aColor );
myName->blockSignals(false);
myName->home(false);
SALOMEDS::Color aColor = theGroup->GetColor();
setGroupColor( aColor );
- myMeshGroupLine->setText(
QString
::fromUtf8(theGroup->GetName()));
+ myMeshGroupLine->setText(
SMESH
::fromUtf8(theGroup->GetName()));
int aType = 0;
switch(theGroup->GetType()) {
int aType = 0;
switch(theGroup->GetType()) {
@@
-687,7
+686,7
@@
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
{
myNameChanged = true;
myName->blockSignals(true);
{
myNameChanged = true;
myName->blockSignals(true);
- myName->setText(
QString
::fromUtf8(theGroup->GetName()));
+ myName->setText(
SMESH
::fromUtf8(theGroup->GetName()));
myName->blockSignals(false);
}
myName->blockSignals(false);
}
@@
-731,6
+730,17
@@
void SMESHGUI_GroupDlg::updateButtons()
}
}
}
}
+ bool meshHasGeom = ( myMesh->_is_nil() || myMesh->HasShapeToMesh() );
+ if ( myGrpTypeId != 1 )
+ {
+ myGrpTypeGroup->button(1)->setEnabled( meshHasGeom );
+ }
+ else
+ {
+ myGeomGroupBtn->setEnabled( meshHasGeom );
+ myGeomGroupLine->setEnabled( meshHasGeom );
+ }
+
myOKBtn->setEnabled(enable);
myApplyBtn->setEnabled(enable);
}
myOKBtn->setEnabled(enable);
myApplyBtn->setEnabled(enable);
}
@@
-1042,7
+1052,7
@@
bool SMESHGUI_GroupDlg::onApply()
if (myGeomObjects->length() == 1) {
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
if (myGeomObjects->length() == 1) {
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
-
myName->text().toUtf8().data(
),
+
SMESH::toUtf8(myName->text()
),
myGeomObjects[0]);
}
else {
myGeomObjects[0]);
}
else {
@@
-1084,11
+1094,11
@@
bool SMESHGUI_GroupDlg::onApply()
aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
-
aNewGeomGroupName.toUtf8().data(
), aMeshShape);
+
SMESH::toUtf8(aNewGeomGroupName
), aMeshShape);
}
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
}
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
-
myName->text().toUtf8().data(
),
+
SMESH::toUtf8(myName->text()
),
aGroupVar);
}
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
aGroupVar);
}
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
@@
-1111,7
+1121,7
@@
bool SMESHGUI_GroupDlg::onApply()
return false;
myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
return false;
myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
-
myName->text().toUtf8().data(
),
+
SMESH::toUtf8(myName->text()
),
myFilter);
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
myFilter);
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
@@
-1136,6
+1146,8
@@
bool SMESHGUI_GroupDlg::onApply()
if( aMeshGroupSO )
anEntryList.append( aMeshGroupSO->GetID().c_str() );
if( aMeshGroupSO )
anEntryList.append( aMeshGroupSO->GetID().c_str() );
+ resultGroup->SetName(SMESH::toUtf8(myName->text().trimmed()));
+
if ( isCreation )
{
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
if ( isCreation )
{
SMESH::setFileType ( aMeshGroupSO, "COULEURGROUP" );
@@
-1152,8
+1164,6
@@
bool SMESHGUI_GroupDlg::onApply()
}
else
{
}
else
{
- resultGroup->SetName(myName->text().toUtf8().data());
-
if ( aMeshGroupSO )
{
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str()))
if ( aMeshGroupSO )
{
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str()))
@@
-1167,7
+1177,7
@@
bool SMESHGUI_GroupDlg::onApply()
if ( !anActor ) return false;
myActorsList.append( anActor );
}
if ( !anActor ) return false;
myActorsList.append( anActor );
}
- anActor->setName(
myName->text().toUtf8().data(
));
+ anActor->setName(
SMESH::toUtf8(myName->text()
));
QColor c;
int delta;
switch ( myTypeId ) {
QColor c;
int delta;
switch ( myTypeId ) {
@@
-1187,7
+1197,10
@@
bool SMESHGUI_GroupDlg::onApply()
}
// update a visible group accoding to a changed contents
if ( !isConversion && anActor->GetVisibility() )
}
// update a visible group accoding to a changed contents
if ( !isConversion && anActor->GetVisibility() )
+ {
SMESH::Update( anIO, true );
SMESH::Update( anIO, true );
+ SMESH::RepaintCurrentView();
+ }
}
}
}
}
}
}
@@
-1316,6
+1329,9
@@
void SMESHGUI_GroupDlg::onObjectSelectionChanged()
// any visible actor of group or submesh of myMesh
SetAppropriateActor();
// any visible actor of group or submesh of myMesh
SetAppropriateActor();
+ setDefaultGroupColor();
+ setDefaultName();
+
aString = aList.First()->getName();
myMeshGroupLine->setText(aString);
myMeshGroupLine->home( false );
aString = aList.First()->getName();
myMeshGroupLine->setText(aString);
myMeshGroupLine->home( false );
@@
-1752,10
+1768,10
@@
void SMESHGUI_GroupDlg::setFilters()
myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone,
/*diffSources=*/isStandalone );
myFilterDlg->SetMesh( myMesh );
myFilterDlg->SetEnabled( /*setInViewer=*/isStandalone,
/*diffSources=*/isStandalone );
myFilterDlg->SetMesh( myMesh );
+ myFilterDlg->SetGroup( myGroupOnFilter );
myFilterDlg->SetSelection();
myFilterDlg->SetSourceWg( myElements, false );
myFilterDlg->SetSelection();
myFilterDlg->SetSourceWg( myElements, false );
-
myFilterDlg->show();
}
myFilterDlg->show();
}