#include <QStringList>
+#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
#ifdef DEB_CLASS2D
#include <BRepTools.hxx>
#include <BRep_Builder.hxx>
double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
+ DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << ")");
double aResAltitude = GetInvalidAltitude();
Handle(HYDROData_Object) anObject =
Handle(HYDROData_Object)::DownCast( GetFatherObject() );
if ( anObject.IsNull() )
+ {
+ DEBTRACE("aStream.IsNull()");
return aResAltitude;
-
+ }
TopoDS_Shape aTopShape = anObject->GetTopShape();
if ( aTopShape.IsNull() )
+ {
+ DEBTRACE("aTopShape.IsNull()");
return aResAltitude;
+ }
TopExp_Explorer aFaceExp( aTopShape, TopAbs_FACE );
if ( !aFaceExp.More() )
+ {
+ DEBTRACE("!aFaceExp.More()");
return aResAltitude;
+ }
// Get only face because of 2d profile wires is in compound
TopoDS_Face aFace = TopoDS::Face( aFaceExp.Current() );
BRepTools::Write(aCmp, "FCL2d.brep");
#endif
if ( aPointState == TopAbs_OUT )
+ {
+ DEBTRACE("aPointState == TopAbs_OUT");
return aResAltitude;
+ }
TopoDS_Edge aLeftEdge, aRightEdge;
// Find the two profiles between which the point is lies
TopoDS_Wire aLeftWire, aRightWire;
if ( !getBoundaryWiresForPoint( thePoint, aLeftWire, aRightWire ) )
+ {
+ DEBTRACE("!getBoundaryProfilesForPoint( thePoint, aLeftProfile, aRightProfile )");
return aResAltitude;
+ }
// Find the projections of point to borders of stream
gp_XYZ aPointToTest( thePoint.X(), thePoint.Y(), 0.0 );
Standard_Real aSecCoeff = aRightProfileDist / ( aLeftProfileDist + aRightProfileDist );
aResAltitude = aLeftAlt * ( 1 - aFirstCoeff ) + aRightAlt * ( 1 - aSecCoeff );
-
+ DEBTRACE("aResAltitude=" << aResAltitude);
return aResAltitude;
}