fix conversion error. Build completed

This commit is contained in:
Viktor UZLOV 2021-02-01 14:23:36 +03:00
parent 29df5478fc
commit 13ed46158e
17 changed files with 108 additions and 96 deletions

View File

@ -33,6 +33,8 @@
#include "SMESH_Comment.hxx" #include "SMESH_Comment.hxx"
#include "SMESH_TypeDefs.hxx" #include "SMESH_TypeDefs.hxx"
#include <smIdType.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <cgnslib.h> #include <cgnslib.h>
@ -546,10 +548,10 @@ namespace
} }
SMDS_MeshElement* add_NGON(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID) SMDS_MeshElement* add_NGON(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID)
{ {
vector<int> idVec( ids[0] ); vector<smIdType> idVec( ids[0] );
for ( int i = 0; i < ids[0]; ++i ) for ( int i = 0; i < ids[0]; ++i )
idVec[ i ] = (int) ids[ i + 1]; idVec[ i ] = (smIdType) ids[ i + 1];
return mesh->AddPolygonalFaceWithID( idVec, ID ); return mesh->AddPolygonalFaceWithID( idVec, ToIdType(ID) );
} }
typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID); typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID);

View File

@ -36,6 +36,7 @@
#include "MED_Utilities.hxx" #include "MED_Utilities.hxx"
#include <NCollection_Map.hxx> #include <NCollection_Map.hxx>
#include <smIdType.hxx>
#include "utilities.h" #include "utilities.h"
@ -225,7 +226,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
// Reading pre information about all MED cells // Reading pre information about all MED cells
//-------------------------------------------- //--------------------------------------------
typedef MED::TVector<int> TNodeIds; typedef MED::TVector<smIdType> TNodeIds;
bool takeNumbers = true; // initially we trust the numbers from file bool takeNumbers = true; // initially we trust the numbers from file
MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD); MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD);
MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin(); MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
@ -318,7 +319,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX; EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID) typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID)
(const std::vector<int> & nodes_ids, const int ID); (const std::vector<smIdType> & nodes_ids, const smIdType ID);
typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon) typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon)
(const std::vector<const SMDS_MeshNode*> & nodes); (const std::vector<const SMDS_MeshNode*> & nodes);
@ -355,7 +356,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif #endif
if ( anIsElemNum ) { if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem ); TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId ); anElement = (myMesh->*addPolyWithID)( aNodeIds, ToIdType(anElemId) );
} }
if ( !anElement ) { if ( !anElement ) {
aNodes.resize( aNbConn ); aNodes.resize( aNbConn );
@ -436,7 +437,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
#endif #endif
if(anIsElemNum){ if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem); TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId); anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToIdType(anElemId));
} }
if(!anElement){ if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes); vector<const SMDS_MeshNode*> aNodes(aNbNodes);

View File

@ -285,7 +285,7 @@ void SMDS_ElementFactory::Compact( std::vector<smIdType>& theVtkIDsNewToOld )
{ {
smIdType newNbCells = NbUsedElements(); smIdType newNbCells = NbUsedElements();
smIdType maxCellID = GetMaxID(); smIdType maxCellID = GetMaxID();
smIdType newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize ); int newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize );
theVtkIDsNewToOld.resize( newNbCells ); theVtkIDsNewToOld.resize( newNbCells );
@ -383,9 +383,9 @@ void SMDS_NodeFactory::Compact( std::vector<smIdType>& theVtkIDsOldToNew )
// in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew: // in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew:
// theVtkIDsOldToNew[ old VtkID ] = new VtkID // theVtkIDsOldToNew[ old VtkID ] = new VtkID
smIdType oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints(); int oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints();
smIdType newNbNodes = NbUsedElements(); int newNbNodes = NbUsedElements();
smIdType newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize ); int newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize );
smIdType maxNodeID = GetMaxID(); smIdType maxNodeID = GetMaxID();
theVtkIDsOldToNew.resize( oldNbNodes, -1 ); 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; 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.resize( shapeID + 10, theDefaultShapeDim );
myShapeDim[ shapeID ] = dim; myShapeDim[ shapeID ] = dim;
} }
@ -836,7 +836,7 @@ void SMDS_ElementChunk::Compact()
} }
else if ( it != mySubIDRanges.mySet.rbegin() ) else if ( it != mySubIDRanges.mySet.rbegin() )
{ {
smIdType nbNodes = (it-1)->my1st; int nbNodes = (it-1)->my1st;
myPositions.resize( nbNodes * 2 ); myPositions.resize( nbNodes * 2 );
std::vector<TParam> newPos( myPositions.begin(), myPositions.end() ); std::vector<TParam> newPos( myPositions.begin(), myPositions.end() );
myPositions.swap( newPos ); myPositions.swap( newPos );

View File

@ -98,7 +98,7 @@ public:
const SMDS_MeshElement* FindElement( const smIdType id ) const; const SMDS_MeshElement* FindElement( const smIdType id ) const;
//! Return a number of used elements //! 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. //! Return an iterator on all element filtered using a given filter.
// nbElemsToReturn is used to optimize by stopping the iteration as soon as // nbElemsToReturn is used to optimize by stopping the iteration as soon as
@ -160,10 +160,10 @@ public:
void SetNbShapes( size_t nbShapes ); void SetNbShapes( size_t nbShapes );
//! Return a dimension of a shape //! Return a dimension of a shape
int GetShapeDim( smIdType shapeID ) const; int GetShapeDim( int shapeID ) const;
//! Set a dimension of a shape //! Set a dimension of a shape
void SetShapeDim( smIdType shapeID, int dim ); void SetShapeDim( int shapeID, int dim );
//! De-allocate all nodes //! De-allocate all nodes
virtual void Clear(); virtual void Clear();
@ -405,7 +405,7 @@ public:
static bool IsUsed( const _UsedRange& r ) { return r.myValue; } static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! Return index of an element in the chunk //! 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 //! Return ID of the 1st element in the chunk
int Get1stID() const { return my1stID; } int Get1stID() const { return my1stID; }

View File

@ -815,9 +815,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids, SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const smIdType ID) const smIdType ID)
{ {
smIdType nbNodes = nodes_ids.size(); int nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (smIdType i = 0; i < nbNodes; i++) { for (int i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode( nodes_ids[i] ); nodes[i] = myNodeFactory->FindNode( nodes_ids[i] );
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }
@ -911,9 +911,9 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdTy
const std::vector<int> & quantities, const std::vector<int> & quantities,
const smIdType ID) const smIdType ID)
{ {
smIdType nbNodes = nodes_ids.size(); int nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (smIdType i = 0; i < nbNodes; i++) { for (int i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode(nodes_ids[i]); nodes[i] = myNodeFactory->FindNode(nodes_ids[i]);
if (!nodes[i]) return NULL; 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, bool SMDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * element,
const SMDS_MeshNode * nodes[], const SMDS_MeshNode * nodes[],
const smIdType nbnodes) const int nbnodes)
{ {
// keep current nodes of element // keep current nodes of element
std::set<const SMDS_MeshNode*> oldNodes( element->begin_nodes(), element->end_nodes() ); std::set<const SMDS_MeshNode*> 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, void SMDS_Mesh::updateInverseElements( const SMDS_MeshElement * element,
const SMDS_MeshNode* const* nodes, const SMDS_MeshNode* const* nodes,
const smIdType nbnodes, const int nbnodes,
std::set<const SMDS_MeshNode*>& oldNodes ) std::set<const SMDS_MeshNode*>& oldNodes )
{ {
if ( GetGrid()->HasLinks() ) // update InverseElements if ( GetGrid()->HasLinks() ) // update InverseElements
@ -1116,7 +1116,7 @@ void SMDS_Mesh::updateInverseElements( const SMDS_MeshElement * element,
std::set<const SMDS_MeshNode*>::iterator it; std::set<const SMDS_MeshNode*>::iterator it;
// AddInverseElement to new nodes // AddInverseElement to new nodes
for ( smIdType i = 0; i < nbnodes; i++ ) for ( int i = 0; i < nbnodes; i++ )
{ {
it = oldNodes.find( nodes[i] ); it = oldNodes.find( nodes[i] );
if ( it == oldNodes.end() ) if ( it == oldNodes.end() )
@ -1459,7 +1459,7 @@ int SMDS_Mesh::GetElementsByNodes(const std::vector<const SMDS_MeshNode *>& node
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of nodes /// Return the number of nodes
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::NbNodes() const int SMDS_Mesh::NbNodes() const
{ {
return myInfo.NbNodes(); return myInfo.NbNodes();
} }
@ -1467,14 +1467,14 @@ smIdType SMDS_Mesh::NbNodes() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of elements /// Return the number of elements
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::NbElements() const int SMDS_Mesh::NbElements() const
{ {
return myInfo.NbElements(); return myInfo.NbElements();
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements /// Return the number of 0D elements
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::Nb0DElements() const int SMDS_Mesh::Nb0DElements() const
{ {
return myInfo.Nb0DElements(); return myInfo.Nb0DElements();
} }
@ -1482,7 +1482,7 @@ smIdType SMDS_Mesh::Nb0DElements() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements /// Return the number of 0D elements
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::NbBalls() const int SMDS_Mesh::NbBalls() const
{ {
return myInfo.NbBalls(); return myInfo.NbBalls();
} }
@ -1490,7 +1490,7 @@ smIdType SMDS_Mesh::NbBalls() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of edges (including construction edges) /// Return the number of edges (including construction edges)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::NbEdges() const int SMDS_Mesh::NbEdges() const
{ {
return myInfo.NbEdges(); return myInfo.NbEdges();
} }
@ -1498,7 +1498,7 @@ smIdType SMDS_Mesh::NbEdges() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of faces (including construction faces) /// Return the number of faces (including construction faces)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::NbFaces() const int SMDS_Mesh::NbFaces() const
{ {
return myInfo.NbFaces(); return myInfo.NbFaces();
} }
@ -1506,7 +1506,7 @@ smIdType SMDS_Mesh::NbFaces() const
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Return the number of volumes /// Return the number of volumes
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
smIdType SMDS_Mesh::NbVolumes() const int SMDS_Mesh::NbVolumes() const
{ {
return myInfo.NbVolumes(); return myInfo.NbVolumes();
} }
@ -1515,7 +1515,7 @@ smIdType SMDS_Mesh::NbVolumes() const
/// Return the number of child mesh of this mesh. /// Return the number of child mesh of this mesh.
/// Note that the tree structure of SMDS_Mesh is unused in SMESH /// 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(); return myChildren.size();
} }
@ -1589,7 +1589,7 @@ SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const
SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) 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 ), return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ),
nbElems); nbElems);
} }
@ -1600,7 +1600,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) c
{ {
return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter ); 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<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ), return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ),
nbElems); nbElems);
} }
@ -1620,7 +1620,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter ); return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter );
default: 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 ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ),
nbElems); nbElems);
} }
@ -1634,7 +1634,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
{ {
typedef SMDS_EdgeIterator TIterator; 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 ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ),
nbElems); nbElems);
} }
@ -1646,7 +1646,7 @@ SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
{ {
typedef SMDS_FaceIterator TIterator; 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 ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ),
nbElems); nbElems);
} }
@ -1658,7 +1658,7 @@ SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const
{ {
typedef SMDS_VolumeIterator TIterator; typedef SMDS_VolumeIterator TIterator;
smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
return return
myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ), myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ),
nbElems ); nbElems );
@ -1705,7 +1705,7 @@ intersectionOfSets( std::set<const SMDS_MeshElement*> vs[], int numberOfSets )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
static std::set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element) static std::set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element)
{ {
smIdType numberOfSets=element->NbNodes(); int numberOfSets=element->NbNodes();
std::set<const SMDS_MeshElement*> *initSet = new std::set<const SMDS_MeshElement*>[numberOfSets]; std::set<const SMDS_MeshElement*> *initSet = new std::set<const SMDS_MeshElement*>[numberOfSets];
SMDS_NodeIteratorPtr itNodes = element->nodeIterator(); SMDS_NodeIteratorPtr itNodes = element->nodeIterator();
@ -2981,8 +2981,8 @@ void SMDS_Mesh::CompactMesh()
myCellFactory->Compact( idCellsNewToOld ); myCellFactory->Compact( idCellsNewToOld );
// make VTK IDs correspond to SMDS IDs // make VTK IDs correspond to SMDS IDs
smIdType newNodeSize = myNodeFactory->NbUsedElements(); int newNodeSize = myNodeFactory->NbUsedElements();
smIdType newCellSize = myCellFactory->NbUsedElements(); int newCellSize = myCellFactory->NbUsedElements();
myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize ); myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize );
if ( idsChange && !myElemHolders.empty() ) if ( idsChange && !myElemHolders.empty() )

View File

@ -613,7 +613,7 @@ public:
bool ChangeElementNodes(const SMDS_MeshElement * elem, bool ChangeElementNodes(const SMDS_MeshElement * elem,
const SMDS_MeshNode * nodes[], const SMDS_MeshNode * nodes[],
const smIdType nbnodes); const int nbnodes);
bool ChangePolyhedronNodes(const SMDS_MeshElement * elem, bool ChangePolyhedronNodes(const SMDS_MeshElement * elem,
const std::vector<const SMDS_MeshNode*>& nodes, const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities); const std::vector<int>& quantities);
@ -689,14 +689,14 @@ public:
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; } const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
virtual smIdType NbNodes() const; virtual int NbNodes() const;
virtual smIdType NbElements() const; virtual int NbElements() const;
virtual smIdType Nb0DElements() const; virtual int Nb0DElements() const;
virtual smIdType NbBalls() const; virtual int NbBalls() const;
virtual smIdType NbEdges() const; virtual int NbEdges() const;
virtual smIdType NbFaces() const; virtual int NbFaces() const;
virtual smIdType NbVolumes() const; virtual int NbVolumes() const;
virtual smIdType NbSubMesh() const; virtual int NbSubMesh() const;
virtual ~SMDS_Mesh(); virtual ~SMDS_Mesh();
@ -731,7 +731,7 @@ public:
void updateInverseElements( const SMDS_MeshElement * element, void updateInverseElements( const SMDS_MeshElement * element,
const SMDS_MeshNode* const* nodes, const SMDS_MeshNode* const* nodes,
const smIdType nbnodes, const int nbnodes,
std::set<const SMDS_MeshNode*>& oldNodes ); std::set<const SMDS_MeshNode*>& oldNodes );
void setNbShapes( size_t nbShapes ); void setNbShapes( size_t nbShapes );

View File

@ -100,6 +100,8 @@
#include "SMESH_TryCatch.hxx" // include after OCCT headers! #include "SMESH_TryCatch.hxx" // include after OCCT headers!
#include <smIdType.hxx>
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem ) #define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
using namespace std; using namespace std;
@ -3122,7 +3124,7 @@ public:
long GetLinkID (const SMDS_MeshNode * n1, long GetLinkID (const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2) const const SMDS_MeshNode * n2) const
{ {
return ( Min(n1->GetID(),n2->GetID()) * myMaxID + Max(n1->GetID(),n2->GetID())); return ( Min(FromIdType<int>(n1->GetID()),FromIdType<int>(n2->GetID())) * myMaxID + Max(FromIdType<int>(n1->GetID()),FromIdType<int>(n2->GetID())));
} }
bool GetNodes (const long theLinkID, bool GetNodes (const long theLinkID,

View File

@ -33,6 +33,7 @@
#include "SALOME_LifeCycleCORBA.hxx" #include "SALOME_LifeCycleCORBA.hxx"
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include <smIdType.hxx>
#include CORBA_SERVER_HEADER(SALOME_Component) #include CORBA_SERVER_HEADER(SALOME_Component)
#include CORBA_SERVER_HEADER(SALOME_Exception) #include CORBA_SERVER_HEADER(SALOME_Exception)
@ -231,10 +232,10 @@ namespace
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
int aFaceId = anIndexes[anIndexId++]; smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++];
std::vector<int> nodes_ids (aNbNodes); std::vector<smIdType> nodes_ids (aNbNodes);
for (int i = 0; i < aNbNodes; i++) { for (int i = 0; i < aNbNodes; i++) {
nodes_ids[i] = anIndexes[anIndexId++]; nodes_ids[i] = anIndexes[anIndexId++];
} }
@ -258,10 +259,10 @@ namespace
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
int aFaceId = anIndexes[anIndexId++]; smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++];
std::vector<int> nodes_ids (aNbNodes); std::vector<smIdType> nodes_ids (aNbNodes);
for (int i = 0; i < aNbNodes; i++) { for (int i = 0; i < aNbNodes; i++) {
nodes_ids[i] = anIndexes[anIndexId++]; nodes_ids[i] = anIndexes[anIndexId++];
} }
@ -414,10 +415,10 @@ namespace
CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
int aFaceId = anIndexes[anIndexId++]; smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++];
std::vector<int> nodes_ids (aNbNodes); std::vector<smIdType> nodes_ids (aNbNodes);
for (int i = 0; i < aNbNodes; i++) { for (int i = 0; i < aNbNodes; i++) {
nodes_ids[i] = anIndexes[anIndexId++]; nodes_ids[i] = anIndexes[anIndexId++];
} }

View File

@ -277,8 +277,8 @@ void SMESHDS_Command::AddVolume(int NewVolID,
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddPolygonalFace (const int ElementID, void SMESHDS_Command::AddPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids) const std::vector<smIdType>& nodes_ids)
{ {
if ( myType != SMESHDS_AddPolygon) { if ( myType != SMESHDS_AddPolygon) {
MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type"); MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type");
@ -299,8 +299,8 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID,
//function : AddQuadPolygonalFace //function : AddQuadPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, void SMESHDS_Command::AddQuadPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids) const std::vector<smIdType>& nodes_ids)
{ {
if ( myType != SMESHDS_AddQuadPolygon) { if ( myType != SMESHDS_AddQuadPolygon) {
MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type"); MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type");
@ -321,8 +321,8 @@ void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID,
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, void SMESHDS_Command::AddPolyhedralVolume (const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities) const std::vector<int>& quantities)
{ {
if ( myType != SMESHDS_AddPolyhedron) { if ( myType != SMESHDS_AddPolyhedron) {

View File

@ -30,6 +30,7 @@
#include "SMESH_SMESHDS.hxx" #include "SMESH_SMESHDS.hxx"
#include "SMESHDS_CommandType.hxx" #include "SMESHDS_CommandType.hxx"
#include <smIdType.hxx>
#include <list> #include <list>
#include <vector> #include <vector>
@ -55,12 +56,12 @@ class SMESHDS_EXPORT SMESHDS_Command
void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
int idnode9, int idnode10, int idnode11, int idnode12); int idnode9, int idnode10, int idnode11, int idnode12);
void AddPolygonalFace (const int ElementID, void AddPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddQuadPolygonalFace (const int ElementID, void AddQuadPolygonalFace (const smIdType ElementID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddPolyhedralVolume (const int ElementID, void AddPolyhedralVolume (const smIdType ElementID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void AddBall(int NewBallID, int node, double diameter); void AddBall(int NewBallID, int node, double diameter);
// special methods for quadratic elements // special methods for quadratic elements

View File

@ -790,7 +790,7 @@ SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector<const SMDS_MeshNode*>& nod
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType>& nodes_ids, SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType>& nodes_ids,
const std::vector<smIdType>& quantities, const std::vector<int>& quantities,
const smIdType ID) const smIdType ID)
{ {
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID); SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID);

View File

@ -246,7 +246,7 @@ void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnod
//function : AddPolygonalFace //function : AddPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector<int>& nodes_ids) void SMESHDS_Script::AddPolygonalFace (smIdType NewFaceID, const std::vector<smIdType>& nodes_ids)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -259,7 +259,7 @@ void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector<int>& no
//function : AddQuadPolygonalFace //function : AddQuadPolygonalFace
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector<int>& nodes_ids) void SMESHDS_Script::AddQuadPolygonalFace(smIdType NewFaceID, const std::vector<smIdType>& nodes_ids)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){
myIsModified = true; myIsModified = true;
@ -272,8 +272,8 @@ void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector<int>&
//function : AddPolyhedralVolume //function : AddPolyhedralVolume
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMESHDS_Script::AddPolyhedralVolume (int NewID, void SMESHDS_Script::AddPolyhedralVolume (smIdType NewID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities) const std::vector<int>& quantities)
{ {
if(myIsEmbeddedMode){ if(myIsEmbeddedMode){

View File

@ -31,6 +31,8 @@
#include "SMESHDS_Command.hxx" #include "SMESHDS_Command.hxx"
#include <smIdType.hxx>
#include <list> #include <list>
#include <vector> #include <vector>
@ -62,12 +64,12 @@ class SMESHDS_EXPORT SMESHDS_Script
int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, int idnode4, int idnode5, int idnode6, int idnode7, int idnode8,
int idnode9, int idnode10, int idnode11, int idnode12); int idnode9, int idnode10, int idnode11, int idnode12);
void AddPolygonalFace (const int NewFaceID, void AddPolygonalFace (const smIdType NewFaceID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddQuadPolygonalFace (const int NewFaceID, void AddQuadPolygonalFace (const smIdType NewFaceID,
const std::vector<int>& nodes_ids); const std::vector<smIdType>& nodes_ids);
void AddPolyhedralVolume (const int NewVolID, void AddPolyhedralVolume (const smIdType NewVolID,
const std::vector<int>& nodes_ids, const std::vector<smIdType>& nodes_ids,
const std::vector<int>& quantities); const std::vector<int>& quantities);
void AddBall(int NewBallID, int node, double diameter); void AddBall(int NewBallID, int node, double diameter);

View File

@ -277,7 +277,7 @@ namespace
static Standard_Integer HashCode(const CutFace& f, const Standard_Integer upper) 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 ) static Standard_Boolean IsEqual(const CutFace& f1, const CutFace& f2 )
{ {

View File

@ -32,6 +32,8 @@
#include "SMDS_SetIterator.hxx" #include "SMDS_SetIterator.hxx"
#include "SMDS_MeshNode.hxx" #include "SMDS_MeshNode.hxx"
#include <smIdType.hxx>
#include <gp_XYZ.hxx> #include <gp_XYZ.hxx>
#include <gp_XY.hxx> #include <gp_XY.hxx>
@ -154,7 +156,7 @@ struct SMESH_TLink: public NLink
// methods for usage of SMESH_TLink as a hasher in NCollection maps // methods for usage of SMESH_TLink as a hasher in NCollection maps
static int HashCode(const SMESH_TLink& link, int aLimit) static int HashCode(const SMESH_TLink& link, int aLimit)
{ {
return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit ); return ::HashCode( FromIdType<int>(link.node1()->GetID() + link.node2()->GetID()), aLimit );
} }
static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2) 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) static Standard_Integer HashCode(const SMDS_MeshElement* e, const Standard_Integer upper)
{ {
return ::HashCode( e->GetID(), upper ); return ::HashCode( FromIdType<int>(e->GetID()), upper );
} }
static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 ) static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 )
{ {

View File

@ -28,6 +28,7 @@
#include "SMESHDS_Mesh.hxx" #include "SMESHDS_Mesh.hxx"
#include "SMESH_TypeDefs.hxx" #include "SMESH_TypeDefs.hxx"
#include <smIdType.hxx>
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Mesh)
@ -59,10 +60,10 @@ public:
virtual const SMDS_MeshElement *FindElement(int IDelem) const; virtual const SMDS_MeshElement *FindElement(int IDelem) const;
virtual bool HasNumerationHoles(); virtual bool HasNumerationHoles();
virtual int MaxNodeID() const; virtual smIdType MaxNodeID() const;
virtual int MinNodeID() const; virtual smIdType MinNodeID() const;
virtual int MaxElementID() const; virtual smIdType MaxElementID() const;
virtual int MinElementID() const; virtual smIdType MinElementID() const;
private: private:
TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ]; TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ];

View File

@ -7057,19 +7057,19 @@ bool SMESH_MeshPartDS::HasNumerationHoles()
MaxElementID() != NbElements() ); MaxElementID() != NbElements() );
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
int SMESH_MeshPartDS::MaxNodeID() const smIdType SMESH_MeshPartDS::MaxNodeID() const
{ {
if ( _meshDS ) return _meshDS->MaxNodeID(); if ( _meshDS ) return _meshDS->MaxNodeID();
return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID();
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
int SMESH_MeshPartDS::MinNodeID() const smIdType SMESH_MeshPartDS::MinNodeID() const
{ {
if ( _meshDS ) return _meshDS->MinNodeID(); if ( _meshDS ) return _meshDS->MinNodeID();
return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID();
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
int SMESH_MeshPartDS::MaxElementID() const smIdType SMESH_MeshPartDS::MaxElementID() const
{ {
if ( _meshDS ) return _meshDS->MaxElementID(); if ( _meshDS ) return _meshDS->MaxElementID();
int maxID = 0; int maxID = 0;
@ -7079,7 +7079,7 @@ int SMESH_MeshPartDS::MaxElementID() const
return maxID; return maxID;
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
int SMESH_MeshPartDS::MinElementID() const smIdType SMESH_MeshPartDS::MinElementID() const
{ {
if ( _meshDS ) return _meshDS->MinElementID(); if ( _meshDS ) return _meshDS->MinElementID();
int minID = 0; int minID = 0;