]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1094
authorisn <isn@opencascade.com>
Tue, 13 Dec 2016 16:09:31 +0000 (19:09 +0300)
committerisn <isn@opencascade.com>
Tue, 13 Dec 2016 18:36:10 +0000 (21:36 +0300)
src/HYDROData/HYDROData_Channel.h
src/HYDROData/HYDROData_DTM.cxx
src/HYDROData/HYDROData_DTM.h
src/HYDROData/HYDROData_PolylineOperator.cxx
src/HYDROData/HYDROData_Stream.cxx
src/HYDROData/HYDROData_Stream.h
src/HYDROGUI/HYDROGUI_StreamOp.cxx
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDRO_tests/reference_data/Channel.png

index 3e069097a2aab3e2dd6a101eaab2e4205f2a9f48..f55bfc1d12e2c241ded4ead40201f2ca862308a8 100644 (file)
@@ -43,10 +43,10 @@ public:
   {
     TopoDS_Shape myPrs3D;
     TopoDS_Face  myPrs2D;
-    TopoDS_Wire  myLeftBank;
-    TopoDS_Wire  myRightBank;
-    TopoDS_Wire  myInlet;
-    TopoDS_Wire  myOutlet;
+    TopoDS_Shape myLeftBank;
+    TopoDS_Shape myRightBank;
+    TopoDS_Shape myInlet;
+    TopoDS_Shape myOutlet;
   };
 
 protected:
index d3a3c441f534fb99688bbb7dba1f9b68a892cbf7..9393ac04e45a453ff112b6ced298092917c2db59 100644 (file)
@@ -42,6 +42,7 @@
 #include <BRepBuilderAPI_MakeFace.hxx>
 #include <TopExp.hxx>
 #include <TopTools_IndexedMapOfOrientedShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
 #include <BRepLib_MakeEdge.hxx>
 #include <BRepLib_MakeWire.hxx>
 #include <ShapeUpgrade_UnifySameDomain.hxx>
 #include <BRepBuilderAPI_MakePolygon.hxx>
 #include <BOPAlgo_Builder.hxx>
-
+#include <gp_Pln.hxx>
 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_SequenceOfShape.hxx>
+#include <assert.h>
 
 IMPLEMENT_STANDARD_HANDLE( HYDROData_DTM, HYDROData_Bathymetry )
 IMPLEMENT_STANDARD_RTTIEXT( HYDROData_DTM, HYDROData_Bathymetry )
@@ -161,19 +163,9 @@ void HYDROData_DTM::SetSpatialStep( double theSpatialStep )
   Changed( Geom_3d );
 }
 
-void HYDROData_DTM::PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W )
+void HYDROData_DTM::PointsToWire(const AltitudePoints& pnts, TopoDS_Wire& W )
 {
-  /*BRepLib_MakeWire WM;
-  if (pnts.empty())
-    return;
-  for (int i = 0; i < pnts.size() - 1; i++)
-  {
-    gp_Pnt p1(pnts[i].X, pnts[i].Y, pnts[i].Z);
-    gp_Pnt p2(pnts[i+1].X, pnts[i+1].Y, pnts[i+1].Z);    
-    WM.Add(BRepLib_MakeEdge(p1, p2).Edge()); 
-  }
-  if (WM.IsDone())*/
-  
   BRepBuilderAPI_MakePolygon PM;
   for (int i = 0; i < pnts.size(); i++)
     PM.Add(gp_Pnt(pnts[i].X, pnts[i].Y, pnts[i].Z));
@@ -181,29 +173,48 @@ void HYDROData_DTM::PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W )
   W = PM.Wire();
 }
 
+void HYDROData_DTM::PointsToEdge(const AltitudePoints& pnts, TopoDS_Edge& E )
+{ 
+  Handle(TColgp_HArray1OfPnt) gpPoints = new TColgp_HArray1OfPnt(1, (int)pnts.size());
+
+  for (int i = 0; i < pnts.size(); i++)
+    gpPoints->SetValue(i+1, gp_Pnt(pnts[i].X, pnts[i].Y, pnts[i].Z));
+
+  GeomAPI_Interpolate anInterpolator(gpPoints, Standard_False,1.0e-6);
+  anInterpolator.Perform() ;
+  if (anInterpolator.IsDone()) 
+  {
+    Handle(Geom_Curve) C = anInterpolator.Curve();
+    E = BRepBuilderAPI_MakeEdge(C).Edge();
+  }
+}
+
 TopTools_IndexedMapOfOrientedShape HYDROData_DTM::Create3DShape(const AltitudePoints& left,
                                                                 const AltitudePoints& right,
                                                                 const std::vector<AltitudePoints>& main_profiles)
 {  
   TopTools_IndexedMapOfOrientedShape ll;
-  TopoDS_Wire LWire, RWire;
-  PointToWire(left, LWire);
-  PointToWire(right, RWire);
-  if (!LWire.IsNull())
-    ll.Add(LWire.Oriented(TopAbs_FORWARD));
+  //TopoDS_Wire LWire, RWire;
+  //PointsToWire(left, LWire);
+  //PointsToWire(right, RWire);
+  TopoDS_Edge LEdge, REdge;
+  PointsToEdge(left, LEdge);
+  PointsToEdge(right, REdge);
+  if (!LEdge.IsNull())
+    ll.Add(LEdge.Oriented(TopAbs_FORWARD));
 
   for (int k = 0; k < main_profiles.size(); k++)
   {
     TopoDS_Wire W;
-    PointToWire(main_profiles[k], W);
+    PointsToWire(main_profiles[k], W);
     TopAbs_Orientation Ori = TopAbs_INTERNAL;
     if (k == 0 || k == main_profiles.size() - 1)
       Ori = TopAbs_FORWARD;
     ll.Add(W.Oriented(Ori));
   }
 
-  if (!RWire.IsNull())
-    ll.Add(RWire.Oriented(TopAbs_FORWARD)); 
+  if (!REdge.IsNull())
+    ll.Add(REdge.Oriented(TopAbs_FORWARD)); 
   //yes, add subshapes in this order (left + profiles + right)
   //otherwise the projected wire will be non-manifold
 
@@ -228,7 +239,7 @@ void HYDROData_DTM::Update()
   bool WireIntersections; //__TODO
   CreateProfilesFromDTM( objs, ddz, step, points, Out3dPres, Out2dPres, OutLeftB, OutRightB, OutInlet, OutOutlet, true, true, InvInd, -1, WireIntersections );
   SetAltitudePoints( points );  
-
+  
   SetShape( DataTag_LeftBankShape, OutLeftB);
   SetShape( DataTag_RightBankShape, OutRightB);
   SetShape( DataTag_InletShape, OutInlet);
@@ -298,179 +309,43 @@ void HYDROData_DTM::CreateProfilesFromDTM (const HYDROData_SequenceOfObjects& In
     Out3dPres, Out2dPres, OutLeftB, OutRightB, OutInlet, OutOutlet, Create3dPres, Create2dPres, InvInd, WireIntersections );
 }
 
-void HYDROData_DTM::ProjWireOnPlane(const TopoDS_Shape& inpWire, const Handle_Geom_Plane& RefPlane, 
-  TopTools_DataMapOfShapeListOfShape* E2PE)
+bool HYDROData_DTM::GetPlanarFaceFromBanks( const TopoDS_Edge& LB, const TopoDS_Edge& RB, TopoDS_Face& outF,
+  TopTools_SequenceOfShape* Boundr)
 {
   BRep_Builder BB;
-
-  //project shape (edges) on planar face
   TopoDS_Face F;
-  BB.MakeFace(F, RefPlane, Precision::Confusion());
+  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(inpWire);
+  nproj.Add(LB);
+  nproj.Add(RB);
   nproj.SetDefaultParams();
   nproj.Build();
   if(!nproj.IsDone())
-    return;
-
-  TopoDS_Shape projRes = nproj.Projection();
-
-  // unite all vertexes/edges from projected result
-  BOPAlgo_Builder anAlgo;
-  TopExp_Explorer exp(projRes, TopAbs_EDGE);
-  for (;exp.More(); exp.Next())
-  {
-    const TopoDS_Edge& E = TopoDS::Edge(exp.Current());
-    if (E.Orientation() != TopAbs_INTERNAL)
-      anAlgo.AddArgument(E);
-  }
-  anAlgo.Perform(); 
-  int stat = anAlgo.ErrorStatus();
-  TopoDS_Shape projResConn = anAlgo.Shape();
-
-  // make wire => vertexes and edges should be untouched after this operation!
-  exp.Init(projResConn, TopAbs_EDGE);
-  //TopTools_ListOfShape llE;
-  //TopoDS_Wire RW;
-  //BRepLib_MakeWire WM;
-
-  //for (;exp.More();exp.Next()) 
-  //  llE.Append(exp.Current());
-  //
-  //WM.Add(llE);
-  //outWire = WM.Wire();
-
-  //outWire.Orientation(inpWire.Orientation()); //take from the original wire
-
-  //history mode: edge to projected edges
-  if (E2PE)
-  {
-    TopExp_Explorer ex(inpWire, TopAbs_EDGE);
-    for (;ex.More();ex.Next())
-    {
-      const TopoDS_Edge& CE = TopoDS::Edge(ex.Current());
-      TopTools_ListOfShape NEL;
-      const TopTools_ListOfShape& LS = nproj.Generated(CE);
-      TopTools_ListIteratorOfListOfShape it(LS);
-      for (;it.More();it.Next())
-      {
-        const TopoDS_Shape& PCE = it.Value();
-        TopTools_ListOfShape PLS = anAlgo.Modified(PCE);
-        if (PLS.IsEmpty())
-          PLS.Append(PCE);
-        TopTools_ListIteratorOfListOfShape itp(PLS);
-        for (;itp.More();itp.Next())
-          NEL.Append(itp.Value());
-      }
-
-      E2PE->Bind(CE, NEL);
-    }
-  }
-}
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-bool HYDROData_DTM::Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF,
-  TopTools_SequenceOfShape* Boundr, std::set<int> ind )
-{
-  //ind : set of indices (starts with 0). index == number of boundary (inlet, outlet, etc..)
-  //in compound cmp. 
-  //if Boundr is not null => this method will return sequence of boundary wires (inlet, outlet...)
-
-  Handle_Geom_Plane refpl = new Geom_Plane(gp_Pnt(0,0,0), gp_Dir(0,0,1));
-  TopTools_DataMapOfShapeListOfShape E2PE;
-  ProjWireOnPlane(cmp, refpl, &E2PE);
-  TopTools_ListOfShape ELL;
+    return false;
 
-  TopoDS_Iterator it(cmp);
-  int i = 0;
-  for (;it.More(); it.Next())
+  //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());
+  TopExp::Vertices(prLB, VFI, VFO, 1);
+  TopExp::Vertices(prRB, VLI, VLO, 1);
+  TopoDS_Edge prIL = BRepLib_MakeEdge(VFI, VLI).Edge();
+  TopoDS_Edge prOL = BRepLib_MakeEdge(VFO, VLO).Edge();
+  TopoDS_Wire prW = BRepLib_MakeWire(prLB, prIL, prOL, prRB).Wire();
+  outF = BRepBuilderAPI_MakeFace(refpl->Pln(), prW, 1).Face();
+
+  if (Boundr)
   {
-    const TopoDS_Wire& W = TopoDS::Wire(it.Value());
-    if (W.Orientation() != TopAbs_INTERNAL)
-    {
-      TopoDS_Wire PW;
-      TopExp_Explorer ex(W, TopAbs_EDGE);   
-      TopTools_ListOfShape LEpW;
-      TopTools_ListOfShape LEpWDummy;
-      for (;ex.More();ex.Next())
-      {
-        const TopoDS_Edge& CE = TopoDS::Edge(ex.Current());
-        TopTools_ListOfShape LS = E2PE.Find(CE);
-        LEpW.Append(LS);
-      }
-      
-      if (ind.count(i) != 0)
-      {
-        BRepLib_MakeWire WM;
-        WM.Add(LEpW);
-        const TopoDS_Wire& WMW = WM.Wire();
-        //assume that wire is a straight line,
-        //take first and last vertex and make simple edge (RE)
-        TopoDS_Vertex VF, VL;
-        TopExp::Vertices(WMW, VF, VL);
-        TopoDS_Edge RE = BRepLib_MakeEdge(VF, VL).Edge();
-        if (RE.IsNull())
-        {
-          LEpWDummy = LEpW; //LEpW will be nullified after appending to ELL
-          ELL.Append(LEpW);
-        }
-        else
-        {
-          LEpWDummy.Append(RE); 
-          ELL.Append(RE);
-        }
-        //TODO: in the new version of OCCT, USD can process separate wires
-        //ShapeUpgrade_UnifySameDomain USD(WMW, 1U, 0U, 1U); //concat bsplines
-        //USD.Build();
-        //const TopoDS_Shape& RSU = USD.Shape();
-        //TopExp_Explorer exp(RSU, TopAbs_EDGE);
-        //TopTools_ListOfShape DummyL;
-        //for (;it.More();it.Next())
-        //  DummyL.Append(it.Value());
-        //if (DummyL.Extent() == 1)
-        //  ELL.Append(DummyL.First()); //if one edge => accept this result 
-        //else
-        //  ELL.Append(LEpW);  //else put 'as is'
-      }
-      else
-      {
-        LEpWDummy = LEpW;
-        ELL.Append(LEpW);
-      }
-
-      if (Boundr)
-      {
-        //make inlet, outlet, left/tight banks [wires]
-        //shouldn't change topology of the edges
-        BRepLib_MakeWire IWM;
-        IWM.Add(LEpWDummy);
-        Boundr->Append(IWM.Wire());
-      }
-    }
-    i++;
+    Boundr->Append(prLB);
+    Boundr->Append(prIL);
+    Boundr->Append(prOL);
+    Boundr->Append(prRB);
   }
 
-  //make primary wire
-  BRepLib_MakeWire WME;
-  WME.Add(ELL);
-
-  const TopoDS_Wire& resW = WME.Wire();
-  BRepBuilderAPI_MakeFace mf(refpl, resW, true); //check inside is true by def
-  outF = mf.Face();
-
-  ShapeAnalysis_Wire WA(resW, outF, Precision::Confusion());
-  bool res = WA.CheckSelfIntersection(); //TODO check that this return false if OK
-  return res;
-
-  ///!!! the internal wires cant be added with 'internal' ori.
-  // it's possible to do with brep builder yet the result will not be correct!
-  // more proper way is to use BOP operation here.
-  /*for (int i = 1; i <= IntW.Extent(); i++)
-  {
-  TopoDS_Wire outIW;
-  const TopoDS_Wire& W = TopoDS::Wire(IntW(i));
-  ProjWireOnPlane(W, refpl, outIW);
-  BB.Add(outF, outIW);
-  }*/
+  ShapeAnalysis_Wire WA(prW, outF, Precision::Confusion());
+  bool res = WA.CheckSelfIntersection();
+  return !res;
 }
 
 void HYDROData_DTM::CreateProfiles(const std::vector<Handle_HYDROData_Profile>& theProfiles,
@@ -489,7 +364,7 @@ void HYDROData_DTM::CreateProfiles(const std::vector<Handle_HYDROData_Profile>&
                                    bool Create3dPres,
                                    bool Create2dPres,
                                    std::set<int>& InvInd,
-                                   bool& WireIntersections)
+                                   bool& ProjStat)
 {
   if (theProfiles.empty())
     return;
@@ -521,7 +396,7 @@ void HYDROData_DTM::CreateProfiles(const std::vector<Handle_HYDROData_Profile>&
     if (Create2dPres)
     {
       TopoDS_Face outF;
-      WireIntersections = Get2dFaceFrom3dPres(cmp, outF); //__TODO
+      ProjStat = GetPlanarFaceFromBanks(TopoDS::Edge(OutLeftB), TopoDS::Edge(OutRightB), outF, NULL);
       Out2dPres = outF;
     };
   }
index 0ac618d4b47f0f9f7718e303159a9b82c184b789..a283f9ceb67492e909feda39a8b9a3e396cba531 100644 (file)
@@ -154,10 +154,15 @@ protected:
                                      std::vector<AltitudePoints>& theMainProfiles,
                                      std::set<int>& invalInd );
 
-  static void PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W );
+  static void PointsToWire(const AltitudePoints& pnts, TopoDS_Wire& W );
 
-  static void ProjWireOnPlane(const TopoDS_Shape& inpWire, const Handle_Geom_Plane& RefPlane,
-    TopTools_DataMapOfShapeListOfShape* E2PE);
+  static void PointsToEdge(const AltitudePoints& pnts, TopoDS_Edge& E );
+
+  //static void ProjWireOnPlane(const TopoDS_Shape& inpWire, const Handle_Geom_Plane& RefPlane,
+    //TopTools_DataMapOfShapeListOfShape* E2PE);
+
+  static bool GetPlanarFaceFromBanks(const TopoDS_Edge& LB, const TopoDS_Edge& RB, TopoDS_Face& outF,
+    TopTools_SequenceOfShape* Boundr);
 
   static TopTools_IndexedMapOfOrientedShape Create3DShape(const AltitudePoints& left,
                                                           const AltitudePoints& right,
@@ -179,10 +184,10 @@ protected:
                              bool Create3dPres,
                              bool Create2dPres,
                              std::set<int>& InvInd,
-                             bool& WireIntersections);
+                             bool& ProjStat);
 
-  static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF, 
-    TopTools_SequenceOfShape* Boundr = NULL, std::set<int> ind = std::set<int>() );
+  //static bool Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF, 
+    //TopTools_SequenceOfShape* Boundr = NULL, std::set<int> ind = std::set<int>() );
   
   static int EstimateNbPoints( const std::vector<Handle_HYDROData_Profile>& theProfiles,
                                double theDDZ, double theSpatialStep );
index 43fb6799520b45b8e48c4b31bbd961c3d72ccba0..07387a6e9d0cf085fba22e6aca6e2ee26cee61fc 100644 (file)
@@ -487,13 +487,22 @@ bool HYDROData_PolylineOperator::Extract( const Handle(HYDROData_Document)& theD
       LSE.Append(E);
     }
 
-    BRepLib_MakeWire WM;
-    WM.Add(LSE);
-    TopoDS_Shape aShapeW;
-    if (WM.IsDone())
-      aShapeW = WM.Wire();
-    else
-      continue;
+
+    TopoDS_Shape aShapeOut;
+    if (LSE.Extent() == 1)
+    {
+      aShapeOut = LSE.First();
+    }
+    else if (LSE.Extent() > 1)
+    {
+      BRepLib_MakeWire WM;
+      WM.Add(LSE);
+      if (WM.IsDone())
+        aShapeOut = WM.Wire();
+      else
+        continue;
+    }
+    else continue;
 
     Handle( HYDROData_PolylineXY ) aPolyline = 
       Handle( HYDROData_PolylineXY )::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
@@ -501,7 +510,7 @@ bool HYDROData_PolylineOperator::Extract( const Handle(HYDROData_Document)& theD
     if( aPolyline.IsNull() )
       return false;
 
-    aPolyline->SetShape( aShapeW );
+    aPolyline->SetShape( aShapeOut );
 
     int anIndex = 0;
     QString aName = K;
index 9ffb8596baf5fefd6cc93515cf0bf13e63b874ea..2f85c4241554574f239b6bb9c4d3a5bcbb7fde83 100644 (file)
@@ -218,10 +218,10 @@ bool HYDROData_Stream::CreatePresentations( const Handle_HYDROData_DTM& theDTM,
 
   theDTM->GetPresentationShapes(Out3dPres, Out2dPres, OutLeftB, OutRightB, OutInlet, OutOutlet);
 
-  thePrs.myInlet = TopoDS::Wire(OutInlet);
-  thePrs.myOutlet = TopoDS::Wire(OutOutlet);
-  thePrs.myLeftBank = TopoDS::Wire(OutLeftB);
-  thePrs.myRightBank = TopoDS::Wire(OutRightB);
+  thePrs.myInlet = OutInlet;
+  thePrs.myOutlet = OutOutlet;
+  thePrs.myLeftBank = OutLeftB;
+  thePrs.myRightBank = OutRightB;
   thePrs.myPrs2D = Out2dPres;
   thePrs.myPrs3D = Out3dPres;
   /*std::vector<TopoDS_Wire> profiles3d;
@@ -1079,8 +1079,14 @@ void HYDROData_Stream::CreatePresentations( const Handle(TColgp_HArray1OfPnt)
 
   if (!ll.IsEmpty())
   {
-    LB = TopoDS::Wire(ll(1));
-    RB = TopoDS::Wire(ll(2));
+    TopAbs_ShapeEnum ll1_sht = ll(1).ShapeType();
+    TopAbs_ShapeEnum ll2_sht = ll(2).ShapeType();
+    if ((ll1_sht == TopAbs_WIRE || ll1_sht == TopAbs_EDGE) &&
+      (ll2_sht == TopAbs_WIRE || ll2_sht == TopAbs_EDGE))
+    {
+      LB = ll(1);
+      RB = ll(2);
+    }
   }
 
   IL = TopoDS::Wire(theArrOfProfiles->Value(theArrOfProfiles->Lower())); //TODO check that
@@ -1096,12 +1102,11 @@ void HYDROData_Stream::CreatePresentations( const Handle(TColgp_HArray1OfPnt)
   BB.Add(newCmp, RB);
 
   thePrs.myPrs3D = newCmp;
-  std::set<int> ind;
-  ind.insert(1); //inlet ind
-  ind.insert(2); //outlet ind
 
   TopTools_SequenceOfShape LS;
-  HYDROData_DTM::Get2dFaceFrom3dPres( newCmp, TopoDS::Face(thePrs.myPrs2D), &LS, ind );
+  //HYDROData_DTM::Get2dFaceFrom3dPres( newCmp, TopoDS::Face(thePrs.myPrs2D), &LS, ind );
+  
+  HYDROData_DTM::GetPlanarFaceFromBanks(TopoDS::Edge(LB), TopoDS::Edge(RB), TopoDS::Face(thePrs.myPrs2D), &LS);
 
 #ifndef NDEBUG
   TopTools_IndexedMapOfShape EE;
@@ -1119,9 +1124,9 @@ void HYDROData_Stream::CreatePresentations( const Handle(TColgp_HArray1OfPnt)
   assert(noncontNb == 0);
 #endif
 
-  thePrs.myLeftBank = TopoDS::Wire(LS(1));  
-  thePrs.myInlet = TopoDS::Wire(LS(2));  
-  thePrs.myOutlet = TopoDS::Wire(LS(3));  
-  thePrs.myRightBank = TopoDS::Wire(LS(4));
+  thePrs.myLeftBank = LS(1);  
+  thePrs.myInlet = LS(2);  
+  thePrs.myOutlet = LS(3);  
+  thePrs.myRightBank = LS(4);
 
 }
\ No newline at end of file
index 0eb6cde9e060ca71c0a8e726ead3ca2706592410..77d9bb5fc13e9ed8b9123ad58fb50e351f28f3e6 100644 (file)
@@ -52,10 +52,10 @@ public:
   {
     TopoDS_Shape myPrs3D;
     TopoDS_Shape myPrs2D;
-    TopoDS_Wire  myLeftBank;   // 3d curve of the left bank
-    TopoDS_Wire  myRightBank;  // 3d curve of the right bank
-    TopoDS_Wire  myInlet;      // first (inlet) 2d profile 
-    TopoDS_Wire  myOutlet;     // last (inlet) 2d profile 
+    TopoDS_Shape myLeftBank;   // 3d curve of the left bank
+    TopoDS_Shape myRightBank;  // 3d curve of the right bank
+    TopoDS_Shape myInlet;      // first (inlet) 2d profile 
+    TopoDS_Shape myOutlet;     // last (inlet) 2d profile 
   };
 
 protected:
index 2a178d83f96d97b3fb4936f6331e8c98c96f3b48..ecac0f9fb5a2b6254352bfe53d82a29d1c0011bf 100755 (executable)
@@ -420,24 +420,24 @@ void HYDROGUI_StreamOp::createPreview()
 
   HYDROData_Bathymetry::AltitudePoints points;
 
-  bool WireIntersections = false;
+  bool ProjStat = true;
   HYDROData_DTM::CreateProfilesFromDTM( aRefProfiles, ddz, ss, points, Out3dPres, Out2dPres, OutLeftB, OutRightB,
-    OutInlet, OutOutlet, true, true, InvInd, MAX_POINTS_IN_PREVIEW, WireIntersections );
+    OutInlet, OutOutlet, true, true, InvInd, MAX_POINTS_IN_PREVIEW, ProjStat );
 
   aPanel->clearAllBackgroundColorsForProfileList();
   for (std::set<int>::const_iterator it = InvInd.begin(); it != InvInd.end(); it++)
     aPanel->setBackgroundColorForProfileList(*it, QColor(Qt::yellow));
 
-  aPrsDef.myInlet = TopoDS::Wire(OutInlet);
-  aPrsDef.myOutlet = TopoDS::Wire(OutOutlet);
-  aPrsDef.myLeftBank = TopoDS::Wire(OutLeftB);
-  aPrsDef.myRightBank = TopoDS::Wire(OutRightB);
-  if (!WireIntersections)
+  aPrsDef.myInlet = OutInlet;
+  aPrsDef.myOutlet = OutOutlet;
+  aPrsDef.myLeftBank = OutLeftB;
+  aPrsDef.myRightBank = OutRightB;
+  if (ProjStat)
     aPrsDef.myPrs2D = Out2dPres;
   aPrsDef.myPrs3D = Out3dPres;
 
-  if (WireIntersections)
-    aPanel->addWarning(tr("STREAM_SELF_INTERSECTIONS"));
+  if (!ProjStat)
+    aPanel->addWarning(tr("STREAM_PROJECTION_FAILED"));
 
   myPreviewPrs->setShape( aPrsDef.myPrs2D );
 }
index e19e9fad620280277b88133f4742e4af7bc5ed9e..3d162afbb4d30273465c5b6af9efdfd7f682495b 100644 (file)
@@ -255,8 +255,8 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <translation>Stream Warnings</translation>
     </message>
      <message>
-      <source>STREAM_SELF_INTERSECTIONS</source>
-      <translation>Warning: intersection(s) of banks/profiles are found</translation>
+      <source>STREAM_PROJECTION_FAILED</source>
+      <translation>Warning: Projection of banks/profiles are failed</translation>
     </message>
     <message>
       <source>PREF_TAB_GENERAL</source>
index 028435ec70e4db8ebc7a7eb1ee14a9745b54b327..369807de4473c18df94d41e40a5d5042f0aa0228 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/Channel.png and b/src/HYDRO_tests/reference_data/Channel.png differ