]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1094 p.2
authorisn <isn@opencascade.com>
Wed, 14 Dec 2016 14:41:08 +0000 (17:41 +0300)
committerisn <isn@opencascade.com>
Thu, 15 Dec 2016 08:29:55 +0000 (11:29 +0300)
src/HYDROData/HYDROData_DTM.cxx

index 9393ac04e45a453ff112b6ced298092917c2db59..2c96221db00810397c763a7f2ec6c88066a68bac 100644 (file)
@@ -52,6 +52,8 @@
 #include <ShapeUpgrade_UnifySameDomain.hxx>
 #include <BRepBuilderAPI_MakePolygon.hxx>
 #include <BOPAlgo_Builder.hxx>
+#include <BRepAdaptor_Curve.hxx>
+#include <GeomProjLib.hxx>
 #include <gp_Pln.hxx>
 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
@@ -315,19 +317,20 @@ bool HYDROData_DTM::GetPlanarFaceFromBanks( const TopoDS_Edge& LB, const TopoDS_
   BRep_Builder BB;
   TopoDS_Face F;
   Handle_Geom_Plane refpl = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1));
-  BB.MakeFace(F, refpl, Precision::Confusion());
-  BRepAlgo_NormalProjection nproj(F);
-  nproj.Add(LB);
-  nproj.Add(RB);
-  nproj.SetDefaultParams();
-  nproj.Build();
-  if(!nproj.IsDone())
-    return false;
 
-  //TopoDS_Shape projBanks = nproj.Projection();
   TopoDS_Vertex VFI, VLI, VFO, VLO;
-  TopoDS_Edge prLB = TopoDS::Edge(nproj.Generated(LB).First());
-  TopoDS_Edge prRB = TopoDS::Edge(nproj.Generated(RB).First());
+  TopoDS_Edge prLB;
+  TopoDS_Edge prRB;
+
+
+  BRepAdaptor_Curve LBAD(LB);
+  Handle_Geom_Curve LBPC = GeomProjLib::ProjectOnPlane(LBAD.Curve().Curve(), refpl, gp_Dir(0, 0, -1), 1 );
+  prLB = BRepLib_MakeEdge(LBPC).Edge();
+
+  BRepAdaptor_Curve RBAD(RB);
+  Handle_Geom_Curve RBPC = GeomProjLib::ProjectOnPlane(RBAD.Curve().Curve(), refpl, gp_Dir(0, 0, -1), 1 );
+  prRB = BRepLib_MakeEdge(RBPC).Edge();
+
   TopExp::Vertices(prLB, VFI, VFO, 1);
   TopExp::Vertices(prRB, VLI, VLO, 1);
   TopoDS_Edge prIL = BRepLib_MakeEdge(VFI, VLI).Edge();