X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_StreamAltitude.cxx;h=96b33ad8cb62e0ad1fb8b67114081823b35191f1;hb=4d422c4f2dc05c85f0924db65ab87a8d5deacea8;hp=60452989426cf7a635598b66210b67c6184f2ee6;hpb=5395b3a6f169302c35e0e9683915f1136ba99a0b;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_StreamAltitude.cxx b/src/HYDROData/HYDROData_StreamAltitude.cxx index 60452989..96b33ad8 100644 --- a/src/HYDROData/HYDROData_StreamAltitude.cxx +++ b/src/HYDROData/HYDROData_StreamAltitude.cxx @@ -52,6 +52,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + #ifdef DEB_CLASS2D #include #include @@ -236,20 +239,29 @@ bool HYDROData_StreamAltitude::getBoundaryWiresForPoint( 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() ); @@ -269,7 +281,10 @@ double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) co BRepTools::Write(aCmp, "FCL2d.brep"); #endif if ( aPointState == TopAbs_OUT ) + { + DEBTRACE("aPointState == TopAbs_OUT"); return aResAltitude; + } TopoDS_Edge aLeftEdge, aRightEdge; @@ -292,7 +307,10 @@ double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) co // 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 ); @@ -348,7 +366,7 @@ double HYDROData_StreamAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) co Standard_Real aSecCoeff = aRightProfileDist / ( aLeftProfileDist + aRightProfileDist ); aResAltitude = aLeftAlt * ( 1 - aFirstCoeff ) + aRightAlt * ( 1 - aSecCoeff ); - + DEBTRACE("aResAltitude=" << aResAltitude); return aResAltitude; }