diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 6bd4e2c62..b3527bc88 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -1085,7 +1085,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode ) } QString aTitle = QString(myScalarBarActor->GetTitle()); aTitle.replace(QRegExp("(:\\s).*"),"\\1"+ QString::number(GetNumberControlEntities())); - myScalarBarActor->SetTitle(aTitle.toLatin1().constData()); + myScalarBarActor->SetTitle(aTitle.toUtf8().constData()); } else { diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.cxx b/src/OBJECT/SMESH_PreviewActorsCollection.cxx index 4269c50ad..7fcd1bcb5 100644 --- a/src/OBJECT/SMESH_PreviewActorsCollection.cxx +++ b/src/OBJECT/SMESH_PreviewActorsCollection.cxx @@ -84,7 +84,7 @@ bool SMESH_PreviewActorsCollection::Init( const TopoDS_Shape& theShape, return false; // Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject(); - // anIO->setEntry( theEntry.toLatin1().constData() ); + // anIO->setEntry( theEntry.toUtf8().constData() ); // get indexes of seleted elements TopExp::MapShapes( theMainShape, myMapOfShapes ); @@ -248,7 +248,7 @@ void SMESH_PreviewActorsCollection::showCurrentChunk() QString entry = QString( "%1_%2" ).arg( myEntry ).arg( index ); // Create interactive object Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject(); - anIO->setEntry( entry.toLatin1().constData() ); + anIO->setEntry( entry.toUtf8().constData() ); // Init Actor anActor->SetVectorMode( myType==TopAbs_EDGE ); anActor->setIO( anIO ); diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx index 01595554c..ae06c0f10 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx @@ -175,7 +175,7 @@ GEOM::GEOM_Object_ptr SMESH_NumberFilter::getGeom _PTR(Study) study = appStudy->studyDS(); 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 ) ) aSO = aRefSO; diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx index a405af184..df5d538af 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx @@ -86,7 +86,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const _PTR(Study) study = appStudy->studyDS(); 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 ) ) obj = aRefSO; if (!obj) return false; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 797674b12..59c7b4e3a 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -6195,7 +6195,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) // 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. - _PTR(SObject) so = studyDS->FindObjectID(entry.toLatin1().data()); + _PTR(SObject) so = studyDS->FindObjectID(entry.toUtf8().data()); if (!so) continue; //Skip the not existent entry std::vector paramNames = ip->getAllParameterNames( *entIt ); @@ -6262,7 +6262,7 @@ void SMESHGUI::restoreVisualParameters (int savePoint) SMESH_Actor* aGeomAc = SMESH_Actor::SafeDownCast(ac); if (aGeomAc->hasIO()) { 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; vtkActors.Bind(viewIndex, aGeomAc); } @@ -6948,7 +6948,7 @@ void SMESHGUI::message( const QString& msg ) // get study _PTR(Study) study = dynamic_cast( application()->activeStudy() )->studyDS(); // get mesh name - _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() ); + _PTR(SObject) obj = study->FindObjectID( entry.toUtf8().constData() ); QString name; if ( obj ) name = SMESH::fromUtf8(obj->GetName()); diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx index a015b4181..990ca5c80 100644 --- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx @@ -442,7 +442,7 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply() QString groupName = myDlg->myGroupListCmBox->currentText(); SMESH::SMESH_IDSource_var newObj = - editor->Create0DElementsOnAllNodes( meshObject, groupName.toLatin1().data(), + editor->Create0DElementsOnAllNodes( meshObject, groupName.toUtf8().data(), myDlg->myDuplicateElemsChkBox->isChecked() ); int newNb0D = mesh->Nb0DElements() - prevNb0D; diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index 0cd63352b..e865d823e 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -268,7 +268,7 @@ QString SMESHGUI_BuildCompoundDlg::GetDefaultName(const QString& theOperation) bool isUnique = false; while (!isUnique) { aName = theOperation + "_" + QString::number(++aNumber); - isUnique = (aSet.count(aName.toLatin1().data()) == 0); + isUnique = (aSet.count(aName.toUtf8().data()) == 0); } return aName; @@ -299,7 +299,7 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply() try { aMesh = myMeshArray[0]->GetMesh(); - aMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + aMesh->SetParameters( aParameters.join(":").toUtf8().constData() ); SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); // concatenate meshes diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index 3c3363d6f..74b9f61e3 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1280,7 +1280,7 @@ void SMESHGUI_BaseComputeOp::onPublishShape() { QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" )); SALOMEDS::SObject_wrap so = geomGen->AddInStudy( myMainShape, - name.toLatin1().data(), + name.toUtf8().data(), GEOM::GEOM_Object::_nil()); // look for myMainShape in the table 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" )); SALOMEDS::SObject_wrap so = geomGen->AddInStudy( shape, - name.toLatin1().data(), myMainShape); + name.toUtf8().data(), myMainShape); if ( !so->_is_nil() ) { CORBA::String_var name = so->GetName(); CORBA::String_var entry = so->GetID(); @@ -1370,7 +1370,7 @@ void SMESHGUI_BaseComputeOp::onGroupOfBadMesh() else grName = "bad mesh of " + grName; SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen(); SMESH::ListOfGroups_var groups - ( gen->MakeGroupsOfBadInputElements(myMesh,curSub,grName.toLatin1().data()) ); + ( gen->MakeGroupsOfBadInputElements(myMesh,curSub,grName.toUtf8().data()) ); update( UF_ObjBrowser | UF_Model ); if( LightApp_Application* anApp = dynamic_cast( application() )) { diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx index 2e25f2c52..b2e7c993e 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx @@ -129,7 +129,7 @@ void SMESHGUI_ConvToQuadOp::selectionDone() try { 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; SMESH::SMESH_IDSource_var idSource = @@ -204,7 +204,7 @@ bool SMESHGUI_ConvToQuadOp::onApply() QString aMess; 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 ) { dlg()->show(); @@ -383,7 +383,7 @@ SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSourc void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id ) { 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; SMESH::SMESH_IDSource_var idSource = diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index b6609fcff..27e70ac43 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -331,7 +331,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); aPartToCopy = aMeshEditor->MakeIDSource( anElementsId, SMESH::ALL ); } - QByteArray meshName = myMeshNameEdit->text().toLatin1(); + QByteArray meshName = myMeshNameEdit->text().toUtf8(); bool toCopyGroups = ( myCopyGroupsCheck->isChecked() ); bool toKeepIDs = ( myKeepIdsCheck->isChecked() ); diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index 0f0611003..ab1d1e63b 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -399,7 +399,7 @@ void SMESHGUI_CreatePatternDlg::onSave() QFile aFile( fName ); aFile.open( QIODevice::WriteOnly ); - long aWritten = aFile.write( aData.toLatin1(), aLen ); + long aWritten = aFile.write( aData.toUtf8(), aLen ); aFile.close(); if ( aWritten != aLen ) { diff --git a/src/SMESHGUI/SMESHGUI_Displayer.cxx b/src/SMESHGUI/SMESHGUI_Displayer.cxx index 633d9196a..eb9852486 100644 --- a/src/SMESHGUI/SMESHGUI_Displayer.cxx +++ b/src/SMESHGUI/SMESHGUI_Displayer.cxx @@ -66,13 +66,13 @@ SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_ if( vtk_viewer ) { 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 ) - anActor = SMESH::CreateActor( entry.toLatin1().data(), true ); + anActor = SMESH::CreateActor( entry.toUtf8().data(), true ); if( anActor ) { SMESH::DisplayActor( wnd, anActor ); - prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame ); + prs = LightApp_Displayer::buildPresentation( entry.toUtf8().data(), aViewFrame ); } if( prs ) UpdatePrs( prs ); @@ -94,7 +94,7 @@ bool SMESHGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vi if(viewer_type != SVTK_Viewer::Type()) 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 ); /* diff --git a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx index 383c93685..16ad3b255 100644 --- a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx @@ -477,7 +477,7 @@ bool SMESHGUI_DuplicateNodesDlg::onApply() for ( int i = 0; i < myGroups1.count(); i++ ) { SMESH::SMESH_Group_var group = - aMeshEditor->DoubleElements( myGroups1[i], groupName.toLatin1().data() ); + aMeshEditor->DoubleElements( myGroups1[i], groupName.toUtf8().data() ); if ( group->_is_nil() ) { if ( toCreateElemGroup ) diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index 417d1f803..ff4d6c9b4 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -442,7 +442,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply() 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 edges = new SMESH::ListOfIDSources(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 7a37a1715..b46875689 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -1159,7 +1159,7 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() SMESH::SMESH_MeshEditor_var meshEditor = mesh->GetMeshEditor(); SMESH::ListOfGroups_var groups; - mesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + mesh->SetParameters( aParameters.join(":").toUtf8().constData() ); if ( ExtrMethod_RBut2->isVisible() && ExtrMethod_RBut2->isChecked() ) // Extrusion by normal diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index d0f3a6512..8c42b0c86 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -3198,7 +3198,7 @@ bool SMESHGUI_FilterDlg::isValid() const QString 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) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"), tr("BAD_SHAPE_NAME").arg(aName)); diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index acb75c273..ef1a2aa1b 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -430,7 +430,7 @@ bool SMESHGUI_FilterLibraryDlg::onApply() } if (myFileName->text() != myLibrary->GetFileName()) - myLibrary->SetFileName( myFileName->text().toLatin1().constData() ); + myLibrary->SetFileName( myFileName->text().toUtf8().constData() ); bool aResult = false; @@ -439,8 +439,8 @@ bool SMESHGUI_FilterLibraryDlg::onApply() } else if (myMode == EDIT || myMode == ADD_TO) { SMESH::Filter_var aFilter = createFilter(); if (!myListBox->selectedItems().empty() && - !myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), + !myLibrary->Replace(myCurrFilterName.toUtf8().constData(), + myName->text().toUtf8().constData(), aFilter.in())) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), tr("ERROR_OF_EDITING")); @@ -662,7 +662,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary() if (aFilterMgr->_is_nil()) return; - myLibrary = aFilterMgr->LoadLibrary(autoExtension(getFileName()).toLatin1().constData()); + myLibrary = aFilterMgr->LoadLibrary(autoExtension(getFileName()).toUtf8().constData()); if (myLibrary->_is_nil()) { if (myMode == COPY_FROM) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), @@ -670,7 +670,7 @@ void SMESHGUI_FilterLibraryDlg::processNewLibrary() return; } else { 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(); - myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), + myLibrary->Replace(myCurrFilterName.toUtf8().constData(), + myName->text().toUtf8().constData(), aFilter); } // 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; myCurrFilter = myListBox->currentRow(); myName->setText(theName); @@ -929,8 +929,8 @@ void SMESHGUI_FilterLibraryDlg::onAddBtnPressed() return; SMESH::Filter_var aFilter = createFilter(); - myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), + myLibrary->Replace(myCurrFilterName.toUtf8().constData(), + myName->text().toUtf8().constData(), aFilter); } myTable->Clear(myTable->GetType()); @@ -966,8 +966,8 @@ void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName) // add new filter in library bool aResult = !aFilter->GetPredicate()->_is_nil() - ? myLibrary->Add(aName.toLatin1().constData(), aFilter) - : myLibrary->AddEmpty(aName.toLatin1().constData(), (SMESH::ElementType)myTable->GetType()); + ? myLibrary->Add(aName.toUtf8().constData(), aFilter) + : myLibrary->AddEmpty(aName.toUtf8().constData(), (SMESH::ElementType)myTable->GetType()); if (!aResult) { SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), @@ -1087,7 +1087,7 @@ void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed() 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"), tr("ERROR_OF_DELETING")); } else { @@ -1179,8 +1179,8 @@ void SMESHGUI_FilterLibraryDlg::onNeedValidation() if (valid) { SMESH::Filter_var aFilter = createFilter(myTable->GetType()); - myLibrary->Replace(myCurrFilterName.toLatin1().constData(), - myName->text().toLatin1().constData(), + myLibrary->Replace(myCurrFilterName.toUtf8().constData(), + myName->text().toUtf8().constData(), aFilter); } } diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index dc1a29fa3..1425aaf2b 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -516,7 +516,7 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation) bool isUnique = false; while (!isUnique) { 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; @@ -531,7 +531,7 @@ void SMESHGUI_GroupDlg::setDefaultName() const do { aResName = aPrefix + QString::number( i++ ); - anObj = SMESH::getStudy()->FindObject( SMESH::toUtf8(aResName) ); + anObj = SMESH::getStudy()->FindObject( aResName.toUtf8().constData() ); } while ( anObj ); myName->setText(aResName); @@ -597,7 +597,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, SALOMEDS::Color aColor = theGroup->GetColor(); setGroupColor( aColor ); - myMeshGroupLine->setText(SMESH::fromUtf8(theGroup->GetName())); + myMeshGroupLine->setText(theGroup->GetName()); int aType = 0; switch(theGroup->GetType()) { @@ -684,7 +684,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, { myNameChanged = true; myName->blockSignals(true); - myName->setText(SMESH::fromUtf8(theGroup->GetName())); + myName->setText(theGroup->GetName()); myName->blockSignals(false); } @@ -1050,7 +1050,7 @@ bool SMESHGUI_GroupDlg::onApply() if (myGeomObjects->length() == 1) { myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - SMESH::toUtf8(myName->text()), + myName->text().toUtf8(), myGeomObjects[0]); } else { @@ -1091,11 +1091,11 @@ bool SMESHGUI_GroupDlg::onApply() aNewGeomGroupName += myName->text(); SALOMEDS::SObject_var aNewGroupSO = geomGen->AddInStudy(aGroupVar, - SMESH::toUtf8(aNewGeomGroupName), aMeshShape); + aNewGeomGroupName.toUtf8(), aMeshShape); } myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, - SMESH::toUtf8(myName->text()), + myName->text().toUtf8(), aGroupVar); } resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom ); @@ -1119,8 +1119,8 @@ bool SMESHGUI_GroupDlg::onApply() return false; myGroupOnFilter = myMesh->CreateGroupFromFilter(aType, - SMESH::toUtf8(myName->text()), - myFilter); + myName->text().toUtf8(), + myFilter); resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter ); isCreation = true; } @@ -1143,7 +1143,7 @@ bool SMESHGUI_GroupDlg::onApply() if( aMeshGroupSO ) anEntryList.append( aMeshGroupSO->GetID().c_str() ); - resultGroup->SetName(SMESH::toUtf8(myName->text().trimmed())); + resultGroup->SetName(myName->text().trimmed().toUtf8()); if ( isCreation ) { @@ -1174,7 +1174,7 @@ bool SMESHGUI_GroupDlg::onApply() if ( !anActor ) return false; myActorsList.append( anActor ); } - anActor->setName(SMESH::toUtf8(myName->text())); + anActor->setName(myName->text().toUtf8()); QColor c; int delta; switch ( myTypeId ) { diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx index 3c32b743e..ade4db03d 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx @@ -304,7 +304,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply() if ( !aStudy ) return false; // mesh - _PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() ); + _PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toUtf8().data() ); SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( meshSO ); if ( mesh->_is_nil() ) return false; @@ -330,7 +330,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply() for ( int i = 0; geomID != geomEnd; ++geomID, ++i ) { // 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(geomSO); if ( geom->_is_nil() ) continue; @@ -349,7 +349,7 @@ bool SMESHGUI_GroupOnShapeOp::onApply() // groupNames.append( name ); //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( _PTR(SObject) aSObject = SMESH::ObjectToSObject( group ) ) anEntryList.append( aSObject->GetID().c_str() ); @@ -462,7 +462,7 @@ void SMESHGUI_GroupOnShapeOp::selectionDone() // study if (_PTR(Study) aStudy = SMESH::getStudy()) { // mesh - if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toLatin1().data() )) { + if (_PTR(SObject) meshSO = aStudy->FindObjectID( myMeshID.toUtf8().data() )) { // shape to mesh _PTR(SObject) anObj, 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(); for (; id != idEnd; ++id, ++name ) { // 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 while ( shapeSO && shapeSO->GetID() != shapeToMesh->GetID() ) if ( shapeSO->Depth() < 2 ) diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index b4084b665..c89878cd6 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -652,7 +652,7 @@ bool SMESHGUI_UnionGroupsDlg::onApply() { SMESH::ListOfGroups_var aList = convert( myGroups ); SMESH::SMESH_Group_var aNewGrp = - aMesh->UnionListOfGroups( aList, aName.toLatin1().constData() ); + aMesh->UnionListOfGroups( aList, aName.toUtf8().constData() ); if ( !CORBA::is_nil( aNewGrp ) ) { aNewGrp->SetColor( getColor() ); @@ -761,7 +761,7 @@ bool SMESHGUI_IntersectGroupsDlg::onApply() { SMESH::ListOfGroups_var aList = convert( myGroups ); SMESH::SMESH_Group_var aNewGrp = - aMesh->IntersectListOfGroups( aList, aName.toLatin1().constData() ); + aMesh->IntersectListOfGroups( aList, aName.toUtf8().constData() ); if ( !CORBA::is_nil( aNewGrp ) ) { aNewGrp->SetColor( getColor() ); @@ -934,7 +934,7 @@ bool SMESHGUI_CutGroupsDlg::onApply() SMESH::ListOfGroups_var aList1 = convert( myGroups1 ); SMESH::ListOfGroups_var aList2 = convert( myGroups2 ); SMESH::SMESH_Group_var aNewGrp = - aMesh->CutListOfGroups( aList1, aList2, aName.toLatin1().constData() ); + aMesh->CutListOfGroups( aList1, aList2, aName.toUtf8().constData() ); if ( !CORBA::is_nil( aNewGrp ) ) { aNewGrp->SetColor( getColor() ); @@ -1120,7 +1120,7 @@ bool SMESHGUI_DimGroupDlg::onApply() (SMESH::NB_COMMON_NODES_ENUM) myNbNoCombo->currentIndex(); SMESH::SMESH_Group_var aNewGrp = - aMesh->CreateDimGroup( aList, anElemType, aName.toLatin1().constData(), + aMesh->CreateDimGroup( aList, anElemType, aName.toUtf8().constData(), aNbCoNodes, myUnderlOnlyChk->isChecked() ); if ( !CORBA::is_nil( aNewGrp ) ) { diff --git a/src/SMESHGUI/SMESHGUI_GroupUtils.cxx b/src/SMESHGUI/SMESHGUI_GroupUtils.cxx index fbdbd43f6..664e83672 100644 --- a/src/SMESHGUI/SMESHGUI_GroupUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupUtils.cxx @@ -42,7 +42,7 @@ namespace SMESH SMESH::SMESH_Group_var aGroup; try { if ( !theMesh->_is_nil() ) - aGroup = theMesh->CreateGroup( theType, SMESH::toUtf8(theGroupName) ); + aGroup = theMesh->CreateGroup( theType, theGroupName.toUtf8() ); } catch( const SALOME::SALOME_Exception& S_ex ) { SalomeApp_Tools::QtCatchCorbaException( S_ex ); diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.h b/src/SMESHGUI/SMESHGUI_Hypotheses.h index f989a49ff..933e5a67b 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.h +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.h @@ -90,7 +90,7 @@ protected: isVariable = false; } const char* text() const { - ((QByteArray&) myTextAsBytes) = myText.toLatin1(); return myTextAsBytes.constData(); + ((QByteArray&) myTextAsBytes) = myText.toUtf8(); return myTextAsBytes.constData(); } }; diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 2ca363488..232c9296b 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -521,7 +521,7 @@ namespace SMESH try { // load plugin library if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); - LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() ); + LibHandle libHandle = LoadLib( aClientLibName.toUtf8().data() ); if (!libHandle) { // report any error, if occurred { @@ -585,7 +585,7 @@ namespace SMESH try { SMESH::SMESH_Hypothesis_var aHypothesis; aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(), - aServLib.toLatin1().data()); + aServLib.toUtf8().data()); if (!aHypothesis->_is_nil()) { _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in()); if (aHypSObject) { @@ -613,7 +613,7 @@ namespace SMESH HypothesisData* aHypData = GetHypothesisData(aHypType); QString aServLib = aHypData->ServerLibName; return SMESHGUI::GetSMESHGen()->IsApplicable( aHypType.toLatin1().data(), - aServLib.toLatin1().data(), + aServLib.toUtf8().data(), theGeomObject, toCheckAll); } diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index 73c54eb1c..125c5ae19 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -302,7 +302,7 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() bool isMesh = true; 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( sobj ); //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 ) { 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( sobj ); if ( grp->_is_nil() ) { 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 ) { 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( sobj ); if ( !idSource->_is_nil() ) { SMESH::array_of_ElementType_var types = idSource->GetTypes(); @@ -427,7 +427,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) groups->length( entries.count() ); 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( sobj ); SMESH::array_of_ElementType_var types = grp->GetTypes(); if ( types->length() < 1 || types[0] != goodType ) @@ -450,8 +450,8 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) SMESH::SMESH_Group_var newGrp; SMESH::SMESH_Mesh_var newMesh; CORBA::Long nbAdded = aMeshEditor->MakeBoundaryElements( mode, - groupName.toLatin1().constData(), - meshName.toLatin1().constData(), + groupName.toUtf8().constData(), + meshName.toUtf8().constData(), copyAll, groups, newMesh.out(), @@ -468,7 +468,7 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh( QStringList& theEntryList ) ok = true; 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::RepaintCurrentView(); } diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index cd5a89ff5..4892b9192 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -528,7 +528,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply() if (aMeshEditor->_is_nil()) return true; - aMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + aMesh->SetParameters( aParameters.join(":").toUtf8().constData() ); bool ok; int anId = myDlg->myId->text().toInt( &ok ); diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index f9f5ab83a..314eabf52 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -329,7 +329,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const // 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; SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh ); @@ -354,7 +354,7 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); for ( ; aSubShapesIter != aGEOMs.end(); 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; GEOM::GEOM_Object_var aSubGeomVar = @@ -416,7 +416,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); 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 ) { QStringList algoNames; @@ -428,11 +428,11 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const if ( algo && algo->InputTypes.empty() && // builds all dimensions it-self !algo->IsSupportSubmeshes ) - return CORBA::string_dup( algoNames[0].toLatin1().data() ); + return CORBA::string_dup( algoNames[0].toUtf8().data() ); } // 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( pGeom ); // if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well @@ -443,7 +443,7 @@ char* SMESHGUI_MeshOp::isSubmeshIgnored() const if ( algo && algo->InputTypes.empty() && // builds all dimensions it-self !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 aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); - _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toLatin1().data() ); - _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toLatin1().data() ); + _PTR(SObject) pMesh = SMESH::getStudy()->FindObjectID( aMeshEntry.toUtf8().data() ); + _PTR(SObject) pGeom = SMESH::getStudy()->FindObjectID( aGeomEntry.toUtf8().data() ); if ( pMesh && pGeom ) { GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface( pGeom ); if ( !geom->_is_nil() ) { @@ -522,7 +522,7 @@ void SMESHGUI_MeshOp::selectionDone() //Check geometry for mesh 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) { SMESH::SMESH_Mesh_var aMeshVar = @@ -550,7 +550,7 @@ void SMESHGUI_MeshOp::selectionDone() int iSubSh = 0; for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { QString aSubGeomEntry = (*aSubShapesIter); - _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toLatin1().data()); + _PTR(SObject) pSubGeom = SMESH::getStudy()->FindObjectID(aSubGeomEntry.toUtf8().data()); if( pSubGeom ) { SALOMEDS_SObject* sobj = _CAST(SObject,pSubGeom); @@ -566,7 +566,7 @@ void SMESHGUI_MeshOp::selectionDone() } else { // get geometry by selected sub-mesh 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 ); if (!aGeomVar->_is_nil()) { aSeq->length(1); @@ -693,12 +693,12 @@ void SMESHGUI_MeshOp::selectionDone() // enable/disable popup for choice of geom selection way bool enable = false; 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( pMesh ); if ( !mesh->_is_nil() ) { //rnv: issue 21056: EDF 1608 SMESH: Dialog Box "Create Sub Mesh": focus should automatically switch to geometry 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() ) myDlg->activateObject(SMESHGUI_MeshDlg::Geom); enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 ); @@ -773,7 +773,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const { QString aMeshEntry = myDlg->selectedObject ( 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( pMesh ); if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) { theMess = tr( "IMPORTED_MESH" ); @@ -802,7 +802,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const } 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() ) { theMess = tr( "GEOMETRY_OBJECT_IS_NULL" ); @@ -818,7 +818,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const theMess = tr( "MESH_IS_NOT_DEFINED" ); 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() ) { theMess = tr( "MESH_IS_NULL" ); @@ -945,7 +945,7 @@ void SMESHGUI_MeshOp::availableHyps( const int theDim, QString aCurrentGeomToSelect; if ( !theMeshType.isEmpty() ) { 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 ); } if ( aCurrentGeomToSelect != myLastGeomToSelect ) @@ -1120,14 +1120,14 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, { anEntry = myDlg->selectedObject ( 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(); if ( myToCreate ) // mesh and geom may be selected { aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj ); 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() ); } 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 { 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() ); if ( !aMeshVar->_is_nil() ) @@ -1154,7 +1154,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, } if ( aGeomVar->_is_nil() ) { 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() ); } @@ -1162,14 +1162,14 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, } SMESH::SMESH_Hypothesis_var hyp = - SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(), - aServerLib.toLatin1().data(), + SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toUtf8().data(), + aServerLib.toUtf8().data(), aMeshVar, aGeomVar, /*byMesh = */isSubMesh); if ( hyp->_is_nil() && isSubMesh ) hyp = SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(), - aServerLib.toLatin1().data(), + aServerLib.toUtf8().data(), aMeshVar, aGeomVar, /*byMesh = */false); @@ -1197,13 +1197,13 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea aMeshEntry = aGeomEntry; 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 ); aMeshEntry = ( aGeomVar->_is_nil() ) ? QString() : SMESH::toQStr( aGeomVar->GetStudyEntry() ); } 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; GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj, &isMesh ); if ( !aGeomVar->_is_nil() ) @@ -1216,7 +1216,7 @@ void SMESHGUI_MeshOp::initHypCreator( SMESHGUI_GenericHypothesisCreator* theCrea if ( anObjEntry != "" && aGeomEntry != "" && aMeshEntry == "" ) { // 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 current object is sub-mesh 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 ) { 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::_narrow( _CAST( SObject,pGeom )->GetObject() ); @@ -1894,7 +1894,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList // get mesh object 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::_narrow( _CAST( SObject,pMesh )->GetObject() ); 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 = 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() ); } else if (aGEOMs.count() > 1) @@ -1934,7 +1934,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { 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::_narrow(_CAST(SObject,pSubGeom)->GetObject()); TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType(); @@ -1959,7 +1959,7 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess, QStringList& theEntryList aNewGeomGroupName += aName; SALOMEDS::SObject_wrap aNewGroupSO = 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; // 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() ); if ( aSubMeshSO ) { - SMESH::SetName( aSubMeshSO, aName.toLatin1().data() ); + SMESH::SetName( aSubMeshSO, aName.toUtf8().data() ); theEntryList.append( aSubMeshSO->GetID().c_str() ); } @@ -2124,7 +2124,7 @@ void SMESHGUI_MeshOp::setDefaultName( const QString& thePrefix ) const do { aResName = aPrefix + QString::number( i++ ); - anObj = aStudy->FindObject( aResName.toLatin1().data() ); + anObj = aStudy->FindObject( aResName.toUtf8().data() ); } while ( anObj ); @@ -2229,7 +2229,7 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim ) void SMESHGUI_MeshOp::readMesh() { 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 ) return; @@ -2395,7 +2395,7 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess ) return false; 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 ) return false; @@ -2578,7 +2578,7 @@ void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh ) } // set mesh object to SMESHGUI_ShapeByMeshOp and start it 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::_narrow( _CAST( SObject,pMesh )->GetObject() ); if ( !aMeshVar->_is_nil() ) { @@ -2607,7 +2607,7 @@ void SMESHGUI_MeshOp::onPublishShapeByMeshDlg(SUIT_Operation* op) if ( !aGeomVar->_is_nil() ) { 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 ); selectionDone(); } diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index 8b0bd227c..26ab55954 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -475,7 +475,7 @@ bool SMESHGUI_MeshPatternDlg::onApply() aParameters << myNode1->text(); if(myType == Type_3d ) aParameters << myNode2->text(); - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + myMesh->SetParameters( aParameters.join(":").toUtf8().constData() ); } QList ids; getIds(ids); @@ -1149,7 +1149,7 @@ bool SMESHGUI_MeshPatternDlg::loadFromFile (const QString& theName) try { SMESH::SMESH_Pattern_var aPattern = SMESH::GetPattern(); - if (!aPattern->LoadFromFile(theName.toLatin1().data()) || + if (!aPattern->LoadFromFile(theName.toUtf8().data()) || (myType == Type_2d && !aPattern->Is2D())) { SMESH::SMESH_Pattern::ErrorCode aCode = aPattern->GetErrorCode(); QString aMess; diff --git a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx index 0e322fc4a..0d5bfb73f 100644 --- a/src/SMESHGUI/SMESHGUI_MeshUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshUtils.cxx @@ -66,7 +66,7 @@ namespace SMESH theBaseName : theBaseName + "_" + thePostfix; if ( _PTR(Study) aStudy = getStudy() ) { QString name = baseName; - while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) { + while ( !aStudy->FindObjectByName( name.toUtf8().data(), "SMESH" ).empty() ) { int nb = 0; QStringList names = name.split("_", QString::KeepEmptyParts); if ( names.count() > 0 ) { diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index 2c0ae0eda..b3a43c861 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -1196,7 +1196,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito { QStringList aParameters; aParameters << myMaxAngleSpin->text(); - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + myMesh->SetParameters( aParameters.join(":").toUtf8().constData() ); } SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor(); 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[1]->text(); aParameters << myDirSpin[2]->text(); - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + myMesh->SetParameters( aParameters.join(":").toUtf8().constData() ); SMESH::PointStruct_var point = new SMESH::PointStruct; point->x = myPointSpin[0]->GetValue(); diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index 5f2f2d921..fb44fa471 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -100,7 +100,7 @@ namespace SMESH try { _PTR(SObject) aSobj = SMESH::FindSObject( theMesh ); 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 ); if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( aSobj->GetID().c_str() ) ) { aVisualObj->Update( true ); diff --git a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx index f6f72edb2..22bf3cf3a 100644 --- a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx @@ -693,7 +693,7 @@ bool SMESHGUI_ReorientFacesOp::onApply() point.y = myDlg->myY->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 ); } @@ -728,7 +728,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg ) { // check object 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() ); if ( myObject->_is_nil() ) { @@ -749,7 +749,7 @@ bool SMESHGUI_ReorientFacesOp::isValid( QString& msg ) if ( myDlg->myConstructorGrp->checkedId() == CONSTRUCTOR_VOLUME ) { 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 ); if ( myVolumeObj->_is_nil() ) { diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index f23c6d2f6..73d3991af 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -436,7 +436,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply() 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 edges = new SMESH::ListOfIDSources(); diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 291d908dd..d647c0244 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -446,13 +446,13 @@ bool SMESHGUI_RotationDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) { for ( int i = 0; i < myObjects.count(); i++ ) { 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); } } else { 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); } break; @@ -462,13 +462,13 @@ bool SMESHGUI_RotationDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) { for ( int i = 0; i < myObjects.count(); i++ ) { 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); } } else { 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); } } @@ -476,13 +476,13 @@ bool SMESHGUI_RotationDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) { for ( int i = 0; i < myObjects.count(); i++ ) { 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); } } else { 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); } } @@ -493,9 +493,9 @@ bool SMESHGUI_RotationDlg::ClickOnApply() for ( int i = 0; i < myObjects.count(); i++ ) { QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); 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, - aName.toLatin1().data()); + aName.toUtf8().data()); if (!mesh->_is_nil()) { if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); @@ -504,9 +504,9 @@ bool SMESHGUI_RotationDlg::ClickOnApply() } else { 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, - LineEditNewMesh->text().toLatin1().data()); + LineEditNewMesh->text().toUtf8().data()); if (!mesh->_is_nil()) { if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index 001ee7d94..e86d61c80 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -484,13 +484,13 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() if ( CheckBoxMesh->isChecked() ) for ( int i = 0; i < myObjects.count(); i++ ) { 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); } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); 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); } break; @@ -501,13 +501,13 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) for ( int i = 0; i < myObjects.count(); i++ ) { 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); } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); 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); } } @@ -515,14 +515,14 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) { for ( int i = 0; i < myObjects.count(); i++ ) { 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); } } else { SMESH::SMESH_MeshEditor_var aMeshEditor = myMeshes[0]->GetMeshEditor(); 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); } } @@ -534,19 +534,19 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() for ( int i = 0; i < myObjects.count(); i++ ) { QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); 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, - aName.toLatin1().data()); + aName.toUtf8().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); } } else { 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); mesh = aMeshEditor->ScaleMakeMesh( src, aPoint, aScaleFact, makeGroups, - LineEditNewMesh->text().toLatin1().data()); + LineEditNewMesh->text().toUtf8().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); } diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index a8704b8b9..450fda119 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -198,7 +198,7 @@ QList SMESHGUI_Selection::elemTypes( int ind, bool fromObj ) const { 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 ); SMESH::SMESH_IDSource_var idSrc = SMESH::SMESH_IDSource::_narrow( obj ); if ( !CORBA::is_nil( idSrc ) ) @@ -263,7 +263,7 @@ QString SMESHGUI_Selection::displayMode( 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 ) return false; SMESH::SMESH_IDSource_var idSource = SMESH::SObjectToInterface( so ); @@ -465,7 +465,7 @@ bool SMESHGUI_Selection::isAutoColor( int ind ) const { 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 ); 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" ) { - _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 ); if ( !CORBA::is_nil( obj ) ) { @@ -517,7 +517,7 @@ int SMESHGUI_Selection::dim( int ind ) const int dim = -1; 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 ); if ( !CORBA::is_nil( obj ) ) { @@ -552,7 +552,7 @@ bool SMESHGUI_Selection::isComputable( int ind ) const myTypes[ind].startsWith("Mesh " ))) { QMap 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(); 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 { QMap 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 ); if ( modeMap.size() > 1 ) 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" ) { - _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 ); return !shape->_is_nil(); } @@ -614,7 +614,7 @@ bool SMESHGUI_Selection::isEditableHyp( int ind ) const bool isEditable = true; 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( so ); if ( !hyp->_is_nil() ) { @@ -633,7 +633,7 @@ bool SMESHGUI_Selection::isVisible( int ind ) const { 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 ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() ) return aViewWindow->isVisible( actor->getIO() ); @@ -651,7 +651,7 @@ bool SMESHGUI_Selection::hasChildren( int ind ) const { 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 ) return SMESH::getStudy()->GetUseCaseBuilder()->HasChildren( sobj ); } @@ -669,7 +669,7 @@ int SMESHGUI_Selection::nbChildren( int ind ) const if ( ind >= 0 ) { _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 ) ) { _PTR(UseCaseIterator) it = study->GetUseCaseBuilder()->GetUseCaseIterator( sobj ); 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 res = -1; - _PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toLatin1().data() ); + _PTR(SObject) obj = SalomeApp_Application::getStudy()->FindObjectID( entry.toUtf8().data() ); if ( obj ) { _PTR(SObject) 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 res = false; - _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() ); + _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().constData() ); if ( 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 { - _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toLatin1().constData() ); + _PTR(SObject) sobj = SMESH::getStudy()->FindObjectID( entry( ind ).toUtf8().constData() ); if ( sobj ) { SMESH::SMESH_Group_var g = SMESH::SObjectToInterface( sobj ); diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index ed560b87e..bbf493e35 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -304,7 +304,7 @@ int SMESHGUI_SelectionOp::typeById( const QString& str, const EntityType objtype if( t<0 ) { //try to get GEOM type - _PTR( SObject ) sobj = aStudy->FindObjectID( str.toLatin1().data() ); + _PTR( SObject ) sobj = aStudy->FindObjectID( str.toUtf8().data() ); if( sobj ) { 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 ); 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( dynamic_cast( sobj.get() )->GetObject() ); SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow( diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index 5d82de8be..73d9727dc 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -314,7 +314,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() // GEOM_Object is published -> no need to UnRegister() myGeomObj = GEOM::GEOM_Object::_duplicate (SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement - ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) ); + ( myMesh.in(), elemID, myDlg->myGeomName->text().toUtf8().constData()) ); } else { @@ -387,7 +387,7 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() QString aNewGeomGroupName ( myDlg->myGeomName->text() ); SALOMEDS::SObject_wrap aNewGroupSO = geomGen->AddInStudy( aGeomObject, - aNewGeomGroupName.toLatin1().data(), aMeshShape); + aNewGeomGroupName.toUtf8().data(), aMeshShape); // get a GEOM_Object already published, which doesn't need UnRegister() CORBA::Object_var obj = aNewGroupSO->GetObject(); diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 3f79c3292..5c27f3bd8 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -382,7 +382,7 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - myMesh->SetParameters( aParameters.join(":").toLatin1().constData() ); + myMesh->SetParameters( aParameters.join(":").toUtf8().constData() ); if ( CheckBoxParametric->isChecked() ) { if(CheckBoxMesh->isChecked()) diff --git a/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx b/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx index 75e03affb..6bd868a80 100644 --- a/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx +++ b/src/SMESHGUI/SMESHGUI_SplitBiQuad.cxx @@ -202,7 +202,7 @@ bool SMESHGUI_SplitBiQuadOp::onApply() int nbObj = 0; 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( pObj ); if( !CORBA::is_nil( obj )) { diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index f994189fd..873c8a4b8 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -512,12 +512,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) for ( int i = 0; i < myObjects.count(); i++ ) { 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 ); } else { 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 ); } break; @@ -528,12 +528,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) for ( int i = 0; i < myObjects.count(); i++ ) { 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); } else { 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); } } @@ -541,12 +541,12 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) for ( int i = 0; i < myObjects.count(); i++ ) { 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); } else { 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); } } @@ -558,17 +558,17 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() for ( int i = 0; i < myObjects.count(); i++ ) { QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); 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, - aName.toLatin1().data()); + aName.toUtf8().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); } else { 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, - LineEditNewMesh->text().toLatin1().data()); + LineEditNewMesh->text().toUtf8().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); } diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 21342aebd..ecd742a77 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -520,12 +520,12 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) for ( int i = 0; i < myObjects.count(); i++ ) { 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); } else { 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); } break; @@ -535,13 +535,13 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) { for ( int i = 0; i < myObjects.count(); i++ ) { 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); } } else { 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); } } @@ -549,13 +549,13 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() if(CheckBoxMesh->isChecked()) { for ( int i = 0; i < myObjects.count(); i++ ) { 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); } } else { 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); } } @@ -566,18 +566,18 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() for ( int i = 0; i < myObjects.count(); i++ ) { QString aName = SMESH::UniqueMeshName( LineEditNewMesh->text().replace( "*", myObjectsNames[i] ) ); 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, - aName.toLatin1().data()); + aName.toUtf8().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); } } else { 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, - LineEditNewMesh->text().toLatin1().data()); + LineEditNewMesh->text().toUtf8().data()); if( _PTR(SObject) aSObject = SMESH::ObjectToSObject( mesh ) ) anEntryList.append( aSObject->GetID().c_str() ); } diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index e6fdb1c15..17d8b4302 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -135,7 +135,7 @@ namespace SMESH { if (getStudy()->GetProperties()->IsLocked()) 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) @@ -148,7 +148,7 @@ namespace SMESH aBuilder->FindOrCreateAttribute(theSObject, "AttributeComment"); _PTR(AttributeComment) aComment = anAttr; if (aComment) - aComment->SetValue(theValue.toLatin1().data()); + aComment->SetValue(theValue.toUtf8().data()); } void setFileName (_PTR(SObject) theSObject, const QString& theValue) @@ -161,7 +161,7 @@ namespace SMESH aBuilder->FindOrCreateAttribute(theSObject, "AttributeExternalFileDef"); _PTR(AttributeExternalFileDef) aFileName = anAttr; if (aFileName) - aFileName->SetValue(theValue.toLatin1().data()); + aFileName->SetValue(theValue.toUtf8().data()); } void setFileType (_PTR(SObject) theSObject, const QString& theValue) @@ -174,7 +174,7 @@ namespace SMESH aBuilder->FindOrCreateAttribute(theSObject, "AttributeFileType"); _PTR(AttributeFileType) aFileType = anAttr; if (aFileType) - aFileType->SetValue(theValue.toLatin1().data()); + aFileType->SetValue(theValue.toUtf8().data()); } CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject ) diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx index a5a5dfe01..7bab7fe59 100644 --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx @@ -96,7 +96,7 @@ namespace aDomainRoot = theStudyBuilder->NewObjectToTag(theSComponentMesh,theDomainRootTag); SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeName"); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(theName.toLatin1().data()); + aName->SetValue(theName.toUtf8().data()); aName->UnRegister(); anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributePixMap"); SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr); @@ -226,7 +226,7 @@ namespace SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName"); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(theAppliedDomainMEN.toLatin1().data()); + aName->SetValue(theAppliedDomainMEN.toUtf8().data()); aName->UnRegister(); anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable"); 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); anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeName"); SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr); - aName->SetValue(aSubMeshName.toLatin1().data()); + aName->SetValue(aSubMeshName.toUtf8().data()); aName->UnRegister(); anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeSelectable"); SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr); diff --git a/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx index 88ea48899..e016bb1ea 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_CartesianParamCreator.cxx @@ -1080,7 +1080,7 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const try { if( isCreation() ) - SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() ); + SMESH::SetName( SMESH::FindSObject( h ), myName->text().toUtf8().constData() ); // threshold h->SetVarParameter( myThreshold->text().toLatin1().constData(), "SetSizeThreshold" ); @@ -1109,7 +1109,7 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const params << myPointSpin[0]->text(); params << myPointSpin[1]->text(); params << myPointSpin[2]->text(); - h->SetVarParameter( params.join(":").toLatin1().constData(), "SetFixedPoint" ); + h->SetVarParameter( params.join(":").toUtf8().constData(), "SetFixedPoint" ); params.clear(); SMESH::PointStruct ps; @@ -1126,7 +1126,7 @@ QString StdMeshersGUI_CartesianParamCreator::storeParams() const params << spins[ax][1]->text(); params << spins[ax][2]->text(); } - h->SetVarParameter( params.join(":").toLatin1().constData(), "SetAxesDirs" ); + h->SetVarParameter( params.join(":").toUtf8().constData(), "SetAxesDirs" ); SMESH::DirStruct axDir[3]; for ( int ax = 0; ax < 3; ++ax ) diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx index 9f1de0c28..4604833ed 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx @@ -167,7 +167,7 @@ void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a ) QString aServLib = aHypData->ServerLibName; QString aHypType = aHypData->TypeName; 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) { SalomeApp_Tools::QtCatchCorbaException(S_ex); diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index 0d095e26b..35fdefcfa 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -379,16 +379,16 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe try { 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 ); int distr = h_data.myDistrType; if ( distr == 0 ) h->SetDistrType( distr ); // this is actually needed at non-uniform -> uniform switch if( distr==1 ) { - h->SetVarParameter( h_data.myScaleVarName.toLatin1().constData(), "SetScaleFactor" ); + h->SetVarParameter( h_data.myScaleVarName.toUtf8().constData(), "SetScaleFactor" ); h->SetScaleFactor( h_data.myScale ); } if( distr==2 || distr==3 ) @@ -403,7 +403,7 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe h->SetTableFunction( h_data.myTable ); 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 //the function will be checked with old conversion mode, so that it may occurs //unexpected errors for user diff --git a/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx index c608923bd..42c6ac2b9 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx @@ -249,7 +249,7 @@ QString StdMeshersGUI_QuadrangleParamCreator::storeParams() const // name if( myName ) - SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() ); + SMESH::SetName( SMESH::FindSObject( h ), myName->text().toUtf8().constData() ); // transition h->SetQuadType( StdMeshers::QuadType( myTypeWdg->GetType()) ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 72ed9ba54..a3d42ddad 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -467,7 +467,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const bool res = getStdParamFromDlg( params ); 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() ); } diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx index a3a54de51..017d77876 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.cxx @@ -578,7 +578,7 @@ void StdMeshersGUI_SubShapeSelectorWdg::updateState() GEOM::GEOM_Object_var StdMeshersGUI_SubShapeSelectorWdg::GetGeomObjectByEntry( const QString& theEntry ) { 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() ) { CORBA::Object_var obj = aSObj->GetObject();