mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +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:
parent
1ccc1371b9
commit
e607bd3e6b
@ -193,11 +193,13 @@ void IVtkOCC_ViewerSelector::Activate (const Handle(SelectMgr_Selection)& theSel
|
||||
aSelEntIter.Value()->SetActiveForSelection();
|
||||
}
|
||||
|
||||
if (theSelection->GetSelectionState() != SelectMgr_SOS_Activated)
|
||||
{
|
||||
theSelection->SetSelectionState (SelectMgr_SOS_Activated);
|
||||
|
||||
myTolerances.Add (theSelection->Sensitivity());
|
||||
myToUpdateTolerance = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
// Method: Deactivate
|
||||
@ -210,8 +212,10 @@ void IVtkOCC_ViewerSelector::Deactivate (const Handle(SelectMgr_Selection)& theS
|
||||
aSelEntIter.Value()->ResetSelectionActiveStatus();
|
||||
}
|
||||
|
||||
if (theSelection->GetSelectionState() == SelectMgr_SOS_Activated)
|
||||
{
|
||||
theSelection->SetSelectionState (SelectMgr_SOS_Deactivated);
|
||||
|
||||
myTolerances.Decrement (theSelection->Sensitivity());
|
||||
myToUpdateTolerance = Standard_True;
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ class IVtkTools_ShapeDataSource;
|
||||
class Standard_EXPORT IVtkTools_ShapeObject : public vtkDataObject
|
||||
{
|
||||
public:
|
||||
vtkTypeMacro (IVtkTools_ShapeObject, vtkObject)
|
||||
vtkTypeMacro (IVtkTools_ShapeObject, vtkDataObject)
|
||||
|
||||
static IVtkTools_ShapeObject* New();
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user