*
* Can be used to check if the object was created in the same container, as this engine.
*/
- long GetObjectId(in Object theObject);
+ smIdType GetObjectId(in Object theObject);
/*!
* \brief Get version of MED format being used.
theResStr.Clear();
TIDsSeq anIntSeq;
- TColStd_SequenceOfAsciiString aStrSeq;
+ NCollection_Sequence< std::string > aStrSeq;
TIDsMap::Iterator anIter( myIds );
for ( ; anIter.More(); anIter.Next() )
{
smIdType anId = anIter.Key();
- TCollection_AsciiString aStr( FromIdType<int>(anId) );
+ SMESH_Comment aStr( anId );
anIntSeq.Append( anId );
aStrSeq.Append( aStr );
}
if ( aStrSeq.Length() == 0 )
return;
-
- theResStr = aStrSeq( 1 );
+ std::string aResStr;
+ aResStr = aStrSeq( 1 );
for ( int j = 2, k = aStrSeq.Length(); j <= k; j++ )
{
- theResStr += ",";
- theResStr += aStrSeq( j );
+ aResStr += ",";
+ aResStr += aStrSeq( j );
}
+ theResStr = aResStr.c_str();
}
//=======================================================================
elemIt = elementIterator( SMDSGeom ); \
if ( elemIt->more() ) \
{ \
- int totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom ); \
- int nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \
+ smIdType totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom );\
+ smIdType nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \
if ( totalNbElems - nbLinearElems > 0 ) \
{ \
GmfSetKwd(meshID, GmfKwd, totalNbElems - nbLinearElems); \
// nodes
std::map< const SMDS_MeshNode* , int > node2IdMap;
- int iN = 0, nbNodes = myMesh->NbNodes();
+ smIdType iN = 0, nbNodes = myMesh->NbNodes();
GmfSetKwd( meshID, GmfVertices, nbNodes );
double xyz[3];
SMDS_NodeIteratorPtr nodeIt = myMesh->nodesIterator();
return;
}
- int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
+ smIdType aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0;
bool aShowOnlyScalarBarTitle = false;
if(aNbCells) {
//myControlMode = theMode;
void SMESH_ActorDef::SetRepresentation (int theMode)
{
- int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
- int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
- int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
- int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
- int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
+ smIdType aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
+ smIdType aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
+ smIdType aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
+ smIdType aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement);
+ smIdType aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball);
if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls )
{
( aPredicate = dynamic_cast<CoincidentNodes*>(theFunctor.get())))
{
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
+ vtkIdType aNbNodes = FromIdType<vtkIdType>(myVisualObj->GetNbEntities(SMDSAbs_Node));
for( vtkIdType i = 0; i < aNbNodes; i++ ){
vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
if(aPredicate->IsSatisfy(anObjId))
// functions : GetNodeObjId, GetNodeVTKId, GetElemObjId, GetElemVTKId
// purpose : Methods for retrieving VTK IDs by SMDS IDs and vice versa
//=================================================================================
-vtkIdType SMESH_VisualObjDef::GetNodeObjId( int theVTKID )
+vtkIdType SMESH_VisualObjDef::GetNodeObjId( vtkIdType theVTKID )
{
if (myLocalGrid)
{
if( this->GetMesh() )
aNode = this->GetMesh()->FindNodeVtk( theVTKID );
- return aNode ? aNode->GetID() : -1;
+ return aNode ? FromIdType<vtkIdType>(aNode->GetID()) : -1;
}
-vtkIdType SMESH_VisualObjDef::GetNodeVTKId( int theObjID )
+vtkIdType SMESH_VisualObjDef::GetNodeVTKId( vtkIdType theObjID )
{
if (myLocalGrid)
{
return aNode ? aNode->GetVtkID() : -1;
}
-vtkIdType SMESH_VisualObjDef::GetElemObjId( int theVTKID )
+vtkIdType SMESH_VisualObjDef::GetElemObjId( vtkIdType theVTKID )
{
if (myLocalGrid)
{
TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID);
return i == myVTK2SMDSElems.end() ? -1 : i->second;
}
- return this->GetMesh()->FromVtkToSmds(theVTKID);
+ return FromIdType<vtkIdType>(this->GetMesh()->FromVtkToSmds(theVTKID));
}
-vtkIdType SMESH_VisualObjDef::GetElemVTKId( int theObjID )
+vtkIdType SMESH_VisualObjDef::GetElemVTKId( vtkIdType theObjID )
{
if (myLocalGrid)
{
return;
TEntityList aNodes;
- vtkIdType nbNodes = GetEntities( SMDSAbs_Node, aNodes );
+ vtkIdType nbNodes = FromIdType<vtkIdType>(GetEntities( SMDSAbs_Node, aNodes ));
thePoints->SetNumberOfPoints( nbNodes );
int nbPoints = 0;
if ( aNode != 0 )
{
thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() );
- int anId = aNode->GetID();
+ smIdType anId = aNode->GetID();
mySMDS2VTKNodes.insert( mySMDS2VTKNodes.end(), std::make_pair( anId, nbPoints ));
myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId ));
nbPoints++;
const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes,
const TConnect& theConnect,
int thePosition,
- int theId)
+ vtkIdType theId)
{
theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second);
}
{ SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDSAbs_Ball, SMDSAbs_0DElement };
// get entity data
- map<SMDSAbs_ElementType,int> nbEnts;
+ map<SMDSAbs_ElementType,smIdType> nbEnts;
map<SMDSAbs_ElementType,TEntityList> anEnts;
vtkIdType aNbCells = 0;
anIdList->SetNumberOfIds( aNbNodes );
const vtkIdType vtkElemType = SMDS_MeshCell::toVtkType( anElem->GetEntityType() );
- int anId = anElem->GetID();
+ smIdType anId = anElem->GetID();
mySMDS2VTKElems.insert( mySMDS2VTKElems.end(), std::make_pair( anId, iElem ));
myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId ));
anIdList->InsertNextId(ph->NbFaceNodes(i));
for(int j = 1; j <= ph->NbFaceNodes(i); j++) {
if ( const SMDS_MeshNode* n = ph->GetFaceNode( i, j ))
- anIdList->InsertNextId( mySMDS2VTKNodes[ n->GetID() ]);
+ anIdList->InsertNextId( mySMDS2VTKNodes[ FromIdType<vtkIdType>(n->GetID()) ]);
}
}
}
else {
for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
const SMDS_MeshElement* aNode = aNodesIter->next();
- anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
+ anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromIdType<vtkIdType>(aNode->GetID())] );
}
}
}
// function : getNodesFromElems
// purpose : Retrieve nodes from elements
//=================================================================================
-static int getNodesFromElems( SMESH::smIdType_array_var& theElemIds,
+static int getNodesFromElems( SMESH::smIdType_array_var& theElemIds,
const SMDS_Mesh* theMesh,
std::list<const SMDS_MeshElement*>& theResList )
{
*/
//=============================================================================
-int SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W)
+smIdType SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W)
{
- int nbPoints = 0;
+ smIdType nbPoints = 0;
for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) {
const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
smIdType nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes();
*/
static double EdgeLength(const TopoDS_Edge & E);
- int NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W);
+ smIdType NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W);
/*!
* \brief Return continuity of two edges
save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl;
save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl;
if ( NbFaces(order) > 0 ) {
- int nb3 = NbTriangles(order);
- int nb4 = NbQuadrangles(order);
+ smIdType nb3 = NbTriangles(order);
+ smIdType nb4 = NbQuadrangles(order);
save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl;
save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl;
if ( nb3 + nb4 != NbFaces(order) ) {
}
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
if ( NbVolumes(order) > 0 ) {
- int nb8 = NbHexas(order);
- int nb4 = NbTetras(order);
- int nb5 = NbPyramids(order);
- int nb6 = NbPrisms(order);
+ smIdType nb8 = NbHexas(order);
+ smIdType nb4 = NbTetras(order);
+ smIdType nb5 = NbPyramids(order);
+ smIdType nb6 = NbPrisms(order);
save << clause << ".1) Number of " << orderStr << " hexahedrons: \t" << nb8 << endl;
save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl;
save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl;
//purpose : Returns type of mesh element with certain id
//=======================================================================
-SMDSAbs_ElementType SMESH_Mesh::GetElementType( const int id, const bool iselem )
+SMDSAbs_ElementType SMESH_Mesh::GetElementType( const smIdType id, const bool iselem )
{
return _myMeshDS->GetElementType( id, iselem );
}
bool SynchronizeGroups();
- SMDSAbs_ElementType GetElementType( const int id, const bool iselem );
+ SMDSAbs_ElementType GetElementType( const smIdType id, const bool iselem );
void ClearMeshOrder();
void SetMeshOrder(const TListOfListOfInt& theOrder );
//purpose : Creates a node
//=======================================================================
-SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID,
+SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, smIdType ID,
double u, double v)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
//=======================================================================
SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector<const SMDS_MeshNode*>& nodes,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMDS_MeshVolume* elem = 0;
const SMDS_MeshNode* n6,
const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
const SMDS_MeshNode* n10,
const SMDS_MeshNode* n11,
const SMDS_MeshNode* n12,
- const int id,
+ const smIdType id,
bool /*force3d*/)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMDS_MeshVolume*
SMESH_MesherHelper::AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities,
- const int id,
+ const smIdType id,
const bool force3d)
{
SMESHDS_Mesh * meshDS = GetMeshDS();
SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh()
{
- int NbAllEdgsAndFaces=0;
- int NbQuadFacesAndEdgs=0;
- int NbFacesAndEdges=0;
+ smIdType NbAllEdgsAndFaces=0;
+ smIdType NbQuadFacesAndEdgs=0;
+ smIdType NbFacesAndEdges=0;
//All faces and edges
NbAllEdgsAndFaces = myMesh->NbEdges() + myMesh->NbFaces();
if ( NbAllEdgsAndFaces == 0 )
/*!
* Creates a node (!Note ID before u=0.,v0.)
*/
- SMDS_MeshNode* AddNode(double x, double y, double z, int ID = 0, double u=0., double v=0.);
+ SMDS_MeshNode* AddNode(double x, double y, double z, smIdType ID = 0, double u=0., double v=0.);
/*!
* Creates quadratic or linear edge
*/
SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates quadratic or linear triangle
SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1,
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
- const int id=0,
+ const smIdType id=0,
const bool force3d = false);
/*!
* Creates bi-quadratic, quadratic or linear quadrangle
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = false);
/*!
* Creates polygon, with additional nodes in quadratic mesh
*/
SMDS_MeshFace* AddPolygonalFace (const std::vector<const SMDS_MeshNode*>& nodes,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = false);
/*!
* Creates quadratic or linear tetrahedron
const SMDS_MeshNode* n2,
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates quadratic or linear pyramid
const SMDS_MeshNode* n3,
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates quadratic or linear pentahedron
const SMDS_MeshNode* n4,
const SMDS_MeshNode* n5,
const SMDS_MeshNode* n6,
- const int id = 0,
+ const smIdType id = 0,
const bool force3d = true);
/*!
* Creates bi-quadratic, quadratic or linear hexahedron
const SMDS_MeshNode* n6,
const SMDS_MeshNode* n7,
const SMDS_MeshNode* n8,
- const int id = 0,
+ const smIdType id = 0,
bool force3d = true);
/*!
const SMDS_MeshNode* n10,
const SMDS_MeshNode* n11,
const SMDS_MeshNode* n12,
- const int id = 0,
+ const smIdType id = 0,
bool force3d = true);
/*!
*/
SMDS_MeshVolume* AddPolyhedralVolume (const std::vector<const SMDS_MeshNode*>& nodes,
const std::vector<int>& quantities,
- const int ID=0,
+ const smIdType ID=0,
const bool force3d = true);
/*!
* \brief Enables fixing node parameters on EDGEs and FACEs by
return setErrorCode( ERR_LOADV_BAD_SHAPE );
// count nodes
- smIdType nbNodes = 0, shapeID;
+ smIdType nbNodes = 0; int shapeID;
for ( shapeID = 1; shapeID <= myShapeIDMap.Extent(); shapeID++ )
{
const TopoDS_Shape& S = myShapeIDMap( shapeID );
//=======================================================================
inline void AddNodesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::double_array& aCoords = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(3*aNbElems != (CORBA::Long) aCoords.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(3*aNbElems != (SMESH::smIdType) aCoords.length())
EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()");
- for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
+ for(SMESH::smIdType aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){
SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId],
aCoords[aCoordId+1],
aCoords[aCoordId+2],
//=======================================================================
inline void Add0DElementsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if (2*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if (2*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()");
- CORBA::Long anIndexId = 0;
+ SMESH::smIdType anIndexId = 0;
for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
{
SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1],
//=======================================================================
inline void AddBallsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::double_array& aDiameter = theSeq[theId].coords;
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if (2*aNbElems != (CORBA::Long) anIndexes.length() )
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if (2*aNbElems != (SMESH::smIdType) anIndexes.length() )
EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != anIndexes.length()");
- if (aNbElems != (CORBA::Long) aDiameter.length())
+ if (aNbElems != (SMESH::smIdType) aDiameter.length())
EXCEPTION(runtime_error,"AddEdgeWithID - aNbElems != aDiameter.length()");
- CORBA::Long anIndexId = 0;
+ SMESH::smIdType anIndexId = 0;
for (; anElemId < aNbElems; anElemId++, anIndexId+=2)
{
SMDS_MeshElement* anElem = theMesh->AddBallWithID(anIndexes[anIndexId+1],
//=======================================================================
inline void AddEdgesWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(3*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(3*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()");
- for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
+ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){
SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
anIndexes[anIndexId]);
//=======================================================================
inline void AddTriasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(4*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(4*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()");
- for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
+ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){
SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddQuadPolygonsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number;
+ SMESH::smIdType anIndexId = 0, aNbElems = theSeq[theId].number;
- for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) {
+ for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) {
smIdType aFaceId = anIndexes[anIndexId++];
int aNbNodes = anIndexes[anIndexId++];
//=======================================================================
inline void AddTetrasWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(5*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(5*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()");
- for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
+ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddPiramidsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
- CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
- if(6*aNbElems != (CORBA::Long) anIndexes.length())
+ SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number;
+ if(6*aNbElems != (SMESH::smIdType) anIndexes.length())
EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()");
- for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
+ for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){
SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1],
anIndexes[anIndexId+2],
anIndexes[anIndexId+3],
//=======================================================================
inline void AddPrismsWithID(SMDS_Mesh* theMesh,
SMESH::log_array_var& theSeq,
- CORBA::Long theId)
+ SMESH::smIdType theId)
{
const SMESH::long_array& anIndexes = theSeq[theId].indexes;
CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number;
try {
SUIT_OverrideCursor wc;
SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
- int removed = aMeshEditor->RemoveOrphanNodes();
+ smIdType removed = aMeshEditor->RemoveOrphanNodes();
SUIT_MessageBox::information(SMESHGUI::desktop(),
tr("SMESH_INFORMATION"),
tr("NB_NODES_REMOVED").arg(removed));
SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array;
anIdList->length( 1 );
anIdList[0] = -1;
- int nbElemsBefore = 0;
+ smIdType nbElemsBefore = 0;
switch (myElementType) {
case SMDSAbs_0DElement: {
for ( size_t i = 0; i < anArrayOfIndices->length(); ++i )
anIdList[i] = aMeshEditor->Add0DElement(anArrayOfIndices[i], duplicateElements);
- CORBA::ULong nbAdded = myMesh->Nb0DElements() - nbElemsBefore;
+ SMESH::smIdType nbAdded = myMesh->Nb0DElements() - nbElemsBefore;
if ( !duplicateElements && nbAdded < anArrayOfIndices->length() )
SUIT_MessageBox::information(SMESHGUI::desktop(),
tr("SMESH_INFORMATION"),
meshLoaded ? SMESHGUI::resourceMgr()->integerValue( "SMESH", "info_controls_limit", 3000 ) : -1;
// nodes info
- const CORBA::Long nbNodes = nbElemsByType[ SMESH::NODE ];
+ const SMESH::smIdType nbNodes = nbElemsByType[ SMESH::NODE ];
// const CORBA::Long nbElems = ( nbElemsByType[ SMESH::EDGE ] +
// nbElemsByType[ SMESH::FACE ] +
// nbElemsByType[ SMESH::VOLUME ] );
else // use numerical functor
{
// compare two sets of possible triangles
- int diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
+ smIdType diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion);
if (diag == 1) // 1-3
isDiag13 = true;
else if (diag == 2) // 2-4
}
-vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( int theVTKID )
+vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( vtkIdType theVTKID )
{
const SMDS_MeshNode* aNode = myMesh->FindNodeVtk( theVTKID );
return aNode ? aNode->GetID() : -1;
}
-vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( int theObjID )
+vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( vtkIdType theObjID )
{
const SMDS_MeshNode* aNode = myMesh->FindNode( theObjID );
return aNode ? aNode->GetID() : -1;
}
-vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( int theVTKID )
+vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( vtkIdType theVTKID )
{
return this->GetMesh()->FromVtkToSmds(theVTKID);
}
-vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( int theObjID )
+vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( vtkIdType theObjID )
{
const SMDS_MeshElement* e = myMesh->FindElement(theObjID);
return e ? e->GetVtkID() : -1;
smIdType& theNodeId1,
smIdType& theNodeId2 ) const;
- virtual vtkIdType GetNodeObjId( int theVTKID );
- virtual vtkIdType GetNodeVTKId( int theObjID );
- virtual vtkIdType GetElemObjId( int theVTKID );
- virtual vtkIdType GetElemVTKId( int theObjID );
+ virtual vtkIdType GetNodeObjId( vtkIdType theVTKID );
+ virtual vtkIdType GetNodeVTKId( vtkIdType theObjID );
+ virtual vtkIdType GetElemObjId( vtkIdType theVTKID );
+ virtual vtkIdType GetElemVTKId( vtkIdType theObjID );
virtual void ClearEntitiesFlags();
virtual bool GetEntitiesFlag();
virtual unsigned int GetEntitiesState();
\param connectivity Return element connectivity.
\return \c true if result is valid; \c false otherwise.
*/
-bool SMESH::SelectionProxy::elementConnectivity( int id, Connectivity& connectivity )
+bool SMESH::SelectionProxy::elementConnectivity( SMESH::smIdType id, Connectivity& connectivity )
{
bool result = false;
connectivity.clear();
if ( !isNull() )
{
- QSet<int> nodes; // order of nodes is important
+ QSet<SMESH::smIdType> nodes; // order of nodes is important
if ( actor() )
{
const SMDS_MeshElement* element = actor()->GetObject()->GetMesh()->FindElement( id );
{
while ( it->more() )
{
- int n = it->next()->GetID();
+ SMESH::smIdType n = it->next()->GetID();
if ( !nodes.contains( n ))
{
connectivity[ SMDSAbs_Node ] << n;
\param autoCompute Compute size if it is unavailable. Defaults to \c false.
\return Group's size.
*/
-int SMESH::SelectionProxy::size( bool autoCompute ) const
+SMESH::smIdType SMESH::SelectionProxy::size( bool autoCompute ) const
{
// note: size is not computed for group on filter for performance reasons, see IPAL52831
- int result = -1;
+ SMESH::smIdType result = -1;
if ( !isNull() )
{
SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject );
\param autoCompute Compute size if it is unavailable. Defaults to \c false.
\return Number of nodes contained in group.
*/
-int SMESH::SelectionProxy::nbNodes( bool autoCompute ) const
+SMESH::smIdType SMESH::SelectionProxy::nbNodes( bool autoCompute ) const
{
// note: nb of nodes is not computed automatically for performance reasons
- int result = -1;
+ SMESH::smIdType result = -1;
if ( !isNull() )
{
SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject );
bool hasElement( int );
SMESH::ElementType elementType( int ) const;
int elementEntityType( int ) const;
- bool elementConnectivity( int, Connectivity& );
+ bool elementConnectivity( SMESH::smIdType, Connectivity& );
bool perFaceConnectivity( int, Connectivity&, int& );
bool elementPosition( int, Position& );
bool elementGravityCenter( int, XYZ& );
// methods that work for group only
SMESH::ElementType groupElementType() const;
QColor color() const;
- int size( bool = false ) const;
- int nbNodes( bool = false ) const;
+ SMESH::smIdType size( bool = false ) const;
+ SMESH::smIdType nbNodes( bool = false ) const;
QSet<uint> ids() const;
private:
for(; anIt!=aResMap.end(); anIt++) {
const vector<smIdType>& aVec = (*anIt).second;
for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) {
- int nbElem = aVec[i];
+ smIdType nbElem = aVec[i];
if ( nbElem < 0 ) // algo failed, check that it has reported a message
{
SMESH_subMesh* sm = anIt->first;
{
TE2EMap & e2eMap = e2eMapByType[ groupDS->GetType() ];
if ( e2eMap.empty() ) continue;
- int minID = e2eMap.begin()->first->GetID();
- int maxID = e2eMap.rbegin()->first->GetID();
+ smIdType minID = e2eMap.begin()->first->GetID();
+ smIdType maxID = e2eMap.rbegin()->first->GetID();
TE2EMap::iterator e2e;
while ( eIt->more() && groupElems.size() < e2eMap.size())
{
if ( grImpl )
{
CORBA::String_var objStr = GetORB()->object_to_string( grImpl->_this() );
- int anId = myStudyContext->findId( string( objStr.in() ) );
+ smIdType anId = myStudyContext->findId( string( objStr.in() ) );
char grpName[ 30 ];
sprintf( grpName, "Group %d %d", anId, grImpl->GetLocalID() );
SMESHDS_GroupBase* aGrpBaseDS = grImpl->GetGroupDS();
#endif
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
CORBA::String_var hypdata = myImpl->SaveTo();
- int id = myStudyContext->findId( string( objStr.in() ));
+ smIdType id = myStudyContext->findId( string( objStr.in() ));
// for each hypothesis create HDF group basing on its id
char hypGrpName[30];
#endif
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
CORBA::String_var hypdata = myImpl->SaveTo();
- int id = myStudyContext->findId( string( objStr.in() ) );
+ smIdType id = myStudyContext->findId( string( objStr.in() ) );
// for each algorithm create HDF group basing on its id
char hypGrpName[30];
SMESH_Mesh_i* myImpl = dynamic_cast<SMESH_Mesh_i*>( GetServant( myMesh ).in() );
if ( myImpl ) {
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
- int id = myStudyContext->findId( string( objStr.in() ) );
+ smIdType id = myStudyContext->findId( string( objStr.in() ) );
::SMESH_Mesh& myLocMesh = myImpl->GetImpl();
SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS();
bool hasShape = myLocMesh.HasShapeToMesh();
// write reference on a shape if exists
SALOMEDS::SObject_wrap myRef;
bool shapeRefFound = false;
- bool found = gotBranch->FindSubObject( GetRefOnShapeTag(), myRef.inout() );
+ bool found = gotBranch->FindSubObject( (CORBA::Long)GetRefOnShapeTag(), myRef.inout() );
if ( found ) {
SALOMEDS::SObject_wrap myShape;
bool ok = myRef->ReferencedObject( myShape.inout() );
// write applied hypotheses if exist
SALOMEDS::SObject_wrap myHypBranch;
- found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
+ found = gotBranch->FindSubObject( (CORBA::Long)GetRefOnAppliedHypothesisTag(), myHypBranch.inout() );
if ( found && !shapeRefFound && hasShape ) { // remove applied hyps
aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch );
}
//string myRefOnObject = myRefOnHyp->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnHyp );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
- int id = myStudyContext->findId( string( objStr.in() ) );
+ smIdType id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char hypName[ 30 ], hypId[ 30 ];
//string myRefOnObject = myRefOnAlgo->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
- int id = myStudyContext->findId( string( objStr.in() ) );
+ smIdType id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char algoName[ 30 ], algoId[ 30 ];
{
SMESH::SMESH_subMesh_var mySubMesh = SMESH::SMESH_subMesh::_narrow( anSubObject ) ;
CORBA::String_var objStr = GetORB()->object_to_string( anSubObject );
- int subid = myStudyContext->findId( string( objStr.in() ) );
+ smIdType subid = myStudyContext->findId( string( objStr.in() ) );
// for each mesh open the HDF group basing on its id
char submeshGrpName[ 30 ];
//string myRefOnObject = myRefOnHyp->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnHyp );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
- int id = myStudyContext->findId( string( objStr.in() ) );
+ smIdType id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char hypName[ 30 ], hypId[ 30 ];
//string myRefOnObject = myRefOnAlgo->GetID();
CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo );
CORBA::String_var objStr = GetORB()->object_to_string( anObject );
- int id = myStudyContext->findId( string( objStr.in() ) );
+ smIdType id = myStudyContext->findId( string( objStr.in() ) );
//if ( myRefOnObject.length() > 0 ) {
//aSize[ 0 ] = myRefOnObject.length() + 1;
char algoName[ 30 ], algoId[ 30 ];
continue;
CORBA::String_var objStr = GetORB()->object_to_string( aSubObject );
- int anId = myStudyContext->findId( string( objStr.in() ) );
+ smIdType anId = myStudyContext->findId( string( objStr.in() ) );
// For each group, create a dataset named "Group <group_persistent_id>"
// and store the group's user name into it
{
SMDS_ElemIteratorPtr eIt =
mySMESHDSMesh->elementsIterator( isNode ? SMDSAbs_Node : SMDSAbs_All );
- int nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements();
+ smIdType nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements();
if ( nbElems < 1 )
continue;
std::vector<int> smIDs; smIDs.reserve( nbElems );
SMESHDS_SubMesh* aSubMesh = const_cast< SMESHDS_SubMesh* >( smIt->next() );
if ( aSubMesh->IsComplexSubmesh() )
continue; // submesh containing other submeshs
- int nbNodes = aSubMesh->NbNodes();
+ smIdType nbNodes = aSubMesh->NbNodes();
if ( nbNodes == 0 ) continue;
int aShapeID = aSubMesh->GetID();
// myImpl->LoadFrom( hypdata.c_str() );
hypDataList.push_back( make_pair( myImpl, hypdata ));
CORBA::String_var iorString = GetORB()->object_to_string( myHyp );
- int newId = myStudyContext->findId( iorString.in() );
+ smIdType newId = myStudyContext->findId( iorString.in() );
myStudyContext->mapOldToNew( id, newId );
}
else
//myImpl->LoadFrom( hypdata.c_str() );
hypDataList.push_back( make_pair( myImpl, hypdata ));
CORBA::String_var iorString = GetORB()->object_to_string( myHyp );
- int newId = myStudyContext->findId( iorString.in() );
+ smIdType newId = myStudyContext->findId( iorString.in() );
myStudyContext->mapOldToNew( id, newId );
}
else
meshGroupList.push_back( make_pair( myNewMeshImpl, aTopGroup ));
CORBA::String_var iorString = GetORB()->object_to_string( myNewMesh );
- int newId = myStudyContext->findId( iorString.in() );
+ smIdType newId = myStudyContext->findId( iorString.in() );
myStudyContext->mapOldToNew( id, newId );
// ouv : NPAL12872
// get mesh old id
CORBA::String_var iorString = GetORB()->object_to_string( myNewMeshImpl->_this() );
- int newId = myStudyContext->findId( iorString.in() );
+ smIdType newId = myStudyContext->findId( iorString.in() );
int meshOldId = myStudyContext->getOldId( newId );
// try to find mesh data dataset
if ( aSubMesh->_is_nil() )
continue;
string iorSubString = GetORB()->object_to_string( aSubMesh );
- int newSubId = myStudyContext->findId( iorSubString );
+ smIdType newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
}
}
continue;
string iorSubString = GetORB()->object_to_string( aNewGroup );
- int newSubId = myStudyContext->findId( iorSubString );
+ smIdType newSubId = myStudyContext->findId( iorSubString );
myStudyContext->mapOldToNew( subid, newSubId );
SMESH_GroupBase_i* aGroupImpl = SMESH::DownCast< SMESH_GroupBase_i*>( aNewGroup );
if(MYDEBUG) MESSAGE( "SMESH_Gen_i::IORToLocalPersistentID" );
if ( myStudyContext && strcmp( IORString, "" ) != 0 ) {
- int anId = myStudyContext->findId( IORString );
+ smIdType anId = myStudyContext->findId( IORString );
if ( anId ) {
if(MYDEBUG) MESSAGE( "VSR " << anId )
char strId[ 20 ];
*/
//================================================================================
-CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
+SMESH::smIdType SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject)
{
if ( myStudyContext && !CORBA::is_nil( theObject )) {
string iorString = GetORB()->object_to_string( theObject );
int RegisterObject(CORBA::Object_ptr theObject);
// Return id of registered object
- CORBA::Long GetObjectId(CORBA::Object_ptr theObject);
+ SMESH::smIdType GetObjectId(CORBA::Object_ptr theObject);
// Return an object that previously had an oldID
template<class TInterface>
SMESHDS_GroupBase* aGroupDS = GetGroupDS();
if (aGroupDS)
{
- int aSize = aGroupDS->Extent();
+ smIdType aSize = aGroupDS->Extent();
aRes->length(aSize);
SMDS_ElemIteratorPtr it = aGroupDS->GetElements();
- for (int i = 0; it->more(); i++)
+ for (smIdType i = 0; it->more(); i++)
aRes[i] = it->next()->GetID();
if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;)
aMeshElem->nodeIterator() );
while ( itElemNodes->more() ) {
const SMDS_MeshNode* aMeshNode = itElemNodes->next();
- int aNodeID = aMeshNode->GetID();
+ smIdType aNodeID = aMeshNode->GetID();
TNodesMap::iterator anIter = nodesMap.find(aNodeID);
if ( anIter == nodesMap.end() ) {
// filling the nodes coordinates
// remove orphan nodes (if there are any)
list< smIdType > IdList( seq.begin(), seq.end() );
- int nbNodesBefore = myMesh->NbNodes();
+ SMESH::smIdType nbNodesBefore = myMesh->NbNodes();
getEditor().Remove( IdList, true );
- int nbNodesAfter = myMesh->NbNodes();
+ SMESH::smIdType nbNodesAfter = myMesh->NbNodes();
declareMeshModified( /*isReComputeSafe=*/ IdList.size() == 0 ); // issue 0020693
return nbNodesBefore - nbNodesAfter;
SMESH_TRY;
initData();
- int NbNodes = IDsOfNodes.length();
+ SMESH::smIdType NbNodes = IDsOfNodes.length();
SMDS_MeshElement* elem = 0;
if (NbNodes == 2)
{
- CORBA::Long index1 = IDsOfNodes[0];
- CORBA::Long index2 = IDsOfNodes[1];
+ SMESH::smIdType index1 = IDsOfNodes[0];
+ SMESH::smIdType index2 = IDsOfNodes[1];
elem = getMeshDS()->AddEdge( getMeshDS()->FindNode(index1),
getMeshDS()->FindNode(index2));
<< index1 << ", " << index2 <<" ])";
}
if (NbNodes == 3) {
- CORBA::Long n1 = IDsOfNodes[0];
- CORBA::Long n2 = IDsOfNodes[1];
- CORBA::Long n12 = IDsOfNodes[2];
+ SMESH::smIdType n1 = IDsOfNodes[0];
+ SMESH::smIdType n2 = IDsOfNodes[1];
+ SMESH::smIdType n12 = IDsOfNodes[2];
elem = getMeshDS()->AddEdge( getMeshDS()->FindNode(n1),
getMeshDS()->FindNode(n2),
getMeshDS()->FindNode(n12));
SMESH_TRY;
initData();
- for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ )
+ for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ )
{
- CORBA::Long index = IDsOfElements[i];
+ SMESH::smIdType index = IDsOfElements[i];
const SMDS_MeshElement * elem = getMeshDS()->FindElement(index);
if ( elem )
getEditor().Reorient( elem );
SMESH_subMesh* aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape );
if ( !aSubMesh || !aSubMesh->GetSubMeshDS())
return aResult._retn();
- int nbSteps = aSubMesh->GetSubMeshDS()->NbElements();
+ smIdType nbSteps = aSubMesh->GetSubMeshDS()->NbElements();
if ( nbSteps == nbAngles )
{
aResult.inout() = theAngles;
for (; eIt != anAffected.end(); ++eIt)
{
const SMDS_MeshElement* anElem = *eIt;
- int elemId = anElem->GetID();
+ smIdType elemId = anElem->GetID();
switch ( anElem->GetType() ) {
case SMDSAbs_Volume: volumeIds[ivol++] = elemId; break;
case SMDSAbs_Face: faceIds[iface++] = elemId; break;
{
Unexpect aCatch(SALOME_SalomeException);
- const int prevNbMeshEnt = NbNodes() + NbElements();
+ const smIdType prevNbMeshEnt = NbNodes() + NbElements();
if ( _preMeshInfo )
_preMeshInfo->ForgetOrLoad();
THROW_SALOME_CORBA_EXCEPTION( "RemoveGroupWithContents(): group does not belong to this mesh",
SALOME::BAD_PARAM);
- vector<int> nodeIds; // to remove nodes becoming free
+ vector<smIdType> nodeIds; // to remove nodes becoming free
bool isNodal = ( theGroup->GetType() == SMESH::NODE );
if ( !isNodal && !theGroup->IsEmpty() )
{
- CORBA::Long elemID = theGroup->GetID( 1 );
+ SMESH::smIdType elemID = theGroup->GetID( 1 );
int nbElemNodes = GetElemNbNodes( elemID );
if ( nbElemNodes > 0 )
nodeIds.reserve( theGroup->Size() * nbElemNodes );
SMDS_ElemIteratorPtr nIt = elOfType->nodesIterator();
for ( nbChecked = 1; nIt->more() && !toStopChecking; ++nbChecked )
{
- const int nID = nIt->next()->GetID();
+ const smIdType nID = nIt->next()->GetID();
if ( nID < isNodeInGroupsSize && isNodeInGroups[ nID ] &&
isToInclude( nbChecked, ++nbCommon, nbNodes, nbCorners, toStopChecking ))
{
while ( elemIt->more() )
{
const SMDS_MeshElement* e = elemIt->next();
- const int elemID = e->GetID();
+ const smIdType elemID = e->GetID();
const int shapeID = e->GetShapeID();
TRange & lastRange = ranges.back();
if ( lastRange.shapeID != shapeID ||
if ( !theIsBreakLink )
if ( mainGO->GetType() == GEOM_GROUP || !geomChanged ) // is group or not modified
{
- int nb = NbNodes() + NbElements();
+ smIdType nb = NbNodes() + NbElements();
CheckGeomGroupModif();
if ( nb != NbNodes() + NbElements() ) // something removed due to hypotheses change
_gen_i->UpdateIcons( me );
if ( !_impl->HasShapeToMesh() ) return;
- CORBA::Long nbEntities = NbNodes() + NbElements();
+ SMESH::smIdType nbEntities = NbNodes() + NbElements();
// Check if group contents changed
// Update icons
- CORBA::Long newNbEntities = NbNodes() + NbElements();
+ SMESH::smIdType newNbEntities = NbNodes() + NbElements();
list< SALOMEDS::SObject_wrap > soToUpdateIcons;
if ( newNbEntities != nbEntities )
{
while(its != logDS.end()){
SMESHDS_Command *com = *its;
int comType = com->GetType();
- int lgcom = com->GetNumber();
+ smIdType lgcom = com->GetNumber();
const list < smIdType >&intList = com->GetIndexes();
int inum = intList.size();
list < smIdType >::const_iterator ii = intList.begin();
smIdType SMESH_MeshPartDS::MaxElementID() const
{
if ( _meshDS ) return _meshDS->MaxElementID();
- int maxID = 0;
+ smIdType maxID = 0;
for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
if ( !_elements[ iType ].empty() )
- maxID = Max( maxID, (*_elements[ iType ].rbegin())->GetID() );
+ maxID = std::max( maxID, (*_elements[ iType ].rbegin())->GetID() );
return maxID;
}
// -------------------------------------------------------------------------------------
smIdType SMESH_MeshPartDS::MinElementID() const
{
if ( _meshDS ) return _meshDS->MinElementID();
- int minID = 0;
+ smIdType minID = 0;
for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType )
if ( !_elements[ iType ].empty() )
- minID = Min( minID, (*_elements[ iType ].begin())->GetID() );
+ minID = std::min( minID, (*_elements[ iType ].begin())->GetID() );
return minID;
}
// -------------------------------------------------------------------------------------
list<const gp_XYZ *> xyzList;
set<const SMDS_MeshFace*> fset;
- for ( CORBA::ULong i = 0; i < theFacesIDs.length(); i++)
+ for ( SMESH::smIdType i = 0; i < theFacesIDs.length(); i++)
{
- CORBA::Long index = theFacesIDs[i];
+ SMESH::smIdType index = theFacesIDs[i];
const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index);
if ( elem && elem->GetType() == SMDSAbs_Face )
fset.insert( static_cast<const SMDS_MeshFace *>( elem ));
list<const gp_XYZ *> xyzList;
set<const SMDS_MeshVolume*> vset;
- for ( CORBA::ULong i = 0; i < theVolumesIDs.length(); i++)
+ for ( SMESH::smIdType i = 0; i < theVolumesIDs.length(); i++)
{
- CORBA::Long index = theVolumesIDs[i];
+ SMESH::smIdType index = theVolumesIDs[i];
const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index);
if ( elem && elem->GetType() == SMDSAbs_Volume && elem->NbNodes() == 8 )
vset.insert( static_cast<const SMDS_MeshVolume *>( elem ));
<< CreatePolygons << ", " << CreatePolyedrs << " )";
addErrorCode( "MakeMesh" );
- int nb = aMesh->NbNodes() + aMesh->NbEdges() + aMesh->NbFaces() + aMesh->NbVolumes();
+ smIdType nb = aMesh->NbNodes() + aMesh->NbEdges() + aMesh->NbFaces() + aMesh->NbVolumes();
bool res = myPattern.MakeMesh( aMesh, CreatePolygons, CreatePolyedrs );
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
- int nbElems = 0;
+ SMESH::smIdType nbElems = 0;
TListOfSubMeshes smList;
if ( getSubMeshes( aSubMesh, smList ))
}
if ( all ) // get nodes from aSubMesh and all child sub-meshes
{
- int nbNodes = 0;
+ SMESH::smIdType nbNodes = 0;
SMESH_subMeshIteratorPtr smIt = aSubMesh->getDependsOnIterator( /*includeSelf=*/true );
while ( smIt->more() )
{
::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId];
- int nbElems = 0;
+ SMESH::smIdType nbElems = 0;
TListOfSubMeshes smList;
if ( getSubMeshes( aSubMesh, smList ))
{
SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge );
if ( !eSubMesh )
return false;
- int nbSeg = eSubMesh->NbElements();
+ smIdType nbSeg = eSubMesh->NbElements();
if ( nbSeg < 1 )
continue;
double segLen = L / nbSeg;
bool Contain( const TopoDS_Vertex& vertex ) const;
void AppendSide( const _FaceSide& side );
void SetBottomSide( int i );
- int GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges=0) const;
+ smIdType GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges=0) const;
bool StoreNodes(SMESH_ProxyMesh& mesh, vector<const SMDS_MeshNode*>& myGrid,
bool reverse, bool isProxy, const SMESHDS_SubMesh* smToCheckEdges=0 );
void SetID(EQuadSides id) { myID = id; }
//purpose :
//=======================================================================
-int _FaceSide::GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges) const
+smIdType _FaceSide::GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges) const
{
- int nb = 0;
+ smIdType nb = 0;
if ( myChildren.empty() )
{
nb = mesh.GetSubMesh(myEdge)->NbElements();
if ( mesh->HasModificationsToDiscard() ) // check nb of nodes on the EDGE sub-mesh
{
int iQuad = sm->NbElements() ? sm->GetElements()->next()->IsQuadratic() : 0;
- int nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements();
+ smIdType nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements();
if ( nbExpect != sm->NbNodes() ) // some nodes are moved from the EDGE by MergeNodes()
{
// add nodes of all segments
std::vector<double> myEdgeLength;
std::vector<int> myIsUniform;
double myLength;
- int myNbPonits, myNbSegments;
+ smIdType myNbPonits, myNbSegments;
SMESH_ProxyMesh::Ptr myProxyMesh;
bool myMissingVertexNodes, myIgnoreMediumNodes;
gp_Pnt2d myDefaultPnt2d;
// Find all block sides starting from mesh faces sharing the corner node
// --------------------------------------------------------------------
- int nbFacesOnSides = 0;
+ smIdType nbFacesOnSides = 0;
TIDSortedElemSet cornerFaces; // corner faces of found _BlockSide's
list< const SMDS_MeshNode* > corners( 1, nCorner );
list< const SMDS_MeshNode* >::iterator corner = corners.begin();
// check if the loaded grid corresponds to nb of quadrangles on the FACE
const SMESHDS_SubMesh* faceSubMesh =
proxymesh ? proxymesh->GetSubMesh( F ) : meshDS->MeshElements( F );
- const int nbQuads = faceSubMesh->NbElements();
+ const smIdType nbQuads = faceSubMesh->NbElements();
const int nbHor = aCubeSide[i]._u2nodesMap.size() - 1;
const int nbVer = aCubeSide[i]._u2nodesMap.begin()->second.size() - 1;
ok = ( nbQuads == nbHor * nbVer );
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
if(IsQuadratic) {
aResVec[SMDSEntity_Quad_Hexa] = nb2d_face0 * ( nb2d/nb1d );
- int nb1d_face0_int = ( nb2d_face0*4 - nb1d ) / 2;
+ smIdType nb1d_face0_int = ( nb2d_face0*4 - nb1d ) / 2;
aResVec[SMDSEntity_Node] = nb0d_face0 * ( 2*nb2d/nb1d - 1 ) - nb1d_face0_int * nb2d/nb1d;
}
else {
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
+#include <smIdType.hxx>
+
#include <vector>
/*!
friend std::istream& operator >> (std::istream & load, StdMeshers_NumberOfSegments & hyp);
protected:
- int _numberOfSegments; //!< an edge will be split on to this number of segments
+ smIdType _numberOfSegments; //!< an edge will be split on to this number of segments
DistrType _distrType; //!< the type of distribution of density function
double _scaleFactor; //!< the scale parameter for DT_Scale
std::vector<double> _table, _distr; //!< the table for DT_TabFunc, a sequence of pairs of numbers
void StdMeshers_Penta_3D::MakeNodes()
{
const int aNbSIDs=9;
- int i, j, k, ij, iNbN, aNodeID, aSize, iErr;
+ int i, j, k, ij, aSize, iErr;
+ smIdType iNbN, aNodeID;
double aX, aY, aZ;
SMESH_Block::TShapeID aSID, aSIDs[aNbSIDs]={
SMESH_Block::ID_V000, SMESH_Block::ID_V100,
}
//
// 2. Make pentahedrons
- int aID0, k , aJ[4];
+ smIdType aID0;
+ int k , aJ[4];
vector<const SMDS_MeshNode*> aN;
//
SMDS_ElemIteratorPtr itf, aItNodes;
//=======================================================================
void StdMeshers_Penta_3D::MakeMeshOnFxy1()
{
- int aID0, aJ, aLevel, ij, aNbNodes, k;
+ int aJ, aLevel, ij, k;
+ smIdType aID0, aNbNodes;
//
SMDS_NodeIteratorPtr itn;
SMDS_ElemIteratorPtr itf, aItNodes;
int iNbF = aM.Extent();
if (iNbF == 6) {
//
- int nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements();
- int nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements();
- int nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements();
- int nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements();
- int nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements();
- int nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements();
+ smIdType nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements();
+ smIdType nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements();
+ smIdType nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements();
+ smIdType nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements();
+ smIdType nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements();
+ smIdType nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements();
//
int has_only_quad_f1 = 1;
int has_only_quad_f2 = 1;
int iNbE = aE.Extent();
if (iNbE == 12) {
//
- int nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements();
- int nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements();
- int nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements();
- int nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements();
- int nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements();
- int nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements();
- int nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements();
- int nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements();
- int nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements();
- int nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements();
- int nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements();
- int nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements();
+ smIdType nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements();
+ smIdType nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements();
+ smIdType nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements();
+ smIdType nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements();
+ smIdType nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements();
+ smIdType nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements();
+ smIdType nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements();
+ smIdType nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements();
+ smIdType nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements();
+ smIdType nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements();
+ smIdType nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements();
+ smIdType nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements();
//
int nb_ok = 0 ;
//
if ( sm1->NbNodes() * smb->NbNodes() != smFace->NbNodes() ) {
// check quadratic case
if ( myCreateQuadratic ) {
- int n1 = sm1->NbNodes()/2;
- int n2 = smb->NbNodes()/2;
- int n3 = sm1->NbNodes() - n1;
- int n4 = smb->NbNodes() - n2;
- int nf = sm1->NbNodes()*smb->NbNodes() - n3*n4;
+ smIdType n1 = sm1->NbNodes()/2;
+ smIdType n2 = smb->NbNodes()/2;
+ smIdType n3 = sm1->NbNodes() - n1;
+ smIdType n4 = smb->NbNodes() - n2;
+ smIdType nf = sm1->NbNodes()*smb->NbNodes() - n3*n4;
if( nf != smFace->NbNodes() ) {
MESSAGE( "Wrong nb face nodes: " <<
sm1->NbNodes()<<" "<<smb->NbNodes()<<" "<<smFace->NbNodes());
}
}
// IJ size
- int vsize = sm1->NbNodes() + 2;
- int hsize = smb->NbNodes() + 2;
+ smIdType vsize = sm1->NbNodes() + 2;
+ smIdType hsize = smb->NbNodes() + 2;
if(myCreateQuadratic) {
vsize = vsize - sm1->NbNodes()/2 -1;
hsize = hsize - smb->NbNodes()/2 -1;
{
SMESH_subMesh* faceSm = *smIt;
SMESHDS_SubMesh* faceSmDS = faceSm->GetSubMeshDS();
- int nbQuads = faceSmDS ? faceSmDS->NbElements() : 0;
+ smIdType nbQuads = faceSmDS ? faceSmDS->NbElements() : 0;
bool toRemove;
if ( nbQuads > 0 )
toRemove = helper->IsStructured( faceSm );
SMESH_subMesh* faceSM = theMesh.GetSubMesh( face );
if ( !faceSM->IsEmpty() )
{
- int nbFaces = faceSM->GetSubMeshDS()->NbElements();
+ smIdType nbFaces = faceSM->GetSubMeshDS()->NbElements();
if ( prevNbFaces < nbFaces )
{
if ( !meshedFaces.empty() ) meshedFaces.pop_back();
}
// assure that all the source (left) EDGEs are meshed
- int nbSrcSegments = 0;
+ smIdType nbSrcSegments = 0;
for ( int i = 0; i < lftSide->NbEdges(); ++i )
{
if ( isArtificialQuad )
const SMDS_MeshNode *srcNode, *tgtNode;
// un-mark internal src nodes in order iterate them using _delaunay
- int nbSrcNodes = 0;
+ smIdType nbSrcNodes = 0;
SMDS_NodeIteratorPtr nIt = _srcSubMesh->GetSubMeshDS()->GetNodes();
if ( !nIt || !nIt->more() ) return true;
if ( moveAll )
tgtNbEW.front() != 4 || srcNbEW.front() != 4 )
return; // not quads
- int srcNbSeg[4];
+ smIdType srcNbSeg[4];
list< TopoDS_Edge >::iterator edgeS = srcEdges.begin(), edgeT = tgtEdges.begin();
for ( int i = 0; edgeS != srcEdges.end(); ++i, ++edgeS )
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *edgeS ))
// compare nb nodes on srcEdge1 and srcEdge2
if ( srcEdge2 != srcEdges.end() )
{
- int nbN1 = 0, nbN2 = 0;
+ smIdType nbN1 = 0, nbN2 = 0;
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( srcEdge1 ))
nbN1 = sm->NbNodes();
if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *srcEdge2 ))
// Merge
SMESH_MeshEditor editor( tgtMesh );
- int nbFaceBeforeMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
+ smIdType nbFaceBeforeMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
editor.MergeNodes( groupsOfNodes );
- int nbFaceAtferMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
+ smIdType nbFaceAtferMerge = tgtSubMesh->GetSubMeshDS()->NbElements();
if ( nbFaceBeforeMerge != nbFaceAtferMerge && !helper.HasDegeneratedEdges() )
return error(COMPERR_BAD_INPUT_MESH, "Probably invalid node parameters on geom faces");
if ( isComputed[ edgeIDs1[i]] &&
isComputed[ edgeIDs2[i]] )
{
- int nbNodes1 = meshDS->MeshElements(edgeIDs[ edgeIDs1[i]] )->NbNodes();
- int nbNodes2 = meshDS->MeshElements(edgeIDs[ edgeIDs2[i]] )->NbNodes();
+ smIdType nbNodes1 = meshDS->MeshElements(edgeIDs[ edgeIDs1[i]] )->NbNodes();
+ smIdType nbNodes2 = meshDS->MeshElements(edgeIDs[ edgeIDs2[i]] )->NbNodes();
if ( nbNodes1 != nbNodes2 )
return false;
if (( int(i)-1 >= 0 ) &&
}
if (computed) {
SMESHDS_SubMesh* smds = sm->GetSubMeshDS();
- int nb_segments = smds->NbElements();
+ smIdType nb_segments = smds->NbElements();
if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) {
isFound = true;
nbseg = nb_segments;
{
points.reserve( _boundarySize );
size_t nb = _boundary.rbegin()->_nodes.size();
- int lastID = _boundary.rbegin()->Node( nb - 1 )->GetID();
+ smIdType lastID = _boundary.rbegin()->Node( nb - 1 )->GetID();
std::list< BndPart >::const_iterator part = _boundary.begin();
for ( ; part != _boundary.end(); ++part )
{
GeomAdaptor_Curve aCurve(C, f,l);
const double totLen = GCPnts_AbscissaPoint::Length(aCurve, f, l);
- int nbExpectNodes = eSubMesh->NbNodes();
+ smIdType nbExpectNodes = eSubMesh->NbNodes();
_initU .reserve( nbExpectNodes );
_normPar.reserve( nbExpectNodes );
_nodes .reserve( nbExpectNodes );