#include <vtkRenderer.h>
#include <vtkCell.h>
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+#if VTK_XVERSION > 50700
#include <vtkPolyhedron.h>
+#endif
#include <vtkPolyData.h>
#include "Utils_SALOME_Exception.hxx"
int aPartId = theMapIndex( ind );
if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
{
+#if VTK_XVERSION > 50700
if (aCell->GetCellType() != VTK_POLYHEDRON)
+#endif
myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+#if VTK_XVERSION > 50700
else
{
vtkPolyhedron *polyhedron = dynamic_cast<vtkPolyhedron*>(aCell);
vtkIdType *pts = polyhedron->GetFaces();
myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),pts[0], pts+1);
}
+#endif
}
}
#include <vtkCell.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
+#include <vtkVersion.h>
#include "utilities.h"
#endif
#endif
+#define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION)
+
vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid);
theIdList->SetId(i,aPntIds->GetId(i));
}
vtkIdType aCellType = aCell->GetCellType();
+#if VTK_XVERSION > 50700
if (aCellType != VTK_POLYHEDRON)
{
+#endif
theConnectivity->InsertNextCell(theIdList);
if (theFaceLocations)
theFaceLocations->InsertNextValue(-1);
+#if VTK_XVERSION > 50700
}
else
{
vtkUnstructuredGrid::DecomposeAPolyhedronCell(
nfaces, face, realnpts, theConnectivity, theFaces);
}
+#endif
theCellTypesArray->InsertNextValue(aCellType);
if(theStoreMapping){
MESSAGE("Execute - myChangeMode = "<<myChangeMode);
}*/
if(myExtractionMode == eCells){
- if(myChangeMode == ePassAll || myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving){
+ if(myChangeMode == ePassAll || (myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving)){
if(vtkIdType aNbElems = anInput->GetNumberOfCells()){
if(myStoreMapping) myOut2InId.reserve(aNbElems);
anOutput->ShallowCopy(anInput);
for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
+#if VTK_XVERSION > 50700
anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity,newFaceLocations,newFaces);
+#else
+ anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
+#endif
anOutput->SetPoints(anInput->GetPoints());
aCellLocationsArray->Delete();
}
aCellTypesArray->Allocate(aNbElems*aCellTypesArray->GetNumberOfComponents());
// additional condition has been added to treat a case described in IPAL21372
// note that it is significant only when myExtractionMode == ePoints
- if(myChangeMode == ePassAll || myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving ||
+ if(myChangeMode == ePassAll || (myCellIds.empty() && myCellTypes.empty() && myChangeMode == eRemoving) ||
!anInput->GetCellTypesArray()){
if(myStoreMapping) myOut2InId.reserve(aNbElems);
for(vtkIdType aCellId = 0, anOutId = 0; aCellId < aNbElems; aCellId++,anOutId++){
for(vtkIdType i = 0, *pts, npts; aConnectivity->GetNextCell(npts,pts); i++){
aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
}
+#if VTK_XVERSION > 50700
anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity,0, 0);
+#else
+ anOutput->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
+#endif
anOutput->SetPoints(anInput->GetPoints());
aCellLocationsArray->Delete();
}