diff --git a/modules/gfx/src/map_iso.cc b/modules/gfx/src/map_iso.cc index 4d49ce68c41c3f6a81d79d05829a8068b893c46c..946c2becbbca9fd910ceb409366ecb58fad01a80 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 9ed928632c301b6d500b604babc085f24ce72e08..70319e7c7d310790d647d548902f1473da85f521 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);