From 13ed46158e39828ec1bc313716e18bc8d0bece2f Mon Sep 17 00:00:00 2001 From: Viktor UZLOV Date: Mon, 1 Feb 2021 14:23:36 +0300 Subject: [PATCH] fix conversion error. Build completed --- src/DriverCGNS/DriverCGNS_Read.cxx | 8 ++-- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 9 ++-- src/SMDS/SMDS_ElementFactory.cxx | 16 ++++---- src/SMDS/SMDS_ElementFactory.hxx | 8 ++-- src/SMDS/SMDS_Mesh.cxx | 48 +++++++++++----------- src/SMDS/SMDS_Mesh.hxx | 20 ++++----- src/SMESH/SMESH_MeshEditor.cxx | 4 +- src/SMESHClient/SMESH_Client.cxx | 13 +++--- src/SMESHDS/SMESHDS_Command.cxx | 14 +++---- src/SMESHDS/SMESHDS_Command.hxx | 13 +++--- src/SMESHDS/SMESHDS_Mesh.cxx | 2 +- src/SMESHDS/SMESHDS_Script.cxx | 10 ++--- src/SMESHDS/SMESHDS_Script.hxx | 14 ++++--- src/SMESHUtils/SMESH_Offset.cxx | 2 +- src/SMESHUtils/SMESH_TypeDefs.hxx | 6 ++- src/SMESH_I/SMESH_MeshPartDS.hxx | 9 ++-- src/SMESH_I/SMESH_Mesh_i.cxx | 8 ++-- 17 files changed, 108 insertions(+), 96 deletions(-) diff --git a/src/DriverCGNS/DriverCGNS_Read.cxx b/src/DriverCGNS/DriverCGNS_Read.cxx index dc6192470..4ac3e92c6 100644 --- a/src/DriverCGNS/DriverCGNS_Read.cxx +++ b/src/DriverCGNS/DriverCGNS_Read.cxx @@ -33,6 +33,8 @@ #include "SMESH_Comment.hxx" #include "SMESH_TypeDefs.hxx" +#include + #include #include @@ -546,10 +548,10 @@ namespace } SMDS_MeshElement* add_NGON(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID) { - vector idVec( ids[0] ); + vector idVec( ids[0] ); for ( int i = 0; i < ids[0]; ++i ) - idVec[ i ] = (int) ids[ i + 1]; - return mesh->AddPolygonalFaceWithID( idVec, ID ); + idVec[ i ] = (smIdType) ids[ i + 1]; + return mesh->AddPolygonalFaceWithID( idVec, ToIdType(ID) ); } typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID); diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index e2b117cf6..ac7cb640f 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -36,6 +36,7 @@ #include "MED_Utilities.hxx" #include +#include #include "utilities.h" @@ -225,7 +226,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() // Reading pre information about all MED cells //-------------------------------------------- - typedef MED::TVector TNodeIds; + typedef MED::TVector TNodeIds; bool takeNumbers = true; // initially we trust the numbers from file MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD); MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin(); @@ -318,7 +319,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX; typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID) - (const std::vector & nodes_ids, const int ID); + (const std::vector & nodes_ids, const smIdType ID); typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon) (const std::vector & nodes); @@ -355,7 +356,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif if ( anIsElemNum ) { TInt anElemId = aPolygoneInfo->GetElemNum( iElem ); - anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId ); + anElement = (myMesh->*addPolyWithID)( aNodeIds, ToIdType(anElemId) ); } if ( !anElement ) { aNodes.resize( aNbConn ); @@ -436,7 +437,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif if(anIsElemNum){ TInt anElemId = aPolyedreInfo->GetElemNum(iElem); - anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId); + anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToIdType(anElemId)); } if(!anElement){ vector aNodes(aNbNodes); diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index 6aec2c078..a0bc0ff91 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -285,7 +285,7 @@ void SMDS_ElementFactory::Compact( std::vector& theVtkIDsNewToOld ) { smIdType newNbCells = NbUsedElements(); smIdType maxCellID = GetMaxID(); - smIdType newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize ); + int newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize ); theVtkIDsNewToOld.resize( newNbCells ); @@ -383,9 +383,9 @@ void SMDS_NodeFactory::Compact( std::vector& theVtkIDsOldToNew ) // in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew: // theVtkIDsOldToNew[ old VtkID ] = new VtkID - smIdType oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints(); - smIdType newNbNodes = NbUsedElements(); - smIdType newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize ); + int oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints(); + int newNbNodes = NbUsedElements(); + int newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize ); smIdType maxNodeID = GetMaxID(); theVtkIDsOldToNew.resize( oldNbNodes, -1 ); @@ -488,7 +488,7 @@ void SMDS_NodeFactory::SetNbShapes( size_t nbShapes ) */ //================================================================================ -int SMDS_NodeFactory::GetShapeDim( smIdType shapeID ) const +int SMDS_NodeFactory::GetShapeDim( int shapeID ) const { return shapeID < (int)myShapeDim.size() ? myShapeDim[ shapeID ] : theDefaultShapeDim; } @@ -499,9 +499,9 @@ int SMDS_NodeFactory::GetShapeDim( smIdType shapeID ) const */ //================================================================================ -void SMDS_NodeFactory::SetShapeDim( smIdType shapeID, int dim ) +void SMDS_NodeFactory::SetShapeDim( int shapeID, int dim ) { - if ( shapeID >= (smIdType)myShapeDim.size() ) + if ( shapeID >= (int)myShapeDim.size() ) myShapeDim.resize( shapeID + 10, theDefaultShapeDim ); myShapeDim[ shapeID ] = dim; } @@ -836,7 +836,7 @@ void SMDS_ElementChunk::Compact() } else if ( it != mySubIDRanges.mySet.rbegin() ) { - smIdType nbNodes = (it-1)->my1st; + int nbNodes = (it-1)->my1st; myPositions.resize( nbNodes * 2 ); std::vector newPos( myPositions.begin(), myPositions.end() ); myPositions.swap( newPos ); diff --git a/src/SMDS/SMDS_ElementFactory.hxx b/src/SMDS/SMDS_ElementFactory.hxx index 109431084..7372550ca 100644 --- a/src/SMDS/SMDS_ElementFactory.hxx +++ b/src/SMDS/SMDS_ElementFactory.hxx @@ -98,7 +98,7 @@ public: const SMDS_MeshElement* FindElement( const smIdType id ) const; //! Return a number of used elements - smIdType NbUsedElements() const { return myNbUsedElements; } + int NbUsedElements() const { return myNbUsedElements; } //! Return an iterator on all element filtered using a given filter. // nbElemsToReturn is used to optimize by stopping the iteration as soon as @@ -160,10 +160,10 @@ public: void SetNbShapes( size_t nbShapes ); //! Return a dimension of a shape - int GetShapeDim( smIdType shapeID ) const; + int GetShapeDim( int shapeID ) const; //! Set a dimension of a shape - void SetShapeDim( smIdType shapeID, int dim ); + void SetShapeDim( int shapeID, int dim ); //! De-allocate all nodes virtual void Clear(); @@ -405,7 +405,7 @@ public: static bool IsUsed( const _UsedRange& r ) { return r.myValue; } //! Return index of an element in the chunk - smIdType Index( const SMDS_MeshElement* e ) const { return e - myElements; } + int Index( const SMDS_MeshElement* e ) const { return e - myElements; } //! Return ID of the 1st element in the chunk int Get1stID() const { return my1stID; } diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index 5c8b7b5fa..b878c679d 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -815,9 +815,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector & nodes_ids, const smIdType ID) { - smIdType nbNodes = nodes_ids.size(); + int nbNodes = nodes_ids.size(); std::vector nodes (nbNodes); - for (smIdType i = 0; i < nbNodes; i++) { + for (int i = 0; i < nbNodes; i++) { nodes[i] = myNodeFactory->FindNode( nodes_ids[i] ); if (!nodes[i]) return NULL; } @@ -911,9 +911,9 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector & quantities, const smIdType ID) { - smIdType nbNodes = nodes_ids.size(); + int nbNodes = nodes_ids.size(); std::vector nodes (nbNodes); - for (smIdType i = 0; i < nbNodes; i++) { + for (int i = 0; i < nbNodes; i++) { nodes[i] = myNodeFactory->FindNode(nodes_ids[i]); if (!nodes[i]) return NULL; } @@ -1083,7 +1083,7 @@ bool SMDS_Mesh::ChangePolyhedronNodes(const SMDS_MeshElement * e bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * element, const SMDS_MeshNode * nodes[], - const smIdType nbnodes) + const int nbnodes) { // keep current nodes of element std::set oldNodes( element->begin_nodes(), element->end_nodes() ); @@ -1108,7 +1108,7 @@ bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * element, void SMDS_Mesh::updateInverseElements( const SMDS_MeshElement * element, const SMDS_MeshNode* const* nodes, - const smIdType nbnodes, + const int nbnodes, std::set& oldNodes ) { if ( GetGrid()->HasLinks() ) // update InverseElements @@ -1116,7 +1116,7 @@ void SMDS_Mesh::updateInverseElements( const SMDS_MeshElement * element, std::set::iterator it; // AddInverseElement to new nodes - for ( smIdType i = 0; i < nbnodes; i++ ) + for ( int i = 0; i < nbnodes; i++ ) { it = oldNodes.find( nodes[i] ); if ( it == oldNodes.end() ) @@ -1459,7 +1459,7 @@ int SMDS_Mesh::GetElementsByNodes(const std::vector& node /////////////////////////////////////////////////////////////////////////////// /// Return the number of nodes /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbNodes() const +int SMDS_Mesh::NbNodes() const { return myInfo.NbNodes(); } @@ -1467,14 +1467,14 @@ smIdType SMDS_Mesh::NbNodes() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of elements /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbElements() const +int SMDS_Mesh::NbElements() const { return myInfo.NbElements(); } /////////////////////////////////////////////////////////////////////////////// /// Return the number of 0D elements /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::Nb0DElements() const +int SMDS_Mesh::Nb0DElements() const { return myInfo.Nb0DElements(); } @@ -1482,7 +1482,7 @@ smIdType SMDS_Mesh::Nb0DElements() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of 0D elements /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbBalls() const +int SMDS_Mesh::NbBalls() const { return myInfo.NbBalls(); } @@ -1490,7 +1490,7 @@ smIdType SMDS_Mesh::NbBalls() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of edges (including construction edges) /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbEdges() const +int SMDS_Mesh::NbEdges() const { return myInfo.NbEdges(); } @@ -1498,7 +1498,7 @@ smIdType SMDS_Mesh::NbEdges() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of faces (including construction faces) /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbFaces() const +int SMDS_Mesh::NbFaces() const { return myInfo.NbFaces(); } @@ -1506,7 +1506,7 @@ smIdType SMDS_Mesh::NbFaces() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of volumes /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbVolumes() const +int SMDS_Mesh::NbVolumes() const { return myInfo.NbVolumes(); } @@ -1515,7 +1515,7 @@ smIdType SMDS_Mesh::NbVolumes() const /// Return the number of child mesh of this mesh. /// Note that the tree structure of SMDS_Mesh is unused in SMESH /////////////////////////////////////////////////////////////////////////////// -smIdType SMDS_Mesh::NbSubMesh() const +int SMDS_Mesh::NbSubMesh() const { return myChildren.size(); } @@ -1589,7 +1589,7 @@ SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const { - smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); + int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ), nbElems); } @@ -1600,7 +1600,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) c { return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter ); } - smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); + int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); return myCellFactory->GetIterator( new SMDS_MeshElement::EntityFilter( type ), nbElems); } @@ -1620,7 +1620,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter ); default: - smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); + int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ), nbElems); } @@ -1634,7 +1634,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const { typedef SMDS_EdgeIterator TIterator; - smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges(); + int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges(); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ), nbElems); } @@ -1646,7 +1646,7 @@ SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const { typedef SMDS_FaceIterator TIterator; - smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces(); + int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces(); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ), nbElems); } @@ -1658,7 +1658,7 @@ SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const { typedef SMDS_VolumeIterator TIterator; - smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); + int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ), nbElems ); @@ -1705,7 +1705,7 @@ intersectionOfSets( std::set vs[], int numberOfSets ) /////////////////////////////////////////////////////////////////////////////// static std::set * getFinitElements(const SMDS_MeshElement * element) { - smIdType numberOfSets=element->NbNodes(); + int numberOfSets=element->NbNodes(); std::set *initSet = new std::set[numberOfSets]; SMDS_NodeIteratorPtr itNodes = element->nodeIterator(); @@ -2981,8 +2981,8 @@ void SMDS_Mesh::CompactMesh() myCellFactory->Compact( idCellsNewToOld ); // make VTK IDs correspond to SMDS IDs - smIdType newNodeSize = myNodeFactory->NbUsedElements(); - smIdType newCellSize = myCellFactory->NbUsedElements(); + int newNodeSize = myNodeFactory->NbUsedElements(); + int newCellSize = myCellFactory->NbUsedElements(); myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize ); if ( idsChange && !myElemHolders.empty() ) diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 88086debf..1150ca044 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -613,7 +613,7 @@ public: bool ChangeElementNodes(const SMDS_MeshElement * elem, const SMDS_MeshNode * nodes[], - const smIdType nbnodes); + const int nbnodes); bool ChangePolyhedronNodes(const SMDS_MeshElement * elem, const std::vector& nodes, const std::vector& quantities); @@ -689,14 +689,14 @@ public: const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; } - virtual smIdType NbNodes() const; - virtual smIdType NbElements() const; - virtual smIdType Nb0DElements() const; - virtual smIdType NbBalls() const; - virtual smIdType NbEdges() const; - virtual smIdType NbFaces() const; - virtual smIdType NbVolumes() const; - virtual smIdType NbSubMesh() const; + virtual int NbNodes() const; + virtual int NbElements() const; + virtual int Nb0DElements() const; + virtual int NbBalls() const; + virtual int NbEdges() const; + virtual int NbFaces() const; + virtual int NbVolumes() const; + virtual int NbSubMesh() const; virtual ~SMDS_Mesh(); @@ -731,7 +731,7 @@ public: void updateInverseElements( const SMDS_MeshElement * element, const SMDS_MeshNode* const* nodes, - const smIdType nbnodes, + const int nbnodes, std::set& oldNodes ); void setNbShapes( size_t nbShapes ); diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index e9c672c1e..b8317ea1b 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -100,6 +100,8 @@ #include "SMESH_TryCatch.hxx" // include after OCCT headers! +#include + #define cast2Node(elem) static_cast( elem ) using namespace std; @@ -3122,7 +3124,7 @@ public: long GetLinkID (const SMDS_MeshNode * n1, const SMDS_MeshNode * n2) const { - return ( Min(n1->GetID(),n2->GetID()) * myMaxID + Max(n1->GetID(),n2->GetID())); + return ( Min(FromIdType(n1->GetID()),FromIdType(n2->GetID())) * myMaxID + Max(FromIdType(n1->GetID()),FromIdType(n2->GetID()))); } bool GetNodes (const long theLinkID, diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index 0c1b1aeab..bab264dbc 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -33,6 +33,7 @@ #include "SALOME_LifeCycleCORBA.hxx" #include +#include #include CORBA_SERVER_HEADER(SALOME_Component) #include CORBA_SERVER_HEADER(SALOME_Exception) @@ -231,10 +232,10 @@ namespace CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { - int aFaceId = anIndexes[anIndexId++]; + smIdType aFaceId = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++]; - std::vector nodes_ids (aNbNodes); + std::vector nodes_ids (aNbNodes); for (int i = 0; i < aNbNodes; i++) { nodes_ids[i] = anIndexes[anIndexId++]; } @@ -258,10 +259,10 @@ namespace CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { - int aFaceId = anIndexes[anIndexId++]; + smIdType aFaceId = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++]; - std::vector nodes_ids (aNbNodes); + std::vector nodes_ids (aNbNodes); for (int i = 0; i < aNbNodes; i++) { nodes_ids[i] = anIndexes[anIndexId++]; } @@ -414,10 +415,10 @@ namespace CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { - int aFaceId = anIndexes[anIndexId++]; + smIdType aFaceId = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++]; - std::vector nodes_ids (aNbNodes); + std::vector nodes_ids (aNbNodes); for (int i = 0; i < aNbNodes; i++) { nodes_ids[i] = anIndexes[anIndexId++]; } diff --git a/src/SMESHDS/SMESHDS_Command.cxx b/src/SMESHDS/SMESHDS_Command.cxx index e5e4002c8..755adf730 100644 --- a/src/SMESHDS/SMESHDS_Command.cxx +++ b/src/SMESHDS/SMESHDS_Command.cxx @@ -277,8 +277,8 @@ void SMESHDS_Command::AddVolume(int NewVolID, //function : AddPolygonalFace //purpose : //======================================================================= -void SMESHDS_Command::AddPolygonalFace (const int ElementID, - const std::vector& nodes_ids) +void SMESHDS_Command::AddPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids) { if ( myType != SMESHDS_AddPolygon) { MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type"); @@ -299,8 +299,8 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID, //function : AddQuadPolygonalFace //purpose : //======================================================================= -void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, - const std::vector& nodes_ids) +void SMESHDS_Command::AddQuadPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids) { if ( myType != SMESHDS_AddQuadPolygon) { MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type"); @@ -321,9 +321,9 @@ void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, //function : AddPolyhedralVolume //purpose : //======================================================================= -void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, - const std::vector& nodes_ids, - const std::vector& quantities) +void SMESHDS_Command::AddPolyhedralVolume (const smIdType ElementID, + const std::vector& nodes_ids, + const std::vector& quantities) { if ( myType != SMESHDS_AddPolyhedron) { MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type"); diff --git a/src/SMESHDS/SMESHDS_Command.hxx b/src/SMESHDS/SMESHDS_Command.hxx index 8c0c3a81b..eb3f943cc 100644 --- a/src/SMESHDS/SMESHDS_Command.hxx +++ b/src/SMESHDS/SMESHDS_Command.hxx @@ -30,6 +30,7 @@ #include "SMESH_SMESHDS.hxx" #include "SMESHDS_CommandType.hxx" +#include #include #include @@ -55,12 +56,12 @@ class SMESHDS_EXPORT SMESHDS_Command void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode9, int idnode10, int idnode11, int idnode12); - void AddPolygonalFace (const int ElementID, - const std::vector& nodes_ids); - void AddQuadPolygonalFace (const int ElementID, - const std::vector& nodes_ids); - void AddPolyhedralVolume (const int ElementID, - const std::vector& nodes_ids, + void AddPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids); + void AddQuadPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids); + void AddPolyhedralVolume (const smIdType ElementID, + const std::vector& nodes_ids, const std::vector& quantities); void AddBall(int NewBallID, int node, double diameter); // special methods for quadratic elements diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 922d5234f..c7dc8bbd1 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -790,7 +790,7 @@ SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector& nod //purpose : //======================================================================= SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector& nodes_ids, - const std::vector& quantities, + const std::vector& quantities, const smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID); diff --git a/src/SMESHDS/SMESHDS_Script.cxx b/src/SMESHDS/SMESHDS_Script.cxx index 1250ddcf9..368fa16fa 100644 --- a/src/SMESHDS/SMESHDS_Script.cxx +++ b/src/SMESHDS/SMESHDS_Script.cxx @@ -246,7 +246,7 @@ void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnod //function : AddPolygonalFace //purpose : //======================================================================= -void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector& nodes_ids) +void SMESHDS_Script::AddPolygonalFace (smIdType NewFaceID, const std::vector& nodes_ids) { if(myIsEmbeddedMode){ myIsModified = true; @@ -259,7 +259,7 @@ void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector& no //function : AddQuadPolygonalFace //purpose : //======================================================================= -void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector& nodes_ids) +void SMESHDS_Script::AddQuadPolygonalFace(smIdType NewFaceID, const std::vector& nodes_ids) { if(myIsEmbeddedMode){ myIsModified = true; @@ -272,9 +272,9 @@ void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector& //function : AddPolyhedralVolume //purpose : //======================================================================= -void SMESHDS_Script::AddPolyhedralVolume (int NewID, - const std::vector& nodes_ids, - const std::vector& quantities) +void SMESHDS_Script::AddPolyhedralVolume (smIdType NewID, + const std::vector& nodes_ids, + const std::vector& quantities) { if(myIsEmbeddedMode){ myIsModified = true; diff --git a/src/SMESHDS/SMESHDS_Script.hxx b/src/SMESHDS/SMESHDS_Script.hxx index 0bf0f8626..d5a84134e 100644 --- a/src/SMESHDS/SMESHDS_Script.hxx +++ b/src/SMESHDS/SMESHDS_Script.hxx @@ -31,6 +31,8 @@ #include "SMESHDS_Command.hxx" +#include + #include #include @@ -62,12 +64,12 @@ class SMESHDS_EXPORT SMESHDS_Script int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode9, int idnode10, int idnode11, int idnode12); - void AddPolygonalFace (const int NewFaceID, - const std::vector& nodes_ids); - void AddQuadPolygonalFace (const int NewFaceID, - const std::vector& nodes_ids); - void AddPolyhedralVolume (const int NewVolID, - const std::vector& nodes_ids, + void AddPolygonalFace (const smIdType NewFaceID, + const std::vector& nodes_ids); + void AddQuadPolygonalFace (const smIdType NewFaceID, + const std::vector& nodes_ids); + void AddPolyhedralVolume (const smIdType NewVolID, + const std::vector& nodes_ids, const std::vector& quantities); void AddBall(int NewBallID, int node, double diameter); diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index 01552f584..22c68fd79 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( f.myInitFace->GetID(), upper ); + return ::HashCode( (int)(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 ddca90c81..f6cb1d3ed 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -32,6 +32,8 @@ #include "SMDS_SetIterator.hxx" #include "SMDS_MeshNode.hxx" +#include + #include #include @@ -154,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( link.node1()->GetID() + link.node2()->GetID(), aLimit ); + return ::HashCode( FromIdType(link.node1()->GetID() + link.node2()->GetID()), aLimit ); } static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2) { @@ -215,7 +217,7 @@ struct SMESH_Hasher { static Standard_Integer HashCode(const SMDS_MeshElement* e, const Standard_Integer upper) { - return ::HashCode( e->GetID(), upper ); + return ::HashCode( FromIdType(e->GetID()), upper ); } static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 ) { diff --git a/src/SMESH_I/SMESH_MeshPartDS.hxx b/src/SMESH_I/SMESH_MeshPartDS.hxx index 07ce97706..0de1d7e19 100644 --- a/src/SMESH_I/SMESH_MeshPartDS.hxx +++ b/src/SMESH_I/SMESH_MeshPartDS.hxx @@ -28,6 +28,7 @@ #include "SMESHDS_Mesh.hxx" #include "SMESH_TypeDefs.hxx" +#include #include #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -59,10 +60,10 @@ public: virtual const SMDS_MeshElement *FindElement(int IDelem) const; virtual bool HasNumerationHoles(); - virtual int MaxNodeID() const; - virtual int MinNodeID() const; - virtual int MaxElementID() const; - virtual int MinElementID() const; + virtual smIdType MaxNodeID() const; + virtual smIdType MinNodeID() const; + virtual smIdType MaxElementID() const; + virtual smIdType MinElementID() const; private: TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ]; diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index b5c003e4c..0ed91d9d6 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -7057,19 +7057,19 @@ bool SMESH_MeshPartDS::HasNumerationHoles() MaxElementID() != NbElements() ); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MaxNodeID() const +smIdType SMESH_MeshPartDS::MaxNodeID() const { if ( _meshDS ) return _meshDS->MaxNodeID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID(); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MinNodeID() const +smIdType SMESH_MeshPartDS::MinNodeID() const { if ( _meshDS ) return _meshDS->MinNodeID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID(); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MaxElementID() const +smIdType SMESH_MeshPartDS::MaxElementID() const { if ( _meshDS ) return _meshDS->MaxElementID(); int maxID = 0; @@ -7079,7 +7079,7 @@ int SMESH_MeshPartDS::MaxElementID() const return maxID; } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MinElementID() const +smIdType SMESH_MeshPartDS::MinElementID() const { if ( _meshDS ) return _meshDS->MinElementID(); int minID = 0; -- 2.39.2