Salome HOME
Merge branch 'master' into pre/penta18
[modules/smesh.git] / src / OBJECT / SMESH_DeviceActor.cxx
index 66cb811bf2ae2d9c8f37f8f9f87ae8fa20907b37..cfe6159a2c0e7e4484c444878060473940d275f2 100644 (file)
@@ -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>
@@ -88,14 +89,14 @@ SMESH_DeviceActor
   myIsShrunk = false;
   myIsHighlited = false;
 
-  myRepresentation = eSurface;
+  myRepresentation = SMESH_DeviceActor::EReperesent(-1);
 
   myProperty = vtkProperty::New();
   myMapper = VTKViewer_PolyDataMapper::New();
   myPlaneCollection = vtkPlaneCollection::New();
 
-  vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
-                                                                 myPolygonOffsetUnits);
+  VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
+                                                     myPolygonOffsetUnits);
 
   myMapper->UseLookupTableScalarRangeOn();
   myMapper->SetColorModeToMapScalars();
@@ -306,7 +307,7 @@ SMESH_DeviceActor
     vtkUnstructuredGrid* aDataSet = vtkUnstructuredGrid::New();
 
     // SetStoreIDMapping(true);
-    // myExtractUnstructuredGrid->Update();
+    myExtractUnstructuredGrid->Update();
     vtkUnstructuredGrid* aGrid = myExtractUnstructuredGrid->GetOutput();
 
     aDataSet->ShallowCopy(aGrid);
@@ -615,11 +616,23 @@ SMESH_DeviceActor
 
 
 
-unsigned long int
+vtkMTimeType
 SMESH_DeviceActor
 ::GetMTime()
 {
-  // cout << this->myExtractUnstructuredGrid
+  // cout << "DA " << this
+  //      << " GF " << myGeomFilter;
+  // if ( this->Property )
+  //   cout << " P " << this->Property->GetMTime();
+  // if ( this->BackfaceProperty != NULL )
+  //   cout << " BP " << BackfaceProperty->GetMTime();
+  // if ( this->Texture != NULL )
+  //   cout << " T " << this->Texture->GetMTime();
+  // cout << " U " << this->GetUserTransformMatrixMTime()
+  //      << " M " << this->MTime.GetMTime() << endl;
+
+  // cout << "DA " << this
+  //      << " GF " << myGeomFilter
   //      << " " << this->Superclass::GetMTime()
   //      << " " << myExtractGeometry->GetMTime()
   //      << " " << myExtractUnstructuredGrid->GetMTime()
@@ -628,7 +641,7 @@ SMESH_DeviceActor
   //      << " " << myTransformFilter->GetMTime()
   //      << " " << myFaceOrientationFilter->GetMTime() << endl;
 
-  unsigned long mTime = this->Superclass::GetMTime();
+  vtkMTimeType mTime = this->Superclass::GetMTime();
   mTime = max(mTime,myExtractGeometry->GetMTime());
   mTime = max(mTime,myExtractUnstructuredGrid->GetMTime());
   mTime = max(mTime,myMergeFilter->GetMTime());
@@ -745,6 +758,8 @@ void
 SMESH_DeviceActor
 ::SetRepresentation(EReperesent theMode)
 {
+  if ( myRepresentation == theMode )
+    return;
   switch(theMode){
   case ePoint:
     myGeomFilter->SetInside(true);