-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// Author: Alexey PETROV
#include "VTKViewer_ExtractUnstructuredGrid.h"
-#include "VTKViewer_CellLocationsArray.h"
+//#include "VTKViewer_CellLocationsArray.h"
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
-vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid);
+vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid)
VTKViewer_ExtractUnstructuredGrid::VTKViewer_ExtractUnstructuredGrid():
}
}
-vtkIdType VTKViewer_ExtractUnstructuredGrid::GetInputId(int theOutId) const
+vtkIdType VTKViewer_ExtractUnstructuredGrid::GetInputId(vtkIdType theOutId) const
{
if ( myPassAll || ( myCellIds.empty() && myCellTypes.empty() ))
return theOutId;
- if ( theOutId<0 || theOutId >= (int)myOut2InId.size() )
+ if ( theOutId < 0 || theOutId >= (vtkIdType) myOut2InId.size() )
return -1;
return myOut2InId[theOutId];
}
// }
-inline int InsertCell(vtkUnstructuredGrid *theInput,
+inline vtkIdType InsertCell(vtkUnstructuredGrid *theInput,
vtkCellArray *theConnectivity,
vtkUnsignedCharArray* theCellTypesArray,
vtkIdTypeArray*& theFaces,
vtkIdTypeArray*& theFaceLocations,
vtkIdType theCellId,
- vtkIdList *theIdList,
+ vtkIdList* /*theIdList*/,
bool theStoreMapping,
- vtkIdType theOutId,
+ vtkIdType /*theOutId*/,
VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId/*,
VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId*/)
{
theFaceLocations->InsertNextValue(theFaces->GetMaxId() + 1);
// insert cell connectivity and faces stream
- vtkIdType nfaces = 0;
- vtkIdType* face = 0;
+ vtkIdType nfaces = 0;
+ const vtkIdType* face = 0;
vtkIdType realnpts;
theInput->GetFaceStream(theCellId, nfaces, face);
vtkUnstructuredGrid::DecomposeAPolyhedronCell(
vtkIdType theCellId,
vtkIdList *theIdList,
bool theStoreMapping,
- vtkIdType theOutId,
+ vtkIdType /*theOutId*/,
VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId/*,
VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId*/)
{
cellTypesVec[ *type ] = *type;
}
-/* if(MYDEBUG){
+/*
MESSAGE("Execute - anInput->GetNumberOfCells() = "<<anInput->GetNumberOfCells());
MESSAGE("Execute - myCellTypes.size() = "<<myCellTypes.size());
MESSAGE("Execute - myCellIds.size() = "<<myCellIds.size());
MESSAGE("Execute - myExtractionMode = "<<myExtractionMode);
MESSAGE("Execute - myChangeMode = "<<myChangeMode);
- }*/
+*/
vtkIdType aNbElems = 0;
if(myExtractionMode == eCells)
{
}
}
if ( vtkIdType newNbElems = aConnectivity->GetNumberOfCells() ) {
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(newNbElems);
aConnectivity->InitTraversal();
- for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
+ vtkIdType const *pts(nullptr);
+ for(vtkIdType i = 0, npts; aConnectivity->GetNextCell(npts,pts); i++){
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
#if VTK_XVERSION > 50700
}
}
if (vtkIdType newNbElems = aConnectivity->GetNumberOfCells() ) {
- VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+ vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples( newNbElems );
aConnectivity->InitTraversal();
- for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
+ vtkIdType const *pts(nullptr);
+ for(vtkIdType i = 0, npts; aConnectivity->GetNextCell(npts,pts); i++){
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
#if VTK_XVERSION > 50700
myPassAll = true;
TVectorId().swap( myOut2InId );
}
-/* if(MYDEBUG){
+/*
MESSAGE("Execute - anOutput->GetNumberOfCells() = "<<anOutput->GetNumberOfCells());
if(myStoreMapping){
MESSAGE("Execute - myOut2InId.size() = "<<myOut2InId.size());
MESSAGE("Execute - myIn2OutId.size() = "<<myIn2OutId.size());
}
- }*/
+*/
return 1;
}