// ...
// NfacesM, Face1M, Face2M, ... FaceNM
const int nbFaces = elemData[ pos++ ];
- vector<int> quantities( nbFaces );
+ vector<smIdType> quantities( nbFaces );
vector<const SMDS_MeshNode*> nodes, faceNodes;
nodes.reserve( nbFaces * 4 );
for ( int iF = 0; iF < nbFaces; ++iF )
if (( v = myMesh->DownCast< SMDS_MeshVolume >( elem )))
{
- std::vector<int> quant = v->GetQuantities();
+ std::vector<smIdType> quant = v->GetQuantities();
if ( !quant.empty() )
{
fprintf(aFileId, "%d %d ", (int)quant.size(), quant[0]);
for(TInt iElem = 0; iElem < aNbElem; iElem++){
MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
TInt aNbFaces = aConnSliceArr.size();
- typedef MED::TVector<int> TQuantities;
+ typedef MED::TVector<smIdType> TQuantities;
TQuantities aQuantities(aNbFaces);
TInt aNbNodes = aPolyedreInfo->GetNbNodes(iElem);
TNodeIds aNodeIds(aNbNodes);
// in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew:
// theVtkIDsOldToNew[ old VtkID ] = new VtkID
- int oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints();
- int newNbNodes = NbUsedElements();
- int newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize );
+ smIdType oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints();
+ smIdType newNbNodes = NbUsedElements();
+ smIdType newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize );
smIdType maxNodeID = GetMaxID();
theVtkIDsOldToNew.resize( oldNbNodes, -1 );
const SMDS_MeshElement* FindElement( const smIdType id ) const;
//! Return a number of used elements
- int NbUsedElements() const { return myNbUsedElements; }
+ smIdType 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
///////////////////////////////////////////////////////////////////////////////
SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType> & nodes_ids,
- const std::vector<int> & quantities,
+ const std::vector<smIdType> & quantities,
const smIdType ID)
{
int nbNodes = nodes_ids.size();
SMDS_MeshVolume*
SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int> & quantities,
+ const std::vector<smIdType> & quantities,
const smIdType ID)
{
if ( nodes.empty() || quantities.empty() )
SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*> & nodes,
- const std::vector<int> & quantities)
+ const std::vector<smIdType> & quantities)
{
smIdType ID = myCellFactory->GetFreeID();
return SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
///////////////////////////////////////////////////////////////////////////////
/// Return the number of nodes
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::NbNodes() const
+smIdType SMDS_Mesh::NbNodes() const
{
return myInfo.NbNodes();
}
///////////////////////////////////////////////////////////////////////////////
/// Return the number of 0D elements
///////////////////////////////////////////////////////////////////////////////
-int SMDS_Mesh::Nb0DElements() const
+smIdType SMDS_Mesh::Nb0DElements() const
{
return myInfo.Nb0DElements();
}
SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const
{
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ),
nbElems);
}
{
return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter );
}
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ),
nbElems);
}
return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter );
default:
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ),
nbElems);
}
SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
{
typedef SMDS_EdgeIterator TIterator;
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges();
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges();
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ),
nbElems);
}
SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
{
typedef SMDS_FaceIterator TIterator;
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces();
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces();
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ),
nbElems);
}
SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const
{
typedef SMDS_VolumeIterator TIterator;
- int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
+ smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
return
myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ),
nbElems );
myCellFactory->Compact( idCellsNewToOld );
// make VTK IDs correspond to SMDS IDs
- int newNodeSize = myNodeFactory->NbUsedElements();
- int newCellSize = myCellFactory->NbUsedElements();
+ smIdType newNodeSize = myNodeFactory->NbUsedElements();
+ smIdType newCellSize = myCellFactory->NbUsedElements();
myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize );
if ( idsChange && !myElemHolders.empty() )
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<smIdType> & nodes_ids,
- const std::vector<int> & quantities,
+ const std::vector<smIdType> & quantities,
const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*> & nodes,
- const std::vector<int> & quantities,
- const smIdType ID);
+ const std::vector<smIdType> & quantities,
+ const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*> & nodes,
- const std::vector<int> & quantities);
+ const std::vector<smIdType> & quantities);
virtual SMDS_MeshVolume* AddVolumeFromVtkIds(const std::vector<vtkIdType>& vtkNodeIds);
const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; }
- virtual int NbNodes() const;
+ virtual smIdType NbNodes() const;
virtual int NbElements() const;
- virtual int Nb0DElements() const;
+ virtual smIdType Nb0DElements() const;
virtual int NbBalls() const;
virtual int NbEdges() const;
virtual int NbFaces() const;
// init a polyherdon
void SMDS_MeshVolume::init( const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& nbNodesPerFace )
+ const std::vector<smIdType>& nbNodesPerFace )
{
std::vector<vtkIdType> ptIds;
ptIds.reserve( nodes.size() + nbNodesPerFace.size() + 1 );
size_t nbFaces = nbNodesPerFace.size();
for ( size_t iN = 0, iF = 0; iF < nbFaces; iF++ )
{
- int nf = nbNodesPerFace[iF];
+ smIdType nf = nbNodesPerFace[iF];
ptIds.push_back(nf);
- for (int n = 0; n < nf; n++)
+ for (smIdType n = 0; n < nf; n++)
ptIds.push_back( nodes[ iN++ ]->GetVtkID() );
}
return true;
}
-const SMDS_MeshNode* SMDS_MeshVolume::GetNode(const int ind) const
+const SMDS_MeshNode* SMDS_MeshVolume::GetNode(const smIdType ind) const
{
if ( !IsPoly() )
return SMDS_MeshCell::GetNode( ind );
return 0;
}
-std::vector<int> SMDS_MeshVolume::GetQuantities() const
+std::vector<smIdType> SMDS_MeshVolume::GetQuantities() const
{
- std::vector<int> quantities;
+ std::vector<smIdType> quantities;
if ( IsPoly() )
{
vtkIdType nFaces = 0;
vtkIdType const *ptIds(nullptr);
getGrid()->GetFaceStream( GetVtkID(), nFaces, ptIds );
- int id = 0;
- for (int i = 0; i < nFaces; i++)
+ smIdType id = 0;
+ for (smIdType i = 0; i < nFaces; i++)
{
- int nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace]
+ smIdType nodesInFace = ptIds[id]; // nodeIds in ptIds[id+1 .. id+nodesInFace]
quantities.push_back( nodesInFace );
id += (nodesInFace + 1);
}
#include "SMDS_MeshCell.hxx"
+#include <smIdType.hxx>
+
/*!
* \brief Mesh volume. This type is not allocated.
* It is only used as function argument type to provide more clear semantic
class SMDS_EXPORT SMDS_MeshVolume : public SMDS_MeshCell
{
void init( const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& nbNodesPerFace ); // init a polyherdon
+ const std::vector<smIdType>& nbNodesPerFace ); // init a polyherdon
void init( const std::vector<vtkIdType>& vtkNodeIds );
public:
virtual SMDSAbs_ElementType GetType() const { return SMDSAbs_Volume; }
- virtual const SMDS_MeshNode* GetNode(const int ind) const;
+ virtual const SMDS_MeshNode* GetNode(const smIdType ind) const;
virtual int NbNodes() const;
virtual int NbFaces() const;
virtual int NbEdges() const;
// 1 <= node_ind <= NbFaceNodes()
const SMDS_MeshNode* GetFaceNode (const int face_ind, const int node_ind) const;
- std::vector<int> GetQuantities() const;
+ std::vector<smIdType> GetQuantities() const;
static SMDSAbs_ElementType Type() { return SMDSAbs_Volume; }
};
myAllFacesNodeIndices_F = &Tetra_F [0][0];
//myAllFacesNodeIndices_FE = &Tetra_F [0][0];
myAllFacesNodeIndices_RE = &Tetra_RE[0][0];
- myAllFacesNbNodes = Tetra_nbN;
+ myAllFacesNbNodes = (smIdType*)(Tetra_nbN);
myMaxFaceNbNodes = sizeof(Tetra_F[0])/sizeof(Tetra_F[0][0]);
break;
case 5:
myAllFacesNodeIndices_F = &Pyramid_F [0][0];
//myAllFacesNodeIndices_FE = &Pyramid_F [0][0];
myAllFacesNodeIndices_RE = &Pyramid_RE[0][0];
- myAllFacesNbNodes = Pyramid_nbN;
+ myAllFacesNbNodes = (smIdType*)(Pyramid_nbN);
myMaxFaceNbNodes = sizeof(Pyramid_F[0])/sizeof(Pyramid_F[0][0]);
break;
case 6:
myAllFacesNodeIndices_F = &Penta_F [0][0];
//myAllFacesNodeIndices_FE = &Penta_FE[0][0];
myAllFacesNodeIndices_RE = &Penta_RE[0][0];
- myAllFacesNbNodes = Penta_nbN;
+ myAllFacesNbNodes = (smIdType*)(Penta_nbN);
myMaxFaceNbNodes = sizeof(Penta_F[0])/sizeof(Penta_F[0][0]);
break;
case 8:
myAllFacesNodeIndices_F = &Hexa_F [0][0];
///myAllFacesNodeIndices_FE = &Hexa_FE[0][0];
myAllFacesNodeIndices_RE = &Hexa_RE[0][0];
- myAllFacesNbNodes = Hexa_nbN;
+ myAllFacesNbNodes = (smIdType*)(Hexa_nbN);
myMaxFaceNbNodes = sizeof(Hexa_F[0])/sizeof(Hexa_F[0][0]);
break;
case 10:
myAllFacesNodeIndices_F = &QuadTetra_F [0][0];
//myAllFacesNodeIndices_FE = &QuadTetra_F [0][0];
myAllFacesNodeIndices_RE = &QuadTetra_RE[0][0];
- myAllFacesNbNodes = QuadTetra_nbN;
+ myAllFacesNbNodes = (smIdType*)(QuadTetra_nbN);
myMaxFaceNbNodes = sizeof(QuadTetra_F[0])/sizeof(QuadTetra_F[0][0]);
break;
case 13:
myAllFacesNodeIndices_F = &QuadPyram_F [0][0];
//myAllFacesNodeIndices_FE = &QuadPyram_F [0][0];
myAllFacesNodeIndices_RE = &QuadPyram_RE[0][0];
- myAllFacesNbNodes = QuadPyram_nbN;
+ myAllFacesNbNodes = (smIdType*)(QuadPyram_nbN);
myMaxFaceNbNodes = sizeof(QuadPyram_F[0])/sizeof(QuadPyram_F[0][0]);
break;
case 15:
myAllFacesNodeIndices_F = &QuadPenta_F [0][0];
//myAllFacesNodeIndices_FE = &QuadPenta_FE[0][0];
myAllFacesNodeIndices_RE = &QuadPenta_RE[0][0];
- myAllFacesNbNodes = QuadPenta_nbN;
+ myAllFacesNbNodes = (smIdType*)(QuadPenta_nbN);
myMaxFaceNbNodes = sizeof(QuadPenta_F[0])/sizeof(QuadPenta_F[0][0]);
break;
case 20:
myAllFacesNodeIndices_F = &QuadHexa_F [0][0];
//myAllFacesNodeIndices_FE = &QuadHexa_FE[0][0];
myAllFacesNodeIndices_RE = &QuadHexa_RE[0][0];
- myAllFacesNbNodes = QuadHexa_nbN;
+ myAllFacesNbNodes = (smIdType*)(QuadHexa_nbN);
myMaxFaceNbNodes = sizeof(QuadHexa_F[0])/sizeof(QuadHexa_F[0][0]);
if ( !myIgnoreCentralNodes && myVolumeNodes.size() == 27 )
{
myAllFacesNodeIndices_F = &TriQuadHexa_F [0][0];
//myAllFacesNodeIndices_FE = &TriQuadHexa_FE[0][0];
myAllFacesNodeIndices_RE = &TriQuadHexa_RE[0][0];
- myAllFacesNbNodes = TriQuadHexa_nbN;
+ myAllFacesNbNodes = (smIdType*)(TriQuadHexa_nbN);
myMaxFaceNbNodes = sizeof(TriQuadHexa_F[0])/sizeof(TriQuadHexa_F[0][0]);
}
break;
myAllFacesNodeIndices_F = &HexPrism_F [0][0];
//myAllFacesNodeIndices_FE = &HexPrism_FE[0][0];
myAllFacesNodeIndices_RE = &HexPrism_RE[0][0];
- myAllFacesNbNodes = HexPrism_nbN;
+ myAllFacesNbNodes = (smIdType*)(HexPrism_nbN);
myMaxFaceNbNodes = sizeof(HexPrism_F[0])/sizeof(HexPrism_F[0][0]);
break;
default:
#include "SMESH_SMDS.hxx"
+#include <smIdType.hxx>
+
class SMDS_MeshElement;
class SMDS_MeshNode;
class SMDS_MeshVolume;
int myNbFaces;
std::vector<const SMDS_MeshNode*> myVolumeNodes;
std::vector< int > myPolyIndices; // of a myCurFace
- std::vector< int > myPolyQuantities;
+ std::vector<smIdType> myPolyQuantities;
std::vector< int > myPolyFacetOri; // -1-in, +1-out, 0-undef
typedef std::pair<int,int> Link;
mutable const int* myAllFacesNodeIndices_F;
mutable const int* myAllFacesNodeIndices_RE;
- mutable const int* myAllFacesNbNodes;
+ mutable const smIdType* myAllFacesNbNodes;
mutable int myMaxFaceNbNodes;
struct SaveFacet;
:myMesh( theMesh ), myMaxID( theMesh->MaxNodeID() + 1)
{}
- long GetLinkID (const SMDS_MeshNode * n1,
+ smIdType GetLinkID (const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2) const
{
return ( Min(FromIdType<int>(n1->GetID()),FromIdType<int>(n2->GetID())) * myMaxID + Max(FromIdType<int>(n1->GetID()),FromIdType<int>(n2->GetID())));
baseType = SMDSEntity_Polygon; // WARNING: change baseType !!!!
}
vector<const SMDS_MeshNode*> polyedre_nodes (nbNodes*2 + 4*nbNodes);
- vector<int> quantities (nbNodes + 2);
+ vector<smIdType> quantities (nbNodes + 2);
polyedre_nodes.clear();
quantities.clear();
int SMESH_MeshEditor::SimplifyFace (const vector<const SMDS_MeshNode *>& faceNodes,
vector<const SMDS_MeshNode *>& poly_nodes,
- vector<int>& quantities) const
+ vector<smIdType>& quantities) const
{
int nbNodes = faceNodes.size();
while ( faceNodes[ 0 ] == faceNodes[ nbNodes-1 ] && nbNodes > 2 )
// a polygon can divide into several elements
vector<const SMDS_MeshNode *> polygons_nodes;
- vector<int> quantities;
+ vector<smIdType> quantities;
nbResElems = SimplifyFace( curNodes, polygons_nodes, quantities );
newElemDefs.resize( nbResElems );
for ( int inode = 0, iface = 0; iface < nbResElems; iface++ )
int nbFaces = aPolyedre->NbFaces();
vector<const SMDS_MeshNode *>& poly_nodes = newElemDefs[0].myNodes;
- vector<int> & quantities = newElemDefs[0].myPolyhedQuantities;
+ vector<smIdType> & quantities = newElemDefs[0].myPolyhedQuantities;
vector<const SMDS_MeshNode *> faceNodes;
poly_nodes.clear();
quantities.clear();
////////////////// HEXAHEDRON ---> polyhedron
hexa.SetExternalNormal();
vector<const SMDS_MeshNode *>& poly_nodes = newElemDefs[0].myNodes;
- vector<int> & quantities = newElemDefs[0].myPolyhedQuantities;
+ vector<smIdType> & quantities = newElemDefs[0].myPolyhedQuantities;
poly_nodes.reserve( 6 * 4 ); poly_nodes.clear();
quantities.reserve( 6 ); quantities.clear();
for ( int iFace = 0; iFace < 6; iFace++ )
// insert new nodes in all faces of the volume, sharing link theBetweenNode1 - theBetweenNode2
int iface, nbFaces = aVolume.NbFaces();
vector<const SMDS_MeshNode *> poly_nodes;
- vector<int> quantities (nbFaces);
+ vector<smIdType> quantities (nbFaces);
for (iface = 0; iface < nbFaces; iface++) {
int nbFaceNodes = aVolume.NbFaceNodes(iface), nbInserted = 0;
void volumeToPolyhedron( const SMDS_MeshElement* elem,
vector<const SMDS_MeshNode *> & nodes,
- vector<int> & nbNodeInFaces )
+ vector<smIdType> & nbNodeInFaces )
{
nodes.clear();
nbNodeInFaces.clear();
int nbElem = 0;
if( !theSm ) return nbElem;
- vector<int> nbNodeInFaces;
+ vector<smIdType> nbNodeInFaces;
vector<const SMDS_MeshNode *> nodes;
SMDS_ElemIteratorPtr ElemItr = theSm->GetElements();
while(ElemItr->more())
}
// convert volumes
- vector<int> nbNodeInFaces;
+ vector<smIdType> nbNodeInFaces;
SMDS_VolumeIteratorPtr aVolumeItr = meshDS->volumesIterator();
while(aVolumeItr->more())
{
bool myIsPoly, myIsQuad;
int myID;
double myBallDiameter;
- std::vector<int> myPolyhedQuantities;
+ std::vector<smIdType> myPolyhedQuantities;
std::vector<const SMDS_MeshNode*> myNodes; // not managed by ElemFeatures
SMESH_EXPORT ElemFeatures( SMDSAbs_ElementType type=SMDSAbs_All, bool isPoly=false, bool isQuad=false )
SMESH_EXPORT ElemFeatures& Init( double diameter )
{ myType = SMDSAbs_Ball; myBallDiameter = diameter; return *this; }
- SMESH_EXPORT ElemFeatures& Init( std::vector<int>& quanities, bool isQuad=false )
+ SMESH_EXPORT ElemFeatures& Init( std::vector<smIdType>& quanities, bool isQuad=false )
{ myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad;
myPolyhedQuantities.swap( quanities ); return *this; }
- SMESH_EXPORT ElemFeatures& Init( const std::vector<int>& quanities, bool isQuad=false )
+ SMESH_EXPORT ElemFeatures& Init( const std::vector<smIdType>& quanities, bool isQuad=false )
{ myType = SMDSAbs_Volume; myIsPoly = 1; myIsQuad = isQuad;
myPolyhedQuantities = quanities; return *this; }
int SimplifyFace (const std::vector<const SMDS_MeshNode *>& faceNodes,
std::vector<const SMDS_MeshNode *>& poly_nodes,
- std::vector<int>& quantities) const;
+ std::vector<smIdType>& quantities) const;
// Split face, defined by <faceNodes>, into several faces by repeating nodes.
// Is used by MergeNodes()
SMDS_MeshVolume*
SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& quantities,
+ const std::vector<smIdType>& quantities,
const int id,
const bool force3d)
{
else
{
vector<const SMDS_MeshNode*> newNodes;
- vector<int> newQuantities;
+ vector<smIdType> newQuantities;
for ( size_t iFace = 0, iN = 0; iFace < quantities.size(); ++iFace )
{
int nbNodesInFace = quantities[iFace];
* Creates polyhedron. In quadratic mesh, adds medium nodes
*/
SMDS_MeshVolume* AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& quantities,
+ const std::vector<smIdType>& quantities,
const int ID=0,
const bool force3d = true);
/*!
if ( !volTool.Set( elem ) || !avoidSet.insert( elem ).second )
continue; // skip faces or refined elements
// add polyhedron definition
- myPolyhedronQuantities.push_back(vector<int> ());
+ myPolyhedronQuantities.push_back(vector<smIdType> ());
myPolyElemXYZIDs.push_back(TElemDef());
- vector<int>& quantity = myPolyhedronQuantities.back();
+ vector<smIdType>& quantity = myPolyhedronQuantities.back();
TElemDef & elemDef = myPolyElemXYZIDs.back();
// get definitions of new elements on volume faces
bool makePoly = false;
const int theNbBndNodes,
const vector< const SMDS_MeshNode* >& theNodes,
list< int >& theFaceDefs,
- vector<int>& theQuantity)
+ vector<smIdType>& theQuantity)
{
bool makePoly = false;
bool is2d = myIs2D;
list< TElemDef >::const_iterator enIt = theElemNodeIDs.begin();
- list< vector<int> >::iterator quantity = myPolyhedronQuantities.begin();
+ list< vector<smIdType> >::iterator quantity = myPolyhedronQuantities.begin();
for ( int iElem = 0; enIt != theElemNodeIDs.end(); enIt++, iElem++ )
{
const TElemDef & elemNodeInd = *enIt;
#define SMESH_Pattern_HeaderFile
#include "SMESH_SMESH.hxx"
+#include <smIdType.hxx>
#include <vector>
#include <list>
const int theNbBndNodes,
const std::vector< const SMDS_MeshNode* >& theNodes,
std::list< int >& theFaceDefs,
- std::vector<int>& theQuantity);
+ std::vector<smIdType>& theQuantity);
// fill faces definition for a volume face defined by theBndNodes
// return true if a face definition changes
std::vector<const SMDS_MeshElement*> myPolyElems;
// definitions of new poly elements
std::list< TElemDef > myPolyElemXYZIDs;
- std::list< std::vector<int> > myPolyhedronQuantities;
+ std::list< std::vector<smIdType> > myPolyhedronQuantities;
// map a boundary to XYZs on it;
// a boundary (edge or face) is defined as a set of its nodes,
}
int aNbFaces = anIndexes[anIndexId++];
- std::vector<int> quantities (aNbFaces);
+ std::vector<smIdType> quantities (aNbFaces);
for (int i = 0; i < aNbFaces; i++) {
quantities[i] = anIndexes[anIndexId++];
}
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4)
{
if ( myType != SMESHDS_AddTetrahedron)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1, int idnode2, int idnode3, int idnode4, int idnode5)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5)
{
if ( myType != SMESHDS_AddPyramid)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2, int idnode3, int idnode4, int idnode5, int idnode6)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1,
+ smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5, smIdType idnode6)
{
if ( myType != SMESHDS_AddPrism)
{
//function :
//purpose :
//=======================================================================
-void SMESHDS_Command::AddVolume(int NewVolID,
- int idnode1,
- int idnode2,
- int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8)
+void SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1,
+ smIdType idnode2,
+ smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8)
{
if ( myType != SMESHDS_AddHexahedron)
{
myNumber++;
}
-void SMESHDS_Command::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 SMESHDS_Command::AddVolume(smIdType NewVolID,
+ smIdType idnode1,smIdType idnode2,smIdType idnode3,smIdType idnode4,
+ smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12)
{
if (myType != SMESHDS_AddHexagonalPrism)
{
//=======================================================================
void SMESHDS_Command::AddPolyhedralVolume (const smIdType ElementID,
const std::vector<smIdType>& nodes_ids,
- const std::vector<int>& quantities)
+ const std::vector<smIdType>& quantities)
{
if ( myType != SMESHDS_AddPolyhedron) {
MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type");
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
- 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 AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
void AddPolygonalFace (const smIdType ElementID,
const std::vector<smIdType>& nodes_ids);
void AddQuadPolygonalFace (const smIdType ElementID,
const std::vector<smIdType>& nodes_ids);
void AddPolyhedralVolume (const smIdType ElementID,
const std::vector<smIdType>& nodes_ids,
- const std::vector<int>& quantities);
+ const std::vector<smIdType>& quantities);
void AddBall(int NewBallID, int node, double diameter);
// special methods for quadratic elements
void AddEdge(int NewEdgeID, int n1, int n2, int n12);
//purpose :
//=======================================================================
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdType>& nodes_ids,
- const std::vector<int>& quantities,
+ const std::vector<smIdType>& quantities,
const smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID);
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& quantities,
- const smIdType ID)
+ const std::vector<smIdType>& quantities,
+ const smIdType ID)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID);
if (anElem) {
SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& quantities)
+ const std::vector<smIdType>& quantities)
{
SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolume(nodes, quantities);
if (anElem) {
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<smIdType>& nodes_ids,
- const std::vector<int>& quantities,
+ const std::vector<smIdType>& quantities,
const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID
(const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& quantities,
- const smIdType ID);
+ const std::vector<smIdType>& quantities,
+ const smIdType ID);
virtual SMDS_MeshVolume* AddPolyhedralVolume
(const std::vector<const SMDS_MeshNode*>& nodes,
- const std::vector<int>& quantities);
+ const std::vector<smIdType>& quantities);
virtual void MoveNode(const SMDS_MeshNode *, double x, double y, double z);
virtual void RemoveNode(const SMDS_MeshNode *);
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2,
- int idnode3, int idnode4)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2,
+ smIdType idnode3, smIdType idnode4)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2,
- int idnode3, int idnode4, int idnode5)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2,
+ smIdType idnode3, smIdType idnode4, smIdType idnode5)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::AddVolume(int NewID,
- int idnode1, int idnode2, int idnode3, int idnode4,
- int idnode5, int idnode6, int idnode7, int idnode8)
+void SMESHDS_Script::AddVolume(smIdType NewID,
+ smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4,
+ smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8)
{
if(myIsEmbeddedMode){
myIsModified = true;
//function :
//purpose :
//=======================================================================
-void SMESHDS_Script::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 SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12)
{
if(myIsEmbeddedMode){
myIsModified = true;
//=======================================================================
void SMESHDS_Script::AddPolyhedralVolume (smIdType NewID,
const std::vector<smIdType>& nodes_ids,
- const std::vector<int>& quantities)
+ const std::vector<smIdType>& quantities)
{
if(myIsEmbeddedMode){
myIsModified = true;
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3);
void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3,
int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6);
- void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3,
- int idnode4, int idnode5, int idnode6, int idnode7, int idnode8);
- 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 AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8);
+ void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3,
+ smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8,
+ smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12);
void AddPolygonalFace (const smIdType NewFaceID,
const std::vector<smIdType>& nodes_ids);
const std::vector<smIdType>& nodes_ids);
void AddPolyhedralVolume (const smIdType NewVolID,
const std::vector<smIdType>& nodes_ids,
- const std::vector<int>& quantities);
+ const std::vector<smIdType>& quantities);
void AddBall(int NewBallID, int node, double diameter);
// special methods for quadratic elements
static Standard_Integer HashCode(const CutFace& f, const Standard_Integer upper)
{
- return ::HashCode( (int)(f.myInitFace->GetID()), upper );
+ return ::HashCode( FromIdType<int>(f.myInitFace->GetID()), upper );
}
static Standard_Boolean IsEqual(const CutFace& f1, const CutFace& f2 )
{
}
int NbFaces = Quantities.length();
- std::vector<int> q (NbFaces);
+ std::vector<smIdType> q (NbFaces);
for (int j = 0; j < NbFaces; j++)
q[j] = Quantities[j];
int NbFaces = IdsOfFaces.length();
std::vector<const SMDS_MeshNode*> poly_nodes;
- std::vector<int> quantities (NbFaces);
+ std::vector<smIdType> quantities (NbFaces);
for (int i = 0; i < NbFaces; i++) {
const SMDS_MeshElement* aFace = getMeshDS()->FindElement(IdsOfFaces[i]);
};
vector< _nodeDef > _nodes;
- vector< int > _quantities;
+ vector< smIdType > _quantities;
_volumeDef* _next; // to store several _volumeDefs in a chain
TGeomID _solidID;
const SMDS_MeshElement* _volume; // new volume
if ( loopsJoined )
{
// set unchanged polygons
- std::vector< int > newQuantities;
+ std::vector< smIdType > newQuantities;
std::vector< _volumeDef::_nodeDef > newNodes;
vector< SMESH_Block::TShapeID > newNames;
newQuantities.reserve( volDef->_quantities.size() );
//=======================================================================
const SMDS_MeshElement* addHexa( std::vector< const SMDS_MeshElement* >& faces,
- const std::vector< int > & quantities,
+ const std::vector< smIdType > & quantities,
SMESH_MesherHelper & helper )
{
const SMDS_MeshElement* newHexa = 0;
//=======================================================================
const SMDS_MeshElement* addTetra( std::vector< const SMDS_MeshElement* >& faces,
- const std::vector< int > & quantities,
+ const std::vector< smIdType > & quantities,
SMESH_MesherHelper & helper )
{
const SMDS_MeshElement* newTetra = 0;
//=======================================================================
const SMDS_MeshElement* addPenta( std::vector< const SMDS_MeshElement* >& faces,
- const std::vector< int > & quantities,
+ const std::vector< smIdType > & quantities,
SMESH_MesherHelper & helper )
{
const SMDS_MeshElement* newPenta = 0;
//=======================================================================
const SMDS_MeshElement* addPyra( std::vector< const SMDS_MeshElement* >& faces,
- const std::vector< int > & quantities,
+ const std::vector< smIdType > & quantities,
SMESH_MesherHelper & helper )
{
const SMDS_MeshElement* newPyra = 0;
//=======================================================================
const SMDS_MeshElement* addHPrism( std::vector< const SMDS_MeshElement* >& faces,
- const std::vector< int > & quantities,
+ const std::vector< smIdType > & quantities,
SMESH_MesherHelper & helper )
{
const SMDS_MeshElement* newHexPrism = 0;
//=======================================================================
const SMDS_MeshElement* addPoly( std::vector< const SMDS_MeshElement* >& faces,
- const std::vector< int > & quantities,
+ const std::vector< smIdType > & quantities,
SMESH_MesherHelper & helper )
{
const SMDS_MeshElement* newPoly = 0;
for ( size_t i = 0; i < faces.size() && !useMediumNodes ; ++i )
useMediumNodes = faces[ i ]->IsQuadratic();
- std::vector< int > quantities( faces.size() );
+ std::vector< smIdType > quantities( faces.size() );
std::set< const SMDS_MeshNode* > nodes;
for ( size_t i = 0; i < faces.size(); ++i )
{
break;
}
default: // ---------- polyhedra
- vector<int> quantities( 2 + nbNodes, 4 );
+ vector<smIdType> quantities( 2 + nbNodes, 4 );
quantities[0] = quantities[1] = nbNodes;
columns.resize( nbNodes + 1 );
columns[ nbNodes ] = columns[ 0 ];