From f3f1db6aad1140283a47e55e580922fa0749a9d2 Mon Sep 17 00:00:00 2001 From: mzn Date: Mon, 8 Jun 2015 12:33:41 +0300 Subject: [PATCH] refs #578: hide included objects on the last step of the wizard. --- src/HYDROGUI/HYDROGUI_CalculationOp.cxx | 28 +++++++++++++++++++++---- src/HYDROGUI/HYDROGUI_CalculationOp.h | 6 ++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index ec7c4c83..bad592de 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -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& ) ), @@ -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 ) diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.h b/src/HYDROGUI/HYDROGUI_CalculationOp.h index 5ae6b3d8..566f9e0c 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.h +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.h @@ -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; -- 2.39.2