From 0b8845c457bf2aab8797f22d8b251c85a3b5cb70 Mon Sep 17 00:00:00 2001 From: ouv Date: Fri, 30 Sep 2005 12:18:22 +0000 Subject: [PATCH] Initializing pipeline from resources --- src/VISU_I/VISU_GaussPoints_i.cc | 186 +++++++++++++++++++++++++------ src/VISU_I/VISU_GaussPoints_i.hh | 56 +++++++++- 2 files changed, 203 insertions(+), 39 deletions(-) diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index b80d4081..6392349c 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -33,6 +33,8 @@ #include "VISU_OpenGLPointSpriteMapper.hxx" #include "VISU_ScalarBarCtrl.hxx" +#include "SUIT_ResourceMgr.h" + #include #include #include @@ -101,9 +103,9 @@ GaussPoints_i(Result_i* theResult, ScalarMap_i(theResult,theAddToStudy), myGaussPointsPL(NULL), myIsColored(true), + myColor(Qt::blue), myIsActiveLocalScalarBar(true), - myIsDispGlobalScalarBar(true), - myColor(Qt::blue) + myIsDispGlobalScalarBar(true) { if(MYDEBUG) MESSAGE("GaussPoints_i::GaussPoints_i - this = "<doubleValue( "VISU", "point_sprite_clamp", GetClamp() ); + SetClamp( aClamp ); + + float aConstSize = aResourceMgr->doubleValue( "VISU", "point_sprite_size", GetConstSize() ); + SetConstSize( aConstSize ); + + float aMinSize = aResourceMgr->doubleValue( "VISU", "point_sprite_min_size", GetMinSize() ); + SetMinSize( aMinSize ); + + float aMaxSize = aResourceMgr->doubleValue( "VISU", "point_sprite_max_size", GetMaxSize() ); + SetMaxSize( aMaxSize ); + + float aMagnification = aResourceMgr->doubleValue( "VISU", "point_sprite_magnification", GetMagnification() ); + SetMagnification( aMagnification ); + + float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() ); + SetMagnificationIncrement( anIncrement ); + + bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() ); + SetIsColored( isColored ); + + QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() ); + SetColor( aColor ); + + float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() ); + SetAlphaThreshold( anAlphaThreshold ); + + QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp"; + aMainTexture = aResourceMgr->stringValue( "VISU", "point_sprite_main_texture", aMainTexture ); + + QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp"; + anAlphaTexture = aResourceMgr->stringValue( "VISU", "point_sprite_alpha_texture", anAlphaTexture ); + + SetTextures( aMainTexture, anAlphaTexture ); + + return this; } @@ -168,34 +211,6 @@ VISU::GaussPoints_i return myGaussPointsPL; } -QColor -VISU::GaussPoints_i -::GetColor() -{ - return myColor; -} - -void -VISU::GaussPoints_i -::SetColor( const QColor& theColor ) -{ - myColor = theColor; -} - -bool -VISU::GaussPoints_i -::IsColored() -{ - return myIsColored; -} - -void -VISU::GaussPoints_i -::ShowColored( bool theColored ) -{ - myIsColored = theColored; -} - bool VISU::GaussPoints_i ::SetMainTexture( const QString& theMainTexture ) @@ -228,6 +243,110 @@ VISU::GaussPoints_i return myAlphaTexture; } +void +VISU::GaussPoints_i +::SetAlphaThreshold( float theAlphaThreshold ) +{ + myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold ); +} + +float +VISU::GaussPoints_i +::GetAlphaThreshold() +{ + return myGaussPointsPL->GetAlphaThreshold(); +} + +float +VISU::GaussPoints_i +::GetMaximumSupportedSize() +{ + return myGaussPointsPL->GetMaximumSupportedSize(); +} + +void +VISU::GaussPoints_i +::SetClamp(float theClamp) +{ + myGaussPointsPL->SetClamp( theClamp ); +} + +float +VISU::GaussPoints_i +::GetClamp() +{ + return myGaussPointsPL->GetClamp(); +} + +void +VISU::GaussPoints_i +::SetConstSize( float theConstSize ) +{ + myGaussPointsPL->SetSize( theConstSize ); +} + +float +VISU::GaussPoints_i +::GetConstSize() +{ + return myGaussPointsPL->GetSize(); +} + +void +VISU::GaussPoints_i +::SetMinSize( float theMinSize ) +{ + myGaussPointsPL->SetMinSize( theMinSize ); +} + +float +VISU::GaussPoints_i +::GetMinSize() +{ + return myGaussPointsPL->GetMinSize(); +} + +void +VISU::GaussPoints_i +::SetMaxSize( float theMaxSize ) +{ + myGaussPointsPL->SetMaxSize( theMaxSize ); +} + +float +VISU::GaussPoints_i +::GetMaxSize() +{ + return myGaussPointsPL->GetMaxSize(); +} + +void +VISU::GaussPoints_i +::SetMagnification( float theMagnification ) +{ + myGaussPointsPL->SetMagnification( theMagnification ); +} + +float +VISU::GaussPoints_i +::GetMagnification() +{ + return myGaussPointsPL->GetMagnification(); +} + +void +VISU::GaussPoints_i +::SetMagnificationIncrement( float theIncrement ) +{ + myGaussPointsPL->SetMagnificationIncrement( theIncrement ); +} + +float +VISU::GaussPoints_i +::GetMagnificationIncrement() +{ + return myGaussPointsPL->GetMagnificationIncrement(); +} //---------------------------------------------------------------------------- void @@ -263,9 +382,6 @@ VISU::GaussPoints_i myGaussPointsPL = dynamic_cast(myPipeLine); ScalarMap_i::DoHook(); - - SetTextures( QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp", - QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp" ); } @@ -346,7 +462,7 @@ VISU::GaussPoints_i void VISU::GaussPoints_i::UpdateActor(VISU_Actor* theActor) { if(VISU_GaussPtsAct* anActor = dynamic_cast(theActor)){ - if(IsColored()){ + if(GetIsColored()){ anActor->SetBarVisibility(true); myPipeLine->GetMapper()->SetScalarVisibility(1); } diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh index 34143510..f1a0a1f3 100644 --- a/src/VISU_I/VISU_GaussPoints_i.hh +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -66,16 +66,16 @@ namespace VISU GetGaussPointsPL(); QColor - GetColor(); + GetColor() { return myColor; } void - SetColor( const QColor& theColor ); + SetColor( const QColor& theColor ) { myColor = theColor; } bool - IsColored(); + GetIsColored() { return myIsColored; } void - ShowColored( bool theColored ); + SetIsColored( bool theIsColored ) { myIsColored = theIsColored; } bool SetMainTexture( const QString& theMainTexture ); @@ -93,6 +93,54 @@ namespace VISU SetTextures( const QString& theMainTexture, const QString& theAlphaTexture ); + void + SetAlphaThreshold(float theAlphaThreshold); + + float + GetAlphaThreshold(); + + float + GetMaximumSupportedSize(); + + void + SetClamp(float theClamp); + + float + GetClamp(); + + void + SetConstSize(float theConstSize); + + float + GetConstSize(); + + void + SetMinSize(float theMinSize); + + float + GetMinSize(); + + void + SetMaxSize(float theMaxSize); + + float + GetMaxSize(); + + float + GetMaxPointSize(); + + void + SetMagnification(float theMagnification); + + float + GetMagnification(); + + void + SetMagnificationIncrement(float theIncrement); + + float + GetMagnificationIncrement(); + void SetIsActiveLocalScalarBar(const bool theFlag); -- 2.39.2