From 939beceaf89288d6d03ec783f17d61b18c43ec18 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 29 Apr 2015 17:10:44 +0300 Subject: [PATCH] 0023055: EDF 10725 GEOM: In the shape recognition functionality, it is not possible to select an area for the filtering sample --- src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx b/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx index a2d7c67a2..8a35f1681 100644 --- a/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx +++ b/src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx @@ -26,7 +26,8 @@ // SALOME includes #include "EntityGUI_FeatureDetectorDlg.h" -#include +#include "ShapeRec_FeatureDetector.hxx" +#include "GEOM_Constants.h" #include #include @@ -444,13 +445,20 @@ void EntityGUI_FeatureDetectorDlg::SelectionIntoArgument() } else return ; - - std::string theImgFileName = myAISShape->TextureFile(); - if ( theImgFileName == "" ) + + SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + if ( !study ) return; + LightApp_Application* app = ::qobject_cast( study->application() ); + if ( !app ) return; + SUIT_ViewManager* vm = app->activeViewManager(); + if ( !vm ) return; + PropMap propMap = study->getObjectProperties( vm->getGlobalId(), myFaceEntry ); + QString theImgFileName = propMap.value( GEOM::propertyName( GEOM::Texture ) ).toString(); + if ( theImgFileName.isEmpty() ) return ; // Setting the image caracteristics - myDetector->SetPath( theImgFileName ); + myDetector->SetPath( theImgFileName.toStdString() ); height = myDetector->GetImgHeight(); width = myDetector->GetImgWidth(); pictureLeft = -0.5 * width; // X coordinate of the top left corner of the background image in the view -- 2.39.2