]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL 19570: EDF 689 VISU : Bad view angle when creating new presentation
authordmv <dmv@opencascade.com>
Mon, 19 May 2008 07:23:39 +0000 (07:23 +0000)
committerdmv <dmv@opencascade.com>
Mon, 19 May 2008 07:23:39 +0000 (07:23 +0000)
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_Tools.cxx

index 32a8e7cab1444615f54d3a16ab26d8a165f21b80..0c24c6accfe4e08b7e98c1a0df25af4685eebc9c 100644 (file)
@@ -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"
 
index cafa1a480cb11ae22a222850f6f2553b137a9fa5..ff97cbe27fcd5fa71e0dcdc10922ac97aaf7173d 100644 (file)
@@ -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" ) );
index 52f8a065444c32dc3c18db49646d6138d19944f6..bcc04d68d899058e86b99308286e043bd8dc88fa 100644 (file)
@@ -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();
index f7f9390332f527123e80ded43cf780cda1ab8eb3..5eabec8faa37d152b7664d0f54956d007881b8e4 100644 (file)
@@ -184,7 +184,7 @@ void VisuGUI_DeformedShapeDlg::updatePrsCopy()
   VisuGUI* aVisuGUI = dynamic_cast <VisuGUI*>(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<SVTK_ViewWindow>();
            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);
index 7f66cd39d60983406f6531e24a3e8facbfc465d0..254b73fa431328da39721ce8e772e18ee695946a 100644 (file)
@@ -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);
index ba3347a037229a0ee404f44fa0165135e4c327e8..7d5e27f21a1ceb12960633d5e1665266e4a25d30 100644 (file)
@@ -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);
       }
index ad54eec133987b18f13ea7bfe94757901324e8c3..1284bd6ded02a0b6fdab0a5e009c8da88520ddf9 100644 (file)
@@ -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<VisuGUI*>(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");