From f5a3157c23f85abf1841c53a4f2c6c6e95958882 Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 8 Feb 2006 09:27:42 +0000 Subject: [PATCH] package update --- src/VISUGUI/VisuGUI_Module.cxx | 11 +++--- src/VISUGUI/VisuGUI_Prs3dTools.h | 2 +- .../VisuGUI_ScalarMapOnDeformedShapeDlg.cxx | 36 +++++++++++++++---- .../VisuGUI_ScalarMapOnDeformedShapeDlg.h | 5 ++- src/VISUGUI/VisuGUI_Tools.cxx | 8 ++--- src/VISUGUI/VisuGUI_ViewTools.h | 4 +-- src/VISU_I/VISU_Gen_i.cc | 11 ++++++ src/VISU_I/VISU_Gen_i.hh | 7 ++++ src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc | 3 ++ 9 files changed, 69 insertions(+), 18 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 2ae2cea1..f496c5dc 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -983,8 +983,10 @@ VisuGUI_Module QApplication::setOverrideCursor(Qt::waitCursor); if(LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this)){ - SALOME_ListIO aList; - aSelectionMgr->selectedObjects(aList); + SALOME_ListIO aSel, aList; + aSelectionMgr->selectedObjects(aSel); + extractContainers(aSel, aList); + for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){ Handle(SALOME_InteractiveObject) anIO = it.Value(); CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() ); @@ -1067,9 +1069,10 @@ VisuGUI_Module { QApplication::setOverrideCursor(Qt::waitCursor); - SALOME_ListIO aList; LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this); - aSelectionMgr->selectedObjects(aList); + SALOME_ListIO aSel, aList; + aSelectionMgr->selectedObjects(aSel); + extractContainers(aSel, aList); for(SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next()){ Handle(SALOME_InteractiveObject) anIO = it.Value(); diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index ab12f335..7984a698 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -68,7 +68,7 @@ namespace VISU INFOS(exc.what()); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": pammy1 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); aPrs3d->RemoveActors(); diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index 95e13191..ccb1c573 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -27,6 +27,7 @@ #include "VisuGUI_ScalarMapOnDeformedShapeDlg.h" #include "VisuGUI_Tools.h" +#include "VISU_Result_i.hh" #include "VISU_ScalarMapOnDeformedShape_i.hh" #include "VISU_ScalarMapOnDeformedShapePL.hxx" #include "SalomeApp_Module.h" @@ -153,7 +154,10 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDe myTimeStampsCombo->setDisabled(isAnim); QString aFieldName(thePrs->GetScalarFieldName()); - float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetScalarIteration()); + float aIterFloat = GetFloatValueOfTimeStamp(thePrs->GetMeshName().c_str(), + thePrs->GetScalarFieldName().c_str(), + thePrs->GetScalarIteration(), + thePrs->GetScalarEntity()); QString aIteration(QString("%1").arg(aIterFloat)); if (myMeshFieldsTimes.size() == 0) @@ -213,7 +217,11 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject (VISU::ScalarMapOnDe } TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()]; TFE aKey(aFieldName.latin1(),anEntity); - aFieldsMap[aKey][aTimeIter.toInt()] = GetFloatValueOfTimeStamp(aTimeIter.toInt()); + aFieldsMap[aKey][aTimeIter.toInt()] = + GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(), + aFieldName.latin1(), + aTimeIter.toInt(), + anEntity); } } } @@ -369,12 +377,28 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){ myScalarPane->setRange(aDoubleRange[0],aDoubleRange[1],myScalarPane->isIRange()); } -float VisuGUI_ScalarMapOnDeformedShapeDlg::GetFloatValueOfTimeStamp(int theIter){ +float VisuGUI_ScalarMapOnDeformedShapeDlg::GetFloatValueOfTimeStamp(const char* theMeshName, + const char* theFieldName, + const int theIter, + const VISU::TEntity theEntity){ float ret=1; - VISU::PField aField = myPrs->GetField(); + VISU::Result_i* theResult = myPrs->GetResult(); + VISU::PField aField = theResult->GetInput()->GetField(theMeshName,theEntity,theFieldName); + if(!aField) return ret; VISU::TValField& aValField = aField->myValField; - VISU::PValForTime aValForTime = aValField.find(theIter)->second; - if(aValForTime) + VISU::TValField::const_iterator aIter = aValField.find(theIter); + if(aIter != aValField.end()){ + VISU::PValForTime aValForTime = aIter->second; ret = float(aValForTime->myTime.first); + } else { + if(MYDEBUG){ + cout << "Where are no aValForTime with iteration:"<first << ","; + cout << endl; + } + } return ret; } diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h index c49a3de1..bf588c9e 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h @@ -102,7 +102,10 @@ protected: void SetScalarField(); void AddAllFieldNames(); void AddAllTimes(const QString& theFieldName); - float GetFloatValueOfTimeStamp(int iteration); + float GetFloatValueOfTimeStamp(const char* theMeshName, + const char* theFieldName, + const int theIteration, + const VISU::TEntity theEntity); }; #endif // VISUGUI_DEFORMEDSHAPEDLS_H diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 970ef604..978a4c24 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -760,7 +760,7 @@ namespace VISU }catch(std::exception& exc){ SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy2 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); } QApplication::restoreOverrideCursor(); @@ -798,7 +798,7 @@ namespace VISU INFOS(exc.what()); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy3 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); } } else if (theDispOnly) { @@ -884,7 +884,7 @@ namespace VISU QApplication::restoreOverrideCursor(); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": pammy4 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); thePrs->RemoveActors(); @@ -1276,7 +1276,7 @@ namespace VISU INFOS(exc.what()); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy5 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); } } diff --git a/src/VISUGUI/VisuGUI_ViewTools.h b/src/VISUGUI/VisuGUI_ViewTools.h index d70ee509..f10bf63e 100644 --- a/src/VISUGUI/VisuGUI_ViewTools.h +++ b/src/VISUGUI/VisuGUI_ViewTools.h @@ -113,7 +113,7 @@ namespace VISU INFOS(exc.what()); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_CREATE_ACTOR") + ": pammy6 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); } } @@ -148,7 +148,7 @@ namespace VISU QApplication::restoreOverrideCursor(); SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"), - QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": pammy7 " + QObject::tr(exc.what()), + QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(exc.what()), QObject::tr("BUT_OK")); thePrs->RemoveActors(); diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index bf51d9b3..ff03f9f2 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -42,6 +42,7 @@ #include "VISU_Plot3D_i.hh" #include "VISU_Table_i.hh" #include "VISU_TimeAnimation.h" +#include "VISU_ScalarMapOnDeformedShape_i.hh" #include "VISU_Actor.h" @@ -200,6 +201,7 @@ namespace VISU Storable::Registry(Table_i::myComment.c_str(),&(Table_i::Restore)); Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore)); Storable::Registry(Container_i::myComment.c_str(),&(Container_i::Restore)); + Storable::Registry(ScalarMapOnDeformedShape_i::myComment.c_str(),&(Restore)); } @@ -668,6 +670,15 @@ namespace VISU return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } + ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); + } + Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index d1ab5424..1f4f9212 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -178,6 +178,13 @@ namespace VISU CORBA::Double theIteration); virtual + ScalarMapOnDeformedShape_ptr + ScalarMapOnDeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index 3246f8f2..9b8868e3 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -53,6 +53,9 @@ int VISU::ScalarMapOnDeformedShape_i::IsPossible(Result_i* theResult, const char try{ aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false); if(isMemoryCheck && aResult){ + const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName); + if(aField->myNbComp <= 1) + return false; float aSize = INCMEMORY* theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration); aResult = VISU_PipeLine::CheckAvailableMemory(aSize); -- 2.39.2