SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType();
if ( myType == aGrpElType || (myType == SMDSAbs_All && aGrpElType != SMDSAbs_Node) ) {
// add elements IDS into control
- int aSize = aGrp->Extent();
- for (int i = 0; i < aSize; i++)
+ smIdType aSize = aGrp->Extent();
+ for (smIdType i = 0; i < aSize; i++)
myIDs.insert( aGrp->GetID(i+1) );
}
}
SMDSAbs_ElementType ConnectedElements::GetType() const
{ return myType; }
-int ConnectedElements::GetNode() const
+smIdType ConnectedElements::GetNode() const
{ return myXYZ.empty() ? myNodeID : 0; } // myNodeID can be found by myXYZ
std::vector<double> ConnectedElements::GetPoint() const
}
}
-void ConnectedElements::SetNode( int nodeID )
+void ConnectedElements::SetNode( smIdType nodeID )
{
myNodeID = nodeID;
myXYZ.clear();
{
theResStr.Clear();
- TColStd_SequenceOfInteger anIntSeq;
+ TIDsSeq anIntSeq;
TColStd_SequenceOfAsciiString aStrSeq;
TIDsMap::Iterator anIter( myIds );
for ( ; anIter.More(); anIter.Next() )
{
- int anId = anIter.Key();
- TCollection_AsciiString aStr( anId );
+ smIdType anId = anIter.Key();
+ TCollection_AsciiString aStr( FromIdType<int>(anId) );
anIntSeq.Append( anId );
aStrSeq.Append( aStr );
}
if ( aMinId != IntegerFirst() )
aStr << aMinId;
- aStr += "-";
+ aStr << "-";
if ( aMaxId != std::numeric_limits<smIdType>::max() )
aStr << aMaxId;
class gp_Pnt;
typedef NCollection_Map< smIdType, smIdHasher > TIDsMap;
+typedef NCollection_Sequence<smIdType> TIDsSeq;
namespace SMESH{
namespace Controls{
public:
ConnectedElements();
//virtual Predicate* clone() const { return new ConnectedElements( *this ); }
- void SetNode( int nodeID );
+ void SetNode( smIdType nodeID );
void SetPoint( double x, double y, double z );
- int GetNode() const;
+ smIdType GetNode() const;
std::vector<double> GetPoint() const;
void SetType( SMDSAbs_ElementType theType );
virtual SMDSAbs_ElementType GetType() const;
virtual void SetMesh( const SMDS_Mesh* theMesh );
- virtual bool IsSatisfy( long theElementId );
+ virtual bool IsSatisfy( smIdType theElementId );
//const std::set<long>& GetDomainIDs() const { return myOkIDs; }
struct TZoneData
{
int _id;
- int _nodeIdShift; // nb nodes in previously read zones
- int _elemIdShift; // nb faces in previously read zones
- int _nbNodes, _nbElems;
+ smIdType _nodeIdShift; // nb nodes in previously read zones
+ smIdType _elemIdShift; // nb faces in previously read zones
+ smIdType _nbNodes, _nbElems;
int _meshDim;
int _sizeX, _sizeY, _sizeZ, _nbCells; // structured
cgsize_t _sizes[NB_ZONE_SIZE_VAL];
case 2: addElemFun = & add_QUAD_4; break;
case 3: addElemFun = & add_HEXA_8; break;
}
- int elemID = meshInfo.NbElements();
+ smIdType elemID = meshInfo.NbElements();
const SMDS_MeshElement* elem = 0;
for ( size_t i = 0; i < ids.size(); i += nbElemNodes )
{
*/
struct TPolyhedFace
{
- int _id; // id of NGON_n
- vector< int > _nodes; // lowest node IDs used for sorting
+ smIdType _id; // id of NGON_n
+ vector< smIdType > _nodes; // lowest node IDs used for sorting
- TPolyhedFace( const SMDS_MeshNode** nodes, const int nbNodes, int ID):_id(ID)
+ TPolyhedFace( const SMDS_MeshNode** nodes, const smIdType nbNodes, smIdType ID):_id(ID)
{
- set< int > ids;
- for ( int i = 0; i < nbNodes; ++i )
+ set< smIdType > ids;
+ for ( smIdType i = 0; i < nbNodes; ++i )
ids.insert( nodes[i]->GetID() );
_nodes.resize( 3 ); // std::min( nbNodes, 4 )); hope 3 nodes is enough
- set< int >::iterator idIt = ids.begin();
+ set< smIdType >::iterator idIt = ids.begin();
for ( size_t j = 0; j < _nodes.size(); ++j, ++idIt )
_nodes[j] = *idIt;
}
// create a Zone
// --------------
- int nbCells = myMesh->NbEdges();
+ smIdType nbCells = myMesh->NbEdges();
if ( meshDim == 3 )
nbCells = myMesh->NbVolumes();
else if ( meshDim == 2 )
Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
- int nbNodes, nbCells;
+ smIdType nbNodes, nbCells;
#if defined(WIN32) && defined(UNICODE)
std::wstring file2Read = Kernel_Utils::utf8_decode_s(myFile);
FILE* aFileId = _wfopen(file2Read.c_str(), L"w+");
nbNodes = myMesh->NbNodes();
/* Combien de mailles, faces ou aretes ? */
- int nb_of_edges, nb_of_faces, nb_of_volumes;
+ smIdType nb_of_edges, nb_of_faces, nb_of_volumes;
nb_of_edges = myMesh->NbEdges();
nb_of_faces = myMesh->NbFaces();
nb_of_volumes = myMesh->NbVolumes();
for ( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- int nodeID = it->next()->GetID();
+ smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID );
for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- int nodeID = it->next()->GetID();
+ smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID );
for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); )
{
- int nodeID = it->next()->GetID();
+ smIdType nodeID = it->next()->GetID();
if ( !nodeNumByID.empty() )
nodeID = nodeNumByID[ nodeID ];
fprintf(aFileId, "%d ", nodeID );
const SMDS_MeshNode* GetNode(){
return myCurrentNode;
}
- MED::TIntVector::value_type GetID(){
+ MED::TIDVector::value_type GetID(){
return myCurrentNode->GetID();
}
MED::TFloatVector::value_type GetCoord(TInt theCoodId){
#include <map>
#include <med.h>
+#include <smIdType.hxx>
#ifdef WIN32
#pragma warning(disable:4099)
typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable;
typedef TVector<TInt> TIntVector;
+ typedef TVector<smIdType> TIDVector;
typedef TVector<TFloat> TFloatVector;
typedef TVector<std::string> TStringVector;
typedef std::set<std::string> TStringSet;
namespace
{
- struct NLink : public std::pair<int,int>
+ struct NLink : public std::pair<smIdType,smIdType>
{
int myOri;
NLink(const SMDS_MeshNode* n1=0, const SMDS_MeshNode* n2=0, int ori=1 )
int nbPoints = 0;
for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
- int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
+ smIdType nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
if(_quadraticMesh)
nb = nb/2;
nbPoints += nb + 1; // internal points plus 1 vertex of 2 (last point ?)
if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
return;
- int nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+ smIdType nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648)
{
_callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true );
HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty
GetMeshDS()->Modified();
- int newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
+ smIdType newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() );
if ( hyp && _callUp )
_callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities );
}
*/
//================================================================================
-int SMESH_Mesh::NbNodes() const
+smIdType SMESH_Mesh::NbNodes() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbNodes();
*/
//================================================================================
-int SMESH_Mesh::Nb0DElements() const
+smIdType SMESH_Mesh::Nb0DElements() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().Nb0DElements();
*/
//================================================================================
-int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbEdges(order);
*/
//================================================================================
-int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbFaces(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbBiQuadTriangles() const
+smIdType SMESH_Mesh::NbBiQuadTriangles() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadTriangles();
*/
//================================================================================
-int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadrangles(order);
*/
//================================================================================
-int SMESH_Mesh::NbBiQuadQuadrangles() const
+smIdType SMESH_Mesh::NbBiQuadQuadrangles() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles();
*/
//================================================================================
-int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolygons(order);
*/
//================================================================================
-int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbVolumes(order);
*/
//================================================================================
-int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTetras(order);
*/
//================================================================================
-int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexas(order);
*/
//================================================================================
-int SMESH_Mesh::NbTriQuadraticHexas() const
+smIdType SMESH_Mesh::NbTriQuadraticHexas() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbTriQuadHexas();
*/
//================================================================================
-int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPyramids(order);
*/
//================================================================================
-int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
+smIdType SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPrisms(order);
}
-int SMESH_Mesh::NbQuadPrisms() const
+smIdType SMESH_Mesh::NbQuadPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbQuadPrisms();
}
-int SMESH_Mesh::NbBiQuadPrisms() const
+smIdType SMESH_Mesh::NbBiQuadPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBiQuadPrisms();
*/
//================================================================================
-int SMESH_Mesh::NbHexagonalPrisms() const
+smIdType SMESH_Mesh::NbHexagonalPrisms() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbHexPrisms();
*/
//================================================================================
-int SMESH_Mesh::NbPolyhedrons() const
+smIdType SMESH_Mesh::NbPolyhedrons() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbPolyhedrons();
*/
//================================================================================
-int SMESH_Mesh::NbBalls() const
+smIdType SMESH_Mesh::NbBalls() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->GetMeshInfo().NbBalls();
*/
//================================================================================
-int SMESH_Mesh::NbSubMesh() const
+smIdType SMESH_Mesh::NbSubMesh() const
{
Unexpect aCatch(SalomeException);
return _myMeshDS->NbSubMesh();
double GetComputeProgress() const;
- int NbNodes() const;
- int Nb0DElements() const;
- int NbBalls() const;
+ smIdType NbNodes() const;
+ smIdType Nb0DElements() const;
+ smIdType NbBalls() const;
- int NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbBiQuadQuadrangles() const;
- int NbBiQuadTriangles() const;
- int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbBiQuadQuadrangles() const;
+ smIdType NbBiQuadTriangles() const;
+ smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbTriQuadraticHexas() const;
- int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
- int NbQuadPrisms() const;
- int NbBiQuadPrisms() const;
- int NbHexagonalPrisms() const;
- int NbPolyhedrons() const;
+ smIdType NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbTriQuadraticHexas() const;
+ smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
+ smIdType NbQuadPrisms() const;
+ smIdType NbBiQuadPrisms() const;
+ smIdType NbHexagonalPrisms() const;
+ smIdType NbPolyhedrons() const;
- int NbSubMesh() const;
+ smIdType NbSubMesh() const;
int NbGroup() const { return _mapGroup.size(); }
SMDS_MeshElement* e = 0;
int nbnode = node.size();
SMESHDS_Mesh* mesh = GetMeshDS();
- const int ID = features.myID;
+ const smIdType ID = features.myID;
switch ( features.myType ) {
case SMDSAbs_Face:
}
// get elem data needed to re-create it
//
- const int id = elem->GetID();
+ const smIdType id = elem->GetID();
const int nbNodes = elem->NbCornerNodes();
nodes.assign(elem->begin_nodes(), elem->end_nodes());
if ( aGeomType == SMDSEntity_Polyhedra )
SMESH_MesherHelper helper( *theMesh );
helper.SetSubShape( theFace );
- int nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() );
- int nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() );
+ smIdType nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() );
+ smIdType nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() );
if ( nbElems == 0 && aMeshDS->NbFaces() == 0 )
{
MESSAGE( "No elements bound to the face");
return setErrorCode( ERR_LOADV_BAD_SHAPE );
// count nodes
- int nbNodes = 0, shapeID;
+ smIdType nbNodes = 0, shapeID;
for ( shapeID = 1; shapeID <= myShapeIDMap.Extent(); shapeID++ )
{
const TopoDS_Shape& S = myShapeIDMap( shapeID );
*/
//================================================================================
-int SMESH_ProxyMesh::NbFaces() const
+smIdType SMESH_ProxyMesh::NbFaces() const
{
- int nb = 0;
+ smIdType nb = 0;
if ( _mesh->HasShapeToMesh() )
{
TopTools_IndexedMapOfShape FF;
SMDS_ElemIteratorPtr GetFaces(const TopoDS_Shape& face) const;
// Return total nb of faces taking into account substitutions
- int NbFaces() const;
+ smIdType NbFaces() const;
bool IsTemporary(const SMDS_MeshElement* elem ) const;
if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS())
{
SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS();
- int nbElems = subMeshDS->NbElements();
+ smIdType nbElems = subMeshDS->NbElements();
if ( nbElems > 0 )
for ( SMDS_ElemIteratorPtr ite = subMeshDS->GetElements(); ite->more(); )
meshDS->RemoveFreeElement( ite->next(), subMeshDS );
- int nbNodes = subMeshDS->NbNodes();
+ smIdType nbNodes = subMeshDS->NbNodes();
if ( nbNodes > 0 )
for ( SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); itn->more() ; )
{