if(aPrsObject){
if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
//UpdateViewer( this, aPrsObject );
- displayer()->Display( anIO->getEntry() );
-
SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
- if ( vw ) {
- vw->highlight(anIO, 1);
+ if ( vw )
+ {
+ displayer()->Display( anIO->getEntry() );
+ vw->highlight(anIO, 1);
}
continue;
}
QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
- QString anEraseRule = "selcount>0 and (" + aPrsVisible +
+ QString anEraseRule = "selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
" or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + ")))";
- QString aDisplayRule = "selcount>0 and (" + aPrsInvisible +
+ QString aDisplayRule = "selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
" or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + ")))";
- QString aDOnlyRule = "selcount>0 and (($type in {'VISU::TMESH' " + aPrsAll + "})"
+ QString aDOnlyRule = "selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})"
" or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
" ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'}))))";
}
return prs;
}
+
+bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& viewer_type ) const
+{
+ SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
+ if( !study )
+ return false;
+
+ _PTR(SObject) obj = study->studyDS()->FindObjectID( entry.latin1() );
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
+ if( CORBA::is_nil( anObj ) )
+ return false;
+
+ if( viewer_type==SVTK_Viewer::Type() )
+ {
+ VISU::Prs3d_i* thePrs = dynamic_cast<VISU::Prs3d_i*>( VISU::GetServant( anObj ).in() );
+ return thePrs;
+ }
+ else if( viewer_type==SPlot2d_Viewer::Type() )
+ {
+ VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>( VISU::GetServant( anObj ).in() );
+ VISU::Container_i* aCont = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in() );
+ VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant( anObj ).in() );
+ return aCurve || aCont || aTable;
+ }
+ else
+ return false;
+}
~VisuGUI_Displayer();
virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
+ virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const;
protected:
bool addCurve ( SPlot2d_Prs*, Plot2d_ViewWindow*, VISU::Curve_i* ) const;