]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into...
authormkr <mkr@opencascade.com>
Fri, 13 Nov 2015 10:15:27 +0000 (13:15 +0300)
committermkr <mkr@opencascade.com>
Fri, 13 Nov 2015 10:15:27 +0000 (13:15 +0300)
1  2 
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDROData/HYDROData_LandCoverMap.h

index 5d16d29e3105c8b16abab817e5bbe46a974880d2,9df53033988a5f9b7406934b9ef22bd7db23971c..7e0429504fa534da86b78183979539ea6551256b
@@@ -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();
+   
++}
index 8b1cce97dc0530d1b27a1e28b63bfd2f451a447d,930fbbf1556ca63d9d1c0cb09bd810c07e8f854c..e078ddd0ae0a09f52bf9540368068876caf75439
@@@ -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& );