//------------------------------------------------------------------------
//------------------------------------------------------------------------
//------------------------------------------------------------------------
-SetupDlg::SetupDlg (VisuGUI* theModule, VISU_TimeAnimation* theAnimator)
- : QDialog(VISU::GetDesktop(theModule), "SetupDlg", true, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myModule(theModule)
+SetupDlg::SetupDlg (QWidget* theParent,
+ VisuGUI* theModule,
+ VISU_TimeAnimation* theAnimator) :
+ QDialog(theParent,
+ "SetupDlg",
+ true,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myAnimator(theAnimator),
+ myModule(theModule)
{
setCaption("Setup Animation");
setSizeGripEnabled( TRUE );
- myAnimator = theAnimator;
QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6);
aMainLayout->setSpacing(5);
-
QFrame* aRangeGrp = new QFrame(this);
QGridLayout* aRangeLayout = new QGridLayout( aRangeGrp );
aRangeLayout->setSpacing( 6 );
{
FieldData& aData = myAnimator->getFieldData(theIndex);
myTypeCombo->clear();
+ myTypeId2ComboId.clear();
myComboId2TypeId.clear();
// ATTENTION: append items in the same order like it is done in the PrsComboItem enumeration
myTypeCombo->insertItem("Scalar Map"); // item 0
+ myTypeId2ComboId[TSCALARMAP_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TSCALARMAP_ITEM);;
myTypeCombo->insertItem("Iso Surfaces"); // item 1
+ myTypeId2ComboId[TISOSURFACE_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TISOSURFACE_ITEM);;
myTypeCombo->insertItem("Cut Planes"); // item 2
+ myTypeId2ComboId[TCUTPLANES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TCUTPLANES_ITEM);;
myTypeCombo->insertItem("Plot 3D"); // item 3
+ 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
+ myTypeId2ComboId[TDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TDEFORMEDSHAPE_ITEM);;
myTypeCombo->insertItem("Vectors"); // item 5
+ myTypeId2ComboId[TVECTORS_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TVECTORS_ITEM);;
myTypeCombo->insertItem("Stream Lines"); // item 6
+ myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
}
long anEntityId = VISU::getValue(aSObject, "myEntityId").toLong();
if(anEntityId == VISU::CELL){
myTypeCombo->insertItem("Gauss Points"); // item 7
+ myTypeId2ComboId[TGAUSSPOINTS_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TGAUSSPOINTS_ITEM);;
}
switch (aData.myPrsType) {
case VISU::TSCALARMAP: //Scalar Map
- myTypeCombo->setCurrentItem(TSCALARMAP_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAP_ITEM]);
break;
case VISU::TISOSURFACE: //Iso Surfaces
- myTypeCombo->setCurrentItem(TISOSURFACE_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TISOSURFACE_ITEM]);
break;
case VISU::TCUTPLANES: //Cut Planes
- myTypeCombo->setCurrentItem(TCUTPLANES_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TCUTPLANES_ITEM]);
break;
case VISU::TPLOT3D: //Plot 3D
- myTypeCombo->setCurrentItem(TPLOT3D_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TPLOT3D_ITEM]);
break;
case VISU::TDEFORMEDSHAPE: //Deformed Shape
- myTypeCombo->setCurrentItem(TDEFORMEDSHAPE_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
break;
case VISU::TVECTORS: //Vectors
- myTypeCombo->setCurrentItem(TVECTORS_ITEM);
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
break;
case VISU::TSTREAMLINES: //Stream Lines
- myTypeCombo->setCurrentItem(TSTREAMLINES_ITEM);
- aData.myPrsType = VISU::TSTREAMLINES;
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TSTREAMLINES_ITEM]);
break;
case VISU::TGAUSSPOINTS: //Gauss Points
- myTypeCombo->setCurrentItem(TGAUSSPOINTS_ITEM);
- aData.myPrsType = VISU::TGAUSSPOINTS;
+ myTypeCombo->setCurrentItem(myTypeId2ComboId[TGAUSSPOINTS_ITEM]);
break;
}
//myPropBtn->setEnabled(aData.myPrsType != VISU::TSCALARMAP);
static QPixmap MYpausePixmap(pauseIco);
-VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy)
- : QDialog(VISU::GetDesktop(theModule), "VisuGUI_TimeAnimationDlg", false, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- myModule(theModule),
- myStudy(theStudy)
+VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy) :
+ QDialog(VISU::GetDesktop(theModule),
+ "VisuGUI_TimeAnimationDlg",
+ false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
+ myModule(theModule),
+ myStudy(theStudy),
+ mySetupDlg(NULL)
{
setCaption("Animation");
setSizeGripEnabled( TRUE );
myAnimator->clearView();
}
+//------------------------------------------------------------------------
+void VisuGUI_TimeAnimationDlg::showEvent(QShowEvent* theEvent)
+{
+ mySetupDlg = new SetupDlg(this,myModule, myAnimator);
+}
+
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
{
//------------------------------------------------------------------------
void VisuGUI_TimeAnimationDlg::onSetupDlg()
{
- if (myAnimator->getNbFrames() > 0) myAnimator->firstFrame();
- SetupDlg* aDlg = new SetupDlg (myModule, myAnimator);
- aDlg->exec();
+ if (myAnimator->getNbFrames() > 0)
+ myAnimator->firstFrame();
+ mySetupDlg->exec();
myPlayFrame->setEnabled(false);
- delete aDlg;
}
//------------------------------------------------------------------------