X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGHS3DPlugin%2FGHS3DPlugin_GHS3D.cxx;h=95f9af32e7875543291e5f3bad7b98744c7bd2e4;hb=204cc2f125ee558768f785d0f9d7ec26937f8aac;hp=7c33c019dfd129ded939201249e5a1012543ea16;hpb=1d76a51da109a1bf75d743da9d4a8537a8e4b873;p=plugins%2Fghs3dplugin.git diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 7c33c01..95f9af3 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -596,7 +596,7 @@ static bool readGMFFile(MG_Tetra_API* MGOutput, SMESHDS_Mesh* theMeshDS = theHelper->GetMeshDS(); const bool hasGeom = ( theHelper->GetMesh()->HasShapeToMesh() ); - int nbInitialNodes = theNodeByGhs3dId.size(); + int nbInitialNodes = (int) theNodeByGhs3dId.size(); #ifdef _MY_DEBUG_ const bool isQuadMesh = @@ -1052,11 +1052,11 @@ static bool writeGMFFile(MG_Tetra_API* MGInput SMESHUtils::Deleter< SMESH_ElementSearcher > pntCls ( SMESH_MeshAlgos::GetElementSearcher(*theMesh->GetMeshDS())); - int nbEnforcedVertices = theEnforcedVertices.size(); + int nbEnforcedVertices = (int) theEnforcedVertices.size(); theInvalidEnforcedFlags = 0; // count faces - int nbFaces = theProxyMesh.NbFaces(); + smIdType nbFaces = theProxyMesh.NbFaces(); int nbNodes; theFaceByGhs3dId.reserve( nbFaces ); @@ -1085,7 +1085,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput { // find MG-Tetra ID const SMDS_MeshNode* node = castToNode( nodeIt->next() ); - int newId = aNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1 + int newId = (int) aNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1 aNodeToGhs3dIdMap.insert( make_pair( node, newId )); } } @@ -1134,7 +1134,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput #endif if (nbFoundElems ==0) { if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) { - newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1 + newId = int( aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1 ); // MG-Tetra ids count from 1 anEnforcedNodeToGhs3dIdMap.insert( make_pair( node, newId )); } } @@ -1191,7 +1191,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput #endif if (nbFoundElems ==0) { if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) { - newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1 + newId = int( aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1 ); // MG-Tetra ids count from 1 anEnforcedNodeToGhs3dIdMap.insert( make_pair( node, newId )); } } @@ -1387,7 +1387,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput // theOrderedNodes.push_back(node); theRequiredNodes.push_back(node); } - int requiredNodes = theRequiredNodes.size(); + int requiredNodes = (int) theRequiredNodes.size(); int solSize = 0; std::vector > ReqVerTab; @@ -1423,7 +1423,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput // GmfVertices std::cout << "Begin writting required nodes in GmfVertices" << std::endl; std::cout << "Nb vertices: " << theOrderedNodes.size() << std::endl; - MGInput->GmfSetKwd( idx, GmfVertices, theOrderedNodes.size()/*+solSize*/); + MGInput->GmfSetKwd( idx, GmfVertices, int( theOrderedNodes.size()/*+solSize*/)); for (ghs3dNodeIt = theOrderedNodes.begin();ghs3dNodeIt != theOrderedNodes.end();++ghs3dNodeIt) { MGInput->GmfSetLin( idx, GmfVertices, (*ghs3dNodeIt)->X(), (*ghs3dNodeIt)->Y(), (*ghs3dNodeIt)->Z(), dummyint); } @@ -1482,7 +1482,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput // idxRequired = MGInput->GmfOpenMesh( theRequiredFileName, GmfWrite, GMFVERSION, GMFDIMENSION); // if (!idxRequired) // return false; - MGInput->GmfSetKwd( idx, GmfEdges, theKeptEnforcedEdges.size()); + MGInput->GmfSetKwd( idx, GmfEdges, (int) theKeptEnforcedEdges.size()); // MGInput->GmfSetKwd( idxRequired, GmfEdges, theKeptEnforcedEdges.size()); for(elemSetIt = theKeptEnforcedEdges.begin() ; elemSetIt != theKeptEnforcedEdges.end() ; ++elemSetIt) { elem = (*elemSetIt); @@ -1519,7 +1519,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput int usedEnforcedTriangles = 0; if (anElemSet.size()+theKeptEnforcedTriangles.size()) { aFaceGroupByGhs3dId.resize( anElemSet.size()+theKeptEnforcedTriangles.size() ); - MGInput->GmfSetKwd( idx, GmfTriangles, anElemSet.size()+theKeptEnforcedTriangles.size()); + MGInput->GmfSetKwd( idx, GmfTriangles, int( anElemSet.size()+theKeptEnforcedTriangles.size() )); int k=0; for(elemSetIt = anElemSet.begin() ; elemSetIt != anElemSet.end() ; ++elemSetIt,++k) { elem = (*elemSetIt); @@ -1568,7 +1568,7 @@ static bool writeGMFFile(MG_Tetra_API* MGInput if (usedEnforcedTriangles) { MGInput->GmfSetKwd( idx, GmfRequiredTriangles, usedEnforcedTriangles); for (int enfID=1;enfID<=usedEnforcedTriangles;enfID++) - MGInput->GmfSetLin( idx, GmfRequiredTriangles, anElemSet.size()+enfID); + MGInput->GmfSetLin( idx, GmfRequiredTriangles, int( anElemSet.size()+enfID )); } MGInput->GmfCloseMesh(idx); @@ -1645,8 +1645,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, } } } - int nbEnforcedVertices = coordsSizeMap.size(); - int nbEnforcedNodes = enforcedNodes.size(); + size_t nbEnforcedVertices = coordsSizeMap.size(); + size_t nbEnforcedNodes = enforcedNodes.size(); std::string tmpStr; (nbEnforcedNodes <= 1) ? tmpStr = "node" : "nodes"; @@ -1937,8 +1937,8 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh, std::string tmpStr; - int nbEnforcedVertices = coordsSizeMap.size(); - int nbEnforcedNodes = enforcedNodes.size(); + size_t nbEnforcedVertices = coordsSizeMap.size(); + size_t nbEnforcedNodes = enforcedNodes.size(); (nbEnforcedNodes <= 1) ? tmpStr = "node" : tmpStr = "nodes"; std::cout << nbEnforcedNodes << " enforced " << tmpStr << " from hypo" << std::endl; (nbEnforcedVertices <= 1) ? tmpStr = "vertex" : tmpStr = "vertices"; @@ -2403,7 +2403,7 @@ static char* getIds( char* ptr, int nbIds, vector& ids ) { while ( !isdigit( *ptr )) ++ptr; if ( ptr[-1] == '-' ) --ptr; - ids.push_back( strtol( ptr, &ptr, 10 )); + ids.push_back((int) strtol( ptr, &ptr, 10 )); --nbIds; } return ptr; @@ -2467,7 +2467,7 @@ GHS3DPlugin_GHS3D::getErrorDescription(const char* logFile, ptr += 4; char* errBeg = ptr; - int errNum = strtol(ptr, &ptr, 10) + versionAddition; + int errNum = int( strtol(ptr, &ptr, 10) + versionAddition ); // we treat errors enumerated in [SALOME platform 0019316] issue // and all errors from a new (Release 1.1) MeshGems User Manual switch ( errNum ) { @@ -2765,7 +2765,7 @@ bool GHS3DPlugin_GHS3D::Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, MapShapeNbElems& aResMap) { - int nbtri = 0, nbqua = 0; + smIdType nbtri = 0, nbqua = 0; double fullArea = 0.0; for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) { TopoDS_Face F = TopoDS::Face( exp.Current() ); @@ -2777,9 +2777,9 @@ bool GHS3DPlugin_GHS3D::Evaluate(SMESH_Mesh& aMesh, "Submesh can not be evaluated",this)); return false; } - std::vector aVec = (*anIt).second; - nbtri += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - nbqua += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nbtri += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + nbqua += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); GProp_GProps G; BRepGProp::SurfaceProperties(F,G); double anArea = G.Mass(); @@ -2787,7 +2787,7 @@ bool GHS3DPlugin_GHS3D::Evaluate(SMESH_Mesh& aMesh, } // collect info from edges - int nb0d_e = 0, nb1d_e = 0; + smIdType nb0d_e = 0, nb1d_e = 0; bool IsQuadratic = false; bool IsFirst = true; TopTools_MapOfShape tmpMap; @@ -2798,9 +2798,9 @@ bool GHS3DPlugin_GHS3D::Evaluate(SMESH_Mesh& aMesh, tmpMap.Add(E); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_e += aVec[SMDSEntity_Node]; - nb1d_e += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + nb1d_e += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); if(IsFirst) { IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); IsFirst = false; @@ -2808,18 +2808,18 @@ bool GHS3DPlugin_GHS3D::Evaluate(SMESH_Mesh& aMesh, } tmpMap.Clear(); - double ELen = sqrt(2.* ( fullArea/(nbtri+nbqua*2) ) / sqrt(3.0) ); + double ELen = sqrt(2.* ( fullArea/double(nbtri+nbqua*2) ) / sqrt(3.0) ); GProp_GProps G; BRepGProp::VolumeProperties(aShape,G); double aVolume = G.Mass(); double tetrVol = 0.1179*ELen*ELen*ELen; double CoeffQuality = 0.9; - int nbVols = int(aVolume/tetrVol/CoeffQuality); - int nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2; - int nb1d_in = (int) ( nbVols*6 - nb1d_e - nb1d_f ) / 5; - std::vector aVec(SMDSEntity_Last); - for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last); + for(smIdType i=SMDSEntity_Node; i