From: apo Date: Wed, 8 Feb 2006 07:27:31 +0000 (+0000) Subject: Fix for Bug IPAL8945 X-Git-Tag: V3_2_0a1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b71c6ea9accedba54232b328797204d3e2a31673;p=modules%2Fvisu.git Fix for Bug IPAL8945 It is impossible to create "Animation" using "Cut Lines" presentation. --- diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index dd40bb95..476721a5 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -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(myModule,aData); break; + case TCUTLINES_ITEM: //Cut Lines + c.suspend(); + EditPrs(myModule,aData); + break; case TPLOT3D_ITEM: //Plot 3D c.suspend(); EditPrs(myModule,aData); diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index ff691ec5..c1db8093 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -271,6 +271,16 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) { myTimeMin, myTimeMax); break; + case VISU::TCUTLINES: // Cut Lines + GeneratePresentations(myStudy, + aData, + aResult, + isRangeDefined(), + myMinVal, + myMaxVal, + myTimeMin, + myTimeMax); + break; case VISU::TPLOT3D: // Plot3d GeneratePresentations(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())