This commit is contained in:
Paul RASCLE 2018-07-18 15:51:52 +02:00
commit e330934ca6
58 changed files with 247 additions and 243 deletions

View File

@ -291,7 +291,7 @@ namespace SMESH{
/*
Class : Length2D
Description : Functor for calculating length of edge
Description : Functor for calculating minimal length of edge
*/
class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
public:

View File

@ -1106,7 +1106,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 {

View File

@ -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 );

View File

@ -804,33 +804,20 @@ bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face& F,
// check that uv is correct
TopLoc_Location loc;
Handle(Geom_Surface) surface = BRep_Tool::Surface( F,loc );
gp_Pnt nodePnt = XYZ( n ), surfPnt(0,0,0);
SMESH_NodeXYZ nXYZ( n );
gp_Pnt nodePnt = nXYZ, surfPnt(0,0,0);
double dist = 0;
if ( !loc.IsIdentity() ) nodePnt.Transform( loc.Transformation().Inverted() );
if ( infinit ||
(dist = nodePnt.Distance( surfPnt = surface->Value( uv.X(), uv.Y() ))) > tol )
{
setPosOnShapeValidity( shapeID, false );
if ( !infinit && distXYZ ) {
surfPnt.Transform( loc );
distXYZ[0] = dist;
distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
}
// uv incorrect, project the node to surface
GeomAPI_ProjectPointOnSurf& projector = GetProjector( F, loc, tol );
projector.Perform( nodePnt );
if ( !projector.IsDone() || projector.NbPoints() < 1 )
{
MESSAGE( "SMESH_MesherHelper::CheckNodeUV() failed to project" );
return false;
}
Standard_Real U,V;
projector.LowerDistanceParameters(U,V);
uv.SetCoord( U,V );
surfPnt = surface->Value( U, V );
dist = nodePnt.Distance( surfPnt );
Handle(ShapeAnalysis_Surface) sprojector = GetSurface( F );
uv = sprojector->ValueOfUV( nXYZ, tol ).XY();
surfPnt = sprojector->Value( uv );
dist = surfPnt.Distance( nXYZ );
if ( distXYZ ) {
surfPnt.Transform( loc );
distXYZ[0] = dist;
distXYZ[1] = surfPnt.X(); distXYZ[2] = surfPnt.Y(); distXYZ[3]=surfPnt.Z();
}
@ -842,7 +829,7 @@ bool SMESH_MesherHelper::CheckNodeUV(const TopoDS_Face& F,
// store the fixed UV on the face
if ( myShape.IsSame(F) && shapeID == myShapeID && myFixNodeParameters )
const_cast<SMDS_MeshNode*>(n)->SetPosition
( SMDS_PositionPtr( new SMDS_FacePosition( U, V )));
( SMDS_PositionPtr( new SMDS_FacePosition( uv.X(), uv.Y() )));
}
else if ( myShape.IsSame(F) && uv.Modulus() > numeric_limits<double>::min() )
{

View File

@ -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;

View File

@ -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;

View File

@ -6259,7 +6259,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<std::string> paramNames = ip->getAllParameterNames( *entIt );
@ -6326,7 +6326,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);
}
@ -7012,7 +7012,7 @@ void SMESHGUI::message( const QString& msg )
// get study
_PTR(Study) study = dynamic_cast<SalomeApp_Study*>( 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());
@ -7121,7 +7121,7 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
aType == SMESH::SUBMESH_EDGE || aType == SMESH::SUBMESH_VERTEX ||
aType == SMESH::HYPOTHESIS || aType == SMESH::ALGORITHM) {
if ( !name.isEmpty() ) {
SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), qPrintable(name) );
SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), qUtf8Printable(name) );
// update name of group object and its actor
Handle(SALOME_InteractiveObject) IObject =
@ -7131,7 +7131,7 @@ bool SMESHGUI::renameObject( const QString& entry, const QString& name) {
if( !aGroupObject->_is_nil() ) {
aGroupObject->SetName( qPrintable(name) );
if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( qPrintable(entry) ) )
anActor->setName( qPrintable(name) );
anActor->setName( qUtf8Printable(name) );
}
return true;
}

View File

@ -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;

View File

@ -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

View File

@ -1276,7 +1276,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 ) {
@ -1295,7 +1295,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();
@ -1366,7 +1366,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<LightApp_Application*>( application() ))
{

View File

@ -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 =

View File

@ -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() );

View File

@ -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 ) {

View File

@ -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 );
/*

View File

@ -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 )

View File

@ -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();

View File

@ -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

View File

@ -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));

View File

@ -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);
}
}

View File

@ -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 ) {

View File

@ -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<SMESH::SMESH_Mesh>( 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<GEOM::GEOM_Object>(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 )

View File

@ -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 ) )
{

View File

@ -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 );

View File

@ -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();
}
};

View File

@ -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);
}

View File

@ -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<SMESH::SMESH_Mesh>( 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<SMESH::SMESH_GroupBase>( 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<SMESH::SMESH_IDSource>( 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<SMESH::SMESH_IDSource>( 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();
}

View File

@ -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 );

View File

@ -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<SMESH::SMESH_Mesh>( 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<GEOM::GEOM_Object>( 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<GEOM::GEOM_Object>( 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<SMESH::SMESH_Mesh>( 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<SMESH::SMESH_Mesh>( 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();
}

View File

@ -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<int> 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;

View File

@ -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 ) {

View File

@ -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();

View File

@ -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 );

View File

@ -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() )
{

View File

@ -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();

View File

@ -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() );

View File

@ -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() );
}

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" )
{
_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<SMESH::SMESH_IDSource>( so );
@ -466,7 +466,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 ) ) {
@ -487,7 +487,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 ) ) {
@ -518,7 +518,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 ) ) {
@ -553,7 +553,7 @@ bool SMESHGUI_Selection::isComputable( int ind ) const
myTypes[ind].startsWith("Mesh " )))
{
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();
if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
@ -579,7 +579,7 @@ bool SMESHGUI_Selection::isPreComputable( int ind ) const
if ( maxDim < 2 ) // we can preview 1D or 2D
{
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 );
if ( modeMap.size() > 1 )
return (( modeMap.contains( SMESH::DIM_3D )) ||
@ -598,7 +598,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();
}
@ -615,7 +615,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<SMESH::SMESH_Hypothesis>( so );
if ( !hyp->_is_nil() )
{
@ -634,7 +634,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() );
@ -652,7 +652,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 );
}
@ -670,7 +670,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++;
@ -697,7 +697,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 ) )
@ -793,7 +793,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 ) );
@ -823,7 +823,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<SMESH::SMESH_Group>( sobj );

View File

@ -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<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
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()
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();

View File

@ -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())

View File

@ -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<SMESH::SMESH_IDSource>( pObj );
if( !CORBA::is_nil( obj ))
{

View File

@ -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() );
}

View File

@ -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() );
}

View File

@ -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 )

View File

@ -4016,7 +4016,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
const char* theURL,
bool isMultiFile )
{
if (!myStudyContext)
//if (!myStudyContext)
UpdateStudy();
SALOMEDS::Study_var aStudy = getStudyServant();
/* if( !theComponent->_is_nil() )

View File

@ -165,7 +165,7 @@ bool SMESH_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR)
{
if(MYDEBUG) MESSAGE("CanPublishInStudy - "<<!CORBA::is_nil(getStudyServant()));
if( !myIsEnablePublish )
if ( !myIsEnablePublish )
return false;
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(theIOR);
@ -479,6 +479,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObje
{
Unexpect aCatch(SALOME_SalomeException);
SALOMEDS::SObject_wrap aSO;
if ( !myIsEnablePublish )
return aSO._retn();
if ( CORBA::is_nil( theIOR ))
return aSO._retn();
if(MYDEBUG) MESSAGE("PublishInStudy");
@ -521,6 +523,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObje
SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
{
if(MYDEBUG) MESSAGE("PublishComponent");
if ( !myIsEnablePublish )
return SALOMEDS::SComponent::_nil();
SALOMEDS::StudyBuilder_var aStudyBuilder = getStudyServant()->NewBuilder();
SALOMEDS::UseCaseBuilder_wrap useCaseBuilder = getStudyServant()->GetUseCaseBuilder();
@ -572,8 +576,10 @@ SALOMEDS::SComponent_ptr SMESH_Gen_i::PublishComponent()
SALOMEDS::SObject_ptr SMESH_Gen_i::PublishMesh (SMESH::SMESH_Mesh_ptr theMesh,
const char* theName)
{
if ( !myIsEnablePublish )
return SALOMEDS::SObject::_nil();
if ( CORBA::is_nil( theMesh ))
return SALOMEDS::SComponent::_nil();
return SALOMEDS::SObject::_nil();
if(MYDEBUG) MESSAGE("PublishMesh--IN");
// find or publish a mesh
@ -659,6 +665,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishSubMesh (SMESH::SMESH_Mesh_ptr theM
GEOM::GEOM_Object_ptr theShapeObject,
const char* theName)
{
if ( !myIsEnablePublish )
return SALOMEDS::SObject::_nil();
if ( theMesh->_is_nil() || theSubMesh->_is_nil() || theShapeObject->_is_nil() )
return SALOMEDS::SObject::_nil();
@ -749,6 +757,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SMESH::SMESH_Mesh_ptr theMesh,
GEOM::GEOM_Object_ptr theShapeObject,
const char* theName)
{
if ( !myIsEnablePublish )
return SALOMEDS::SObject::_nil();
if (theMesh->_is_nil() || theGroup->_is_nil() )
return SALOMEDS::SObject::_nil();
@ -823,6 +833,8 @@ SALOMEDS::SObject_ptr
const char* theName)
{
if(MYDEBUG) MESSAGE("PublishHypothesis")
if ( !myIsEnablePublish )
return SALOMEDS::SObject::_nil();
if (theHyp->_is_nil())
return SALOMEDS::SObject::_nil();

View File

@ -1176,26 +1176,28 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
}
// import python files corresponding to plugins if they are used in anUpdatedScript
{
TCollection_AsciiString importStr;
//TCollection_AsciiString importStr;
std::vector<std::string> pluginNames = getPluginNames();
for ( size_t i = 0; i < pluginNames.size(); ++i )
{
// Convert access to plugin members:
// e.g. StdMeshers.QUAD_REDUCED -> StdMeshersBuilder.QUAD_REDUCED
// e.g. StdMeshers.QUAD_REDUCED -> smeshBuilder.QUAD_REDUCED
TCollection_AsciiString pluginAccess = (pluginNames[i] + ".").c_str() ;
int iFrom = 1, iPos;
while (( iPos = anUpdatedScript.Location( pluginAccess, iFrom, anUpdatedScript.Length() )))
{
anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
iFrom = iPos + pluginNames[i].size() + 8;
//anUpdatedScript.Insert( iPos + pluginNames[i].size(), "Builder" );
anUpdatedScript.Remove( iPos, pluginNames[i].size() );
anUpdatedScript.Insert( iPos, "smeshBuilder" );
iFrom = iPos - pluginNames[i].size() + 12;
}
// if any plugin member is used, import the plugin
if ( iFrom > 1 )
importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
" import " + pluginNames[i].c_str() +"Builder" );
// if ( iFrom > 1 )
// importStr += ( helper + "\n" "from salome." + pluginNames[i].c_str() +
// " import " + pluginNames[i].c_str() +"Builder" );
}
if ( !importStr.IsEmpty() )
initPart += importStr + "\n";
// if ( !importStr.IsEmpty() )
// initPart += importStr + "\n";
}
if ( isMultiFile )

View File

@ -169,7 +169,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
hyp = self.Hypothesis("MaxLength", [length], UseExisting=UseExisting)
if length > 0.0:
if isinstance(length,str) or length > 0:
# set given length
hyp.SetLength(length)
if not UseExisting:

View File

@ -4185,7 +4185,7 @@ class Mesh(metaclass = MeshMeta):
def GetPointState(self, x, y, z):
"""
Return point state in a closed 2D mesh in terms of TopAbs_State enumeration:
0-IN, 1-OUT, 2-ON, 3-UNKNOWN.
smesh.TopAbs_IN, smesh.TopAbs_OUT, smesh.TopAbs_ON and smesh.TopAbs_UNKNOWN.
UNKNOWN state means that either mesh is wrong or the analysis fails.
"""
@ -5626,7 +5626,7 @@ class Mesh(metaclass = MeshMeta):
Parameters:
IDsOfElements: list of elements ids
Mirror: is :class:`SMESH.AxisStruct` or geom object (point, line, plane)
theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
If the *Mirror* is a geom object this parameter is unnecessary
Copy: allows to copy element (Copy is 1) or to replace with its mirroring (Copy is 0)
MakeGroups: forces the generation of new groups from existing ones (if Copy)
@ -5654,7 +5654,7 @@ class Mesh(metaclass = MeshMeta):
Parameters:
IDsOfElements: the list of elements ids
Mirror: is :class:`SMESH.AxisStruct` or geom object (point, line, plane)
theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
If the *Mirror* is a geom object this parameter is unnecessary
MakeGroups: to generate new groups from existing ones
NewMeshName: a name of the new mesh to create
@ -5681,7 +5681,7 @@ class Mesh(metaclass = MeshMeta):
Parameters:
theObject: :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`
Mirror: :class:`SMESH.AxisStruct` or geom object (point, line, plane)
theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
If the *Mirror* is a geom object this parameter is unnecessary
Copy: allows copying the element (Copy==True) or replacing it with its mirror (Copy==False)
MakeGroups: forces the generation of new groups from existing ones (if Copy)
@ -5709,7 +5709,7 @@ class Mesh(metaclass = MeshMeta):
Parameters:
theObject: :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`
Mirror: :class:`SMESH.AxisStruct` or geom object (point, line, plane)
theMirrorType: smeshBuilder.POINT, smeshBuilder.AXIS or smeshBuilder.PLANE.
theMirrorType: smesh.POINT, smesh.AXIS or smesh.PLANE.
If the *Mirror* is a geom object this parameter is unnecessary
MakeGroups: forces the generation of new groups from existing ones
NewMeshName: the name of the new mesh to create

View File

@ -6680,6 +6680,7 @@ void _ViscousBuilder::findCollisionEdges( _SolidData& data, SMESH_MesherHelper&
_EdgesOnShape& eos = data._edgesOnShape[iS];
if ( eos._edges.empty() ) continue;
if ( eos.ShapeType() != TopAbs_EDGE && eos.ShapeType() != TopAbs_VERTEX ) continue;
if ( !eos._sWOL.IsNull() ) continue; // PAL23566
for ( size_t i = 0; i < eos._edges.size(); ++i )
{

View File

@ -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 )

View File

@ -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);

View File

@ -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

View File

@ -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()) );

View File

@ -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() );
}

View File

@ -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();

View File

@ -185,6 +185,8 @@ class MacObject:
self.DirectionalMeshParams = MeshPar
self.MeshPar[0] = GenFunctions.CompatibilityTest(self)
if isinstance( self.MeshPar[0], list ):
return # workaround, as CompatibilityTest() can return a list
if self.MeshPar[0] < 0 :
Alarms.Message(4)
if self.MeshPar[0] == -1 : print(("Problem encountered with object(s) no. "+str(ObjectsInvolved)))

View File

@ -6,7 +6,7 @@ def writeFile( fn, txt = None):
if fn == None : return
fn = str(fn)
try:
f = open(fn, 'wb')
f = open(fn, 'w')
f.write(txt)
f.close()
return 1
@ -20,7 +20,7 @@ def readFile( fn, txt):
if fn == None : return
try:
f = open(fn, 'wb')
f = open(fn, 'w')
txt=f.read()
f.close()
except IOError: