]> SALOME platform Git repositories - plugins/blsurfplugin.git/commitdiff
Salome HOME
remove "using namespace std" from SMESH headers V8_0_0_BR V8_0_0 V8_0_0rc2
authoreap <eap@opencascade.com>
Mon, 15 Feb 2016 13:58:54 +0000 (16:58 +0300)
committervsr <vsr@opencascade.com>
Sat, 20 Feb 2016 08:18:15 +0000 (11:18 +0300)
src/BLSURFPlugin/BLSURFPlugin_Attractor.cxx
src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx
src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx
src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx

index 554630954476045e2657ce51d5772d380090d5ac..2bfab6562d92fb4f0d651bc99ed0e235a699e25c 100644 (file)
@@ -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;
index 58a0c0fe228da233d2b99a229a5409cabae59e27..66f6b643ce62807c5098988f8e3630bf46ce8f47 100644 (file)
@@ -96,6 +96,8 @@ extern "C"{
 #include <fenv.h>
 #endif
 
+using namespace std;
+
 /* ==================================
  * ===========  PYTHON ==============
  * ==================================*/
index 8d523f2863bdbdb98af26117bb6c64557db2c74b..8c836f1d1a209b7dc49689b966dbd66ce17ffb41 100644 (file)
@@ -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<string> &theSourceVerticesEntries, vector<string> &theTargetVerticesEntries) {
+    std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &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<string> &theSourceVerticesEntries, vector<string> &theTargetVerticesEntries) {
+    std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries) {
 
   TPreCadPeriodicity preCadEdgesPeriodicity;
   preCadEdgesPeriodicity.shape1Entry = theEdge1Entry;
@@ -1798,21 +1798,21 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) {
   isOK = static_cast<bool>(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<bool>(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<bool>(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());
 
index ed94e17a2744916388c06b2b57e0c3fe9c44344b..0915b85e4151d266c39199f663559ba4ecfd4f60 100644 (file)
@@ -37,6 +37,8 @@
 #include <cstring>
 #include <boost/regex.hpp>
 
+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;i<coords->length();i++)
+      for (CORBA::ULong i=0;i<coords->length();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;i<coords->length();i++)
+      for (CORBA::ULong i=0;i<coords->length();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;ind<coords->length();ind++)
+    for (CORBA::ULong ind=0;ind<coords->length();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;ind<coords2->length();ind++)
+    for (CORBA::ULong ind=0;ind<coords2->length();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;ind<coords->length();ind++)
+    for (CORBA::ULong ind=0;ind<coords->length();ind++)
       coords[ind] = currentEnfVertex->coords[ind];
     enfVertex->coords = coords;
     // Group name
index 8a0663cd882b3d736b491547d1c89280080720a7..e3d3d42f02c5a03bf276c2080ff03955c76c03c9 100644 (file)
@@ -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<GEOM::shape_type> theShapeTypes);
   std::string PublishIfNeeded(GEOM::GEOM_Object_ptr shape, GEOM::shape_type theShapeType, std::string prefix);
-  std::string FormatVerticesEntries(vector<string> &theSourceVerticesEntries, vector<string> &theTargetVerticesEntries);
+  std::string FormatVerticesEntries(std::vector<std::string> &theSourceVerticesEntries, std::vector<std::string> &theTargetVerticesEntries);
 
 };
 
index 5005e1098e01141f355c7af6dbc2ec5962ec897f..f61f73f0760d2c9338150def59a0c9160533f27f 100644 (file)
@@ -80,6 +80,7 @@
 #include <stdexcept>
 #include <algorithm>
 
+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;i<mySizeMaps->length(); ++i ) {
+  for ( CORBA::ULong i = 0;i<mySizeMaps->length(); ++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();