From ae8d697b82f79e9cafabd140f723f6a8153f1d82 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 15 Feb 2016 15:40:54 +0300 Subject: [PATCH] remove "using namespace std" from SMESH headers --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 2 + src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.cxx | 2 +- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx | 6 ++- src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx | 44 ++++++++++---------- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 20cc2ed..0ab006c 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -93,6 +93,8 @@ extern "C" #include } +using namespace std; + #define HOLE_ID -1 // flags returning state of enforced entities, returned from writeGMFFile diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.cxx index b208290..2ff7964 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D_i.cxx @@ -102,7 +102,7 @@ SMESH::SMESH_Mesh_ptr GHS3DPlugin_GHS3D_i::importGMFMesh(const char* theGMFFileN #else #define SEP '/' #endif - string strFileName (theGMFFileName); + std::string strFileName (theGMFFileName); strFileName = strFileName.substr(strFileName.rfind(SEP)+1); strFileName.erase(strFileName.rfind('.')); smeshGen->SetName(theSMesh, strFileName.c_str()); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index 9c3fa87..ddfbb56 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -35,6 +35,8 @@ #define getpid _getpid #endif +using namespace std; + //======================================================================= //function : GHS3DPlugin_Hypothesis //======================================================================= @@ -1364,7 +1366,7 @@ std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load) enfMesh->persistID = persistID; _enfMeshList.insert(enfMesh); - std::cout << "Restoring of enforced mesh " <(load >> persistID); MESSAGE("persistID: " << persistID); } - std::cout << "isOK: " << isOK << std::endl; + //std::cout << "isOK: " << isOK << std::endl; } // while // } // if isOK = static_cast(load >> txt); // __BEGIN_ENF_MESH__ diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 5e83934..27dd392 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -44,6 +44,8 @@ // #include // #include CORBA_SERVER_HEADER(SALOMEDS) +using namespace std; + //======================================================================= //function : GHS3DPlugin_Hypothesis_i //======================================================================= @@ -748,7 +750,7 @@ GHS3DPlugin::GHS3DEnforcedVertexList* GHS3DPlugin_Hypothesis_i::GetEnforcedVerti // Coords GHS3DPlugin::TCoords_var coords = new GHS3DPlugin::TCoords(); coords->length(currentVertex->coords.size()); - for (int ind = 0; ind < currentVertex->coords.size(); ind++) + for ( size_t ind = 0; ind < currentVertex->coords.size(); ind++) coords[ind] = currentVertex->coords[ind]; enfVertex->coords = coords; // Group Name @@ -999,7 +1001,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo // MESSAGE("Required type is "<GetTypes(); MESSAGE("Available types:"); - for (int i=0;ilength();i++){MESSAGE(types[i]);} + for ( CORBA::ULong i=0;ilength();i++){MESSAGE(types[i]);} if ( types->length() >= 1 && types[types->length()-1] < theType) { MESSAGE("Required type not available"); @@ -1022,20 +1024,20 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo string enfMeshName = theName; if (enfMeshName.empty()) - enfMeshName = SObj->GetName(); + enfMeshName = SObj->GetName(); if (theMesh_i) { try { - bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName); - if (theGroupName != "") { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " - << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )"; - } - else { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " - << theSource << ".GetMesh(), " << theType << " )"; - } + bool res = this->GetImpl()->SetEnforcedMesh(theMesh_i->GetImpl(), theType, enfMeshName , SObj->GetID(), theGroupName); + if (theGroupName && theGroupName[0] ) { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " + << theSource << ".GetMesh(), " << theType << ", \"" << theGroupName << "\" )"; + } + else { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " + << theSource << ".GetMesh(), " << theType << " )"; + } return res; } @@ -1054,20 +1056,20 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo else if (theGroup_i)// && types->length() == 1 && types[0] == theType) { MESSAGE("The source is a group") - try { + try { bool res = this->GetImpl()->SetEnforcedGroup(theGroup_i->GetGroupDS()->GetMesh(), theGroup_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); - if (theGroupName != "") { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " + if ( theGroupName && theGroupName[0] ) { + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " << theSource << ", " << theType << ", \"" << theGroupName << "\" )"; } else { - SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " + SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMesh( " << theSource << ", " << theType << " )"; } - return res; - } - catch (const std::invalid_argument& ex) { - SALOME::ExceptionStruct ExDescription; + return res; + } + catch (const std::invalid_argument& ex) { + SALOME::ExceptionStruct ExDescription; ExDescription.text = ex.what(); ExDescription.type = SALOME::BAD_PARAM; ExDescription.sourceFile = "GHS3DPlugin_Hypothesis_i.cxx"; @@ -1083,7 +1085,7 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo MESSAGE("The source is a group on geom") try { bool res = this->GetImpl()->SetEnforcedGroup(theGroupOnGeom_i->GetGroupDS()->GetMesh(),theGroupOnGeom_i->GetListOfID(), theType, enfMeshName , SObj->GetID(), theGroupName); - if (theGroupName != "") { + if ( theGroupName && theGroupName[0] ) { SMESH::TPythonDump () << "isDone = " << _this() << ".SetEnforcedMeshWithGroup( " << theSource << ", " << theType << ", \"" << theGroupName << "\" )"; } -- 2.39.2