From 85e166846c68b7241ce3f6178d51ca0163fc50de Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 21 May 2007 08:13:39 +0000 Subject: [PATCH] This commit was generated by cvs2git to create tag 'mergeto_BR_Dev_For_4_0_21May07'. Sprout from BR_mergefrom_BR_Dev_For_4_0 2007-05-21 08:13:38 UTC apo 'To fix problem with MED module interaction' Cherrypick from BR_mergefrom_BR_Dev_For_4_0 2007-05-15 06:56:10 UTC apo 'To customize "shrink" functionality for the presentations': resources/Makefile.am src/PIPELINE/VISU_PipeLine.cxx src/PIPELINE/VISU_PipeLine.hxx --- resources/Makefile.am | 6 +----- src/PIPELINE/VISU_PipeLine.cxx | 19 +++++++++---------- src/PIPELINE/VISU_PipeLine.hxx | 4 ++-- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/resources/Makefile.am b/resources/Makefile.am index 61ac45c2..5cf88e8c 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -84,10 +84,6 @@ Visu_tree_gauss_points.png \ Visu_tree_isosurfaces_gr.png \ Visu_tree_isosurfaces.png \ Visu_tree_mesh.png \ -Visu_tree_multipr_full.png \ -Visu_tree_multipr_hide.png \ -Visu_tree_multipr_low.png \ -Visu_tree_multipr_medium.png \ Visu_tree_plot3d_gr.png \ Visu_tree_plot3d.png \ Visu_tree_result.png \ @@ -112,6 +108,6 @@ Visu_slider_play.png \ Visu_slider_pause.png \ Visu_slider_next.png \ Visu_slider_last.png - + EXTRA_DIST+= VISUCatalog.xml.in nodist_salomeres_DATA=VISUCatalog.xml diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 06661f01..0b8b845a 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -393,14 +393,13 @@ VISU_PipeLine //---------------------------------------------------------------------------- size_t VISU_PipeLine -::CheckAvailableMemory(double theSize) +::CheckAvailableMemory(size_t theSize) { if(theSize < ULONG_MAX){ try{ - size_t aSize = size_t(theSize); - if(char *aCheck = new char[aSize]){ + if(char *aCheck = new char[theSize]){ delete [] aCheck; - return aSize; + return theSize; } }catch(std::bad_alloc& exc){ }catch(...){ @@ -417,19 +416,19 @@ VISU_PipeLine size_t theMinSize) { // Finds acceptable memory size by half-deflection methods - static double EPSILON = 2 * 1024; - double aMax = std::max(theSize, theMinSize); - double aMin = std::min(theSize, theMinSize); + static size_t EPSILON = 2 * 1024; + size_t aMax = std::max(theSize, theMinSize); + size_t aMin = std::min(theSize, theMinSize); //cout<<"GetAvailableMemory - "< EPSILON){ - double aRoot = (aMax + aMin) / 2.; + while(CheckAvailableMemory(aMax) == 0 && CheckAvailableMemory(aMin) > 0 && (aMax - aMin) > EPSILON){ + size_t aRoot = (aMax + aMin) / 2; if(CheckAvailableMemory(aRoot)) aMin = aRoot; else aMax = aRoot; } //cout<<"; "<