From 6268f378eaa5e3763ea8d4536eb012d259c1dbcb Mon Sep 17 00:00:00 2001 From: mzn Date: Mon, 8 Jun 2015 10:19:20 +0300 Subject: [PATCH] refs #524: fix bugs --- src/HYDROGUI/HYDROGUI_OCCSelector.cxx | 29 ++----------------- src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx | 15 +++++----- src/HYDROGUI/HYDROGUI_Shape.cxx | 1 - 3 files changed, 10 insertions(+), 35 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_OCCSelector.cxx b/src/HYDROGUI/HYDROGUI_OCCSelector.cxx index 75059329..eebfdf35 100644 --- a/src/HYDROGUI/HYDROGUI_OCCSelector.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCSelector.cxx @@ -70,36 +70,11 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) return; Handle(AIS_InteractiveContext) aContext = aViewer->getAISContext(); - if ( aContext.IsNull() || aContext->HasOpenedContext() ) { + if ( aContext->HasOpenedContext() ) { return; } - //@MZN LightApp_OCCSelector::setSelection( aList ); - QMap aDisplayed; - - AIS_ListOfInteractive aDispList, aSelList; - aContext->DisplayedObjects( aDispList ); - - for ( AIS_ListIteratorOfListOfInteractive it( aDispList ); it.More(); it.Next() ) - { - QString entryStr = entry( it.Value() ); - if ( !entryStr.isEmpty() ) - aDisplayed.insert( entryStr, it.Value() ); - } - - mySelectedExternals.clear(); - - for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) - { - const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); - if ( owner && aDisplayed.contains( owner->entry() ) ) - aSelList.Append( aDisplayed[owner->entry()] ); - else - mySelectedExternals.append(*itr); - } - - //@MZNmyViewer->unHighlightAll( false ); - aViewer->setObjectsSelected( aSelList ); + LightApp_OCCSelector::setSelection( aList ); } QString HYDROGUI_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS ) const diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx index a3166c19..2bee9b76 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 @@ -79,6 +79,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; } @@ -334,11 +340,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 +358,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, diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 6f1f62f9..60962d74 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -486,7 +486,6 @@ Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const } else { return new AIS_Shape( myTopoShape ); } - } } void HYDROGUI_Shape::buildShape() -- 2.39.2