+bool IsPointBetweenEdges( const gp_Pnt& aFirstPnt1, const gp_Pnt& aLastPnt1,
+ const gp_Pnt& aFirstPnt2, const gp_Pnt& aLastPnt2,
+ const gp_Pnt& thePoint) {
+ BRepBuilderAPI_MakeEdge aLeftMakeEdge( aFirstPnt1, aLastPnt1 );
+ BRepBuilderAPI_MakeEdge aBotMakeEdge( aLastPnt1, aLastPnt2 );
+ BRepBuilderAPI_MakeEdge aRightMakeEdge( aLastPnt2, aFirstPnt2 );
+ BRepBuilderAPI_MakeEdge aTopMakeEdge( aFirstPnt2, aFirstPnt1 );
+
+ BRepBuilderAPI_MakeWire aMakeWire( aLeftMakeEdge.Edge(), aBotMakeEdge.Edge(),
+ aRightMakeEdge.Edge(), aTopMakeEdge.Edge() );
+
+ BRepBuilderAPI_MakeFace aMakeFace( aMakeWire.Wire() );
+
+ TopoDS_Face aFace = aMakeFace.Face();
+#ifdef DEB_CLASS2D
+ TopoDS_Compound aCmp;
+ BRep_Builder aBB;
+ aBB.MakeCompound(aCmp);
+ aBB.Add(aCmp, aFace);
+ BRepBuilderAPI_MakeVertex aMk(thePoint);
+ aBB.Add(aCmp, aMk.Vertex());
+ BRepTools::Write(aCmp, "ProfileFace.brep");
+#endif
+
+ gp_XY anXY( thePoint.X(), thePoint.Y() );
+ TopAbs_State aPointState = HYDROData_Tool::ComputePointState(anXY, aFace);
+
+#ifdef DEB_CLASS2D
+ cout << "Point status is = " << aPointState <<endl;
+#endif
+ return aPointState != TopAbs_OUT;
+}
+
+Standard_Real getAltitudeFromWire( const TopoDS_Wire& theWire,
+ const Standard_Real& theLeftDist,
+ const Standard_Real& theRightDist )