double anAbsoluteCoord[3];
myPoints->SetNumberOfPoints(aNumPts);
vtkPoints *anInputPoints = theInput->GetPoints();
- for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+ for (auto aPntId = 0; aPntId < aNumPts; aPntId++) {
anInputPoints->GetPoint(myPointIds[aPntId], anAbsoluteCoord);
myPoints->SetPoint(aPntId, anAbsoluteCoord);
}
double aCellCenter[3] = {0.0, 0.0, 0.0};
{
double aPntCoord[3];
- for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+ for (auto aPntId = 0; aPntId < aNumPts; aPntId++) {
aPoints->GetPoint(GetPointId(aPntId),aPntCoord);
if(DEBUG_TRIA_EXECUTE) cout<<"\taPntId = "<<GetPointId(aPntId)<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}\n";
aCellCenter[0] += aPntCoord[0];
}
double aCellLength = GetCellLength();
- int aNumFaces = GetNumFaces();
+ vtkIdType aNumFaces = GetNumFaces();
static double EPS = 1.0E-2;
double aDistEps = aCellLength/3.0 * EPS;
typedef std::set<TPointIds> TFace2PointIds;
TFace2PointIds aFace2PointIds;
- for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
+ for (auto aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
vtkCell* aFace = GetFace(aFaceId);
GetCellNeighbors(theInput, theCellId, aFace, myCellIds);
::TPolygons aPolygons;
- for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
+ for (auto aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
if(aFace2Visibility.find(aFaceId) == aFace2Visibility.end())
continue;
if(DEBUG_TRIA_EXECUTE) cout << "; Added = FALSE" << endl;
}
}
- int aNbPoints = (int)aPointIds.size(); //!< TODO: conversion from size_t to int
+ auto aNbPoints = aPointIds.size(); //!< TODO: conversion from size_t to int
aCenter[0] /= aNbPoints;
aCenter[1] /= aNbPoints;
aCenter[2] /= aNbPoints;
}
if(!aSortedPointIds.empty()){
- int aNumFacePts = (int)aSortedPointIds.size(); //!< TODO: conversion from size_t to int
+ auto aNumFacePts = aSortedPointIds.size(); //!< TODO: conversion from size_t to int
::TConnectivities aConnectivities(aNumFacePts);
TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
// To check, whether the polygons give a convex polyhedron or not
if(theIsCheckConvex){
- int aNbPolygons = (int)aPolygons.size(); //!< TODO: conversion from size_t to int
- for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
+ auto aNbPolygons = aPolygons.size(); //!< TODO: conversion from size_t to int
+ for (auto aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
::TPolygon& aPolygon = aPolygons[aPolygonId];
double* aNormal = aPolygon.myNormal;
double* anOrigin = aPolygon.myOrigin;
// To pass resulting set of the polygons to the output
{
- int aNbPolygons = (int)aPolygons.size(); //!< TODO: conversion from size_t to int
- for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
+ auto aNbPolygons = aPolygons.size(); //!< TODO: conversion from size_t to int
+ for (auto aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
::TPolygon& aPolygon = aPolygons[aPolygonId];
if(DEBUG_TRIA_EXECUTE) cout << "PoilygonId="<<aPolygonId<<" | ";
TConnectivities& aConnectivities = aPolygon.myConnectivities;
cout << aConnectivities[i] << ",";
cout << endl;
}
- int aNbPoints = (int)aConnectivities.size(); //!< TODO: conversion from size_t to int
+ auto aNbPoints = aConnectivities.size(); //!< TODO: conversion from size_t to int
vtkIdType aNewCellId = theOutput->InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]);
if(theStoreMapping)
VTKViewer_GeometryFilter::InsertId( theCellId, VTK_POLYGON, theVTK2ObjIds, theDimension2VTK2ObjIds );
zSize = aBounds[5] - aBounds[4];
double anAbsoluteCoord[3];
double aParamentrucCoord[3];
- for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+ for (auto aPntId = 0; aPntId < aNumPts; aPntId++) {
myPoints->GetPoint(aPntId, anAbsoluteCoord);
aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize);
aParamentrucCoord[1] = ySize==0. ? 0. : ((anAbsoluteCoord[1] - aBounds[2]) / ySize);
}
vtkIdType cellId;
- int i;
+ vtkIdType i;
int allVisible;
vtkIdType npts = 0;
vtkIdType const *pts = 0;
quad1D2DTypes.insert( VTK_BIQUADRATIC_QUAD );
quad1D2DTypes.insert( VTK_QUADRATIC_POLYGON );
- for ( int i = 0; i < types->GetNumberOfTuples() && !hasQuad1D2D; ++i )
+ for ( auto i = 0; i < types->GetNumberOfTuples() && !hasQuad1D2D; ++i )
hasQuad1D2D = quad1D2DTypes.count( types->GetValue(i) );
}
buildArcs = hasQuad1D2D;
// Loop over all cells now that visibility is known
// (Have to compute visibility first for 3D cell boundaries)
- int progressInterval = numCells/20 + 1;
+ vtkIdType progressInterval = numCells/20 + 1;
TMapOfVectorId aDimension2VTK2ObjIds;
if ( myStoreMapping )
aDimension2VTK2ObjIds.resize( 3 ); // max dimension is 2
{
#ifdef SHOW_COINCIDING_3D_PAL21924
faceIdsTmp->SetNumberOfIds( npts );
- for ( int ai = 0; ai < npts; ai++ )
+ for ( auto ai = 0; ai < npts; ai++ )
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
#endif
faceIds->InsertNextId(pts[faceVerts[1]]);
faceIds->InsertNextId(pts[faceVerts[2]]);
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
#ifdef SHOW_COINCIDING_3D_PAL21924
bool process = nbNeighbors <= 0;
#else
{
#ifdef SHOW_COINCIDING_3D_PAL21924
faceIdsTmp->SetNumberOfIds( npts );
- for ( int ai = 0; ai < npts; ai++ )
+ for ( auto ai = 0; ai < npts; ai++ )
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
#endif
aCellType = VTK_QUAD;
numFacePts = 4;
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
#ifdef SHOW_COINCIDING_3D_PAL21924
bool process = nbNeighbors <= 0;
#else
{
#ifdef SHOW_COINCIDING_3D_PAL21924
faceIdsTmp->SetNumberOfIds( npts );
- for ( int ai = 0; ai < npts; ai++ )
+ for ( auto ai = 0; ai < npts; ai++ )
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
#endif
faceIds->InsertNextId(pts[faceVerts[2]]);
faceIds->InsertNextId(pts[faceVerts[3]]);
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
#ifdef SHOW_COINCIDING_3D_PAL21924
bool process = nbNeighbors <= 0;
#else
numFacePts = 4;
}
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
#ifdef SHOW_COINCIDING_3D_PAL21924
bool process = nbNeighbors <= 0;
#else
{
#ifdef SHOW_COINCIDING_3D_PAL21924
faceIdsTmp->SetNumberOfIds( npts );
- for ( int ai = 0; ai < npts; ai++ )
+ for ( auto ai = 0; ai < npts; ai++ )
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
#endif
numFacePts = 6;
}
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
#ifdef SHOW_COINCIDING_3D_PAL21924
bool process = nbNeighbors <= 0;
#else
if ( myShowInside )
{
aCellType = VTK_LINE;
- for ( int edgeID = 0; edgeID < 8; ++edgeID )
+ for ( auto edgeID = 0; edgeID < 8; ++edgeID )
{
const vtkIdType *edgeVerts = vtkPyramid::GetEdgeArray( edgeID );
if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
{
#ifdef SHOW_COINCIDING_3D_PAL21924
faceIdsTmp->SetNumberOfIds( npts );
- for ( int ai = 0; ai < npts; ai++ )
+ for ( auto ai = 0; ai < npts; ai++ )
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
#endif
numFacePts = 4;
}
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
#ifdef SHOW_COINCIDING_3D_PAL21924
bool process = nbNeighbors <= 0;
#else
{
vtkIdType nFaces = 0;
const vtkIdType* ptIds = 0;
- int idp = 0;
+ vtkIdType idp = 0;
input->GetFaceStream(cellId, nFaces, ptIds);
#ifdef SHOW_COINCIDING_3D_PAL21924
if ( !myShowInside )
{
faceIds->Reset();
numFacePts = ptIds[idp];
- int pt0 = ++idp;
+ vtkIdType pt0 = ++idp;
for (i = 0; i < numFacePts; i++)
{
faceIds->InsertNextId(ptIds[idp + i]);
default:aCellType = VTK_POLYGON;
}
input->GetCellNeighbors(cellId, faceIds, cellIds);
- int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
if ( myShowInside && nbNeighbors > 0 && cellId < cellIds->GetId(0) )
continue; // don't add twice same internal face in wireframe mode
#ifdef SHOW_COINCIDING_3D_PAL21924
#ifdef SHOW_COINCIDING_3D_PAL21924
if ( !myShowInside )
{
- int npts1 = 0;
+ vtkIdType npts1 = 0;
switch (aCellType ){
case VTK_QUADRATIC_TETRA: npts1 = 4; break;
case VTK_QUADRATIC_HEXAHEDRON: npts1 = 8; break;
}
faceIdsTmp->SetNumberOfIds( npts1 );
if ( npts1 > 0 ) {
- for (int ai=0; ai<npts1; ai++)
+ for (auto ai=0; ai<npts1; ai++)
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
}
#endif
aCellType = VTK_TRIANGLE;
numFacePts = 3;
- int nbNeighbors = 0;
- for (int j=0; j < cell->GetNumberOfFaces(); j++)
+ vtkIdType nbNeighbors = 0;
+ for (auto j=0; j < cell->GetNumberOfFaces(); j++)
{
vtkCell *face = cell->GetFace(j);
if ( !myShowInside ) {
}
else
{
- int nbCoincident = 0;
+ vtkIdType nbCoincident = 0;
#ifdef SHOW_COINCIDING_3D_PAL21924
- int nbPnt = npts - cell->GetNumberOfEdges();
+ vtkIdType nbPnt = npts - cell->GetNumberOfEdges();
faceIdsTmp->SetNumberOfIds( nbPnt );
- for ( int ai = 0; ai < nbPnt; ai++ )
+ for ( auto ai = 0; ai < nbPnt; ai++ )
faceIdsTmp->SetId( ai, pts[ai] );
input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
nbCoincident = cellIdsTmp->GetNumberOfIds();
{
vtkCell * face = cell->GetFace( faceId );
input->GetCellNeighbors( cellId, face->GetPointIds(), cellIds );
- int nbNeighbors = cellIds->GetNumberOfIds() - nbCoincident;
+ vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - nbCoincident;
if ( nbNeighbors <= 0 )
{
- int nbEdges = face->GetNumberOfPoints() / 2;
- for ( int edgeId = 0; edgeId < nbEdges; ++edgeId )
+ vtkIdType nbEdges = face->GetNumberOfPoints() / 2;
+ for ( auto edgeId = 0; edgeId < nbEdges; ++edgeId )
{
vtkIdType p1 = ( edgeId ); // corner
vtkIdType p2 = ( edgeId + nbEdges ); // medium
}
case VTK_QUADRATIC_POLYGON:
{
- int nbP = aCell->GetNumberOfPoints();
+ vtkIdType nbP = aCell->GetNumberOfPoints();
std::vector< Pnt > pVec( nbP + 2 );
- for ( int i = 0; i < nbP/2; ++i )
+ for ( auto i = 0; i < nbP/2; ++i )
{
pVec[i*2 + 0] = CreatePnt( aCell, inputScalars, i );
pVec[i*2 + 1] = CreatePnt( aCell, inputScalars, i + nbP/2 );
pVec[ nbP ] = pVec[ 0 ];
pVec[ nbP+1 ] = pVec[ 1 ];
- for ( int i = 0; i < nbP; i += 2 )
+ for ( auto i = 0; i < nbP; i += 2 )
{
VTKViewer_ArcBuilder aBuilder( pVec[i], pVec[i+1], pVec[i+2], myMaxArcAngle );
aCollection.push_back( aBuilder.GetPoints() );
vtkIdType aTriangleId;
vtkPolygon *aPlg = vtkPolygon::New();
- std::map<int, double> aPntId2ScalarValue;
+ std::map<vtkIdType, double> aPntId2ScalarValue;
aNbPoints = MergevtkPoints(aCollection, aScalarCollection, aPlg->GetPoints(), aPntId2ScalarValue, aNewPoints);
aPlg->GetPointIds()->SetNumberOfIds(aNbPoints);
aPlg->Delete();
}
else {
- std::map<int, double> aPntId2ScalarValue;
+ std::map<vtkIdType, double> aPntId2ScalarValue;
aNbPoints = MergevtkPoints(aCollection, aScalarCollection, output->GetPoints(), aPntId2ScalarValue, aNewPoints);
if(outputScalars)
for(vtkIdType i = 0; i < aNbPoints; i++)