]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0023055: EDF 10725 GEOM: In the shape recognition functionality, it is not possible...
authorvsr <vsr@opencascade.com>
Wed, 29 Apr 2015 14:10:44 +0000 (17:10 +0300)
committervsr <vsr@opencascade.com>
Wed, 29 Apr 2015 14:10:44 +0000 (17:10 +0300)
src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx

index a2d7c67a282df3ef8a364094129153e90618c9bb..8a35f16811cf2908dc52121774206c0555645282 100644 (file)
@@ -26,7 +26,8 @@
 
 // SALOME includes
 #include "EntityGUI_FeatureDetectorDlg.h"
-#include <ShapeRec_FeatureDetector.hxx>
+#include "ShapeRec_FeatureDetector.hxx"
+#include "GEOM_Constants.h"
 
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewManager.h>
@@ -444,13 +445,20 @@ void EntityGUI_FeatureDetectorDlg::SelectionIntoArgument()
       }
       else
         return ;
-      
-      std::string theImgFileName = myAISShape->TextureFile();      
-      if ( theImgFileName == "" )
+
+      SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+      if ( !study ) return;
+      LightApp_Application* app = ::qobject_cast<LightApp_Application*>( 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