]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #524: fix bugs
authormzn <mzn@opencascade.com>
Mon, 8 Jun 2015 07:19:20 +0000 (10:19 +0300)
committermzn <mzn@opencascade.com>
Mon, 8 Jun 2015 07:19:20 +0000 (10:19 +0300)
src/HYDROGUI/HYDROGUI_OCCSelector.cxx
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
src/HYDROGUI/HYDROGUI_Shape.cxx

index 750593296731d62ab2f7d1195845b7254b41a14f..eebfdf3575b8dba74f9c0cbd283dcf59b57294b6 100644 (file)
@@ -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<QString, Handle(AIS_InteractiveObject)> 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<const LightApp_DataOwner*>( (*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
index a3166c19372857cd137d367de2755f49384b8678..2bee9b76568d36e848f24979752ee160d8290baf 100644 (file)
@@ -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 <HYDROData_Document.h>
 #include <HYDROData_GeomTool.h>
@@ -79,6 +79,12 @@ void HYDROGUI_RecognizeContoursOp::startOperation()
 {
   HYDROGUI_Operation::startOperation();
   
+  // Set preview view manager
+  if ( !getPreviewManager() ) {
+    setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( 
+                       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<OCCViewer_ViewManager*>( 
-                          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, 
index 6f1f62f9afdace888abe0ae2fb50eacb365b0042..60962d74b4c78ad4418c94c0adfa31cfce3f8b1c 100644 (file)
@@ -486,7 +486,6 @@ Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const
   } else {
     return new AIS_Shape( myTopoShape );
   }
-  }
 }
 
 void HYDROGUI_Shape::buildShape()