]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #578: hide included objects on the last step of the wizard.
authormzn <mzn@opencascade.com>
Mon, 8 Jun 2015 09:33:41 +0000 (12:33 +0300)
committermzn <mzn@opencascade.com>
Mon, 8 Jun 2015 09:33:41 +0000 (12:33 +0300)
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.h

index ec7c4c83a479e3b759fd08f99be4b807b7e755a6..bad592deedd2444f57fa8706e32827b28e3f1219 100644 (file)
@@ -54,7 +54,9 @@ HYDROGUI_CalculationOp::HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool
 : HYDROGUI_Operation( theModule ),
   myIsEdit( theIsEdit ),
   myActiveViewManager( NULL ),
-  myPreviewViewManager( NULL )
+  myPreviewViewManager( NULL ),
+  myShowGeomObjects( true ),
+  myShowZones( false )
 {
   setName( myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ) );
 }
@@ -230,7 +232,7 @@ HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const
   connect( aPanel, SIGNAL( removeGroups() ), SLOT( onRemoveGroups() ) );
   connect( aPanel, SIGNAL( orderChanged( bool& ) ), SLOT( onOrderChanged( bool& ) ) );
   connect( aPanel, SIGNAL( Next( const int ) ), SLOT( onNext( const int ) ) );
-  connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onHideZones() ) );
+  connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onBack( const int ) ) );
   //connect( aPanel, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
   connect( aPanel, SIGNAL( setMergeType( int, QString& ) ), SLOT( onSetMergeType( int, QString& ) ) );
   connect( aPanel, SIGNAL( moveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>& ) ),
@@ -696,6 +698,8 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
       return;
 
     QApplication::setOverrideCursor( Qt::WaitCursor );
+
+    setGeomObjectsVisible( false );
   
     QString aNewCaseName = aPanel->getObjectName();
     QString anOldCaseName = myEditedObject->GetName();
@@ -774,8 +778,9 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
   }
 }
 
-void HYDROGUI_CalculationOp::onHideZones()
+void HYDROGUI_CalculationOp::onBack( const int theIndex )
 {
+  setGeomObjectsVisible( theIndex != 2 );
   setZonesVisible( false );
 }
 
@@ -813,6 +818,18 @@ void HYDROGUI_CalculationOp::setZonesVisible( bool theIsVisible )
   }
 }
 
+void HYDROGUI_CalculationOp::setGeomObjectsVisible( bool theIsVisible )
+{
+  myShowGeomObjects = theIsVisible;
+
+  HYDROData_SequenceOfObjects aSeq = myEditedObject->GetGeometryObjects();
+
+  HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+  for ( ; anIter.More(); anIter.Next() ) {
+    setObjectVisibility( anIter.Value(), theIsVisible );
+  }
+}
+
 void HYDROGUI_CalculationOp::AssignDefaultZonesColors()
 {
   HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions();
@@ -887,7 +904,10 @@ QColor HYDROGUI_CalculationOp::GenerateDefaultZonesColor( int theIndex,
 void HYDROGUI_CalculationOp::createPreview()
 {
   LightApp_Application* anApp = module()->getApp();
-  HYDROData_SequenceOfObjects aSeq = myEditedObject->GetGeometryObjects();
+  HYDROData_SequenceOfObjects aSeq;
+  if ( myShowGeomObjects ) {
+    aSeq.Append( myEditedObject->GetGeometryObjects() );
+  }
   Handle(HYDROData_Entity) anEntity;
 
   if ( myShowZones )
index 5ae6b3d887c8235401b685bac3a031c08eca0e26..566f9e0cf74a3c46d60b9a836bc13cd5d0f22120 100644 (file)
@@ -103,9 +103,9 @@ protected slots:
    */
   void                            onClickedInZonesBrowser( SUIT_DataObject* theItem );
   /**
-   * Hide zones in the viewer.
+   * Slot called on back button click.
    */
-  void                            onHideZones();
+  void                            onBack( const int );
   /** 
    * Geometry object is selected in the list on the first wizard page
    */
@@ -122,6 +122,7 @@ private:
   void                            closePreview();
   void                            setObjectVisibility( Handle(HYDROData_Entity) theEntity, const bool theIsVisible );
   void                            setZonesVisible( bool theIsVisible );
+  void                            setGeomObjectsVisible( bool theIsVisible );
   void                            getNamesAndEntries( const HYDROData_SequenceOfObjects& theSeq, 
                                                       QStringList& theNames, QStringList& theEntries ) const;
 
@@ -153,6 +154,7 @@ private:
 private:
   bool                            myIsEdit;
   bool                            myShowZones;
+  bool                            myShowGeomObjects;
   Handle(HYDROData_CalculationCase) myEditedObject;
 
   SUIT_ViewManager*               myActiveViewManager;