From ef808bb1b445ecb9dec6ebc5030eaf63a00c3763 Mon Sep 17 00:00:00 2001 From: isn Date: Wed, 30 Nov 2016 14:22:43 +0300 Subject: [PATCH] LCM classification -> correct 2d to parametric 2d conversion of points --- src/HYDROData/HYDROData_LCM_FaceClassifier.cxx | 15 ++++++++++++--- src/HYDROData/HYDROData_LandCoverMap.cxx | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx b/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx index 9e3a8f91..b2c7a11a 100644 --- a/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx +++ b/src/HYDROData/HYDROData_LCM_FaceClassifier.cxx @@ -26,7 +26,10 @@ #include #include #include - +#include +#include +#include +#include Standard_Boolean HYDROData_FaceClassifier_BndBoxTreeSelector::Accept (const Standard_Integer& theObj) { @@ -38,8 +41,14 @@ Standard_Boolean HYDROData_FaceClassifier_BndBoxTreeSelector::Accept (const Stan return Standard_False; BRepTopAdaptor_FClass2d* class2d = myMapF2Class2d.FindFromKey(f); - - TopAbs_State aState = class2d->Perform( myP, Standard_False ); + + TopLoc_Location L; + Handle(Geom_Surface) C = BRep_Tool::Surface(f, L); + Handle(Geom_Plane) Pl = Handle(Geom_Plane)::DownCast(C->Transformed(L.Transformation())); + Standard_Real u, v; + ElSLib::Parameters(Pl->Pln(), gp_Pnt(myP.X(), myP.Y(), 0.0), u, v); + + TopAbs_State aState = class2d->Perform( gp_Pnt2d(u, v), Standard_False ); if (aState == TopAbs_IN) { diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index 046e61fd..1ecf2586 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -1295,7 +1295,7 @@ void HYDROData_LandCoverMap::ClassifyPoints( const std::vector& thePoints else { std::set::const_iterator it; - std::vector C1(SStr.size()); + std::vector C1; for (it = SStr.begin(); it != SStr.end(); ++it) C1.push_back(theTable->Get( *it, DefValue )); double Val; -- 2.30.2