Back to index

salome-gui  6.5.0
Functions
SVTK_Selector.cxx File Reference
#include "SVTK_SelectorDef.h"
#include <VTKViewer_Filter.h>
#include "SALOME_Actor.h"
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <vtkCallbackCommand.h>
#include <vtkActorCollection.h>
#include <vtkCellPicker.h>

Go to the source code of this file.

Functions

static bool removeIndex (TColStd_IndexedMapOfInteger &theMapIndex, const int theIndex)
 Handle (VTKViewer_Filter) SVTK_SelectorDef

Function Documentation

Returns:
filter by it's id
Parameters:
theId- filter id

Definition at line 517 of file SVTK_Selector.cxx.

{
  TFilters::const_iterator anIter = myFilters.find(theId);
  if(anIter != myFilters.end()){
    const Handle(VTKViewer_Filter)& aFilter = anIter->second;
    return aFilter;
  }
  return Handle(VTKViewer_Filter)();
}
static bool removeIndex ( TColStd_IndexedMapOfInteger &  theMapIndex,
const int  theIndex 
) [static]

Definition at line 300 of file SVTK_Selector.cxx.

{
  int anId = theMapIndex.FindIndex(theIndex); // i==0 if Index is not in the MapIndex
  if(anId){
    // only the last key can be removed
    int aLastId = theMapIndex.FindKey(theMapIndex.Extent());
    if(aLastId == anId)
      theMapIndex.RemoveLast();
    else{
      TColStd_IndexedMapOfInteger aNewMap;
      aNewMap.ReSize(theMapIndex.Extent()-1);
      for(int j = 1; j <= theMapIndex.Extent(); j++){
        int anIndex = theMapIndex(j);
        if ( anIndex != theIndex )
          aNewMap.Add( anIndex );
      }
      theMapIndex = aNewMap;
    }
  }
  return anId != 0;
}

Here is the caller graph for this function: