Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISUGUI / VisuGUI_Displayer.cxx
index bcfffa772294744ddb3810aca7e4ef7ed5c8c996..1fa6f098984eb6b1e560bf44fc517dd634a0beea 100644 (file)
@@ -27,6 +27,7 @@
 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/VISUGUI/VisuGUI_Displayer.cxx
 
 #include "VisuGUI_Displayer.h"
+#include "VVTK_ViewModel.h"
 #include "VisuGUI_Tools.h"
 #include "VISU_Actor.h"
 
@@ -69,7 +70,8 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V
     SVTK_Viewer* vtk_viewer = dynamic_cast<SVTK_Viewer*>( aViewFrame );
     if( vtk_viewer )
     {
-      SVTK_ViewWindow* wnd = dynamic_cast<SVTK_ViewWindow*>( vtk_viewer->getViewManager()->getActiveView() );
+      SVTK_ViewWindow* wnd =
+        dynamic_cast<SVTK_ViewWindow*>( vtk_viewer->getViewManager()->getActiveView() );
       if( wnd )
       {
        VISU::Prs3d_i* thePrs = dynamic_cast<VISU::Prs3d_i*>( VISU::GetServant( anObj ).in() );
@@ -84,7 +86,8 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& entry, SALOME_V
     SPlot2d_Viewer* plot_viewer = dynamic_cast<SPlot2d_Viewer*>( aViewFrame );
     if( plot_viewer )
     {
-      Plot2d_ViewWindow* wnd = dynamic_cast<Plot2d_ViewWindow*>( plot_viewer->getViewManager()->getActiveView() );
+      Plot2d_ViewWindow* wnd =
+        dynamic_cast<Plot2d_ViewWindow*>( plot_viewer->getViewManager()->getActiveView() );
       if( !wnd )
        return 0;
 
@@ -116,11 +119,9 @@ void VisuGUI_Displayer::buildPrs3d( SVTK_ViewWindow* wnd, VISU::Prs3d_i* thePrs
   VISU_Actor* newAct = VISU::FindActor( wnd, thePrs );
   if( !newAct )
   {
-    VISU_Actor* a = thePrs->CreateActor();
-    if( a )
-      newAct = a->GetParent();
+    newAct = thePrs->CreateActor();
   }
-  if( newAct && newAct )
+  if( newAct )
   {
     wnd->AddActor( newAct );
     wnd->Repaint();
@@ -224,7 +225,10 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie
   if( CORBA::is_nil( anObj ) )
     return false;
 
-  if( viewer_type==SVTK_Viewer::Type() )
+  if( study->isComponent( entry ) )
+    return true;
+
+  if( viewer_type==SVTK_Viewer::Type() || viewer_type==VVTK_Viewer::Type())
   {
     VISU::Prs3d_i* thePrs = dynamic_cast<VISU::Prs3d_i*>( VISU::GetServant( anObj ).in() );
     return thePrs;