From: dmv Date: Mon, 19 May 2008 07:23:39 +0000 (+0000) Subject: NPAL 19570: EDF 689 VISU : Bad view angle when creating new presentation X-Git-Tag: TG_start_Deformed_CutPlanes~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=98bcc705784af9c170b7d03fc0f210b92c0235ee;p=modules%2Fvisu.git NPAL 19570: EDF 689 VISU : Bad view angle when creating new presentation --- diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 32a8e7ca..0c24c6ac 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -234,6 +234,9 @@ msgstr "Use Shading" msgid "VISU_DISP_ONLY" msgstr "Display only on creation" +msgid "VISU_AUTOMATIC_FIT_ALL" +msgstr "Automatic Fit All" + msgid "VISU_SHRINK" msgstr "Shrink" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index cafa1a48..ff97cbe2 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -1761,6 +1761,7 @@ VisuGUI aScalarMap->SetMapScale(aPercents); aScalarMap->UpdateActor(anActor); aViewWindow->getRenderWindow()->Render(); + aViewWindow->Repaint(); usleep(aTemp); } catch (std::exception& exc) { INFOS("Follow exception was occured :\n" << exc.what()); @@ -3438,6 +3439,10 @@ void VisuGUI::createPreferences() addPreference( tr( "VISU_DISP_ONLY" ), representGr, LightApp_Preferences::Bool, "VISU", "display_only" ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr, + LightApp_Preferences::Bool, "VISU", "automatic_fit_all" ); // TAB: 3D Cache ; group: "Cache properties" int cacheTab = addPreference( tr( "3D Cache" ) ); diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 52f8a065..bcc04d68 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -457,7 +457,9 @@ void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview) storeToPrsObject(myCutPlanes); myCutPlanes->GetPipeLine()->Update(); createPlanes(); - vf->onFitAll(); + if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) { + vf->onFitAll(); + } } else { deletePlanes(); vf->Repaint(); diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index f7f93903..5eabec8f 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -184,7 +184,7 @@ void VisuGUI_DeformedShapeDlg::updatePrsCopy() VisuGUI* aVisuGUI = dynamic_cast (myModule); if ( myPrsCopy->GetNumberOfActors() == 0 ) { PublishInView(aVisuGUI, myPrsCopy, aViewWindow); -// if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) + if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) aViewWindow->onFitAll(); int aPos = VISU::GetFreePositionOfDefaultScalarBar(aVisuGUI, aViewWindow); VISU::AddScalarBarPosition(aVisuGUI, aViewWindow, myPrsCopy, aPos); @@ -278,7 +278,7 @@ void VisuGUI_DeformedShapeDlg::CreatePrs3d(VisuGUI* theModule) aDlg->storeToPrsObject( aPrs3d ); SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow(); PublishInView(theModule, aPrs3d, aViewWindow); -// if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) + if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) aViewWindow->onFitAll(); int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow); VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 7f66cd39..254b73fa 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -76,7 +76,7 @@ using namespace std; static void renderViewFrame (SVTK_ViewWindow* vw) { if (vw) { - vw->getRenderer()->ResetCameraClippingRange(); +// vw->getRenderer()->ResetCameraClippingRange(); vw->Repaint(); } } @@ -399,7 +399,7 @@ void VisuGUI_Plot3DPane::updatePreview() renderViewFrame(myViewWindow); - if (fitall) { + if (fitall && VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) { myPreviewActor->SetInfinitive(false); myViewWindow->onFitAll(); myPreviewActor->SetInfinitive(true); diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index ba3347a0..7d5e27f2 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -263,7 +263,9 @@ namespace VISU // Display created presentation. if (aViewWindow) { PublishInView(theModule, aPrs3d, aViewWindow); - aViewWindow->onFitAll(); + if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){ + aViewWindow->onFitAll(); + } AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos); } diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index ad54eec1..1284bd6d 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -1089,7 +1089,9 @@ namespace VISU } } aPlot->Repaint(); - aPlot->fitAll(); + if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){ + aPlot->fitAll(); + } } //------------------------------------------------------------ @@ -1201,7 +1203,9 @@ namespace VISU if(av)(const_cast(av))->OnEraseAll(); } PublishMeshInView(theModule, pPresent, theViewWindow); - SetFitAll(theViewWindow); + if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){ + SetFitAll(theViewWindow); + } #ifdef CHECKTIME timer.Stop(); MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");