From 6507b5cf36f7fe19b92bf3f895ff9c71d6a7fd26 Mon Sep 17 00:00:00 2001
From: marco <marco@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Tue, 29 Jun 2010 13:34:45 +0000
Subject: [PATCH] minor cleanup of MapIso

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2471 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 modules/gfx/src/map_iso.cc | 16 +++++++++++-----
 modules/gfx/src/map_iso.hh |  1 +
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/modules/gfx/src/map_iso.cc b/modules/gfx/src/map_iso.cc
index 4d49ce68c..946c2becb 100644
--- a/modules/gfx/src/map_iso.cc
+++ b/modules/gfx/src/map_iso.cc
@@ -135,8 +135,8 @@ geom::Vec3 MapIso::GetCenter() const
   geom::Vec3 nrvo = mh_.IndexToCoord(mh_.GetExtent().GetCenter());
   return nrvo;
 }
-  
-void MapIso::OnRenderModeChange()
+
+void MapIso::UpdateRenderParams()
 {
   if(GetRenderMode()==RenderMode::FILL ||
      GetRenderMode()==RenderMode::OUTLINE) {
@@ -159,7 +159,12 @@ void MapIso::OnRenderModeChange()
     va_.SetLineWidth(this->GetLineWidth());
     va_.SetMode(0x2); // only lines
     va_.SetTwoSided(true);
-  }
+  }  
+}
+
+void MapIso::OnRenderModeChange()
+{
+  this->UpdateRenderParams();
   this->FlagRebuild();
   GfxObj::OnRenderModeChange();
 }
@@ -298,7 +303,7 @@ void MapIso::Rebuild()
   va_.CalcNormals(1.0);
   va_.DrawNormals(true);
 #endif  
-  OnRenderModeChange();  
+  this->UpdateRenderParams();  
 }
 
 void MapIso::SetLevel(float l)
@@ -316,7 +321,8 @@ void MapIso::CalculateStat() const
 
 void MapIso::CalculateHistogram() const
 {
-  histogram_ = img::alg::HistogramBase(histogram_bin_count_, this->GetMinLevel(), this->GetMaxLevel());
+  histogram_ = img::alg::HistogramBase(histogram_bin_count_, 
+                                       this->GetMinLevel(), this->GetMaxLevel());
   mh_.ApplyIP(histogram_);
   histogram_calculated_=true;
 }
diff --git a/modules/gfx/src/map_iso.hh b/modules/gfx/src/map_iso.hh
index 9ed928632..70319e7c7 100644
--- a/modules/gfx/src/map_iso.hh
+++ b/modules/gfx/src/map_iso.hh
@@ -146,6 +146,7 @@ public:
   bool IfOctreeDirty() const;
 
 protected:
+  void UpdateRenderParams();
   void CalculateStat() const;
   void CalculateHistogram() const;
   virtual void CustomPreRenderGL(bool flag);
-- 
GitLab