mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0028488: VIS - fix compilation with VTK 8.2
Occurrences of removed method vtkDataArray::InsertNextTupleValue() have been replaced by InsertNextTypedTuple(). Fixed misprint in vtkTypeMacro usage for class IVtkTools_ShapeObject. Patch #0030452 (SelectMgr_ViewerSelector::Deactivate() raises exception when called twice) has been propagated to IVtkOCC_ViewerSelector.
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#include <vtkCellData.h>
|
||||
#include <vtkDoubleArray.h>
|
||||
#include <vtkIdList.h>
|
||||
#include <vtkIdTypeArray.h>
|
||||
#include <vtkPoints.h>
|
||||
#include <vtkPolyData.h>
|
||||
#ifdef _MSC_VER
|
||||
@@ -80,10 +79,7 @@ void IVtkVTK_ShapeData::InsertVertex (const IVtk_IdType theShapeID,
|
||||
{
|
||||
vtkIdType aPointIdVTK = thePointId;
|
||||
myPolyData->InsertNextCell (VTK_VERTEX, 1, &aPointIdVTK);
|
||||
const vtkIdType aShapeIDVTK = theShapeID;
|
||||
mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
|
||||
const vtkIdType aType = theMeshType;
|
||||
myMeshTypes->InsertNextTupleValue (&aType);
|
||||
insertNextSubShapeId (theShapeID, theMeshType);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
@@ -97,10 +93,7 @@ void IVtkVTK_ShapeData::InsertLine (const IVtk_IdType theShapeID,
|
||||
{
|
||||
vtkIdType aPoints[2] = { thePointId1, thePointId2 };
|
||||
myPolyData->InsertNextCell (VTK_LINE, 2, aPoints);
|
||||
const vtkIdType aShapeIDVTK = theShapeID;
|
||||
mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
|
||||
const vtkIdType aType = theMeshType;
|
||||
myMeshTypes->InsertNextTupleValue (&aType);
|
||||
insertNextSubShapeId (theShapeID, theMeshType);
|
||||
}
|
||||
|
||||
//================================================================
|
||||
@@ -124,10 +117,7 @@ void IVtkVTK_ShapeData::InsertLine (const IVtk_IdType theShapeID,
|
||||
}
|
||||
|
||||
myPolyData->InsertNextCell (VTK_POLY_LINE, anIdList);
|
||||
const vtkIdType aShapeIDVTK = theShapeID;
|
||||
mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
|
||||
const vtkIdType aType = theMeshType;
|
||||
myMeshTypes->InsertNextTupleValue (&aType);
|
||||
insertNextSubShapeId (theShapeID, theMeshType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,8 +133,5 @@ void IVtkVTK_ShapeData::InsertTriangle (const IVtk_IdType theShapeID,
|
||||
{
|
||||
vtkIdType aPoints[3] = { thePointId1, thePointId2, thePointId3 };
|
||||
myPolyData->InsertNextCell (VTK_TRIANGLE, 3, aPoints);
|
||||
const vtkIdType aShapeIDVTK = theShapeID;
|
||||
mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
|
||||
const vtkIdType aType = theMeshType;
|
||||
myMeshTypes->InsertNextTupleValue (&aType);
|
||||
insertNextSubShapeId (theShapeID, theMeshType);
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#endif
|
||||
#include <vtkPolyData.h>
|
||||
#include <vtkSmartPointer.h>
|
||||
#include <vtkIdTypeArray.h>
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
@@ -105,6 +106,23 @@ public: //! @name Specific methods
|
||||
vtkPolyData* getVtkPolyData() const
|
||||
{ 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
|
||||
|
Reference in New Issue
Block a user