From: admin Date: Mon, 21 May 2007 08:13:39 +0000 (+0000) Subject: This commit was generated by cvs2git to create tag X-Git-Tag: mergeto_BR_Dev_For_4_0_21May07 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=85e166846c68b7241ce3f6178d51ca0163fc50de;p=modules%2Fvisu.git 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 --- 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<<"; "<