+
+bool VisuGUI_Displayer::IsDisplayed( const QString& id, SALOME_View* vf ) const {
+
+ bool displayed = false;
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myApp->activeStudy() );
+ if(!aStudy)
+ return displayed;
+
+ _PTR(SObject) aSObject = aStudy->studyDS()->FindObjectID( (const char*)id.toLatin1() );
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( aSObject );
+ if( CORBA::is_nil( anObj ) )
+ return LightApp_Displayer::IsDisplayed(id, vf);
+
+ if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in())) {
+ int nbCurves = aContainer->GetNbCurves();
+ for( int k=1; k<=nbCurves; k++ ) {
+ VISU::Curve_i* aCurve = aContainer->GetCurve( k );
+ if(aCurve && LightApp_Displayer::IsDisplayed(aCurve->GetEntry().c_str(), vf)) {
+ displayed = true;
+ break;
+ }
+ }
+ return displayed;
+ } else if( VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>( VISU::GetServant( anObj ).in()) ) {
+
+ SPlot2d_Viewer* view2D = dynamic_cast<SPlot2d_Viewer*>(vf);
+ if( !view2D )
+ return LightApp_Displayer::IsDisplayed(id, vf);
+
+ _PTR(SObject) TableSO = aStudy->studyDS()->FindObjectID( (const char*)id.toLatin1() );
+ if( TableSO ) {
+ _PTR(ChildIterator) Iter = aStudy->studyDS()->NewChildIterator( TableSO );
+ for( ; Iter->More(); Iter->Next() ) {
+ CORBA::Object_var childObject = VISU::ClientSObjectToObject( Iter->Value() );
+ if( !CORBA::is_nil( childObject ) ) {
+ CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
+ if( !CORBA::is_nil( aCurve ) ) {
+ VISU::Curve_i* aCurve_i = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+ if(aCurve && LightApp_Displayer::IsDisplayed(aCurve_i->GetEntry().c_str(), vf)) {
+ displayed = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ return displayed;
+ } else {
+ return LightApp_Displayer::IsDisplayed(id, vf);
+ }
+}
+