#include <BRepTools.hxx>
#include <TopExp_Explorer.hxx>
#include <ShapeUpgrade_UnifySameDomain.hxx>
+#include <TopExp.hxx>
+ #include <TDataStd_Real.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <ShapeBuild_ReShape.hxx>
+#include <ShapeFix_Shape.hxx>
+
#include <QFile>
#include <QString>
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();
++
++}