0028488: VIS - fix compilation with VTK 8.2
[occt.git] / src / IVtkVTK / IVtkVTK_ShapeData.hxx
index cb9fa37..04ceac3 100644 (file)
@@ -24,6 +24,7 @@
 #endif
 #include <vtkPolyData.h>
 #include <vtkSmartPointer.h>
+#include <vtkIdTypeArray.h>
 #ifdef _MSC_VER
 #pragma warning(pop)
 #endif
@@ -106,6 +107,23 @@ public: //! @name Specific methods
   { return myPolyData; }
 
 private:
+
+  //! Wrapper over vtkGenericDataArray::InsertNextTypedTuple().
+  void insertNextSubShapeId (IVtk_IdType theShapeID,
+                             IVtk_MeshType theMeshType)
+  {
+    const vtkIdType aShapeIDVTK = theShapeID;
+    const vtkIdType aType = theMeshType;
+  #if (VTK_MAJOR_VERSION > 7) || (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION >= 1)
+    mySubShapeIDs->InsertNextTypedTuple (&aShapeIDVTK);
+    myMeshTypes->InsertNextTypedTuple (&aType);
+  #else
+    mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
+    myMeshTypes->InsertNextTupleValue (&aType);
+  #endif
+  }
+
+private:
   vtkSmartPointer< vtkPolyData >    myPolyData;    //!< Shape geometry as vtkPolyData
   vtkSmartPointer< vtkIdTypeArray > mySubShapeIDs; //!< Array of sub-shapes ids
   vtkSmartPointer< vtkIdTypeArray > myMeshTypes;   //!< Array of type codes of mesh parts