From: mkr Date: Fri, 13 Nov 2015 10:15:27 +0000 (+0300) Subject: Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into... X-Git-Tag: v1.5~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3535c63440d6ca7b7662d92ce6af3526560d56b;p=modules%2Fhydro.git Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into BR_LAND_COVER_MAP --- f3535c63440d6ca7b7662d92ce6af3526560d56b diff --cc src/HYDROData/HYDROData_LandCoverMap.cxx index 5d16d29e,9df53033..7e042950 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@@ -900,3 -901,50 +909,50 @@@ 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 8b1cce97,930fbbf1..e078ddd0 --- a/src/HYDROData/HYDROData_LandCoverMap.h +++ b/src/HYDROData/HYDROData_LandCoverMap.h @@@ -124,11 -125,11 +125,13 @@@ public HYDRODATA_EXPORT void StoreLandCovers( const HYDROData_MapOfFaceToStricklerType& ); - /** - * Checks that object has 2D presentation. Reimlemented to retun true. - */ + HYDRODATA_EXPORT virtual bool IsHas2dPrs() const; + + 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& );