From: isn Date: Fri, 13 Nov 2015 10:55:20 +0000 (+0300) Subject: Merge branch 'BR_LAND_COVER_MAP' into HEAD X-Git-Tag: v1.5~44^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=af8ddda6b2f69cd209acf146c9723bc439607626;p=modules%2Fhydro.git Merge branch 'BR_LAND_COVER_MAP' into HEAD --- af8ddda6b2f69cd209acf146c9723bc439607626 diff --cc src/HYDROData/HYDROData_LandCoverMap.cxx index 969ce6d0,9df53033..acecb291 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@@ -942,3 -928,23 +943,23 @@@ TopoDS_Shape HYDROData_LandCoverMap::Re return sfs->Shape(); } + + void HYDROData_LandCoverMap::SetTransparency( double theTransparency ) + { + Handle(TDataStd_Real) anAttr; + TDF_Label aLabel = myLab.FindChild( DataTag_Transparency ); + if( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) ) + aLabel.AddAttribute( anAttr = new TDataStd_Real() ); + anAttr->Set( theTransparency ); + } + + double HYDROData_LandCoverMap::GetTransparency() const + { + Handle(TDataStd_Real) anAttr; + TDF_Label aLabel = myLab.FindChild( DataTag_Transparency ); + if( !aLabel.FindAttribute( TDataStd_Real::GetID(), anAttr ) ) + return 0.5; + + return anAttr->Get(); + -} ++} diff --cc src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx index 51c12818,0afe0e31..dc04adb8 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx @@@ -59,9 -59,12 +59,12 @@@ void HYDROGUI_LandCoverMapPrs::SetLandC void HYDROGUI_LandCoverMapPrs::UpdateColors() { + if( !myLCMap.IsNull() ) + SetTransparency( myLCMap->GetTransparency() ); + Set( myLCMap->GetShape() ); SetMaterial( Graphic3d_NOM_PLASTIC ); - HYDROData_LandCoverMap::Iterator anIt( myLCMap ); + HYDROData_LandCoverMap::Explorer anIt( myLCMap ); for( ; anIt.More(); anIt.Next() ) { TopoDS_Face aFace = anIt.Face();