From: eap Date: Wed, 13 Jan 2016 13:47:35 +0000 (+0300) Subject: Fix compilation errors using gcc-5.X relating to explicit stream::operator bool() X-Git-Tag: V7_8_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=59627b07d70f4caa4c768be6805334d2610fa54c;p=modules%2Fsmesh.git Fix compilation errors using gcc-5.X relating to explicit stream::operator bool() + Fix compilation warnings --- diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl index 8c63fdbda..b28fb1432 100644 --- a/idl/SMESH_MeshEditor.idl +++ b/idl/SMESH_MeshEditor.idl @@ -773,8 +773,9 @@ module SMESH SEW_DIFF_NB_OF_ELEMENTS, SEW_TOPO_DIFF_SETS_OF_ELEMENTS, SEW_BAD_SIDE1_NODES, - SEW_BAD_SIDE2_NODES - }; + SEW_BAD_SIDE2_NODES, + SEW_INTERNAL_ERROR + }; Sew_Error SewFreeBorders (in long FirstNodeID1, in long SecondNodeID1, diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx index 95d6a2ff1..f72df42cf 100644 --- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx @@ -435,6 +435,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() const SMDS_MeshElement* aElement = myMesh->FindElement(aRec.ElementList[i]); if (aElement) { switch (aElement->GetType()) { + case SMDSAbs_Edge: if (!aEdgesGroup) { aEdgesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Edge); @@ -449,6 +450,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } aEdgesGroup->Add(aElement); break; + case SMDSAbs_Face: if (!aFacesGroup) { aFacesGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Face); @@ -463,6 +465,7 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } aFacesGroup->Add(aElement); break; + case SMDSAbs_Volume: if (!aVolumeGroup) { aVolumeGroup = (SMDS_MeshGroup*) myGroup->AddSubGroup(SMDSAbs_Volume); @@ -477,6 +480,8 @@ Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform() } aVolumeGroup->Add(aElement); break; + + default:; } } } diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 1c9af415d..bdd94da6b 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -1707,13 +1707,14 @@ void SMESH_ActorDef::SetRepresentation (int theMode) my0DActor->SetRepresentation(aReperesent); myBallActor->SetRepresentation(aReperesent); - switch(myControlMode){ + switch ( myControlMode ) { case eLength: case eMultiConnection: aProp = aBackProp = my1DProp; if(myRepresentation != ePoint) aReperesent = SMESH_DeviceActor::eInsideframe; break; + default:; } if(aQuadraticMode == SMESH_Actor::eLines) @@ -2253,7 +2254,7 @@ vtkPlane* SMESH_ActorDef:: GetClippingPlane(vtkIdType theID) { - if(theID >= myCippingPlaneCont.size()) + if ( theID >= (vtkIdType)myCippingPlaneCont.size() ) return NULL; return myCippingPlaneCont[theID].Get(); } @@ -2487,7 +2488,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() { bool isLogarithmic = lookupTable->GetScale() == VTK_SCALE_LOG10; fun->GetHistogram(nbIntervals, nbEvents, funValues, elemIds, range, isLogarithmic); - for ( int i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ ) + for ( size_t i = 0; i < std::min( nbEvents.size(), funValues.size() -1 ); i++ ) my2dHistogram->addPoint(funValues[i] + (funValues[i+1] - funValues[i])/2.0, static_cast(nbEvents[i])); if(funValues.size() >= 2) diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index 87a7c8401..9d8e4f3f3 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -37,7 +37,7 @@ namespace SMESH enum LabelFont { FntArial, //!< arial font family FntCourier, //!< courier font family - FntTimes, //!< times font family + FntTimes //!< times font family }; SMESHOBJECT_EXPORT diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx index b3ff7d74b..d96609719 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.cxx +++ b/src/OBJECT/SMESH_ExtractGeometry.cxx @@ -60,14 +60,14 @@ SMESH_ExtractGeometry::~SMESH_ExtractGeometry() vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID) { - if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1; + if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1; return myElemVTK2ObjIds[theVtkID]; } vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID) { - if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1; + if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1; return myNodeVTK2ObjIds[theVtkID]; } diff --git a/src/OBJECT/SMESH_ScalarBarActor.cxx b/src/OBJECT/SMESH_ScalarBarActor.cxx index d82962cb9..561182114 100644 --- a/src/OBJECT/SMESH_ScalarBarActor.cxx +++ b/src/OBJECT/SMESH_ScalarBarActor.cxx @@ -320,7 +320,7 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) // rnv begin // Customization of the vtkScalarBarActor to show distribution histogram. - bool distrVisibility = (numColors == this->myNbValues.size()); + bool distrVisibility = (numColors == (int)this->myNbValues.size()); vtkPoints *distrPts; vtkCellArray *distrPolys; vtkUnsignedCharArray *distColors = 0; @@ -328,12 +328,12 @@ int SMESH_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) if(!distrVisibility) vtkDebugMacro(<<" Distribution invisible, because numColors == this->myNbValues.size()"); - if (distrVisibility && GetDistributionVisibility()) { - for( i=0 ;iMaximumNumberOfColors == this->myNbValues.size(); + bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() ); double coef; if( GetDistributionVisibility() && distrVisibility ) if(this->Orientation == VTK_ORIENT_VERTICAL) @@ -856,40 +856,39 @@ void SMESH_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, } //---------------------------------------------------------------------------- -void SMESH_ScalarBarActor::SizeTitle(int *titleSize, - int *size, - vtkViewport *viewport) +void SMESH_ScalarBarActor::SizeTitle(int *titleSize, + int *size, + vtkViewport *viewport) { titleSize[0] = titleSize[1] = 0; if (this->Title == NULL || !strlen(this->Title)) - { + { return; - } + } int targetWidth, targetHeight; - + targetWidth = size[0]; // rnv begin // Customization of the vtkScalarBarActor to show distribution histogram. - bool distrVisibility = this->MaximumNumberOfColors == this->myNbValues.size(); + bool distrVisibility = ( this->MaximumNumberOfColors == (int) this->myNbValues.size() ); double coef; - if( GetDistributionVisibility() && distrVisibility ) + if ( GetDistributionVisibility() && distrVisibility ) coef=0.18; - else + else coef=0.25; if ( this->Orientation == VTK_ORIENT_VERTICAL ) - { - targetHeight = (int)(0.1*size[1]); - } + { + targetHeight = (int)(0.1*size[1]); + } else - { - targetHeight = (int)(coef*size[1]); - } + { + targetHeight = (int)(coef*size[1]); + } - this->TitleMapper->SetConstrainedFontSize( - viewport, targetWidth, targetHeight); + this->TitleMapper->SetConstrainedFontSize(viewport, targetWidth, targetHeight); this->TitleMapper->GetSize(viewport, titleSize); } diff --git a/src/SMDS/SMDS_Downward.cxx b/src/SMDS/SMDS_Downward.cxx index d6049c0bd..257ab88dd 100644 --- a/src/SMDS/SMDS_Downward.cxx +++ b/src/SMDS/SMDS_Downward.cxx @@ -217,13 +217,13 @@ void SMDS_Down1D::initCell(int cellId) */ void SMDS_Down1D::allocate(int nbElems) { - if (nbElems >= _vtkCellIds.size()) - { - _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); - _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); - _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize); - _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize); - } + if (nbElems >= (int)_vtkCellIds.size()) + { + _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); + _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); + _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize); + _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize); + } } void SMDS_Down1D::compactStorage() @@ -239,15 +239,15 @@ void SMDS_Down1D::compactStorage() _upCellIndex.resize(_maxId + 1, -1); // id and types of rank i correspond to [ _upCellIndex[i], _upCellIndex[i+1] [ int current = 0; for (int i = 0; i < _maxId; i++) + { + _upCellIndex[i] = current; + for (size_t j = 0; j < _upCellIdsVector[i].size(); j++) { - _upCellIndex[i] = current; - for (int j = 0; j < _upCellIdsVector[i].size(); j++) - { - _upCellIds[current] = _upCellIdsVector[i][j]; - _upCellTypes[current] = _upCellTypesVector[i][j]; - current++; - } + _upCellIds[current] = _upCellIdsVector[i][j]; + _upCellTypes[current] = _upCellTypesVector[i][j]; + current++; } + } _upCellIndex[_maxId] = current; _upCellIdsVector.clear(); @@ -674,14 +674,14 @@ bool SMDS_Down2D::isInFace(int cellId, int *pts, int npts) */ void SMDS_Down2D::allocate(int nbElems) { - if (nbElems >= _vtkCellIds.size()) - { - _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); - _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); - _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1); - _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1); - _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1); - } + if (nbElems >= (int)_vtkCellIds.size()) + { + _cellIds.resize (_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); + _vtkCellIds.resize (nbElems + SMDS_Mesh::chunkSize, -1); + _upCellIds.resize (2 * (nbElems + SMDS_Mesh::chunkSize), -1); + _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1); + _tempNodes.resize (_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1); + } } void SMDS_Down2D::compactStorage() @@ -764,11 +764,11 @@ SMDS_Down3D::~SMDS_Down3D() void SMDS_Down3D::allocate(int nbElems) { - if (nbElems >= _vtkCellIds.size()) - { - _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); - _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); - } + if (nbElems >= (int)_vtkCellIds.size()) + { + _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1); + _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1); + } } void SMDS_Down3D::compactStorage() @@ -1121,7 +1121,7 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector& o { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1131,19 +1131,19 @@ void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector& o set tofind; int ids[12] = { 0, 1, 2, 0, 3, 1, 2, 3, 0, 1, 3, 2 }; -//int ids[12] = { 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 }; + //int ids[12] = { 2, 1, 0, 1, 3, 0, 0, 3, 2, 2, 3, 1 }; for (int k = 0; k < 4; k++) + { + tofind.clear(); + for (int i = 0; i < 3; i++) + tofind.insert(nodes[ids[3 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 3; i++) - tofind.insert(nodes[ids[3 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 3; i++) - orderedNodes[i] = nodes[ids[3 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[3 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1229,7 +1229,7 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1239,19 +1239,19 @@ void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector tofind; int ids[24] = { 0, 1, 2, 4, 5, 6, 0, 3, 1, 7, 8, 4, 2, 3, 0, 9, 7, 6, 1, 3, 2, 8, 9, 5 }; -//int ids[24] = { 2, 1, 0, 5, 4, 6, 1, 3, 0, 8, 7, 4, 0, 3, 2, 7, 9, 6, 2, 3, 1, 9, 8, 5 }; + //int ids[24] = { 2, 1, 0, 5, 4, 6, 1, 3, 0, 8, 7, 4, 0, 3, 2, 7, 9, 6, 2, 3, 1, 9, 8, 5 }; for (int k = 0; k < 4; k++) + { + tofind.clear(); + for (int i = 0; i < 6; i++) + tofind.insert(nodes[ids[6 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 6; i++) - tofind.insert(nodes[ids[6 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 6; i++) - orderedNodes[i] = nodes[ids[6 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[6 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1352,7 +1352,7 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector& { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1368,24 +1368,24 @@ void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector& for (int i = 0; i < 4; i++) tofind.insert(nodes[ids[i]]); if (setNodes == tofind) - { - for (int i = 0; i < 4; i++) - orderedNodes[i] = nodes[ids[i]]; - return; - } + { + for (int i = 0; i < 4; i++) + orderedNodes[i] = nodes[ids[i]]; + return; + } // Triangular faces for (int k = 0; k < 4; k++) + { + tofind.clear(); + for (int i = 0; i < 3; i++) + tofind.insert(nodes[ids[4 + 3 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 3; i++) - tofind.insert(nodes[ids[4 + 3 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 3; i++) - orderedNodes[i] = nodes[ids[4 + 3 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[4 + 3 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1492,10 +1492,10 @@ SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid() void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector& orderedNodes) { -// MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId); + // MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId); set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1512,24 +1512,24 @@ void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1655,7 +1655,7 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector& o { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1664,35 +1664,35 @@ void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector& o _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; -//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; + //int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; int ids[18] = { 0, 1, 2, 3, 5, 4, 0, 3, 4, 1, 1, 4, 5, 2, 2, 5, 3, 0 }; // Triangular faces for (int k = 0; k < 2; k++) + { + tofind.clear(); + for (int i = 0; i < 3; i++) + tofind.insert(nodes[ids[3 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 3; i++) - tofind.insert(nodes[ids[3 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 3; i++) - orderedNodes[i] = nodes[ids[3 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[3 * k + i]]; + return; } + } // Quadrangular faces for (int k = 0; k < 3; k++) + { + tofind.clear(); + for (int i = 0; i < 4; i++) + tofind.insert(nodes[ids[6 + 4 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 4; i++) - tofind.insert(nodes[ids[6 + 4 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 4; i++) - orderedNodes[i] = nodes[ids[6 + 4 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[6 + 4 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1704,7 +1704,7 @@ void SMDS_DownPenta::addDownCell(int cellId, int lowCellId, unsigned char aType) int *faces = &_cellIds[_nbDownCells * cellId]; if (aType == VTK_QUAD) for (int i = 0; i < 3; i++) - { + { if (faces[i] < 0) { faces[i] = lowCellId; @@ -1805,7 +1805,7 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1814,36 +1814,36 @@ void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vectorGetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; -//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; + //int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 }; int ids[36] = { 0, 1, 2, 6, 7, 8, 3, 5, 4, 11, 10, 9, 0, 3, 4, 1, 12, 9, 13, 6, 1, 4, 5, 2, 13, 10, 14, 7, 2, 5, 3, 0, 14, 11, 12, 8 }; // Triangular faces for (int k = 0; k < 2; k++) + { + tofind.clear(); + for (int i = 0; i < 6; i++) + tofind.insert(nodes[ids[6 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 6; i++) - tofind.insert(nodes[ids[6 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 6; i++) - orderedNodes[i] = nodes[ids[6 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[6 * k + i]]; + return; } + } // Quadrangular faces for (int k = 0; k < 3; k++) + { + tofind.clear(); + for (int i = 0; i < 8; i++) + tofind.insert(nodes[ids[12 + 8 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 8; i++) - tofind.insert(nodes[ids[12 + 8 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 8; i++) - orderedNodes[i] = nodes[ids[12 + 8 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[12 + 8 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -1976,7 +1976,7 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector& or { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -1985,20 +1985,20 @@ void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector& or _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes); set tofind; -//int ids[24] = { 0, 1, 2, 3, 7, 6, 5, 4, 4, 0, 3, 7, 5, 1, 0, 4, 6, 2, 1, 5, 7, 3, 2, 6}; + //int ids[24] = { 0, 1, 2, 3, 7, 6, 5, 4, 4, 0, 3, 7, 5, 1, 0, 4, 6, 2, 1, 5, 7, 3, 2, 6}; int ids[24] = { 3, 2, 1, 0, 4, 5, 6, 7, 7, 3, 0, 4, 4, 0, 1, 5, 5, 1, 2, 6, 6, 2, 3, 7}; for (int k = 0; k < 6; k++) // loop on the 6 faces + { + tofind.clear(); + for (int i = 0; i < 4; i++) + tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 4; i++) - tofind.insert(nodes[ids[4 * k + i]]); // node ids of the face i - if (setNodes == tofind) - { - for (int i = 0; i < 4; i++) - orderedNodes[i] = nodes[ids[4 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[4 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); @@ -2107,7 +2107,7 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector { set setNodes; setNodes.clear(); - for (int i = 0; i < orderedNodes.size(); i++) + for ( size_t i = 0; i < orderedNodes.size(); i++ ) setNodes.insert(orderedNodes[i]); //MESSAGE("cellId = " << cellId); @@ -2120,17 +2120,17 @@ void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector int ids[48] = { 3, 2, 1, 0,10, 9, 8,11, 4, 5, 6, 7,12,13,14,15, 7, 3, 0, 4,19,11,16,15, 4, 0, 1, 5,16, 8,17,12, 5, 1, 2, 6,17, 9,18,13, 6, 2, 3, 7,18,10,19,14}; for (int k = 0; k < 6; k++) + { + tofind.clear(); + for (int i = 0; i < 8; i++) + tofind.insert(nodes[ids[8 * k + i]]); + if (setNodes == tofind) { - tofind.clear(); for (int i = 0; i < 8; i++) - tofind.insert(nodes[ids[8 * k + i]]); - if (setNodes == tofind) - { - for (int i = 0; i < 8; i++) - orderedNodes[i] = nodes[ids[8 * k + i]]; - return; - } + orderedNodes[i] = nodes[ids[8 * k + i]]; + return; } + } MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId])); MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]); MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]); diff --git a/src/SMDS/SMDS_IteratorOfElements.cxx b/src/SMDS/SMDS_IteratorOfElements.cxx index 3719c6b56..e775b5bda 100644 --- a/src/SMDS/SMDS_IteratorOfElements.cxx +++ b/src/SMDS/SMDS_IteratorOfElements.cxx @@ -54,24 +54,24 @@ const SMDS_MeshElement * SMDS_IteratorOfElements::subNext() /// Create an iterator which look for elements of type type which are linked /// to the element element. it is the iterator to get connectivity of element ////////////////////////////////////////////////////////////////////////////// -SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element, - SMDSAbs_ElementType type, +SMDS_IteratorOfElements::SMDS_IteratorOfElements(const SMDS_MeshElement * element, + SMDSAbs_ElementType type, const SMDS_ElemIteratorPtr& it) - : t1Iterator(it), - t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)), - myType(type), myElement(element), - myProxyElement(NULL) + : t1Iterator(it), + t2Iterator(SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL)), + myType(type), myElement(element), + myProxyElement(NULL) { - while(subMore()) - alreadyReturnedElements.insert(subNext()); - itAlreadyReturned= alreadyReturnedElements.begin(); - switch(myElement->GetType()) - { - case SMDSAbs_Node: - case SMDSAbs_Edge: myReverseIteration=true; break; - case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break; - default: myReverseIteration=false; - } + while(subMore()) + alreadyReturnedElements.insert(subNext()); + itAlreadyReturned= alreadyReturnedElements.begin(); + switch(myElement->GetType()) + { + case SMDSAbs_Node: + case SMDSAbs_Edge: myReverseIteration=true; break; + case SMDSAbs_Face: myReverseIteration=(type==SMDSAbs_Volume); break; + default: myReverseIteration=false; + } } bool SMDS_IteratorOfElements::more() diff --git a/src/SMDS/SMDS_IteratorOfElements.hxx b/src/SMDS/SMDS_IteratorOfElements.hxx index e0756198c..2b720b0cc 100644 --- a/src/SMDS/SMDS_IteratorOfElements.hxx +++ b/src/SMDS/SMDS_IteratorOfElements.hxx @@ -43,11 +43,11 @@ class SMDS_EXPORT SMDS_IteratorOfElements:public SMDS_ElemIterator const SMDS_MeshElement * next(); private: - SMDS_ElemIteratorPtr t2Iterator; SMDS_ElemIteratorPtr t1Iterator; + SMDS_ElemIteratorPtr t2Iterator; SMDSAbs_ElementType myType; - const SMDS_MeshElement * myProxyElement; const SMDS_MeshElement * myElement; + const SMDS_MeshElement * myProxyElement; bool myReverseIteration; std::set alreadyReturnedElements; diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index c4cadf10f..f37887482 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -3149,6 +3149,7 @@ void SMDS_Mesh::addChildrenWithNodes(set& setOfChildren MESSAGE("Internal Error: This should not happen"); break; case SMDSAbs_0DElement: + case SMDSAbs_Ball: { } break; @@ -3199,6 +3200,7 @@ void SMDS_Mesh::addChildrenWithNodes(set& setOfChildren addChildrenWithNodes(setOfChildren, ite->next(), nodes); } } + case SMDSAbs_NbElementTypes: case SMDSAbs_All: break; } } diff --git a/src/SMDS/SMDS_MeshCell.cxx b/src/SMDS/SMDS_MeshCell.cxx index e629a2f5b..8b7b2f63c 100644 --- a/src/SMDS/SMDS_MeshCell.cxx +++ b/src/SMDS/SMDS_MeshCell.cxx @@ -278,7 +278,7 @@ const std::vector& SMDS_MeshCell::reverseSmdsOrder(SMDSAbs_EntityType smdsT reverseInterlaces[ smdsType ][pos++] = 0; for ( int i = nbNodes / 2 - 1; i > 0 ; --i ) // 3,2,1 reverseInterlaces[ smdsType ][pos++] = i; - for ( int i = nbNodes - 1; i >= nbNodes / 2; --i ) // 7,6,5,4 + for ( int i = nbNodes - 1, nb = nbNodes / 2; i >= nb; --i ) // 7,6,5,4 reverseInterlaces[ smdsType ][pos++] = i; } } diff --git a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx index 2dfa337db..22cab1ab8 100644 --- a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx +++ b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.cxx @@ -101,7 +101,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbEdges() const { int nbEdges = 0; - for (int ifa = 0; ifa < myQuantities.size(); ifa++) { + for ( size_t ifa = 0; ifa < myQuantities.size(); ifa++) { nbEdges += myQuantities[ifa]; } nbEdges /= 2; @@ -124,7 +124,7 @@ int SMDS_PolyhedralVolumeOfNodes::NbFaces() const //======================================================================= int SMDS_PolyhedralVolumeOfNodes::NbFaceNodes (const int face_ind) const { - if (face_ind < 1 || myQuantities.size() < face_ind) + if (face_ind < 1 || (int)myQuantities.size() < face_ind) return 0; return myQuantities[face_ind - 1]; } @@ -201,7 +201,7 @@ struct _MyIterator:public SMDS_NodeVectorElemIterator class _MySubIterator : public SMDS_ElemIterator { vector< const SMDS_MeshElement* > myElems; - int myIndex; + size_t myIndex; public: _MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) { SMDS_VolumeTool vTool(vol); diff --git a/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx b/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx index 2a356d581..0ab7e8c84 100644 --- a/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx +++ b/src/SMDS/SMDS_QuadraticVolumeOfNodes.cxx @@ -215,7 +215,7 @@ bool SMDS_QuadraticVolumeOfNodes::IsMediumNode(const SMDS_MeshNode* node) const case 15: nbCorners = 6; break; default: nbCorners = 8; } - for ( int i = nbCorners; i myElems; - int myIndex; + size_t myIndex; public: _MySubIterator(const SMDS_MeshVolume* vol, SMDSAbs_ElementType type):myIndex(0) { SMDS_VolumeTool vTool(vol); diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index c0c506d9c..06755badf 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -843,7 +843,7 @@ bool SMDS_VolumeTool::GetBaryCenter(double & X, double & Y, double & Z) const if ( !myVolume ) return false; - for ( int i = 0; i < myVolumeNodes.size(); i++ ) { + for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) { X += myVolumeNodes[ i ]->X(); Y += myVolumeNodes[ i ]->Y(); Z += myVolumeNodes[ i ]->Z(); @@ -1390,7 +1390,7 @@ bool SMDS_VolumeTool::IsLinked (const SMDS_MeshNode* theNode1, // find nodes indices int i1 = -1, i2 = -1, nbFound = 0; - for ( int i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ ) + for ( size_t i = 0; i < myVolumeNodes.size() && nbFound < 2; i++ ) { if ( myVolumeNodes[ i ] == theNode1 ) i1 = i, ++nbFound; @@ -1418,7 +1418,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, int minInd = min( theNode1Index, theNode2Index ); int maxInd = max( theNode1Index, theNode2Index ); - if ( minInd < 0 || maxInd > myVolumeNodes.size() - 1 || maxInd == minInd ) + if ( minInd < 0 || maxInd > (int)myVolumeNodes.size() - 1 || maxInd == minInd ) return false; VolumeType type = GetVolumeType(); @@ -1535,7 +1535,7 @@ bool SMDS_VolumeTool::IsLinked (const int theNode1Index, int SMDS_VolumeTool::GetNodeIndex(const SMDS_MeshNode* theNode) const { if ( myVolume ) { - for ( int i = 0; i < myVolumeNodes.size(); i++ ) { + for ( size_t i = 0; i < myVolumeNodes.size(); i++ ) { if ( myVolumeNodes[ i ] == theNode ) return i; } @@ -1596,8 +1596,8 @@ int SMDS_VolumeTool::GetAllExistingEdges(vector & edges { edges.clear(); edges.reserve( myVolumeNodes.size() * 2 ); - for ( int i = 0; i < myVolumeNodes.size()-1; ++i ) { - for ( int j = i + 1; j < myVolumeNodes.size(); ++j ) { + for ( size_t i = 0; i < myVolumeNodes.size()-1; ++i ) { + for ( size_t j = i + 1; j < myVolumeNodes.size(); ++j ) { if ( IsLinked( i, j )) { const SMDS_MeshElement* edge = SMDS_Mesh::FindEdge( myVolumeNodes[i], myVolumeNodes[j] ); diff --git a/src/SMDS/chrono.cxx b/src/SMDS/chrono.cxx index caa6031f4..e09007076 100644 --- a/src/SMDS/chrono.cxx +++ b/src/SMDS/chrono.cxx @@ -60,7 +60,7 @@ void counters::stats() } chrono::chrono(int i) : - _ctr(i), _run(true) + _run(true), _ctr(i) { //MESSAGE("chrono::chrono " << _ctr << " " << _run); _start = clock(); diff --git a/src/SMESHFiltersSelection/SMESH_Type.h b/src/SMESHFiltersSelection/SMESH_Type.h index 9398fe649..94e1b6fb4 100644 --- a/src/SMESHFiltersSelection/SMESH_Type.h +++ b/src/SMESHFiltersSelection/SMESH_Type.h @@ -39,7 +39,7 @@ #define SMESHFILTERSSELECTION_EXPORT #endif -namespace SMESH{ +namespace SMESH { enum MeshObjectType { HYPOTHESIS, ALGORITHM, @@ -64,5 +64,5 @@ namespace SMESH{ IDSOURCE_FACE, IDSOURCE_VOLUME }; -}; +} #endif diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx index 5f12c7faa..fc0c43bdd 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.cxx @@ -264,6 +264,7 @@ bool SMESH_TypeFilter::isOk (const SUIT_DataOwner* theDataOwner) const Ok = isIDSourceOfType( obj, SMESH::VOLUME ); break; } + default:; } } return Ok; diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 12d43fc6d..a429e8818 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -84,7 +84,7 @@ typedef std::map SMESHGUI_Cli //================================================================================= class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module { - Q_OBJECT; + Q_OBJECT public : SMESHGUI(); diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index 5cfddb9ce..deacb22f0 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -338,8 +338,8 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM : QDialog( SMESH::GetDesktop( theModule ) ), mySMESHGUI( theModule ), mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ), - myGeomType( theType ), - myBusy( false ) + myBusy( false ), + myGeomType( theType ) { setModal( false ); setAttribute( Qt::WA_DeleteOnClose, true ); @@ -599,6 +599,7 @@ void SMESHGUI_AddQuadraticElementDlg::Init() myNbCenterNodes = 1; myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_hexahedrons break; + default:; } myMidFaceLabel ->setVisible( myNbMidFaceNodes ); @@ -724,6 +725,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply() anIds.push_back( aListId[ 0 ].toInt() ); } break; + default:; } if ( myReverseCB->isChecked()) ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false ); @@ -849,6 +851,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply() case SMESH::VOLUME: myActor->SetRepresentation(SMESH_Actor::eSurface); myActor->SetEntityMode( aMode |= SMESH_Actor::eVolumes ); break; + default:; } } @@ -1068,6 +1071,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument() case SMDSEntity_Quad_Hexa: case SMDSEntity_TriQuad_Hexa: anElementType = SMESH::VOLUME; break; + default:; } myGroups.clear(); ComboBox_GroupName->clear(); @@ -1309,7 +1313,7 @@ bool SMESHGUI_AddQuadraticElementDlg::IsValid() okIDs.insert( anID ); } - return okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes; + return (int) okIDs.size() == myTable->rowCount() + myNbMidFaceNodes + myNbCenterNodes; } //================================================================================= @@ -1406,6 +1410,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity ) aFirstColIds = FirstHexahedronIds; aLastColIds = LastHexahedronIds; break; + default:; } // fill the First and the Last columns diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h index 161d2183f..b3e117556 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h @@ -56,7 +56,7 @@ class SUIT_SelectionFilter; //================================================================================= class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog { - Q_OBJECT; + Q_OBJECT public: diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 1d68b74fa..d38e638ca 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -601,12 +601,12 @@ SMESHGUI_ClippingDlg::~SMESHGUI_ClippingDlg() if (myViewWindow) SMESH::RenderViewWindow(myViewWindow); - for( int i=0; i< myPlanes.size(); i++ ) { + for ( size_t i = 0; i < myPlanes.size(); i++ ) { SMESH::TPlaneData aPlaneData = myPlanes[i]; aPlaneData.Plane->Delete(); } - if (myPreviewWidget) { + if ( myPreviewWidget ) { myPreviewWidget->Off(); myPreviewWidget->Delete(); } diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index a71b425d4..001416791 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -271,7 +271,7 @@ namespace SMESH GEOM_Actor* getActor(const TopoDS_Shape& shape) { int index = myIndexToShape.FindIndex( shape ) - 1; - if ( index < 0 || index >= myActors.size() ) + if ( index < 0 || index >= (int) myActors.size() ) return 0; GEOM_Actor* & actor = myActors[ index ]; if ( !actor ) { @@ -887,7 +887,7 @@ void SMESHGUI_BaseComputeOp::computeMesh() #endif aCompErrors = gen->GetComputeErrors( myMesh, myMainShape ); // check if there are memory problems - for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) + for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB ); } catch(const SALOME::SALOME_Exception & S_ex) { @@ -922,7 +922,7 @@ void SMESHGUI_BaseComputeOp::computeMesh() aListToUpdate.append( QPair< SMESH::SMESH_IDSource_var, _PTR(SObject) >(aMeshObj, aMeshSObj) ); SMESH::submesh_array_var aSubMeshes = myMesh->GetSubMeshes(); // put SubMeshes into list - for ( int i = 0; i < aSubMeshes->length(); i++ ) { + for ( CORBA::ULong i = 0; i < aSubMeshes->length(); i++ ) { SMESH::SMESH_subMesh_var sm = aSubMeshes[i]; if ( CORBA::is_nil( sm ) ) continue; _PTR(SObject) smSObj = SMESH::ObjectToSObject( sm ); @@ -1081,7 +1081,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, else { bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported - for ( int i = 0; i < theCompErrors->length() && onlyWarnings; ++i ) + for ( CORBA::ULong i = 0; i < theCompErrors->length() && onlyWarnings; ++i ) onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING || theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE ); @@ -1136,7 +1136,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, tbl->setColumnWidth( COL_ERROR, 200 ); bool hasBadMesh = false; - for ( int row = 0; row < theCompErrors->length(); ++row ) + for ( int row = 0; row < (int) theCompErrors->length(); ++row ) { SMESH::ComputeError & err = theCompErrors[ row ]; @@ -1542,15 +1542,15 @@ LightApp_Dialog* SMESHGUI_ComputeOp::dlg() const //================================================================================ /*! * \brief Constructor -*/ + */ //================================================================================ SMESHGUI_PrecomputeOp::SMESHGUI_PrecomputeOp() : SMESHGUI_BaseComputeOp(), - myDlg( 0 ), - myOrderMgr( 0 ), myActiveDlg( 0 ), - myPreviewDisplayer( 0 ) + myDlg( 0 ), + myPreviewDisplayer( 0 ), + myOrderMgr( 0 ) { } @@ -1962,7 +1962,7 @@ void SMESHGUI_PrecomputeOp::onPreview() #endif aCompErrors = gen->GetComputeErrors( myMesh, myMainShape ); // check if there are memory problems - for ( int i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) + for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i ) memoryLack = ( aCompErrors[ i ].code == SMESH::COMPERR_MEMORY_PB ); } catch(const SALOME::SALOME_Exception & S_ex){ @@ -2293,7 +2293,7 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes, tbl->setColumnWidth( COL_ERROR, 200 ); bool hasBadMesh = false; - for ( int row = 0; row < theCompErrors->length(); ++row ) + for ( int row = 0; row < (int) theCompErrors->length(); ++row ) { SMESH::ComputeError & err = theCompErrors[ row ]; diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 06d9172e4..7d1495845 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -239,7 +239,9 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() } } break; - } + + default:; + } // switch( (*anIt).myValue.type() ) if( w ) { @@ -297,7 +299,7 @@ void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int result ) { SMESH::SObjectList listSOmesh = SMESH::GetMeshesUsingAlgoOrHypothesis( myHypo ); if( listSOmesh.size() > 0 ) - for( int i = 0; i < listSOmesh.size(); i++ ) + for( size_t i = 0; i < listSOmesh.size(); i++ ) { _PTR(SObject) submSO = listSOmesh[i]; SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface( submSO ); @@ -391,8 +393,8 @@ QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams { QString valueStr = ""; ListOfStdParams::const_iterator param = params.begin(), aLast = params.end(); - uint len0 = 0; - for( int i=0; param!=aLast; param++, i++ ) + int len0 = 0; + for ( ; param != aLast; param++ ) { if ( valueStr.length() > len0 ) { valueStr += "; "; @@ -749,12 +751,12 @@ HypothesisData::HypothesisData( const QString& theTypeName, Context( theContext ), Dim( theDim ), IsAuxOrNeedHyp( theIsAuxOrNeedHyp ), + IsNeedGeometry( theIsNeedGeometry ), + IsSupportSubmeshes( supportSub ), BasicHypos( theBasicHypos ), OptionalHypos( theOptionalHypos ), InputTypes( theInputTypes ), - OutputTypes( theOutputTypes ), - IsNeedGeometry( theIsNeedGeometry ), - IsSupportSubmeshes( supportSub ) + OutputTypes( theOutputTypes ) { } diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 351639e89..1ddf9b2a4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -88,10 +88,10 @@ //================================================================================ SMESHGUI_MeshOp::SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh ) : SMESHGUI_SelectionOp(), - myToCreate( theToCreate ), - myIsMesh( theIsMesh ), myDlg( 0 ), myShapeByMeshOp( 0 ), + myToCreate( theToCreate ), + myIsMesh( theIsMesh ), myHypoSet( 0 ) { if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists @@ -576,7 +576,7 @@ void SMESHGUI_MeshOp::selectionDone() if (aSeq->length() > 0) { shapeDim = -1; - for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) { + for ( CORBA::ULong iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) { GEOM::GEOM_Object_var aGeomVar = aSeq[iss]; switch ( aGeomVar->GetShapeType() ) { case GEOM::SOLID: shapeDim = 3; break; diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index 206f4504e..35bd50672 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -157,15 +157,15 @@ private: bool myHasConcurrentSubBefore; TDim2Type2HypList myExistingHyps; //!< all hypothesis of SMESH module - TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current + TDim2Type2HypList myObjHyps; //!< hypothesis assigned to the current // edited mesh/sub-mesh // hypdata corresponding to hypotheses present in myDlg THypDataList myAvailableHypData[4][NbHypTypes]; QString myLastGeomToSelect; THypLabelIsAppMap myHypMapIsApplicable; bool myIgnoreAlgoSelection; - HypothesesSet* myHypoSet; - int myDim, myType, myMaxShapeDim; + HypothesesSet* myHypoSet; + int myDim, myType, myMaxShapeDim; QString myObjectToSelect; }; diff --git a/src/SMESHUtils/SMESH_File.cxx b/src/SMESHUtils/SMESH_File.cxx index 8d138b46c..10c1f533f 100644 --- a/src/SMESHUtils/SMESH_File.cxx +++ b/src/SMESHUtils/SMESH_File.cxx @@ -271,7 +271,7 @@ void SMESH_File::rewind() bool SMESH_File::getInts(std::vector& ints) { - int i = 0; + size_t i = 0; while ( i < ints.size() ) { while ( !isdigit( *_pos ) && !eof()) ++_pos; @@ -330,7 +330,7 @@ bool SMESH_File::writeRaw(const void* data, size_t size) #else ssize_t nbWritten = ::write( _file, data, size ); - return ( nbWritten == size ); + return ( nbWritten == (ssize_t) size ); #endif } diff --git a/src/SMESHUtils/SMESH_MAT2d.cxx b/src/SMESHUtils/SMESH_MAT2d.cxx index 970d560e5..c9fcd8501 100644 --- a/src/SMESHUtils/SMESH_MAT2d.cxx +++ b/src/SMESHUtils/SMESH_MAT2d.cxx @@ -448,14 +448,14 @@ namespace addedEdges.insert( bndSegs[i]._edge->twin() ).second ) { v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex0(), v2Node.size() + 1 )).first; - int n0 = v2n->second; + size_t n0 = v2n->second; if ( n0 == v2Node.size() ) text << "n" << n0 << " = m.AddNode( " << bndSegs[i]._edge->vertex0()->x() / theScale[0] << ", " << bndSegs[i]._edge->vertex0()->y() / theScale[1] << ", 0 )\n"; v2n = v2Node.insert( make_pair( bndSegs[i]._edge->vertex1(), v2Node.size() + 1 )).first; - int n1 = v2n->second; + size_t n1 = v2n->second; if ( n1 == v2Node.size() ) text << "n" << n1 << " = m.AddNode( " << bndSegs[i]._edge->vertex1()->x() / theScale[0] << ", " @@ -1210,7 +1210,7 @@ namespace else // bndSegs[ i ]._branchID > 0 { dInd = +1; - for ( edgeInd = 0; edgeInd < branchEdges[ brID ].size(); ++edgeInd ) + for ( edgeInd = 0; edgeInd < (int)branchEdges[ brID ].size(); ++edgeInd ) if ( branchEdges[ brID ][ edgeInd ] == bndSegs[ i ]._edge ) break; } @@ -1386,7 +1386,7 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge, int di = ( points._params[0] == points._params[i] ) ? +1 : -1; while ( points._params[i] == points._params[i+1] ) i += di; - if ( i < 0 || i+1 >= points._params.size() ) + if ( i < 0 || i+1 >= (int)points._params.size() ) i = 0; } @@ -1394,9 +1394,9 @@ bool SMESH_MAT2d::Boundary::getBranchPoint( const std::size_t iEdge, if ( !points._maEdges[ i ].second ) // no branch at the EDGE end, look for a closest branch { - if ( i < points._maEdges.size() / 2 ) // near 1st point + if ( i < (int)points._maEdges.size() / 2 ) // near 1st point { - while ( i < points._maEdges.size()-1 && !points._maEdges[ i ].second ) + while ( i < (int)points._maEdges.size()-1 && !points._maEdges[ i ].second ) ++i; edgeParam = edgeReverse; } @@ -1699,7 +1699,7 @@ bool SMESH_MAT2d::Branch::getParameter(const BranchPoint & p, double & u ) const if ( p._iEdge > _params.size()-1 ) return false; if ( p._iEdge == _params.size()-1 ) - return u = 1.; + return ( u = 1. ); u = ( _params[ p._iEdge ] * ( 1 - p._edgeParam ) + _params[ p._iEdge+1 ] * p._edgeParam ); @@ -1805,7 +1805,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >& { // look for a VERTEX of the opposite EDGE // iNext - next after all null-length segments - while ( maE = ++iNext ) + while (( maE = ++iNext )) { iSeg2 = getBndSegment( maE ); if ( !_boundary->isConcaveSegment( ie1, iSeg2 )) @@ -1837,7 +1837,7 @@ bool SMESH_MAT2d::Branch::addDivPntForConcaVertex( std::vector< std::size_t >& else if ( isConcaPrev ) { // all null-length segments passed, find their beginning - while ( maE = iPrev.edgePrev() ) + while (( maE = iPrev.edgePrev() )) { iSeg1 = getBndSegment( maE ); if ( _boundary->isConcaveSegment( edgeIDs1.back(), iSeg1 )) @@ -1909,7 +1909,7 @@ void SMESH_MAT2d::Branch::getOppositeGeomEdges( std::vector< std::size_t >& edge BranchPoint divisionPnt; divisionPnt._branch = this; - for ( ++maIter, ++twIter; maIter.index() < _maEdges.size(); ++maIter, ++twIter ) + for ( ++maIter, ++twIter; maIter.index() < (int)_maEdges.size(); ++maIter, ++twIter ) { size_t ie1 = getGeomEdge( maIter.edge() ); size_t ie2 = getGeomEdge( twIter.edge() ); diff --git a/src/SMESHUtils/SMESH_Tree.hxx b/src/SMESHUtils/SMESH_Tree.hxx index eb7b2b864..983aa064b 100644 --- a/src/SMESHUtils/SMESH_Tree.hxx +++ b/src/SMESHUtils/SMESH_Tree.hxx @@ -138,8 +138,8 @@ SMESH_Tree::SMESH_Tree (SMESH_TreeLimit* limit): myFather(0), myIsLeaf( false ), myLimit( limit ), - myLevel(0), - myBox(0) + myBox(0), + myLevel(0) { //if ( !myLimit ) myLimit = new SMESH_TreeLimit(); } diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index fe64ce7b7..532c9a450 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -960,7 +960,7 @@ void SMESH_Gen_i::SetOption(const char* name, const char* value) // color must be presented as a string of next form: if ( str.at(0) == '#' && str.length() == 7 ) { // hexadecimal color ("#ffaa00", for example) str = str.substr(1); - for ( int i = 0; i < str.length()/2; i++ ) + for ( size_t i = 0; i < str.length()/2; i++ ) if ( str.at(i*2) >= '0' && str.at(i*2) <= 'f' && str.at(i*2+1) >= '0' && str.at(i*2+1) <= 'f' ) color.push_back( strtol( str.substr( i*2, 2 ).c_str(), NULL, 16 ) ); } @@ -4896,7 +4896,7 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent, _CORBA_Octet* buffer = new _CORBA_Octet[real_size]; char tmp[3]; tmp[2]='\0'; - int c = -1; + uint c = -1; for ( int i = 0; i < real_size; i++ ) { memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 ); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 0b927273c..f31e583eb 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -285,13 +285,13 @@ namespace MeshEditor_I { SMDS_MeshElement::Filter & filter = *aFilter; if ( aType == SMDSAbs_Node ) - for (int i=0; iFindNode( IDs[i] ); if ( filter( elem )) aMap.insert( aMap.end(), elem ); } else - for (int i=0; iFindElement( IDs[i] ); if ( filter( elem )) aMap.insert( aMap.end(), elem ); @@ -315,7 +315,7 @@ namespace MeshEditor_I { SMESH::long_array_var aElementsId = theObject->GetIDs(); if ( types->length() == 1 && types[0] == SMESH::NODE) { - for(int i = 0; i < aElementsId->length(); i++) + for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ ) if ( const SMDS_MeshNode * n = theMeshDS->FindNode( aElementsId[i] )) theNodeSet.insert( theNodeSet.end(), n); } @@ -323,13 +323,13 @@ namespace MeshEditor_I { { SMDS_NodeIteratorPtr nIt = theMeshDS->nodesIterator(); while ( nIt->more( )) - if( const SMDS_MeshElement * elem = nIt->next() ) + if ( const SMDS_MeshElement * elem = nIt->next() ) theNodeSet.insert( elem->begin_nodes(), elem->end_nodes()); } else { - for(int i = 0; i < aElementsId->length(); i++) - if( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] )) + for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ ) + if ( const SMDS_MeshElement * elem = theMeshDS->FindElement( aElementsId[i] )) theNodeSet.insert( elem->begin_nodes(), elem->end_nodes()); } } @@ -349,7 +349,7 @@ namespace MeshEditor_I { SMDSAbs_ElementType elemType = (*theElements.begin())->GetType(); bool sameElemType = ( elemType == (*theElements.rbegin())->GetType() ); if ( sameElemType && - theMeshDS->GetMeshInfo().NbElements( elemType ) == theElements.size() ) + theMeshDS->GetMeshInfo().NbElements( elemType ) == (int) theElements.size() ) return; // all the elements are in theElements if ( !sameElemType ) @@ -794,7 +794,7 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements) list< int > IdList; - for (int i = 0; i < IDsOfElements.length(); i++) + for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ ) IdList.push_back( IDsOfElements[i] ); // Update Python script @@ -823,7 +823,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo initData(); list< int > IdList; - for (int i = 0; i < IDsOfNodes.length(); i++) + for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++) IdList.push_back( IDsOfNodes[i] ); // Update Python script @@ -859,9 +859,7 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes() SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq ); // remove orphan nodes (if there are any) - list< int > IdList; - for ( int i = 0; i < seq.size(); i++ ) - IdList.push_back( seq[i] ); + list< int > IdList( seq.begin(), seq.end() ); int nbNodesBefore = myMesh->NbNodes(); getEditor().Remove( IdList, true ); @@ -1584,7 +1582,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfEleme SMESH_TRY; initData(); - for (int i = 0; i < IDsOfElements.length(); i++) + for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ ) { CORBA::Long index = IDsOfElements[i]; const SMDS_MeshElement * elem = getMeshDS()->FindElement(index); @@ -2273,7 +2271,7 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements, arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face); set fixedNodes; - for (int i = 0; i < IDsOfFixedNodes.length(); i++) { + for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) { CORBA::Long index = IDsOfFixedNodes[i]; const SMDS_MeshNode * node = aMesh->FindNode(index); if ( node ) @@ -2866,7 +2864,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the idSourceToSet( theFaces[i], getMeshDS(), elemsNodes[0], SMDSAbs_Face ); list angles; - for (int i = 0; i < theAngles.length(); i++) { + for ( CORBA::ULong i = 0; i < theAngles.length(); i++ ) { angles.push_back( theAngles[i] ); } @@ -4091,7 +4089,7 @@ FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr theObject, TIDSortedNodeSet nodes; idSourceToNodeSet( theObject, getMeshDS(), nodes ); - for ( int i = 0; i < theExceptSubMeshOrGroups.length(); ++i ) + for ( CORBA::ULong i = 0; i < theExceptSubMeshOrGroups.length(); ++i ) { SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( theExceptSubMeshOrGroups[i], SMESH::NODE ); @@ -4127,7 +4125,7 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN aTPythonDump << this << ".MergeNodes(["; TIDSortedNodeSet setOfNodesToKeep; - for ( int i = 0; i < NodesToKeep.length(); ++i ) + for ( CORBA::ULong i = 0; i < NodesToKeep.length(); ++i ) { prepareIdSource( NodesToKeep[i] ); SMDS_ElemIteratorPtr nodeIt = myMesh_i->GetElements( NodesToKeep[i], SMESH::NODE ); @@ -4136,12 +4134,12 @@ void SMESH_MeshEditor_i::MergeNodes (const SMESH::array_of_long_array& GroupsOfN } ::SMESH_MeshEditor::TListOfListOfNodes aListOfListOfNodes; - for (int i = 0; i < GroupsOfNodes.length(); i++) + for ( CORBA::ULong i = 0; i < GroupsOfNodes.length(); i++ ) { const SMESH::long_array& aNodeGroup = GroupsOfNodes[ i ]; aListOfListOfNodes.push_back( list< const SMDS_MeshNode* >() ); list< const SMDS_MeshNode* >& aListOfNodes = aListOfListOfNodes.back(); - for ( int j = 0; j < aNodeGroup.length(); j++ ) + for ( CORBA::ULong j = 0; j < aNodeGroup.length(); j++ ) { CORBA::Long index = aNodeGroup[ j ]; if ( const SMDS_MeshNode * node = aMesh->FindNode( index )) @@ -4227,11 +4225,11 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& GroupsO ::SMESH_MeshEditor::TListOfListOfElementsID aListOfListOfElementsID; - for (int i = 0; i < GroupsOfElementsID.length(); i++) { + for ( CORBA::ULong i = 0; i < GroupsOfElementsID.length(); i++ ) { const SMESH::long_array& anElemsIDGroup = GroupsOfElementsID[ i ]; aListOfListOfElementsID.push_back( list< int >() ); list< int >& aListOfElemsID = aListOfListOfElementsID.back(); - for ( int j = 0; j < anElemsIDGroup.length(); j++ ) { + for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ ) { CORBA::Long id = anElemsIDGroup[ j ]; aListOfElemsID.push_back( id ); } @@ -4456,7 +4454,7 @@ SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x, SMDSAbs_ElementType( type ), foundElems); res->length( foundElems.size() ); - for ( int i = 0; i < foundElems.size(); ++i ) + for ( size_t i = 0; i < foundElems.size(); ++i ) res[i] = foundElems[i]->GetID(); return res._retn(); @@ -4517,7 +4515,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID SMDSAbs_ElementType( type ), foundElems); res->length( foundElems.size() ); - for ( int i = 0; i < foundElems.size(); ++i ) + for ( size_t i = 0; i < foundElems.size(); ++i ) res[i] = foundElems[i]->GetID(); return res._retn(); @@ -4568,6 +4566,7 @@ static SMESH::SMESH_MeshEditor::Sew_Error convError( const::SMESH_MeshEditor::Se RETCASE( SEW_TOPO_DIFF_SETS_OF_ELEMENTS ); RETCASE( SEW_BAD_SIDE1_NODES ); RETCASE( SEW_BAD_SIDE2_NODES ); + RETCASE( SEW_INTERNAL_ERROR ); } return SMESH::SMESH_MeshEditor::SEW_OK; } @@ -4651,16 +4650,16 @@ SewCoincidentFreeBorders(const SMESH::CoincidentFreeBorders& freeBorders, for ( CORBA::ULong iP = 0; iP < aGRP.length(); ++iP ) { const SMESH::FreeBorderPart& aPART = aGRP[ iP ]; - if ( aPART.border < 0 || aPART.border >= freeBorders.borders.length() ) + if ( aPART.border < 0 || aPART.border >= (int) freeBorders.borders.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::border index", SALOME::BAD_PARAM); const SMESH::FreeBorder& aBRD = freeBorders.borders[ aPART.border ]; - if ( aPART.node1 < 0 || aPART.node1 > aBRD.nodeIDs.length() ) + if ( aPART.node1 < 0 || aPART.node1 > (int) aBRD.nodeIDs.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node1", SALOME::BAD_PARAM); - if ( aPART.node2 < 0 || aPART.node2 > aBRD.nodeIDs.length() ) + if ( aPART.node2 < 0 || aPART.node2 > (int) aBRD.nodeIDs.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::node2", SALOME::BAD_PARAM); - if ( aPART.nodeLast < 0 || aPART.nodeLast > aBRD.nodeIDs.length() ) + if ( aPART.nodeLast < 0 || aPART.nodeLast > (int) aBRD.nodeIDs.length() ) THROW_SALOME_CORBA_EXCEPTION("Invalid FreeBorderPart::nodeLast", SALOME::BAD_PARAM); // do not keep these nodes for further sewing as nodes can be removed by the sewing @@ -6500,7 +6499,7 @@ void SMESH_MeshEditor_i::CreateHoleSkin(CORBA::Double radius, theNodeSearcher = SMESH_MeshAlgos::GetNodeSearcher( *getMeshDS() ); vector nodesCoords; - for (int i = 0; i < theNodesCoords.length(); i++) + for ( CORBA::ULong i = 0; i < theNodesCoords.length(); i++) { nodesCoords.push_back( theNodesCoords[i] ); } @@ -6666,7 +6665,7 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim, groupsOfThisMesh ->length( groups.length() ); groupsOfOtherMesh->length( groups.length() ); int nbGroups = 0, nbGroupsOfOtherMesh = 0; - for ( int i = 0; i < groups.length(); ++i ) + for ( CORBA::ULong i = 0; i < groups.length(); ++i ) { SMESH::SMESH_Mesh_var m = groups[i]->GetMesh(); if ( myMesh_i != SMESH::DownCast( m )) diff --git a/src/SMESH_I/SMESH_NoteBook.cxx b/src/SMESH_I/SMESH_NoteBook.cxx index 943a1b767..75297f2db 100644 --- a/src/SMESH_I/SMESH_NoteBook.cxx +++ b/src/SMESH_I/SMESH_NoteBook.cxx @@ -53,7 +53,7 @@ namespace */ void SetVariable(Handle(_pyCommand) theCommand, const SMESH_ObjectStates* theStates, - int position, int theArgNb) + size_t position, int theArgNb) { if(theStates->GetCurrectState().size() > position) if(!theStates->GetCurrectState().at(position).IsEmpty()) @@ -100,7 +100,7 @@ void SMESH_ObjectStates::AddState(const TState &theState) //================================================================================ TState SMESH_ObjectStates::GetCurrectState() const { - if(_states.size() > _dumpstate) + if ( (int) _states.size() > _dumpstate) return _states[_dumpstate]; TState empty; return empty; @@ -236,7 +236,7 @@ SMESH_NoteBook::~SMESH_NoteBook() //================================================================================ void SMESH_NoteBook::ReplaceVariables() { - for(int i=0;i<_commands.size();i++) + for ( size_t i = 0 ; i < _commands.size(); i++ ) { Handle(_pyCommand) aCmd = _commands[i]; TCollection_AsciiString aMethod = aCmd->GetMethod(); @@ -714,7 +714,7 @@ void SMESH_NoteBook::ReplaceVariables() { TState aCurrentState = aStates->GetCurrectState(); int argIndex = h->getParamIndex( aMethod, aCurrentState.size() ); - if ( 0 <= argIndex && argIndex < aCurrentState.size() && + if ( 0 <= argIndex && argIndex < (int)aCurrentState.size() && !aCurrentState[argIndex].IsEmpty() ) aCmd->SetArg( 1, aCurrentState[argIndex] ); @@ -790,10 +790,10 @@ void SMESH_NoteBook::InitObjectMap() else aState = new SMESH_ObjectStates(anObjType); - for(int i = 0; i < aSections->length(); i++) { + for ( size_t i = 0; i < aSections->length(); i++ ) { TState aVars; SALOMEDS::ListOfStrings aListOfVars = aSections[i]; - for ( int j = 0; jIsVariable(aVar.ToCString())) { @@ -859,8 +859,8 @@ void SMESH_NoteBook::ProcessLayerDistribution() return; // 2) Initialize all type of 1D Distribution hypothesis - for(int i=0;i<_commands.size();i++){ - for(int j =0;j < aLDS.size();j++){ + for ( size_t i = 0; i < _commands.size(); i++ ) { + for ( size_t j = 0; j < aLDS.size(); j++ ) { TCollection_AsciiString aResultValue = _commands[i]->GetResultValue(); if(_commands[i]->GetMethod() == "CreateHypothesis" && aLDS[j]->HasDistribution(aResultValue)){ @@ -872,8 +872,8 @@ void SMESH_NoteBook::ProcessLayerDistribution() } // 3) ... and replase variables ... - for(int i=0;i<_commands.size();i++){ - for(int j =0;j < aLDS.size();j++){ + for ( size_t i = 0; i < _commands.size(); i++ ) { + for ( size_t j = 0; j < aLDS.size(); j++ ) { TCollection_AsciiString anObject = _commands[i]->GetObject(); if(aLDS[j]->HasDistribution(anObject)) { @@ -929,8 +929,8 @@ void SMESH_NoteBook::ProcessLayerDistribution() TCollection_AsciiString SMESH_NoteBook::GetResultScript() const { TCollection_AsciiString aResult; - for(int i=0;i<_commands.size();i++) - aResult+=_commands[i]->GetString()+"\n"; + for ( size_t i = 0; i < _commands.size(); i++ ) + aResult += _commands[i]->GetString() + "\n"; return aResult; } @@ -941,7 +941,7 @@ TCollection_AsciiString SMESH_NoteBook::GetResultScript() const //================================================================================ void SMESH_NoteBook::GetResultLines(std::list< TCollection_AsciiString >& lines) const { - for(int i=0;i<_commands.size();i++) + for ( size_t i = 0; i < _commands.size(); i++ ) lines.push_back( _commands[i]->GetString() ); } diff --git a/src/StdMeshers/StdMeshers_Adaptive1D.cxx b/src/StdMeshers/StdMeshers_Adaptive1D.cxx index 2fc76a7b3..8ffcc0ce2 100644 --- a/src/StdMeshers/StdMeshers_Adaptive1D.cxx +++ b/src/StdMeshers/StdMeshers_Adaptive1D.cxx @@ -992,7 +992,7 @@ ostream & StdMeshers_Adaptive1D::SaveTo(ostream & save) istream & StdMeshers_Adaptive1D::LoadFrom(istream & load) { int dummyParam; - bool isOK = (load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam); + bool isOK = static_cast(load >> myMinSize >> myMaxSize >> myDeflection >> dummyParam >> dummyParam); if (!isOK) load.clear(ios::badbit | load.rdstate()); return load; diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx index 2642dd1af..deabddb71 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.cxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.cxx @@ -144,22 +144,22 @@ istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load) { bool isOK = true; int intVal; - isOK = (load >> _begLength); + isOK = static_cast(load >> _begLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _endLength); + isOK = static_cast(load >> _endLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index 6d8135590..7226e4beb 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -799,51 +799,51 @@ std::istream & StdMeshers_CartesianParameters3D::LoadFrom(std::istream & load) { bool ok; - ok = ( load >> _sizeThreshold ); + ok = static_cast( load >> _sizeThreshold ); for ( int ax = 0; ax < 3; ++ax ) { if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _coords[ax].resize( i ); for ( i = 0; i < _coords[ax].size() && ok; ++i ) - ok = (load >> _coords[ax][i] ); + ok = static_cast(load >> _coords[ax][i] ); } } if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _internalPoints[ax].resize( i ); for ( i = 0; i < _internalPoints[ax].size() && ok; ++i ) - ok = (load >> _internalPoints[ax][i] ); + ok = static_cast(load >> _internalPoints[ax][i] ); } } if (ok) { size_t i = 0; - ok = (load >> i ); + ok = static_cast(load >> i ); if ( i > 0 && ok ) { _spaceFunctions[ax].resize( i ); for ( i = 0; i < _spaceFunctions[ax].size() && ok; ++i ) - ok = (load >> _spaceFunctions[ax][i] ); + ok = static_cast(load >> _spaceFunctions[ax][i] ); } } } - ok = ( load >> _toAddEdges ); + ok = static_cast( load >> _toAddEdges ); for ( int i = 0; i < 9 && ok; ++i ) - ok = ( load >> _axisDirs[i]); + ok = static_cast( load >> _axisDirs[i]); for ( int i = 0; i < 3 && ok ; ++i ) - ok = ( load >> _fixedPoint[i]); + ok = static_cast( load >> _fixedPoint[i]); return load; } diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index c2aa6f3e4..b896de3b6 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -696,17 +696,17 @@ namespace int& di, double tol ) { //val += values[0]; // input \a val is measured from 0. - if ( i > values.size()-2 ) + if ( i > (int) values.size()-2 ) i = values.size()-2; else - while ( i+2 < values.size() && val > values[ i+1 ]) + while ( i+2 < (int) values.size() && val > values[ i+1 ]) ++i; while ( i > 0 && val < values[ i ]) --i; if ( i > 0 && val - values[ i ] < tol ) di = -1; - else if ( i+2 < values.size() && values[ i+1 ] - val < tol ) + else if ( i+2 < (int) values.size() && values[ i+1 ] - val < tol ) di = 1; else di = 0; @@ -1776,7 +1776,7 @@ namespace if ( quad._eIntNodes[ iP ]->IsUsedInFace( polygon )) quad._eIntNodes[ iP ]->_usedInFace = 0; #endif - int nbUsedEdgeNodes = 0; + size_t nbUsedEdgeNodes = 0; _Face* prevPolyg = 0; // polygon previously created from this quad while ( nbSplits > 0 ) @@ -1839,7 +1839,7 @@ namespace else { _OrientedLink foundSplit; - for ( int i = iS; i < splits.size() && !foundSplit; ++i ) + for ( size_t i = iS; i < splits.size() && !foundSplit; ++i ) if (( foundSplit = splits[ i ]) && ( n2->IsLinked( foundSplit.FirstNode()->_intPoint ))) { @@ -2100,7 +2100,7 @@ namespace { sortVertexNodes( chainNodes, curNode, curFace ); } - for ( int i = 0; i < chainNodes.size(); ++i ) + for ( size_t i = 0; i < chainNodes.size(); ++i ) { polygon.AddPolyLink( chainNodes[ i ], curNode ); curNode = chainNodes[ i ]; @@ -2322,9 +2322,9 @@ namespace i = int(lineInd.I()) + dInd[iL][0]; j = int(lineInd.J()) + dInd[iL][1]; k = int(lineInd.K()) + dInd[iL][2]; - if ( i < 0 || i >= nbCells[0] || - j < 0 || j >= nbCells[1] || - k < 0 || k >= nbCells[2] ) continue; + if ( i < 0 || i >= (int) nbCells[0] || + j < 0 || j >= (int) nbCells[1] || + k < 0 || k >= (int) nbCells[2] ) continue; const size_t hexIndex = _grid->CellIndex( i,j,k ); Hexahedron *& hex = allHexa[ hexIndex ]; @@ -2436,7 +2436,7 @@ namespace planes._zProjs [0] = 0; const double zFactor = _grid->_axes[ iDirZ ] * planes._zNorm; const vector< double > & u = _grid->_coords[ iDirZ ]; - for ( int i = 1; i < planes._zProjs.size(); ++i ) + for ( size_t i = 1; i < planes._zProjs.size(); ++i ) { planes._zProjs [i] = zFactor * ( u[i] - u[0] ); } @@ -2870,7 +2870,7 @@ namespace { bool isOut = false; - const bool moreIntPoints = ( iP+1 < link._fIntPoints.size() ); + const bool moreIntPoints = ( iP+1 < (int) link._fIntPoints.size() ); // get 2 _Node's _Node* n1 = link._fIntNodes[ iP ]; @@ -3049,7 +3049,7 @@ namespace // sort nodes accoring to the order of edges _Node* orderNodes [20]; TGeomID orderShapeIDs[20]; - int nbN = 0; + size_t nbN = 0; TGeomID id, *pID; for ( e = edges.begin(); e != edges.end(); ++e ) { @@ -3536,7 +3536,7 @@ bool StdMeshers_Cartesian_3D::Compute(SMESH_Mesh & theMesh, map< TGeomID, vector< TGeomID > > edge2faceIDsMap; TopExp_Explorer eExp; Bnd_Box shapeBox; - for ( int i = 0; i < faceVec.size(); ++i ) + for ( size_t i = 0; i < faceVec.size(); ++i ) { facesItersectors[i]._face = TopoDS::Face ( faceVec[i] ); facesItersectors[i]._faceID = grid._shapes.Add( faceVec[i] ); diff --git a/src/StdMeshers/StdMeshers_Deflection1D.cxx b/src/StdMeshers/StdMeshers_Deflection1D.cxx index 2fbaefb01..d2bc5501c 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.cxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.cxx @@ -119,7 +119,7 @@ ostream & StdMeshers_Deflection1D::SaveTo(ostream & save) istream & StdMeshers_Deflection1D::LoadFrom(istream & load) { - bool isOK = (load >> _value); + bool isOK = static_cast(load >> _value); if (!isOK) load.clear(ios::badbit | load.rdstate()); return load; diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 455f82bae..574466cc7 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -132,8 +132,8 @@ bool FunctionTable::value( const double t, double& f ) const double FunctionTable::integral( const int i ) const { - if( i>=0 && i= 0 && i < (int)myData.size()-1 ) + return integral( i, myData[2*(i+1)] - myData[2*i] ); else return 0; } diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 2625b9fb1..3849040e9 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -310,14 +310,14 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, if ( NbEdges() == 0 ) return myPoints; StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this ); - SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); + //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() ); SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() ); fHelper.SetSubShape( myFace ); bool paramOK; double eps = 1e-100; - // sort nodes of all edges putting them into a map + // sort nodes of all edges by putting them into a map map< double, const SMDS_MeshNode*> u2node; vector< pair< double, const SMDS_MeshNode*> > u2nodeVec; @@ -428,8 +428,8 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, u2node.insert( u2node.end(), make_pair( 1., node )); } - if ( u2node.size() + nbProxyNodes != myNbPonits && - u2node.size() + nbProxyNodes != NbPoints( /*update=*/true )) + if ((int) u2node.size() + nbProxyNodes != myNbPonits && + (int) u2node.size() + nbProxyNodes != NbPoints( /*update=*/true )) { MESSAGE("Wrong node parameters on edges, u2node.size():" <& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, // set if ( isXConst ) - for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].x = constValue; + for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].x = constValue; else - for ( iPt = 0; iPt < points.size(); ++iPt ) points[ iPt ].y = constValue; + for ( iPt = 0; iPt < (int)points.size(); ++iPt ) points[ iPt ].y = constValue; } // if ( myPoints.empty()) @@ -543,7 +543,7 @@ const vector& StdMeshers_FaceSide::SimulateUVPtStruct(int nbSeg, int EdgeIndex = 0; double prevNormPar = 0, paramSize = myNormPar[ EdgeIndex ]; - for (int i = 0 ; i < myFalsePoints.size(); ++i ) { + for ( size_t i = 0 ; i < myFalsePoints.size(); ++i ) { double normPar = double(i) / double(nbSeg); UVPtStruct & uvPt = (*points)[i]; uvPt.node = 0; @@ -582,7 +582,7 @@ std::vector StdMeshers_FaceSide::GetOrderedNodes(int theEd { if ( NbEdges() == 0 ) return resultNodes; - SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); + //SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS(); SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() ); SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() ); fHelper.SetSubShape( myFace ); @@ -682,8 +682,8 @@ std::vector StdMeshers_FaceSide::GetOrderedNodes(int theEd // Fill the result vector if ( theEdgeInd < 0 && - u2node.size() != myNbPonits && - u2node.size() != NbPoints( /*update=*/true )) + (int) u2node.size() != myNbPonits && + (int) u2node.size() != NbPoints( /*update=*/true )) { u2node.clear(); } @@ -810,7 +810,7 @@ const SMDS_MeshNode* StdMeshers_FaceSide::VertexNode(std::size_t i, bool* isMove n = SMESH_Algo::VertexNode( V, sm, myProxyMesh->GetMesh(), /*checkV=*/false ); if (( !n ) && - (( i > 0 && i < NbEdges() ) || IsClosed() )) + (( i > 0 && (int) i < NbEdges() ) || IsClosed() )) { iE = SMESH_MesherHelper::WrapIndex( int(i)-1, NbEdges() ); sm = myProxyMesh->GetMeshDS()->MeshElements( myEdgeID[ iE ]); @@ -1051,7 +1051,7 @@ void StdMeshers_FaceSide::dump(const char* msg) const if (msg) MESSAGE ( std::endl << msg ); MESSAGE_BEGIN ("NB EDGES: "<< myEdge.size() ); MESSAGE_ADD ( "nbPoints: "<()<() - << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() ); + << " V2: " << TopExp::LastVertex( myEdge[i], 1).TShape().operator->() ); } MESSAGE_ADD ( "\tC2d: "); - + if (myC2d[i].IsNull()) { MESSAGE_ADD ( "NULL" ); } else { MESSAGE_ADD ( myC2d[i].operator->() ); } - + MESSAGE_ADD ( "\tF: "< 0 && myPoints[ i ].normParam > U ) --i; - while ( i+1 < myPoints.size() && myPoints[ i+1 ].normParam < U ) + while ( i+1 < (int)myPoints.size() && myPoints[ i+1 ].normParam < U ) ++i; double r = (( U - myPoints[ i ].normParam ) / ( myPoints[ i+1 ].normParam - myPoints[ i ].normParam )); diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx index cd9b520d3..83e19296b 100644 --- a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx @@ -150,37 +150,37 @@ istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load) int intVal; double dblVal; - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _params.clear(); _params.reserve( intVal ); for ( size_t i = 0; i < _params.capacity() && isOK; i++) { - isOK = (load >> dblVal); + isOK = static_cast(load >> dblVal); if ( isOK ) _params.push_back( dblVal ); } } - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _nbsegs.clear(); _nbsegs.reserve( intVal ); for ( size_t i = 0; i < _nbsegs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _nbsegs.push_back( intVal ); } } - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.clear(); _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); return load; } diff --git a/src/StdMeshers/StdMeshers_Geometric1D.cxx b/src/StdMeshers/StdMeshers_Geometric1D.cxx index eb50e45a9..dd77350f7 100644 --- a/src/StdMeshers/StdMeshers_Geometric1D.cxx +++ b/src/StdMeshers/StdMeshers_Geometric1D.cxx @@ -132,8 +132,8 @@ ostream & StdMeshers_Geometric1D::SaveTo(ostream & save) istream & StdMeshers_Geometric1D::LoadFrom(istream & load) { bool isOK = true; - isOK = (load >> _begLength); - isOK = (load >> _ratio); + isOK = static_cast(load >> _begLength); + isOK = static_cast(load >> _ratio); if (isOK) StdMeshers_Reversible1D::LoadFrom( load ); diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx index a31944c64..340271d55 100644 --- a/src/StdMeshers/StdMeshers_LengthFromEdges.cxx +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.cxx @@ -106,7 +106,7 @@ istream & StdMeshers_LengthFromEdges::LoadFrom(istream & load) { bool isOK = true; int a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_mode = a; else diff --git a/src/StdMeshers/StdMeshers_LocalLength.cxx b/src/StdMeshers/StdMeshers_LocalLength.cxx index ea14e8126..d86e9becb 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.cxx +++ b/src/StdMeshers/StdMeshers_LocalLength.cxx @@ -148,13 +148,13 @@ istream & StdMeshers_LocalLength::LoadFrom(istream & load) bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_length = a; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_precision = a; else diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.cxx b/src/StdMeshers/StdMeshers_MaxElementArea.cxx index 726909c3d..ed2d53fb2 100644 --- a/src/StdMeshers/StdMeshers_MaxElementArea.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementArea.cxx @@ -114,7 +114,7 @@ istream & StdMeshers_MaxElementArea::LoadFrom(istream & load) { bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_maxArea = a; else diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx index 4ece14008..21a4d78a9 100644 --- a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx @@ -116,7 +116,7 @@ istream & StdMeshers_MaxElementVolume::LoadFrom(istream & load) { bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_maxVolume = a; else diff --git a/src/StdMeshers/StdMeshers_MaxLength.cxx b/src/StdMeshers/StdMeshers_MaxLength.cxx index 3d5529940..75ca617c8 100644 --- a/src/StdMeshers/StdMeshers_MaxLength.cxx +++ b/src/StdMeshers/StdMeshers_MaxLength.cxx @@ -158,20 +158,20 @@ istream & StdMeshers_MaxLength::LoadFrom(istream & load) bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _length = a; else load.clear(ios::badbit | load.rdstate()); - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _preestimated = a; else load.clear(ios::badbit | load.rdstate()); bool pre; - isOK = (load >> pre); + isOK = static_cast(load >> pre); if ( isOK ) _preestimation = pre; else diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx index d3e0b5277..f3fa3104c 100644 --- a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx @@ -118,7 +118,7 @@ ostream & StdMeshers_NumberOfLayers::SaveTo(ostream & save) istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load) { bool isOK = true; - isOK = (load >> _nbLayers); + isOK = static_cast(load >> _nbLayers); if (!isOK) load.clear(ios::badbit | load.rdstate()); return load; diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx index 8d262e36f..2fec858ef 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.cxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.cxx @@ -548,7 +548,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) int a; // read number of segments - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _numberOfSegments = a; else @@ -561,7 +561,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) // (nb.segments, distr.type, some other params.), // we wait here the ditribution type, which is integer double scale_factor; - isOK = (load >> scale_factor); + isOK = static_cast(load >> scale_factor); a = (int)scale_factor; // try to interprete ditribution type, @@ -582,7 +582,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) { case DT_Scale: { - isOK = (load >> b); + isOK = static_cast(load >> b); if (isOK) _scaleFactor = b; else @@ -596,13 +596,13 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) break; case DT_TabFunc: { - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) { _table.resize(a, 0.); for ( size_t i=0; i < _table.size(); i++ ) { - isOK = (load >> b); + isOK = static_cast(load >> b); if (isOK) _table[i] = b; else @@ -621,7 +621,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) case DT_ExprFunc: { string str; - isOK = (load >> str); + isOK = static_cast(load >> str); if (isOK) _func = str; else @@ -640,7 +640,7 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc) { - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) _convMode = a; else @@ -649,14 +649,14 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load) // load reversed edges IDs int intVal; - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK && _distrType != DT_Regular && intVal > 0 ) { _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index 3c3abe385..f4c519ae7 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -495,26 +495,23 @@ static bool HasIntersection3(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint, //======================================================================= static bool HasIntersection(const gp_Pnt& P, const gp_Pnt& PC, gp_Pnt& Pint, - Handle(TColgp_HSequenceOfPnt)& aContour) + TColgp_SequenceOfPnt& aContour) { - if(aContour->Length()==3) { - return HasIntersection3( P, PC, Pint, aContour->Value(1), - aContour->Value(2), aContour->Value(3) ); + if ( aContour.Length() == 3 ) { + return HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) ); } else { bool check = false; - if( (aContour->Value(1).Distance(aContour->Value(2)) > 1.e-6) && - (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) && - (aContour->Value(2).Distance(aContour->Value(3)) > 1.e-6) ) { - check = HasIntersection3( P, PC, Pint, aContour->Value(1), - aContour->Value(2), aContour->Value(3) ); + if( (aContour(1).Distance(aContour(2)) > 1.e-6) && + (aContour(1).Distance(aContour(3)) > 1.e-6) && + (aContour(2).Distance(aContour(3)) > 1.e-6) ) { + check = HasIntersection3( P, PC, Pint, aContour(1), aContour(2), aContour(3) ); } if(check) return true; - if( (aContour->Value(1).Distance(aContour->Value(4)) > 1.e-6) && - (aContour->Value(1).Distance(aContour->Value(3)) > 1.e-6) && - (aContour->Value(4).Distance(aContour->Value(3)) > 1.e-6) ) { - check = HasIntersection3( P, PC, Pint, aContour->Value(1), - aContour->Value(3), aContour->Value(4) ); + if( (aContour(1).Distance(aContour(4)) > 1.e-6) && + (aContour(1).Distance(aContour(3)) > 1.e-6) && + (aContour(4).Distance(aContour(3)) > 1.e-6) ) { + check = HasIntersection3( P, PC, Pint, aContour(1), aContour(3), aContour(4) ); } if(check) return true; } @@ -546,24 +543,23 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *aMesh.GetMeshDS() ); SMESH_ElementSearcher* searcher = const_cast(myElemSearcher); - //SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); - //cout<<" CheckIntersection: meshDS->NbFaces() = "<NbFaces()< suspectElems; searcher->GetElementsNearLine( line, SMDSAbs_Face, suspectElems); + TColgp_SequenceOfPnt aContour; for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { const SMDS_MeshElement* face = suspectElems[iF]; if ( face == NotCheckedFace ) continue; - Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; + aContour.Clear(); for ( int i = 0; i < face->NbCornerNodes(); ++i ) - aContour->Append( SMESH_TNodeXYZ( face->GetNode(i) )); - if( HasIntersection(P, PC, Pres, aContour) ) { + aContour.Append( SMESH_TNodeXYZ( face->GetNode(i) )); + if ( HasIntersection(P, PC, Pres, aContour)) { res = true; double tmp = PC.Distance(Pres); if ( tmp < dist ) { @@ -591,8 +587,8 @@ bool StdMeshers_QuadToTriaAdaptor::CheckIntersection (const gp_Pnt& P, //================================================================================ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face, - Handle(TColgp_HArray1OfPnt)& PN, - Handle(TColgp_HArray1OfVec)& VN, + TColgp_Array1OfPnt& PN, + TColgp_Array1OfVec& VN, vector& FNodes, gp_Pnt& PC, gp_Vec& VNorm, @@ -608,7 +604,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face for ( i = 0; i < 4; ++i ) { gp_XYZ p = SMESH_TNodeXYZ( FNodes[i] = face->GetNode(i) ); - PN->SetValue( i+1, p ); + PN.SetValue( i+1, p ); xyzC += p; } PC = xyzC/4; @@ -619,7 +615,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face for(i=1; i<4; i++) { j = i+1; for(; j<=4; j++) { - if( PN->Value(i).Distance(PN->Value(j)) < 1.e-6 ) + if( PN(i).Distance(PN(j)) < 1.e-6 ) break; } if(j<=4) break; @@ -630,7 +626,7 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face if(i<4) { //cout<<"find degeneration"<Value(i); + gp_Pnt Pdeg = PN(i); list< const SMDS_MeshNode* >::iterator itdg = myDegNodes.begin(); const SMDS_MeshNode* DegNode = 0; @@ -651,24 +647,24 @@ int StdMeshers_QuadToTriaAdaptor::Preparation(const SMDS_MeshElement* face FNodes[i-1] = DegNode; } for(i=j; i<4; i++) { - PN->SetValue(i,PN->Value(i+1)); + PN.SetValue(i,PN.Value(i+1)); FNodes[i-1] = FNodes[i]; } nbp = 3; } - PN->SetValue(nbp+1,PN->Value(1)); + PN.SetValue(nbp+1,PN(1)); FNodes[nbp] = FNodes[0]; // find normal direction - gp_Vec V1(PC,PN->Value(nbp)); - gp_Vec V2(PC,PN->Value(1)); + gp_Vec V1(PC,PN(nbp)); + gp_Vec V2(PC,PN(1)); VNorm = V1.Crossed(V2); - VN->SetValue(nbp,VNorm); + VN.SetValue(nbp,VNorm); for(i=1; iValue(i)); - V2 = gp_Vec(PC,PN->Value(i+1)); + V1 = gp_Vec(PC,PN(i)); + V2 = gp_Vec(PC,PN(i+1)); gp_Vec Vtmp = V1.Crossed(V2); - VN->SetValue(i,Vtmp); + VN.SetValue(i,Vtmp); VNorm += Vtmp; } @@ -736,8 +732,8 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, myElemSearcher = SMESH_MeshAlgos::GetElementSearcher( *meshDS ); const SMESHDS_SubMesh * aSubMeshDSFace; - Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5); - Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4); + TColgp_Array1OfPnt PN(1,5); + TColgp_Array1OfVec VN(1,4); vector FNodes(5); gp_Pnt PC; gp_Vec VNorm; @@ -796,9 +792,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, for(; i<=4; i++) { gp_Pnt Pbest; if(!isRev) - Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i).Reversed()); + Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i).Reversed()); else - Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i)); + Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i)); xc += Pbest.X(); yc += Pbest.Y(); zc += Pbest.Z(); @@ -807,31 +803,21 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, // check PCbest double height = PCbest.Distance(PC); - if(height<1.e-6) { + if ( height < 1.e-6 ) { // create new PCbest using a bit shift along VNorm PCbest = PC.XYZ() + VNorm.XYZ() * 0.001; } else { // check possible intersection with other faces gp_Pnt Pint; - bool check = CheckIntersection(PCbest, PC, Pint, aMesh, aShape, face); - if(check) { - //cout<<"--PC("<(myElemSearcher); + TColgp_Array1OfPnt PN(1,5); + TColgp_Array1OfVec VN(1,4); + vector FNodes(5); + TColgp_SequenceOfPnt aContour; + SMDS_FaceIteratorPtr fIt = meshDS->facesIterator(/*idInceasingOrder=*/true); while( fIt->more()) { const SMDS_MeshElement* face = fIt->next(); if ( !face ) continue; // retrieve needed information about a face - Handle(TColgp_HArray1OfPnt) PN = new TColgp_HArray1OfPnt(1,5); - Handle(TColgp_HArray1OfVec) VN = new TColgp_HArray1OfVec(1,4); - vector FNodes(5); gp_Pnt PC; gp_Vec VNorm; const SMDS_MeshElement* volumes[2]; @@ -970,7 +958,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) SMDS_MeshFace* NewFace; // check orientation - double tmp = PN->Value(1).Distance(PN->Value(2)) + PN->Value(2).Distance(PN->Value(3)); + double tmp = PN(1).Distance(PN(2)) + PN(2).Distance(PN(3)); // far points in VNorm direction gp_Pnt Ptmp1 = PC.XYZ() + VNorm.XYZ() * tmp * 1.e6; gp_Pnt Ptmp2 = PC.XYZ() - VNorm.XYZ() * tmp * 1.e6; @@ -989,9 +977,9 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) for ( size_t iF = 0; iF < suspectElems.size(); ++iF ) { const SMDS_MeshElement* F = suspectElems[iF]; if ( F == face ) continue; - Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; + aContour.Clear(); for ( int i = 0; i < 4; ++i ) - aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) )); + aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) )); gp_Pnt PPP; if ( !volumes[0] && HasIntersection( Ptmp1, PC, PPP, aContour )) { IsOK1 = true; @@ -1045,7 +1033,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) gp_XYZ PCbest(0., 0., 0.); // pyramid peak int i = 1; for ( ; i <= 4; i++ ) { - gp_Pnt Pbest = FindBestPoint(PN->Value(i), PN->Value(i+1), PC, VN->Value(i)); + gp_Pnt Pbest = FindBestPoint(PN(i), PN(i+1), PC, VN(i)); PCbest += Pbest.XYZ(); } PCbest /= 4; @@ -1061,7 +1049,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) // Restrict pyramid height by intersection with other faces gp_Vec tmpDir(PC,PCbest); tmpDir.Normalize(); - double tmp = PN->Value(1).Distance(PN->Value(3)) + PN->Value(2).Distance(PN->Value(4)); + double tmp = PN(1).Distance(PN(3)) + PN(2).Distance(PN(4)); // far points: in (PC, PCbest) direction and vice-versa gp_Pnt farPnt[2] = { PC.XYZ() + tmpDir.XYZ() * tmp * 1.e6, PC.XYZ() - tmpDir.XYZ() * tmp * 1.e6 }; @@ -1078,10 +1066,10 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh) { const SMDS_MeshElement* F = suspectElems[iF]; if ( F == face ) continue; - Handle(TColgp_HSequenceOfPnt) aContour = new TColgp_HSequenceOfPnt; - int nbN = F->NbNodes() / ( F->IsQuadratic() ? 2 : 1 ); + aContour.Clear(); + int nbN = F->NbCornerNodes(); for ( i = 0; i < nbN; ++i ) - aContour->Append( SMESH_TNodeXYZ( F->GetNode(i) )); + aContour.Append( SMESH_TNodeXYZ( F->GetNode(i) )); gp_Pnt intP; for ( int isRev = 0; isRev < 2; ++isRev ) { diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx index c1082f7ce..44470b8e9 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.hxx @@ -32,8 +32,8 @@ class SMESH_ElementSearcher; class SMDS_MeshElement; class SMDS_MeshNode; class SMDS_MeshFace; -class Handle_TColgp_HArray1OfPnt; -class Handle_TColgp_HArray1OfVec; +class TColgp_Array1OfPnt; +class TColgp_Array1OfVec; class gp_Pnt; class gp_Vec; @@ -65,8 +65,8 @@ public: protected: int Preparation(const SMDS_MeshElement* face, - Handle_TColgp_HArray1OfPnt& PN, - Handle_TColgp_HArray1OfVec& VN, + TColgp_Array1OfPnt& PN, + TColgp_Array1OfVec& VN, std::vector& FNodes, gp_Pnt& PC, gp_Vec& VNorm, const SMDS_MeshElement** volumes=0); diff --git a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx index 708b9a2fa..9ba7ec23a 100644 --- a/src/StdMeshers/StdMeshers_QuadrangleParams.cxx +++ b/src/StdMeshers/StdMeshers_QuadrangleParams.cxx @@ -153,16 +153,16 @@ ostream & StdMeshers_QuadrangleParams::SaveTo(ostream & save) istream & StdMeshers_QuadrangleParams::LoadFrom(istream & load) { bool isOK = true; - isOK = (load >> _triaVertexID); + isOK = static_cast(load >> _triaVertexID); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); if (!isOK) load.clear(ios::badbit | load.rdstate()); int type; - isOK = (load >> type); + isOK = static_cast(load >> type); if (isOK) _quadType = StdMeshers_QuadType(type); diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index a3bf670cb..e55edf26a 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -1781,10 +1781,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh, // 0 bottom 1 - const int bfrom = quad->side[0].from; - const int rfrom = quad->side[1].from; + //const int bfrom = quad->side[0].from; + //const int rfrom = quad->side[1].from; const int tfrom = quad->side[2].from; - const int lfrom = quad->side[3].from; + //const int lfrom = quad->side[3].from; { const vector& uv_eb_vec = quad->side[0].GetUVPtStruct(true,0); const vector& uv_er_vec = quad->side[1].GetUVPtStruct(false,1); @@ -1925,10 +1925,10 @@ bool StdMeshers_Quadrangle_2D::computeQuadPref (SMESH_Mesh & aMesh, } // if ( dv != 0 && dh != 0 ) - const int db = quad->side[0].IsReversed() ? -1 : +1; - const int dr = quad->side[1].IsReversed() ? -1 : +1; + //const int db = quad->side[0].IsReversed() ? -1 : +1; + //const int dr = quad->side[1].IsReversed() ? -1 : +1; const int dt = quad->side[2].IsReversed() ? -1 : +1; - const int dl = quad->side[3].IsReversed() ? -1 : +1; + //const int dl = quad->side[3].IsReversed() ? -1 : +1; // Case dv == 0, here possibly myQuadList.size() > 1 // @@ -2970,7 +2970,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh, const vector& uv_et = quad->side[2].GetUVPtStruct(true,1); const vector& uv_el = quad->side[3].GetUVPtStruct(false,0); - if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl) + if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr || + (int) uv_et.size() != nt || (int) uv_el.size() != nl) return error(COMPERR_BAD_INPUT_MESH); // arrays for normalized params @@ -3283,7 +3284,8 @@ bool StdMeshers_Quadrangle_2D::computeReduced (SMESH_Mesh & aMesh, const vector& uv_et = quad->side[2].GetUVPtStruct(true,1); const vector& uv_el = quad->side[3].GetUVPtStruct(false,0); - if (uv_eb.size() != nb || uv_er.size() != nr || uv_et.size() != nt || uv_el.size() != nl) + if ((int) uv_eb.size() != nb || (int) uv_er.size() != nr || + (int) uv_et.size() != nt || (int) uv_el.size() != nl) return error(COMPERR_BAD_INPUT_MESH); gp_UV uv[ UV_SIZE ]; @@ -4337,7 +4339,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, // check if there are possible variations in choosing corners bool haveVariants = false; - if ( vertexByAngle.size() > nbCorners ) + if ((int) vertexByAngle.size() > nbCorners ) { double lostAngle = a2v->first; double lastAngle = ( --a2v, a2v->first ); @@ -4345,7 +4347,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, } const double angleTol = 5.* M_PI/180; - myCheckOri = ( vertexByAngle.size() > nbCorners || + myCheckOri = ( (int)vertexByAngle.size() > nbCorners || vertexByAngle.begin()->first < angleTol ); // make theWire begin from a corner vertex or triaVertex @@ -4475,7 +4477,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, { // select two halfDivider's as corners TGeoIndex hd1, hd2 = -1; - int iC2; + size_t iC2; for ( iC2 = 0; iC2 < cornerInd.size() && hd2 < 0; ++iC2 ) { hd1 = cornerInd[ iC2 ]; @@ -4521,10 +4523,10 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, vector< double > accuLength; double totalLen = 0; vector< TGeoIndex > evVec( equVerts.begin(), equVerts.end() ); - int iEV = 0; + size_t iEV = 0; TGeoIndex iE = cornerInd[ helper.WrapIndex( iC - nbC[0] - 1, cornerInd.size() )]; TGeoIndex iEEnd = cornerInd[ helper.WrapIndex( iC + nbC[1] + 1, cornerInd.size() )]; - while ( accuLength.size() < nbEqualV + int( !allCornersSame ) ) + while ((int) accuLength.size() < nbEqualV + int( !allCornersSame ) ) { // accumulate length of edges before iEV-th equal vertex accuLength.push_back( totalLen ); @@ -4780,8 +4782,6 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes() quadsBySide[ (*quadIt)->side[iSide] ].push_back( *quadIt ); } - SMESH_Mesh* mesh = myHelper->GetMesh(); - SMESHDS_Mesh* meshDS = myHelper->GetMeshDS(); const TopoDS_Face& face = TopoDS::Face( myHelper->GetSubShape() ); Handle(Geom_Surface) surf = BRep_Tool::Surface( face ); @@ -4961,8 +4961,8 @@ bool StdMeshers_Quadrangle_2D::addEnforcedNodes() continue; const vector& oGrid = side.contacts[iC].other_side->grid->GetUVPtStruct(); const UVPtStruct& uvPt = points[ side.contacts[iC].point ]; - if ( side.contacts[iC].other_point >= oGrid .size() || - side.contacts[iC].point >= points.size() ) + if ( side.contacts[iC].other_point >= (int) oGrid .size() || + side.contacts[iC].point >= (int) points.size() ) throw SALOME_Exception( "StdMeshers_Quadrangle_2D::addEnforcedNodes(): wrong contact" ); if ( oGrid[ side.contacts[iC].other_point ].node ) (( UVPtStruct& ) uvPt).node = oGrid[ side.contacts[iC].other_point ].node; @@ -5118,9 +5118,9 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side, return; } - const int iFrom = Min ( iForced, *iNext ); - const int iTo = Max ( iForced, *iNext ) + 1; - const int sideSize = iTo - iFrom; + const int iFrom = Min ( iForced, *iNext ); + const int iTo = Max ( iForced, *iNext ) + 1; + const size_t sideSize = iTo - iFrom; vector points[4]; // side points of a temporary quad @@ -5130,7 +5130,7 @@ void StdMeshers_Quadrangle_2D::updateSideUV( FaceQuadStruct::Side& side, for ( int is2nd = 0; is2nd < 2; ++is2nd ) { points[ is2nd ].reserve( sideSize ); - int nbLoops = 0; + size_t nbLoops = 0; while ( points[is2nd].size() < sideSize ) { int iCur = iFrom + points[is2nd].size() - int( !points[is2nd].empty() ); @@ -5624,8 +5624,8 @@ bool FaceQuadStruct::Side::IsForced( int nodeIndex ) const void FaceQuadStruct::Side::AddContact( int ip, Side* side, int iop ) { - if ( ip >= GetUVPtStruct().size() || - iop >= side->GetUVPtStruct().size() ) + if ( ip >= (int) GetUVPtStruct().size() || + iop >= (int) side->GetUVPtStruct().size() ) throw SALOME_Exception( "FaceQuadStruct::Side::AddContact(): wrong point" ); if ( ip < from || ip >= to ) return; diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index e9aab2b29..b861f3701 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -537,8 +537,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, gp_Vec2d aVec2d(PC,p2dV); Nodes1.resize( myLayerPositions.size()+1 ); Nodes2.resize( myLayerPositions.size()+1 ); - int i = 0; - for(; iSetNodeOnEdge(NC, edgeID, cp); Nodes1.resize( myLayerPositions.size()+1 ); Nodes2.resize( myLayerPositions.size()+1 ); - int i = 0; + size_t i = 0; for(; isecond == NF ); NC = const_cast ( nodesFromP0ToP1 ? theNodes.begin()->second : theNodes.rbegin()->second ); - int i = 0, ir = Nodes1.size()-1; - int * pi = nodesFromP0ToP1 ? &i : &ir; + size_t i = 0, ir = Nodes1.size()-1; + size_t * pi = nodesFromP0ToP1 ? &i : &ir; itn = theNodes.begin(); if ( nodesFromP0ToP1 ) ++itn; for ( ; i < Nodes1.size(); ++i, --ir, ++itn ) @@ -817,8 +817,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, meshDS->SetNodeOnVertex(NC, vertID); } double dp = lp-fp; - int i = 0; - for(; iAddNode(P.X(), P.Y(), P.Z()); Nodes1[i] = node; double param; - if(!ori) + if ( !ori ) param = fp + dp*(1-myLayerPositions[i]); else param = fp + dp*myLayerPositions[i]; @@ -840,11 +840,11 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, // create 1D elements on edge SMDS_MeshEdge* ME = myHelper->AddEdge( NC, Nodes1[0] ); if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); - for(i=1; iAddEdge( Nodes1[i-1], Nodes1[i] ); if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); } - if (nbe==2 && LinEdge1.Orientation() == TopAbs_INTERNAL ) + if ( nbe == 2 && LinEdge1.Orientation() == TopAbs_INTERNAL ) Nodes2 = Nodes1; } markEdgeAsComputedByMe( LinEdge1, aMesh.GetSubMesh( F )); @@ -856,8 +856,8 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, return error("Invalid mesh on a straight edge"); bool nodesFromP0ToP2 = ( theNodes.rbegin()->second == NL ); - int i = 0, ir = Nodes1.size()-1; - int * pi = nodesFromP0ToP2 ? &i : &ir; + size_t i = 0, ir = Nodes1.size()-1; + size_t * pi = nodesFromP0ToP2 ? &i : &ir; itn = theNodes.begin(); if ( nodesFromP0ToP2 ) ++itn; for ( ; i < Nodes2.size(); ++i, --ir, ++itn ) @@ -886,7 +886,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, PC = PL; } double dp = lp-fp; - for(int i=0; iAddEdge( NC, Nodes2[0] ); - if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); - for(int i=1; iSetMeshElementOnShape(ME, edgeID); + for ( size_t i = 1; i < Nodes2.size(); i++ ) { ME = myHelper->AddEdge( Nodes2[i-1], Nodes2[i] ); if(ME) meshDS->SetMeshElementOnShape(ME, edgeID); } @@ -953,7 +953,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, // create faces tmpNodes.push_back( CNodes[i] ); // quad - for(j=0; jAddFace( tmpNodes[j], Nodes1[j], @@ -969,14 +969,14 @@ bool StdMeshers_RadialQuadrangle_1D2D::Compute(SMESH_Mesh& aMesh, MF = myHelper->AddFace( NC, Nodes1[0], tmpNodes[0] ); else MF = myHelper->AddFace( NC, tmpNodes[0], Nodes1[0] ); - if(MF) meshDS->SetMeshElementOnShape(MF, faceID); - for(j=0; jSetMeshElementOnShape(MF, faceID); + for ( j = 0; j < (int) Nodes1.size(); j++ ) { Nodes1[j] = tmpNodes[j]; } } // create last faces // quad - for(i=0; iAddFace( Nodes2[i], Nodes1[i], @@ -1106,7 +1106,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(const gp_Pnt& } else { - if ( myLayerPositions.size() != nbNodes ) + if ((int) myLayerPositions.size() != nbNodes ) return error("Radial edge is meshed by other algorithm"); } } @@ -1196,7 +1196,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, ok = !aResMap.count( aMesh.GetSubMesh(LinEdge1) ); if ( !ok ) { const vector& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ]; - ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() ); + ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() ); } if(ok) { ok = algo1d->EvaluateCircularEdge( aMesh, CircEdge, aResMap ); @@ -1243,7 +1243,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, // other curve not line return error(COMPERR_BAD_SHAPE); } - int nbLayers = myLayerPositions.size(); + size_t nbLayers = myLayerPositions.size(); computeLayerPositions( P0, P1, LinEdge2 ); if ( nbLayers != myLayerPositions.size() ) return error("Different hypotheses apply to radial edges"); @@ -1254,7 +1254,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, ok = true; // override other 1d hyps else { const vector& aVec = aResMap[ aMesh.GetSubMesh(LinEdge1) ]; - ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() ); + ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() ); } } if( ok && aResMap.count( aMesh.GetSubMesh(LinEdge2) )) { @@ -1262,7 +1262,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, ok = true; // override other 1d hyps else { const vector& aVec = aResMap[ aMesh.GetSubMesh(LinEdge2) ]; - ok = ( aVec[SMDSEntity_Node] == myLayerPositions.size() ); + ok = ( aVec[SMDSEntity_Node] == (int) myLayerPositions.size() ); } } if(ok) { diff --git a/src/StdMeshers/StdMeshers_Reversible1D.cxx b/src/StdMeshers/StdMeshers_Reversible1D.cxx index 6a088119b..d653bfb0b 100644 --- a/src/StdMeshers/StdMeshers_Reversible1D.cxx +++ b/src/StdMeshers/StdMeshers_Reversible1D.cxx @@ -66,7 +66,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save) if ( !_edgeIDs.empty() ) { - for ( size_t i = 0; i < _edgeIDs.size(); i++) + for ( size_t i = 0; i < _edgeIDs.size(); i++ ) save << " " << _edgeIDs[i]; save << " " << _objEntry << " "; } @@ -76,7 +76,7 @@ std::ostream & StdMeshers_Reversible1D::SaveTo(std::ostream & save) //============================================================================= /*! - * + * */ //============================================================================= @@ -85,14 +85,14 @@ std::istream & StdMeshers_Reversible1D::LoadFrom(std::istream & load) bool isOK; int intVal; - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); - for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++ ) { + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx index e53ca6231..3cc7562b4 100644 --- a/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx +++ b/src/StdMeshers/StdMeshers_SegmentLengthAroundVertex.cxx @@ -117,7 +117,7 @@ istream & StdMeshers_SegmentLengthAroundVertex::LoadFrom(istream & load) { bool isOK = true; double a; - isOK = (load >> a); + isOK = static_cast(load >> a); if (isOK) this->_length = a; else diff --git a/src/StdMeshers/StdMeshers_StartEndLength.cxx b/src/StdMeshers/StdMeshers_StartEndLength.cxx index dffe92e9a..2c230524e 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.cxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.cxx @@ -146,22 +146,22 @@ istream & StdMeshers_StartEndLength::LoadFrom(istream & load) { bool isOK = true; int intVal; - isOK = (load >> _begLength); + isOK = static_cast(load >> _begLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> _endLength); + isOK = static_cast(load >> _endLength); if (!isOK) load.clear(ios::badbit | load.rdstate()); - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if (isOK && intVal > 0) { _edgeIDs.reserve( intVal ); for ( size_t i = 0; i < _edgeIDs.capacity() && isOK; i++) { - isOK = (load >> intVal); + isOK = static_cast(load >> intVal); if ( isOK ) _edgeIDs.push_back( intVal ); } - isOK = (load >> _objEntry); + isOK = static_cast(load >> _objEntry); } return load; diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx index 0d567e4fb..e2471de3a 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx @@ -64,19 +64,19 @@ Plot2d_QwtLegendLabel* getLegendLabel( QwtPlotCurve* plotCurve ) QwtLegend* legend = dynamic_cast( plotCurve->plot()->legend() ); QWidget* widget = legend->legendWidget( itemInfo ); QwtLegendLabel* label = dynamic_cast( widget ); - if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label ) - return anItem; + Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label; + return anItem; } StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h ) -: QwtPlot( p ), - myPoints( 50 ), - myIsTable( false ), - myVars( 1, 1 ), - myValues( 1, 1 ), - myConv( CUT_NEGATIVE ), - myIsDone( true ), - myNbSeg( 1 ) + : QwtPlot( p ), + myPoints( 50 ), + myNbSeg( 1 ), + myIsTable( false ), + myConv( CUT_NEGATIVE ), + myVars( 1, 1 ), + myValues( 1, 1 ), + myIsDone( true ) { Kernel_Utils::Localizer loc; myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx index 2066cac77..0b5246735 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.cxx @@ -574,7 +574,7 @@ StdMeshersGUI_DistrTableFrame:: setData( const DataArray& array ) { QList d; - for ( int i = 0; i < array.length(); i++ ) + for ( CORBA::ULong i = 0; i < array.length(); i++ ) d.append( array[i] ); sortData( d ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx index 3b5ece91c..7f75b9b6c 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx @@ -360,7 +360,7 @@ SMESH::double_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfPoints() void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints) { clear(); - for ( int i = 0; i < thePoints->length(); i++ ) { + for ( CORBA::ULong i = 0; i < thePoints->length(); i++ ) { addPoint( thePoints[ i ] ); } } @@ -388,7 +388,7 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var { if ( myListWidget->count() > 0 && theSegments->length() == 1) mySameValues->setChecked(true); - for ( int i = 0; i < theSegments->length(); i++ ) { + for ( CORBA::ULong i = 0; i < theSegments->length(); i++ ) { setNbSegments( i, theSegments[i] ); } } diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx index 82d2e437d..57e21193d 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx @@ -45,7 +45,7 @@ //================================================================================ /*! * \brief Constructor initialized by filter - * \param f - object filter + * \param f - object filter */ //================================================================================ @@ -53,8 +53,8 @@ StdMeshersGUI_LayerDistributionParamWdg ::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr holderHyp, SMESH::SMESH_Hypothesis_ptr distribHyp, const QString& name, - QDialog* dlg): - QWidget(), myName(name), myDlg( dlg ) + QDialog* dlg): + QWidget(), myDlg( dlg ), myName(name) { myHolderHyp = SMESH::SMESH_Hypothesis::_duplicate( holderHyp ); init(); diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx index 6749e0b9c..9a9f2756b 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx @@ -295,13 +295,13 @@ QString StdMeshersGUI_NbSegmentsCreator::storeParams() const case Regular : valStr += tr("SMESH_DISTR_REGULAR"); break; - case Scale : - valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );\ + case Scale : + valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale ); break; case TabFunc : { //valStr += tr("SMESH_TAB_FUNC"); bool param = true; - for( int i=0; i < data.myTable.length(); i++, param = !param ) { + for( CORBA::ULong i = 0; i < data.myTable.length(); i++, param = !param ) { if ( param ) valStr += "["; valStr += QString::number( data.myTable[ i ]); diff --git a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx index 379e593d5..accf0ccb7 100644 --- a/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx +++ b/src/Tools/padder/meshjob/impl/MeshJobManager_i.cxx @@ -656,7 +656,7 @@ std::vector * MeshJobManager_i::_getResourceNames() { LOG("### resource list:"); std::vector* resourceNames = new std::vector(); if (resourceList) { - for (int i = 0; i < resourceList->length(); i++) { + for ( size_t i = 0; i < resourceList->length(); i++) { const char* aResourceName = (*resourceList)[i]; resourceNames->push_back(std::string(aResourceName)); LOG("resource["<