-QStringList HYDROData_StreamAltitude::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
-{
- QStringList aResList;
-
- Handle(HYDROData_Document) aDocument = HYDROData_Document::Document( myLab );
- if ( aDocument.IsNull() )
- return aResList;
-
- QString aDocName = aDocument->GetDocPyName();
- QString anAltitudeName = GetName();
-
- aResList << QString( "%1 = %2.CreateObject( %3 );" )
- .arg( anAltitudeName ).arg( aDocName ).arg( PYTHON_STREAM_ALTITUDE_ID );
- aResList << QString( "%1.SetName( \"%2\" );" )
- .arg( anAltitudeName ).arg( anAltitudeName );
-
- // TODO
-
- return aResList;
+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;