From 18125691dd3427066d7ee9fe99dfc3c10d46c552 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 2 Apr 2010 13:20:24 +0000 Subject: [PATCH] 0020821: EDF 1347 VISU : Surface Representation during edition --- src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 19 +++++++++++++++---- src/VISUGUI/VisuGUI_DeformedShapeDlg.h | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index 03f87a4c..92b6ba8a 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -205,12 +205,23 @@ int VisuGUI_DeformedShapeDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs) return anIsOk; } -void VisuGUI_DeformedShapeDlg::updatePrsCopy() +void VisuGUI_DeformedShapeDlg::updatePrsCopy( VISU::Prs3d_i* thePrs ) { SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(); VisuGUI* aVisuGUI = dynamic_cast (myModule); if ( myPrsCopy->GetNumberOfActors() == 0 ) { PublishInView(aVisuGUI, myPrsCopy, aViewWindow); + + // Bug 0020821 + if( thePrs ) { + if( SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow( myModule ) ) { + VISU_Actor* anActorSource = VISU::FindActor( aViewWindow, thePrs ); + VISU_Actor* anActorCopy = VISU::FindActor( aViewWindow, myPrsCopy ); + if( anActorSource && anActorCopy ) + anActorCopy->DeepCopy( anActorSource ); + } + } + if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) aViewWindow->onFitAll(); int aPos = VISU::GetFreePositionOfDefaultScalarBar(aVisuGUI, aViewWindow); @@ -252,7 +263,7 @@ bool VisuGUI_DeformedShapeDlg::onApply() { if ( storeToPrsObject( myPrsCopy ) ) { - updatePrsCopy(); + updatePrsCopy( myPrsCopy ); isApplyed = true; return true; } @@ -329,7 +340,7 @@ void VisuGUI_DeformedShapeDlg::EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* theP if (TPrs3d_i* aPrs3d = dynamic_cast(thePrs3d)) { VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule); aDlg->initFromPrsObject(aPrs3d, true); - aDlg->updatePrsCopy(); + aDlg->updatePrsCopy(thePrs3d); //Hide thePrs3d from Viewer SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(theModule); @@ -339,7 +350,7 @@ void VisuGUI_DeformedShapeDlg::EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* theP anActor->VisibilityOff(); VisuGUI_DialogRunner r(aDlg); - int dlgResult = r.run( false ); + int dlgResult = r.run( true ); if ( dlgResult != 0 ) aDlg->storeToPrsObject( aPrs3d ); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index 5589baf4..c66a84b5 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -72,7 +72,7 @@ public: static VISU::Prs3d_i* CreatePrs3d(VisuGUI* theModule); static void EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d, Handle(SALOME_InteractiveObject)& theIO); - void updatePrsCopy(); + void updatePrsCopy( VISU::Prs3d_i* thePrs ); protected: virtual QString GetContextHelpFilePath(); -- 2.39.2