double HYDROData_ChannelAltitude::GetAltitudeForPoint( const gp_XY& thePoint ) const
{
- DEBTRACE("HYDROData_ChannelAltitude::GetAltitudeForPoint");
+ DEBTRACE("GetAltitudeForPoint p(" << thePoint.X() << ", " << thePoint.Y() << ")");
double aResAltitude = GetInvalidAltitude();
Handle(HYDROData_Channel) aChannel =
DEBTRACE("aGuideLine.IsNull()");
return aResAltitude;
}
- DEBTRACE("aGuideLine: " << aGuideLine->GetName().toStdString());
+ //DEBTRACE("aGuideLine: " << aGuideLine->GetName().toStdString());
Handle(HYDROData_PolylineXY) aGuideXY = aGuideLine->GetPolylineXY();
if (aGuideXY.IsNull())
DEBTRACE("aGuideXY.IsNull()");
return aResAltitude;
}
- DEBTRACE("aGuideXY: " << aGuideXY->GetName().toStdString());
+ //DEBTRACE("aGuideXY: " << aGuideXY->GetName().toStdString());
Handle(HYDROData_ProfileUZ) aGuideUZ = aGuideLine->GetProfileUZ();
if (aGuideUZ.IsNull())
DEBTRACE("aGuideUZ.IsNull()");
return aResAltitude;
}
- DEBTRACE("aGuideUZ: " << aGuideUZ->GetName().toStdString());
+ //DEBTRACE("aGuideUZ: " << aGuideUZ->GetName().toStdString());
Handle (HYDROData_Profile) aProfile = aChannel->GetProfile();
if (aProfile.IsNull())
{
return aResAltitude;
}
- DEBTRACE("aProfile: " << aProfile->GetName().toStdString());
+ //DEBTRACE("aProfile: " << aProfile->GetName().toStdString());
// --- See GEOMImpl_ProjectionDriver.cxx
-// TopoDS_Shape aShape = aGuideLine->GetShape3D();
-// double middleZ = -9999;
-// aGuideLine->GetMiddleZ(middleZ); // use the middle Z value of the 3d line to help the projection.
-// if (middleZ < -9000)
-// {
-// DEBTRACE("the middle Z value of the 3d line is incorrect");
-// }
-// gp_Pnt P1(thePoint.X(), thePoint.Y(), middleZ);
-
TopoDS_Shape aShape = aGuideXY->GetShape();
gp_Pnt P1(thePoint.X(), thePoint.Y(), 0);
TopoDS_Shape aPoint = BRepBuilderAPI_MakeVertex(P1).Shape();
// Store the valid solution.
hasValidSolution = Standard_True;
- DEBTRACE("distance XY: "<< aParam);
-// // Normalize parameter.
-// TopoDS_Edge aSupportEdge = TopoDS::Edge(aSupportShape);
-// Standard_Real aF, aL;
-// BRep_Tool::Range(aSupportEdge, aF, aL);
-// if (Abs(aL - aF) <= aTolConf)
-// {
-// DEBTRACE("Projection aborted : degenerated projection edge");
-// return aResAltitude;
-// }
-// aParam = (aParam - aF)/(aL - aF);
-
// profile altitude at projection point
HYDROData_IPolyline::PointsList aProfilePoints = aGuideUZ->GetPoints();
if ( aProfilePoints.IsEmpty() )
return aResAltitude;
}
double aDepth = HYDROData_ProfileUZ::GetDepthFromDistance( aProfilePoints, aParam );
- DEBTRACE("profile altitude: " << aDepth);
+ //DEBTRACE("profile altitude: " << aDepth);
// Compute edge index.
TopExp_Explorer anExp(aShape, TopAbs_EDGE);
// get the XY distance from point to guideline
const gp_Pnt &aPntProj = aDistShSh.PointOnShape2(i);
- DEBTRACE("projection: (" << aPntProj.X() << ", " << aPntProj.Y() << ", " << aPntProj.Z() << ")");
+ //DEBTRACE("projection: (" << aPntProj.X() << ", " << aPntProj.Y() << ", " << aPntProj.Z() << ")");
gp_XY aProjXY = gp_XY(aPntProj.X(), aPntProj.Y());
aProjXY.Subtract(thePoint);
double distance = aProjXY.Modulus();
- DEBTRACE("distance to guideline " << distance);
+ //DEBTRACE("distance to guideline " << distance);
- // get delta altitude on section (supposed symmetric) from guideline distance
+ // get delta altitude on section (supposed symmetric) from guideline distance (aParam)
double delta = 0;
int i1 = 0;
gp_XY pt1 = gp_XY();
for ( int i = 1, aNbPoints = aSectionPoints.Size(); i <= aNbPoints; ++i )
{
const HYDROData_IPolyline::Point& aPolylinePoint = aSectionPoints.Value( i );
- DEBTRACE(" profile point: " << aPolylinePoint.X() << " " << aPolylinePoint.Y());
+ //DEBTRACE(" profile point: " << aPolylinePoint.X() << " " << aPolylinePoint.Y());
if (aPolylinePoint.X() < distance)
{
i1 = i;
delta = pt1.Y() + (pt2.Y() - pt1.Y())*(distance -pt1.X())/(pt2.X()-pt1.X());
}
aResAltitude = delta + aDepth;
- DEBTRACE("final altitude: " << aResAltitude << " delta: " << delta);
+ DEBTRACE("distance XY: "<< aParam << " distance to guideline: " << distance << " final altitude: " << aResAltitude << " delta: " << delta);
return aResAltitude;
}
}