From: isn Date: Wed, 16 Jan 2019 16:19:20 +0000 (+0300) Subject: lot 15 :: updated gui X-Git-Tag: SH_V2_2_0~99^2~39^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8864411375337623db3c8cb3009e15d76d7b7cad;p=modules%2Fhydro.git lot 15 :: updated gui --- diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 9fb52a8f..8dcedb1e 100755 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -396,6 +396,8 @@ static void PerformEdgeReplInZones(const HYDROData_SplitToZonesTool::SplitDataLi { TopoDS_Shape K = ObjToRes.FindKey(i); TopoDS_Shape V = ObjToRes.FindFromIndex(i); + if (V.IsNull()) + continue; if (V.ShapeType() != TopAbs_EDGE && V.ShapeType() != TopAbs_WIRE && V.ShapeType() != TopAbs_COMPOUND) continue; if (V.ShapeType() == TopAbs_COMPOUND) diff --git a/src/HYDROData/HYDROData_CompleteCalcCase.cxx b/src/HYDROData/HYDROData_CompleteCalcCase.cxx index 2aa627b0..01b83a90 100644 --- a/src/HYDROData/HYDROData_CompleteCalcCase.cxx +++ b/src/HYDROData/HYDROData_CompleteCalcCase.cxx @@ -90,7 +90,9 @@ static bool CheckIntersection(BOPAlgo_Builder& theAlgo, const std::vector theNewObjects, - bool& IsIntersectionOfNewObj) + bool IsUseOrigNamingOfNewRegions, + bool& IsIntersectionOfNewObj, + NCollection_Sequence& theNewRegions) { Handle(HYDROData_PolylineXY) aBndPolyline = theCalcCase->GetBoundaryPolyline(); TopoDS_Wire aBndWire; @@ -307,10 +309,12 @@ bool HYDROData_CompleteCalcCase::AddObjects( const Handle(HYDROData_Document)& d { const std::vector& sh_vec = NREGV[k]; Handle(HYDROData_Region) aRegion = theCalcCase->addNewRegion( doc, aRegsPref ); + theNewRegions.Append(aRegion); + QString OrigNameOfRegion = ""; for (int i=0;iaddNewZone( doc, aZonesPref, nF, refObjList); + + //try to get an origial name region (obtained from origin object) + if (IsUseOrigNamingOfNewRegions && !refObjList.empty() && OrigNameOfRegion == "") + OrigNameOfRegion = refObjList.first(); } + if (OrigNameOfRegion != "") + aRegion->SetName(OrigNameOfRegion + "_reg"); } //GROUPS @@ -418,6 +428,7 @@ bool HYDROData_CompleteCalcCase::AddObjects( const Handle(HYDROData_Document)& d TopTools_SequenceOfShape aSeqSh, ModifedGDefSeq; aGroup->GetShapes(aSeqSh); Handle(HYDROData_SplitShapesGroup) aSplitGroup = theCalcCase->addNewSplitGroup( aName ); + theCalcCase->AddGeometryGroup( aSplitGroup ); for (int i=1;i<=aSeqSh.Length();i++) { @@ -431,5 +442,6 @@ bool HYDROData_CompleteCalcCase::AddObjects( const Handle(HYDROData_Document)& d } aSplitGroup->SetShapes(ModifedGDefSeq); } + return true; } diff --git a/src/HYDROData/HYDROData_CompleteCalcCase.h b/src/HYDROData/HYDROData_CompleteCalcCase.h index 9f170c85..6e76decb 100644 --- a/src/HYDROData/HYDROData_CompleteCalcCase.h +++ b/src/HYDROData/HYDROData_CompleteCalcCase.h @@ -27,6 +27,7 @@ */ #include +#include #include #include @@ -37,7 +38,9 @@ public: static bool AddObjects( const Handle(HYDROData_Document)& doc, Handle(HYDROData_CalculationCase)& theCalcCase, NCollection_Sequence theNewObjects, - bool& IsIntersectionOfNewObj); + bool IsUseOrigNamingOfNewRegions, + bool& IsIntersectionOfNewObj, + NCollection_Sequence& theNewRegions); }; diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx index fff5820a..c506dcf8 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.cxx +++ b/src/HYDROData/HYDROData_PolylineOperator.cxx @@ -183,10 +183,10 @@ bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theD aNewPolyline->AddSection(aSectName, aSectType, aSectClosure); HYDROData_PolylineXY::PointsList aPointsList = aPolyline->GetPoints(i-1, false); QColor sectColor; - aPolyline->getSectionColor(i-1, sectColor); + aPolyline->GetSectionColor(i-1, sectColor); aNewPolyline->SetPoints(ins, aPointsList); if (sectColor.isValid()) - aNewPolyline->setSectionColor(ins, sectColor); + aNewPolyline->SetSectionColor(ins, sectColor); ins++; } } diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx index c4fd3ac7..0beb4d14 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx @@ -66,14 +66,22 @@ #include -HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle ) +HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool IsComplete ) : HYDROGUI_Wizard( theModule, theTitle ) { + myIsComplete = IsComplete; + myAlreadyAddedGeomObjects = NULL; + myPolylineName = NULL; + myLandCoverMapName = NULL; + myStricklerTableName = NULL; + myAvailableGeomObjects = NULL; addPage( createObjectsPage() ); - addPage( createGroupsPage() ); - addPage( createBoundaryPolygonsPage() ); - - addPage( createLandCoverMapPage() ); + if (!IsComplete) + { + addPage( createGroupsPage() ); + addPage( createBoundaryPolygonsPage() ); + addPage( createLandCoverMapPage() ); + } addPage( createZonesPage() ); } @@ -86,10 +94,16 @@ void HYDROGUI_CalculationDlg::reset() myObjectName->clear(); HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList; myGeomObjects->setObjects(anObject2VisibleList); - myPolylineName->clear(); - myLandCoverMapName->clear(); - myStricklerTableName->clear(); - myAvailableGeomObjects->clear(); + if (myAlreadyAddedGeomObjects) + myAlreadyAddedGeomObjects->clear(); + if (myPolylineName) + myPolylineName->clear(); + if (myLandCoverMapName) + myLandCoverMapName->clear(); + if (myStricklerTableName) + myStricklerTableName->clear(); + if (myAvailableGeomObjects) + myAvailableGeomObjects->clear(); // Activate the automatic mode setMode( HYDROData_CalculationCase::AUTOMATIC ); @@ -149,6 +163,18 @@ QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() { myGeomObjects->setHiddenObjectsShown(true); myGeomObjects->setVisibilityIconShown(false); myGeomObjects->setContentsMargins(QMargins()); + + if (myIsComplete) + { + myAlreadyAddedGeomObjects = new QListWidget( aPage ); + myAlreadyAddedGeomObjects->setSelectionMode( QListWidget::ExtendedSelection ); + myAlreadyAddedGeomObjects->setEditTriggers( QListWidget::NoEditTriggers ); + myAlreadyAddedGeomObjects->setViewMode( QListWidget::ListMode ); + } + else + { + myAlreadyAddedGeomObjects = NULL; + } // included geometry objects QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_OBJECTS" ) ); @@ -185,9 +211,21 @@ QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() { // fill the objects frame with two lists, two labels and with buttons frame anObjsLayout->addWidget( anObjectsLabel, 0, 0, Qt::AlignHCenter ); anObjsLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter ); - anObjsLayout->addWidget( myAvailableGeomObjects, 1, 0 ); + if (myIsComplete) + { + QLabel* anAlreadyIncludedLabel = new QLabel( tr( "ALREADY_INCLUDED_OBJECTS" ) ); + anObjsLayout->addWidget( anAlreadyIncludedLabel, 2, 2, Qt::AlignHCenter ); + anObjsLayout->addWidget( myAvailableGeomObjects, 1, 0, 3, 1 ); + } + else + anObjsLayout->addWidget( myAvailableGeomObjects, 1, 0 ); + anObjsLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter ); anObjsLayout->addWidget( myGeomObjects, 1, 2 ); + if (myIsComplete) + { + anObjsLayout->addWidget( myAlreadyAddedGeomObjects, 3, 2 ); + } // fill the top of the page QGridLayout* aTopLayout = new QGridLayout; @@ -229,6 +267,14 @@ QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() { aPage->setLayout( aPageLayout ); + if (myIsComplete) + { + aLimitsLabel->setEnabled(false); + myPolylineName->setEnabled(false); + aModeGroup->setEnabled(false); + myPriorityWidget->setEnabled(false); + } + // Create selector if ( module() ) { HYDROGUI_ListSelector* aListSelector = @@ -651,7 +697,32 @@ void HYDROGUI_CalculationDlg::includeGeomObjects( const QStringList& theObjects myGeomObjects->addObject( HYDROGUI_ListModel::Object2Visible( anObject, true ) ); } - myPriorityWidget->setObjects( getGeometryObjects() ); + if (!myIsComplete) + myPriorityWidget->setObjects( getGeometryObjects() ); +} + +void HYDROGUI_CalculationDlg::hideAvailableGeomObjects( const QStringList& theObjects ) +{ + QList aFoundItems; + foreach ( const QString& anObjName, theObjects ) + { + aFoundItems = myAvailableGeomObjects->findItems( anObjName, Qt::MatchExactly ); + foreach ( QListWidgetItem* anItem, aFoundItems ) + anItem->setHidden( true ); + } +} + +void HYDROGUI_CalculationDlg::setAlreadyAddedGeomObjects( const QStringList& theObjects ) +{ + myAlreadyAddedGeomObjects->addItems(theObjects); +} + + QStringList HYDROGUI_CalculationDlg::getAlreadyAddedGeomObjects() +{ + QStringList list; + for (int i = 0; i < myAlreadyAddedGeomObjects->count(); i++) + list << myAlreadyAddedGeomObjects->item(i)->text(); + return list; } void HYDROGUI_CalculationDlg::excludeGeomObjects( const QStringList& theObjects ) @@ -904,6 +975,11 @@ void HYDROGUI_CalculationDlg::setMode( int theMode ) } } +void HYDROGUI_CalculationDlg::setGeomOrderingEnabled( int enabled ) +{ + myGeomObjects->setOrderingEnabled( enabled ); +} + /** Enable/disable zones drag'n'drop and renaming. @param theIsEnabled if true - zones drag'n'drop and renaming will be enabled diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.h b/src/HYDROGUI/HYDROGUI_CalculationDlg.h index 07307c74..3353209c 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.h +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.h @@ -48,7 +48,7 @@ class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard Q_OBJECT public: - HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle ); + HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool IsComplete ); virtual ~HYDROGUI_CalculationDlg(); void reset(); @@ -87,12 +87,19 @@ public: public slots: void setMode( int theMode ); + void setGeomOrderingEnabled( int enabled ); + void setBoundary( const QString& theObjName ); void includeGeomObjects( const QStringList& theObjects ); void excludeGeomObjects( const QStringList& theObjects ); void includeGroups( const QStringList& theObjects ); void excludeGroups( const QStringList& theObjects ); + void hideAvailableGeomObjects( const QStringList& theObjects ); + void setAlreadyAddedGeomObjects( const QStringList& theObjects ); + QStringList getAlreadyAddedGeomObjects(); + + void includeBoundaryPolygons( const QStringList& theObjects ); void includeISBoundaryPolygons( const QStringList& theObjects ); @@ -184,6 +191,9 @@ private: QListWidget* myAvailableGeomObjects; HYDROGUI_OrderedListWidget* myGeomObjects; + QListWidget* myAlreadyAddedGeomObjects; + + HYDROGUI_PriorityWidget* myPriorityWidget; QListWidget* myAvailableGroups; @@ -199,6 +209,8 @@ private: QComboBox* myBathymetryChoice; QLabel* myBathymetryLabel; HYDROGUI_Zone* myCurrentZone; + + bool myIsComplete; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index fca5ae8d..551a991f 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -51,12 +51,16 @@ #include #include #include +#include #include #include #include #include #include +#include + + HYDROGUI_CalculationOp::HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool theIsEdit, bool IsComplete ) : HYDROGUI_Operation( theModule ), myIsEdit( theIsEdit ), @@ -65,9 +69,14 @@ HYDROGUI_CalculationOp::HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool myShowGeomObjects( true ), myShowLandCoverMap( false ), myShowZones( false ), - myDenyIncExcl (IsComplete) + myIsComplete (IsComplete) { - setName( myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ) ); + QString aDlgName; + if (myIsComplete) + aDlgName = tr( "COMPLETE_CALCULATION" ); + else + aDlgName = myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ); + setName( aDlgName ); } HYDROGUI_CalculationOp::~HYDROGUI_CalculationOp() @@ -143,6 +152,7 @@ void HYDROGUI_CalculationOp::startOperation() QString anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_CALCULATION_CASE_NAME" ) ); myEditedObject.Nullify(); + if ( myIsEdit ) { myEditedObject = Handle(HYDROData_CalculationCase)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) ); @@ -166,7 +176,16 @@ void HYDROGUI_CalculationOp::startOperation() aSeq.Append(anInterPolyList); getNamesAndEntries( aSeq, aList, anEntryList ); - aPanel->includeGeomObjects( aList ); + if (!myIsComplete) + aPanel->includeGeomObjects( aList ); + else + { + //aPanel->includeGeomObjects( aList ); + aPanel->setAlreadyAddedGeomObjects( aList ); + //myIncObjAtStart = aSeq; + aPanel->hideAvailableGeomObjects( aList ); + aPanel->setGeomOrderingEnabled(true); + } // set rules setRules( HYDROData_CalculationCase::DataTag_CustomRules ); @@ -182,10 +201,7 @@ void HYDROGUI_CalculationOp::startOperation() aPanel->setObjectName( anObjectName ); aPanel->setEditedObject( myEditedObject ); - - myIncObjAtStart.clear(); - myIncObjAtStart = aPanel->getGeometryObjects(false); - + setGeomObjectsVisible( true ); createPreview( false ); @@ -248,7 +264,7 @@ void HYDROGUI_CalculationOp::commitOperation() HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const { - HYDROGUI_CalculationDlg* aPanel = new HYDROGUI_CalculationDlg( module(), getName() ); + HYDROGUI_CalculationDlg* aPanel = new HYDROGUI_CalculationDlg( module(), getName(), myIsComplete ); // Connect signals and slots connect( aPanel, SIGNAL( changeMode( int ) ), SLOT( onChangeMode( int ) ) ); @@ -581,16 +597,10 @@ void HYDROGUI_CalculationOp::onRemoveObjects() QStringList aSelectedList = aPanel->getSelectedGeomObjects(); - if (myDenyIncExcl) + if (myIsComplete) { QSet selMap = aSelectedList.toSet(); - myIncObjAtStart.toVector(); - for (int i=0;iGetName(); - if (selMap.contains(str)) - return; - } + } @@ -632,11 +642,11 @@ bool HYDROGUI_CalculationOp::confirmRegionsChange() const if ( !isConfirmed ) { - if (myDenyIncExcl) + if (myIsComplete) { - SUIT_MessageBox::information(module()->getApp()->desktop(), - tr( "REGIONS_CHANGED" ), - tr( "COMPLETE_OP_WILL_BE_PERFORMED" )); + //SUIT_MessageBox::information(module()->getApp()->desktop(), + // tr( "REGIONS_CHANGED" ), + // tr( "COMPLETE_OP_WILL_BE_PERFORMED" )); return true; } @@ -846,18 +856,18 @@ void HYDROGUI_CalculationOp::onApply() aMsg ); } } -#include + void HYDROGUI_CalculationOp::onNext( const int theIndex ) { - if( theIndex==1 ) + if( theIndex==1 && !myIsComplete) { setAvailableGroups(); } - else if( theIndex==2 ) + else if( theIndex==2 && !myIsComplete) { setAvailableBoundaryPolygons(); } - else if( theIndex==3 ) + else if( theIndex==3 && !myIsComplete) { // Land cover map panel HYDROGUI_CalculationDlg* aPanel = @@ -962,7 +972,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) closePreview( false ); createPreview( true ); } - else if( theIndex==4 ) + else if( theIndex==4 || myIsComplete) { HYDROGUI_CalculationDlg* aPanel = ::qobject_cast( inputPanel() ); @@ -992,7 +1002,11 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) { myEditedObject->RemoveGeometryObjects(); - foreach ( const QString& aName, aPanel->getAllGeomObjects() ) + QStringList aGeomObjNames; + if (myIsComplete) //erase objects ? + aGeomObjNames << aPanel->getAlreadyAddedGeomObjects(); + aGeomObjNames << aPanel->getAllGeomObjects(); + foreach ( const QString& aName, aGeomObjNames ) { Handle(HYDROData_Object) anObject = Handle(HYDROData_Object)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), aName ) ); @@ -1003,48 +1017,65 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) myEditedObject->AddGeometryObject( anObject ); } - // Clear priority rules - //@ASL if ( myEditedObject->GetRulesCount() > 0 ) { + if (!myIsComplete) + { + // Clear priority rules + //@ASL if ( myEditedObject->GetRulesCount() > 0 ) { myEditedObject->ClearRules( HYDROData_CalculationCase::DataTag_CustomRules, true ); - //@ASL } - // Set priority rules - foreach ( const HYDROData_CustomRule& aRule, aPanel->getRules() ) { - myEditedObject->AddRule( aRule.Object1, aRule.Priority, - aRule.Object2, aRule.MergeType, - HYDROData_CalculationCase::DataTag_CustomRules ); + //@ASL } + // Set priority rules + foreach ( const HYDROData_CustomRule& aRule, aPanel->getRules() ) { + myEditedObject->AddRule( aRule.Object1, aRule.Priority, + aRule.Object2, aRule.MergeType, + HYDROData_CalculationCase::DataTag_CustomRules ); + } } } } aPanel->setEditZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL ); + if (myIsComplete) + aPanel->BackButton()->setEnabled(false); //force disable; to prevent moving to the first page + if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) ) { myShowZones = true; - if (myDenyIncExcl) + if (myIsComplete) { - QList ibcludedGeomObj = aPanel->getGeometryObjects(false); + //abortDocOperation(); + //module()->getApp()->updateObjectBrowser(); + QList newGeomObj = aPanel->getGeometryObjects(false); //QSet includedObjAtStartSet = myIncObjAtStart.toSet(); NCollection_Sequence theNewObjects; - foreach (Handle(HYDROData_Entity) obj, ibcludedGeomObj) - { - if (!myIncObjAtStart.contains(obj)) - theNewObjects.Append(obj); - } + foreach (Handle(HYDROData_Entity) obj, newGeomObj) + theNewObjects.Append(obj); + bool is_int = false; - HYDROData_CompleteCalcCase::AddObjects(doc(), myEditedObject, theNewObjects, is_int); + bool UseOrigNamingOfNewRegions = true; + NCollection_Sequence theNewRegions; + QSet newRegionEntries; + HYDROData_CompleteCalcCase::AddObjects(doc(), myEditedObject, theNewObjects, UseOrigNamingOfNewRegions, is_int, theNewRegions); if (is_int) SUIT_MessageBox::information(module()->getApp()->desktop(), tr( "COMPLETE_CASE" ), tr( "There is an intersection(s) between new objects. result will be depend on order" )); myEditedObject->ClearChanged(); + for (int k=1;k<=theNewRegions.Size();k++) + { + QString anEntry = HYDROGUI_DataObject::dataObjectEntry( theNewRegions(k) ); + newRegionEntries.insert(anEntry); + } + AssignDefaultZonesColors(&newRegionEntries); } else + { myEditedObject->Update(); + AssignDefaultZonesColors(NULL); + } - AssignDefaultZonesColors(); //aPanel->setEditedObject( myEditedObject ); aPanel->refreshZonesBrowser(); @@ -1070,32 +1101,48 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) void HYDROGUI_CalculationOp::onHideZones( const int theIndex ) { - if( theIndex==1 ) - { - setGeomObjectsVisible( true ); - - closePreview( false ); - createPreview( false ); + if (myIsComplete) + { + //theIndex == 0 + // setGeomObjectsVisible( true ); + // // HYDROGUI_CalculationDlg* aPanel = ::qobject_cast( inputPanel() ); + // // QList geomObjList = aPanel->getGeometryObjects(false); + // // foreach ( Handle(HYDROData_Entity) geomObj, geomObjList) + // // setObjectVisibility( geomObj, true ); + // + // setZonesVisible( false ); + // closePreview( false ); + // createPreview( false ); } - if( theIndex==3 ) + else { - setLandCoverMapVisible( true ); + if( theIndex==1 ) + { + setGeomObjectsVisible( true ); - closePreview( false ); - createPreview( true ); + closePreview( false ); + createPreview( false ); + } + if( theIndex==3 ) + { + setLandCoverMapVisible( true ); - // Hide zones - setZonesVisible( false ); - } - else if( theIndex==4 ) - { - AssignDefaultZonesColors(); + closePreview( false ); + createPreview( true ); - closePreview( false ); - createPreview( false ); + // Hide zones + setZonesVisible( false ); + } + else if( theIndex==4 ) + { + AssignDefaultZonesColors(); + + closePreview( false ); + createPreview( false ); - // Show zones - setZonesVisible( true ); + // Show zones + setZonesVisible( true ); + } } } @@ -1151,7 +1198,7 @@ void HYDROGUI_CalculationOp::setLandCoverMapVisible( bool theIsVisible ) setObjectVisibility( myEditedObject->GetLandCoverMap(), theIsVisible ); } -void HYDROGUI_CalculationOp::AssignDefaultZonesColors() +void HYDROGUI_CalculationOp::AssignDefaultZonesColors(const QSet* theRegionsEntriesToColored) { HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions(); HYDROData_SequenceOfObjects::Iterator aRegionsIter( aRegions ); @@ -1167,6 +1214,11 @@ void HYDROGUI_CalculationOp::AssignDefaultZonesColors() for ( ; aRegionsIter.More(); aRegionsIter.Next() ) { aRegion = Handle(HYDROData_Region)::DownCast( aRegionsIter.Value() ); + QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aRegion ); + + if (theRegionsEntriesToColored && !theRegionsEntriesToColored->contains(anEntry)) + continue; + if ( !aRegion.IsNull() ) { aZones = aRegion->GetZones(); diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.h b/src/HYDROGUI/HYDROGUI_CalculationOp.h index e2ba6d4c..85183a96 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.h +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.h @@ -148,7 +148,7 @@ private: /** * Internal method that used to assign unique default colors for zones */ - void AssignDefaultZonesColors(); + void AssignDefaultZonesColors(const QSet* theRegionsEntriesToColored = NULL); void setRules( HYDROData_CalculationCase::DataTag theDataTag ); bool createRegion( const QList& theZonesList ); @@ -170,9 +170,8 @@ private: SUIT_ViewManager* myActiveViewManager; OCCViewer_ViewManager* myPreviewViewManager; - QList myIncObjAtStart; - bool myDenyIncExcl; + bool myIsComplete; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_OrderedListWidget.cxx b/src/HYDROGUI/HYDROGUI_OrderedListWidget.cxx index a6ef3229..f66e8009 100644 --- a/src/HYDROGUI/HYDROGUI_OrderedListWidget.cxx +++ b/src/HYDROGUI/HYDROGUI_OrderedListWidget.cxx @@ -112,12 +112,21 @@ HYDROGUI_OrderedListWidget::HYDROGUI_OrderedListWidget( QWidget* theParent, int connect ( myList->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), this, SIGNAL( selectionChanged() ) ); + + connect ( myList->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), + this, SLOT( onSelectionChanged() ) ); // Initialize setHiddenObjectsShown( true ); setVisibilityIconShown( true ); } +void HYDROGUI_OrderedListWidget::onSelectionChanged() +{ + QStringList selectedEntries = getSelectedEntries(); + +} + /** Destructor. */ diff --git a/src/HYDROGUI/HYDROGUI_OrderedListWidget.h b/src/HYDROGUI/HYDROGUI_OrderedListWidget.h index 7b1feab7..fd272a29 100644 --- a/src/HYDROGUI/HYDROGUI_OrderedListWidget.h +++ b/src/HYDROGUI/HYDROGUI_OrderedListWidget.h @@ -70,6 +70,7 @@ signals: private slots: void onMove( int theType ); + void onSelectionChanged(); private: HYDROGUI_ListModel* getSourceModel() const; diff --git a/src/HYDROGUI/HYDROGUI_Wizard.cxx b/src/HYDROGUI/HYDROGUI_Wizard.cxx index 7ad59940..c6d9397d 100644 --- a/src/HYDROGUI/HYDROGUI_Wizard.cxx +++ b/src/HYDROGUI/HYDROGUI_Wizard.cxx @@ -190,4 +190,9 @@ void HYDROGUI_Wizard::SetButtonsState (bool IsLastPage) myNext->setVisible( false ); myFinish->setVisible( true ); } -} \ No newline at end of file +} + +QPushButton* HYDROGUI_Wizard::BackButton() +{ + return myBack; +} diff --git a/src/HYDROGUI/HYDROGUI_Wizard.h b/src/HYDROGUI/HYDROGUI_Wizard.h index 8269950c..333f1460 100644 --- a/src/HYDROGUI/HYDROGUI_Wizard.h +++ b/src/HYDROGUI/HYDROGUI_Wizard.h @@ -40,6 +40,8 @@ public: int addPage( QWizardPage* thePage ); QStackedWidget* wizard() const; + QPushButton* BackButton(); + public slots: void onNext(); void onBack(); diff --git a/src/HYDROGUI/resources/HYDROGUI_images.ts b/src/HYDROGUI/resources/HYDROGUI_images.ts index ba88e887..03993d96 100644 --- a/src/HYDROGUI/resources/HYDROGUI_images.ts +++ b/src/HYDROGUI/resources/HYDROGUI_images.ts @@ -463,6 +463,12 @@ EDIT_CALCULATION_ICO icon_edit_calc.png + + + COMPLETE_CALCULATION_ICO + icon_complete_calc.png + + EXPORT_CALCULATION_ICO icon_export_calc.png diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 3b654ee6..48bfb0a4 100755 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -337,7 +337,11 @@ All supported formats (*.brep *.iges *.igs *.step *.stp) INCLUDED_OBJECTS Included objects - + + + ALREADY_INCLUDED_OBJECTS + Already included objects (can't be excluded) + AVAILABLE_GROUPS Available groups @@ -439,6 +443,10 @@ All supported formats (*.brep *.iges *.igs *.step *.stp) Edit calculation case + COMPLETE_CALCULATION + Fast update of calculation case + + PREVIEW_CASE_ZONES Preview case zones @@ -948,6 +956,10 @@ Would you like to remove all references from the image? Edit calculation case + DSK_COMPLETE_CALCULATION + Complete calculation case + + DSK_EXPORT_CALCULATION Export calculation case to GEOM @@ -1333,6 +1345,10 @@ Would you like to remove all references from the image? Edit calculation case + MEN_COMPLETE_CALCULATION + Complete calculation case + + MEN_EXPORT_CALCULATION Export calculation case @@ -1713,6 +1729,10 @@ Would you like to remove all references from the image? Edit calculation case + STB_COMPLETE_CALCULATION + Complete calculation case + + STB_EXPORT_CALCULATION Export calculation case to GEOM diff --git a/src/HYDROGUI/resources/icon_complete_calc.png b/src/HYDROGUI/resources/icon_complete_calc.png new file mode 100644 index 00000000..703e1970 Binary files /dev/null and b/src/HYDROGUI/resources/icon_complete_calc.png differ