aViewWindow->Repaint();
break;
}
+ else
+ displayer()->Display(anIO->getEntry());
case VISU::TCURVE:
case VISU::TCONTAINER:
case VISU::TTABLE:
// display/erase commands
QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
- QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
+ QString aTableOrContHide = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreVisibleCurves)";
+ QString aTableOrContShow = "(($type in {'VISU::TTABLE' 'VISU::TPOINTMAP3D' 'VISU::TCONTAINER'}) and isPlot2dViewer and hasCurves and isThereAreHiddenCurves)";
QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
- QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isVisible)";
- QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})" + andInvisible + ")";
+ QString aPrsVisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isVisible and (not isPlot2dViewer))";
+ QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})" + andInvisible + " and (not isPlot2dViewer))";
QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
- " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent;
+ " or (client='ObjectBrowser' and (" + aTableOrContHide + orCurveVisible + "))) ) or " + aComponent;
QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
- " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or " + aComponent;
+ " or (client='ObjectBrowser' and (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})"
" or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
#include "SalomeApp_Study.h"
#include "LightApp_Study.h"
+#include "LightApp_Displayer.h"
using namespace VISU;
else if ( p == "mediumResolution" ) val = QVariant( mediumResolution( ind ) );
else if ( p == "lowResolution" ) val = QVariant( lowResolution( ind ) );
else if ( p == "resolutionState" ) val = QVariant( resolutionState( ind ) );
+ else if ( p == "isThereAreVisibleCurves" ) val = QVariant( findDisplayedCurves( ind, false ) );
+ else if ( p == "isThereAreHiddenCurves" ) val = QVariant( findDisplayedCurves( ind, true ) );
+ else if ( p == "hasCurves" ) val = QVariant( hasCurves( ind ) );
+ else if ( p == "isPlot2dViewer" ) val = QVariant( Plot2dViewerType( ind ) );
}
return val;
return dynamic_cast<VISU::VISU_Gen_i*>( VISU::GetServant( anObj ).in() );
}
+
+//---------------------------------------------------------------------------
+bool VisuGUI_Selection::findDisplayedCurves( const int ind, bool findHidden ) const
+{
+ // findHidden == false - find at least one Visible curve in the childs of ind
+ // findHidden == true - find at least one Hidden curve in the childs of ind
+ SalomeApp_Study* aSStudy = GetStudy();
+ if ( !aSStudy )
+ return false;
+
+ QString entryId;
+ _PTR(Study) aStudy = GetCStudy( aSStudy );
+ if ( aStudy ){
+ _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
+ if ( SO ){
+ for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
+ _PTR(SObject) refSO;
+ if ( Iter->Value()->ReferencedObject(refSO) )
+ entryId = refSO->GetID().c_str();
+ else
+ entryId = Iter->Value()->GetID().c_str();
+
+ LightApp_Displayer* displayer = LightApp_Displayer::FindDisplayer( myModule->moduleName(), false );
+ if ( displayer->IsDisplayed( entryId ) && findHidden == false )
+ return true;
+ else if ( !displayer->IsDisplayed( entryId ) && findHidden == true )
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+//---------------------------------------------------------------------------
+bool VisuGUI_Selection::hasCurves( const int ind ) const
+{
+ SalomeApp_Study* aSStudy = GetStudy();
+ if ( !aSStudy )
+ return false;
+
+ QString entryId;
+ _PTR(Study) aStudy = GetCStudy( aSStudy );
+ if ( aStudy ){
+ _PTR(SObject) SO = aStudy->FindObjectID( (const char*) entry( ind ).toLatin1() );
+ if ( SO ){
+ for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
+ _PTR(SObject) refSO;
+ if ( Iter->Value()->ReferencedObject(refSO) ) {
+ // reference on curve
+ }
+ else
+ refSO = Iter->Value();
+
+ CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(refSO);
+ if(!CORBA::is_nil(aCORBAObject)){
+ PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+ if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aServant.in()))
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+//---------------------------------------------------------------------------
+bool VisuGUI_Selection::Plot2dViewerType( const int ind ) const
+{
+ QString viewerType;
+ SUIT_Session* session = SUIT_Session::session();
+ if( SUIT_Application* app = session->activeApplication() )
+ if( LightApp_Application* sApp = dynamic_cast<LightApp_Application*>( app ) )
+ if( SUIT_ViewManager* vman = sApp->activeViewManager() )
+ if( SUIT_ViewModel* vmod = vman->getViewModel() ) {
+ viewerType = vmod->getType();
+ if (viewerType ==SPlot2d_Viewer::Type())
+ return true;
+ }
+ return false;
+}
+