]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
package update
authorsrn <srn@opencascade.com>
Wed, 8 Feb 2006 09:27:42 +0000 (09:27 +0000)
committersrn <srn@opencascade.com>
Wed, 8 Feb 2006 09:27:42 +0000 (09:27 +0000)
src/VISUGUI/VisuGUI_Module.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_ViewTools.h
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc

index 2ae2cea1c0830a6c8572f01880adf3c3b49bd256..f496c5dcd25e2f6202f6c03e98fa634cf4f27b3e 100644 (file)
@@ -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();
index ab12f3353e6f311635306d3a7a7743169fd845c6..7984a698872fe2e76323cec325b3bfd8c56adbb7 100644 (file)
@@ -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();
index 95e131915dd4d58c8c7270569c8169292d05e068..ccb1c5737824a1ab136e4e6811ed7e57ab10e5f0 100644 (file)
@@ -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:"<<theIter<<endl;
+      cout << "\tThe possible interations is aValField.keys():";
+      VISU::TValField::const_iterator aTmp = aValField.begin();
+      for(;aTmp != aValField.end(); aTmp++)
+       cout << aTmp->first << ",";
+      cout << endl;
+    }
+  }
   return ret;
 }
index c49a3de178e1e6779f2c6c63fd64ae227e70da5a..bf588c9e429e2f62e9f3c7e40261a65ae30ffdb5 100644 (file)
@@ -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
index 970ef60407ad80e3aac9933503840f11fce59d34..978a4c24f0c010ad7cf0e2e503b9de443cd9308c 100644 (file)
@@ -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"));
       }
     }
index d70ee509a0c5ebbe4da74e8a0b54c2a90b181410..f10bf63e9a5ee9e442e82c94967aa191dd359286 100644 (file)
@@ -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();
index bf51d9b34e449fb8c4741f20949d88aa9af68e45..ff03f9f2b308cc3d799fbdef92e285ac6e3f781b 100644 (file)
@@ -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<ScalarMapOnDeformedShape_i>));
   }
 
 
@@ -668,6 +670,15 @@ namespace VISU
     return Prs3dOnField<VISU::DeformedShape_i>(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<VISU::ScalarMapOnDeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+  }
+  
   Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult,
                                         const char* theMeshName,
                                         VISU::Entity theEntity,
index d1ab542439b44692d4c010201fe7bffe3d85db4b..1f4f921268ae509bbeb556e10bd70889a75a516a 100644 (file)
@@ -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, 
index 3246f8f2997de4061a96aaa81cec0540b35bba70..9b8868e34f352262ec469a5c9453892e8edd94bb 100644 (file)
@@ -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);