From 58bdf173dfd9ccaa6fc99f34041db773c98475c0 Mon Sep 17 00:00:00 2001 From: Viktor UZLOV Date: Mon, 15 Feb 2021 12:07:47 +0300 Subject: [PATCH] fix SVTK --- src/SVTK/SALOME_Actor.cxx | 46 +++++++++++++++---------------- src/SVTK/SVTK_DeviceActor.cxx | 16 +++++------ src/SVTK/SVTK_DeviceActor.h | 12 ++++---- src/SVTK/SVTK_InteractorStyle.cxx | 10 +++---- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index 503cf1e91..74435febb 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -542,9 +542,9 @@ SALOME_Actor SVTK::TPickLimiter aPickLimiter( myPointPicker, this ); myPointPicker->Pick( x, y, z, aRenderer ); - int aVtkId = myPointPicker->GetPointId(); + vtkIdType aVtkId = myPointPicker->GetPointId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) { - int anObjId = GetNodeObjId( aVtkId ); + vtkIdType anObjId = GetNodeObjId( aVtkId ); myIsPreselected = (anObjId >= 0); if(myIsPreselected){ const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex(); @@ -572,9 +572,9 @@ SALOME_Actor SVTK::TPickLimiter aPickLimiter( myCellPicker, this ); myCellPicker->Pick( x, y, z, aRenderer ); - int aVtkId = myCellPicker->GetCellId(); + vtkIdType aVtkId = myCellPicker->GetCellId(); if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) && hasIO() ) { - int anObjId = GetElemObjId (aVtkId ); + vtkIdType anObjId = GetElemObjId (aVtkId ); if ( anObjId >= 0 ) { myIsPreselected = CheckDimensionId(aSelectionMode,this,anObjId); if(myIsPreselected){ @@ -599,16 +599,16 @@ SALOME_Actor SVTK::TPickLimiter aPickLimiter( myCellPicker, this ); myCellPicker->Pick( x, y, z, aRenderer ); - int aVtkId = myCellPicker->GetCellId(); + vtkIdType aVtkId = myCellPicker->GetCellId(); if ( aVtkId >= 0 && mySelector->IsValid( this, aVtkId )) { - int anObjId = GetElemObjId( aVtkId ); + vtkIdType anObjId = GetElemObjId( aVtkId ); if ( anObjId >= 0 ) { - int aFNId, aSNId; + vtkIdType aFNId, aSNId; int anEdgeId = GetEdgeAndNodesId(this,myCellPicker.GetPointer(),anObjId,aFNId,aSNId); myIsPreselected = anEdgeId < 0; if(myIsPreselected){ - int aFNObjId = GetNodeObjId( aFNId ); - int aSNObjId = GetNodeObjId( aSNId ); + vtkIdType aFNObjId = GetNodeObjId( aFNId ); + vtkIdType aSNObjId = GetNodeObjId( aSNId ); const SVTK_IndexedMapOfIds& aMapIds = myPreHighlightActor->GetMapCompositeIndex(); int anExtent = aMapIds.Extent(); anIsChanged |= (anExtent == 0 || (anExtent > 0 && aMapIds(1).size() == 2 && @@ -714,9 +714,9 @@ SALOME_Actor const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second; vtkIdType anEnd = (int)aVectorIds.size(); //!< TODO: conversion from size_t to int for(vtkIdType anId = 0; anId < anEnd; anId++ ) { - int aPointId = aVectorIds[anId]; + vtkIdType aPointId = aVectorIds[anId]; if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) { - int anObjId = GetNodeObjId( aPointId ); + vtkIdType anObjId = GetNodeObjId( aPointId ); anIndexes.Add( anObjId ); } } @@ -790,11 +790,11 @@ SALOME_Actor const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second; vtkIdType anEnd = (int)aVectorIds.size(); //!< TODO: conversion from size_t to int for(vtkIdType anId = 0; anId < anEnd; anId++ ) { - int aCellId = aVectorIds[anId]; + vtkIdType aCellId = aVectorIds[anId]; if ( !mySelector->IsValid( this, aCellId ) ) continue; - int anObjId = GetElemObjId( aCellId ); + vtkIdType anObjId = GetElemObjId( aCellId ); if( anObjId != -1 ) if ( CheckDimensionId(aSelectionMode,this,anObjId) ) { anIndexes.Add(anObjId); @@ -828,13 +828,13 @@ SALOME_Actor const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second; vtkIdType anEnd = (int)aVectorIds.size(); //!< TODO: conversion from size_t to int for(vtkIdType anId = 0; anId < anEnd; anId++ ) { - int aCellId = aVectorIds[anId]; + vtkIdType aCellId = aVectorIds[anId]; if ( !mySelector->IsValid( this, aCellId ) ) continue; - int anObjId = GetElemObjId( aCellId ); + vtkIdType anObjId = GetElemObjId( aCellId ); if( anObjId != -1 ) { - int aFNId, aSNId; + vtkIdType aFNId, aSNId; int anEdgeId = GetEdgeAndNodesId(this,myCellPicker.GetPointer(),anObjId,aFNId,aSNId); if( anEdgeId < 0 ) { SVTK_ListOfInteger aCompositeID; @@ -866,9 +866,9 @@ SALOME_Actor SVTK::TPickLimiter aPickLimiter( myPointPicker, this ); myPointPicker->Pick( x, y, 0.0, aRenderer ); - int aVtkId = myPointPicker->GetPointId(); + vtkIdType aVtkId = myPointPicker->GetPointId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId, true ) ) { - int anObjId = GetNodeObjId( aVtkId ); + vtkIdType anObjId = GetNodeObjId( aVtkId ); if( hasIO() && anObjId >= 0 ) { mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift ); mySelector->AddIObject( this ); @@ -886,9 +886,9 @@ SALOME_Actor SVTK::TPickLimiter aPickLimiter( myCellPicker, this ); myCellPicker->Pick( x, y, 0.0, aRenderer ); - int aVtkId = myCellPicker->GetCellId(); + vtkIdType aVtkId = myCellPicker->GetCellId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) { - int anObjId = GetElemObjId( aVtkId ); + vtkIdType anObjId = GetElemObjId( aVtkId ); if( anObjId >= 0 ) { if ( hasIO() && CheckDimensionId(aSelectionMode,this,anObjId) ) { mySelector->AddOrRemoveIndex( myIO, anObjId, anIsShift ); @@ -903,11 +903,11 @@ SALOME_Actor SVTK::TPickLimiter aPickLimiter( myCellPicker, this ); myCellPicker->Pick( x, y, 0.0, aRenderer ); - int aVtkId = myCellPicker->GetCellId(); + vtkIdType aVtkId = myCellPicker->GetCellId(); if( aVtkId >= 0 && mySelector->IsValid( this, aVtkId ) ) { - int anObjId = GetElemObjId( aVtkId ); + vtkIdType anObjId = GetElemObjId( aVtkId ); if( anObjId >= 0 ) { - int aFNId, aSNId; + vtkIdType aFNId, aSNId; int anEdgeId = GetEdgeAndNodesId(this,myCellPicker.GetPointer(),anObjId,aFNId,aSNId); if( hasIO() && anEdgeId < 0 ) { SVTK_ListOfInteger aCompositeID; diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index b7f4f42c8..4e7ad5247 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -268,8 +268,8 @@ SVTK_DeviceActor myPassFilter[ 0 ]->Update(); if ( vtkDataSet* aDataSet = myPassFilter[ 0 ]->GetOutput() ) { - int numCells=aDataSet->GetNumberOfCells(); - int numPts = aDataSet->GetNumberOfPoints(); + vtkIdType numCells=aDataSet->GetNumberOfCells(); + vtkIdType numPts = aDataSet->GetNumberOfPoints(); //It's impossible to use to apply "shrink" for "empty" dataset if (numCells < 1 || numPts < 1) return; @@ -576,9 +576,9 @@ SVTK_DeviceActor /*! Maps VTK index of a node to corresponding object index */ -int +vtkIdType SVTK_DeviceActor -::GetNodeObjId(int theVtkID) +::GetNodeObjId(vtkIdType theVtkID) { return theVtkID; } @@ -588,7 +588,7 @@ SVTK_DeviceActor */ double* SVTK_DeviceActor -::GetNodeCoord(int theObjID) +::GetNodeCoord(vtkIdType theObjID) { return GetInput()->GetPoint(theObjID); } @@ -599,7 +599,7 @@ SVTK_DeviceActor */ vtkCell* SVTK_DeviceActor -::GetElemCell(int theObjID) +::GetElemCell(vtkIdType theObjID) { return GetInput()->GetCell(theObjID); } @@ -607,9 +607,9 @@ SVTK_DeviceActor /*! Maps VTK index of a cell to corresponding object index */ -int +vtkIdType SVTK_DeviceActor -::GetElemObjId(int theVtkID) +::GetElemObjId(vtkIdType theVtkID) { return theVtkID; } diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index 82c31e1c5..0d5c8fc13 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -90,20 +90,20 @@ class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor /** @name For selection mapping purpose */ //@{ virtual - int - GetNodeObjId(int theVtkID); + vtkIdType + GetNodeObjId(vtkIdType theVtkID); virtual double* - GetNodeCoord(int theObjID); + GetNodeCoord(vtkIdType theObjID); virtual - int - GetElemObjId(int theVtkID); + vtkIdType + GetElemObjId(vtkIdType theVtkID); virtual vtkCell* - GetElemCell(int theObjID); + GetElemCell(vtkIdType theObjID); //! To provide VTK to Object and backward mapping virtual diff --git a/src/SVTK/SVTK_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index d3610ed9f..363587850 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -539,7 +539,7 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, { Selection_Mode aSelectionMode = GetSelector()->SelectionMode(); double* aCoords = NULL; - int aVtkId; + vtkIdType aVtkId; bool isTrueType = false; if( myCurrFocalPointType == SVTK::StartFocalPointSelection || @@ -553,7 +553,7 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, aVtkId = myPointPicker->GetPointId(); if ( aVtkId >= 0 ) { - int anObjId = anActor->GetNodeObjId( aVtkId ); + vtkIdType anObjId = anActor->GetNodeObjId( aVtkId ); aCoords = anActor->GetNodeCoord(anObjId); isTrueType = true; } @@ -569,7 +569,7 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, 0.0, GetCurrentRenderer() ); aVtkId = aCellPicker->GetCellId(); - int aCellId = anActor->GetElemObjId( aVtkId ); + vtkIdType aCellId = anActor->GetElemObjId( aVtkId ); if( aSelectionMode == EdgeSelection ) isTrueType = anActor->GetObjDimension( aCellId ) == 1; @@ -1370,9 +1370,9 @@ void SVTK_InteractorStyle::onCursorMove(QPoint /*mousePos*/) { SVTK::TPickLimiter aPickLimiter( myPointPicker, anActor ); myPointPicker->Pick( aSelectionEvent->myX, aSelectionEvent->myY, 0.0, GetCurrentRenderer() ); - int aVtkId = myPointPicker->GetPointId(); + vtkIdType aVtkId = myPointPicker->GetPointId(); if ( aVtkId >= 0 ) { - int anObjId = anActor->GetNodeObjId( aVtkId ); + vtkIdType anObjId = anActor->GetNodeObjId( aVtkId ); TColStd_IndexedMapOfInteger aMapIndex; aMapIndex.Add( anObjId ); -- 2.39.2