From: eap Date: Fri, 19 Mar 2021 11:29:37 +0000 (+0300) Subject: bos #20256: avoid clash with FromIdType() from MEDCOUPLING X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Focc%2F20256;p=modules%2Fsmesh.git bos #20256: avoid clash with FromIdType() from MEDCOUPLING --- diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index 4864fb040..c3612f142 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -4178,7 +4178,7 @@ void ElementsOnSurface::process() if ( !myMeshModifTracer.GetMesh() ) return; - int nbElems = FromIdType( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType )); + int nbElems = FromSmIdType( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType )); if ( nbElems > 0 ) myIds.ReSize( nbElems ); diff --git a/src/DriverCGNS/DriverCGNS_Read.cxx b/src/DriverCGNS/DriverCGNS_Read.cxx index cfb37c3e4..85ddf9228 100644 --- a/src/DriverCGNS/DriverCGNS_Read.cxx +++ b/src/DriverCGNS/DriverCGNS_Read.cxx @@ -551,7 +551,7 @@ namespace vector idVec( ids[0] ); for ( int i = 0; i < ids[0]; ++i ) idVec[ i ] = (smIdType) ids[ i + 1]; - return mesh->AddPolygonalFaceWithID( idVec, ToIdType(ID) ); + return mesh->AddPolygonalFaceWithID( idVec, ID ); } typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID); diff --git a/src/DriverCGNS/DriverCGNS_Write.cxx b/src/DriverCGNS/DriverCGNS_Write.cxx index 0643273cb..424ea0276 100644 --- a/src/DriverCGNS/DriverCGNS_Write.cxx +++ b/src/DriverCGNS/DriverCGNS_Write.cxx @@ -285,8 +285,8 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() else if ( meshDim == 2 ) nbCells = myMesh->NbFaces(); - cgsize_t size[9] = { FromIdType( myMesh->NbNodes() ), - FromIdType( nbCells ), + cgsize_t size[9] = { FromSmIdType( myMesh->NbNodes() ), + FromSmIdType( nbCells ), /*NBoundVertex=*/0, 0,0,0,0,0,0 }; int iZone; if ( cg_zone_write( _fn, iBase, "SMESH_Mesh", size, diff --git a/src/DriverGMF/DriverGMF_Read.cxx b/src/DriverGMF/DriverGMF_Read.cxx index b70f6a33c..17e721c6d 100644 --- a/src/DriverGMF/DriverGMF_Read.cxx +++ b/src/DriverGMF/DriverGMF_Read.cxx @@ -429,7 +429,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() }; for ( int i = 0; i < 4; ++i ) { - int gmfKwd = FromIdType( kes[i][0] ); + int gmfKwd = FromSmIdType( kes[i][0] ); SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1]; smIdType shift = kes[i][2]; if ( int nb = GmfStatKwd(meshID, gmfKwd)) @@ -472,7 +472,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() }; for ( int i = 0; i < 7; ++i ) { - int gmfKwd = FromIdType( kes[i][0] ); + int gmfKwd = FromSmIdType( kes[i][0] ); SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1]; smIdType shift = kes[i][2]; if ( int nb = GmfStatKwd(meshID, gmfKwd)) diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index fac44fc86..b46e696b1 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -270,7 +270,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end()); // allocate array of diameters - vtkIdType maxID = FromIdType(myMesh->MaxElementID() + aNbBalls); + vtkIdType maxID = FromSmIdType(myMesh->MaxElementID() + aNbBalls); if ( anIsElemNum && !aBallInfo->myElemNum->empty() ) maxID = *std::max_element( aBallInfo->myElemNum->begin(), aBallInfo->myElemNum->end() ); @@ -356,7 +356,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif if ( anIsElemNum ) { TInt anElemId = aPolygoneInfo->GetElemNum( iElem ); - anElement = (myMesh->*addPolyWithID)( aNodeIds, ToIdType(anElemId) ); + anElement = (myMesh->*addPolyWithID)( aNodeIds, ToSmIdType(anElemId) ); } if ( !anElement ) { aNodes.resize( aNbConn ); @@ -437,7 +437,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif if(anIsElemNum){ TInt anElemId = aPolyedreInfo->GetElemNum(iElem); - anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToIdType(anElemId)); + anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToSmIdType(anElemId)); } if(!anElement){ vector aNodes(aNbNodes); diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index bd5e48f47..f2e3fefb7 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -548,7 +548,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() const EBooleen theIsElemNames = eFAUX; const EConnectivite theConnMode = eNOD; - TInt aNbNodes = FromIdType( myMesh->NbNodes() ); + TInt aNbNodes = FromSmIdType( myMesh->NbNodes() ); PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes, theMode, theSystem, theIsElemNum, theIsElemNames); @@ -568,7 +568,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() aTCoordSlice[2] = 0.; // node number - TInt aNodeID = FromIdType( aCoordHelperPtr->GetID() ); + TInt aNodeID = FromSmIdType( aCoordHelperPtr->GetID() ); aNodeInfo->SetElemNum( iNode, aNodeID ); #ifdef _EDF_NODE_IDS_ aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 )); @@ -634,66 +634,66 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eBALL, - FromIdType(nbElemInfo.NbBalls()), + FromSmIdType(nbElemInfo.NbBalls()), SMDSAbs_Ball)); #ifdef _ELEMENTS_BY_DIM_ anEntity = eARETE; #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eSEG2, - FromIdType(nbElemInfo.NbEdges( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbEdges( ORDER_LINEAR )), SMDSAbs_Edge)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eSEG3, - FromIdType(nbElemInfo.NbEdges( ORDER_QUADRATIC )), + FromSmIdType(nbElemInfo.NbEdges( ORDER_QUADRATIC )), SMDSAbs_Edge)); #ifdef _ELEMENTS_BY_DIM_ anEntity = eFACE; #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA3, - FromIdType(nbElemInfo.NbTriangles( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbTriangles( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA6, - FromIdType(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - + FromSmIdType(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - nbElemInfo.NbBiQuadTriangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA7, - FromIdType(nbElemInfo.NbBiQuadTriangles()), + FromSmIdType(nbElemInfo.NbBiQuadTriangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD4, - FromIdType(nbElemInfo.NbQuadrangles( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbQuadrangles( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD8, - FromIdType(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - + FromSmIdType(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - nbElemInfo.NbBiQuadQuadrangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD9, - FromIdType(nbElemInfo.NbBiQuadQuadrangles()), + FromSmIdType(nbElemInfo.NbBiQuadQuadrangles()), SMDSAbs_Face)); if ( polyTypesSupported ) { aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGONE, - FromIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), SMDSAbs_Face)); // we need one more loop on poly elements to count nb of their nodes aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGONE, - FromIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGON2, - FromIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), + FromSmIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), SMDSAbs_Face)); // we need one more loop on QUAD poly elements to count nb of their nodes aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGON2, - FromIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), + FromSmIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), SMDSAbs_Face)); } #ifdef _ELEMENTS_BY_DIM_ @@ -701,58 +701,58 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTETRA4, - FromIdType(nbElemInfo.NbTetras( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbTetras( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTETRA10, - FromIdType(nbElemInfo.NbTetras( ORDER_QUADRATIC )), + FromSmIdType(nbElemInfo.NbTetras( ORDER_QUADRATIC )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePYRA5, - FromIdType(nbElemInfo.NbPyramids( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbPyramids( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePYRA13, - FromIdType(nbElemInfo.NbPyramids( ORDER_QUADRATIC )), + FromSmIdType(nbElemInfo.NbPyramids( ORDER_QUADRATIC )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA6, - FromIdType(nbElemInfo.NbPrisms( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbPrisms( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA15, - FromIdType(nbElemInfo.NbQuadPrisms()), + FromSmIdType(nbElemInfo.NbQuadPrisms()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA18, - FromIdType(nbElemInfo.NbBiQuadPrisms()), + FromSmIdType(nbElemInfo.NbBiQuadPrisms()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA8, - FromIdType(nbElemInfo.NbHexas( ORDER_LINEAR )), + FromSmIdType(nbElemInfo.NbHexas( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA20, - FromIdType(nbElemInfo.NbHexas( ORDER_QUADRATIC )- + FromSmIdType(nbElemInfo.NbHexas( ORDER_QUADRATIC )- nbElemInfo.NbTriQuadHexas()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA27, - FromIdType(nbElemInfo.NbTriQuadHexas()), + FromSmIdType(nbElemInfo.NbTriQuadHexas()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eOCTA12, - FromIdType(nbElemInfo.NbHexPrisms()), + FromSmIdType(nbElemInfo.NbHexPrisms()), SMDSAbs_Volume)); if ( polyTypesSupported ) { aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYEDRE, - FromIdType(nbElemInfo.NbPolyhedrons()), + FromSmIdType(nbElemInfo.NbPolyhedrons()), SMDSAbs_Volume)); // we need one more loop on poly elements to count nb of their nodes aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYEDRE, - FromIdType(nbElemInfo.NbPolyhedrons()), + FromSmIdType(nbElemInfo.NbPolyhedrons()), SMDSAbs_Volume)); } @@ -831,13 +831,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() for(TInt iNode = 0; iNode < aNbNodes; iNode++) { const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); #ifdef _EDF_NODE_IDS_ - aTConnSlice[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; + aTConnSlice[ iNode ] = aNodeIdMap[FromSmIdType(aNode->GetID())]; #else aTConnSlice[ iNode ] = aNode->GetID(); #endif } // element number - aPolygoneInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aPolygoneInfo->SetElemNum( iElem, FromSmIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); @@ -905,14 +905,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() while ( nodeIt->more() ) { const SMDS_MeshElement* aNode = nodeIt->next(); #ifdef _EDF_NODE_IDS_ - conn[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; + conn[ iNode ] = aNodeIdMap[FromSmIdType(aNode->GetID())]; #else conn[ iNode ] = aNode->GetID(); #endif ++iNode; } // element number - aPolyhInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aPolyhInfo->SetElemNum( iElem, FromSmIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); @@ -939,12 +939,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() // connectivity const SMDS_MeshElement* aNode = anElem->GetNode( 0 ); #ifdef _EDF_NODE_IDS_ - (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType(aNode->GetID())]; + (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromSmIdType(aNode->GetID())]; #else (*aBallInfo->myConn)[ iElem ] = aNode->GetID(); #endif // element number - aBallInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aBallInfo->SetElemNum( iElem, FromSmIdType(anElem->GetID()) ); // diameter aBallInfo->myDiameters[ iElem ] = @@ -987,13 +987,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() for (TInt iNode = 0; iNode < aNbNodes; iNode++) { const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); #ifdef _EDF_NODE_IDS_ - aTConnSlice[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; + aTConnSlice[ iNode ] = aNodeIdMap[FromSmIdType(aNode->GetID())]; #else aTConnSlice[ iNode ] = aNode->GetID(); #endif } // element number - aCellInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); + aCellInfo->SetElemNum( iElem, FromSmIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index da3381285..7cd4ecd37 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -117,7 +117,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { const SMDS_MeshNode* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( FromIdType(aNode->GetID()) ); + aRec.node_labels.push_back( FromSmIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -141,7 +141,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() for ( aRec.node_labels.clear(); aNodesIter->more(); ) { const SMDS_MeshNode* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( FromIdType(aNode->GetID()) ); + aRec.node_labels.push_back( FromSmIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -199,7 +199,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { const SMDS_MeshElement* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( FromIdType(aNode->GetID()) ); + aRec.node_labels.push_back( FromSmIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -230,7 +230,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( aIter->more() ) { const SMDS_MeshElement* aNode = aIter->next(); if ( nodeLabelByID.empty() ) - aRec.NodeList.push_back( FromIdType(aNode->GetID()) ); + aRec.NodeList.push_back( FromSmIdType(aNode->GetID()) ); else aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -240,7 +240,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( aIter->more() ) { const SMDS_MeshElement* aElem = aIter->next(); if ( elemLabelByID.empty() ) - aRec.ElementList.push_back( FromIdType(aElem->GetID()) ); + aRec.ElementList.push_back( FromSmIdType(aElem->GetID()) ); else aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]); } diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 7733dd88d..14cb5394b 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -604,7 +604,7 @@ SMESH_DeviceActor ( aPredicate = dynamic_cast(theFunctor.get()))) { myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); - vtkIdType aNbNodes = FromIdType(myVisualObj->GetNbEntities(SMDSAbs_Node)); + vtkIdType aNbNodes = FromSmIdType(myVisualObj->GetNbEntities(SMDSAbs_Node)); for( vtkIdType i = 0; i < aNbNodes; i++ ){ vtkIdType anObjId = myVisualObj->GetNodeObjId(i); if(aPredicate->IsSatisfy(anObjId)) diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index e7696cd00..002bf2a43 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -114,7 +114,7 @@ vtkIdType SMESH_VisualObjDef::GetNodeObjId( vtkIdType theVTKID ) if( this->GetMesh() ) aNode = this->GetMesh()->FindNodeVtk( theVTKID ); - return aNode ? FromIdType(aNode->GetID()) : -1; + return aNode ? FromSmIdType(aNode->GetID()) : -1; } vtkIdType SMESH_VisualObjDef::GetNodeVTKId( vtkIdType theObjID ) @@ -139,7 +139,7 @@ vtkIdType SMESH_VisualObjDef::GetElemObjId( vtkIdType theVTKID ) TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID); return i == myVTK2SMDSElems.end() ? -1 : i->second; } - return FromIdType(this->GetMesh()->FromVtkToSmds(theVTKID)); + return FromSmIdType(this->GetMesh()->FromVtkToSmds(theVTKID)); } vtkIdType SMESH_VisualObjDef::GetElemVTKId( vtkIdType theObjID ) @@ -171,7 +171,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints ) return; TEntityList aNodes; - vtkIdType nbNodes = FromIdType(GetEntities( SMDSAbs_Node, aNodes )); + vtkIdType nbNodes = FromSmIdType(GetEntities( SMDSAbs_Node, aNodes )); thePoints->SetNumberOfPoints( nbNodes ); int nbPoints = 0; @@ -424,7 +424,7 @@ void SMESH_VisualObjDef::buildElemPrs() anIdList->InsertNextId(ph->NbFaceNodes(i)); for(int j = 1; j <= ph->NbFaceNodes(i); j++) { if ( const SMDS_MeshNode* n = ph->GetFaceNode( i, j )) - anIdList->InsertNextId( mySMDS2VTKNodes[ FromIdType(n->GetID()) ]); + anIdList->InsertNextId( mySMDS2VTKNodes[ FromSmIdType(n->GetID()) ]); } } } @@ -441,7 +441,7 @@ void SMESH_VisualObjDef::buildElemPrs() else { for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){ const SMDS_MeshElement* aNode = aNodesIter->next(); - anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromIdType(aNode->GetID())] ); + anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromSmIdType(aNode->GetID())]); } } } diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index 1501b1eb5..dc8fa6bf9 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -178,11 +178,11 @@ SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType id ) smIdType id0 = myChunks.size() * theChunkSize + 1; myChunks.push_back( new SMDS_ElementChunk( this, id0 )); } - SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType(index) ); + SMDS_MeshElement* e = myChunks[iChunk].Element( FromSmIdType(index) ); if ( !e->IsNull() ) return 0; // element with given ID already exists - myChunks[iChunk].UseElement( FromIdType(index) ); + myChunks[iChunk].UseElement( FromSmIdType(index) ); ++myNbUsedElements; e->myHolder = & myChunks[iChunk]; @@ -208,7 +208,7 @@ const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType id ) co smIdType index = ( id - 1 ) % theChunkSize; if ( iChunk < (smIdType) myChunks.size() ) { - const SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType(index) ); + const SMDS_MeshElement* e = myChunks[iChunk].Element( FromSmIdType(index) ); return e->IsNull() ? 0 : e; } } @@ -647,7 +647,7 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const { - vtkIdType dfltVtkID = FromIdType(e->GetID() - 1); + vtkIdType dfltVtkID = FromSmIdType(e->GetID() - 1); return ( dfltVtkID < (vtkIdType)myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID; } diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 039d4920b..9cb9a2040 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -191,7 +191,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, // Use double type for storing coordinates of nodes instead float. vtkPoints *newPoints = vtkPoints::New(); newPoints->SetDataType( VTK_DOUBLE ); - newPoints->SetNumberOfPoints( FromIdType(newNodeSize) ); + newPoints->SetNumberOfPoints( FromSmIdType(newNodeSize) ); vtkIdType i = 0, alreadyCopied = 0; while ( i < oldNodeSize ) @@ -257,11 +257,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New(); newTypes->Initialize(); - newTypes->SetNumberOfValues(FromIdType(newCellSize)); + newTypes->SetNumberOfValues(FromSmIdType(newCellSize)); vtkIdTypeArray *newLocations = vtkIdTypeArray::New(); newLocations->Initialize(); - newLocations->SetNumberOfValues(FromIdType(newCellSize)); + newLocations->SetNumberOfValues(FromSmIdType(newCellSize)); std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell @@ -298,16 +298,16 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, { smIdType oldCellId = idCellsNewToOld[ newCellID ]; newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 ); - smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType(oldCellId) ); - smIdType nCellFaces = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); - newFaces->InsertNextValue( FromIdType(nCellFaces) ); + smIdType oldFaceLoc = this->FaceLocations->GetValue( FromSmIdType(oldCellId) ); + smIdType nCellFaces = this->Faces->GetValue( FromSmIdType(oldFaceLoc++) ); + newFaces->InsertNextValue( FromSmIdType(nCellFaces) ); for ( int n = 0; n < nCellFaces; n++ ) { - int nptsInFace = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); + int nptsInFace = this->Faces->GetValue( FromSmIdType(oldFaceLoc++) ); newFaces->InsertNextValue( nptsInFace ); for ( int k = 0; k < nptsInFace; k++ ) { - vtkIdType oldpt = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); + vtkIdType oldpt = this->Faces->GetValue( FromSmIdType(oldFaceLoc++) ); newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]); } } @@ -446,15 +446,15 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool /*withEdges*/) const SMDS_MeshInfo &meshInfo = _mesh->GetMeshInfo(); - int nbLinTetra = FromIdType(meshInfo.NbTetras (ORDER_LINEAR)); - int nbQuadTetra = FromIdType(meshInfo.NbTetras (ORDER_QUADRATIC)); - int nbLinPyra = FromIdType(meshInfo.NbPyramids(ORDER_LINEAR)); - int nbQuadPyra = FromIdType(meshInfo.NbPyramids(ORDER_QUADRATIC)); - int nbLinPrism = FromIdType(meshInfo.NbPrisms (ORDER_LINEAR)); - int nbQuadPrism = FromIdType(meshInfo.NbPrisms (ORDER_QUADRATIC)); - int nbLinHexa = FromIdType(meshInfo.NbHexas (ORDER_LINEAR)); - int nbQuadHexa = FromIdType(meshInfo.NbHexas (ORDER_QUADRATIC)); - int nbHexPrism = FromIdType(meshInfo.NbHexPrisms()); + int nbLinTetra = FromSmIdType(meshInfo.NbTetras (ORDER_LINEAR)); + int nbQuadTetra = FromSmIdType(meshInfo.NbTetras (ORDER_QUADRATIC)); + int nbLinPyra = FromSmIdType(meshInfo.NbPyramids(ORDER_LINEAR)); + int nbQuadPyra = FromSmIdType(meshInfo.NbPyramids(ORDER_QUADRATIC)); + int nbLinPrism = FromSmIdType(meshInfo.NbPrisms (ORDER_LINEAR)); + int nbQuadPrism = FromSmIdType(meshInfo.NbPrisms (ORDER_QUADRATIC)); + int nbLinHexa = FromSmIdType(meshInfo.NbHexas (ORDER_LINEAR)); + int nbQuadHexa = FromSmIdType(meshInfo.NbHexas (ORDER_QUADRATIC)); + int nbHexPrism = FromSmIdType(meshInfo.NbHexPrisms()); int nbLineGuess = int((4.0 / 3.0) * nbLinTetra + 2 * nbLinPrism + 2.5 * nbLinPyra + 3 * nbLinHexa); int nbQuadEdgeGuess = int((4.0 / 3.0) * nbQuadTetra + 2 * nbQuadPrism + 2.5 * nbQuadPyra + 3 * nbQuadHexa); diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 3cb125ff2..2c7cbab0d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -7474,7 +7474,7 @@ public: static int HashCode(const ComparableElement& se, int limit ) { - return ::HashCode( FromIdType(se.mySumID), limit ); + return ::HashCode( FromSmIdType(se.mySumID), limit ); } static Standard_Boolean IsEqual(const ComparableElement& se1, const ComparableElement& se2 ) { diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 79e415e44..36ba5eaa1 100644 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -3539,7 +3539,7 @@ void SMESHGUI_FilterDlg::filterSource (const int theType, return; SMESH::smIdType_array_var anIds = myFilter[ theType ]->GetElementsId(myMesh); for (int i = 0, n = anIds->length(); i < n; i++) - theResIds.append(FromIdType(anIds[ i ])); + theResIds.append(FromSmIdType(anIds[ i ])); } else if (aSourceId == Selection) { @@ -3593,7 +3593,7 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, SMESH::smIdType_array_var anIds = theType == SMESH::NODE ? aSubMesh->GetNodesId() : aSubMesh->GetElementsId(); for (int i = 0, n = anIds->length(); i < n; i++) - aToBeFiltered.Add(FromIdType(anIds[ i ])); + aToBeFiltered.Add(FromSmIdType(anIds[ i ])); } } @@ -3606,7 +3606,7 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, { SMESH::smIdType_array_var anIds = aGroup->GetListOfID(); for (int i = 0, n = anIds->length(); i < n; i++) - aToBeFiltered.Add(FromIdType(anIds[ i ])); + aToBeFiltered.Add(FromSmIdType(anIds[ i ])); } } diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index 6febe32b6..9898f9051 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -533,7 +533,7 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply() bool ok; int anId = myDlg->myId->text().toInt( &ok ); if( !ok || anId < 1 ) - anId = FromIdType(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), + anId = FromSmIdType(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), myDlg->myDestinationY->GetValue(), myDlg->myDestinationZ->GetValue())); @@ -770,7 +770,7 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview() myDlg->myDestDZ->setReadOnly(true); } if ( isPreview && isMoveNode && anId == 0 ) - anId = FromIdType(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), + anId = FromSmIdType(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), myDlg->myDestinationY->GetValue(), myDlg->myDestinationZ->GetValue())); // find id and/or just compute preview @@ -870,7 +870,7 @@ void SMESHGUI_MakeNodeAtPointOp::onTextChange( const QString& theText ) if( const SMDS_MeshNode* aNode = aMesh->FindNode( theText.toInt() ) ) { SVTK_TVtkIDsMap aListInd; - aListInd.Add( FromIdType(aNode->GetID()) ); + aListInd.Add( FromSmIdType(aNode->GetID()) ); selector()->AddOrRemoveIndex( anIO, aListInd, false ); if( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ) ) aViewWindow->highlight( anIO, true, true ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index 34ba6a13a..b964c90bd 100644 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -711,7 +711,7 @@ void SMESHGUI_MultiEditDlg::onAddBtn() if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { SMESH::smIdType_array_var anIds = aSubMesh->GetElementsId(); for (int i = 0, n = anIds->length(); i < n; i++) { - if (isIdValid(FromIdType(anIds[ i ]))) + if (isIdValid(FromSmIdType(anIds[ i ]))) toBeAdded.Add(anIds[ i ]); } } @@ -727,7 +727,7 @@ void SMESHGUI_MultiEditDlg::onAddBtn() if (aGroup->GetMesh()->GetId() == myMesh->GetId()) { SMESH::smIdType_array_var anIds = aGroup->GetListOfID(); for (int i = 0, n = anIds->length(); i < n; i++) { - if (isIdValid(FromIdType(anIds[ i ]))) + if (isIdValid(FromSmIdType(anIds[ i ]))) toBeAdded.Add(anIds[ i ]); } } @@ -1109,9 +1109,9 @@ bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEdi return theEditor->ReorientObject( obj ); } -int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh() +smIdType SMESHGUI_ChangeOrientationDlg::nbElemsInMesh() { - return ( myFilterType == SMESH::FaceFilter ) ? FromIdType(myMesh->NbFaces()) : FromIdType(myMesh->NbVolumes()); + return ( myFilterType == SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes(); } /*! @@ -1207,9 +1207,9 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito return ok; } -int SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh() +smIdType SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh() { - return FromIdType(myMesh->NbTriangles()); + return myMesh->NbTriangles(); } void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview ) @@ -1327,9 +1327,9 @@ bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, return hasObj ? theEditor->QuadToTriObject(obj, aCrit) : theEditor->QuadToTri(theIds, aCrit); } -int SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh() +smIdType SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh() { - return FromIdType(myMesh->NbQuadrangles()); + return myMesh->NbQuadrangles(); } @@ -1439,13 +1439,13 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() const SMDS_MeshNode* aNode = static_cast(anIter->next()); if (aNode) { - if (!anIdToVtk.IsBound(FromIdType(aNode->GetID()))) + if (!anIdToVtk.IsBound(FromSmIdType(aNode->GetID()))) { aPoints->SetPoint(++nbPoints, aNode->X(), aNode->Y(), aNode->Z()); - anIdToVtk.Bind(FromIdType(aNode->GetID()), nbPoints); + anIdToVtk.Bind(FromSmIdType(aNode->GetID()), nbPoints); } - aNodes[ k++ ] = FromIdType(aNode->GetID()); + aNodes[ k++ ] = FromSmIdType(aNode->GetID()); } } @@ -1696,9 +1696,9 @@ bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, return true; } -int SMESHGUI_SplitVolumesDlg::nbElemsInMesh() +smIdType SMESHGUI_SplitVolumesDlg::nbElemsInMesh() { - return isIntoPrisms() ? FromIdType(myMesh->NbHexas()) : FromIdType(myMesh->NbVolumes() - myMesh->NbTetras()); + return isIntoPrisms() ? myMesh->NbHexas() : myMesh->NbVolumes() - myMesh->NbTetras(); } bool SMESHGUI_SplitVolumesDlg::isIntoPrisms() diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index e62901bfe..88c8293d0 100644 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -41,6 +41,8 @@ #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_MeshEditor) +#include + class SMESHGUI; class SMESHGUI_FilterDlg; class SMESHGUI_SpinBox; @@ -120,7 +122,7 @@ protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::smIdType_array& , SMESH::SMESH_IDSource_ptr obj) = 0; - virtual int nbElemsInMesh() = 0; + virtual smIdType nbElemsInMesh() = 0; int entityType(); protected: @@ -184,7 +186,7 @@ protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::smIdType_array& , SMESH::SMESH_IDSource_ptr obj); - virtual int nbElemsInMesh(); + virtual smIdType nbElemsInMesh(); }; /*! @@ -204,7 +206,7 @@ protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::smIdType_array&, SMESH::SMESH_IDSource_ptr obj ); - virtual int nbElemsInMesh(); + virtual smIdType nbElemsInMesh(); protected slots: virtual void onDisplaySimulation( bool ); @@ -229,7 +231,7 @@ protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::smIdType_array& , SMESH::SMESH_IDSource_ptr obj); - virtual int nbElemsInMesh(); + virtual smIdType nbElemsInMesh(); protected slots: virtual void reject(); @@ -271,7 +273,7 @@ protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::smIdType_array&, SMESH::SMESH_IDSource_ptr obj ); - virtual int nbElemsInMesh(); + virtual smIdType nbElemsInMesh(); virtual void setSelectionMode(); void showFacetByElement( int id ); diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index 9a6a42750..bcb288991 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -1985,7 +1985,7 @@ SMESH_MeshAlgos::FindSharpEdges( SMDS_Mesh* theMesh, typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap; TLinkSharpMap linkIsSharp; - Standard_Integer nbBuckets = FromIdType( theMesh->NbFaces() ); + Standard_Integer nbBuckets = FromSmIdType( theMesh->NbFaces() ); if ( nbBuckets > 0 ) linkIsSharp.ReSize( nbBuckets ); @@ -2096,7 +2096,7 @@ SMESH_MeshAlgos::SeparateFacesByEdges( SMDS_Mesh* theMesh, const std::vector< Ed typedef std::vector< const SMDS_MeshElement* > TFaceVec; typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks; TFacesByLinks facesByLink; - Standard_Integer nbBuckets = FromIdType( theMesh->NbFaces() ); + Standard_Integer nbBuckets = FromSmIdType( theMesh->NbFaces() ); if ( nbBuckets > 0 ) facesByLink.ReSize( nbBuckets ); diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index cd886ee58..830e03ab9 100644 --- a/src/SMESHUtils/SMESH_Offset.cxx +++ b/src/SMESHUtils/SMESH_Offset.cxx @@ -277,7 +277,7 @@ namespace static Standard_Integer HashCode(const CutFace& f, const Standard_Integer upper) { - return ::HashCode( FromIdType(f.myInitFace->GetID()), upper ); + return ::HashCode( FromSmIdType(f.myInitFace->GetID()), upper ); } static Standard_Boolean IsEqual(const CutFace& f1, const CutFace& f2 ) { diff --git a/src/SMESHUtils/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx index f6cb1d3ed..f4dd5c67e 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -156,7 +156,7 @@ struct SMESH_TLink: public NLink // methods for usage of SMESH_TLink as a hasher in NCollection maps static int HashCode(const SMESH_TLink& link, int aLimit) { - return ::HashCode( FromIdType(link.node1()->GetID() + link.node2()->GetID()), aLimit ); + return smIdHasher::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit ); } static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2) { @@ -217,7 +217,7 @@ struct SMESH_Hasher { static Standard_Integer HashCode(const SMDS_MeshElement* e, const Standard_Integer upper) { - return ::HashCode( FromIdType(e->GetID()), upper ); + return smIdHasher::HashCode( e->GetID(), upper ); } static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 ) { diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index a7c67171c..0470c9fcd 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -2065,7 +2065,7 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) } typedef struct { - int shapeID, fromID, toID; // indices of elements of a sub-mesh + int shapeID; smIdType fromID, toID; // indices of elements of a sub-mesh } TRange; std::vector< TRange > elemRanges, nodeRanges; // elements of sub-meshes std::vector< SMDS_PositionPtr > positions; // node positions @@ -2101,7 +2101,7 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) TRange & lastRange = ranges.back(); if ( lastRange.shapeID != shapeID || lastRange.toID != elemID ) - ranges.push_back( TRange{ shapeID, FromIdType(elemID), FromIdType(elemID + 1) }); + ranges.push_back( TRange{ shapeID, elemID, elemID + 1 }); else lastRange.toID = elemID + 1; diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index ed0d0d294..950d0cdf9 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -583,7 +583,7 @@ bool StdMeshers_Regular_1D::divideIntoEqualSegments( SMESH_Mesh & theMesh bool ok = false; if ( theNbPoints < IntegerLast() ) { - int nbPnt = FromIdType( theNbPoints ); + int nbPnt = FromSmIdType( theNbPoints ); GCPnts_UniformAbscissa discret(theC3d, nbPnt, theFirstU, theLastU, theTol ); if ( !discret.IsDone() ) return error( "GCPnts_UniformAbscissa failed"); @@ -801,7 +801,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if (nbseg <= 0) nbseg = 1; // degenerated edge eltSize = theLength / nbseg * ( 1. - 1e-9 ); - nbSegments = ToIdType( nbseg ); + nbSegments = ToSmIdType( nbseg ); } else if ( _hypType == LOCAL_LENGTH ) { @@ -827,7 +827,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, smIdType nb_segments = smds->NbElements(); if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) { isFound = true; - nbseg = FromIdType( nb_segments ); + nbseg = FromSmIdType( nb_segments ); } } } @@ -842,7 +842,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if (nbseg <= 0) nbseg = 1; // degenerated edge eltSize = theLength / nbseg; - nbSegments = ToIdType( nbseg ); + nbSegments = ToSmIdType( nbseg ); } else { @@ -891,7 +891,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, break; case StdMeshers_NumberOfSegments::DT_TabFunc: { - FunctionTable func(_vvalue[ TAB_FUNC_IND ], FromIdType( _ivalue[ CONV_MODE_IND ])); + FunctionTable func(_vvalue[ TAB_FUNC_IND ], FromSmIdType( _ivalue[ CONV_MODE_IND ])); return computeParamByFunc(theC3d, f, l, theLength, theReverse, _ivalue[ NB_SEGMENTS_IND ], func, theParams); @@ -900,7 +900,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, case StdMeshers_NumberOfSegments::DT_ExprFunc: { FunctionExpr func(_svalue[ EXPR_FUNC_IND ].c_str(), - FromIdType( _ivalue[ CONV_MODE_IND ])); + FromSmIdType( _ivalue[ CONV_MODE_IND ])); return computeParamByFunc(theC3d, f, l, theLength, theReverse, _ivalue[ NB_SEGMENTS_IND ], func, theParams); diff --git a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx index 8793f3bce..e69a8024d 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx @@ -305,14 +305,14 @@ void StdMeshersGUI_FixedPointsParamWdg::setNbSegments( int idx, SMESH::smIdType { if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ) { - myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, FromIdType( val )); + myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, qlonglong( val )); myTreeWidget->topLevelItem( idx )->setText( 1, idx > 0 && mySameValues->isChecked() ? QString( SAME_TEXT ) : QString::number( val ) ); } } smIdType StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const { - return ToIdType( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1 ); + return idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toLongLong() : 1; } //=================================================================================