X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_CalculationCase.cxx;h=5a5b3ad2dc78fe86434a6d11b93dcf041520135c;hb=c52bda48bea5753316f128f52a3be1abb5aff055;hp=5d910ddca6701e293900deee7e314af596ca6afa;hpb=ef1096f4d88cbde902053605b1082ecd55d982fc;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 5d910ddc..5a5b3ad2 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -20,7 +20,8 @@ #include #include #include - +#include +#include #define CALCULATION_REGIONS_PREF GetName() + "_Reg" #define CALCULATION_ZONES_PREF GetName() + "_Zone" @@ -620,7 +621,6 @@ Handle(HYDROData_Zone) HYDROData_CalculationCase::GetZoneFromPoint( const gp_XY& return aResZone; } - HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPointClassification( const gp_XY& thePoint, const Handle(HYDROData_Zone)& theZone ) const @@ -633,10 +633,13 @@ HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPoi if ( aZoneFace.IsNull() ) return aRes; - // TODO: classify the point position relative to zone - // POINT_OUT - point is out of zone face - // POINT_IN - point is inside of zone face - // POINT_ON - point is on the edge of zone face - + BRepTopAdaptor_FClass2d aClassifier( aZoneFace, Precision::Confusion() ); + TopAbs_State State = aClassifier.Perform( gp_Pnt2d(thePoint), Standard_False ); + if (State == TopAbs_OUT) + aRes = POINT_OUT; + else if(State == TopAbs_IN) + aRes = POINT_IN; + else if(State == TopAbs_ON) + aRes = POINT_ON; return aRes; }