Salome HOME
best warning on qlineedit for double value
[modules/smesh.git] / src / OBJECT / SMESH_SVTKActor.cxx
index b86c81d5481eb3f6e9ada5502a43c2c285e103d8..de143a7901df15960ba33ab8bff1b8f6ae19f8da 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013  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
@@ -31,7 +31,6 @@
 #include <SVTK_Utils.h>
 #include <SALOME_Actor.h>
 
-
 #include <SVTK_DeviceActor.h>
 #include <vtkPoints.h>
 #include <vtkRenderer.h>
@@ -39,6 +38,9 @@
 #include <vtkUnstructuredGrid.h>
 #include <vtkCell.h>
 #include <vtkDataSetMapper.h>
+#include <vtkPolyhedron.h>
+
+#include <Utils_SALOME_Exception.hxx>
 
 vtkStandardNewMacro(SMESH_SVTKActor);
 
@@ -124,29 +126,28 @@ SMESH_SVTKActor
   for(int ind = 1; ind <= aNbOfParts; ind++){
     int aPartId = theMapIndex( ind );
     if(vtkCell* aCell = theMapActor->GetElemCell(aPartId))
-      {
-#if VTK_XVERSION > 50700
+    {
       if (aCell->GetCellType() != VTK_POLYHEDRON)
-#endif
-      if(aCell->GetCellType() == VTK_VERTEX ) {
-       my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
-      } else if(aCell->GetCellType() == VTK_POLY_VERTEX ) {
-       myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
-      } else {
-        myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+      {
+        if(aCell->GetCellType() == VTK_VERTEX ) {
+          my0DGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+        } else if(aCell->GetCellType() == VTK_POLY_VERTEX ) {
+          myBallGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+        } else {
+          myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+        }
       }
-#if VTK_XVERSION > 50700
       else
-        {
-          vtkPolyhedron *polyhedron = dynamic_cast<vtkPolyhedron*>(aCell);
-          if (!polyhedron)
-            throw SALOME_Exception(LOCALIZED ("not a polyhedron"));
-          vtkIdType *pts = polyhedron->GetFaces();
-          myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),pts[0], pts+1);
-        }
-#endif
+      {
+        vtkPolyhedron *polyhedron = dynamic_cast<vtkPolyhedron*>(aCell);
+        if (!polyhedron)
+          throw SALOME_Exception(LOCALIZED ("not a polyhedron"));
+        vtkIdType *pts = polyhedron->GetFaces();
+        myUnstructuredGrid->InsertNextCell(aCell->GetCellType(),pts[0], pts+1);
       }
-    
+    }
+  }
+
   UnShrink();
   if(theMapActor->IsShrunk()){
     SetShrinkFactor(theMapActor->GetShrinkFactor());
@@ -154,16 +155,15 @@ SMESH_SVTKActor
   }
 
   myMapIndex = theMapIndex;
-  }
 }
-  
+
 void
 SMESH_SVTKActor
 ::Initialize()
 {
   Superclass::Initialize();
-  my0DActor->SetInput(my0DGrid);
-  myBallActor->SetInput(myBallGrid);
+  my0DActor->SetInputData(my0DGrid);
+  myBallActor->SetInputData(myBallGrid);
 }