From: isn Date: Fri, 13 Nov 2015 09:52:33 +0000 (+0300) Subject: Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into... X-Git-Tag: v1.5~50^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6befa9f9669377349a681a5ca4a12b8d256cf476;p=modules%2Fhydro.git Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into HEAD Conflicts: src/HYDROData/HYDROData_LandCoverMap.cxx src/HYDROData/HYDROData_LandCoverMap.h --- 6befa9f9669377349a681a5ca4a12b8d256cf476 diff --cc src/HYDROData/HYDROData_LandCoverMap.cxx index 4af54673,02098d3e..9df53033 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@@ -44,11 -43,7 +44,12 @@@ #include #include #include +#include + #include +#include +#include +#include + #include #include @@@ -901,29 -894,21 +902,49 @@@ QStringList HYDROData_LandCoverMap::Dum return aResList; } +TopoDS_Shape HYDROData_LandCoverMap::RemoveInternal(const TopoDS_Shape& InSh) +{ + //Shape must be topologically correct + TopExp_Explorer anExp(InSh, TopAbs_EDGE); + TopTools_ListOfShape anEdgesToRemove; + + for(; anExp.More(); anExp.Next() ) + { + TopoDS_Edge CurEdge = TopoDS::Edge(anExp.Current()); + if (CurEdge.Orientation() == TopAbs_INTERNAL) + anEdgesToRemove.Append(CurEdge); + } + + Handle_ShapeBuild_ReShape aReshape = new ShapeBuild_ReShape(); + TopoDS_Shape OutSh = aReshape->Apply(InSh); + TopTools_ListIteratorOfListOfShape aIt(anEdgesToRemove); + for (; aIt.More(); aIt.Next()) + aReshape->Remove(aIt.Value()); + OutSh = aReshape->Apply(InSh); + + Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape; + sfs->Init(OutSh); + sfs->Perform(); + 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/HYDROData/HYDROData_LandCoverMap.h index a4c44ab6,5c632ebb..930fbbf1 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@@ -124,8 -125,9 +125,11 @@@ public HYDRODATA_EXPORT void StoreLandCovers( const HYDROData_MapOfFaceToStricklerType& ); + HYDRODATA_EXPORT void SetTransparency( double ); + HYDRODATA_EXPORT double GetTransparency() const; + + HYDRODATA_EXPORT TopoDS_Shape RemoveInternal(const TopoDS_Shape& InSh); + protected: void SetShape( const TopoDS_Shape& );