]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
12.12.2013. GetPointClassification() implemented.
authorszy <szy@opencascade.com>
Thu, 12 Dec 2013 11:26:33 +0000 (11:26 +0000)
committerszy <szy@opencascade.com>
Thu, 12 Dec 2013 11:26:33 +0000 (11:26 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx

index 5d910ddca6701e293900deee7e314af596ca6afa..b84397216cb82ac1731074b6b31fc4c57593881a 100644 (file)
@@ -20,7 +20,8 @@
 #include <TopExp.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-
+#include <BRepTopAdaptor_FClass2d.hxx>
+#include <TopAbs.hxx>
 #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
@@ -637,6 +637,13 @@ HYDROData_CalculationCase::PointClassification HYDROData_CalculationCase::GetPoi
   // 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;
 }