#include <vtkRenderer.h>
#include <vtkUnstructuredGrid.h>
#include <vtkCellData.h>
+#include <iostream>
vtkStandardNewMacro(SMESH_CellLabelActor)
{
myCellsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
- int aNbElem = aDataSet->GetNumberOfCells();
- vtkIntArray *anArray = vtkIntArray::New();
+ vtkIdType aNbElem = aDataSet->GetNumberOfCells();
+ vtkIdTypeArray *anArray = vtkIdTypeArray::New();
+ //
+ std::cout << "\n\n\n***********\nSizeof vtkIdType: " << sizeof(vtkIdType) << "\nSizeof smIdType: " << sizeof(smIdType) << "\n";
+ //
anArray->SetNumberOfValues(aNbElem);
myExtractUnstructuredGrid->BuildOut2InMap();
- for(int anId = 0; anId < aNbElem; anId++)
+ for(vtkIdType anId = 0; anId < aNbElem; anId++)
{
vtkIdType id = anId;
if(IsImplicitFunctionUsed())
id = myExtractGeometry->GetElemObjId(id);
id = myExtractUnstructuredGrid->GetInputId(id);
id = (id >=0) ? id : anId;
- int aSMDSId = myVisualObj->GetElemObjId(id);
+ vtkIdType aSMDSId = myVisualObj->GetElemObjId(id);
anArray->SetValue(anId,aSMDSId);
}
aDataSet->GetCellData()->SetScalars(anArray);
SMESH_ExtractGeometry::~SMESH_ExtractGeometry()
{}
-vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID)
+vtkIdType SMESH_ExtractGeometry::GetElemObjId(vtkIdType theVtkID)
{
- if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1;
+ if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1;
return myElemVTK2ObjIds[theVtkID];
}
-vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID)
+vtkIdType SMESH_ExtractGeometry::GetNodeObjId(vtkIdType theVtkID)
{
- if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1;
+ if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1;
return myNodeVTK2ObjIds[theVtkID];
}
}
bool GetStoreMapping(){ return myStoreMapping;}
- virtual vtkIdType GetNodeObjId(int theVtkID);
- virtual vtkIdType GetElemObjId(int theVtkID);
+ virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
+ virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
protected:
SMESH_ExtractGeometry();
myPointsNumDataSet->ShallowCopy(aGrid);
vtkUnstructuredGrid *aDataSet = myPointsNumDataSet;
- int aNbElem = aDataSet->GetNumberOfPoints();
+ vtkIdType aNbElem = aDataSet->GetNumberOfPoints();
- vtkIntArray *anArray = vtkIntArray::New();
+ vtkIdTypeArray *anArray = vtkIdTypeArray::New();
anArray->SetNumberOfValues( aNbElem );
for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
{
- int aSMDSId = myVisualObj->GetNodeObjId( anId );
+ vtkIdType aSMDSId = myVisualObj->GetNodeObjId( anId );
anArray->SetValue( anId, aSMDSId );
}
double r = double( nbSegPerDiap * ( iDiap + 1 )) / double( nbTot );
double parI = par0 + ( par1 - par0 ) * r;
Params.InsertBefore( i, parI );
- nbsegs.insert( nbsegs.begin() + i-2 + iDiap, nbSegPerDiap );
+ auto it = nbsegs.begin();
+ auto incr_it = i - 2 + iDiap;
+ nbsegs.insert( it + incr_it, nbSegPerDiap );
}
nbsegs[ i-2 + nbDiapason - 1 ] = nbSegPerDiap + nbTot % nbDiapason;
}