+ Handle( TDataStd_NamedData ) aMap = Map();
+ TCollection_ExtendedString aType = HYDROData_Tool::toExtString( theType );
+ if( aMap->HasInteger( aType ) )
+ {
+ int aColorInt = aMap->GetInteger( aType );
+ int b = aColorInt % 256;
+ int g = (aColorInt>>8) % 256;
+ int r = (aColorInt>>16) % 256;
+ return QColor( r, g, b );
+ }
+ else
+ return QColor();
+}
+
+void HYDROData_StricklerTable::SetColor( const QString& theType, const QColor& theColor ) const
+{
+ Handle( TDataStd_NamedData ) aMap = Map();
+ TCollection_ExtendedString aType = HYDROData_Tool::toExtString( theType );
+ int r = theColor.red();
+ int g = theColor.green();
+ int b = theColor.blue();
+ int aColorInt = ( r<<16 ) + ( g<<8 ) + b;
+ aMap->SetInteger( aType, aColorInt );
+
+ // synchronize the color for the same type in other maps
+ HYDROData_Iterator anIt( HYDROData_Document::Document( myLab ), KIND_STRICKLER_TABLE );
+ for( ; anIt.More(); anIt.Next() )
+ {
+ Handle( HYDROData_StricklerTable ) aTable =
+ Handle( HYDROData_StricklerTable )::DownCast( anIt.Current() );
+ if( aTable->Label()==myLab )
+ continue;
+
+ if( aTable->HasType( theType ) )
+ aTable->Map()->SetInteger( aType, aColorInt );
+ }