From 204cc2f125ee558768f785d0f9d7ec26937f8aac Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 17 Mar 2021 17:37:21 +0300 Subject: [PATCH] bos #20256: [CEA 18523] Porting SMESH to int 64 bits --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 60 ++++++++++---------- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx | 24 ++++---- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx | 2 +- src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx | 22 +++---- src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx | 28 ++++----- src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx | 20 +++---- 6 files changed, 78 insertions(+), 78 deletions(-) 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; ilength() == 0 ){MESSAGE("The source group is empty");} - for ( CORBA::ULong i=0; i < theIDs->length(); i++) { - CORBA::Long ind = theIDs[i]; + for ( CORBA::ULong i = 0; i < theIDs->length(); i++) { + SMESH::smIdType ind = theIDs[i]; if (elementType == SMESH::NODE) { const SMDS_MeshNode * node = theMeshDS->FindNode(ind); @@ -1001,15 +1001,15 @@ float GHS3DPlugin_Hypothesis::DefaultMaximumMemory() statex.dwLength = sizeof (statex); long err = GlobalMemoryStatusEx (&statex); if (err != 0) { - double totMB = (double)statex.ullAvailPhys / 1024. / 1024.; - return (float)( 0.7 * totMB ); + double totMB = double( statex.ullAvailPhys ) / 1024. / 1024.; + return float( 0.7 * totMB ); } #elif !defined(__APPLE__) struct sysinfo si; long err = sysinfo( &si ); if ( err == 0 ) { - long ramMB = si.totalram * si.mem_unit / 1024 / 1024; - return ( 0.7 * ramMB ); + double ramMB = double( si.totalram * si.mem_unit / 1024 / 1024 ); + return float( 0.7 * ramMB ); } #endif return 1024; @@ -1271,19 +1271,19 @@ std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load) isOK = static_cast(load >> d); if (isOK) - myMaximumMemory = d; + myMaximumMemory = float( d ); else load.clear(ios::badbit | load.rdstate()); isOK = static_cast(load >> d); if (isOK) - myInitialMemory = d; + myInitialMemory = float( d ); else load.clear(ios::badbit | load.rdstate()); isOK = static_cast(load >> i); if (isOK) - myOptimizationLevel = i; + myOptimizationLevel = (short int) i; else load.clear(ios::badbit | load.rdstate()); @@ -1918,7 +1918,7 @@ void GHS3DPlugin_Hypothesis::SetOptionValue(const std::string& optionName, // strip white spaces while (ptr[0] == ' ') ptr++; - int i = strlen(ptr); + size_t i = strlen(ptr); while (i != 0 && ptr[i - 1] == ' ') i--; // check value type @@ -2040,7 +2040,7 @@ bool GHS3DPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk ) if ( isOk ) *isOk = true; for ( size_t i = 0; i <= s.size(); ++i ) - s[i] = tolower( s[i] ); + s[i] = (char) tolower( s[i] ); if ( s == "1" || s == "true" || s == "active" || s == "yes" ) return true; diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index c023b51..53d26b1 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx @@ -284,7 +284,7 @@ public: * To set enforced elements */ bool SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName = ""); - bool SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::long_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName = ""); + bool SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::smIdType_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName = ""); bool SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, std::string groupName = ""); const TGHS3DEnforcedMeshList _GetEnforcedMeshes() const { return _enfMeshList; } const TEntryGHS3DEnforcedMeshListMap _GetEnforcedMeshesByEntry() const { return _entryEnfMeshMap; } diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 53defdd..b7c78bf 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -161,7 +161,7 @@ void GHS3DPlugin_Hypothesis_i::SetNbVolumeProximityLayers( CORBA::Short nbLayers CORBA::Short GHS3DPlugin_Hypothesis_i::GetNbVolumeProximityLayers() { - return this->GetImpl()->GetNbVolumeProximityLayers(); + return (CORBA::Short) this->GetImpl()->GetNbVolumeProximityLayers(); } //======================================================================= @@ -473,13 +473,13 @@ void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char // basic options (visible in Advanced table) else if ( name == "verbose" ) - SetVerboseLevel( GetImpl()->ToInt( optionValue )); + SetVerboseLevel((CORBA::Short) GetImpl()->ToInt( optionValue )); else if ( name == "max_memory" ) - SetMaximumMemory( GetImpl()->ToInt( optionValue )); + SetMaximumMemory((CORBA::Short) GetImpl()->ToInt( optionValue )); else if ( name == "automatic_memory" ) - SetInitialMemory( GetImpl()->ToInt( optionValue )); + SetInitialMemory((CORBA::Short) GetImpl()->ToInt( optionValue )); else if ( name == "no_initial_central_point" && // optimizer strcmp( GetImpl()->GetName(), ::GHS3DPlugin_Hypothesis::GetHypType() ) != 0 ) @@ -509,7 +509,7 @@ void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char SetGradation( GetImpl()->ToDbl( optionValue )); else if ( name == "volume_proximity_layers" ) - SetNbVolumeProximityLayers( GetImpl()->ToInt( optionValue )); + SetNbVolumeProximityLayers((CORBA::Short) GetImpl()->ToInt( optionValue )); else if ( name == "components" ) SetToMeshHoles( strncmp( "all", optionValue, 3 ) == 0 ); @@ -573,7 +573,7 @@ GHS3DPlugin::string_array* GHS3DPlugin_Hypothesis_i::GetOptionValues() GHS3DPlugin::string_array_var result = new GHS3DPlugin::string_array(); const ::GHS3DPlugin_Hypothesis::TOptionValues & opts = this->GetImpl()->GetOptionValues(); - result->length(opts.size()); + result->length((CORBA::ULong) opts.size()); int i=0; bool isDefault; @@ -600,7 +600,7 @@ GHS3DPlugin::string_array* GHS3DPlugin_Hypothesis_i::GetAdvancedOptionValues() GHS3DPlugin::string_array_var result = new GHS3DPlugin::string_array(); const ::GHS3DPlugin_Hypothesis::TOptionValues & custom_opts = this->GetImpl()->GetCustomOptionValues(); - result->length(custom_opts.size()); + result->length((CORBA::ULong) custom_opts.size()); int i=0; ::GHS3DPlugin_Hypothesis::TOptionValues::const_iterator opIt = custom_opts.begin(); @@ -1042,7 +1042,7 @@ GHS3DPlugin::GHS3DEnforcedVertexList* GHS3DPlugin_Hypothesis_i::GetEnforcedVerti GHS3DPlugin::GHS3DEnforcedVertexList_var result = new GHS3DPlugin::GHS3DEnforcedVertexList(); const ::GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList enfVertexList = this->GetImpl()->_GetEnforcedVertices(); - result->length( enfVertexList.size() ); + result->length((CORBA::ULong) enfVertexList.size() ); ::GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList::const_iterator it = enfVertexList.begin(); @@ -1055,8 +1055,8 @@ GHS3DPlugin::GHS3DEnforcedVertexList* GHS3DPlugin_Hypothesis_i::GetEnforcedVerti enfVertex->geomEntry = CORBA::string_dup(currentVertex->geomEntry.c_str()); // Coords GHS3DPlugin::TCoords_var coords = new GHS3DPlugin::TCoords(); - coords->length(currentVertex->coords.size()); - for ( size_t ind = 0; ind < currentVertex->coords.size(); ind++) + coords->length((CORBA::ULong) currentVertex->coords.size()); + for ( CORBA::ULong ind = 0; ind < currentVertex->coords.size(); ind++) coords[ind] = currentVertex->coords[ind]; enfVertex->coords = coords; // Group Name @@ -1163,7 +1163,7 @@ GHS3DPlugin::GHS3DEnforcedMeshList* GHS3DPlugin_Hypothesis_i::GetEnforcedMeshes( GHS3DPlugin::GHS3DEnforcedMeshList_var result = new GHS3DPlugin::GHS3DEnforcedMeshList(); const ::GHS3DPlugin_Hypothesis::TGHS3DEnforcedMeshList enfMeshList = this->GetImpl()->_GetEnforcedMeshes(); - result->length( enfMeshList.size() ); + result->length((CORBA::ULong) enfMeshList.size() ); ::GHS3DPlugin_Hypothesis::TGHS3DEnforcedMeshList::const_iterator it = enfMeshList.begin(); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx index 7b2a923..d44325a 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx @@ -166,9 +166,9 @@ namespace if ( meshDS->NbNodes() != meshDS->MaxNodeID() ) meshDS->CompactMesh(); - theMGInput->GmfSetKwd( mfile, GmfVertices, meshDS->NbNodes() ); + theMGInput->GmfSetKwd( mfile, GmfVertices, (int) meshDS->NbNodes() ); int TypTab[] = { GmfSca }; - theMGInput->GmfSetKwd( sfile, GmfSolAtVertices, meshDS->NbNodes(), 1, TypTab); + theMGInput->GmfSetKwd( sfile, GmfSolAtVertices, (int) meshDS->NbNodes(), 1, TypTab); SMDS_NodeIteratorPtr nodeIt = theHelper->GetMeshDS()->nodesIterator(); while ( nodeIt->more() ) @@ -182,30 +182,30 @@ namespace // write all triangles - theMGInput->GmfSetKwd( mfile, GmfTriangles, meshDS->GetMeshInfo().NbTriangles() ); + theMGInput->GmfSetKwd( mfile, GmfTriangles, (int) meshDS->GetMeshInfo().NbTriangles() ); SMDS_ElemIteratorPtr triaIt = meshDS->elementGeomIterator( SMDSGeom_TRIANGLE ); while ( triaIt->more() ) { const SMDS_MeshElement* tria = triaIt->next(); theMGInput->GmfSetLin( mfile, GmfTriangles, - tria->GetNode(0)->GetID(), - tria->GetNode(1)->GetID(), - tria->GetNode(2)->GetID(), + static_cast(tria->GetNode(0)->GetID()), + static_cast(tria->GetNode(1)->GetID()), + static_cast(tria->GetNode(2)->GetID()), tag ); } // write all tetra - theMGInput->GmfSetKwd( mfile, GmfTetrahedra, meshDS->GetMeshInfo().NbTetras() ); + theMGInput->GmfSetKwd( mfile, GmfTetrahedra, (int) meshDS->GetMeshInfo().NbTetras() ); SMDS_ElemIteratorPtr tetIt = meshDS->elementGeomIterator( SMDSGeom_TETRA ); while ( tetIt->more() ) { const SMDS_MeshElement* tet = tetIt->next(); theMGInput->GmfSetLin( mfile, GmfTetrahedra, - tet->GetNode(0)->GetID(), - tet->GetNode(2)->GetID(), - tet->GetNode(1)->GetID(), - tet->GetNode(3)->GetID(), + static_cast(tet->GetNode(0)->GetID()), + static_cast(tet->GetNode(2)->GetID()), + static_cast(tet->GetNode(1)->GetID()), + static_cast(tet->GetNode(3)->GetID()), tag ); } @@ -234,8 +234,8 @@ namespace int nbNodes = theMGOutput->GmfStatKwd( inFile, GmfVertices ); int nbTet = theMGOutput->GmfStatKwd( inFile, GmfTetrahedra ); - int nbNodesOld = meshDS->NbNodes(); - int nbTetOld = meshDS->GetMeshInfo().NbTetras(); + smIdType nbNodesOld = meshDS->NbNodes(); + smIdType nbTetOld = meshDS->GetMeshInfo().NbTetras(); std::cout << "Optimization input: " << nbNodesOld << " nodes, \t" << nbTetOld << " tetra" << std::endl; std::cout << "Optimization output: " @@ -359,7 +359,7 @@ namespace void getNodeByGhsId( SMESH_Mesh& mesh, std::vector & nodeByGhsId ) { SMESHDS_Mesh* meshDS = mesh.GetMeshDS(); - const int nbNodes = meshDS->NbNodes(); + const smIdType nbNodes = meshDS->NbNodes(); nodeByGhsId.resize( nbNodes + 1 ); SMDS_NodeIteratorPtr nodeIt = meshDS->nodesIterator(); while ( nodeIt->more() ) diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index dd3bc11..4023eec 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -833,7 +833,7 @@ void GHS3DPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetIt void GHS3DPluginGUI_HypothesisCreator::onSelectEnforcedVertex() { - int nbSelEnfVertex = myEnfVertexWdg->NbObjects(); + size_t nbSelEnfVertex = myEnfVertexWdg->NbObjects(); clearEnforcedVertexWidgets(); if (nbSelEnfVertex == 1) { @@ -1195,7 +1195,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedMesh() myEnforcedMeshTableWidget->resizeColumnToContents(column); // Vertex selection - int selEnfMeshes = myEnfMeshWdg->NbObjects(); + size_t selEnfMeshes = myEnfMeshWdg->NbObjects(); if (selEnfMeshes == 0) return; @@ -1250,7 +1250,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex() myEnforcedTableWidget->resizeColumnToContents(column); // Vertex selection - int selEnfVertex = myEnfVertexWdg->NbObjects(); + size_t selEnfVertex = myEnfVertexWdg->NbObjects(); bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty()); if ((selEnfVertex == 0) && coordsEmpty) return; @@ -1292,7 +1292,7 @@ void GHS3DPluginGUI_HypothesisCreator::onAddEnforcedVertex() return; CORBA::Double x = 0, y = 0,z = 0; - for (int j = 0 ; j < selEnfVertex ; j++) + for ( size_t j = 0 ; j < selEnfVertex ; j++) { myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(j); if (myEnfVertex == GEOM::GEOM_Object::_nil()) @@ -1791,13 +1791,13 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD if( isCreation() ) SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().constData() ); - h->SetOptimizationLevel ( h_data.myOptimizationLevel ); + h->SetOptimizationLevel ((CORBA::Short) h_data.myOptimizationLevel ); h->SetMinSize ( h_data.myUseMinSize ? h_data.myMinSize : 0 ); h->SetMaxSize ( h_data.myUseMaxSize ? h_data.myMaxSize : 0 ); h->SetMinMaxSizeDefault ( this->myMinSizeDefault, this->myMaxSizeDefault ); h->SetGradation ( h_data.myGradation ); h->SetVolumeProximity ( h_data.myUseProximity ); - h->SetNbVolumeProximityLayers ( h_data.myNbProximityLayers ); + h->SetNbVolumeProximityLayers ((CORBA::Short) h_data.myNbProximityLayers ); h->SetToMeshHoles ( h_data.myToMeshHoles ); h->SetToMakeGroupsOfDomains ( h_data.myToMakeGroupsOfDomains ); @@ -1820,7 +1820,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD opt->SetSplitOverConstrained ( (GHS3DPlugin::Mode) h_data.mySplitOverConstrained ); opt->SetPThreadsMode ( (GHS3DPlugin::PThreadsMode) h_data.myPThreadsMode ); opt->SetSmoothOffSlivers ( h_data.mySmoothOffSlivers ); - opt->SetMaximalNumberOfThreads( h_data.myNumberOfThreads ); + opt->SetMaximalNumberOfThreads((CORBA::Short) h_data.myNumberOfThreads ); } // Enforced vertices @@ -1916,11 +1916,11 @@ bool GHS3DPluginGUI_HypothesisCreator::readParamsFromWidgets( GHS3DHypothesisDat h_data.myToMeshHoles = myToMeshHolesCheck->isChecked(); h_data.myToMakeGroupsOfDomains = myToMakeGroupsOfDomains->isChecked(); } - h_data.myMaximumMemory = myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1; - h_data.myInitialMemory = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1; + h_data.myMaximumMemory = float( myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1 ); + h_data.myInitialMemory = float( myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1 ); h_data.myKeepFiles = myAdvWidget->keepWorkingFilesCheck->isChecked(); h_data.myWorkingDir = myAdvWidget->workingDirectoryLineEdit->text().trimmed(); - h_data.myVerboseLevel = myAdvWidget->verboseLevelSpin->value(); + h_data.myVerboseLevel = short( myAdvWidget->verboseLevelSpin->value() ); h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked(); h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked(); -- 2.30.2