From: akl Date: Fri, 22 Aug 2008 16:21:41 +0000 (+0000) Subject: Correction integration for issue 0016100: EDF 429 VISU : Automatic creation of a... X-Git-Tag: V5_1_0a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=df78ab0f24f145bc1b5828375124fc230e15d73d;p=modules%2Fvisu.git Correction integration for issue 0016100: EDF 429 VISU : Automatic creation of a view Plot2D when we display a curve. --- diff --git a/src/VISUGUI/VisuGUI_Displayer.cxx b/src/VISUGUI/VisuGUI_Displayer.cxx index 9593731e..9cf7e830 100644 --- a/src/VISUGUI/VisuGUI_Displayer.cxx +++ b/src/VISUGUI/VisuGUI_Displayer.cxx @@ -63,10 +63,9 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM { SALOME_Prs* aPrs = 0; - SALOME_View* aView = theView ? theView : GetActiveView(); SalomeApp_Study* aStudy = dynamic_cast( myApp->activeStudy() ); - if(aStudy && aView){ + if(aStudy){ _PTR(SObject) aSObject = aStudy->studyDS()->FindObjectID( (const char*)theEntry.toLatin1() ); CORBA::Object_var anObject = VISU::ClientSObjectToObject( aSObject ); if( CORBA::is_nil( anObject ) ) @@ -78,9 +77,10 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM VISU::Base_i* aBaseServant = dynamic_cast(VISU::GetServant(aBase).in()); + SALOME_View* aView = theView ? theView : GetActiveView(); VISU::VISUType aType = aBase->GetType(); VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aBase); - if(!CORBA::is_nil(aPrs3d) || aType == VISU::TCOLOREDPRS3DHOLDER){ + if( aView && (!CORBA::is_nil(aPrs3d) || aType == VISU::TCOLOREDPRS3DHOLDER) ){ SVTK_Viewer* aViewer = dynamic_cast( aView ); if (!aViewer) aViewer = dynamic_cast( aView ); @@ -124,8 +124,9 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM } } - SPlot2d_Viewer* aViewer = dynamic_cast(aView); - if(!aViewer && (aType==VISU::TCURVE || aType==VISU::TCONTAINER || aType==VISU::TTABLE)) + SPlot2d_Viewer* aViewer = 0; + if (aView) aViewer = dynamic_cast(aView); + if(!aViewer && (aType==VISU::TCURVE || aType==VISU::TCONTAINER)) if(VisuGUI* aVisuGUI = dynamic_cast(myApp->activeModule())) aViewer = VISU::GetPlot2dViewer( (SalomeApp_Module*)aVisuGUI, true ); @@ -148,6 +149,7 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM aPlot2dPrs = buildContainer( aViewWindow, aContainer ); break; } + case VISU::TPOINTMAP3D: case VISU::TTABLE: { VISU::Table_i* aTable = dynamic_cast(aBaseServant); aPlot2dPrs = buildTable( aViewWindow, aTable ); @@ -289,9 +291,7 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie if( dynamic_cast( VISU::GetServant( anObj ).in() ) || - dynamic_cast( VISU::GetServant( anObj ).in() ) - || - dynamic_cast(VISU::GetServant( anObj ).in() ) ) + dynamic_cast( VISU::GetServant( anObj ).in() ) ) return true; if( viewer_type==SVTK_Viewer::Type() || viewer_type==VVTK_Viewer::Type()) @@ -309,6 +309,11 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie return dynamic_cast(aBase); } + else if( viewer_type==SPlot2d_Viewer::Type() ) + { + VISU::Table_i* aTable = dynamic_cast(VISU::GetServant( anObj ).in() ); + return aTable; + } else return false; }