From 85b4cdee2aac5e1ab22e7a454633dcb96389e39e Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 15 Feb 2016 16:58:54 +0300 Subject: [PATCH] remove "using namespace std" from SMESH headers --- src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx | 17 ++++++------ src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 2 ++ src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 12 ++++----- .../BLSURFPlugin_Hypothesis_i.cxx | 26 ++++++++++--------- .../BLSURFPlugin_Hypothesis_i.hxx | 2 +- src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx | 11 ++++---- 6 files changed, 37 insertions(+), 33 deletions(-) diff --git a/src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx b/src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx index 5546309..2bfab65 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx @@ -44,13 +44,14 @@ BLSURFPlugin_Attractor::BLSURFPlugin_Attractor () : _face(), _attractorShape(), _attEntry(), - _gridU(0), - _gridV(0), _vectU(), _vectV(), _DMap(), _known(), _trial(), + _type(-1), + _gridU(0), + _gridV(0), _u1 (0.), _u2 (0.), _v1 (0.), @@ -59,7 +60,6 @@ BLSURFPlugin_Attractor::BLSURFPlugin_Attractor () _endSize(-1), _actionRadius(-1), _constantRadius(-1), - _type(-1), _isMapBuilt(false), _isEmpty(true){ MESSAGE("construction of a void attractor"); } @@ -67,13 +67,14 @@ BLSURFPlugin_Attractor::BLSURFPlugin_Attractor (const TopoDS_Face& Face, const T : _face(), _attractorShape(), _attEntry(attEntry), - _gridU(), - _gridV(), _vectU(), _vectV(), _DMap(), _known(), _trial(), + _type(0), + _gridU(), + _gridV(), _u1 (0.), _u2 (0.), _v1 (0.), @@ -82,7 +83,6 @@ BLSURFPlugin_Attractor::BLSURFPlugin_Attractor (const TopoDS_Face& Face, const T _endSize(-1), _actionRadius(-1), _constantRadius(-1), - _type(0), _isMapBuilt(false), _isEmpty(false) { @@ -175,7 +175,7 @@ void BLSURFPlugin_Attractor::edgeInit(Handle(Geom_Surface) theSurf, const TopoDS gp_Pnt2d P2; double first; double last; - int i,j,i0,j0; + int i,i0,j0; Trial_Pnt TPnt(3,0); Handle(Geom2d_Curve) aCurve2d; Handle(Geom_Curve) aCurve3d = BRep_Tool::Curve (anEdge, first, last); @@ -241,6 +241,7 @@ double BLSURFPlugin_Attractor::GetSize(double u, double v) return _startSize + ( 0.5 * (attrDist - _constantRadius + abs(attrDist - _constantRadius)) ) ; break; } + return -1; } @@ -248,7 +249,7 @@ void BLSURFPlugin_Attractor::BuildMap() { MESSAGE("building the map"); int i, j, k, n; - int count = 0; + //int count = 0; int ip, jp, kp, np; int i0, j0; gp_Pnt P; diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 58a0c0f..66f6b64 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -96,6 +96,8 @@ extern "C"{ #include #endif +using namespace std; + /* ================================== * =========== PYTHON ============== * ==================================*/ diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 8d523f2..8c836f1 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -1280,7 +1280,7 @@ void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertexAllFaces(bool toEnforceIn //============================================================================= void BLSURFPlugin_Hypothesis::SetInternalEnforcedVertexAllFacesGroup(BLSURFPlugin_Hypothesis::TEnfGroupName theGroupName) { - if (string(theGroupName) != string(_enforcedInternalVerticesAllFacesGroup)) { + if (std::string(theGroupName) != std::string(_enforcedInternalVerticesAllFacesGroup)) { _enforcedInternalVerticesAllFacesGroup = theGroupName; NotifySubMeshesHypothesisModification(); } @@ -1329,7 +1329,7 @@ void BLSURFPlugin_Hypothesis::ClearPreCadPeriodicityVectors() { //function : AddPreCadFacesPeriodicity //======================================================================= void BLSURFPlugin_Hypothesis::AddPreCadFacesPeriodicity(TEntry theFace1Entry, TEntry theFace2Entry, - vector &theSourceVerticesEntries, vector &theTargetVerticesEntries) { + std::vector &theSourceVerticesEntries, std::vector &theTargetVerticesEntries) { TPreCadPeriodicity preCadFacesPeriodicity; preCadFacesPeriodicity.shape1Entry = theFace1Entry; @@ -1346,7 +1346,7 @@ void BLSURFPlugin_Hypothesis::AddPreCadFacesPeriodicity(TEntry theFace1Entry, TE //function : AddPreCadEdgesPeriodicity //======================================================================= void BLSURFPlugin_Hypothesis::AddPreCadEdgesPeriodicity(TEntry theEdge1Entry, TEntry theEdge2Entry, - vector &theSourceVerticesEntries, vector &theTargetVerticesEntries) { + std::vector &theSourceVerticesEntries, std::vector &theTargetVerticesEntries) { TPreCadPeriodicity preCadEdgesPeriodicity; preCadEdgesPeriodicity.shape1Entry = theEdge1Entry; @@ -1798,21 +1798,21 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) { isOK = static_cast(load >> val); if (isOK) // former parameter: get min value - _angleMesh = min(val,_angleMesh); + _angleMesh = std::min(val,_angleMesh); else load.clear(std::ios::badbit | load.rdstate()); isOK = static_cast(load >> val); if (isOK) // former parameter: get min value - _minSize = min(val,_minSize); + _minSize = std::min(val,_minSize); else load.clear(std::ios::badbit | load.rdstate()); isOK = static_cast(load >> val); if (isOK) // former parameter: get max value - _maxSize = max(val,_maxSize); + _maxSize = std::max(val,_maxSize); else load.clear(std::ios::badbit | load.rdstate()); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index ed94e17..0915b85 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -37,6 +37,8 @@ #include #include +using namespace std; + //============================================================================= /*! * BLSURFPlugin_Hypothesis_i::BLSURFPlugin_Hypothesis_i @@ -876,11 +878,11 @@ BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValues() { void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); - for (int i = 0; i < options.length(); ++i) { + for (CORBA::ULong i = 0; i < options.length(); ++i) { string name_value_type = options[i].in(); if(name_value_type.empty()) continue; - int colonPos = name_value_type.find(':'); + size_t colonPos = name_value_type.find(':'); string name, value; bool custom = false; if (colonPos == string::npos) // ':' not found @@ -904,11 +906,11 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options) throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); - for (int i = 0; i < options.length(); ++i) { + for ( CORBA::ULong i = 0; i < options.length(); ++i) { string name_value_type = options[i].in(); if(name_value_type.empty()) continue; - int colonPos = name_value_type.find(':'); + size_t colonPos = name_value_type.find(':'); string name, value; bool custom = false; if (colonPos == string::npos) // ':' not found @@ -1239,9 +1241,9 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams() void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); - for (int i = 0; i < sizeMaps.length(); ++i) { + for ( CORBA::ULong i = 0; i < sizeMaps.length(); ++i) { string entry_sizemap = sizeMaps[i].in(); - int colonPos = entry_sizemap.find('|'); + size_t colonPos = entry_sizemap.find('|'); string entry, sizemap; if (colonPos == string::npos) // '|' separator not found entry = entry_sizemap; @@ -1477,7 +1479,7 @@ BLSURFPlugin::TFaceEntryEnfVertexListMap* BLSURFPlugin_Hypothesis_i::GetAllEnfor // Coords BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords(); coords->length(currentEnfVertex->coords.size()); - for (int i=0;ilength();i++) + for (CORBA::ULong i=0;ilength();i++) coords[i] = currentEnfVertex->coords[i]; enfVertex->coords = coords; @@ -1537,7 +1539,7 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVertices( // Coords BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords(); coords->length(currentEnfVertex->coords.size()); - for (int ind = 0; ind < coords->length(); ind++) + for (CORBA::ULong ind = 0; ind < coords->length(); ind++) coords[ind] = currentEnfVertex->coords[ind]; enfVertex->coords = coords; // Group name @@ -1597,7 +1599,7 @@ BLSURFPlugin::TFaceEntryCoordsListMap* BLSURFPlugin_Hypothesis_i::GetAllCoordsBy for (int j = 0; it_coords != _coordsList.end(); ++it_coords, ++j) { BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords(); coords->length((*it_coords).size()); - for (int i=0;ilength();i++) + for (CORBA::ULong i=0;ilength();i++) coords[i] = (*it_coords)[i]; coordsList[j] = coords; MESSAGE("Coords #" << j << ": " << coords[0] << ", " << coords[1] << ", " << coords[2]); @@ -1632,7 +1634,7 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert BLSURFPlugin::TCoordsEnfVertexElement_var mapElement = new BLSURFPlugin::TCoordsEnfVertexElement(); BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords(); coords->length(it_coords->first.size()); - for (int ind=0;indlength();ind++) + for (CORBA::ULong ind=0;indlength();ind++) coords[ind] = it_coords->first[ind]; mapElement->coords = coords; MESSAGE("Coords: " << mapElement->coords[0] << ", " << mapElement->coords[1] << ", " << mapElement->coords[2]); @@ -1645,7 +1647,7 @@ BLSURFPlugin::TCoordsEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnforcedVert // Coords BLSURFPlugin::TEnfVertexCoords_var coords2 = new BLSURFPlugin::TEnfVertexCoords(); coords2->length(currentEnfVertex->coords.size()); - for (int ind=0;indlength();ind++) + for (CORBA::ULong ind=0;indlength();ind++) coords2[ind] = currentEnfVertex->coords[ind]; enfVertex->coords = coords2; // Group name @@ -1748,7 +1750,7 @@ BLSURFPlugin::TEnfVertexEntryEnfVertexMap* BLSURFPlugin_Hypothesis_i::GetAllEnfo // Coords BLSURFPlugin::TEnfVertexCoords_var coords = new BLSURFPlugin::TEnfVertexCoords(); coords->length(currentEnfVertex->coords.size()); - for (int ind=0;indlength();ind++) + for (CORBA::ULong ind=0;indlength();ind++) coords[ind] = currentEnfVertex->coords[ind]; enfVertex->coords = coords; // Group name diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index 8a0663c..e3d3d42 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -364,7 +364,7 @@ private: void CheckShapeType(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType); void CheckShapeTypes(GEOM::GEOM_Object_ptr shape, std::vector theShapeTypes); std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix); - std::string FormatVerticesEntries(vector &theSourceVerticesEntries, vector &theTargetVerticesEntries); + std::string FormatVerticesEntries(std::vector &theSourceVerticesEntries, std::vector &theTargetVerticesEntries); }; diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index 5005e10..f61f73f 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -80,6 +80,7 @@ #include #include +using namespace std; enum { STD_TAB = 0, @@ -964,7 +965,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() myPeriodicityTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); myPeriodicityTreeWidget->setSelectionBehavior(QAbstractItemView::SelectRows); - int periodicityVisibleColumns = 2; + size_t periodicityVisibleColumns = 2; for (size_t column = 0; column < periodicityVisibleColumns; ++column) { #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) myPeriodicityTreeWidget->header()->setResizeMode(column,QHeaderView::Interactive); @@ -1597,7 +1598,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddPeriodicity() { int P2Ssel = myPeriodicityP2SourceWdg->NbObjects(); int P3Ssel = myPeriodicityP3SourceWdg->NbObjects(); int P1Tsel = myPeriodicityP1TargetWdg->NbObjects(); - int P2Tsel = myPeriodicityP2TargetWdg->NbObjects(); + //int P2Tsel = myPeriodicityP2TargetWdg->NbObjects(); int P3Tsel = myPeriodicityP3TargetWdg->NbObjects(); if (P1Ssel!=1 || P2Ssel!=1 || P3Ssel!=1 || P1Tsel!=1 || P3Tsel!=1 || P3Tsel!=1) @@ -1910,7 +1911,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const const QString entry = i.key(); const QString sizeMap = i.value(); string shapeName = myGeomToolSelected->getNameFromEntry(entry.toStdString()); - int row = mySizeMapTable->topLevelItemCount(); + //int row = mySizeMapTable->topLevelItemCount(); QTreeWidgetItem* item = new QTreeWidgetItem(); mySizeMapTable->addTopLevelItem( item ); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled ); @@ -2086,7 +2087,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData QString fullSizeMaps; QStringList fullSizeMapList; GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool(); - for ( int i = 0;ilength(); ++i ) { + for ( CORBA::ULong i = 0;ilength(); ++i ) { fullSizeMaps = mySizeMaps[i].in(); // MESSAGE("fullSizeMaps: " << fullSizeMaps.toStdString()); fullSizeMapList = fullSizeMaps.split( "|", QString::KeepEmptyParts ); @@ -3286,8 +3287,6 @@ bool BLSURFPluginGUI_HypothesisCreator::insertAttractor(GEOM::GEOM_Object_var aF BLSURFPlugin::BLSURFPlugin_Hypothesis_var h = BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis()); - BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; - TopAbs_ShapeEnum shapeType; string entry, attEntry, faceName, attName; entry = (string) aFace->GetStudyEntry(); -- 2.39.2