Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / OBJECT / SMESH_CellLabelActor.cxx
index 399bc869f78ebb824c0305ce75e71a9e4a7efc67..3e117de16858568a164989c9d6734bc76faba832 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -38,7 +38,7 @@
 #include <vtkPointData.h>
 #include <vtkProperty2D.h>
 #include <vtkRenderer.h>
-#include <vtkPolyData.h>
+#include <vtkUnstructuredGrid.h>
 #include <vtkCellData.h>
 
 vtkStandardNewMacro(SMESH_CellLabelActor);
@@ -49,7 +49,7 @@ vtkStandardNewMacro(SMESH_CellLabelActor);
 SMESH_CellLabelActor::SMESH_CellLabelActor() {
     //Definition of cells numbering pipeline
   //---------------------------------------
-  myCellsNumDataSet = vtkPolyData::New();
+  myCellsNumDataSet = vtkUnstructuredGrid::New();
 
   myCellCenters = VTKViewer_CellCenters::New();
   myCellCenters->SetInput(myCellsNumDataSet);
@@ -125,19 +125,19 @@ SMESH_CellLabelActor::~SMESH_CellLabelActor() {
 
 void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) {
   myTransformFilter->Update();
-  vtkPolyData* aGrid = vtkPolyData::SafeDownCast(myTransformFilter->GetOutput());
+  vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::SafeDownCast(myTransformFilter->GetOutput());
   if(!aGrid)
     return;
 
   myIsCellsLabeled = theIsCellsLabeled && aGrid->GetNumberOfPoints();
   if(myIsCellsLabeled){
     myCellsNumDataSet->ShallowCopy(aGrid);
-    vtkDataSet *aDataSet = myCellsNumDataSet;
+    vtkUnstructuredGrid *aDataSet = myCellsNumDataSet;
     int aNbElem = aDataSet->GetNumberOfCells();
     vtkIntArray *anArray = vtkIntArray::New();
     anArray->SetNumberOfValues(aNbElem);
     for(int anId = 0; anId < aNbElem; anId++){
-      int aSMDSId = GetElemObjId(anId);
+      int aSMDSId = myVisualObj->GetElemObjId(anId);
       anArray->SetValue(anId,aSMDSId);
     }
     aDataSet->GetCellData()->SetScalars(anArray);