From ab370779da71629697355b2625db52584612b089 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 6 Oct 2005 05:04:50 +0000 Subject: [PATCH] To provide persistent of the GaussPoints presentations --- src/VISU_I/VISU_GaussPoints_i.cc | 67 +++++++++++++++++++++++++++++++- src/VISU_I/VISU_GaussPoints_i.hh | 6 +++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 02381e3b..12bb52e7 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -148,8 +148,8 @@ VISU::GaussPoints_i bool aDisplayGlobal = aResourceMgr->booleanValue( "VISU", "scalar_bar_diplay_global", GetIsDispGlobalScalarBar() ); SetIsDispGlobalScalarBar( aDisplayGlobal ); - int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetGaussPointsPL()->GetBicolor() ); - GetGaussPointsPL()->SetBicolor( aBicolor == 0 ); + int aBicolor = aResourceMgr->integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() ); + SetBiColor( aBicolor == 0 ); float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() ); SetSpacing( aSpacing ); @@ -200,6 +200,32 @@ VISU::GaussPoints_i { TSuperClass::Restore(theMap); + SetIsActiveLocalScalarBar(Storable::FindValue(theMap,"myIsActiveLocalScalarBar").toInt()); + SetIsDispGlobalScalarBar(Storable::FindValue(theMap,"myIsDispGlobalScalarBar").toInt()); + SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt()); + SetSpacing(Storable::FindValue(theMap,"mySpacing").toDouble()); + + SetClamp(Storable::FindValue(theMap,"myClamp").toDouble()); + SetMinSize(Storable::FindValue(theMap,"myMinSize").toDouble()); + SetMaxSize(Storable::FindValue(theMap,"myMaxSize").toDouble()); + SetConstSize(Storable::FindValue(theMap,"myConstSize").toDouble()); + + SetMagnification(Storable::FindValue(theMap,"myMagnification").toDouble()); + SetMagnificationIncrement(Storable::FindValue(theMap,"myMagnificationIncrement").toDouble()); + + SetIsColored(Storable::FindValue(theMap,"myIsColored").toInt()); + int aRed = Storable::FindValue(theMap,"myColor.R").toInt(); + int aGreen = Storable::FindValue(theMap,"myColor.G").toInt(); + int aBlue = Storable::FindValue(theMap,"myColor.B").toInt(); + SetColor( QColor(aRed,aGreen,aBlue) ); + + SetAlphaThreshold(Storable::FindValue(theMap,"myAlphaThreshold").toDouble()); + + SetMainTexture(Storable::FindValue(theMap,"myMainTexture")); + SetAlphaTexture(Storable::FindValue(theMap,"myAlphaTexture")); + + SetTextures( GetMainTexture(), GetAlphaTexture() ); + return this; } @@ -210,6 +236,29 @@ VISU::GaussPoints_i ::ToStream(std::ostringstream& theStr) { TSuperClass::ToStream(theStr); + + Storable::DataToStream( theStr, "myIsActiveLocalScalarBar", myIsActiveLocalScalarBar ); + Storable::DataToStream( theStr, "myIsDispGlobalScalarBar", myIsDispGlobalScalarBar ); + Storable::DataToStream( theStr, "myIsBiColor", GetBiColor() ); + Storable::DataToStream( theStr, "mySpacing", GetSpacing() ); + + Storable::DataToStream( theStr, "myClamp", GetClamp() ); + Storable::DataToStream( theStr, "myMinSize", GetMinSize() ); + Storable::DataToStream( theStr, "myMaxSize", GetMaxSize() ); + Storable::DataToStream( theStr, "myConstSize", GetConstSize() ); + + Storable::DataToStream( theStr, "myMagnification", GetMagnification() ); + Storable::DataToStream( theStr, "myMagnificationIncrement", GetMagnificationIncrement() ); + + Storable::DataToStream( theStr, "myIsColored", GetIsColored() ); + QColor aColor = GetColor(); + Storable::DataToStream( theStr, "myColor.R", aColor.red() ); + Storable::DataToStream( theStr, "myColor.G", aColor.green() ); + Storable::DataToStream( theStr, "myColor.B", aColor.blue() ); + + Storable::DataToStream( theStr, "myAlphaThreshold", GetAlphaThreshold() ); + Storable::DataToStream( theStr, "myMainTexture", GetMainTexture() ); + Storable::DataToStream( theStr, "myAlphaTexture", GetAlphaTexture() ); } @@ -641,6 +690,20 @@ VISU::GaussPoints_i return myIsDispGlobalScalarBar; } +void +VISU::GaussPoints_i +::SetBiColor(bool theIsBiColor) +{ + GetGaussPointsPL()->SetBicolor(theIsBiColor); +} + +bool +VISU::GaussPoints_i +::GetBiColor() +{ + return GetGaussPointsPL()->GetBicolor(); +} + void VISU::GaussPoints_i ::SetSpacing(const float theSpacing) diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh index 6c63572c..85d97629 100644 --- a/src/VISU_I/VISU_GaussPoints_i.hh +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -156,6 +156,12 @@ namespace VISU bool GetIsDispGlobalScalarBar() const; + void + SetBiColor(bool theIsBiColor); + + bool + GetBiColor(); + void SetSpacing(const float theSpacing); -- 2.39.2