From 104fb853e59d3f22d9ff8fcfd9d93257e7ad0398 Mon Sep 17 00:00:00 2001 From: rkv Date: Wed, 30 Oct 2013 13:14:43 +0000 Subject: [PATCH] Splitting geometry objects to zones is performed on "Next" button in the first wizard page of Calculation Case operation. --- src/HYDROGUI/HYDROGUI_CalculationDlg.cxx | 1 + src/HYDROGUI/HYDROGUI_CalculationDlg.h | 1 + src/HYDROGUI/HYDROGUI_CalculationOp.cxx | 49 +++++++++++++----------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx index 8d43d446..9d5265ac 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx @@ -63,6 +63,7 @@ HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, co QWizard* aWizard = wizard(); aWizard->addPage( createObjectsPage() ); aWizard->addPage( createZonesPage() ); + connect( aWizard->button( QWizard::NextButton ), SIGNAL( clicked() ), SIGNAL( splitZones() ) ); aWizard->show(); } diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.h b/src/HYDROGUI/HYDROGUI_CalculationDlg.h index aa3dbe53..fa48b369 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.h +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.h @@ -61,6 +61,7 @@ public slots: signals: void addObjects(); void removeObjects(); + void splitZones(); private: diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index 977b440b..552f6841 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -146,8 +146,9 @@ HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const HYDROGUI_CalculationDlg* aPanel = new HYDROGUI_CalculationDlg( module(), getName() ); // Connect signals and slots - connect( aPanel, SIGNAL( addObjects() ), this, SLOT( onAddObjects() ) ); - connect( aPanel, SIGNAL( removeObjects() ), this, SLOT( onRemoveObjects() ) ); + connect( aPanel, SIGNAL( addObjects() ), SLOT( onAddObjects() ) ); + connect( aPanel, SIGNAL( removeObjects() ), SLOT( onRemoveObjects() ) ); + connect( aPanel, SIGNAL( splitZones() ), SLOT( onSplitZones() ) ); return aPanel; } @@ -297,7 +298,7 @@ void HYDROGUI_CalculationOp::onApply() void HYDROGUI_CalculationOp::onSplitZones() { - myRegionsList.clear(); + //myRegionsList.clear(); HYDROGUI_CalculationDlg* aPanel = ::qobject_cast( inputPanel() ); @@ -306,35 +307,37 @@ void HYDROGUI_CalculationOp::onSplitZones() QApplication::setOverrideCursor( Qt::WaitCursor ); - QStringList aGeomObjectNames = aPanel->getSelectedGeomObjects(); - HYDROData_SequenceOfObjects aGeomObjects = - HYDROGUI_Tool::FindObjectsByNames( module(), aGeomObjectNames ); + //QStringList aGeomObjectNames = aPanel->getSelectedGeomObjects(); + //HYDROData_SequenceOfObjects aGeomObjects = + // HYDROGUI_Tool::FindObjectsByNames( module(), aGeomObjectNames ); - QStringList aResSplittedZones; + //QStringList aResSplittedZones; - HYDROData_SplitToZonesTool::SplitDataList aSplittedZones = - HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects ); + //HYDROData_SplitToZonesTool::SplitDataList aSplittedZones = + // HYDROData_SplitToZonesTool::SplitToZones( aGeomObjects ); - QStringList aUsedNames; + //QStringList aUsedNames; - HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplittedZones ); - while( anIter.hasNext() ) - { - Region aRegion; - aRegion.SplitData = anIter.next(); + //HYDROData_SplitToZonesTool::SplitDataListIterator anIter( aSplittedZones ); + //while( anIter.hasNext() ) + //{ + // Region aRegion; + // aRegion.SplitData = anIter.next(); - aRegion.FillingColor = HYDROGUI_Tool::GenerateFillingColor( module(), aRegion.SplitData.ObjectNames ); - aRegion.BorderColor = QColor( HYDROData_ImmersibleZone::DefaultBorderColor() ); + // aRegion.FillingColor = HYDROGUI_Tool::GenerateFillingColor( module(), aRegion.SplitData.ObjectNames ); + // aRegion.BorderColor = QColor( HYDROData_ImmersibleZone::DefaultBorderColor() ); - aRegion.RegionName = HYDROGUI_Tool::GenerateObjectName( module(), "Region", aUsedNames ); + // aRegion.RegionName = HYDROGUI_Tool::GenerateObjectName( module(), "Region", aUsedNames ); - aUsedNames.append( aRegion.RegionName ); + // aUsedNames.append( aRegion.RegionName ); - aResSplittedZones.append( aRegion.RegionName ); + // aResSplittedZones.append( aRegion.RegionName ); - myRegionsList.append( aRegion ); - } - + // myRegionsList.append( aRegion ); + //} + // + + myEditedObject->SplitGeometryObjects(); createPreview(); QApplication::restoreOverrideCursor(); -- 2.39.2