Salome HOME
Merge changes from 'master' branch.
[modules/gui.git] / src / SVTK / SVTK_Actor.cxx
index a4e404ee69cbd7bd39002f4d48c5e9bda91ff20e..d410444699a73b9501d79ad78fcf5b8194d833ea 100644 (file)
@@ -103,6 +103,14 @@ SVTK_Actor
   return myMapIndex;
 }
 
+
+const SVTK_IndexedMapOfIds&
+SVTK_Actor
+::GetMapCompositeIndex() const 
+{
+  return myMapCompositeIndex;
+}
+
 void
 SVTK_Actor
 ::MapCells(SALOME_Actor* theMapActor,
@@ -213,6 +221,34 @@ SVTK_Actor
   myMapIndex = theMapIndex;
 }
 
+void
+SVTK_Actor
+::MapEdge( SALOME_Actor* theMapActor, 
+           const SVTK_IndexedMapOfIds& 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 );
+      vtkSmartPointer<vtkIdList> ids = vtkSmartPointer<vtkIdList>::New();
+      ids->InsertNextId(theMapActor->GetNodeVtkId( aNodesIds[0] ) );
+      ids->InsertNextId(theMapActor->GetNodeVtkId( aNodesIds[1] ) );
+      myUnstructuredGrid->InsertNextCell(VTK_LINE,ids);
+  }
+
+  UnShrink();
+  if(theMapActor->IsShrunk()){
+    SetShrinkFactor(theMapActor->GetShrinkFactor());
+    SetShrink();
+  }
+  
+  myMapCompositeIndex = theMapCompositeIndex;
+}
+
 /*!
   To publish the actor an all its internal devices
 */