Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/geom.git] / src / GEOMGUI / GEOM_Displayer.cxx
index 20b49e11c866fe3142892aaaccd8fd24bbc4ac6d..40b20d41fc5327dae1b4c1e5fa459ae64677292c 100644 (file)
@@ -83,6 +83,7 @@
 
 // VTK Includes
 #include <vtkActorCollection.h>
+#include <vtkProperty.h>
 
 // STL Includes
 #include <cstring>
@@ -838,12 +839,13 @@ void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& the
   sm->clearFilters();
 
   SALOME_View* vf = GetActiveView();
-  if ( vf )
-    {
-      SALOME_Prs* prs = vf->CreatePrs( theIO.IsNull() ? 0 : theIO->getEntry() );
-      vf->LocalSelection( prs, theMode );
-      delete prs;  // delete presentation because displayer is its owner
-    }
+  if ( vf ) {
+    if (!theIO.IsNull() && !vf->isVisible(theIO))
+      Display(theIO);
+    SALOME_Prs* prs = vf->CreatePrs( theIO.IsNull() ? 0 : theIO->getEntry() );
+    vf->LocalSelection( prs, theMode );
+    delete prs;  // delete presentation because displayer is its owner
+  }
 }
 
 //=================================================================
@@ -1094,3 +1096,8 @@ void GEOM_Displayer::setShape( const TopoDS_Shape& theShape )
 {
   myShape = theShape;
 }
+
+bool GEOM_Displayer::canBeDisplayed( const QString& /*entry*/, const QString& viewer_type ) const
+{
+  return viewer_type==SOCC_Viewer::Type() || viewer_type==SVTK_Viewer::Type();
+}