From: enk Date: Wed, 24 Oct 2007 06:19:29 +0000 (+0000) Subject: Junctions imp. X-Git-Tag: CTH_V1_3~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fec466a6a1d2a593fd86b8ac949c431a8bb761b5;p=modules%2Fgui.git Junctions imp. selection --- diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index eb9d4ebcf..ad6d31369 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -58,6 +58,7 @@ #include #include +#include #include #include @@ -831,3 +832,16 @@ SALOME_Actor { myHighlightActor->SetProperty(theProperty); } + +void +SALOME_Actor +::MapCells(const TColStd_IndexedMapOfInteger& theMapIndex, + vtkUnstructuredGrid* theUG) +{ + int aNbOfParts = theMapIndex.Extent(); + for(int ind = 1; ind <= aNbOfParts; ind++){ + int aPartId = theMapIndex( ind ); + if(vtkCell* aCell = GetElemCell(aPartId)) + theUG->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds()); + } +} \ No newline at end of file diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index a44acc9fd..a5677703b 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -49,6 +49,7 @@ class vtkCellPicker; class vtkOutlineSource; class vtkInteractorStyle; class vtkRenderWindowInteractor; +class vtkUnstructuredGrid; class SVTK_Actor; class SVTK_RectPicker; @@ -202,6 +203,9 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor void SetHighlightProperty(vtkProperty* theProperty); + virtual void MapCells(const TColStd_IndexedMapOfInteger& theMapIndex, + vtkUnstructuredGrid* theUG); + protected: //---------------------------------------------------------------------------- vtkRenderWindowInteractor* myInteractor; diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 1d32a1c2b..dd34ab95e 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -116,12 +116,7 @@ SVTK_Actor vtkDataSet *aSourceDataSet = theMapActor->GetInput(); CopyPoints(GetSource(),aSourceDataSet); - int aNbOfParts = theMapIndex.Extent(); - for(int ind = 1; ind <= aNbOfParts; ind++){ - int aPartId = theMapIndex( ind ); - if(vtkCell* aCell = theMapActor->GetElemCell(aPartId)) - myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds()); - } + theMapActor->MapCells(theMapIndex,myUnstructuredGrid.GetPointer()); UnShrink(); if(theMapActor->IsShrunk()){