Unicode support: correct handling of unicode on GUI level

This commit is contained in:
rnv 2018-01-22 11:57:06 +03:00
parent efce3946f7
commit 7c11ba6115
49 changed files with 203 additions and 203 deletions

View File

@ -1085,7 +1085,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
} }
QString aTitle = QString(myScalarBarActor->GetTitle()); QString aTitle = QString(myScalarBarActor->GetTitle());
aTitle.replace(QRegExp("(:\\s).*"),"\\1"+ QString::number(GetNumberControlEntities())); aTitle.replace(QRegExp("(:\\s).*"),"\\1"+ QString::number(GetNumberControlEntities()));
myScalarBarActor->SetTitle(aTitle.toLatin1().constData()); myScalarBarActor->SetTitle(aTitle.toUtf8().constData());
} }
else { else {

View File

@ -84,7 +84,7 @@ bool SMESH_PreviewActorsCollection::Init( const TopoDS_Shape& theShape,
return false; return false;
// Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject(); // Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject();
// anIO->setEntry( theEntry.toLatin1().constData() ); // anIO->setEntry( theEntry.toUtf8().constData() );
// get indexes of seleted elements // get indexes of seleted elements
TopExp::MapShapes( theMainShape, myMapOfShapes ); TopExp::MapShapes( theMainShape, myMapOfShapes );
@ -248,7 +248,7 @@ void SMESH_PreviewActorsCollection::showCurrentChunk()
QString entry = QString( "%1_%2" ).arg( myEntry ).arg( index ); QString entry = QString( "%1_%2" ).arg( myEntry ).arg( index );
// Create interactive object // Create interactive object
Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject(); Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject();
anIO->setEntry( entry.toLatin1().constData() ); anIO->setEntry( entry.toUtf8().constData() );
// Init Actor // Init Actor
anActor->SetVectorMode( myType==TopAbs_EDGE ); anActor->SetVectorMode( myType==TopAbs_EDGE );
anActor->setIO( anIO ); anActor->setIO( anIO );

View File

@ -175,7 +175,7 @@ GEOM::GEOM_Object_ptr SMESH_NumberFilter::getGeom
_PTR(Study) study = appStudy->studyDS(); _PTR(Study) study = appStudy->studyDS();
QString entry = owner->entry(); QString entry = owner->entry();
_PTR(SObject) aSO( study->FindObjectID( entry.toLatin1().data() ) ), aRefSO; _PTR(SObject) aSO( study->FindObjectID( entry.toUtf8().data() ) ), aRefSO;
if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) ) if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) )
aSO = aRefSO; aSO = aRefSO;

View File

@ -86,7 +86,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const
_PTR(Study) study = appStudy->studyDS(); _PTR(Study) study = appStudy->studyDS();
QString entry = owner->entry(); QString entry = owner->entry();
_PTR(SObject) obj (study->FindObjectID(entry.toLatin1().data())), aRefSO; _PTR(SObject) obj (study->FindObjectID(entry.toUtf8().data())), aRefSO;
if( extractReference && obj && obj->ReferencedObject( aRefSO ) ) if( extractReference && obj && obj->ReferencedObject( aRefSO ) )
obj = aRefSO; obj = aRefSO;
if (!obj) return false; if (!obj) return false;

View File

@ -6195,7 +6195,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
// Check that the entry corresponds to a real object in the Study // Check that the entry corresponds to a real object in the Study
// as the object may be deleted or modified after the visual state is saved. // as the object may be deleted or modified after the visual state is saved.
_PTR(SObject) so = studyDS->FindObjectID(entry.toLatin1().data()); _PTR(SObject) so = studyDS->FindObjectID(entry.toUtf8().data());
if (!so) continue; //Skip the not existent entry if (!so) continue; //Skip the not existent entry
std::vector<std::string> paramNames = ip->getAllParameterNames( *entIt ); std::vector<std::string> paramNames = ip->getAllParameterNames( *entIt );
@ -6262,7 +6262,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint)
SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac); SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac);
if (aGeomAc->hasIO()) { if (aGeomAc->hasIO()) {
Handle(SALOME_InteractiveObject) io = aGeomAc->getIO(); Handle(SALOME_InteractiveObject) io = aGeomAc->getIO();
if (io->hasEntry() && strcmp(io->getEntry(), entry.toLatin1().data()) == 0) { if (io->hasEntry() && strcmp(io->getEntry(), entry.toUtf8().data()) == 0) {
isFound = true; isFound = true;
vtkActors.Bind(viewIndex, aGeomAc); vtkActors.Bind(viewIndex, aGeomAc);
} }
@ -6948,7 +6948,7 @@ void SMESHGUI::message( const QString& msg )
// get study // get study
_PTR(Study) study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() )->studyDS(); _PTR(Study) study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() )->studyDS();
// get mesh name // get mesh name
_PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() ); _PTR(SObject) obj = study->FindObjectID( entry.toUtf8().constData() );
QString name; QString name;
if ( obj ) if ( obj )
name = SMESH::fromUtf8(obj->GetName()); name = SMESH::fromUtf8(obj->GetName());

View File

@ -442,7 +442,7 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply()
QString groupName = myDlg->myGroupListCmBox->currentText(); QString groupName = myDlg->myGroupListCmBox->currentText();
SMESH::SMESH_IDSource_var newObj = SMESH::SMESH_IDSource_var newObj =
editor->Create0DElementsOnAllNodes( meshObject, groupName.toLatin1().data(), editor->Create0DElementsOnAllNodes( meshObject, groupName.toUtf8().data(),
myDlg->myDuplicateElemsChkBox->isChecked() ); myDlg->myDuplicateElemsChkBox->isChecked() );
int newNb0D = mesh->Nb0DElements() - prevNb0D; int newNb0D = mesh->Nb0DElements() - prevNb0D;

View File

@ -268,7 +268,7 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation)
bool isUnique = false; bool isUnique = false;
while (!isUnique) { while (!isUnique) {
aName = theOperation + "_" + QString::number(++aNumber); aName = theOperation + "_" + QString::number(++aNumber);
isUnique = (aSet.count(aName.toLatin1().data()) == 0); isUnique = (aSet.count(aName.toUtf8().data()) == 0);
} }
return aName; return aName;
@ -299,7 +299,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
try { try {
aMesh = myMeshArray[0]->GetMesh(); aMesh = myMeshArray[0]->GetMesh();
aMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); aMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
// concatenate meshes // concatenate meshes

View File

@ -1280,7 +1280,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
{ {
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" )); QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape, SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape,
name.toLatin1().data(), name.toUtf8().data(),
GEOM::GEOM_Object::_nil()); GEOM::GEOM_Object::_nil());
// look for myMainShape in the table // look for myMainShape in the table
for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) { for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
@ -1299,7 +1299,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape()
} }
QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" )); QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape, SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape,
name.toLatin1().data(), myMainShape); name.toUtf8().data(), myMainShape);
if ( !so->_is_nil() ) { if ( !so->_is_nil() ) {
CORBA::String_var name = so->GetName(); CORBA::String_var name = so->GetName();
CORBA::String_var entry = so->GetID(); CORBA::String_var entry = so->GetID();
@ -1370,7 +1370,7 @@ void SMESHGUI_BaseComputeOp::onGroupOfBadMesh()
else grName = "bad mesh of " + grName; else grName = "bad mesh of " + grName;
SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen(); SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
SMESH::ListOfGroups_var groups SMESH::ListOfGroups_var groups
( gen->MakeGroupsOfBadInputElements(myMesh,curSub,grName.toLatin1().data()) ); ( gen->MakeGroupsOfBadInputElements(myMesh,curSub,grName.toUtf8().data()) );
update( UF_ObjBrowser | UF_Model ); update( UF_ObjBrowser | UF_Model );
if( LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( application() )) if( LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( application() ))
{ {

View File

@ -129,7 +129,7 @@ void SMESHGUI_ConvToQuadOp::selectionDone()
try try
{ {
QString anObjEntry = myDlg->selectedObject( 0 ); QString anObjEntry = myDlg->selectedObject( 0 );
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
if ( !pObj ) return; if ( !pObj ) return;
SMESH::SMESH_IDSource_var idSource = SMESH::SMESH_IDSource_var idSource =
@ -204,7 +204,7 @@ bool SMESHGUI_ConvToQuadOp::onApply()
QString aMess; QString aMess;
QString anObjEntry = myDlg->selectedObject( 0 ); QString anObjEntry = myDlg->selectedObject( 0 );
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
if ( !pObj ) if ( !pObj )
{ {
dlg()->show(); dlg()->show();
@ -383,7 +383,7 @@ SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSourc
void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id ) void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id )
{ {
QString anObjEntry = myDlg->selectedObject( 0 ); QString anObjEntry = myDlg->selectedObject( 0 );
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
if ( !pObj ) return; if ( !pObj ) return;
SMESH::SMESH_IDSource_var idSource = SMESH::SMESH_IDSource_var idSource =

View File

@ -331,7 +331,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply()
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
aPartToCopy = aMeshEditor->MakeIDSource( anElementsId, SMESH::ALL ); aPartToCopy = aMeshEditor->MakeIDSource( anElementsId, SMESH::ALL );
} }
QByteArray meshName = myMeshNameEdit->text().toLatin1(); QByteArray meshName = myMeshNameEdit->text().toUtf8();
bool toCopyGroups = ( myCopyGroupsCheck->isChecked() ); bool toCopyGroups = ( myCopyGroupsCheck->isChecked() );
bool toKeepIDs = ( myKeepIdsCheck->isChecked() ); bool toKeepIDs = ( myKeepIdsCheck->isChecked() );

View File

@ -399,7 +399,7 @@ void SMESHGUI_CreatePatternDlg::onSave()
QFile aFile( fName ); QFile aFile( fName );
aFile.open( QIODevice::WriteOnly ); aFile.open( QIODevice::WriteOnly );
long aWritten = aFile.write( aData.toLatin1(), aLen ); long aWritten = aFile.write( aData.toUtf8(), aLen );
aFile.close(); aFile.close();
if ( aWritten != aLen ) { if ( aWritten != aLen ) {

View File

@ -66,13 +66,13 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_
if( vtk_viewer ) if( vtk_viewer )
{ {
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView(); SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() ); SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toUtf8().data() );
if( !anActor ) if( !anActor )
anActor = SMESH::CreateActor( entry.toLatin1().data(), true ); anActor = SMESH::CreateActor( entry.toUtf8().data(), true );
if( anActor ) if( anActor )
{ {
SMESH::DisplayActor( wnd, anActor ); SMESH::DisplayActor( wnd, anActor );
prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame ); prs = LightApp_Displayer::buildPresentation( entry.toUtf8().data(), aViewFrame );
} }
if( prs ) if( prs )
UpdatePrs( prs ); UpdatePrs( prs );
@ -94,7 +94,7 @@ bool SMESHGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vi
if(viewer_type != SVTK_Viewer::Type()) if(viewer_type != SVTK_Viewer::Type())
return res; return res;
_PTR(SObject) obj = SMESH::getStudy()->FindObjectID( (const char*)entry.toLatin1() ); _PTR(SObject) obj = SMESH::getStudy()->FindObjectID( (const char*)entry.toUtf8() );
CORBA::Object_var anObj = SMESH::SObjectToObject( obj ); CORBA::Object_var anObj = SMESH::SObjectToObject( obj );
/* /*

View File

@ -477,7 +477,7 @@ bool SMESHGUI_DuplicateNodesDlg::onApply()
for ( int i = 0; i < myGroups1.count(); i++ ) for ( int i = 0; i < myGroups1.count(); i++ )
{ {
SMESH::SMESH_Group_var group = SMESH::SMESH_Group_var group =
aMeshEditor->DoubleElements( myGroups1[i], groupName.toLatin1().data() ); aMeshEditor->DoubleElements( myGroups1[i], groupName.toUtf8().data() );
if ( group->_is_nil() ) if ( group->_is_nil() )
{ {
if ( toCreateElemGroup ) if ( toCreateElemGroup )

View File

@ -442,7 +442,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh(); SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh();
mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); mesh->SetParameters( aParameters.join(":").toUtf8().constData() );
SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources(); SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources(); SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();

View File

@ -1159,7 +1159,7 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
SMESH::SMESH_MeshEditor_var meshEditor = mesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var meshEditor = mesh->GetMeshEditor();
SMESH::ListOfGroups_var groups; SMESH::ListOfGroups_var groups;
mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); mesh->SetParameters( aParameters.join(":").toUtf8().constData() );
if ( ExtrMethod_RBut2->isVisible() && if ( ExtrMethod_RBut2->isVisible() &&
ExtrMethod_RBut2->isChecked() ) // Extrusion by normal ExtrMethod_RBut2->isChecked() ) // Extrusion by normal

View File

@ -3198,7 +3198,7 @@ bool SMESHGUI_FilterDlg::isValid() const
QString aName; QString aName;
myTable->GetThreshold(i, aName); myTable->GetThreshold(i, aName);
std::vector<_PTR(SObject)> aList = SMESH::getStudy()->FindObjectByName(aName.toLatin1().constData(), "GEOM"); std::vector<_PTR(SObject)> aList = SMESH::getStudy()->FindObjectByName(aName.toUtf8().constData(), "GEOM");
if (aList.size() == 0) { if (aList.size() == 0) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
tr("BAD_SHAPE_NAME").arg(aName)); tr("BAD_SHAPE_NAME").arg(aName));

View File

@ -430,7 +430,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
} }
if (myFileName->text() != myLibrary->GetFileName()) if (myFileName->text() != myLibrary->GetFileName())
myLibrary->SetFileName( myFileName->text().toLatin1().constData() ); myLibrary->SetFileName( myFileName->text().toUtf8().constData() );
bool aResult = false; bool aResult = false;
@ -439,8 +439,8 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
} else if (myMode == EDIT || myMode == ADD_TO) { } else if (myMode == EDIT || myMode == ADD_TO) {
SMESH::Filter_var aFilter = createFilter(); SMESH::Filter_var aFilter = createFilter();
if (!myListBox->selectedItems().empty() && if (!myListBox->selectedItems().empty() &&
!myLibrary->Replace(myCurrFilterName.toLatin1().constData(), !myLibrary->Replace(myCurrFilterName.toUtf8().constData(),
myName->text().toLatin1().constData(), myName->text().toUtf8().constData(),
aFilter.in())) { aFilter.in())) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_OF_EDITING")); tr("ERROR_OF_EDITING"));
@ -662,7 +662,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary()
if (aFilterMgr->_is_nil()) if (aFilterMgr->_is_nil())
return; return;
myLibrary = aFilterMgr->LoadLibrary(autoExtension(getFileName()).toLatin1().constData()); myLibrary = aFilterMgr->LoadLibrary(autoExtension(getFileName()).toUtf8().constData());
if (myLibrary->_is_nil()) { if (myLibrary->_is_nil()) {
if (myMode == COPY_FROM) { if (myMode == COPY_FROM) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
@ -670,7 +670,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary()
return; return;
} else { } else {
myLibrary = aFilterMgr->CreateLibrary(); myLibrary = aFilterMgr->CreateLibrary();
myLibrary->SetFileName(getFileName().toLatin1().constData()); myLibrary->SetFileName(getFileName().toUtf8().constData());
} }
} }
@ -822,14 +822,14 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged()
} }
SMESH::Filter_var aFilter = createFilter(); SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(), myLibrary->Replace(myCurrFilterName.toUtf8().constData(),
myName->text().toLatin1().constData(), myName->text().toUtf8().constData(),
aFilter); aFilter);
} }
// Fill table with filter parameters // Fill table with filter parameters
SMESH::Filter_var aFilter = myLibrary->Copy(theName.toLatin1().constData()); SMESH::Filter_var aFilter = myLibrary->Copy(theName.toUtf8().constData());
myCurrFilterName = theName; myCurrFilterName = theName;
myCurrFilter = myListBox->currentRow(); myCurrFilter = myListBox->currentRow();
myName->setText(theName); myName->setText(theName);
@ -929,8 +929,8 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed()
return; return;
SMESH::Filter_var aFilter = createFilter(); SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(), myLibrary->Replace(myCurrFilterName.toUtf8().constData(),
myName->text().toLatin1().constData(), myName->text().toUtf8().constData(),
aFilter); aFilter);
} }
myTable->Clear(myTable->GetType()); myTable->Clear(myTable->GetType());
@ -966,8 +966,8 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
// add new filter in library // add new filter in library
bool aResult = !aFilter->GetPredicate()->_is_nil() bool aResult = !aFilter->GetPredicate()->_is_nil()
? myLibrary->Add(aName.toLatin1().constData(), aFilter) ? myLibrary->Add(aName.toUtf8().constData(), aFilter)
: myLibrary->AddEmpty(aName.toLatin1().constData(), (SMESH::ElementType)myTable->GetType()); : myLibrary->AddEmpty(aName.toUtf8().constData(), (SMESH::ElementType)myTable->GetType());
if (!aResult) { if (!aResult) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
@ -1087,7 +1087,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
int anIndex = getIndex(myCurrFilterName); int anIndex = getIndex(myCurrFilterName);
if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) { if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toUtf8().constData())) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
tr("ERROR_OF_DELETING")); tr("ERROR_OF_DELETING"));
} else { } else {
@ -1179,8 +1179,8 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation()
if (valid) if (valid)
{ {
SMESH::Filter_var aFilter = createFilter(myTable->GetType()); SMESH::Filter_var aFilter = createFilter(myTable->GetType());
myLibrary->Replace(myCurrFilterName.toLatin1().constData(), myLibrary->Replace(myCurrFilterName.toUtf8().constData(),
myName->text().toLatin1().constData(), myName->text().toUtf8().constData(),
aFilter); aFilter);
} }
} }

View File

@ -516,7 +516,7 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
bool isUnique = false; bool isUnique = false;
while (!isUnique) { while (!isUnique) {
aName = theOperation + "_" + QString::number(++aNumber); aName = theOperation + "_" + QString::number(++aNumber);
isUnique = (aSet.count(std::string(SMESH::toUtf8(aName))) == 0); isUnique = (aSet.count(std::string(aName.toUtf8().constData())) == 0);
} }
return aName; return aName;
@ -531,7 +531,7 @@ void SMESHGUI_GroupDlg::setDefaultName() const
do do
{ {
aResName = aPrefix + QString::number( i++ ); aResName = aPrefix + QString::number( i++ );
anObj = SMESH::getStudy()->FindObject( SMESH::toUtf8(aResName) ); anObj = SMESH::getStudy()->FindObject( aResName.toUtf8().constData() );
} }
while ( anObj ); while ( anObj );
myName->setText(aResName); myName->setText(aResName);
@ -597,7 +597,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
SALOMEDS::Color aColor = theGroup->GetColor(); SALOMEDS::Color aColor = theGroup->GetColor();
setGroupColor( aColor ); setGroupColor( aColor );
myMeshGroupLine->setText(SMESH::fromUtf8(theGroup->GetName())); myMeshGroupLine->setText(theGroup->GetName());
int aType = 0; int aType = 0;
switch(theGroup->GetType()) { switch(theGroup->GetType()) {
@ -684,7 +684,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
{ {
myNameChanged = true; myNameChanged = true;
myName->blockSignals(true); myName->blockSignals(true);
myName->setText(SMESH::fromUtf8(theGroup->GetName())); myName->setText(theGroup->GetName());
myName->blockSignals(false); myName->blockSignals(false);
} }
@ -1050,7 +1050,7 @@ bool SMESHGUI_GroupDlg::onApply()
if (myGeomObjects->length() == 1) { if (myGeomObjects->length() == 1) {
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
SMESH::toUtf8(myName->text()), myName->text().toUtf8(),
myGeomObjects[0]); myGeomObjects[0]);
} }
else { else {
@ -1091,11 +1091,11 @@ bool SMESHGUI_GroupDlg::onApply()
aNewGeomGroupName += myName->text(); aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO = SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aGroupVar, geomGen->AddInStudy(aGroupVar,
SMESH::toUtf8(aNewGeomGroupName), aMeshShape); aNewGeomGroupName.toUtf8(), aMeshShape);
} }
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
SMESH::toUtf8(myName->text()), myName->text().toUtf8(),
aGroupVar); aGroupVar);
} }
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
@ -1119,7 +1119,7 @@ bool SMESHGUI_GroupDlg::onApply()
return false; return false;
myGroupOnFilter = myMesh->CreateGroupFromFilter(aType, myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
SMESH::toUtf8(myName->text()), myName->text().toUtf8(),
myFilter); myFilter);
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
isCreation = true; isCreation = true;
@ -1143,7 +1143,7 @@ bool SMESHGUI_GroupDlg::onApply()
if( aMeshGroupSO ) if( aMeshGroupSO )
anEntryList.append( aMeshGroupSO->GetID().c_str() ); anEntryList.append( aMeshGroupSO->GetID().c_str() );
resultGroup->SetName(SMESH::toUtf8(myName->text().trimmed())); resultGroup->SetName(myName->text().trimmed().toUtf8());
if ( isCreation ) if ( isCreation )
{ {
@ -1174,7 +1174,7 @@ bool SMESHGUI_GroupDlg::onApply()
if ( !anActor ) return false; if ( !anActor ) return false;
myActorsList.append( anActor ); myActorsList.append( anActor );
} }
anActor->setName(SMESH::toUtf8(myName->text())); anActor->setName(myName->text().toUtf8());
QColor c; QColor c;
int delta; int delta;
switch ( myTypeId ) { switch ( myTypeId ) {

View File

@ -304,7 +304,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
if ( !aStudy ) return false; if ( !aStudy ) return false;
// mesh // mesh
_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() ); _PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toUtf8().data() );
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( meshSO ); SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( meshSO );
if ( mesh->_is_nil() ) return false; if ( mesh->_is_nil() ) return false;
@ -330,7 +330,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
for ( int i = 0; geomID != geomEnd; ++geomID, ++i ) for ( int i = 0; geomID != geomEnd; ++geomID, ++i )
{ {
// selected geom // selected geom
_PTR(SObject) geomSO = aStudy->FindObjectID( geomID->toLatin1().data() ); _PTR(SObject) geomSO = aStudy->FindObjectID( geomID->toUtf8().data() );
GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>(geomSO); GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>(geomSO);
if ( geom->_is_nil() ) continue; if ( geom->_is_nil() ) continue;
@ -349,7 +349,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply()
// groupNames.append( name ); // groupNames.append( name );
//printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() ); //printf( "apply() %s %s\n", (*geomID).latin1(), name.latin1() );
group = mesh->CreateGroupFromGEOM( elemType, name.toLatin1().data(), geom ); group = mesh->CreateGroupFromGEOM( elemType, name.toUtf8().data(), geom );
if( !group->_is_nil() ) if( !group->_is_nil() )
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
@ -462,7 +462,7 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
// study // study
if (_PTR(Study) aStudy = SMESH::getStudy()) { if (_PTR(Study) aStudy = SMESH::getStudy()) {
// mesh // mesh
if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() )) { if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toUtf8().data() )) {
// shape to mesh // shape to mesh
_PTR(SObject) anObj, shapeToMesh; _PTR(SObject) anObj, shapeToMesh;
if (meshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(shapeToMesh)) { if (meshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(shapeToMesh)) {
@ -470,7 +470,7 @@ void SMESHGUI_GroupOnShapeOp::selectionDone()
QStringList::iterator name = names.begin(), id = ids.begin(), idEnd = ids.end(); QStringList::iterator name = names.begin(), id = ids.begin(), idEnd = ids.end();
for (; id != idEnd; ++id, ++name ) { for (; id != idEnd; ++id, ++name ) {
// shape SO // shape SO
if (_PTR(SObject) shapeSO = aStudy->FindObjectID( id->toLatin1().data() )) { if (_PTR(SObject) shapeSO = aStudy->FindObjectID( id->toUtf8().data() )) {
// check if shape SO is a child of shape to mesh // check if shape SO is a child of shape to mesh
while ( shapeSO && shapeSO->GetID() != shapeToMesh->GetID() ) while ( shapeSO && shapeSO->GetID() != shapeToMesh->GetID() )
if ( shapeSO->Depth() < 2 ) if ( shapeSO->Depth() < 2 )

View File

@ -652,7 +652,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply()
{ {
SMESH::ListOfGroups_var aList = convert( myGroups ); SMESH::ListOfGroups_var aList = convert( myGroups );
SMESH::SMESH_Group_var aNewGrp = SMESH::SMESH_Group_var aNewGrp =
aMesh->UnionListOfGroups( aList, aName.toLatin1().constData() ); aMesh->UnionListOfGroups( aList, aName.toUtf8().constData() );
if ( !CORBA::is_nil( aNewGrp ) ) if ( !CORBA::is_nil( aNewGrp ) )
{ {
aNewGrp->SetColor( getColor() ); aNewGrp->SetColor( getColor() );
@ -761,7 +761,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply()
{ {
SMESH::ListOfGroups_var aList = convert( myGroups ); SMESH::ListOfGroups_var aList = convert( myGroups );
SMESH::SMESH_Group_var aNewGrp = SMESH::SMESH_Group_var aNewGrp =
aMesh->IntersectListOfGroups( aList, aName.toLatin1().constData() ); aMesh->IntersectListOfGroups( aList, aName.toUtf8().constData() );
if ( !CORBA::is_nil( aNewGrp ) ) if ( !CORBA::is_nil( aNewGrp ) )
{ {
aNewGrp->SetColor( getColor() ); aNewGrp->SetColor( getColor() );
@ -934,7 +934,7 @@ bool SMESHGUI_CutGroupsDlg::onApply()
SMESH::ListOfGroups_var aList1 = convert( myGroups1 ); SMESH::ListOfGroups_var aList1 = convert( myGroups1 );
SMESH::ListOfGroups_var aList2 = convert( myGroups2 ); SMESH::ListOfGroups_var aList2 = convert( myGroups2 );
SMESH::SMESH_Group_var aNewGrp = SMESH::SMESH_Group_var aNewGrp =
aMesh->CutListOfGroups( aList1, aList2, aName.toLatin1().constData() ); aMesh->CutListOfGroups( aList1, aList2, aName.toUtf8().constData() );
if ( !CORBA::is_nil( aNewGrp ) ) if ( !CORBA::is_nil( aNewGrp ) )
{ {
aNewGrp->SetColor( getColor() ); aNewGrp->SetColor( getColor() );
@ -1120,7 +1120,7 @@ bool SMESHGUI_DimGroupDlg::onApply()
(SMESH::NB_COMMON_NODES_ENUM) myNbNoCombo->currentIndex(); (SMESH::NB_COMMON_NODES_ENUM) myNbNoCombo->currentIndex();
SMESH::SMESH_Group_var aNewGrp = SMESH::SMESH_Group_var aNewGrp =
aMesh->CreateDimGroup( aList, anElemType, aName.toLatin1().constData(), aMesh->CreateDimGroup( aList, anElemType, aName.toUtf8().constData(),
aNbCoNodes, myUnderlOnlyChk->isChecked() ); aNbCoNodes, myUnderlOnlyChk->isChecked() );
if ( !CORBA::is_nil( aNewGrp ) ) if ( !CORBA::is_nil( aNewGrp ) )
{ {

View File

@ -42,7 +42,7 @@ namespace SMESH
SMESH::SMESH_Group_var aGroup; SMESH::SMESH_Group_var aGroup;
try { try {
if ( !theMesh->_is_nil() ) if ( !theMesh->_is_nil() )
aGroup = theMesh->CreateGroup( theType, SMESH::toUtf8(theGroupName) ); aGroup = theMesh->CreateGroup( theType, theGroupName.toUtf8() );
} }
catch( const SALOME::SALOME_Exception& S_ex ) { catch( const SALOME::SALOME_Exception& S_ex ) {
SalomeApp_Tools::QtCatchCorbaException( S_ex ); SalomeApp_Tools::QtCatchCorbaException( S_ex );

View File

@ -90,7 +90,7 @@ protected:
isVariable = false; isVariable = false;
} }
const char* text() const { const char* text() const {
((QByteArray&) myTextAsBytes) = myText.toLatin1(); return myTextAsBytes.constData(); ((QByteArray&) myTextAsBytes) = myText.toUtf8(); return myTextAsBytes.constData();
} }
}; };

View File

@ -521,7 +521,7 @@ namespace SMESH
try { try {
// load plugin library // load plugin library
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() ); LibHandle libHandle = LoadLib( aClientLibName.toUtf8().data() );
if (!libHandle) { if (!libHandle) {
// report any error, if occurred // report any error, if occurred
{ {
@ -585,7 +585,7 @@ namespace SMESH
try { try {
SMESH::SMESH_Hypothesis_var aHypothesis; SMESH::SMESH_Hypothesis_var aHypothesis;
aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(), aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
aServLib.toLatin1().data()); aServLib.toUtf8().data());
if (!aHypothesis->_is_nil()) { if (!aHypothesis->_is_nil()) {
_PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in()); _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
if (aHypSObject) { if (aHypSObject) {
@ -613,7 +613,7 @@ namespace SMESH
HypothesisData* aHypData = GetHypothesisData(aHypType); HypothesisData* aHypData = GetHypothesisData(aHypType);
QString aServLib = aHypData->ServerLibName; QString aServLib = aHypData->ServerLibName;
return SMESHGUI::GetSMESHGen()->IsApplicable( aHypType.toLatin1().data(), return SMESHGUI::GetSMESHGen()->IsApplicable( aHypType.toLatin1().data(),
aServLib.toLatin1().data(), aServLib.toUtf8().data(),
theGeomObject, theGeomObject,
toCheckAll); toCheckAll);
} }

View File

@ -302,7 +302,7 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone()
bool isMesh = true; bool isMesh = true;
for ( int i = 0; i < ids.count() && isMesh; ++i ) for ( int i = 0; i < ids.count() && isMesh; ++i )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toLatin1().constData() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( ids[i].toUtf8().constData() );
mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj ); mySrcMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( sobj );
//isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh //isMesh = !mySrcMesh->_is_nil(); // EAP - it's sometimes necessary to copy to a new mesh
} }
@ -355,7 +355,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
for ( int i = 0; i < entries.count(); ++i ) for ( int i = 0; i < entries.count(); ++i )
{ {
SMESH::SMESH_GroupBase_var grp; SMESH::SMESH_GroupBase_var grp;
if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() )) if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().constData() ))
grp = SMESH::SObjectToInterface<SMESH::SMESH_GroupBase>( sobj ); grp = SMESH::SObjectToInterface<SMESH::SMESH_GroupBase>( sobj );
if ( grp->_is_nil() ) { if ( grp->_is_nil() ) {
msg = tr( "SMESH_NOT_ONLY_GROUPS" ); msg = tr( "SMESH_NOT_ONLY_GROUPS" );
@ -369,7 +369,7 @@ bool SMESHGUI_Make2DFrom3DOp::isValid( QString& msg ) const
for ( int i = 0; i < entries.count(); ++i ) for ( int i = 0; i < entries.count(); ++i )
{ {
SMESH::SMESH_IDSource_var idSource; SMESH::SMESH_IDSource_var idSource;
if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() )) if ( _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().constData() ))
idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj ); idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
if ( !idSource->_is_nil() ) { if ( !idSource->_is_nil() ) {
SMESH::array_of_ElementType_var types = idSource->GetTypes(); SMESH::array_of_ElementType_var types = idSource->GetTypes();
@ -427,7 +427,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
groups->length( entries.count() ); groups->length( entries.count() );
for ( int i = 0; i < entries.count(); ++i ) for ( int i = 0; i < entries.count(); ++i )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().constData() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().constData() );
SMESH::SMESH_IDSource_var grp = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj ); SMESH::SMESH_IDSource_var grp = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( sobj );
SMESH::array_of_ElementType_var types = grp->GetTypes(); SMESH::array_of_ElementType_var types = grp->GetTypes();
if ( types->length() < 1 || types[0] != goodType ) if ( types->length() < 1 || types[0] != goodType )
@ -450,8 +450,8 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
SMESH::SMESH_Group_var newGrp; SMESH::SMESH_Group_var newGrp;
SMESH::SMESH_Mesh_var newMesh; SMESH::SMESH_Mesh_var newMesh;
CORBA::Long nbAdded = aMeshEditor->MakeBoundaryElements( mode, CORBA::Long nbAdded = aMeshEditor->MakeBoundaryElements( mode,
groupName.toLatin1().constData(), groupName.toUtf8().constData(),
meshName.toLatin1().constData(), meshName.toUtf8().constData(),
copyAll, copyAll,
groups, groups,
newMesh.out(), newMesh.out(),
@ -468,7 +468,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList )
ok = true; ok = true;
for ( int i = 0; i < entries.count(); ++i ) for ( int i = 0; i < entries.count(); ++i )
if ( SMESH_Actor* actor = SMESH::FindActorByEntry( entries[i].toLatin1().constData() )) if ( SMESH_Actor* actor = SMESH::FindActorByEntry( entries[i].toUtf8().constData() ))
SMESH::Update(actor->getIO(),actor->GetVisibility()); SMESH::Update(actor->getIO(),actor->GetVisibility());
SMESH::RepaintCurrentView(); SMESH::RepaintCurrentView();
} }

View File

@ -528,7 +528,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply()
if (aMeshEditor->_is_nil()) if (aMeshEditor->_is_nil())
return true; return true;
aMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); aMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
bool ok; bool ok;
int anId = myDlg->myId->text().toInt( &ok ); int anId = myDlg->myId->text().toInt( &ok );

View File

@ -329,7 +329,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
// mesh // mesh
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
_PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() );
if (!pMesh) return false; if (!pMesh) return false;
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh ); SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
@ -354,7 +354,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) { for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) {
QString aSubGeomEntry = (*aSubShapesIter); QString aSubGeomEntry = (*aSubShapesIter);
_PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data()); _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toUtf8().data());
if (!pSubGeom) return false; if (!pSubGeom) return false;
GEOM::GEOM_Object_var aSubGeomVar = GEOM::GEOM_Object_var aSubGeomVar =
@ -416,7 +416,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
_PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() );
if ( pMesh ) { if ( pMesh ) {
QStringList algoNames; QStringList algoNames;
@ -428,11 +428,11 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
if ( algo && if ( algo &&
algo->InputTypes.empty() && // builds all dimensions it-self algo->InputTypes.empty() && // builds all dimensions it-self
!algo->IsSupportSubmeshes ) !algo->IsSupportSubmeshes )
return CORBA::string_dup( algoNames[0].toLatin1().data() ); return CORBA::string_dup( algoNames[0].toUtf8().data() );
} }
// GEOM::GEOM_Object_var geom; // GEOM::GEOM_Object_var geom;
// if (_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() )) // if (_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() ))
// geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom ); // geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
// if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well // if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well
@ -443,7 +443,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const
if ( algo && if ( algo &&
algo->InputTypes.empty() && // builds all dimensions it-self algo->InputTypes.empty() && // builds all dimensions it-self
!algo->IsSupportSubmeshes ) !algo->IsSupportSubmeshes )
return CORBA::string_dup( algoNames[0].toLatin1().data() ); return CORBA::string_dup( algoNames[0].toUtf8().data() );
} }
// } // }
} }
@ -461,8 +461,8 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const
{ {
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
_PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() );
_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ); _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() );
if ( pMesh && pGeom ) { if ( pMesh && pGeom ) {
GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom ); GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
if ( !geom->_is_nil() ) { if ( !geom->_is_nil() ) {
@ -522,7 +522,7 @@ void SMESHGUI_MeshOp::selectionDone()
//Check geometry for mesh //Check geometry for mesh
QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj); QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj);
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anObjEntry.toLatin1().data()); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID(anObjEntry.toUtf8().data());
if (pObj) if (pObj)
{ {
SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh_var aMeshVar =
@ -550,7 +550,7 @@ void SMESHGUI_MeshOp::selectionDone()
int iSubSh = 0; int iSubSh = 0;
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
QString aSubGeomEntry = (*aSubShapesIter); QString aSubGeomEntry = (*aSubShapesIter);
_PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data()); _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toUtf8().data());
if( pSubGeom ) { if( pSubGeom ) {
SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom); SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom);
@ -566,7 +566,7 @@ void SMESHGUI_MeshOp::selectionDone()
} else { } else {
// get geometry by selected sub-mesh // get geometry by selected sub-mesh
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
if (!aGeomVar->_is_nil()) { if (!aGeomVar->_is_nil()) {
aSeq->length(1); aSeq->length(1);
@ -693,12 +693,12 @@ void SMESHGUI_MeshOp::selectionDone()
// enable/disable popup for choice of geom selection way // enable/disable popup for choice of geom selection way
bool enable = false; bool enable = false;
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) { if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh ); SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if ( !mesh->_is_nil() ) { if ( !mesh->_is_nil() ) {
//rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry //rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ); _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() );
if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() ) if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
myDlg->activateObject(SMESHGUI_MeshDlg::Geom); myDlg->activateObject(SMESHGUI_MeshDlg::Geom);
enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 ); enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 );
@ -773,7 +773,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
{ {
QString aMeshEntry = myDlg->selectedObject QString aMeshEntry = myDlg->selectedObject
( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj ); ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) { if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh ); SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) { if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) {
theMess = tr( "IMPORTED_MESH" ); theMess = tr( "IMPORTED_MESH" );
@ -802,7 +802,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
} }
return true; return true;
} }
_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ); _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() );
if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() ) if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
{ {
theMess = tr( "GEOMETRY_OBJECT_IS_NULL" ); theMess = tr( "GEOMETRY_OBJECT_IS_NULL" );
@ -818,7 +818,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const
theMess = tr( "MESH_IS_NOT_DEFINED" ); theMess = tr( "MESH_IS_NOT_DEFINED" );
return false; return false;
} }
_PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() );
if ( !pMesh || SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() )->_is_nil() ) if ( !pMesh || SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() )->_is_nil() )
{ {
theMess = tr( "MESH_IS_NULL" ); theMess = tr( "MESH_IS_NULL" );
@ -945,7 +945,7 @@ void SMESHGUI_MeshOp::availableHyps( const int theDim,
QString aCurrentGeomToSelect; QString aCurrentGeomToSelect;
if ( !theMeshType.isEmpty() ) { if ( !theMeshType.isEmpty() ) {
aCurrentGeomToSelect = myDlg->selectedObject( myToCreate ? SMESHGUI_MeshDlg::Geom : SMESHGUI_MeshDlg::Obj ); aCurrentGeomToSelect = myDlg->selectedObject( myToCreate ? SMESHGUI_MeshDlg::Geom : SMESHGUI_MeshDlg::Obj );
if ( _PTR(SObject) so = SMESH::getStudy()->FindObjectID( aCurrentGeomToSelect.toLatin1().data() )) { if ( _PTR(SObject) so = SMESH::getStudy()->FindObjectID( aCurrentGeomToSelect.toUtf8().data() )) {
aGeomVar = SMESH::GetGeom( so ); aGeomVar = SMESH::GetGeom( so );
} }
if ( aCurrentGeomToSelect != myLastGeomToSelect ) if ( aCurrentGeomToSelect != myLastGeomToSelect )
@ -1120,14 +1120,14 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
{ {
anEntry = myDlg->selectedObject anEntry = myDlg->selectedObject
( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj ); ( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
if ( _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() )) if ( _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anEntry.toUtf8().data() ))
{ {
CORBA::Object_ptr Obj = _CAST( SObject,pObj )->GetObject(); CORBA::Object_ptr Obj = _CAST( SObject,pObj )->GetObject();
if ( myToCreate ) // mesh and geom may be selected if ( myToCreate ) // mesh and geom may be selected
{ {
aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj ); aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj );
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() )) if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toUtf8().data() ))
aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
} }
else // edition: sub-mesh may be selected else // edition: sub-mesh may be selected
@ -1145,7 +1145,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
if ( !myToCreate ) // mesh to edit can be selected if ( !myToCreate ) // mesh to edit can be selected
{ {
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() )) if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( anEntry.toUtf8().data() ))
{ {
aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() ); aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if ( !aMeshVar->_is_nil() ) if ( !aMeshVar->_is_nil() )
@ -1154,7 +1154,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
} }
if ( aGeomVar->_is_nil() ) { if ( aGeomVar->_is_nil() ) {
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toLatin1().data() )) if ( _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( anEntry.toUtf8().data() ))
{ {
aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
} }
@ -1162,14 +1162,14 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType,
} }
SMESH::SMESH_Hypothesis_var hyp = SMESH::SMESH_Hypothesis_var hyp =
SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(), SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toUtf8().data(),
aServerLib.toLatin1().data(), aServerLib.toUtf8().data(),
aMeshVar, aMeshVar,
aGeomVar, aGeomVar,
/*byMesh = */isSubMesh); /*byMesh = */isSubMesh);
if ( hyp->_is_nil() && isSubMesh ) if ( hyp->_is_nil() && isSubMesh )
hyp = SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(), hyp = SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(),
aServerLib.toLatin1().data(), aServerLib.toUtf8().data(),
aMeshVar, aMeshVar,
aGeomVar, aGeomVar,
/*byMesh = */false); /*byMesh = */false);
@ -1197,13 +1197,13 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea
aMeshEntry = aGeomEntry; aMeshEntry = aGeomEntry;
if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited if ( aMeshEntry != aGeomEntry ) { // Get Geom object from Mesh of a sub-mesh being edited
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
aMeshEntry = ( aGeomVar->_is_nil() ) ? QString() : SMESH::toQStr( aGeomVar->GetStudyEntry() ); aMeshEntry = ( aGeomVar->_is_nil() ) ? QString() : SMESH::toQStr( aGeomVar->GetStudyEntry() );
} }
if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited if ( aMeshEntry == "" && aGeomEntry == "" ) { // get geom of an object being edited
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
bool isMesh; bool isMesh;
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh ); GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh );
if ( !aGeomVar->_is_nil() ) if ( !aGeomVar->_is_nil() )
@ -1216,7 +1216,7 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea
if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) {
// take geometry from submesh being created // take geometry from submesh being created
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
if ( pObj ) { if ( pObj ) {
// if current object is sub-mesh // if current object is sub-mesh
SMESH::SMESH_subMesh_var aSubMeshVar = SMESH::SMESH_subMesh_var aSubMeshVar =
@ -1827,7 +1827,7 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess, QStringList& theEntryList )
for ( int i = 0; it!=aList.end(); it++, ++i ) for ( int i = 0; it!=aList.end(); it++, ++i )
{ {
QString aGeomEntry = *it; QString aGeomEntry = *it;
_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ); _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() );
GEOM::GEOM_Object_var aGeomVar = GEOM::GEOM_Object_var aGeomVar =
GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
@ -1894,7 +1894,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
// get mesh object // get mesh object
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
_PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() );
SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh_var aMeshVar =
SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() ); SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if (aMeshVar->_is_nil()) if (aMeshVar->_is_nil())
@ -1914,7 +1914,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
{ {
//QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); //QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
QString aGeomEntry = aGEOMs.first(); QString aGeomEntry = aGEOMs.first();
_PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ); _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() );
aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
} }
else if (aGEOMs.count() > 1) else if (aGEOMs.count() > 1)
@ -1934,7 +1934,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
QString aSubGeomEntry = (*aSubShapesIter); QString aSubGeomEntry = (*aSubShapesIter);
_PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data()); _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toUtf8().data());
GEOM::GEOM_Object_var aSubGeomVar = GEOM::GEOM_Object_var aSubGeomVar =
GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject()); GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType(); TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType();
@ -1959,7 +1959,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
aNewGeomGroupName += aName; aNewGeomGroupName += aName;
SALOMEDS::SObject_wrap aNewGroupSO = SALOMEDS::SObject_wrap aNewGroupSO =
geomGen->AddInStudy( aGeomVar, geomGen->AddInStudy( aGeomVar,
aNewGeomGroupName.toLatin1().data(), mainGeom); aNewGeomGroupName.toUtf8().data(), mainGeom);
} }
} }
} }
@ -1972,10 +1972,10 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList
SUIT_OverrideCursor aWaitCursor; SUIT_OverrideCursor aWaitCursor;
// create sub-mesh // create sub-mesh
SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.toLatin1().data() ); SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.toUtf8().data() );
_PTR(SObject) aSubMeshSO = SMESH::FindSObject( aSubMeshVar.in() ); _PTR(SObject) aSubMeshSO = SMESH::FindSObject( aSubMeshVar.in() );
if ( aSubMeshSO ) { if ( aSubMeshSO ) {
SMESH::SetName( aSubMeshSO, aName.toLatin1().data() ); SMESH::SetName( aSubMeshSO, aName.toUtf8().data() );
theEntryList.append( aSubMeshSO->GetID().c_str() ); theEntryList.append( aSubMeshSO->GetID().c_str() );
} }
@ -2124,7 +2124,7 @@ void SMESHGUI_MeshOp::setDefaultName( const QString& thePrefix ) const
do do
{ {
aResName = aPrefix + QString::number( i++ ); aResName = aPrefix + QString::number( i++ );
anObj = aStudy->FindObject( aResName.toLatin1().data() ); anObj = aStudy->FindObject( aResName.toUtf8().data() );
} }
while ( anObj ); while ( anObj );
@ -2229,7 +2229,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
void SMESHGUI_MeshOp::readMesh() void SMESHGUI_MeshOp::readMesh()
{ {
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
if ( !pObj ) if ( !pObj )
return; return;
@ -2395,7 +2395,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess )
return false; return false;
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
if ( !pObj ) if ( !pObj )
return false; return false;
@ -2578,7 +2578,7 @@ void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh )
} }
// set mesh object to SMESHGUI_ShapeByMeshOp and start it // set mesh object to SMESHGUI_ShapeByMeshOp and start it
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() )) { if ( _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() )) {
SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh_var aMeshVar =
SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() ); SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if ( !aMeshVar->_is_nil() ) { if ( !aMeshVar->_is_nil() ) {
@ -2607,7 +2607,7 @@ void SMESHGUI_MeshOp::onPublishShapeByMeshDlg(SUIT_Operation* op)
if ( !aGeomVar->_is_nil() ) if ( !aGeomVar->_is_nil() )
{ {
QString ID = SMESH::toQStr( aGeomVar->GetStudyEntry() ); QString ID = SMESH::toQStr( aGeomVar->GetStudyEntry() );
if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toLatin1().data() )) { if ( _PTR(SObject) aGeomSO = SMESH::getStudy()->FindObjectID( ID.toUtf8().data() )) {
selectObject( aGeomSO ); selectObject( aGeomSO );
selectionDone(); selectionDone();
} }

View File

@ -475,7 +475,7 @@ bool SMESHGUI_MeshPatternDlg::onApply()
aParameters << myNode1->text(); aParameters << myNode1->text();
if(myType == Type_3d ) if(myType == Type_3d )
aParameters << myNode2->text(); aParameters << myNode2->text();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); myMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
} }
QList<int> ids; QList<int> ids;
getIds(ids); getIds(ids);
@ -1149,7 +1149,7 @@ bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName)
try { try {
SMESH::SMESH_Pattern_var aPattern = SMESH::GetPattern(); SMESH::SMESH_Pattern_var aPattern = SMESH::GetPattern();
if (!aPattern->LoadFromFile(theName.toLatin1().data()) || if (!aPattern->LoadFromFile(theName.toUtf8().data()) ||
(myType == Type_2d && !aPattern->Is2D())) { (myType == Type_2d && !aPattern->Is2D())) {
SMESH::SMESH_Pattern::ErrorCode aCode = aPattern->GetErrorCode(); SMESH::SMESH_Pattern::ErrorCode aCode = aPattern->GetErrorCode();
QString aMess; QString aMess;

View File

@ -66,7 +66,7 @@ namespace SMESH
theBaseName : theBaseName + "_" + thePostfix; theBaseName : theBaseName + "_" + thePostfix;
if ( _PTR(Study) aStudy = getStudy() ) { if ( _PTR(Study) aStudy = getStudy() ) {
QString name = baseName; QString name = baseName;
while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) { while ( !aStudy->FindObjectByName( name.toUtf8().data(), "SMESH" ).empty() ) {
int nb = 0; int nb = 0;
QStringList names = name.split("_", QString::KeepEmptyParts); QStringList names = name.split("_", QString::KeepEmptyParts);
if ( names.count() > 0 ) { if ( names.count() > 0 ) {

View File

@ -1196,7 +1196,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito
{ {
QStringList aParameters; QStringList aParameters;
aParameters << myMaxAngleSpin->text(); aParameters << myMaxAngleSpin->text();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); myMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
} }
SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor(); SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0; double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
@ -1666,7 +1666,7 @@ bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
aParameters << myDirSpin[0]->text(); aParameters << myDirSpin[0]->text();
aParameters << myDirSpin[1]->text(); aParameters << myDirSpin[1]->text();
aParameters << myDirSpin[2]->text(); aParameters << myDirSpin[2]->text();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); myMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
SMESH::PointStruct_var point = new SMESH::PointStruct; SMESH::PointStruct_var point = new SMESH::PointStruct;
point->x = myPointSpin[0]->GetValue(); point->x = myPointSpin[0]->GetValue();

View File

@ -100,7 +100,7 @@ namespace SMESH
try { try {
_PTR(SObject) aSobj = SMESH::FindSObject( theMesh ); _PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
theMesh->SetParameters( theParameters.join(":").toLatin1().constData() ); theMesh->SetParameters( theParameters.join(":").toUtf8().constData() );
aNodeId = aMeshEditor->AddNode( x, y, z ); aNodeId = aMeshEditor->AddNode( x, y, z );
if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( aSobj->GetID().c_str() ) ) { if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( aSobj->GetID().c_str() ) ) {
aVisualObj->Update( true ); aVisualObj->Update( true );

View File

@ -693,7 +693,7 @@ bool SMESHGUI_ReorientFacesOp::onApply()
point.y = myDlg->myY->GetValue(); point.y = myDlg->myY->GetValue();
point.z = myDlg->myZ->GetValue(); point.z = myDlg->myZ->GetValue();
aMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); aMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
aResult = aMeshEditor->Reorient2D( myObject, direction, face, point ); aResult = aMeshEditor->Reorient2D( myObject, direction, face, point );
} }
@ -728,7 +728,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg )
{ {
// check object // check object
QString objectEntry = myDlg->selectedObject( EObject ); QString objectEntry = myDlg->selectedObject( EObject );
_PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() ); _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toUtf8().data() );
myObject = SMESH::SMESH_IDSource::_narrow( _CAST( SObject,pSObject )->GetObject() ); myObject = SMESH::SMESH_IDSource::_narrow( _CAST( SObject,pSObject )->GetObject() );
if ( myObject->_is_nil() ) if ( myObject->_is_nil() )
{ {
@ -749,7 +749,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg )
if ( myDlg->myConstructorGrp->checkedId() == CONSTRUCTOR_VOLUME ) if ( myDlg->myConstructorGrp->checkedId() == CONSTRUCTOR_VOLUME )
{ {
objectEntry = myDlg->selectedObject( EVolumes ); objectEntry = myDlg->selectedObject( EVolumes );
_PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toLatin1().data() ); _PTR(SObject) pSObject = SMESH::getStudy()->FindObjectID( objectEntry.toUtf8().data() );
myVolumeObj = SMESH::SObjectToInterface< SMESH::SMESH_IDSource>( pSObject ); myVolumeObj = SMESH::SObjectToInterface< SMESH::SMESH_IDSource>( pSObject );
if ( myVolumeObj->_is_nil() ) if ( myVolumeObj->_is_nil() )
{ {

View File

@ -436,7 +436,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh(); SMESH::SMESH_Mesh_var mesh = SelectorWdg->GetMesh();
mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); mesh->SetParameters( aParameters.join(":").toUtf8().constData() );
SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources(); SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources(); SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();

View File

@ -446,13 +446,13 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) { if(CheckBoxMesh->isChecked()) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, false); aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, false);
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false); aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
} }
break; break;
@ -462,13 +462,13 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) { if(CheckBoxMesh->isChecked()) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->RotateObjectMakeGroups(myObjects[i], anAxis, anAngle); groups = aMeshEditor->RotateObjectMakeGroups(myObjects[i], anAxis, anAngle);
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle); groups = aMeshEditor->RotateMakeGroups(anElementsId, anAxis, anAngle);
} }
} }
@ -476,13 +476,13 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) { if(CheckBoxMesh->isChecked()) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, true); aMeshEditor->RotateObject(myObjects[i], anAxis, anAngle, true);
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true); aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
} }
} }
@ -493,9 +493,9 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->RotateObjectMakeMesh(myObjects[i], anAxis, anAngle, makeGroups, mesh = aMeshEditor->RotateObjectMakeMesh(myObjects[i], anAxis, anAngle, makeGroups,
aName.toLatin1().data()); aName.toUtf8().data());
if (!mesh->_is_nil()) { if (!mesh->_is_nil()) {
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
@ -504,9 +504,9 @@ bool SMESHGUI_RotationDlg::ClickOnApply()
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups, mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
LineEditNewMesh->text().toLatin1().data()); LineEditNewMesh->text().toUtf8().data());
if (!mesh->_is_nil()) { if (!mesh->_is_nil()) {
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );

View File

@ -484,13 +484,13 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
if ( CheckBoxMesh->isChecked() ) if ( CheckBoxMesh->isChecked() )
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters( aParameters.join( ":" ).toLatin1().constData() ); myMeshes[i]->SetParameters( aParameters.join( ":" ).toUtf8().constData() );
aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, false); aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, false);
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
myMeshes[0]->SetParameters( aParameters.join( ":" ).toLatin1().constData() ); myMeshes[0]->SetParameters( aParameters.join( ":" ).toUtf8().constData() );
aMeshEditor->Scale( src, aPoint, aScaleFact, false); aMeshEditor->Scale( src, aPoint, aScaleFact, false);
} }
break; break;
@ -501,13 +501,13 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) if(CheckBoxMesh->isChecked())
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->ScaleMakeGroups(myObjects[i], aPoint, aScaleFact); groups = aMeshEditor->ScaleMakeGroups(myObjects[i], aPoint, aScaleFact);
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact); groups = aMeshEditor->ScaleMakeGroups( src, aPoint, aScaleFact);
} }
} }
@ -515,14 +515,14 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) { if(CheckBoxMesh->isChecked()) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, true); aMeshEditor->Scale(myObjects[i], aPoint, aScaleFact, true);
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Scale( src, aPoint, aScaleFact, true); aMeshEditor->Scale( src, aPoint, aScaleFact, true);
} }
} }
@ -534,19 +534,19 @@ bool SMESHGUI_ScaleDlg::ClickOnApply()
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->ScaleMakeMesh(myObjects[i], aPoint, aScaleFact, makeGroups, mesh = aMeshEditor->ScaleMakeMesh(myObjects[i], aPoint, aScaleFact, makeGroups,
aName.toLatin1().data()); aName.toUtf8().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL); SMESH::IDSource_wrap src = aMeshEditor->MakeIDSource(anElementsId, SMESH::ALL);
mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups, mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups,
LineEditNewMesh->text().toLatin1().data()); LineEditNewMesh->text().toUtf8().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
} }

View File

@ -198,7 +198,7 @@ QList<QVariant> SMESHGUI_Selection::elemTypes( int ind, bool fromObj ) const
{ {
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj ); CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj ); SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj );
if ( !CORBA::is_nil( idSrc ) ) if ( !CORBA::is_nil( idSrc ) )
@ -263,7 +263,7 @@ QString SMESHGUI_Selection::displayMode( int ind ) const
bool SMESHGUI_Selection::isQuadratic( int ind ) const bool SMESHGUI_Selection::isQuadratic( int ind ) const
{ {
_PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
if ( !so ) if ( !so )
return false; return false;
SMESH::SMESH_IDSource_var idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( so ); SMESH::SMESH_IDSource_var idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( so );
@ -465,7 +465,7 @@ bool SMESHGUI_Selection::isAutoColor( int ind ) const
{ {
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj ); CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
if ( !CORBA::is_nil( obj ) ) { if ( !CORBA::is_nil( obj ) ) {
@ -486,7 +486,7 @@ int SMESHGUI_Selection::numberOfNodes( int ind ) const
{ {
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj ); CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
if ( !CORBA::is_nil( obj ) ) { if ( !CORBA::is_nil( obj ) ) {
@ -517,7 +517,7 @@ int SMESHGUI_Selection::dim( int ind ) const
int dim = -1; int dim = -1;
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj ); CORBA::Object_var obj = SMESH::SObjectToObject( sobj );
if ( !CORBA::is_nil( obj ) ) { if ( !CORBA::is_nil( obj ) ) {
@ -552,7 +552,7 @@ bool SMESHGUI_Selection::isComputable( int ind ) const
myTypes[ind].startsWith("Mesh " ))) myTypes[ind].startsWith("Mesh " )))
{ {
QMap<int,int> modeMap; QMap<int,int> modeMap;
_PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) meshSO = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
_PTR(SComponent) component = meshSO->GetFatherComponent(); _PTR(SComponent) component = meshSO->GetFatherComponent();
if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
@ -578,7 +578,7 @@ bool SMESHGUI_Selection::isPreComputable( int ind ) const
if ( maxDim < 2 ) // we can preview 1D or 2D if ( maxDim < 2 ) // we can preview 1D or 2D
{ {
QMap<int,int> modeMap; QMap<int,int> modeMap;
_PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap ); SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
if ( modeMap.size() > 1 ) if ( modeMap.size() > 1 )
return (( modeMap.contains( SMESH::DIM_3D )) || return (( modeMap.contains( SMESH::DIM_3D )) ||
@ -597,7 +597,7 @@ bool SMESHGUI_Selection::hasGeomReference( int ind ) const
{ {
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{ {
_PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so ); GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
return !shape->_is_nil(); return !shape->_is_nil();
} }
@ -614,7 +614,7 @@ bool SMESHGUI_Selection::isEditableHyp( int ind ) const
bool isEditable = true; bool isEditable = true;
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" )
{ {
_PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) so = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface<SMESH::SMESH_Hypothesis>( so ); SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface<SMESH::SMESH_Hypothesis>( so );
if ( !hyp->_is_nil() ) if ( !hyp->_is_nil() )
{ {
@ -633,7 +633,7 @@ bool SMESHGUI_Selection::isVisible( int ind ) const
{ {
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{ {
SMESH_Actor* actor = SMESH::FindActorByEntry( entry( ind ).toLatin1().data() ); SMESH_Actor* actor = SMESH::FindActorByEntry( entry( ind ).toUtf8().data() );
if ( actor && actor->hasIO() ) { if ( actor && actor->hasIO() ) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() )
return aViewWindow->isVisible( actor->getIO() ); return aViewWindow->isVisible( actor->getIO() );
@ -651,7 +651,7 @@ bool SMESHGUI_Selection::hasChildren( int ind ) const
{ {
if ( ind >= 0 ) if ( ind >= 0 )
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().data() );
if ( sobj ) if ( sobj )
return SMESH::getStudy()->GetUseCaseBuilder()->HasChildren( sobj ); return SMESH::getStudy()->GetUseCaseBuilder()->HasChildren( sobj );
} }
@ -669,7 +669,7 @@ int SMESHGUI_Selection::nbChildren( int ind ) const
if ( ind >= 0 ) if ( ind >= 0 )
{ {
_PTR(Study) study = SMESH::getStudy(); _PTR(Study) study = SMESH::getStudy();
_PTR(SObject) sobj = study->FindObjectID( entry( ind ).toLatin1().data() ); _PTR(SObject) sobj = study->FindObjectID( entry( ind ).toUtf8().data() );
if ( sobj && study->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) { if ( sobj && study->GetUseCaseBuilder()->IsUseCaseNode( sobj ) ) {
_PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( sobj ); _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( sobj );
for ( it->Init( false ); it->More(); it->Next() ) nb++; for ( it->Init( false ); it->More(); it->Next() ) nb++;
@ -696,7 +696,7 @@ bool SMESHGUI_Selection::isContainer( int ind ) const
int SMESHGUI_Selection::type( const QString& entry ) int SMESHGUI_Selection::type( const QString& entry )
{ {
int res = -1; int res = -1;
_PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toLatin1().data() ); _PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toUtf8().data() );
if ( obj ) { if ( obj ) {
_PTR(SObject) ref; _PTR(SObject) ref;
if ( obj->ReferencedObject( ref ) ) if ( obj->ReferencedObject( ref ) )
@ -792,7 +792,7 @@ QString SMESHGUI_Selection::typeName( const int t )
bool SMESHGUI_Selection::isImported( const int ind ) const bool SMESHGUI_Selection::isImported( const int ind ) const
{ {
bool res = false; bool res = false;
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().constData() );
if ( sobj ) if ( sobj )
{ {
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( sobj ) ); SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( sobj ) );
@ -822,7 +822,7 @@ int SMESHGUI_Selection::guiState()
QString SMESHGUI_Selection::groupType( int ind ) const QString SMESHGUI_Selection::groupType( int ind ) const
{ {
_PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() ); _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().constData() );
if ( sobj ) if ( sobj )
{ {
SMESH::SMESH_Group_var g = SMESH::SObjectToInterface<SMESH::SMESH_Group>( sobj ); SMESH::SMESH_Group_var g = SMESH::SObjectToInterface<SMESH::SMESH_Group>( sobj );

View File

@ -304,7 +304,7 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype
if( t<0 ) if( t<0 )
{ {
//try to get GEOM type //try to get GEOM type
_PTR( SObject ) sobj = aStudy->FindObjectID( str.toLatin1().data() ); _PTR( SObject ) sobj = aStudy->FindObjectID( str.toUtf8().data() );
if( sobj ) if( sobj )
{ {
GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow( GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
@ -327,7 +327,7 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype
int id = _id.toInt( &ok ); int id = _id.toInt( &ok );
if( ok ) if( ok )
{ {
_PTR( SObject ) sobj = aStudy->FindObjectID( entry.toLatin1().data() ); _PTR( SObject ) sobj = aStudy->FindObjectID( entry.toUtf8().data() );
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow( SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow(
dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() ); dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow( SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow(

View File

@ -314,7 +314,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
// GEOM_Object is published -> no need to UnRegister() // GEOM_Object is published -> no need to UnRegister()
myGeomObj = GEOM::GEOM_Object::_duplicate myGeomObj = GEOM::GEOM_Object::_duplicate
(SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement (SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) ); ( myMesh.in(), elemID, myDlg->myGeomName->text().toUtf8().constData()) );
} }
else else
{ {
@ -387,7 +387,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation()
QString aNewGeomGroupName ( myDlg->myGeomName->text() ); QString aNewGeomGroupName ( myDlg->myGeomName->text() );
SALOMEDS::SObject_wrap aNewGroupSO = SALOMEDS::SObject_wrap aNewGroupSO =
geomGen->AddInStudy( aGeomObject, geomGen->AddInStudy( aGeomObject,
aNewGeomGroupName.toLatin1().data(), aMeshShape); aNewGeomGroupName.toUtf8().data(), aMeshShape);
// get a GEOM_Object already published, which doesn't need UnRegister() // get a GEOM_Object already published, which doesn't need UnRegister()
CORBA::Object_var obj = aNewGroupSO->GetObject(); CORBA::Object_var obj = aNewGroupSO->GetObject();

View File

@ -382,7 +382,7 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
SUIT_OverrideCursor aWaitCursor; SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); myMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
if ( CheckBoxParametric->isChecked() ) { if ( CheckBoxParametric->isChecked() ) {
if(CheckBoxMesh->isChecked()) if(CheckBoxMesh->isChecked())

View File

@ -202,7 +202,7 @@ bool SMESHGUI_SplitBiQuadOp::onApply()
int nbObj = 0; int nbObj = 0;
for ( int i = 0; i < entries.count() ; ++i ) for ( int i = 0; i < entries.count() ; ++i )
{ {
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( entries[i].toLatin1().data() ); _PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( entries[i].toUtf8().data() );
SMESH::SMESH_IDSource_var obj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj ); SMESH::SMESH_IDSource_var obj = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj );
if( !CORBA::is_nil( obj )) if( !CORBA::is_nil( obj ))
{ {

View File

@ -512,12 +512,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) if(CheckBoxMesh->isChecked())
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, false ); aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, false );
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false ); aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
} }
break; break;
@ -528,12 +528,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) if(CheckBoxMesh->isChecked())
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->MirrorObjectMakeGroups(myObjects[i], aMirror, aMirrorType); groups = aMeshEditor->MirrorObjectMakeGroups(myObjects[i], aMirror, aMirrorType);
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType); groups = aMeshEditor->MirrorMakeGroups(anElementsId, aMirror, aMirrorType);
} }
} }
@ -541,12 +541,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) if(CheckBoxMesh->isChecked())
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, true); aMeshEditor->MirrorObject(myObjects[i], aMirror, aMirrorType, true);
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true); aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
} }
} }
@ -558,17 +558,17 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply()
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->MirrorObjectMakeMesh(myObjects[i], aMirror, aMirrorType, makeGroups, mesh = aMeshEditor->MirrorObjectMakeMesh(myObjects[i], aMirror, aMirrorType, makeGroups,
aName.toLatin1().data()); aName.toUtf8().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups, mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
LineEditNewMesh->text().toLatin1().data()); LineEditNewMesh->text().toUtf8().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
} }

View File

@ -520,12 +520,12 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) if(CheckBoxMesh->isChecked())
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->TranslateObject(myObjects[i], aVector, false); aMeshEditor->TranslateObject(myObjects[i], aVector, false);
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Translate(anElementsId, aVector, false); aMeshEditor->Translate(anElementsId, aVector, false);
} }
break; break;
@ -535,13 +535,13 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) { if(CheckBoxMesh->isChecked()) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->TranslateObjectMakeGroups(myObjects[i],aVector); groups = aMeshEditor->TranslateObjectMakeGroups(myObjects[i],aVector);
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
groups = aMeshEditor->TranslateMakeGroups(anElementsId, aVector); groups = aMeshEditor->TranslateMakeGroups(anElementsId, aVector);
} }
} }
@ -549,13 +549,13 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
if(CheckBoxMesh->isChecked()) { if(CheckBoxMesh->isChecked()) {
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->TranslateObject(myObjects[i], aVector, true); aMeshEditor->TranslateObject(myObjects[i], aVector, true);
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
aMeshEditor->Translate(anElementsId, aVector, true); aMeshEditor->Translate(anElementsId, aVector, true);
} }
} }
@ -566,18 +566,18 @@ bool SMESHGUI_TranslationDlg::ClickOnApply()
for ( int i = 0; i < myObjects.count(); i++ ) { for ( int i = 0; i < myObjects.count(); i++ ) {
QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) );
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[i]->GetMeshEditor();
myMeshes[i]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[i]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->TranslateObjectMakeMesh(myObjects[i], aVector, makeGroups, mesh = aMeshEditor->TranslateObjectMakeMesh(myObjects[i], aVector, makeGroups,
aName.toLatin1().data()); aName.toUtf8().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
} }
} }
else { else {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor();
myMeshes[0]->SetParameters(aParameters.join( ":" ).toLatin1().constData()); myMeshes[0]->SetParameters(aParameters.join( ":" ).toUtf8().constData());
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups, mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
LineEditNewMesh->text().toLatin1().data()); LineEditNewMesh->text().toUtf8().data());
if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) )
anEntryList.append( aSObject->GetID().c_str() ); anEntryList.append( aSObject->GetID().c_str() );
} }

View File

@ -135,7 +135,7 @@ namespace SMESH
{ {
if (getStudy()->GetProperties()->IsLocked()) if (getStudy()->GetProperties()->IsLocked())
return; return;
SMESHGUI::GetSMESHGen()->SetName(theSObject->GetIOR().c_str(), theName.toLatin1().data()); SMESHGUI::GetSMESHGen()->SetName(theSObject->GetIOR().c_str(), theName.toUtf8().data());
} }
void SetValue (_PTR(SObject) theSObject, const QString& theValue) void SetValue (_PTR(SObject) theSObject, const QString& theValue)
@ -148,7 +148,7 @@ namespace SMESH
aBuilder->FindOrCreateAttribute(theSObject, "AttributeComment"); aBuilder->FindOrCreateAttribute(theSObject, "AttributeComment");
_PTR(AttributeComment) aComment = anAttr; _PTR(AttributeComment) aComment = anAttr;
if (aComment) if (aComment)
aComment->SetValue(theValue.toLatin1().data()); aComment->SetValue(theValue.toUtf8().data());
} }
void setFileName (_PTR(SObject) theSObject, const QString& theValue) void setFileName (_PTR(SObject) theSObject, const QString& theValue)
@ -161,7 +161,7 @@ namespace SMESH
aBuilder->FindOrCreateAttribute(theSObject, "AttributeExternalFileDef"); aBuilder->FindOrCreateAttribute(theSObject, "AttributeExternalFileDef");
_PTR(AttributeExternalFileDef) aFileName = anAttr; _PTR(AttributeExternalFileDef) aFileName = anAttr;
if (aFileName) if (aFileName)
aFileName->SetValue(theValue.toLatin1().data()); aFileName->SetValue(theValue.toUtf8().data());
} }
void setFileType (_PTR(SObject) theSObject, const QString& theValue) void setFileType (_PTR(SObject) theSObject, const QString& theValue)
@ -174,7 +174,7 @@ namespace SMESH
aBuilder->FindOrCreateAttribute(theSObject, "AttributeFileType"); aBuilder->FindOrCreateAttribute(theSObject, "AttributeFileType");
_PTR(AttributeFileType) aFileType = anAttr; _PTR(AttributeFileType) aFileType = anAttr;
if (aFileType) if (aFileType)
aFileType->SetValue(theValue.toLatin1().data()); aFileType->SetValue(theValue.toUtf8().data());
} }
CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject ) CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject )

View File

@ -96,7 +96,7 @@ namespace
aDomainRoot = theStudyBuilder->NewObjectToTag(theSComponentMesh,theDomainRootTag); aDomainRoot = theStudyBuilder->NewObjectToTag(theSComponentMesh,theDomainRootTag);
SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeName"); SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aName->SetValue(theName.toLatin1().data()); aName->SetValue(theName.toUtf8().data());
aName->UnRegister(); aName->UnRegister();
anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributePixMap"); anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributePixMap");
SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
@ -226,7 +226,7 @@ namespace
SALOMEDS::GenericAttribute_var anAttr = SALOMEDS::GenericAttribute_var anAttr =
theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName"); theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aName->SetValue(theAppliedDomainMEN.toLatin1().data()); aName->SetValue(theAppliedDomainMEN.toUtf8().data());
aName->UnRegister(); aName->UnRegister();
anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable"); anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
@ -551,7 +551,7 @@ const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
aSubMeshesRoot = myStudyBuilder->NewObjectToTag(aMeshSO,aShapeTag); aSubMeshesRoot = myStudyBuilder->NewObjectToTag(aMeshSO,aShapeTag);
anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeName"); anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeName");
SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
aName->SetValue(aSubMeshName.toLatin1().data()); aName->SetValue(aSubMeshName.toUtf8().data());
aName->UnRegister(); aName->UnRegister();
anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeSelectable"); anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeSelectable");
SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);

View File

@ -1080,7 +1080,7 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const
try try
{ {
if( isCreation() ) if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() ); SMESH::SetName( SMESH::FindSObject( h ), myName->text().toUtf8().constData() );
// threshold // threshold
h->SetVarParameter( myThreshold->text().toLatin1().constData(), "SetSizeThreshold" ); h->SetVarParameter( myThreshold->text().toLatin1().constData(), "SetSizeThreshold" );
@ -1109,7 +1109,7 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const
params << myPointSpin[0]->text(); params << myPointSpin[0]->text();
params << myPointSpin[1]->text(); params << myPointSpin[1]->text();
params << myPointSpin[2]->text(); params << myPointSpin[2]->text();
h->SetVarParameter( params.join(":").toLatin1().constData(), "SetFixedPoint" ); h->SetVarParameter( params.join(":").toUtf8().constData(), "SetFixedPoint" );
params.clear(); params.clear();
SMESH::PointStruct ps; SMESH::PointStruct ps;
@ -1126,7 +1126,7 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const
params << spins[ax][1]->text(); params << spins[ax][1]->text();
params << spins[ax][2]->text(); params << spins[ax][2]->text();
} }
h->SetVarParameter( params.join(":").toLatin1().constData(), "SetAxesDirs" ); h->SetVarParameter( params.join(":").toUtf8().constData(), "SetAxesDirs" );
SMESH::DirStruct axDir[3]; SMESH::DirStruct axDir[3];
for ( int ax = 0; ax < 3; ++ax ) for ( int ax = 0; ax < 3; ++ax )

View File

@ -167,7 +167,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a )
QString aServLib = aHypData->ServerLibName; QString aServLib = aHypData->ServerLibName;
QString aHypType = aHypData->TypeName; QString aHypType = aHypData->TypeName;
try { try {
set( gen->CreateHypothesis(aHypType.toLatin1().data(), aServLib.toLatin1().data())); set( gen->CreateHypothesis(aHypType.toLatin1().data(), aServLib.toUtf8().data()));
} }
catch (const SALOME::SALOME_Exception & S_ex) { catch (const SALOME::SALOME_Exception & S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex); SalomeApp_Tools::QtCatchCorbaException(S_ex);

View File

@ -379,16 +379,16 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
try try
{ {
if( isCreation() ) if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() ); SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toUtf8().data() );
h->SetVarParameter( h_data.myNbSegVarName.toLatin1().constData(), "SetNumberOfSegments" ); h->SetVarParameter( h_data.myNbSegVarName.toUtf8().constData(), "SetNumberOfSegments" );
h->SetNumberOfSegments( h_data.myNbSeg ); h->SetNumberOfSegments( h_data.myNbSeg );
int distr = h_data.myDistrType; int distr = h_data.myDistrType;
if ( distr == 0 ) if ( distr == 0 )
h->SetDistrType( distr ); // this is actually needed at non-uniform -> uniform switch h->SetDistrType( distr ); // this is actually needed at non-uniform -> uniform switch
if( distr==1 ) { if( distr==1 ) {
h->SetVarParameter( h_data.myScaleVarName.toLatin1().constData(), "SetScaleFactor" ); h->SetVarParameter( h_data.myScaleVarName.toUtf8().constData(), "SetScaleFactor" );
h->SetScaleFactor( h_data.myScale ); h->SetScaleFactor( h_data.myScale );
} }
if( distr==2 || distr==3 ) if( distr==2 || distr==3 )
@ -403,7 +403,7 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
h->SetTableFunction( h_data.myTable ); h->SetTableFunction( h_data.myTable );
if( distr==3 ) if( distr==3 )
h->SetExpressionFunction( h_data.myExpr.toLatin1().data() ); h->SetExpressionFunction( h_data.myExpr.toUtf8().data() );
//setting of function must follow after setConversionMode, because otherwise //setting of function must follow after setConversionMode, because otherwise
//the function will be checked with old conversion mode, so that it may occurs //the function will be checked with old conversion mode, so that it may occurs
//unexpected errors for user //unexpected errors for user

View File

@ -249,7 +249,7 @@ QString StdMeshersGUI_QuadrangleParamCreator::storeParams() const
// name // name
if( myName ) if( myName )
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() ); SMESH::SetName( SMESH::FindSObject( h ), myName->text().toUtf8().constData() );
// transition // transition
h->SetQuadType( StdMeshers::QuadType( myTypeWdg->GetType()) ); h->SetQuadType( StdMeshers::QuadType( myTypeWdg->GetType()) );

View File

@ -467,7 +467,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
bool res = getStdParamFromDlg( params ); bool res = getStdParamFromDlg( params );
if( isCreation() ) if( isCreation() )
{ {
SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().toLatin1().data() ); SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().toUtf8().data() );
params.erase( params.begin() ); params.erase( params.begin() );
} }

View File

@ -578,7 +578,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState()
GEOM::GEOM_Object_var StdMeshersGUI_SubShapeSelectorWdg::GetGeomObjectByEntry( const QString& theEntry ) GEOM::GEOM_Object_var StdMeshersGUI_SubShapeSelectorWdg::GetGeomObjectByEntry( const QString& theEntry )
{ {
GEOM::GEOM_Object_var aGeomObj; GEOM::GEOM_Object_var aGeomObj;
SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.toLatin1().data() ); SALOMEDS::SObject_var aSObj = SMESH_Gen_i::getStudyServant()->FindObjectID( theEntry.toUtf8().data() );
if (!aSObj->_is_nil() ) if (!aSObj->_is_nil() )
{ {
CORBA::Object_var obj = aSObj->GetObject(); CORBA::Object_var obj = aSObj->GetObject();