Salome HOME
refs #618
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_RecognizeContoursOp.cxx
index 2bee9b76568d36e848f24979752ee160d8290baf..c4961c39d71c503a272f74664850babf16f9bdf4 100644 (file)
@@ -53,6 +53,7 @@
 #include <gp_GTrsf.hxx>
 
 #include <QDialog>
+#include <QDir>
 #include <QTemporaryFile>
 
 /**
@@ -99,7 +100,7 @@ void HYDROGUI_RecognizeContoursOp::startOperation()
 
   // Create temporary graphics file
   QImage aQImage = myImage->Image();
-  myTmpImageFile = new QTemporaryFile( anImageName );
+  myTmpImageFile = new QTemporaryFile( QDir::tempPath() + QDir::separator() + anImageName );
   if ( !myTmpImageFile->open() || 
        !aQImage.save( myTmpImageFile->fileName(), "PNG", 100 ) ) {
     abort();
@@ -141,10 +142,10 @@ void HYDROGUI_RecognizeContoursOp::startOperation()
       // update the object browser
       module()->getApp()->updateObjectBrowser( true );
 
-      // select the picture
-      SUIT_DataOwnerPtrList aList( true );
-      aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( aGeomPictureEntry ) ) );
-      selectionMgr()->setSelected(aList );
+      // browse the published GEOM picture
+      QStringList anEntries;
+      anEntries << aGeomPictureEntry;
+      browseObjects( anEntries );
 
       // Add GEOM picture object entry to the list of temporary geom objects
       myTmpGeomObjects << aGeomPictureEntry;
@@ -467,9 +468,9 @@ void HYDROGUI_RecognizeContoursOp::onViewerSelectionChanged()
     return;
   }
 
-  Handle(AIS_InteractiveContext) aCtx = NULL;
 
   OCCViewer_ViewManager* aViewManager = getPreviewManager();
+  Handle(AIS_InteractiveContext) aCtx = NULL;
   if ( aViewManager ) {
     if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
       aCtx = aViewer->getAISContext();