Salome HOME
Copyright update 2020
[modules/smesh.git] / src / OBJECT / SMESH_DeviceActor.cxx
index 2f6ccd06f0044e7a26e03d7b5a87c80db50f26f9..0cd05d2019723d60c78a634997149727d8f40139 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020  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
@@ -37,6 +37,7 @@
 #include <VTKViewer_Transform.h>
 #include <VTKViewer_TransformFilter.h>
 #include <VTKViewer_ExtractUnstructuredGrid.h>
+#include <VTKViewer_Actor.h>
 
 // VTK Includes
 #include <vtkObjectFactory.h>
@@ -94,8 +95,8 @@ SMESH_DeviceActor
   myMapper = VTKViewer_PolyDataMapper::New();
   myPlaneCollection = vtkPlaneCollection::New();
 
-  vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                 myPolygonOffsetUnits);
+  VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+                                                     myPolygonOffsetUnits);
 
   myMapper->UseLookupTableScalarRangeOn();
   myMapper->SetColorModeToMapScalars();
@@ -430,7 +431,8 @@ SMESH_DeviceActor
       aCellLocationsArray->SetNumberOfTuples( aNbCells );
 
       aConnectivity->InitTraversal();
-      for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
+      vtkIdType const *pts(nullptr);
+      for( vtkIdType idType = 0, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
         aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
 
       aDataSet->SetCells( aCellTypesArray, aCellLocationsArray, aConnectivity );
@@ -494,7 +496,8 @@ SMESH_DeviceActor
       aCellLocationsArray->SetNumberOfTuples( aNbCells );
 
       aConnectivity->InitTraversal();
-      for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
+      vtkIdType const *pts(nullptr);
+      for( vtkIdType idType = 0, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
         aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
 
       aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
@@ -588,7 +591,8 @@ SMESH_DeviceActor
     aCellLocationsArray->SetNumberOfTuples( aNbCells );
     
     aConnectivity->InitTraversal();
-    for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
+    vtkIdType const *pts(nullptr);
+    for( vtkIdType idType = 0, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
       aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
     
     aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
@@ -748,7 +752,7 @@ SMESH_DeviceActor
 {
   bool aShowFaceOrientation = myIsFacesOriented;
   aShowFaceOrientation &= vtkLODActor::GetVisibility(); //GetVisibility(); -- avoid calling GetUnstructuredGrid()  
-  aShowFaceOrientation &= myRepresentation == eSurface;
+  aShowFaceOrientation &= ( myRepresentation != ePoint );
   myFaceOrientation->SetVisibility(aShowFaceOrientation);
 }
 
@@ -860,6 +864,12 @@ SMESH_DeviceActor
   return aCoord;
 }
 
+int
+SMESH_DeviceActor
+::GetNodeVtkId(int theObjID) 
+{
+  return myVisualObj->GetNodeVTKId(theObjID);
+}
 
 int
 SMESH_DeviceActor