]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To provide persistent of the GaussPoints presentations
authorapo <apo@opencascade.com>
Thu, 6 Oct 2005 05:04:50 +0000 (05:04 +0000)
committerapo <apo@opencascade.com>
Thu, 6 Oct 2005 05:04:50 +0000 (05:04 +0000)
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh

index 02381e3b539cfa00d4b917b22bcc41f5fbeedb47..12bb52e7276eee13c9d55f61a7d56c5783cd9576 100644 (file)
@@ -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)
index 6c63572ceda88284d9f7e65bfb06d44ecfb2135e..85d976298223434bf972d6329f3dbef37a3b974a 100644 (file)
@@ -156,6 +156,12 @@ namespace VISU
     bool
     GetIsDispGlobalScalarBar() const;
 
+    void
+    SetBiColor(bool theIsBiColor);
+
+    bool
+    GetBiColor();
+
     void
     SetSpacing(const float theSpacing);