Salome HOME
cmake compatibility
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index 91d5002836d2af36d35702b5e6a0d7a4ba876bc8..d392cbe0d6e28dce3bd24e5442094f88cb5514c1 100644 (file)
@@ -226,6 +226,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
   aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+  aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
 
   //Definition 1D device of the actor
   //---------------------------------
@@ -533,6 +534,13 @@ SMESH_ActorDef::~SMESH_ActorDef()
 {
   if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
 
+#ifndef DISABLE_PLOT2DVIEWER
+  if(my2dHistogram) {
+    SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
+    delete my2dHistogram;
+  }
+#endif
+
   // caught by SMESHGUI::ProcessEvents() static method
   this->InvokeEvent( SMESH::DeleteActorEvent, NULL );
 
@@ -617,10 +625,6 @@ SMESH_ActorDef::~SMESH_ActorDef()
   myImplicitBoolean->Delete();
 
   myTimeStamp->Delete();
-#ifndef DISABLE_PLOT2DVIEWER
-  if(my2dHistogram)
-    delete my2dHistogram;
-#endif 
 }
 
 
@@ -1343,7 +1347,11 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
 
     if(myIsCellsLabeled) 
       myCellsLabels->VisibilityOn();
-  }
+  } 
+#ifndef DISABLE_PLOT2DVIEWER
+  else
+    SMESH::ProcessIn2DViewers(this,SMESH::RemoveFrom2dViewer);
+#endif
   UpdateHighlight();
   Modified();
 }