From cfdd68b41f3a532316810dc5568758290520063c Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 29 Oct 2007 11:17:06 +0000 Subject: [PATCH] Merge the final state of the MERGE_MULTIPR_EVOLUTION --- src/VISUGUI/VISU_msg_en.po | 3 + src/VISUGUI/VisuGUI.cxx | 2 + src/VISUGUI/VisuGUI_GaussPointsDlg.cxx | 86 +++++++++++++++----------- src/VISUGUI/VisuGUI_GaussPointsDlg.h | 4 +- src/VISUGUI/VisuGUI_Prs3dDlg.cxx | 16 ++--- src/VISU_I/VISU_ColoredPrs3d_i.cc | 2 +- src/VISU_I/VISU_GaussPoints_i.cc | 13 ++-- src/VISU_I/VISU_MultiResult_i.cc | 9 +-- 8 files changed, 76 insertions(+), 59 deletions(-) diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index a2ef6b93..2f10ac9a 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -489,6 +489,9 @@ msgstr "All Files (*.*)" msgid "VisuGUI::FLT_MED_FILES" msgstr "MED Files (*.med)" +msgid "VisuGUI::FLT_DISTRIBUTED_MED_FILES" +msgstr "Distributed MED Files (*_maitre.med)" + msgid "VisuGUI::FLT_TABLE_FILES" msgstr "Tables (*.xls *.txt *.tab)" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 85048f08..0bd5b847 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -186,6 +186,7 @@ VisuGUI // Get file name QStringList aFilter; aFilter.append( tr( "FLT_MED_FILES" ) ); + aFilter.append( tr( "FLT_DISTRIBUTED_MED_FILES" ) ); aFilter.append( tr( "FLT_ALL_FILES" ) ); bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false); @@ -2987,6 +2988,7 @@ void VisuGUI::createPreferences() addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" ); addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" ); addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" ); + addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" ); addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" ); addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" ); diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 5e0b3fc1..2e5c6363 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -303,32 +303,51 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent): myIsStoreTextProp = false; } +bool VisuGUI_GaussScalarBarPane::UseFieldRange(bool theInit) +{ + if ( theInit ) + return !myPrsCopy->IsRangeFixed(); + + return RBFieldRange->isChecked() || !myPrsCopy->GetIsActiveLocalScalarBar(); +} + + void VisuGUI_GaussScalarBarPane::onGlobalScalarBar() { - myCBDisplayed->setChecked( true ); + myPrsCopy->SetIsActiveLocalScalarBar(false); + myPrsCopy->SetSourceRange(); + + myCBDisplayed->setEnabled( false ); RBImposedRange->setEnabled( false ); RBFieldRange->setEnabled( false ); + MinEdit->setEnabled( false ); MaxEdit->setEnabled( false ); - myPrsCopy->SetIsActiveLocalScalarBar(false); + MinEdit->setText( QString::number( myPrsCopy->GetMin() ) ); + MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) ); } void VisuGUI_GaussScalarBarPane::onLocalScalarBar() { + myPrsCopy->SetIsActiveLocalScalarBar(true); + if ( RBFieldRange->isChecked() ) + myPrsCopy->SetSourceRange(); + else + myPrsCopy->SetRange(myPrsCopy->GetMin(), myPrsCopy->GetMax()); + myCBDisplayed->setEnabled( true ); RBImposedRange->setEnabled( true ); RBFieldRange->setEnabled( true ); - if ( RBImposedRange->isChecked() ) { - MinEdit->setEnabled( true ); - MaxEdit->setEnabled( true ); - } + MinEdit->setEnabled( RBImposedRange->isChecked() ); + MaxEdit->setEnabled( RBImposedRange->isChecked() ); - myPrsCopy->SetIsActiveLocalScalarBar(true); + MinEdit->setText( QString::number( myPrsCopy->GetMin() ) ); + MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) ); } @@ -337,14 +356,16 @@ void VisuGUI_GaussScalarBarPane::onLocalScalarBar() */ void VisuGUI_GaussScalarBarPane::fieldRangeClicked() { + myPrsCopy->SetSourceRange(); + + RBFieldRange->setChecked( true ); RBImposedRange->setChecked( false ); + MinEdit->setEnabled( false ); MaxEdit->setEnabled( false ); - MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) ); - MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) ); - - myPrsCopy->SetSourceRange(); + MinEdit->setText( QString::number( myPrsCopy->GetMin() ) ); + MaxEdit->setText( QString::number( myPrsCopy->GetMax() ) ); } @@ -353,11 +374,13 @@ void VisuGUI_GaussScalarBarPane::fieldRangeClicked() */ void VisuGUI_GaussScalarBarPane::imposedRangeClicked() { + myPrsCopy->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble()); + + RBImposedRange->setChecked( true ); RBFieldRange->setChecked( false ); + MinEdit->setEnabled( true ); MaxEdit->setEnabled( true ); - - myPrsCopy->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble()); } @@ -367,34 +390,28 @@ void VisuGUI_GaussScalarBarPane::imposedRangeClicked() void VisuGUI_GaussScalarBarPane::changeScalarMode( int theMode ) { myPrsCopy->SetScalarMode( theMode ); - if ( RBFieldRange->isChecked() ) { - CORBA::Double aRange[2] = {myPrsCopy->GetSourceMin(), myPrsCopy->GetSourceMax()}; - MinEdit->setText( QString::number( aRange[0] ) ); - MaxEdit->setText( QString::number( aRange[1] ) ); + if ( UseFieldRange() ) { + MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) ); + MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) ); } } /** * Initialise dialog box from presentation object */ -void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) { +void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs, + bool theInit ) +{ myPrsCopy = thePrs; myModeCombo->setCurrentItem(thePrs->GetScalarMode()); bool activeLocal = thePrs->GetIsActiveLocalScalarBar(); if ( activeLocal ) { - if ( thePrs->IsRangeFixed() ) { - RBImposedRange->setChecked( true ); - RBFieldRange->setChecked( false ); - MinEdit->setEnabled( true ); - MaxEdit->setEnabled( true ); - } else { - RBImposedRange->setChecked( false ); - RBFieldRange->setChecked( true ); - MinEdit->setEnabled( false ); - MaxEdit->setEnabled( false ); - } + RBImposedRange->setChecked( !UseFieldRange(theInit) ); + RBFieldRange->setChecked( UseFieldRange(theInit) ); + MinEdit->setEnabled( !UseFieldRange(theInit) ); + MaxEdit->setEnabled( !UseFieldRange(theInit) ); } else { RBImposedRange->setEnabled( false ); RBFieldRange->setEnabled( false ); @@ -402,13 +419,8 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) MaxEdit->setEnabled( false ); } - if ( RBFieldRange->isChecked() ) { - MinEdit->setText( QString::number( thePrs->GetSourceMin() ) ); - MaxEdit->setText( QString::number( thePrs->GetSourceMax() ) ); - } else { - MinEdit->setText( QString::number( thePrs->GetMin() ) ); - MaxEdit->setText( QString::number( thePrs->GetMax() ) ); - } + MinEdit->setText( QString::number( thePrs->GetMin() ) ); + MaxEdit->setText( QString::number( thePrs->GetMax() ) ); setPosAndSize( thePrs->GetPosX(), thePrs->GetPosY(), @@ -780,7 +792,7 @@ void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, if( theInit ) myPrsCopy = VISU::TSameAsFactory().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish); - myScalarPane->initFromPrsObject( myPrsCopy ); + myScalarPane->initFromPrsObject( myPrsCopy, theInit ); bool isDeformed = myPrsCopy->GetIsDeformed(); myScaleSpinBox->setValue( myPrsCopy->GetScaleFactor() ); diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index 7bd912df..d66df5fc 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -62,7 +62,7 @@ class VisuGUI_GaussScalarBarPane : public QVBox int getNbColors(); int getNbLabels(); - void initFromPrsObject(VISU::GaussPoints_i* thePrs); + void initFromPrsObject(VISU::GaussPoints_i* thePrs, bool theInit); int storeToPrsObject(VISU::GaussPoints_i* thePrs); protected: @@ -104,6 +104,8 @@ class VisuGUI_GaussScalarBarPane : public QVBox int myRangeMode; bool myIsStoreTextProp; + bool UseFieldRange( bool theInit = true ); + private slots: void onGlobalScalarBar(); void onLocalScalarBar(); diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx index 3eb42d6d..f45f02dd 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx @@ -450,7 +450,6 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent): connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() )); connect( HeightSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() )); connect( CBLog, SIGNAL( toggled( bool ) ), this, SLOT( updatePreview() )); - changeRange( 0 ); changeDefaults( 0 ); myIsStoreTextProp = false; myBusy = false; @@ -794,9 +793,11 @@ void VisuGUI_ScalarBarPane::changeDefaults( int ) void VisuGUI_ScalarBarPane::changeRange( int ) { if ( RBFrange->isChecked() ) { + myScalarMap->SetSourceRange(); MinEdit->setEnabled( false ); MaxEdit->setEnabled( false ); } else { + myScalarMap->SetRange(myScalarMap->GetMin(), myScalarMap->GetMax()); MinEdit->setEnabled( true ); MaxEdit->setEnabled( true ); } @@ -828,12 +829,13 @@ void VisuGUI_ScalarBarPane::XYChanged( double ) */ void VisuGUI_ScalarBarPane::changeScalarMode( int theMode ) { - if ( myScalarMap ) { - if ( RBFrange->isChecked() ) { - MinEdit->setText( QString::number( myScalarMap->GetComponentMin(theMode) ) ); - MaxEdit->setText( QString::number( myScalarMap->GetComponentMax(theMode) ) ); - } + if ( RBFrange->isChecked() ) { + MinEdit->setText( QString::number( myScalarMap->GetComponentMin(theMode) ) ); + MaxEdit->setText( QString::number( myScalarMap->GetComponentMax(theMode) ) ); } + + myScalarMap->SetScalarMode(theMode); + updatePreview(); } @@ -852,7 +854,7 @@ void VisuGUI_ScalarBarPane::setRange( double imin, double imax, bool sbRange ) else RBFrange->setChecked( true ); - changeRange( 0 ); + changeRange( sbRange ); } diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index ce1d5d92..65e2dd08 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -281,7 +281,7 @@ VISU::ColoredPrs3d_i GetSpecificPL()->Init(); // To update scalar range according to the new input - if(!IsRangeFixed() || theReInit) + if(!IsRangeFixed() && theReInit) SetSourceRange(); GetCResult()->ConnectObserver(this, myResultConnection); diff --git a/src/VISU_I/VISU_GaussPoints_i.cc b/src/VISU_I/VISU_GaussPoints_i.cc index 47ddbf40..48331e5d 100644 --- a/src/VISU_I/VISU_GaussPoints_i.cc +++ b/src/VISU_I/VISU_GaussPoints_i.cc @@ -1033,15 +1033,10 @@ VISU::GaussPoints_i { VISU::TSetModified aModified(this); - if(IsTimeStampFixed() || GetIsActiveLocalScalarBar()) - ProcessVoidEvent(new TVoidMemFunEvent - (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange)); - else{ - TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode()); - vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second}; - ProcessVoidEvent(new TVoidMemFun1ArgEvent - (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange)); - } + vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()}; + ProcessVoidEvent(new TVoidMemFun1ArgEvent + (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange)); + UseFixedRange(false); } diff --git a/src/VISU_I/VISU_MultiResult_i.cc b/src/VISU_I/VISU_MultiResult_i.cc index 7639c4e2..8894cb93 100644 --- a/src/VISU_I/VISU_MultiResult_i.cc +++ b/src/VISU_I/VISU_MultiResult_i.cc @@ -550,7 +550,7 @@ VISU::MultiResult_i { QFileInfo aFileInfo(theFileName); QString aTargetFileName = aFileInfo.filePath(); - if(aTargetFileName.endsWith("_grains_maitre.med")){ + if(aTargetFileName.endsWith("_maitre.med")){ myMultiprObj.create(theFileName); if (myMultiprObj.isValidDistributedMEDFile()) { aTargetFileName = myMultiprObj.getSequentialMEDFilename(); @@ -749,7 +749,7 @@ VISU::MultiResult_i VISU::TSubString(aPrefix, aSuffix) = ""; BEGMSG(MYDEBUG, "aPrefix = '"<GetMeshMap(); - VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName); + //VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName); + VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.begin(); if(aMeshIter == aMeshMap.end()) return; @@ -1095,7 +1096,7 @@ VISU::MultiResult_i int aRes = false; std::string anErrorMessage("empty mesh"); try { - INITMSG(MYDEBUG, "theMeshName = '"<