if ( !myMeshModifTracer.GetMesh() )
return;
- int nbElems = FromIdType<int>( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
+ int nbElems = FromSmIdType<int>( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType ));
if ( nbElems > 0 )
myIds.ReSize( nbElems );
vector<smIdType> idVec( ids[0] );
for ( int i = 0; i < ids[0]; ++i )
idVec[ i ] = (smIdType) ids[ i + 1];
- return mesh->AddPolygonalFaceWithID( idVec, ToIdType(ID) );
+ return mesh->AddPolygonalFaceWithID( idVec, ID );
}
typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID);
else if ( meshDim == 2 )
nbCells = myMesh->NbFaces();
- cgsize_t size[9] = { FromIdType<cgsize_t>( myMesh->NbNodes() ),
- FromIdType<cgsize_t>( nbCells ),
+ cgsize_t size[9] = { FromSmIdType<cgsize_t>( myMesh->NbNodes() ),
+ FromSmIdType<cgsize_t>( nbCells ),
/*NBoundVertex=*/0, 0,0,0,0,0,0 };
int iZone;
if ( cg_zone_write( _fn, iBase, "SMESH_Mesh", size,
};
for ( int i = 0; i < 4; ++i )
{
- int gmfKwd = FromIdType<int>( kes[i][0] );
+ int gmfKwd = FromSmIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd))
};
for ( int i = 0; i < 7; ++i )
{
- int gmfKwd = FromIdType<int>( kes[i][0] );
+ int gmfKwd = FromSmIdType<int>( kes[i][0] );
SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1];
smIdType shift = kes[i][2];
if ( int nb = GmfStatKwd(meshID, gmfKwd))
aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end());
// allocate array of diameters
- vtkIdType maxID = FromIdType<vtkIdType>(myMesh->MaxElementID() + aNbBalls);
+ vtkIdType maxID = FromSmIdType<vtkIdType>(myMesh->MaxElementID() + aNbBalls);
if ( anIsElemNum && !aBallInfo->myElemNum->empty() )
maxID = *std::max_element( aBallInfo->myElemNum->begin(),
aBallInfo->myElemNum->end() );
#endif
if ( anIsElemNum ) {
TInt anElemId = aPolygoneInfo->GetElemNum( iElem );
- anElement = (myMesh->*addPolyWithID)( aNodeIds, ToIdType(anElemId) );
+ anElement = (myMesh->*addPolyWithID)( aNodeIds, ToSmIdType(anElemId) );
}
if ( !anElement ) {
aNodes.resize( aNbConn );
#endif
if(anIsElemNum){
TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
- anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToIdType(anElemId));
+ anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToSmIdType(anElemId));
}
if(!anElement){
vector<const SMDS_MeshNode*> aNodes(aNbNodes);
const EBooleen theIsElemNames = eFAUX;
const EConnectivite theConnMode = eNOD;
- TInt aNbNodes = FromIdType<TInt>( myMesh->NbNodes() );
+ TInt aNbNodes = FromSmIdType<TInt>( myMesh->NbNodes() );
PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes,
theMode, theSystem, theIsElemNum, theIsElemNames);
aTCoordSlice[2] = 0.;
// node number
- TInt aNodeID = FromIdType<TInt>( aCoordHelperPtr->GetID() );
+ TInt aNodeID = FromSmIdType<TInt>( aCoordHelperPtr->GetID() );
aNodeInfo->SetElemNum( iNode, aNodeID );
#ifdef _EDF_NODE_IDS_
aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 ));
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eBALL,
- FromIdType<TInt>(nbElemInfo.NbBalls()),
+ FromSmIdType<TInt>(nbElemInfo.NbBalls()),
SMDSAbs_Ball));
#ifdef _ELEMENTS_BY_DIM_
anEntity = eARETE;
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG2,
- FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbEdges( ORDER_LINEAR )),
SMDSAbs_Edge));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eSEG3,
- FromIdType<TInt>(nbElemInfo.NbEdges( ORDER_QUADRATIC )),
+ FromSmIdType<TInt>(nbElemInfo.NbEdges( ORDER_QUADRATIC )),
SMDSAbs_Edge));
#ifdef _ELEMENTS_BY_DIM_
anEntity = eFACE;
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA3,
- FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbTriangles( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA6,
- FromIdType<TInt>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
+ FromSmIdType<TInt>(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTRIA7,
- FromIdType<TInt>(nbElemInfo.NbBiQuadTriangles()),
+ FromSmIdType<TInt>(nbElemInfo.NbBiQuadTriangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD4,
- FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD8,
- FromIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
+ FromSmIdType<TInt>(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) -
nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eQUAD9,
- FromIdType<TInt>(nbElemInfo.NbBiQuadQuadrangles()),
+ FromSmIdType<TInt>(nbElemInfo.NbBiQuadQuadrangles()),
SMDSAbs_Face));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE,
- FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face));
// we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGONE,
- FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_LINEAR )),
SMDSAbs_Face));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
- FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
+ FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face));
// we need one more loop on QUAD poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYGON2,
- FromIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
+ FromSmIdType<TInt>(nbElemInfo.NbPolygons( ORDER_QUADRATIC )),
SMDSAbs_Face));
}
#ifdef _ELEMENTS_BY_DIM_
#endif
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA4,
- FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbTetras( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eTETRA10,
- FromIdType<TInt>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
+ FromSmIdType<TInt>(nbElemInfo.NbTetras( ORDER_QUADRATIC )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA5,
- FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbPyramids( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePYRA13,
- FromIdType<TInt>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
+ FromSmIdType<TInt>(nbElemInfo.NbPyramids( ORDER_QUADRATIC )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA6,
- FromIdType<TInt>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbPrisms( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA15,
- FromIdType<TInt>(nbElemInfo.NbQuadPrisms()),
+ FromSmIdType<TInt>(nbElemInfo.NbQuadPrisms()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePENTA18,
- FromIdType<TInt>(nbElemInfo.NbBiQuadPrisms()),
+ FromSmIdType<TInt>(nbElemInfo.NbBiQuadPrisms()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA8,
- FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_LINEAR )),
+ FromSmIdType<TInt>(nbElemInfo.NbHexas( ORDER_LINEAR )),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA20,
- FromIdType<TInt>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
+ FromSmIdType<TInt>(nbElemInfo.NbHexas( ORDER_QUADRATIC )-
nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eHEXA27,
- FromIdType<TInt>(nbElemInfo.NbTriQuadHexas()),
+ FromSmIdType<TInt>(nbElemInfo.NbTriQuadHexas()),
SMDSAbs_Volume));
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
eOCTA12,
- FromIdType<TInt>(nbElemInfo.NbHexPrisms()),
+ FromSmIdType<TInt>(nbElemInfo.NbHexPrisms()),
SMDSAbs_Volume));
if ( polyTypesSupported ) {
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE,
- FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
+ FromSmIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume));
// we need one more loop on poly elements to count nb of their nodes
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
ePOLYEDRE,
- FromIdType<TInt>(nbElemInfo.NbPolyhedrons()),
+ FromSmIdType<TInt>(nbElemInfo.NbPolyhedrons()),
SMDSAbs_Volume));
}
for(TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_
- aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
+ aTConnSlice[ iNode ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else
aTConnSlice[ iNode ] = aNode->GetID();
#endif
}
// element number
- aPolygoneInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
+ aPolygoneInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
while ( nodeIt->more() ) {
const SMDS_MeshElement* aNode = nodeIt->next();
#ifdef _EDF_NODE_IDS_
- conn[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
+ conn[ iNode ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else
conn[ iNode ] = aNode->GetID();
#endif
++iNode;
}
// element number
- aPolyhInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
+ aPolyhInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
// connectivity
const SMDS_MeshElement* aNode = anElem->GetNode( 0 );
#ifdef _EDF_NODE_IDS_
- (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
+ (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else
(*aBallInfo->myConn)[ iElem ] = aNode->GetID();
#endif
// element number
- aBallInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
+ aBallInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// diameter
aBallInfo->myDiameters[ iElem ] =
for (TInt iNode = 0; iNode < aNbNodes; iNode++) {
const SMDS_MeshElement* aNode = anElem->GetNode( iNode );
#ifdef _EDF_NODE_IDS_
- aTConnSlice[ iNode ] = aNodeIdMap[FromIdType<TInt>(aNode->GetID())];
+ aTConnSlice[ iNode ] = aNodeIdMap[FromSmIdType<TInt>(aNode->GetID())];
#else
aTConnSlice[ iNode ] = aNode->GetID();
#endif
}
// element number
- aCellInfo->SetElemNum( iElem, FromIdType<TInt>(anElem->GetID()) );
+ aCellInfo->SetElemNum( iElem, FromSmIdType<TInt>(anElem->GetID()) );
// family number
int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId );
{
const SMDS_MeshNode* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() )
- aRec.node_labels.push_back( FromIdType<int>(aNode->GetID()) );
+ aRec.node_labels.push_back( FromSmIdType<int>(aNode->GetID()) );
else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
for ( aRec.node_labels.clear(); aNodesIter->more(); ) {
const SMDS_MeshNode* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() )
- aRec.node_labels.push_back( FromIdType<int>(aNode->GetID()) );
+ aRec.node_labels.push_back( FromSmIdType<int>(aNode->GetID()) );
else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
{
const SMDS_MeshElement* aNode = aNodesIter->next();
if ( nodeLabelByID.empty() )
- aRec.node_labels.push_back( FromIdType<int>(aNode->GetID()) );
+ aRec.node_labels.push_back( FromSmIdType<int>(aNode->GetID()) );
else
aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]);
}
while ( aIter->more() ) {
const SMDS_MeshElement* aNode = aIter->next();
if ( nodeLabelByID.empty() )
- aRec.NodeList.push_back( FromIdType<int>(aNode->GetID()) );
+ aRec.NodeList.push_back( FromSmIdType<int>(aNode->GetID()) );
else
aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]);
}
while ( aIter->more() ) {
const SMDS_MeshElement* aElem = aIter->next();
if ( elemLabelByID.empty() )
- aRec.ElementList.push_back( FromIdType<int>(aElem->GetID()) );
+ aRec.ElementList.push_back( FromSmIdType<int>(aElem->GetID()) );
else
aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]);
}
( aPredicate = dynamic_cast<CoincidentNodes*>(theFunctor.get())))
{
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- vtkIdType aNbNodes = FromIdType<vtkIdType>(myVisualObj->GetNbEntities(SMDSAbs_Node));
+ vtkIdType aNbNodes = FromSmIdType<vtkIdType>(myVisualObj->GetNbEntities(SMDSAbs_Node));
for( vtkIdType i = 0; i < aNbNodes; i++ ){
vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
if(aPredicate->IsSatisfy(anObjId))
if( this->GetMesh() )
aNode = this->GetMesh()->FindNodeVtk( theVTKID );
- return aNode ? FromIdType<vtkIdType>(aNode->GetID()) : -1;
+ return aNode ? FromSmIdType<vtkIdType>(aNode->GetID()) : -1;
}
vtkIdType SMESH_VisualObjDef::GetNodeVTKId( vtkIdType theObjID )
TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID);
return i == myVTK2SMDSElems.end() ? -1 : i->second;
}
- return FromIdType<vtkIdType>(this->GetMesh()->FromVtkToSmds(theVTKID));
+ return FromSmIdType<vtkIdType>(this->GetMesh()->FromVtkToSmds(theVTKID));
}
vtkIdType SMESH_VisualObjDef::GetElemVTKId( vtkIdType theObjID )
return;
TEntityList aNodes;
- vtkIdType nbNodes = FromIdType<vtkIdType>(GetEntities( SMDSAbs_Node, aNodes ));
+ vtkIdType nbNodes = FromSmIdType<vtkIdType>(GetEntities( SMDSAbs_Node, aNodes ));
thePoints->SetNumberOfPoints( nbNodes );
int nbPoints = 0;
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[ FromIdType<vtkIdType>(n->GetID()) ]);
+ anIdList->InsertNextId( mySMDS2VTKNodes[ FromSmIdType<vtkIdType>(n->GetID()) ]);
}
}
}
else {
for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
const SMDS_MeshElement* aNode = aNodesIter->next();
- anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromIdType<vtkIdType>(aNode->GetID())] );
+ anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromSmIdType<vtkIdType>(aNode->GetID())]);
}
}
}
smIdType id0 = myChunks.size() * theChunkSize + 1;
myChunks.push_back( new SMDS_ElementChunk( this, id0 ));
}
- SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType<int>(index) );
+ SMDS_MeshElement* e = myChunks[iChunk].Element( FromSmIdType<int>(index) );
if ( !e->IsNull() )
return 0; // element with given ID already exists
- myChunks[iChunk].UseElement( FromIdType<int>(index) );
+ myChunks[iChunk].UseElement( FromSmIdType<int>(index) );
++myNbUsedElements;
e->myHolder = & myChunks[iChunk];
smIdType index = ( id - 1 ) % theChunkSize;
if ( iChunk < (smIdType) myChunks.size() )
{
- const SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType<int>(index) );
+ const SMDS_MeshElement* e = myChunks[iChunk].Element( FromSmIdType<int>(index) );
return e->IsNull() ? 0 : e;
}
}
vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const
{
- vtkIdType dfltVtkID = FromIdType<vtkIdType>(e->GetID() - 1);
+ vtkIdType dfltVtkID = FromSmIdType<vtkIdType>(e->GetID() - 1);
return ( dfltVtkID < (vtkIdType)myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID;
}
// Use double type for storing coordinates of nodes instead float.
vtkPoints *newPoints = vtkPoints::New();
newPoints->SetDataType( VTK_DOUBLE );
- newPoints->SetNumberOfPoints( FromIdType<vtkIdType>(newNodeSize) );
+ newPoints->SetNumberOfPoints( FromSmIdType<vtkIdType>(newNodeSize) );
vtkIdType i = 0, alreadyCopied = 0;
while ( i < oldNodeSize )
vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New();
newTypes->Initialize();
- newTypes->SetNumberOfValues(FromIdType<vtkIdType>(newCellSize));
+ newTypes->SetNumberOfValues(FromSmIdType<vtkIdType>(newCellSize));
vtkIdTypeArray *newLocations = vtkIdTypeArray::New();
newLocations->Initialize();
- newLocations->SetNumberOfValues(FromIdType<vtkIdType>(newCellSize));
+ newLocations->SetNumberOfValues(FromSmIdType<vtkIdType>(newCellSize));
std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell
{
smIdType oldCellId = idCellsNewToOld[ newCellID ];
newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 );
- smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType<vtkIdType>(oldCellId) );
- smIdType nCellFaces = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
- newFaces->InsertNextValue( FromIdType<vtkIdType>(nCellFaces) );
+ smIdType oldFaceLoc = this->FaceLocations->GetValue( FromSmIdType<vtkIdType>(oldCellId) );
+ smIdType nCellFaces = this->Faces->GetValue( FromSmIdType<vtkIdType>(oldFaceLoc++) );
+ newFaces->InsertNextValue( FromSmIdType<vtkIdType>(nCellFaces) );
for ( int n = 0; n < nCellFaces; n++ )
{
- int nptsInFace = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
+ int nptsInFace = this->Faces->GetValue( FromSmIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( nptsInFace );
for ( int k = 0; k < nptsInFace; k++ )
{
- vtkIdType oldpt = this->Faces->GetValue( FromIdType<vtkIdType>(oldFaceLoc++) );
+ vtkIdType oldpt = this->Faces->GetValue( FromSmIdType<vtkIdType>(oldFaceLoc++) );
newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]);
}
}
const SMDS_MeshInfo &meshInfo = _mesh->GetMeshInfo();
- int nbLinTetra = FromIdType<int>(meshInfo.NbTetras (ORDER_LINEAR));
- int nbQuadTetra = FromIdType<int>(meshInfo.NbTetras (ORDER_QUADRATIC));
- int nbLinPyra = FromIdType<int>(meshInfo.NbPyramids(ORDER_LINEAR));
- int nbQuadPyra = FromIdType<int>(meshInfo.NbPyramids(ORDER_QUADRATIC));
- int nbLinPrism = FromIdType<int>(meshInfo.NbPrisms (ORDER_LINEAR));
- int nbQuadPrism = FromIdType<int>(meshInfo.NbPrisms (ORDER_QUADRATIC));
- int nbLinHexa = FromIdType<int>(meshInfo.NbHexas (ORDER_LINEAR));
- int nbQuadHexa = FromIdType<int>(meshInfo.NbHexas (ORDER_QUADRATIC));
- int nbHexPrism = FromIdType<int>(meshInfo.NbHexPrisms());
+ int nbLinTetra = FromSmIdType<int>(meshInfo.NbTetras (ORDER_LINEAR));
+ int nbQuadTetra = FromSmIdType<int>(meshInfo.NbTetras (ORDER_QUADRATIC));
+ int nbLinPyra = FromSmIdType<int>(meshInfo.NbPyramids(ORDER_LINEAR));
+ int nbQuadPyra = FromSmIdType<int>(meshInfo.NbPyramids(ORDER_QUADRATIC));
+ int nbLinPrism = FromSmIdType<int>(meshInfo.NbPrisms (ORDER_LINEAR));
+ int nbQuadPrism = FromSmIdType<int>(meshInfo.NbPrisms (ORDER_QUADRATIC));
+ int nbLinHexa = FromSmIdType<int>(meshInfo.NbHexas (ORDER_LINEAR));
+ int nbQuadHexa = FromSmIdType<int>(meshInfo.NbHexas (ORDER_QUADRATIC));
+ int nbHexPrism = FromSmIdType<int>(meshInfo.NbHexPrisms());
int nbLineGuess = int((4.0 / 3.0) * nbLinTetra + 2 * nbLinPrism + 2.5 * nbLinPyra + 3 * nbLinHexa);
int nbQuadEdgeGuess = int((4.0 / 3.0) * nbQuadTetra + 2 * nbQuadPrism + 2.5 * nbQuadPyra + 3 * nbQuadHexa);
static int HashCode(const ComparableElement& se, int limit )
{
- return ::HashCode( FromIdType<int>(se.mySumID), limit );
+ return ::HashCode( FromSmIdType<int>(se.mySumID), limit );
}
static Standard_Boolean IsEqual(const ComparableElement& se1, const ComparableElement& se2 )
{
return;
SMESH::smIdType_array_var anIds = myFilter[ theType ]->GetElementsId(myMesh);
for (int i = 0, n = anIds->length(); i < n; i++)
- theResIds.append(FromIdType<int>(anIds[ i ]));
+ theResIds.append(FromSmIdType<int>(anIds[ i ]));
}
else if (aSourceId == Selection)
{
SMESH::smIdType_array_var anIds =
theType == SMESH::NODE ? aSubMesh->GetNodesId() : aSubMesh->GetElementsId();
for (int i = 0, n = anIds->length(); i < n; i++)
- aToBeFiltered.Add(FromIdType<int>(anIds[ i ]));
+ aToBeFiltered.Add(FromSmIdType<int>(anIds[ i ]));
}
}
{
SMESH::smIdType_array_var anIds = aGroup->GetListOfID();
for (int i = 0, n = anIds->length(); i < n; i++)
- aToBeFiltered.Add(FromIdType<int>(anIds[ i ]));
+ aToBeFiltered.Add(FromSmIdType<int>(anIds[ i ]));
}
}
bool ok;
int anId = myDlg->myId->text().toInt( &ok );
if( !ok || anId < 1 )
- anId = FromIdType<int>(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ anId = FromSmIdType<int>(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
myDlg->myDestinationY->GetValue(),
myDlg->myDestinationZ->GetValue()));
myDlg->myDestDZ->setReadOnly(true);
}
if ( isPreview && isMoveNode && anId == 0 )
- anId = FromIdType<int>(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ anId = FromSmIdType<int>(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
myDlg->myDestinationY->GetValue(),
myDlg->myDestinationZ->GetValue()));
// find id and/or just compute preview
if( const SMDS_MeshNode* aNode = aMesh->FindNode( theText.toInt() ) )
{
SVTK_TVtkIDsMap aListInd;
- aListInd.Add( FromIdType<int>(aNode->GetID()) );
+ aListInd.Add( FromSmIdType<int>(aNode->GetID()) );
selector()->AddOrRemoveIndex( anIO, aListInd, false );
if( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ) )
aViewWindow->highlight( anIO, true, true );
if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
SMESH::smIdType_array_var anIds = aSubMesh->GetElementsId();
for (int i = 0, n = anIds->length(); i < n; i++) {
- if (isIdValid(FromIdType<int>(anIds[ i ])))
+ if (isIdValid(FromSmIdType<int>(anIds[ i ])))
toBeAdded.Add(anIds[ i ]);
}
}
if (aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::smIdType_array_var anIds = aGroup->GetListOfID();
for (int i = 0, n = anIds->length(); i < n; i++) {
- if (isIdValid(FromIdType<int>(anIds[ i ])))
+ if (isIdValid(FromSmIdType<int>(anIds[ i ])))
toBeAdded.Add(anIds[ i ]);
}
}
return theEditor->ReorientObject( obj );
}
-int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
+smIdType SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
{
- return ( myFilterType == SMESH::FaceFilter ) ? FromIdType<int>(myMesh->NbFaces()) : FromIdType<int>(myMesh->NbVolumes());
+ return ( myFilterType == SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes();
}
/*!
return ok;
}
-int SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh()
+smIdType SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh()
{
- return FromIdType<int>(myMesh->NbTriangles());
+ return myMesh->NbTriangles();
}
void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview )
return hasObj ? theEditor->QuadToTriObject(obj, aCrit) : theEditor->QuadToTri(theIds, aCrit);
}
-int SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh()
+smIdType SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh()
{
- return FromIdType<int>(myMesh->NbQuadrangles());
+ return myMesh->NbQuadrangles();
}
const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(anIter->next());
if (aNode)
{
- if (!anIdToVtk.IsBound(FromIdType<int>(aNode->GetID())))
+ if (!anIdToVtk.IsBound(FromSmIdType<int>(aNode->GetID())))
{
aPoints->SetPoint(++nbPoints, aNode->X(), aNode->Y(), aNode->Z());
- anIdToVtk.Bind(FromIdType<int>(aNode->GetID()), nbPoints);
+ anIdToVtk.Bind(FromSmIdType<int>(aNode->GetID()), nbPoints);
}
- aNodes[ k++ ] = FromIdType<int>(aNode->GetID());
+ aNodes[ k++ ] = FromSmIdType<int>(aNode->GetID());
}
}
return true;
}
-int SMESHGUI_SplitVolumesDlg::nbElemsInMesh()
+smIdType SMESHGUI_SplitVolumesDlg::nbElemsInMesh()
{
- return isIntoPrisms() ? FromIdType<int>(myMesh->NbHexas()) : FromIdType<int>(myMesh->NbVolumes() - myMesh->NbTetras());
+ return isIntoPrisms() ? myMesh->NbHexas() : myMesh->NbVolumes() - myMesh->NbTetras();
}
bool SMESHGUI_SplitVolumesDlg::isIntoPrisms()
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+#include <smIdType.hxx>
+
class SMESHGUI;
class SMESHGUI_FilterDlg;
class SMESHGUI_SpinBox;
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::smIdType_array& ,
SMESH::SMESH_IDSource_ptr obj) = 0;
- virtual int nbElemsInMesh() = 0;
+ virtual smIdType nbElemsInMesh() = 0;
int entityType();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::smIdType_array& ,
SMESH::SMESH_IDSource_ptr obj);
- virtual int nbElemsInMesh();
+ virtual smIdType nbElemsInMesh();
};
/*!
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::smIdType_array&,
SMESH::SMESH_IDSource_ptr obj );
- virtual int nbElemsInMesh();
+ virtual smIdType nbElemsInMesh();
protected slots:
virtual void onDisplaySimulation( bool );
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::smIdType_array& ,
SMESH::SMESH_IDSource_ptr obj);
- virtual int nbElemsInMesh();
+ virtual smIdType nbElemsInMesh();
protected slots:
virtual void reject();
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
const SMESH::smIdType_array&,
SMESH::SMESH_IDSource_ptr obj );
- virtual int nbElemsInMesh();
+ virtual smIdType nbElemsInMesh();
virtual void setSelectionMode();
void showFacetByElement( int id );
typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap;
TLinkSharpMap linkIsSharp;
- Standard_Integer nbBuckets = FromIdType<Standard_Integer>( theMesh->NbFaces() );
+ Standard_Integer nbBuckets = FromSmIdType<Standard_Integer>( theMesh->NbFaces() );
if ( nbBuckets > 0 )
linkIsSharp.ReSize( nbBuckets );
typedef std::vector< const SMDS_MeshElement* > TFaceVec;
typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks;
TFacesByLinks facesByLink;
- Standard_Integer nbBuckets = FromIdType<Standard_Integer>( theMesh->NbFaces() );
+ Standard_Integer nbBuckets = FromSmIdType<Standard_Integer>( theMesh->NbFaces() );
if ( nbBuckets > 0 )
facesByLink.ReSize( nbBuckets );
static Standard_Integer HashCode(const CutFace& f, const Standard_Integer upper)
{
- return ::HashCode( FromIdType<int>(f.myInitFace->GetID()), upper );
+ return ::HashCode( FromSmIdType<int>(f.myInitFace->GetID()), upper );
}
static Standard_Boolean IsEqual(const CutFace& f1, const CutFace& f2 )
{
// methods for usage of SMESH_TLink as a hasher in NCollection maps
static int HashCode(const SMESH_TLink& link, int aLimit)
{
- return ::HashCode( FromIdType<int>(link.node1()->GetID() + link.node2()->GetID()), aLimit );
+ return smIdHasher::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit );
}
static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2)
{
{
static Standard_Integer HashCode(const SMDS_MeshElement* e, const Standard_Integer upper)
{
- return ::HashCode( FromIdType<int>(e->GetID()), upper );
+ return smIdHasher::HashCode( e->GetID(), upper );
}
static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 )
{
}
typedef struct {
- int shapeID, fromID, toID; // indices of elements of a sub-mesh
+ int shapeID; smIdType fromID, toID; // indices of elements of a sub-mesh
} TRange;
std::vector< TRange > elemRanges, nodeRanges; // elements of sub-meshes
std::vector< SMDS_PositionPtr > positions; // node positions
TRange & lastRange = ranges.back();
if ( lastRange.shapeID != shapeID ||
lastRange.toID != elemID )
- ranges.push_back( TRange{ shapeID, FromIdType<int>(elemID), FromIdType<int>(elemID + 1) });
+ ranges.push_back( TRange{ shapeID, elemID, elemID + 1 });
else
lastRange.toID = elemID + 1;
bool ok = false;
if ( theNbPoints < IntegerLast() )
{
- int nbPnt = FromIdType<int>( theNbPoints );
+ int nbPnt = FromSmIdType<int>( theNbPoints );
GCPnts_UniformAbscissa discret(theC3d, nbPnt, theFirstU, theLastU, theTol );
if ( !discret.IsDone() )
return error( "GCPnts_UniformAbscissa failed");
if (nbseg <= 0)
nbseg = 1; // degenerated edge
eltSize = theLength / nbseg * ( 1. - 1e-9 );
- nbSegments = ToIdType( nbseg );
+ nbSegments = ToSmIdType( nbseg );
}
else if ( _hypType == LOCAL_LENGTH )
{
smIdType nb_segments = smds->NbElements();
if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) {
isFound = true;
- nbseg = FromIdType<double>( nb_segments );
+ nbseg = FromSmIdType<double>( nb_segments );
}
}
}
if (nbseg <= 0)
nbseg = 1; // degenerated edge
eltSize = theLength / nbseg;
- nbSegments = ToIdType( nbseg );
+ nbSegments = ToSmIdType( nbseg );
}
else
{
break;
case StdMeshers_NumberOfSegments::DT_TabFunc:
{
- FunctionTable func(_vvalue[ TAB_FUNC_IND ], FromIdType<int>( _ivalue[ CONV_MODE_IND ]));
+ FunctionTable func(_vvalue[ TAB_FUNC_IND ], FromSmIdType<int>( _ivalue[ CONV_MODE_IND ]));
return computeParamByFunc(theC3d, f, l, theLength, theReverse,
_ivalue[ NB_SEGMENTS_IND ], func,
theParams);
case StdMeshers_NumberOfSegments::DT_ExprFunc:
{
FunctionExpr func(_svalue[ EXPR_FUNC_IND ].c_str(),
- FromIdType<int>( _ivalue[ CONV_MODE_IND ]));
+ FromSmIdType<int>( _ivalue[ CONV_MODE_IND ]));
return computeParamByFunc(theC3d, f, l, theLength, theReverse,
_ivalue[ NB_SEGMENTS_IND ], func,
theParams);
{
if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() )
{
- myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, FromIdType<int>( val ));
+ myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, qlonglong( val ));
myTreeWidget->topLevelItem( idx )->setText( 1, idx > 0 && mySameValues->isChecked() ? QString( SAME_TEXT ) : QString::number( val ) );
}
}
smIdType StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const
{
- return ToIdType( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1 );
+ return idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toLongLong() : 1;
}
//=================================================================================