X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_RecognizeContoursOp.cxx;h=9eb098fed541c823c562d616f07f6189ff9ddcc2;hb=298c1759f9b1d4a7dc316742b7a13008eb4234e1;hp=a3166c19372857cd137d367de2755f49384b8678;hpb=2fe8190c31b4be5a6b7b9ba2e7195dc4ab64c87f;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx index a3166c19..9eb098fe 100644 --- a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx +++ b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx @@ -24,7 +24,7 @@ #include "HYDROGUI_Tool.h" #include "HYDROGUI_UpdateFlags.h" #include "HYDROGUI_OCCSelector.h" -#include "HYDROGUI_ZLayers.h" //@MZN +#include "HYDROGUI_ZLayers.h" #include #include @@ -53,6 +53,7 @@ #include #include +#include #include /** @@ -79,6 +80,12 @@ void HYDROGUI_RecognizeContoursOp::startOperation() { HYDROGUI_Operation::startOperation(); + // Set preview view manager + if ( !getPreviewManager() ) { + setPreviewManager( ::qobject_cast( + module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) ); + } + if ( !isApplyAndClose() ) { return; } @@ -93,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(); @@ -135,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; @@ -334,11 +341,6 @@ void HYDROGUI_RecognizeContoursOp::updateRecognizedPolylines() Handle(AIS_InteractiveContext) aCtx = NULL; // Display preview - if ( !getPreviewManager() ) { - setPreviewManager( ::qobject_cast( - module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) ); - } - OCCViewer_ViewManager* aViewManager = getPreviewManager(); if ( aViewManager ) { if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) { @@ -357,7 +359,7 @@ void HYDROGUI_RecognizeContoursOp::updateRecognizedPolylines() aTrsf.m21(), -aTrsf.m22(), aTrsf.m23(), aTrsf.m31() + aRect.width() * 0.5, aTrsf.m32 () - aRect.height() * 0.5, aTrsf.m33() ); - /* @MZN + /* QTransform aTrsf = myImage->Trsf(); gp_Mat aMat( aTrsf.m11(), aTrsf.m21(), 0, aTrsf.m12(), -aTrsf.m22(), 0,