]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL8945
authorapo <apo@opencascade.com>
Wed, 8 Feb 2006 07:27:31 +0000 (07:27 +0000)
committerapo <apo@opencascade.com>
Wed, 8 Feb 2006 07:27:31 +0000 (07:27 +0000)
  It is impossible to create "Animation" using "Cut Lines" presentation.

src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.cxx

index dd40bb9588f89944be9f1e1ec4a6faecec1413eb..476721a51807548745b242d04ec3a156a46d5e19 100644 (file)
@@ -14,6 +14,7 @@
 #include "VisuGUI_Tools.h"
 #include "VisuGUI_DeformedShapeDlg.h"
 #include "VisuGUI_CutPlanesDlg.h"
+#include "VisuGUI_CutLinesDlg.h"
 #include "VisuGUI_Plot3DDlg.h"
 #include "VisuGUI_VectorsDlg.h"
 #include "VisuGUI_IsoSurfacesDlg.h"
@@ -561,12 +562,13 @@ enum PrsComboItem {
   TSCALARMAP_ITEM     = 0, // VISU::TSCALARMAP
   TISOSURFACE_ITEM    = 1, // VISU::TISOSURFACE
   TCUTPLANES_ITEM     = 2, // VISU::TCUTPLANES
-  TPLOT3D_ITEM        = 3, // VISU::TPLOT3D
-  TDEFORMEDSHAPE_ITEM = 4, // VISU::TDEFORMEDSHAPE
-  TVECTORS_ITEM       = 5, // VISU::TVECTORS
-  TSTREAMLINES_ITEM   = 6, // VISU::TSTREAMLINES
-  TGAUSSPOINTS_ITEM   = 7, // VISU::TGAUSSPOINTS
-  TSCALARMAPONDEFORMEDSHAPE_ITEM = 8 // VISU::TSCALARMAPONDEFORMEDSHAPE
+  TCUTLINES_ITEM      = 3, // VISU::TCUTLINES
+  TPLOT3D_ITEM        = 4, // VISU::TPLOT3D
+  TDEFORMEDSHAPE_ITEM = 5, // VISU::TDEFORMEDSHAPE
+  TVECTORS_ITEM       = 6, // VISU::TVECTORS
+  TSTREAMLINES_ITEM   = 7, // VISU::TSTREAMLINES
+  TGAUSSPOINTS_ITEM   = 8, // VISU::TGAUSSPOINTS
+  TSCALARMAPONDEFORMEDSHAPE_ITEM = 9 // VISU::TSCALARMAPONDEFORMEDSHAPE
 };
 
 //------------------------------------------------------------------------
@@ -590,34 +592,37 @@ void SetupDlg::onFieldChange (int theIndex)
   myTypeId2ComboId[TCUTPLANES_ITEM] = myComboId2TypeId.size();
   myComboId2TypeId.push_back(TCUTPLANES_ITEM);;
 
-  myTypeCombo->insertItem("Plot 3D");      // item 3
+  myTypeCombo->insertItem("Cut Lines");   // item 3
+  myTypeId2ComboId[TCUTLINES_ITEM] = myComboId2TypeId.size();
+  myComboId2TypeId.push_back(TCUTLINES_ITEM);;
+
+  myTypeCombo->insertItem("Plot 3D");      // item 4
   myTypeId2ComboId[TPLOT3D_ITEM] = myComboId2TypeId.size();
   myComboId2TypeId.push_back(TPLOT3D_ITEM);;
 
   _PTR(SObject) aSObject = aData.myField;
   long aNumComp = VISU::getValue(aSObject, "myNumComponent").toLong();
   if (aNumComp > 1) {
-    myTypeCombo->insertItem("Deformed Shape"); // item 4
+    myTypeCombo->insertItem("Deformed Shape"); // item 5
     myTypeId2ComboId[TDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TDEFORMEDSHAPE_ITEM);;
 
-    myTypeCombo->insertItem("Vectors");        // item 5
+    myTypeCombo->insertItem("Vectors");        // item 6
     myTypeId2ComboId[TVECTORS_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TVECTORS_ITEM);;
 
-    myTypeCombo->insertItem("Stream Lines");   // item 6
+    myTypeCombo->insertItem("Stream Lines");   // item 7
     myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
 
-    myTypeCombo->insertItem("Scalar map on Deformed shape");   // item 8
+    myTypeCombo->insertItem("Scalar map on Deformed shape");   // item 9
     myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TSCALARMAPONDEFORMEDSHAPE_ITEM);;
-    
   }
 
   long anEntityId = VISU::getValue(aSObject, "myEntityId").toLong();
   if(anEntityId == VISU::CELL){
-    myTypeCombo->insertItem("Gauss Points");   // item 7
+    myTypeCombo->insertItem("Gauss Points");   // item 8
     myTypeId2ComboId[TGAUSSPOINTS_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TGAUSSPOINTS_ITEM);;
   }
@@ -632,6 +637,9 @@ void SetupDlg::onFieldChange (int theIndex)
   case VISU::TCUTPLANES: //Cut Planes
     myTypeCombo->setCurrentItem(myTypeId2ComboId[TCUTPLANES_ITEM]);
     break;
+  case VISU::TCUTLINES: //Cut Lines
+    myTypeCombo->setCurrentItem(myTypeId2ComboId[TCUTLINES_ITEM]);
+    break;
   case VISU::TPLOT3D: //Plot 3D
     myTypeCombo->setCurrentItem(myTypeId2ComboId[TPLOT3D_ITEM]);
     break;
@@ -669,6 +677,9 @@ void SetupDlg::onTypeChanged (int theIndex)
   case TCUTPLANES_ITEM: //Cut Planes
     aData.myPrsType = VISU::TCUTPLANES;
     break;
+  case TCUTLINES_ITEM: //Cut Lines
+    aData.myPrsType = VISU::TCUTLINES;
+    break;
   case TPLOT3D_ITEM: //Plot 3D
     aData.myPrsType = VISU::TPLOT3D;
     break;
@@ -733,6 +744,10 @@ void SetupDlg::onPreferencesDlg()
     c.suspend();
     EditPrs<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg>(myModule,aData);
     break;
+  case TCUTLINES_ITEM: //Cut Lines
+    c.suspend();
+    EditPrs<VISU::CutLines_i,VisuGUI_CutLinesDlg>(myModule,aData);
+    break;
   case TPLOT3D_ITEM: //Plot 3D
     c.suspend();
     EditPrs<VISU::Plot3D_i,VisuGUI_Plot3DDlg>(myModule,aData);
index ff691ec51f9ac4857b2cf5225afb44e8f67f4837..c1db8093ddd405f3201c51f57c8751832da4c621 100644 (file)
@@ -271,6 +271,16 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                                       myTimeMin,
                                       myTimeMax);
     break;
+  case VISU::TCUTLINES: // Cut Lines
+    GeneratePresentations<CutLines_i>(myStudy,
+                                     aData,
+                                     aResult,
+                                     isRangeDefined(),
+                                     myMinVal,
+                                     myMaxVal,
+                                     myTimeMin,
+                                     myTimeMax);
+    break;
   case VISU::TPLOT3D: // Plot3d
     GeneratePresentations<Plot3D_i>(myStudy,
                                    aData,
@@ -721,6 +731,9 @@ std::string GetPresentationComment (VISU::VISUType thePrsType)
   case VISU::TCUTPLANES:
     aPrsCmt = VISU::CutPlanes_i::myComment;
     break;
+  case VISU::TCUTLINES:
+    aPrsCmt = VISU::CutLines_i::myComment;
+    break;
   case VISU::TPLOT3D:
     aPrsCmt = VISU::Plot3D_i::myComment;
     break;
@@ -895,6 +908,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
       aData.myPrsType = VISU::TISOSURFACE;
     else if (strName == VISU::CutPlanes_i::myComment.c_str())
       aData.myPrsType = VISU::TCUTPLANES;
+    else if (strName == VISU::CutLines_i::myComment.c_str())
+      aData.myPrsType = VISU::TCUTLINES;
     else if (strName == VISU::Plot3D_i::myComment.c_str())
       aData.myPrsType = VISU::TPLOT3D;
     else if (strName == VISU::DeformedShape_i::myComment.c_str())