#include "HYDROData_Profile.h"
#include "HYDROData_Stream.h"
#include "HYDROData_ShapesTool.h"
-
+#include <HYDROData_Tool.h>
#include <BRep_Tool.hxx>
-#include <BRepTopAdaptor_FClass2d.hxx>
-
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <QStringList>
+#ifdef DEB_CLASS2D
+#include <BRepTools.hxx>
+#include <BRep_Builder.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#endif
IMPLEMENT_STANDARD_HANDLE(HYDROData_StreamAltitude, HYDROData_IAltitudeObject)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_StreamAltitude, HYDROData_IAltitudeObject)
{
}
-QStringList HYDROData_StreamAltitude::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const
-{
- QStringList aResList = HYDROData_Entity::DumpToPython( theTreatedObjects );
-
- // TODO
-
- return aResList;
-}
-
Standard_Real getAltitudeFromProfile( const Handle(HYDROData_Profile)& theProfile,
const Standard_Real& theLeftDist,
const Standard_Real& theRightDist )
aRightMakeEdge.Edge(), aTopMakeEdge.Edge() );
BRepBuilderAPI_MakeFace aMakeFace( aMakeWire.Wire() );
-
+
TopoDS_Face aProfilesFace = aMakeFace.Face();
-
- BRepTopAdaptor_FClass2d aClassifier( aProfilesFace, Precision::Confusion() );
- TopAbs_State aPointState = aClassifier.Perform( gp_Pnt2d( thePoint ), Standard_False );
+#ifdef DEB_CLASS2D
+ TopoDS_Compound aCmp;
+ BRep_Builder aBB;
+ aBB.MakeCompound(aCmp);
+ aBB.Add(aCmp, aProfilesFace);
+ gp_Pnt aPnt (thePoint.X(), thePoint.Y(), 0.);
+ BRepBuilderAPI_MakeVertex aMk(aPnt);
+ aBB.Add(aCmp, aMk.Vertex());
+ BRepTools::Write(aCmp, "ProfileFace.brep");
+#endif
+
+ TopAbs_State aPointState = HYDROData_Tool::ComputePointState(thePoint, aProfilesFace);
+
+#ifdef DEB_CLASS2D
+ cout << "Point status is = " << aPointState <<endl;
+#endif
if ( aPointState != TopAbs_OUT )
{
theLeftProfile = aPrevProfile;
TopoDS_Face aStreamFace = TopoDS::Face( aStreamFaceExp.Current() );
// Check if point is inside of stream presentation
- BRepTopAdaptor_FClass2d aClassifier( aStreamFace, Precision::Confusion() );
- TopAbs_State aPointState = aClassifier.Perform( gp_Pnt2d( thePoint ), Standard_False );
+ TopAbs_State aPointState = HYDROData_Tool::ComputePointState(thePoint, aStreamFace);
+
+#ifdef DEB_CLASS2D
+ cout << "Point status is = " << aPointState <<endl;
+ TopoDS_Compound aCmp;
+ BRep_Builder aBB;
+ aBB.MakeCompound(aCmp);
+ aBB.Add(aCmp, aStreamFace);
+ gp_Pnt aPnt (thePoint.X(), thePoint.Y(), 0.);
+ BRepBuilderAPI_MakeVertex aMk(aPnt);
+ aBB.Add(aCmp, aMk.Vertex());
+ BRepTools::Write(aCmp, "FCL2d.brep");
+#endif
if ( aPointState == TopAbs_OUT )
return aResAltitude;