Salome HOME
Merge branch 'agy/ssl_0'
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 22 Apr 2021 11:20:42 +0000 (13:20 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 22 Apr 2021 11:20:42 +0000 (13:20 +0200)
32 files changed:
src/LightApp/LightApp_VTKSelector.cxx
src/LightApp/LightApp_VTKSelector.h
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_Actor.cxx
src/SVTK/SVTK_Actor.h
src/SVTK/SVTK_DeviceActor.cxx
src/SVTK/SVTK_DeviceActor.h
src/SVTK/SVTK_Hash.h
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_Selector.cxx
src/SVTK/SVTK_Selector.h
src/SVTK/SVTK_SelectorDef.h
src/VTKViewer/CMakeLists.txt
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Actor.h
src/VTKViewer/VTKViewer_AppendFilter.cxx
src/VTKViewer/VTKViewer_ArcBuilder.cxx
src/VTKViewer/VTKViewer_ArcBuilder.h
src/VTKViewer/VTKViewer_CellLocationsArray.h
src/VTKViewer/VTKViewer_ConvexTool.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx
src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h
src/VTKViewer/VTKViewer_Filter.cxx
src/VTKViewer/VTKViewer_Filter.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx
src/VTKViewer/VTKViewer_GeometryFilter.h
src/VTKViewer/VTKViewer_InteractorStyle.cxx
src/VTKViewer/VTKViewer_InteractorStyle.h
src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx
src/VTKViewer/VTKViewer_RenderWindowInteractor.h
src/VTKViewer/VTKViewer_ShrinkFilter.cxx
src/VTKViewer/VTKViewer_ShrinkFilter.h

index 3d637ae407fa36dab639b1851c546e347176ff16..b7cded04f5c8fdc8ed827cc349aacc940cdcf552 100644 (file)
@@ -77,7 +77,7 @@ LightApp_SVTKDataOwner
 /*!
   Gets dataowners ids list.
 */
-const TColStd_IndexedMapOfInteger
+const SVTK_TIndexedMapOfVtkId
 LightApp_SVTKDataOwner
 ::GetIds() const
 {
index 8d9ffcea68bd0ebaacd67b8d8c6c45461363389f..84791de9e8e0718e6390561aa241231beb9e3cd0 100644 (file)
@@ -33,6 +33,7 @@ class SUIT_Desktop;
 
 #ifndef DISABLE_VTKVIEWER
   #include <TColStd_IndexedMapOfInteger.hxx>
+  #include "SVTK_Hash.h"
   #include "SVTK_Selection.h"
 #ifndef DISABLE_SALOMEOBJECT
   #include "SALOME_InteractiveObject.hxx"
@@ -57,7 +58,7 @@ class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
    #endif
 
     /*!Gets dataowners ids list.*/
-    const TColStd_IndexedMapOfInteger& GetIds() const;
+    const SVTK_TIndexedMapOfVtkId& GetIds() const;
 
     /*!Gets selection mode.*/
     Selection_Mode GetMode() const;
@@ -66,7 +67,7 @@ class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner
     SALOME_Actor* GetActor() const;
 
  protected:
-    mutable TColStd_IndexedMapOfInteger myIds;
+    mutable SVTK_TIndexedMapOfVtkId myIds;
 
     SVTK_ViewWindow* GetActiveViewWindow() const;
     SUIT_Desktop* myDesktop;
index 9642ce0ff82f3a2582547aecef43e33eeeb5d9d1..d71c17d7e6d6f260c1b1e2d2996fb04531ac33ef 100644 (file)
@@ -86,9 +86,9 @@ namespace
   int
   GetEdgeAndNodesId(SALOME_Actor* theActor,
                     vtkPicker* thePicker,
-                    int theObjId,
-                    int& theFirstNodeId,
-                    int& theSecondNodeId)
+                    vtkIdType theObjId,
+                    vtkIdType& theFirstNodeId,
+                    vtkIdType& theSecondNodeId)
   {
     int anEdgeId = 0;
     if (vtkCell* aPickedCell = theActor->GetElemCell(theObjId)) {
@@ -449,7 +449,7 @@ SALOME_Actor
 
   if(mySelector.GetPointer()){
     if(mySelectionMode != ActorSelection){
-      TColStd_IndexedMapOfInteger aMapIndex;
+      SVTK_TIndexedMapOfVtkId aMapIndex;
       mySelector->GetIndex( getIO(), aMapIndex );
       switch( mySelectionMode ) {
       case NodeSelection:
@@ -466,7 +466,7 @@ SALOME_Actor
         myHighlightActor->MapCells( this, aMapIndex );
         break;
       case EdgeOfCellSelection:
-       SVTK_IndexedMapOfIds aMapCompositeIndex;
+       SVTK_IndexedMapOfVtkIds aMapCompositeIndex;
        mySelector->GetCompositeIndex( getIO(), aMapCompositeIndex );
         myHighlightActor->GetProperty()->SetRepresentationToWireframe();
        myHighlightActor->MapEdge( this, aMapCompositeIndex );
@@ -542,16 +542,16 @@ 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();
-          int anExtent = aMapIndex.Extent();
+          const SVTK_TIndexedMapOfVtkId& aMapIndex = myPreHighlightActor->GetMapIndex();
+          vtkIdType anExtent = aMapIndex.Extent();
           anIsChanged |= (anExtent == 0 || (anExtent > 0 && anObjId != aMapIndex(1)));
           if(anIsChanged){
-            TColStd_IndexedMapOfInteger aMapIndex;
+            SVTK_TIndexedMapOfVtkId aMapIndex;
             aMapIndex.Add( anObjId );
             
             myPreHighlightActor->GetProperty()->SetRepresentationToPoints();
@@ -572,17 +572,17 @@ 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){
-            const TColStd_IndexedMapOfInteger& aMapIndex = myPreHighlightActor->GetMapIndex();
-            int anExtent = aMapIndex.Extent();
+            const SVTK_TIndexedMapOfVtkId& aMapIndex = myPreHighlightActor->GetMapIndex();
+            vtkIdType anExtent = aMapIndex.Extent();
             anIsChanged |= (anExtent == 0 || (anExtent > 0 && anObjId != aMapIndex(1)));
             if(anIsChanged){
-              TColStd_IndexedMapOfInteger aMapIndex;
+              SVTK_TIndexedMapOfVtkId aMapIndex;
               aMapIndex.Add( anObjId );
               
               myPreHighlightActor->GetProperty()->SetRepresentationToSurface();
@@ -599,23 +599,23 @@ 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 );
-            const SVTK_IndexedMapOfIds& aMapIds = myPreHighlightActor->GetMapCompositeIndex();
-            int anExtent = aMapIds.Extent();
+           vtkIdType aFNObjId = GetNodeObjId( aFNId );
+           vtkIdType aSNObjId = GetNodeObjId( aSNId );
+            const SVTK_IndexedMapOfVtkIds& aMapIds = myPreHighlightActor->GetMapCompositeIndex();
+            vtkIdType anExtent = aMapIds.Extent();
             anIsChanged |= (anExtent == 0 || (anExtent > 0 && aMapIds(1).size() == 2 && 
                                             (aFNObjId != aMapIds(1)[0] || aSNObjId != aMapIds(1)[1] ) ) );
             if( anIsChanged ) {
-             SVTK_IndexedMapOfIds aMapIds;
-             SVTK_ListOfInteger aCompositeID;
+             SVTK_IndexedMapOfVtkIds aMapIds;
+             SVTK_ListOfVtk aCompositeID;
               aCompositeID.push_back( aFNObjId );
               aCompositeID.push_back( aSNObjId );
              aMapIds.Add( aCompositeID );
@@ -709,14 +709,14 @@ SALOME_Actor
 
       const SVTK_AreaPicker::TVectorIdsMap& aVectorIdsMap = myPointAreaPicker->GetPointIdsMap();
       SVTK_AreaPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
-      TColStd_MapOfInteger anIndexes;
+      SVTK_TVtkIDsMap anIndexes;
       if(aMapIter != aVectorIdsMap.end()){
         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 );
           }
         }
@@ -785,16 +785,16 @@ SALOME_Actor
 
       const SVTK_AreaPicker::TVectorIdsMap& aVectorIdsMap = myCellAreaPicker->GetCellIdsMap();
       SVTK_AreaPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
-      TColStd_MapOfInteger anIndexes;
+      SVTK_TVtkIDsMap anIndexes;
       if(aMapIter != aVectorIdsMap.end()){
         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);
@@ -823,21 +823,21 @@ SALOME_Actor
 
       const SVTK_AreaPicker::TVectorIdsMap& aVectorIdsMap = myCellAreaPicker->GetCellIdsMap();
       SVTK_AreaPicker::TVectorIdsMap::const_iterator aMapIter = aVectorIdsMap.find(this);
-      SVTK_IndexedMapOfIds anIndexes;
+      SVTK_IndexedMapOfVtkIds anIndexes;
       if(aMapIter != aVectorIdsMap.end()){
         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;
+             SVTK_ListOfVtk aCompositeID;
               aCompositeID.push_back( GetNodeObjId( aFNId ) );
               aCompositeID.push_back( GetNodeObjId( aSNId ) );
              anIndexes.Add( 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,14 +903,14 @@ 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;
+           SVTK_ListOfVtk aCompositeID;
            aCompositeID.push_back( GetNodeObjId( aFNId ) );
            aCompositeID.push_back( GetNodeObjId( aSNId ) );
            mySelector->AddOrRemoveCompositeIndex( myIO, aCompositeID, anIsShift );
index 8eef21bd29fb9736dffb63534b1f37cd616f3100..c54cc6bb938ea19b9aff04ba5ff4aeaf967526e4 100644 (file)
@@ -96,7 +96,7 @@ SVTK_Actor
 {
 }
 
-const TColStd_IndexedMapOfInteger&
+const SVTK_TIndexedMapOfVtkId&
 SVTK_Actor
 ::GetMapIndex() const
 {
@@ -104,7 +104,7 @@ SVTK_Actor
 }
 
 
-const SVTK_IndexedMapOfIds&
+const SVTK_IndexedMapOfVtkIds&
 SVTK_Actor
 ::GetMapCompositeIndex() const 
 {
@@ -114,7 +114,7 @@ SVTK_Actor
 void
 SVTK_Actor
 ::MapCells(SALOME_Actor* theMapActor,
-           const TColStd_IndexedMapOfInteger& theMapIndex)
+           const SVTK_TIndexedMapOfVtkId& theMapIndex)
 {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
@@ -156,7 +156,7 @@ SVTK_Actor
 void 
 SVTK_Actor
 ::MapPoints(SALOME_Actor* theMapActor,
-            const TColStd_IndexedMapOfInteger& theMapIndex)
+            const SVTK_TIndexedMapOfVtkId& theMapIndex)
 {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
@@ -165,7 +165,7 @@ SVTK_Actor
     vtkPoints *aPoints = vtkPoints::New();
     aPoints->SetNumberOfPoints(aNbOfParts);
     for(vtkIdType i = 0; i < aNbOfParts; i++){
-      int aPartId = theMapIndex( i+1 );
+         vtkIdType aPartId = theMapIndex( i+1 );
       if(double* aCoord = theMapActor->GetNodeCoord(aPartId)){
         aPoints->SetPoint(i,aCoord);
         // Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
@@ -185,7 +185,7 @@ SVTK_Actor
 void
 SVTK_Actor
 ::MapEdge(SALOME_Actor* theMapActor,
-          const TColStd_IndexedMapOfInteger& theMapIndex)
+          const SVTK_TIndexedMapOfVtkId& theMapIndex)
 {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
@@ -224,16 +224,16 @@ SVTK_Actor
 void
 SVTK_Actor
 ::MapEdge( SALOME_Actor* theMapActor, 
-           const SVTK_IndexedMapOfIds& theMapCompositeIndex) {
+           const SVTK_IndexedMapOfVtkIds& theMapCompositeIndex) {
   myUnstructuredGrid->Initialize();
   myUnstructuredGrid->Allocate();
 
   vtkUnstructuredGrid * aSourceGrid = ( vtkUnstructuredGrid * )theMapActor->GetInput();
   GetSource()->SetPoints( aSourceGrid->GetPoints() );
 
-  int aNbOfParts = theMapCompositeIndex.Extent();
-  for(int ind = 1; ind <= aNbOfParts; ind++){
-      std::vector<int> aNodesIds = theMapCompositeIndex( ind );
+  vtkIdType aNbOfParts = theMapCompositeIndex.Extent();
+  for(vtkIdType ind = 1; ind <= aNbOfParts; ind++){
+      std::vector<vtkIdType> aNodesIds = theMapCompositeIndex( ind );
       vtkSmartPointer<vtkIdList> ids = vtkSmartPointer<vtkIdList>::New();
       ids->InsertNextId(theMapActor->GetNodeVtkId( aNodesIds[0] ) );
       ids->InsertNextId(theMapActor->GetNodeVtkId( aNodesIds[1] ) );
index 69c9337b64ee67e49d112e1a9a2790414a7e6095..fe576d1e679de6eefc2188fcd4c48653db2b1f29 100644 (file)
@@ -72,33 +72,33 @@ public:
   //! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes
   virtual void
   MapCells(SALOME_Actor* theMapActor, 
-           const TColStd_IndexedMapOfInteger& theMapIndex);
+           const SVTK_TIndexedMapOfVtkId& theMapIndex);
 
   //! Allow to recostruct selected points from source SALOME_Actor and map of subindexes
   virtual void 
   MapPoints(SALOME_Actor* theMapActor, 
-            const TColStd_IndexedMapOfInteger& theMapIndex);
+            const SVTK_TIndexedMapOfVtkId& theMapIndex);
 
   //! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes
   virtual void 
   MapEdge(SALOME_Actor* theMapActor, 
-          const TColStd_IndexedMapOfInteger& theMapIndex);
+          const SVTK_TIndexedMapOfVtkId& theMapIndex);
 
 //! Allow to recostruct selected edges from source SALOME_Actor and map of subindexes using corner node ids
   virtual void 
   MapEdge(SALOME_Actor* theMapActor, 
-          const SVTK_IndexedMapOfIds& theMapCompositeIndex);
+          const SVTK_IndexedMapOfVtkIds& theMapCompositeIndex);
   
 
-  const TColStd_IndexedMapOfInteger&
+  const SVTK_TIndexedMapOfVtkId&
   GetMapIndex() const;
 
-  const SVTK_IndexedMapOfIds&
+  const SVTK_IndexedMapOfVtkIds&
   GetMapCompositeIndex() const;
 
  protected:
-  TColStd_IndexedMapOfInteger myMapIndex;
-  SVTK_IndexedMapOfIds        myMapCompositeIndex;
+  SVTK_TIndexedMapOfVtkId        myMapIndex;
+  SVTK_IndexedMapOfVtkIds        myMapCompositeIndex;
 
   vtkSmartPointer<vtkUnstructuredGrid> myUnstructuredGrid;
 
index 80b1e7c334187667eafbbf98c7d4c24da956e6a1..246edae958c21a882727613e8056a6629cf13d28 100644 (file)
@@ -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;
 }
index c3f60d92f89cedecff7cdc317e91e749d7058bdc..06beaa0d59f029913b499122d39341374abe5210 100644 (file)
@@ -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 
index 0b40e34144b3125fd16ed4c7e47a26e4e40c76b3..32fe4480c6e89ddecb91337147c22670e465cb5f 100644 (file)
 
 #include <vector>
 #include <NCollection_IndexedMap.hxx>
+#include <NCollection_Map.hxx>
 #include <Standard_Integer.hxx>
+#include <vtkType.h>
+#include <limits>
 
 typedef std::vector<Standard_Integer> SVTK_ListOfInteger;
+typedef std::vector<vtkIdType> SVTK_ListOfVtk;
 
 class SVTK_Hasher {
 
 public:
-    static Standard_Integer HashCode(const std::vector<Standard_Integer> ids,
-                                    const Standard_Integer upper) {
-        Standard_Integer seed = (Standard_Integer)ids.size(); //!< TODO: conversion from size_t to int
-        for( Standard_Integer i = 0; i <  (Standard_Integer) ids.size(); i++ ) {
-            Standard_Integer v = ids[i];
-            seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
-        }
-        return ::HashCode(seed,upper);
-    }
-
-    static Standard_Boolean IsEqual(const SVTK_ListOfInteger& theKey1,
-                                    const SVTK_ListOfInteger& theKey2) {
-        return theKey1 == theKey2;
-    }
+  static Standard_Integer HashCode(const std::vector<Standard_Integer> ids,
+                                   const Standard_Integer              upper)
+  {
+    Standard_Integer seed = (Standard_Integer)ids.size();
+    for ( Standard_Integer v : ids )
+      seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
+
+    return ::HashCode(seed,upper);
+  }
+
+  static Standard_Boolean IsEqual(const SVTK_ListOfInteger& theKey1,
+                                  const SVTK_ListOfInteger& theKey2)
+  {
+    return theKey1 == theKey2;
+  }
+};
+
+class SVTK_vtkHasher {
+
+public:
+  static vtkIdType HashCode(const std::vector<vtkIdType> ids,
+                            const Standard_Integer       upper)
+  {
+    vtkIdType seed = (vtkIdType)ids.size();
+    for ( vtkIdType v : ids )
+      seed ^= v + 0x9e3779b97f4a7c15 + ( seed << 6 ) + ( seed >> 2 );
+
+    return ::HashCode((Standard_Integer) seed, upper);
+  }
+
+  static vtkIdType IsEqual(const SVTK_ListOfVtk& theKey1,
+                           const SVTK_ListOfVtk& theKey2)
+  {
+    return theKey1 == theKey2;
+  }
+};
+
+struct svtkIdHasher
+{
+  static int HashCode(const vtkIdType theValue,  const int theUpperBound)
+  {
+    return static_cast<int> ((theValue & (std::numeric_limits<vtkIdType>::max)()) % theUpperBound + 1);
+  }
+
+  static bool IsEqual( const vtkIdType& id1, const vtkIdType& id2 )
+  {
+    return id1 == id2;
+  }
 };
 
 typedef NCollection_IndexedMap<SVTK_ListOfInteger,SVTK_Hasher> SVTK_IndexedMapOfIds;
+typedef NCollection_IndexedMap<SVTK_ListOfVtk, SVTK_vtkHasher> SVTK_IndexedMapOfVtkIds;
+typedef NCollection_Map< vtkIdType, svtkIdHasher > SVTK_TVtkIDsMap;
+typedef NCollection_Map< vtkIdType, svtkIdHasher >::Iterator SVTK_TVtkIDsMapIterator;
+typedef NCollection_IndexedMap<vtkIdType,svtkIdHasher> SVTK_TIndexedMapOfVtkId;
 
 #endif // SVTK_HASH_H
index c0aa791c7d33d50ac66da433ed90b57ad2ba6ca0..92c2b81993152f5675d8c640ed9b1ec79107ffa9 100644 (file)
@@ -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,11 +1370,11 @@ 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;
+            SVTK_TIndexedMapOfVtkId aMapIndex;
             aMapIndex.Add( anObjId );
             myHighlightSelectionPointActor->MapPoints( anActor, aMapIndex );
 
index 02840da43ebbe214203c5e5618050ddbec188e47..6eff6187a3c3f0d7679907706e5548129e435142 100644 (file)
@@ -273,7 +273,7 @@ SVTK_SelectorDef
 void 
 SVTK_SelectorDef
 ::GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-            TColStd_IndexedMapOfInteger& theIndex)
+            SVTK_TIndexedMapOfVtkId& theIndex)
 {
   TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO);
   if(anIter != myMapIOSubIndex.end())
@@ -294,14 +294,14 @@ SVTK_SelectorDef
 {
   TMapIOSubIndex::const_iterator anIter = myMapIOSubIndex.find(theIO);
   if(anIter != myMapIOSubIndex.end()){
-    const TColStd_IndexedMapOfInteger& aMapIndex = anIter->second.myMap;
+    const SVTK_TIndexedMapOfVtkId& aMapIndex = anIter->second.myMap;
     return aMapIndex.Contains( theIndex ) == Standard_True;
   }
 
   return false;
 }
 
-static bool removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, const int theIndex)
+static bool removeIndex(SVTK_TIndexedMapOfVtkId& theMapIndex, const int theIndex)
 {
   int anId = theMapIndex.FindIndex(theIndex); // i==0 if Index is not in the MapIndex
   if(anId){
@@ -310,7 +310,7 @@ static bool removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, const int theI
     if(aLastId == anId)
       theMapIndex.RemoveLast();
     else{
-      TColStd_IndexedMapOfInteger aNewMap;
+      SVTK_TIndexedMapOfVtkId aNewMap;
       aNewMap.ReSize(theMapIndex.Extent()-1);
       for(int j = 1; j <= theMapIndex.Extent(); j++){
         int anIndex = theMapIndex(j);
@@ -323,19 +323,19 @@ static bool removeIndex(TColStd_IndexedMapOfInteger& theMapIndex, const int theI
   return anId != 0;
 }
 
-static bool removeCompositeIndex( SVTK_IndexedMapOfIds& theMapIndex, const SVTK_ListOfInteger theIds )
+static bool removeCompositeIndex( SVTK_IndexedMapOfVtkIds& theMapIndex, const SVTK_ListOfVtk theIds )
 {
   int anId = theMapIndex.FindIndex( theIds ); // i==0 if Index is not in the MapIndex
   if( anId ) {
     // only the last key can be removed
-    SVTK_ListOfInteger aLastIds = theMapIndex.FindKey( theMapIndex.Extent() );
+    SVTK_ListOfVtk aLastIds = theMapIndex.FindKey( theMapIndex.Extent() );
     if( aLastIds == theIds )
       theMapIndex.RemoveLast();
     else {
-      SVTK_IndexedMapOfIds aNewMap;
+      SVTK_IndexedMapOfVtkIds aNewMap;
       aNewMap.ReSize(theMapIndex.Extent()-1);
       for( int j = 1; j <= theMapIndex.Extent(); j++ ){
-        SVTK_ListOfInteger anIds = theMapIndex( j );
+        SVTK_ListOfVtk anIds = theMapIndex( j );
         if ( anIds != theIds )
           aNewMap.Add( anIds );
       }
@@ -355,7 +355,7 @@ static bool removeCompositeIndex( SVTK_IndexedMapOfIds& theMapIndex, const SVTK_
 bool
 SVTK_SelectorDef
 ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    const SVTK_TIndexedMapOfVtkId& theIndices, 
                     bool theIsModeShift)
 {
   TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO);
@@ -364,7 +364,7 @@ SVTK_SelectorDef
     aMapIter = myMapIOSubIndex.
       insert(TMapIOSubIndex::value_type(theIO,anEmpty)).first;
   }
-  TColStd_IndexedMapOfInteger& aMapIndex = aMapIter->second.myMap;
+  SVTK_TIndexedMapOfVtkId& aMapIndex = aMapIter->second.myMap;
 
   if(!theIsModeShift)
     aMapIndex.Clear();
@@ -390,7 +390,7 @@ SVTK_SelectorDef
 bool
 SVTK_SelectorDef
 ::AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_MapOfInteger& theIndices, 
+                    const SVTK_TVtkIDsMap& theIndices, 
                     bool theIsModeShift)
 {
   TMapIOSubIndex::iterator aMapIter = myMapIOSubIndex.find(theIO);
@@ -399,12 +399,12 @@ SVTK_SelectorDef
     aMapIter = myMapIOSubIndex.
       insert(TMapIOSubIndex::value_type(theIO,anEmpty)).first;
   }
-  TColStd_IndexedMapOfInteger& aMapIndex = aMapIter->second.myMap;
+  SVTK_TIndexedMapOfVtkId& aMapIndex = aMapIter->second.myMap;
 
   if(!theIsModeShift)
     aMapIndex.Clear();
   
-  TColStd_MapIteratorOfMapOfInteger anIter(theIndices);
+  SVTK_TVtkIDsMapIterator anIter(theIndices);
   for(; anIter.More(); anIter.Next())
     aMapIndex.Add(anIter.Key());
   
@@ -435,7 +435,7 @@ SVTK_SelectorDef
     anIter = myMapIOSubIndex.
       insert(TMapIOSubIndex::value_type(theIO,anEmpty)).first;
   }
-  TColStd_IndexedMapOfInteger& aMapIndex = anIter->second.myMap;
+  SVTK_TIndexedMapOfVtkId& aMapIndex = anIter->second.myMap;
 
   bool anIsConatains = aMapIndex.Contains( theIndex ) == Standard_True;
   if ( anIsConatains )
@@ -466,7 +466,7 @@ SVTK_SelectorDef
 {
   if(IsIndexSelected(theIO,theIndex)){
     TMapIOSubIndex::iterator anIter = myMapIOSubIndex.find(theIO);
-    TColStd_IndexedMapOfInteger& aMapIndex = anIter->second.myMap;
+    SVTK_TIndexedMapOfVtkId& aMapIndex = anIter->second.myMap;
     removeIndex(aMapIndex,theIndex);
   }
 }
@@ -499,7 +499,7 @@ SVTK_SelectorDef
 void 
 SVTK_SelectorDef
 ::GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    SVTK_IndexedMapOfIds& theIds )
+                    SVTK_IndexedMapOfVtkIds& theIds )
 {
   TMapIOSubCompositeIndex::const_iterator anIter = myMapIOSubCompositeIndex.find( theIO );
   if( anIter != myMapIOSubCompositeIndex.end() )
@@ -517,15 +517,15 @@ SVTK_SelectorDef
 bool
 SVTK_SelectorDef
 ::AddOrRemoveCompositeIndex( const Handle( SALOME_InteractiveObject )& theIO, 
-                    const SVTK_IndexedMapOfIds& theIds, 
+                    const SVTK_IndexedMapOfVtkIds& theIds, 
                     bool theIsModeShift)
 {
   TMapIOSubCompositeIndex::iterator aMapIter = myMapIOSubCompositeIndex.find( theIO );
   if( aMapIter == myMapIOSubCompositeIndex.end() ) {
-    SVTK_IndexedMapOfIds anEmpty;
+    SVTK_IndexedMapOfVtkIds anEmpty;
     aMapIter = myMapIOSubCompositeIndex.insert( TMapIOSubCompositeIndex::value_type( theIO, anEmpty ) ).first;
   }
-  SVTK_IndexedMapOfIds& aMapIndex = aMapIter->second;
+  SVTK_IndexedMapOfVtkIds& aMapIndex = aMapIter->second;
 
   if( !theIsModeShift )
     aMapIndex.Clear();
@@ -549,16 +549,16 @@ SVTK_SelectorDef
 bool 
 SVTK_SelectorDef
 ::AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                            SVTK_ListOfInteger theIds,
+                            SVTK_ListOfVtk theIds,
                             bool theIsModeShift)
 {
   TMapIOSubCompositeIndex::iterator anIter = myMapIOSubCompositeIndex.find( theIO );
   if( anIter == myMapIOSubCompositeIndex.end() ) {
-    SVTK_IndexedMapOfIds anEmpty;
+    SVTK_IndexedMapOfVtkIds anEmpty;
     anIter = myMapIOSubCompositeIndex.insert(TMapIOSubCompositeIndex::value_type( theIO,anEmpty ) ).first;
   }
 
-  SVTK_IndexedMapOfIds& aMapIndex = anIter->second;
+  SVTK_IndexedMapOfVtkIds& aMapIndex = anIter->second;
 
   bool anIsContains = aMapIndex.Contains( theIds ) == Standard_True;
   if ( anIsContains )
@@ -584,11 +584,11 @@ SVTK_SelectorDef
 void
 SVTK_SelectorDef
 ::RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                       SVTK_ListOfInteger theIds )
+                       SVTK_ListOfVtk theIds )
 {
   if(IsCompositeIndexSelected( theIO, theIds ) ) {
     TMapIOSubCompositeIndex::iterator anIter = myMapIOSubCompositeIndex.find( theIO );
-    SVTK_IndexedMapOfIds& aMapIndex = anIter->second;
+    SVTK_IndexedMapOfVtkIds& aMapIndex = anIter->second;
     removeCompositeIndex( aMapIndex,theIds );
   }
 }
@@ -601,11 +601,11 @@ SVTK_SelectorDef
 bool
 SVTK_SelectorDef
 ::IsCompositeIndexSelected( const Handle(SALOME_InteractiveObject)& theIO, 
-                           SVTK_ListOfInteger theIds ) const
+                           SVTK_ListOfVtk theIds ) const
 {
   TMapIOSubCompositeIndex::const_iterator anIter = myMapIOSubCompositeIndex.find( theIO );
   if( anIter != myMapIOSubCompositeIndex.end() ) {
-    const SVTK_IndexedMapOfIds& aMapIndex = anIter->second;
+    const SVTK_IndexedMapOfVtkIds& aMapIndex = anIter->second;
     return aMapIndex.Contains( theIds ) == Standard_True;
   }
   return false;
index c69227f5e11f5d27a5d8f434b87fa6a55a01d3c4..98d4427b2aac7baa628debd65572764e1f197426 100644 (file)
@@ -130,20 +130,20 @@ public:
   virtual
   void 
   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-            TColStd_IndexedMapOfInteger& theIndex ) = 0;
+            SVTK_TIndexedMapOfVtkId& theIndex ) = 0;
         
   //! Change indices of subselection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    const SVTK_TIndexedMapOfVtkId& theIndices, 
                     bool theIsModeShift) = 0;
 
   //! Change indexes of subslection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_MapOfInteger& theIndices, 
+                    const SVTK_TVtkIDsMap& theIndices, 
                     bool theIsModeShift) = 0;
 
   //! Change index of subslection for given #SALOME_InteractiveObject
@@ -179,33 +179,33 @@ public:
   virtual
   void 
   GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    SVTK_IndexedMapOfIds& theIds ) = 0;
+                    SVTK_IndexedMapOfVtkIds& theIds ) = 0;
         
   //! Change composite indices of subselection for given #SALOME_InteractiveObject
   virtual
   bool 
   AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                            const SVTK_IndexedMapOfIds& theIds,
+                            const SVTK_IndexedMapOfVtkIds& theIds,
                             bool theIsModeShift) = 0;
 
   //! Change composite index of subslection for given #SALOME_InteractiveObject
   virtual
   bool
   AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                            SVTK_ListOfInteger ids, 
+                            SVTK_ListOfVtk ids, 
                             bool theIsModeShift) = 0;
 
   //! Change composite index of subslection for given #SALOME_InteractiveObject
   virtual
   void 
   RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                       SVTK_ListOfInteger ids ) = 0;
+                       SVTK_ListOfVtk ids ) = 0;
 
   //! Check, if the given composite index is present in subselection 
   virtual
   bool 
   IsCompositeIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
-                          SVTK_ListOfInteger ids ) const = 0;
+                          SVTK_ListOfVtk ids ) const = 0;
 
   //! Clear composite indexes subselection
   virtual
index 5b9be5f73257856964e80caacfbd5aceb1d7ad32..c9cedbf9e7b90ba03a547ff10a419f67f1298608 100644 (file)
@@ -106,17 +106,17 @@ public:
   virtual
   void 
   GetIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-            TColStd_IndexedMapOfInteger& theIndex );
+            SVTK_TIndexedMapOfVtkId& theIndex );
         
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_IndexedMapOfInteger& theIndices, 
+                    const SVTK_TIndexedMapOfVtkId& theIndices, 
                     bool theIsModeShift);
   virtual
   bool 
   AddOrRemoveIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    const TColStd_MapOfInteger& theIndices, 
+                    const SVTK_TVtkIDsMap& theIndices, 
                     bool theIsModeShift);
   virtual
   bool
@@ -144,28 +144,28 @@ public:
   virtual
   void 
   GetCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                    SVTK_IndexedMapOfIds& theIds );        
+                    SVTK_IndexedMapOfVtkIds& theIds );        
   virtual
   bool 
   AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                            const SVTK_IndexedMapOfIds& theIds,
+                            const SVTK_IndexedMapOfVtkIds& theIds,
                             bool theIsModeShift);
 
   virtual
   bool
   AddOrRemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                            SVTK_ListOfInteger theIds,
+                            SVTK_ListOfVtk theIds,
                             bool theIsModeShift);
 
   virtual
   void 
   RemoveCompositeIndex( const Handle(SALOME_InteractiveObject)& theIO, 
-                       SVTK_ListOfInteger theIds );
+                       SVTK_ListOfVtk theIds );
 
   virtual
   bool 
   IsCompositeIndexSelected(const Handle(SALOME_InteractiveObject)& theIO, 
-                          SVTK_ListOfInteger theIds ) const;
+                          SVTK_ListOfVtk theIds ) const;
 
   virtual
   void 
@@ -255,7 +255,7 @@ private:
 
   struct TIndexedMapOfInteger
   {
-    TColStd_IndexedMapOfInteger myMap;
+    SVTK_TIndexedMapOfVtkId myMap;
     TIndexedMapOfInteger()
     {}
     TIndexedMapOfInteger(const TIndexedMapOfInteger& theIndexedMapOfInteger)
@@ -280,7 +280,7 @@ private:
   TMapIOSubIndex myMapIOSubIndex;
 
   typedef std::map<Handle(SALOME_InteractiveObject),
-                   SVTK_IndexedMapOfIds,
+                   SVTK_IndexedMapOfVtkIds,
                    TIOLessThan> TMapIOSubCompositeIndex;
   TMapIOSubCompositeIndex myMapIOSubCompositeIndex;
 
index 63b191753ba161b0976bf1ccecd81c9469652584..b4b8079ac020216f4830cef81719d1f0f6867ba3 100644 (file)
@@ -72,7 +72,6 @@ SET(_other_HEADERS
   VTKViewer_Algorithm.h
   VTKViewer_ArcBuilder.h
   VTKViewer_CellCenters.h
-  VTKViewer_CellLocationsArray.h
   VTKViewer_ConvexTool.h
   VTKViewer_DataSetMapper.h
   VTKViewer_ExtractUnstructuredGrid.h
@@ -156,7 +155,6 @@ SET(_other_SOURCES
   VTKViewer_AppendFilter.cxx
   VTKViewer_ArcBuilder.cxx
   VTKViewer_CellCenters.cxx
-  VTKViewer_CellLocationsArray.cxx
   VTKViewer_ConvexTool.cxx
   VTKViewer_DataSetMapper.cxx
   VTKViewer_ExtractUnstructuredGrid.cxx
index 9d636ca5cfd0ec07dd3ad8190032e24e2240b8da..202b8019ff49db0ea79798d23ed3422494d622f5 100644 (file)
@@ -433,9 +433,9 @@ VTKViewer_Actor
 /*!
   Maps VTK index of a node to corresponding object index
 */
-int 
+vtkIdType 
 VTKViewer_Actor
-::GetNodeObjId(int theVtkID)
+::GetNodeObjId(vtkIdType theVtkID)
 { 
   return theVtkID;
 }
@@ -445,7 +445,7 @@ VTKViewer_Actor
 */
 double* 
 VTKViewer_Actor
-::GetNodeCoord(int theObjID)
+::GetNodeCoord(vtkIdType theObjID)
 {
   return GetInput()->GetPoint(theObjID);
 }
@@ -453,9 +453,9 @@ VTKViewer_Actor
 /*!
  Maps object index of a node to corresponding VTK index
 */
-int
+vtkIdType
 VTKViewer_Actor
-::GetNodeVtkId( int theObjID )
+::GetNodeVtkId( vtkIdType theObjID )
 {
   return theObjID;
 }
@@ -466,7 +466,7 @@ VTKViewer_Actor
 */
 vtkCell* 
 VTKViewer_Actor
-::GetElemCell(int theObjID)
+::GetElemCell(vtkIdType theObjID)
 {
   return GetInput()->GetCell(theObjID);
 }
@@ -474,9 +474,9 @@ VTKViewer_Actor
 /*!
   Maps VTK index of a cell to corresponding object index
 */
-int
+vtkIdType
 VTKViewer_Actor
-::GetElemObjId(int theVtkID) 
+::GetElemObjId(vtkIdType theVtkID) 
 { 
   return theVtkID;
 }
@@ -487,7 +487,7 @@ VTKViewer_Actor
 */
 int
 VTKViewer_Actor
-::GetObjDimension( const int theObjId )
+::GetObjDimension( const vtkIdType theObjId )
 {
   if ( vtkCell* aCell = GetElemCell(theObjId) )
     return aCell->GetCellDimension();
index 0b4b53cb7c3e859c3baefcc3a9f5064a931c6915..d00786a55183fc3dc3678830f08310b603e73c97 100644 (file)
 
 #include <string>
 #include <vector>
+#include <limits>
+
+#include <NCollection_IndexedMap.hxx>
+#include <NCollection_Map.hxx>
 
 #include <vtkLODActor.h>
 #include <vtkProperty.h>
@@ -138,34 +142,34 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   // For selection mapping purpose
   //! Maps VTK index of a node to corresponding object index
   virtual
-  int 
-  GetNodeObjId(int theVtkID);
+  vtkIdType 
+  GetNodeObjId(vtkIdType theVtkID);
 
   //! Get coordinates of a node for given object index
   virtual
   double*
-  GetNodeCoord(int theObjID);
+  GetNodeCoord(vtkIdType theObjID);
 
   //! Maps object index of a node to corresponding VTK index
   virtual
-  int 
-  GetNodeVtkId(int theObjID);
+  vtkIdType 
+  GetNodeVtkId(vtkIdType theObjID);
 
   //! Maps VTK index of a cell to corresponding object index
   virtual 
-  int
-  GetElemObjId(int theVtkID);
+  vtkIdType
+  GetElemObjId(vtkIdType theVtkID);
 
   //! Get corresponding #vtkCell for given object index
   virtual
   vtkCell* 
-  GetElemCell(int theObjID);
+  GetElemCell(vtkIdType theObjID);
 
   //----------------------------------------------------------------------------
   //! Get dimension of corresponding mesh element
   virtual
   int
-  GetObjDimension( const int theObjId );
+  GetObjDimension( const vtkIdType theObjId );
 
   //! To insert some additional filters and then sets the given #vtkMapper
   virtual
@@ -394,6 +398,22 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor
   bool myIsHighlighted;
 };
 
+struct vtkIdHasher
+{
+  static int HashCode(const vtkIdType theValue,  const int theUpperBound)
+  {
+    return static_cast<int> ((theValue & (std::numeric_limits<vtkIdType>::max)()) % theUpperBound + 1);
+  }
+
+  static bool IsEqual( const vtkIdType& id1, const vtkIdType& id2 )
+  {
+    return id1 == id2;
+  }
+};
+
+typedef NCollection_Map< vtkIdType, vtkIdHasher > TVtkIDsMap;
+typedef NCollection_IndexedMap<vtkIdType,vtkIdHasher> TIndexedMapOfVtkId;
+
 #ifdef WIN32
 #pragma warning ( default:4251 )
 #endif
index 11c8dd647ef45ce91b8255edb780a2fd97f692d4..9cd3778ef20b83a414acf79e919ad5fbc74c05eb 100644 (file)
@@ -149,7 +149,7 @@ namespace
   {
     theInputID = theInputDataSetID = -1;
 
-    vtkIdType aNbInputs = (int)theRanges.size(); //!< TODO: conversion from size_t to int
+    vtkIdType aNbInputs = (vtkIdType)theRanges.size(); //!< TODO: conversion from size_t to vtkIdType
     if(theInputDataSetID < 0 || theInputDataSetID >= aNbInputs)
       return -1;
     
@@ -201,7 +201,7 @@ namespace
       return;
 
     vtkIdType aStartId = 0;
-    vtkIdType aNbInputs = (int)theRanges.size(); //!< TODO: conversion from size_t to int
+    vtkIdType aNbInputs = (vtkIdType)theRanges.size(); //!< TODO: conversion from size_t to vtkIdType
     for(vtkIdType aDataSetId = 0; aDataSetId < aNbInputs; ++aDataSetId){
       vtkIdType aRange = theRanges[aDataSetId];
       if(aRange > theOutputID){
index e41504917ecea9110fbdbd848f2237dac12d2bb6..916b3c8e8041bf472cbb759ad8e2e1561d279fc7 100644 (file)
@@ -640,7 +640,7 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input,
 vtkIdType MergevtkPoints(const std::vector< vtkSmartPointer< vtkPoints > >& theCollection,
                          const std::vector< std::vector<double> >& theScalarCollection,
                          vtkPoints* thePoints,
-                         std::map<int, double>& thePntId2ScalarValue,
+                         std::map<vtkIdType, double>& thePntId2ScalarValue,
                          vtkIdType* &theIds){
   vtkIdType aNbPoints = 0;
   vtkIdType anIdCounter = 0;
index 075bb2841a453d8c637d801f4bb77352c757d432..5131071860aed318b13bba77f524cc855c026d7b 100644 (file)
@@ -41,7 +41,7 @@ typedef std::list<Pnt> PntList;
 vtkIdType MergevtkPoints(const std::vector< vtkSmartPointer< vtkPoints > >& theCollection,
                          const std::vector< std::vector<double> >& theScalarCollection,
                          vtkPoints* thePoints,
-                         std::map<int, double>& thePntId2ScalarValue,
+                         std::map<vtkIdType, double>& thePntId2ScalarValue,
                          vtkIdType* &theIds);
 
 vtkIdType Build1DArc(vtkIdType cellId, 
index abc386a84225d2a972915facccc46655cff34842..4c88e388f7add2c95ff0547afd83fd2cd99848c9 100644 (file)
@@ -31,7 +31,7 @@
 #  include <vtkIdTypeArray.h>
 #  define TCellLocationsArray vtkIdTypeArray
 #else
-#  include <vtkIntArray.h>
+#  include <vtkLongLongArray.h>
 #  define TCellLocationsArray vtkIntArray
 #endif
 
index ec76a011bab9278a3f7232689832a7a050c555cb..603c29af0c43d2549ba9305ae12982213dd8e05b 100644 (file)
@@ -114,7 +114,7 @@ VTKViewer_Triangulator
     double anAbsoluteCoord[3];
     myPoints->SetNumberOfPoints(aNumPts);
     vtkPoints *anInputPoints = theInput->GetPoints();
-    for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+    for (auto aPntId = 0; aPntId < aNumPts; aPntId++) {
       anInputPoints->GetPoint(myPointIds[aPntId], anAbsoluteCoord);
       myPoints->SetPoint(aPntId, anAbsoluteCoord);
     }
@@ -216,7 +216,7 @@ VTKViewer_Triangulator
   double aCellCenter[3] = {0.0, 0.0, 0.0};
   {
     double aPntCoord[3];
-    for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+    for (auto aPntId = 0; aPntId < aNumPts; aPntId++) {
       aPoints->GetPoint(GetPointId(aPntId),aPntCoord);
       if(DEBUG_TRIA_EXECUTE) cout<<"\taPntId = "<<GetPointId(aPntId)<<" {"<<aPntCoord[0]<<", "<<aPntCoord[1]<<", "<<aPntCoord[2]<<"}\n";
       aCellCenter[0] += aPntCoord[0];
@@ -229,7 +229,7 @@ VTKViewer_Triangulator
   }
 
   double aCellLength = GetCellLength();
-  int aNumFaces = GetNumFaces();
+  vtkIdType aNumFaces = GetNumFaces();
 
   static double EPS = 1.0E-2;
   double aDistEps = aCellLength/3.0 * EPS;
@@ -248,7 +248,7 @@ VTKViewer_Triangulator
   typedef std::set<TPointIds> TFace2PointIds;
   TFace2PointIds aFace2PointIds;
 
-  for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
+  for (auto aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
     vtkCell* aFace = GetFace(aFaceId);
     
     GetCellNeighbors(theInput, theCellId, aFace, myCellIds);
@@ -270,7 +270,7 @@ VTKViewer_Triangulator
 
   ::TPolygons aPolygons;
 
-  for (int aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
+  for (auto aFaceId = 0; aFaceId < aNumFaces; aFaceId++) {
     if(aFace2Visibility.find(aFaceId) == aFace2Visibility.end())
       continue;
 
@@ -405,7 +405,7 @@ VTKViewer_Triangulator
             if(DEBUG_TRIA_EXECUTE) cout  << "; Added = FALSE" << endl;
           }
         }
-        int aNbPoints = (int)aPointIds.size(); //!< TODO: conversion from size_t to int
+        size_t aNbPoints = aPointIds.size();
         aCenter[0] /= aNbPoints;
         aCenter[1] /= aNbPoints;
         aCenter[2] /= aNbPoints;
@@ -523,7 +523,7 @@ VTKViewer_Triangulator
         }
 
         if(!aSortedPointIds.empty()){
-          int aNumFacePts = (int)aSortedPointIds.size(); //!< TODO: conversion from size_t to int
+          size_t aNumFacePts = aSortedPointIds.size();
           ::TConnectivities aConnectivities(aNumFacePts);
           TSortedPointIds::const_iterator anIter = aSortedPointIds.begin();
           TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end();
@@ -544,8 +544,8 @@ VTKViewer_Triangulator
 
   // To check, whether the polygons give a convex polyhedron or not
   if(theIsCheckConvex){
-    int aNbPolygons = (int)aPolygons.size(); //!< TODO: conversion from size_t to int
-    for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
+    size_t aNbPolygons = aPolygons.size();
+    for (size_t aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
       ::TPolygon& aPolygon = aPolygons[aPolygonId];
       double* aNormal = aPolygon.myNormal;
       double* anOrigin = aPolygon.myOrigin;
@@ -569,8 +569,8 @@ VTKViewer_Triangulator
 
   // To pass resulting set of the polygons to the output
   {
-    int aNbPolygons = (int)aPolygons.size(); //!< TODO: conversion from size_t to int
-    for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
+    size_t aNbPolygons = aPolygons.size();
+    for (size_t aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) {
       ::TPolygon& aPolygon = aPolygons[aPolygonId];
       if(DEBUG_TRIA_EXECUTE) cout << "PoilygonId="<<aPolygonId<<" | ";
       TConnectivities& aConnectivities = aPolygon.myConnectivities;
@@ -579,7 +579,7 @@ VTKViewer_Triangulator
           cout << aConnectivities[i] << ",";
         cout << endl;
       }
-      int aNbPoints = (int)aConnectivities.size(); //!< TODO: conversion from size_t to int
+      int aNbPoints = (int)aConnectivities.size();
       vtkIdType aNewCellId = theOutput->InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]);
       if(theStoreMapping)
         VTKViewer_GeometryFilter::InsertId( theCellId, VTK_POLYGON, theVTK2ObjIds, theDimension2VTK2ObjIds );
@@ -636,7 +636,7 @@ VTKViewer_OrderedTriangulator
     zSize = aBounds[5] - aBounds[4];
     double anAbsoluteCoord[3];
     double aParamentrucCoord[3];
-    for (int aPntId = 0; aPntId < aNumPts; aPntId++) {
+    for (auto aPntId = 0; aPntId < aNumPts; aPntId++) {
       myPoints->GetPoint(aPntId, anAbsoluteCoord);
       aParamentrucCoord[0] = xSize==0. ? 0. : ((anAbsoluteCoord[0] - aBounds[0]) / xSize);
       aParamentrucCoord[1] = ySize==0. ? 0. : ((anAbsoluteCoord[1] - aBounds[2]) / ySize);
index 7af1a7e2a46301accace7314422c1238e2597136..ea3ccdf1905a2c82eea472858d91bd684c175e82 100644 (file)
@@ -24,7 +24,7 @@
 // Author:  Alexey PETROV
 
 #include "VTKViewer_ExtractUnstructuredGrid.h"
-#include "VTKViewer_CellLocationsArray.h"
+//#include "VTKViewer_CellLocationsArray.h"
 
 #include <vtkUnsignedCharArray.h>
 #include <vtkUnstructuredGrid.h>
@@ -81,12 +81,12 @@ void VTKViewer_ExtractUnstructuredGrid::SetStoreMapping(int theStoreMapping)
   }
 }
 
-vtkIdType VTKViewer_ExtractUnstructuredGrid::GetInputId(int theOutId) const
+vtkIdType VTKViewer_ExtractUnstructuredGrid::GetInputId(vtkIdType theOutId) const
 {
   if ( myPassAll || ( myCellIds.empty() && myCellTypes.empty() ))
     return theOutId;
 
-  if ( theOutId<0 || theOutId >= (int)myOut2InId.size() )
+  if ( theOutId < 0 || theOutId >= (vtkIdType) myOut2InId.size() )
     return -1;
   return myOut2InId[theOutId];
 }
@@ -281,7 +281,7 @@ void VTKViewer_ExtractUnstructuredGrid::BuildOut2InMap()
 // }
 
 
-inline int InsertCell(vtkUnstructuredGrid *theInput,
+inline vtkIdType InsertCell(vtkUnstructuredGrid *theInput,
                       vtkCellArray *theConnectivity,
                       vtkUnsignedCharArray* theCellTypesArray,
                       vtkIdTypeArray*& theFaces,
@@ -490,7 +490,7 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re
         }
       }
       if ( vtkIdType newNbElems = aConnectivity->GetNumberOfCells() ) {
-        VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+        vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
         aCellLocationsArray->SetNumberOfComponents(1);
         aCellLocationsArray->SetNumberOfTuples(newNbElems);
         aConnectivity->InitTraversal();
@@ -592,7 +592,7 @@ int VTKViewer_ExtractUnstructuredGrid::RequestData(vtkInformation *vtkNotUsed(re
       }
     }
     if (vtkIdType newNbElems = aConnectivity->GetNumberOfCells() ) {
-      VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
+      vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New();
       aCellLocationsArray->SetNumberOfComponents(1);
       aCellLocationsArray->SetNumberOfTuples( newNbElems );
       aConnectivity->InitTraversal();
index 9d42d9d7cded1bf928fb19faa25bf8c13b66777e..cc72624ea6e4c18b7c0cad3863f016763c341920 100644 (file)
@@ -95,7 +95,7 @@ public:
   //! Computes a map out IDs to in IDs. Call it before GetInputId()!!!
   void BuildOut2InMap();
   //! Gets the input id by output id. Call BuildOut2InMap() before
-  vtkIdType GetInputId(int theOutId) const;
+  vtkIdType GetInputId(vtkIdType theOutId) const;
   //! Gets the output id by input id.
   //vtkIdType GetOutputId(int theInId) const;
 
index 0a03f7ebe091b461555f49e1d7307747bc88c10b..118fd4fa6b53c4039a058f5ab569dfdb94941739 100644 (file)
@@ -51,7 +51,7 @@ VTKViewer_Filter::~VTKViewer_Filter()
  * \param theCellId - cell id.
  * \retval \c true - if cell id is valid, else \c false.
  */
-bool VTKViewer_Filter::IsValid( VTKViewer_Actor* theActor, const int theCellId )
+bool VTKViewer_Filter::IsValid( VTKViewer_Actor* theActor, const vtkIdType theCellId )
 {
   SetActor( theActor );
   return IsValid( theCellId );
index 742e60b025744821b92edb7c35794881bed67b19..50a27b0b0213ab7a50ba67052b9edbe8f7e1c957 100644 (file)
@@ -29,6 +29,7 @@
 #define VTKViewer_Filter_HeaderFile
 
 #include "VTKViewer.h"
+#include <vtkType.h>
 
 #include <Standard_Transient.hxx>
 #include <Standard_DefineHandle.hxx>
@@ -50,8 +51,8 @@ public:
   VTKVIEWER_EXPORT VTKViewer_Filter();
   VTKVIEWER_EXPORT virtual ~VTKViewer_Filter();
 
-  VTKVIEWER_EXPORT bool                        IsValid( VTKViewer_Actor*, const int theId );
-  VTKVIEWER_EXPORT virtual bool                IsValid( const int theId ) const = 0;
+  VTKVIEWER_EXPORT bool                        IsValid( VTKViewer_Actor*, const vtkIdType theId );
+  VTKVIEWER_EXPORT virtual bool                IsValid( const vtkIdType theId ) const = 0;
   VTKVIEWER_EXPORT virtual int                 GetId() const = 0;
   VTKVIEWER_EXPORT virtual bool                IsNodeFilter() const = 0;
 
index ab252568d3968e1b2cf2360a41000f8dbee16357..577206a2d0f93ed717ac2f26305c1b701fb93a09 100644 (file)
@@ -285,7 +285,7 @@ VTKViewer_GeometryFilter
     }
 
   vtkIdType cellId;
-  int i;
+  vtkIdType i;
   int allVisible;
   vtkIdType npts = 0;
   vtkIdType const *pts = 0;
@@ -369,7 +369,7 @@ VTKViewer_GeometryFilter
       quad1D2DTypes.insert( VTK_BIQUADRATIC_QUAD );
       quad1D2DTypes.insert( VTK_QUADRATIC_POLYGON );
 
-      for ( int i = 0; i < types->GetNumberOfTuples() && !hasQuad1D2D; ++i )
+      for ( auto i = 0; i < types->GetNumberOfTuples() && !hasQuad1D2D; ++i )
         hasQuad1D2D = quad1D2DTypes.count( types->GetValue(i) );
     }
     buildArcs = hasQuad1D2D;
@@ -432,7 +432,7 @@ VTKViewer_GeometryFilter
 
   // Loop over all cells now that visibility is known
   // (Have to compute visibility first for 3D cell boundaries)
-  int progressInterval = numCells/20 + 1;
+  vtkIdType progressInterval = numCells/20 + 1;
   TMapOfVectorId aDimension2VTK2ObjIds;
   if ( myStoreMapping )
     aDimension2VTK2ObjIds.resize( 3 ); // max dimension is 2
@@ -559,7 +559,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -573,7 +573,7 @@ VTKViewer_GeometryFilter
               faceIds->InsertNextId(pts[faceVerts[1]]);
               faceIds->InsertNextId(pts[faceVerts[2]]);
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -616,7 +616,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -631,7 +631,7 @@ VTKViewer_GeometryFilter
               aCellType = VTK_QUAD;
               numFacePts = 4;
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -674,7 +674,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -689,7 +689,7 @@ VTKViewer_GeometryFilter
               faceIds->InsertNextId(pts[faceVerts[2]]);
               faceIds->InsertNextId(pts[faceVerts[3]]);
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -752,7 +752,7 @@ VTKViewer_GeometryFilter
                 numFacePts = 4;
               }
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -795,7 +795,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -817,7 +817,7 @@ VTKViewer_GeometryFilter
                 numFacePts = 6;
               }
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -841,7 +841,7 @@ VTKViewer_GeometryFilter
           if ( myShowInside )
           {
             aCellType = VTK_LINE;
-            for ( int edgeID = 0; edgeID < 8; ++edgeID )
+            for ( auto edgeID = 0; edgeID < 8; ++edgeID )
             {
               const vtkIdType *edgeVerts = vtkPyramid::GetEdgeArray( edgeID );
               if ( toShowEdge( pts[edgeVerts[0]], pts[edgeVerts[1]], cellId, input ))
@@ -860,7 +860,7 @@ VTKViewer_GeometryFilter
           {
 #ifdef SHOW_COINCIDING_3D_PAL21924
             faceIdsTmp->SetNumberOfIds( npts );
-            for ( int ai = 0; ai < npts; ai++ )
+            for ( auto ai = 0; ai < npts; ai++ )
               faceIdsTmp->SetId( ai, pts[ai] );
             input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
@@ -880,7 +880,7 @@ VTKViewer_GeometryFilter
                 numFacePts = 4;
               }
               input->GetCellNeighbors(cellId, faceIds, cellIds);
-              int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+              vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
 #ifdef SHOW_COINCIDING_3D_PAL21924
               bool process = nbNeighbors <= 0;
 #else
@@ -905,7 +905,7 @@ VTKViewer_GeometryFilter
         {
           vtkIdType nFaces = 0;
           const vtkIdType* ptIds = 0;
-          int idp = 0;
+          vtkIdType idp = 0;
           input->GetFaceStream(cellId, nFaces, ptIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
           if ( !myShowInside )
@@ -926,7 +926,7 @@ VTKViewer_GeometryFilter
           {
             faceIds->Reset();
             numFacePts = ptIds[idp];
-            int pt0 = ++idp;
+            vtkIdType pt0 = ++idp;
             for (i = 0; i < numFacePts; i++)
             {
               faceIds->InsertNextId(ptIds[idp + i]);
@@ -939,7 +939,7 @@ VTKViewer_GeometryFilter
             default:aCellType = VTK_POLYGON;
             }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
-            int nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
+            vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - cellIdsTmp->GetNumberOfIds();
             if ( myShowInside && nbNeighbors > 0 && cellId < cellIds->GetId(0) )
               continue; // don't add twice same internal face in wireframe mode
 #ifdef SHOW_COINCIDING_3D_PAL21924
@@ -1033,7 +1033,7 @@ VTKViewer_GeometryFilter
 #ifdef SHOW_COINCIDING_3D_PAL21924
               if ( !myShowInside )
               {
-                int npts1 = 0;
+                vtkIdType npts1 = 0;
                 switch (aCellType ){
                 case VTK_QUADRATIC_TETRA:             npts1 = 4; break;
                 case VTK_QUADRATIC_HEXAHEDRON:        npts1 = 8; break;
@@ -1044,7 +1044,7 @@ VTKViewer_GeometryFilter
                 }
                 faceIdsTmp->SetNumberOfIds( npts1 );
                 if ( npts1 > 0 ) {
-                  for (int ai=0; ai<npts1; ai++)
+                  for (auto ai=0; ai<npts1; ai++)
                     faceIdsTmp->SetId( ai, pts[ai] );
                   input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
                 }
@@ -1052,8 +1052,8 @@ VTKViewer_GeometryFilter
 #endif
               aCellType = VTK_TRIANGLE;
               numFacePts = 3;
-              int nbNeighbors = 0;
-              for (int j=0; j < cell->GetNumberOfFaces(); j++)
+              vtkIdType nbNeighbors = 0;
+              for (auto j=0; j < cell->GetNumberOfFaces(); j++)
               {
                 vtkCell *face = cell->GetFace(j);
                 if ( !myShowInside ) {
@@ -1210,11 +1210,11 @@ VTKViewer_GeometryFilter
               }
               else
               {
-                int nbCoincident = 0;
+                vtkIdType nbCoincident = 0;
 #ifdef SHOW_COINCIDING_3D_PAL21924
-                int nbPnt = npts - cell->GetNumberOfEdges();
+                vtkIdType nbPnt = npts - cell->GetNumberOfEdges();
                 faceIdsTmp->SetNumberOfIds( nbPnt );
-                for ( int ai = 0; ai < nbPnt; ai++ )
+                for ( auto ai = 0; ai < nbPnt; ai++ )
                   faceIdsTmp->SetId( ai, pts[ai] );
                 input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
                 nbCoincident = cellIdsTmp->GetNumberOfIds();
@@ -1225,11 +1225,11 @@ VTKViewer_GeometryFilter
                 {
                   vtkCell * face = cell->GetFace( faceId );
                   input->GetCellNeighbors( cellId, face->GetPointIds(), cellIds );
-                  int nbNeighbors = cellIds->GetNumberOfIds() - nbCoincident;
+                  vtkIdType nbNeighbors = cellIds->GetNumberOfIds() - nbCoincident;
                   if ( nbNeighbors <= 0 )
                   {
-                    int nbEdges = face->GetNumberOfPoints() / 2;
-                    for ( int edgeId = 0; edgeId < nbEdges; ++edgeId )
+                    vtkIdType nbEdges = face->GetNumberOfPoints() / 2;
+                    for ( auto edgeId = 0; edgeId < nbEdges; ++edgeId )
                     {
                       vtkIdType p1 = ( edgeId );               // corner
                       vtkIdType p2 = ( edgeId + nbEdges );     // medium
@@ -1408,9 +1408,9 @@ VTKViewer_GeometryFilter
 }
 
 
-vtkIdType VTKViewer_GeometryFilter::GetElemObjId( int theVtkID )
+vtkIdType VTKViewer_GeometryFilter::GetElemObjId( vtkIdType theVtkID )
 {
-  if( theVtkID < 0 || theVtkID >= (int)myVTK2ObjIds.size() )
+  if( theVtkID < 0 || theVtkID >= (vtkIdType)myVTK2ObjIds.size() )
     return -1;
   return myVTK2ObjIds[theVtkID];
 }
@@ -1521,10 +1521,10 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
     }
     case VTK_QUADRATIC_POLYGON:
     {
-      int nbP = aCell->GetNumberOfPoints();
+      vtkIdType nbP = aCell->GetNumberOfPoints();
       std::vector< Pnt > pVec( nbP + 2 );
 
-      for ( int i = 0; i < nbP/2; ++i )
+      for ( auto i = 0; i < nbP/2; ++i )
       {
         pVec[i*2 + 0] = CreatePnt( aCell, inputScalars, i );
         pVec[i*2 + 1] = CreatePnt( aCell, inputScalars, i + nbP/2 );
@@ -1532,7 +1532,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
       pVec[ nbP   ] = pVec[ 0 ];
       pVec[ nbP+1 ] = pVec[ 1 ];
 
-      for ( int i = 0; i < nbP; i += 2 )
+      for ( auto i = 0; i < nbP; i += 2 )
       {      
         VTKViewer_ArcBuilder aBuilder( pVec[i], pVec[i+1], pVec[i+2], myMaxArcAngle );
         aCollection.push_back( aBuilder.GetPoints() );
@@ -1553,7 +1553,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
     vtkIdType aTriangleId;
 
     vtkPolygon *aPlg = vtkPolygon::New();
-    std::map<int, double> aPntId2ScalarValue;
+    std::map<vtkIdType, double> aPntId2ScalarValue;
     aNbPoints = MergevtkPoints(aCollection, aScalarCollection, aPlg->GetPoints(), aPntId2ScalarValue, aNewPoints);
     aPlg->GetPointIds()->SetNumberOfIds(aNbPoints);
 
@@ -1585,7 +1585,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
     aPlg->Delete();
   }
   else {
-    std::map<int, double> aPntId2ScalarValue;
+    std::map<vtkIdType, double> aPntId2ScalarValue;
     aNbPoints = MergevtkPoints(aCollection, aScalarCollection, output->GetPoints(), aPntId2ScalarValue, aNewPoints);
     if(outputScalars)
       for(vtkIdType i = 0; i < aNbPoints; i++)
index 333814674421d76c60192c302d13dc23b75d1663..af65b0267d040111d3addd2072a6a0f403cb9d8b 100644 (file)
@@ -93,12 +93,12 @@ public:
    * \brief Return input value theVtkID
    * \retval theVtkID
    */
-  virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
+  virtual vtkIdType GetNodeObjId(vtkIdType theVtkID) { return theVtkID;}
   /*! \fn virtual vtkIdType GetElemObjId(int theVtkID);
    * \brief Return object ID by VTK ID cell 
    * \retval myVTK2ObjIds[theVtkID]
    */
-  virtual vtkIdType GetElemObjId(int theVtkID);
+  virtual vtkIdType GetElemObjId(vtkIdType theVtkID);
 
   virtual void SetQuadraticArcMode(bool theFlag);
   virtual bool GetQuadraticArcMode() const;
index a116739b2cde4809bd20504f0723f157c797f4eb..c2e1f862d1ea365378c0e53d99975650c5cd8d50 100644 (file)
@@ -1485,7 +1485,7 @@ void  VTKViewer_InteractorStyle::RemoveFilter( const int theId )
  *\param theIsNode - boolean flag, if \c true - node, else - cell.
  */
 bool VTKViewer_InteractorStyle::IsValid( VTKViewer_Actor* theActor,
-                                               const int     theId,
+                                               const vtkIdType theId,
                                                const bool    theIsNode )
 {
   std::map<int, Handle(VTKViewer_Filter)>::const_iterator anIter;
index 435852c65220a270e61b144e4c007403ceaa9cbd..8d6d9491bffbca09cc4bdb0a87736d1afaf52385 100644 (file)
@@ -101,7 +101,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   bool                     IsFilterPresent( const int );
   void                     RemoveFilter( const int );
   bool                     IsValid( VTKViewer_Actor* theActor,
-                                    const int     theId,
+                                    const vtkIdType  theId,
                                     const bool    theIsNode = false );
 
   void                     IncrementalPan   ( const int incrX, const int incrY );
@@ -140,9 +140,9 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
 
   VTKViewer_Actor *myPreViewActor, *myPreSelectionActor, *mySelectedActor;
 
-  int myElemId;
+  vtkIdType myElemId;
   int myEdgeId;
-  int myNodeId;
+  vtkIdType myNodeId;
 
  public:
   bool eventFilter(QObject* object, QEvent* event);
index e39ed18cb8cafdf4a16b9164419154b9f650792c..da50de021b11df0582e996c96589f81620226362 100644 (file)
@@ -679,7 +679,7 @@ bool VTKViewer_RenderWindowInteractor::unHighlightAll(){
  * else sets visibility to false.
  * \li Emit render window modified, if flag \a update - true.
  */
-bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
+bool VTKViewer_RenderWindowInteractor::highlight(const TIndexedMapOfVtkId& theMapIndex,
                                                  VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
                                                  TUpdateActor theFun, bool hilight, bool update)
 {
@@ -702,7 +702,7 @@ bool VTKViewer_RenderWindowInteractor::highlight(const TColStd_IndexedMapOfInteg
 }
 
 /*!Sets actors data.*/
-void VTKViewer_RenderWindowInteractor::setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
+void VTKViewer_RenderWindowInteractor::setActorData(const TIndexedMapOfVtkId& theMapIndex,
                                                     VTKViewer_Actor * theMapActor,
                                                     VTKViewer_Actor * theActor,
                                                     TUpdateActor theFun)
index 60123ce57856e0c34eecd1c85f272a3132cb7d02..8fa0761e79bb64596137f26428ad30f874bb355c 100644 (file)
@@ -104,15 +104,15 @@ public:
   
   /** @name Selection Management */
   //@{
-  bool highlightCell(const TColStd_IndexedMapOfInteger& MapIndex,
+  bool highlightCell(const TIndexedMapOfVtkId& MapIndex,
                      VTKViewer_Actor* theMapActor,
                      bool hilight,
                      bool update = true );
-  bool highlightEdge(const TColStd_IndexedMapOfInteger& MapIndex,
+  bool highlightEdge(const TIndexedMapOfVtkId& MapIndex,
                      VTKViewer_Actor* theMapActor,
                      bool hilight,
                      bool update = true );
-  bool highlightPoint(const TColStd_IndexedMapOfInteger& MapIndex,
+  bool highlightPoint(const TIndexedMapOfVtkId& MapIndex,
                       VTKViewer_Actor* theMapActor,
                       bool hilight,
                       bool update = true );
@@ -174,7 +174,7 @@ public:
                     VTKViewer_Actor* /*theMapActor*/,
                     VTKViewer_Actor* /*theActor*/) {}
 
-  typedef void (*TUpdateActor)(const TColStd_IndexedMapOfInteger& theMapIndex,
+  typedef void (*TUpdateActor)(const TIndexedMapOfVtkId& theMapIndex,
                                VTKViewer_Actor* theMapActor,
                                VTKViewer_Actor* theActor);
  protected:
@@ -184,10 +184,10 @@ public:
 
   VTKViewer_InteractorStyle* myInteractorStyle;
 
-  bool highlight(const TColStd_IndexedMapOfInteger& theMapIndex,
+  bool highlight(const TIndexedMapOfVtkId& theMapIndex,
                  VTKViewer_Actor* theMapActor, VTKViewer_Actor* theActor,
                  TUpdateActor theFun, bool hilight, bool update);
-  void setActorData(const TColStd_IndexedMapOfInteger& theMapIndex,
+  void setActorData(const TIndexedMapOfVtkId& theMapIndex,
                     VTKViewer_Actor* theMapActor,
                     VTKViewer_Actor *theActor,
                     TUpdateActor theFun);
index 55d29176c8b401410dfb6c9007a9029c3987ed8d..ba7713595729d9e2f22357782622345ef0c10285 100644 (file)
@@ -64,7 +64,8 @@ int VTKViewer_ShrinkFilter::RequestData(
     outInfo->Get(vtkDataObject::DATA_OBJECT()));
 
   vtkPoints *newPts;
-  int i, j, numIds, abort=0;
+  vtkIdType i, numIds, abort=0;
+  int j;
   vtkIdType cellId, numCells, numPts;
   vtkIdType oldId, newId;
   double center[3], *p, pt[3];
@@ -178,9 +179,9 @@ void VTKViewer_ShrinkFilter::SetStoreMapping(int theStoreMapping){
 /*!Return node object id by vtk node id.
  *\retval -1 - if no object, else return id.
  */
-vtkIdType VTKViewer_ShrinkFilter::GetNodeObjId(int theVtkID)
+vtkIdType VTKViewer_ShrinkFilter::GetNodeObjId(vtkIdType theVtkID)
 {
-  if ( myVTK2ObjIds.empty() || theVtkID > (int)myVTK2ObjIds.size() )
+  if ( myVTK2ObjIds.empty() || theVtkID > (vtkIdType)myVTK2ObjIds.size() )
     return -1;
   return myVTK2ObjIds.at(theVtkID);
 }
index 9c5e78cfa302a93dcad49a87804cb682b7498fd6..2a382c9af06d12ce87f5935d0c301749a37f81b7 100644 (file)
@@ -47,9 +47,9 @@ public:
   /*!Gets store mapping flag.*/
   int GetStoreMapping(){ return myStoreMapping;}
 
-  virtual vtkIdType GetNodeObjId(int theVtkID);
+  virtual vtkIdType GetNodeObjId(vtkIdType theVtkID);
   /*!Return element id by vtk id.*/
-  virtual vtkIdType GetElemObjId(int theVtkID) { return theVtkID;}
+  virtual vtkIdType GetElemObjId(vtkIdType theVtkID) { return theVtkID;}
 
 protected:
   VTKViewer_ShrinkFilter();