double aMaxTime = myAnimator->getMaxTime();
double aMinTime = myAnimator->getMinTime();
- double aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+ double aStep;
+ if ( myAnimator->getAnimationMode() == 0 )
+ aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+ else { // consecutive animation mode
+ std::pair<int,long> aLastFieldFrame(myAnimator->getNbFields() - 1,
+ myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1);
+ aStep = (aMaxTime - aMinTime) / myAnimator->getAbsoluteFrameNumber(aLastFieldFrame);
+ }
QLabel* aMinLbl = new QLabel("From", aRangeGrp);
aMinLbl->setEnabled(myUseRangeChk->isChecked());
// Find names of fields
for (int i = 0; i < myAnimator->getNbFields(); i++) {
_PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
- aFieldNames.append(VISU::getValue(aSO, "myName"));
+ QString aFieldName(VISU::getValue(aSO, "myName"));
+ if ( myAnimator->getAnimationMode() == 0 )
+ aFieldNames.append(aFieldName);
+ else if ( myAnimator->getAnimationMode() == 1 ) {
+ QString aFileName(VISU::getValue(aSO->GetFather()->GetFather()->GetFather(),"myInitFileName"));
+ aFileName = aFileName.right(aFileName.length() - (aFileName.findRev("/") + 1));
+ aFieldNames.append(aFileName + QString(" : ") + aFieldName);
+ }
}
myFieldLst->insertStringList(aFieldNames);
- myFieldLst->setSelected(0, true);
- connect( myFieldLst, SIGNAL( highlighted(int) ),
- this, SLOT( onFieldChange(int) ) );
-
-
- QVBox* aSetupBox = new QVBox(aPropFrame);
+
+ if ( myAnimator->getAnimationMode() == 0 ) {
+ myFieldLst->setSelected(0, true);
+ connect( myFieldLst, SIGNAL( highlighted(int) ),
+ this, SLOT( onFieldChange(int) ) );
+ }
+ else if ( myAnimator->getAnimationMode() == 1 )
+ myFieldLst->setSelectionMode(QListBox::NoSelection);
+
+ QVBox* aSetupBox = new QVBox(aPropFrame);
aSetupBox->setSpacing(5);
QVGroupBox* aPropBox = new QVGroupBox("Properties", aSetupBox);
connect( myPropBtn, SIGNAL( clicked() ),
this, SLOT( onPreferencesDlg() ) );
- if (myAnimator->getNbFields() > 1) {
+ if (myAnimator->getNbFields() > 1 && myAnimator->getAnimationMode() == 0) {
myArrangeBtn = new QPushButton("Arrange...", aSetupBox);
connect( myArrangeBtn, SIGNAL( clicked() ), this, SLOT( onArrangeDlg() ) );
}
//------------------------------------------------------------------------
void SetupDlg::onFieldChange (int theIndex)
{
- FieldData& aData = myAnimator->getFieldData(theIndex);
myTypeCombo->clear();
myTypeId2ComboId.clear();
myComboId2TypeId.clear();
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) {
+ bool anEnableItems = false;
+ bool anEnableGP = false;
+ VISU::VISUType aPrsType;
+ if ( myAnimator->getAnimationMode() == 0 ) { // parallel animation mode
+
+ FieldData& aData = myAnimator->getFieldData(theIndex);
+ _PTR(SObject) aSObject = aData.myField;
+ long aNumComp = VISU::getValue(aSObject, "myNumComponent").toLong();
+ anEnableItems = (aNumComp > 1);
+
+ long anEntityId = VISU::getValue(aSObject, "myEntityId").toLong();
+ anEnableGP = (anEntityId == VISU::CELL);
+
+ aPrsType = aData.myPrsType;
+
+ }
+ else if ( myAnimator->getAnimationMode() == 1 ) { // consecutive animation mode
+
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ _PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
+ long aNumComp = VISU::getValue(aSO, "myNumComponent").toLong();
+ anEnableItems = (aNumComp > 1);
+
+ long anEntityId = VISU::getValue(aSO, "myEntityId").toLong();
+ anEnableGP = (anEntityId == VISU::CELL);
+
+ if ( !anEnableItems && !anEnableGP ) break;
+ }
+
+ aPrsType = myAnimator->getFieldData(0).myPrsType;
+
+ }
+
+ if (anEnableItems) {
myTypeCombo->insertItem("Deformed Shape"); // item 5
myTypeId2ComboId[TDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TDEFORMEDSHAPE_ITEM);;
myComboId2TypeId.push_back(TSCALARMAPONDEFORMEDSHAPE_ITEM);;
}
- long anEntityId = VISU::getValue(aSObject, "myEntityId").toLong();
- if(anEntityId == VISU::CELL){
+ if(anEnableGP){
myTypeCombo->insertItem("Gauss Points"); // item 8
myTypeId2ComboId[TGAUSSPOINTS_ITEM] = myComboId2TypeId.size();
myComboId2TypeId.push_back(TGAUSSPOINTS_ITEM);;
}
- switch (aData.myPrsType) {
+ switch (aPrsType) {
case VISU::TSCALARMAP: //Scalar Map
myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAP_ITEM]);
break;
//------------------------------------------------------------------------
void SetupDlg::onTypeChanged (int theIndex)
{
- FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
int aType = myComboId2TypeId[theIndex];
- switch (aType) {
- case TSCALARMAP_ITEM: //Scalar Map
- aData.myPrsType = VISU::TSCALARMAP;
- break;
- case TISOSURFACE_ITEM: //Iso Surfaces
- aData.myPrsType = VISU::TISOSURFACE;
- break;
- 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;
- case TDEFORMEDSHAPE_ITEM: //Deformed Shape
- aData.myPrsType = VISU::TDEFORMEDSHAPE;
- break;
- case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
- aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
- break;
- case TVECTORS_ITEM: //Vectors
- aData.myPrsType = VISU::TVECTORS;
- break;
- case TSTREAMLINES_ITEM: //Stream Lines
- aData.myPrsType = VISU::TSTREAMLINES;
- break;
- case TGAUSSPOINTS_ITEM: //Gauss Points
- aData.myPrsType = VISU::TGAUSSPOINTS;
- break;
+
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ FieldData& aData = ( myAnimator->getAnimationMode() == 0 ) ?
+ myAnimator->getFieldData(myFieldLst->currentItem()) :
+ myAnimator->getFieldData(i);
+
+ switch (aType) {
+ case TSCALARMAP_ITEM: //Scalar Map
+ aData.myPrsType = VISU::TSCALARMAP;
+ break;
+ case TISOSURFACE_ITEM: //Iso Surfaces
+ aData.myPrsType = VISU::TISOSURFACE;
+ break;
+ 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;
+ case TDEFORMEDSHAPE_ITEM: //Deformed Shape
+ aData.myPrsType = VISU::TDEFORMEDSHAPE;
+ break;
+ case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
+ aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
+ break;
+ case TVECTORS_ITEM: //Vectors
+ aData.myPrsType = VISU::TVECTORS;
+ break;
+ case TSTREAMLINES_ITEM: //Stream Lines
+ aData.myPrsType = VISU::TSTREAMLINES;
+ break;
+ case TGAUSSPOINTS_ITEM: //Gauss Points
+ aData.myPrsType = VISU::TGAUSSPOINTS;
+ break;
+ }
+ myAnimator->clearData(aData);
+
+ if ( myAnimator->getAnimationMode() == 0 ) // parallel animation mode
+ break;
}
- myAnimator->clearData(aData);
//myPropBtn->setEnabled(aData.myPrsType != VISU::TSCALARMAP);
//myAnimator->generatePresentations(myFieldLst->currentItem());
}
template<class TPrs3d, class TDialog>
void
EditPrs(VisuGUI* theModule,
- FieldData& theData)
+ FieldData& theData,
+ VISU_TimeAnimation* theAnimator)
{
TDialog* aDlg = new TDialog(theModule);
aDlg->initFromPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[0]));
- if (aDlg->exec())
+ if (aDlg->exec()) {
for (int i = 0; i < theData.myNbFrames; i++)
aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[i]));
+ if ( theAnimator->getAnimationMode() == 1 ) {
+ for (int i = 1; i < theAnimator->getNbFields(); i++) {
+ for (int j = 0; j < theAnimator->getFieldData(i).myNbFrames; j++)
+ aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(theAnimator->getFieldData(i).myPrs[j]));
+ }
+ }
+ }
delete aDlg;
}
}
void SetupDlg::onPreferencesDlg()
{
SUIT_OverrideCursor c;
- FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
+
+ int id = ( myAnimator->getAnimationMode() == 0 ) ? myFieldLst->currentItem() : 0;
+ FieldData& aData = myAnimator->getFieldData(id);
if (aData.myPrs.empty())
- myAnimator->generatePresentations(myFieldLst->currentItem());
+ myAnimator->generatePresentations(id);
+
+ if ( myAnimator->getAnimationMode() == 1 ) {
+ for (int i = 0; i < myAnimator->getNbFields(); i++) {
+ if ( i != id && myAnimator->getFieldData(i).myPrs.empty() ) myAnimator->generatePresentations(i);
+ }
+ }
if(!aData.myNbFrames || !aData.myPrs[0]){
QApplication::restoreOverrideCursor();
switch (aType) {
case TSCALARMAP_ITEM: //Scalar Map
c.suspend();
- EditPrs<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg>(myModule,aData);
+ EditPrs<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg>(myModule,aData,myAnimator);
break;
case TISOSURFACE_ITEM: //Iso Surfaces
c.suspend();
- EditPrs<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg>(myModule,aData);
+ EditPrs<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg>(myModule,aData,myAnimator);
break;
case TCUTPLANES_ITEM: //Cut Planes
c.suspend();
- EditPrs<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg>(myModule,aData);
+ EditPrs<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg>(myModule,aData,myAnimator);
break;
case TCUTLINES_ITEM: //Cut Lines
c.suspend();
- EditPrs<VISU::CutLines_i,VisuGUI_CutLinesDlg>(myModule,aData);
+ EditPrs<VISU::CutLines_i,VisuGUI_CutLinesDlg>(myModule,aData,myAnimator);
break;
case TPLOT3D_ITEM: //Plot 3D
c.suspend();
- EditPrs<VISU::Plot3D_i,VisuGUI_Plot3DDlg>(myModule,aData);
+ EditPrs<VISU::Plot3D_i,VisuGUI_Plot3DDlg>(myModule,aData,myAnimator);
break;
case TDEFORMEDSHAPE_ITEM: //Deformed Shape
c.suspend();
- EditPrs<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg>(myModule,aData);
+ EditPrs<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg>(myModule,aData,myAnimator);
break;
case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
c.suspend();
break;
case TVECTORS_ITEM: //Vectors
c.suspend();
- EditPrs<VISU::Vectors_i,VisuGUI_VectorsDlg>(myModule,aData);
+ EditPrs<VISU::Vectors_i,VisuGUI_VectorsDlg>(myModule,aData,myAnimator);
break;
case TSTREAMLINES_ITEM: //Stream Lines
c.suspend();
- EditPrs<VISU::StreamLines_i,VisuGUI_StreamLinesDlg>(myModule,aData);
+ EditPrs<VISU::StreamLines_i,VisuGUI_StreamLinesDlg>(myModule,aData,myAnimator);
break;
case TGAUSSPOINTS_ITEM: //Gauss Points
c.suspend();
- EditPrs<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg>(myModule,aData);
+ EditPrs<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg>(myModule,aData,myAnimator);
break;
}
}
static QPixmap MYpausePixmap(pauseIco);
-VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy) :
+VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy, int theMode) :
QDialog(VISU::GetDesktop(theModule),
"VisuGUI_TimeAnimationDlg",
false,
myStudy(theStudy),
mySetupDlg(NULL)
{
- setCaption("Animation");
+ if ( theMode == 0 )
+ setCaption("Parallel Animation");
+ else if ( theMode == 1 )
+ setCaption("Consecutive Animation");
setSizeGripEnabled( TRUE );
isClosing = false;
myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
connect(myAnimator, SIGNAL(frameChanged(long, double)), this, SLOT(onExecution(long, double)));
connect(myAnimator, SIGNAL(stopped()), this, SLOT(onStop()));
+ myAnimator->setAnimationMode(theMode);
QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 6);
aMainLayout->setSpacing(5);
{
myAnimator->restoreFromStudy(theAnimation);
mySaveBtn->setEnabled(myAnimator->isSavedInStudy());
+ if ( myAnimator->getAnimationMode() == 1 )
+ setCaption("Consecutive Animation");
}
//------------------------------------------------------------------------
connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
}
+ myAnimationMode = 0;
myTimeMinVal = 0;
myTimeMaxVal = 0;
myTimeMin = 0;
return false;
aNewData.myNbTimes = VISU::Storable::FindValue(aMap,"myNbTimeStamps").toLong();
- if ( aNewData.myNbTimes < 2 )
- return false;
- if ( !myFieldsLst.isEmpty() && myFieldsLst.first().myNbTimes != aNewData.myNbTimes )
- return false;
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( aNewData.myNbTimes < 2 )
+ return false;
+ if ( !myFieldsLst.isEmpty() && myFieldsLst.first().myNbTimes != aNewData.myNbTimes )
+ return false;
+ if ( myFieldsLst.isEmpty() )
+ myFieldsAbsFrames.push_back(aNewData.myNbTimes);
+ }
+ else { // consecutive animation mode
+ if ( aNewData.myNbTimes < 1 )
+ return false;
+
+ long aNumCompCurr = VISU::Storable::FindValue(aMap, "myNumComponent").toLong();
+ if ( !myFieldsLst.isEmpty() ) {
+ VISU::Storable::TRestoringMap aFMap = getMapOfValue(myFieldsLst.first().myField);
+ long aNumComp = VISU::Storable::FindValue(aFMap, "myNumComponent").toLong();
+ if ( aNumCompCurr != aNumComp )
+ return false;
+ }
+ if ( !myFieldsLst.isEmpty() )
+ myFieldsAbsFrames.push_back(myFieldsAbsFrames.back() + aNewData.myNbTimes);
+ else
+ myFieldsAbsFrames.push_back(aNewData.myNbTimes);
+ }
+
myFieldsLst.append(aNewData);
-
+
//find Min/Max timestamps
- if ((myTimeMin == 0) && (myTimeMax == 0)) {
- _PTR(ChildIterator) anIter = myStudy->NewChildIterator(theField);
- anIter->Next(); // First is reference on support
+ _PTR(ChildIterator) anIter = myStudy->NewChildIterator(theField);
+ anIter->Next(); // First is reference on support
+ if ( myFieldsLst.size() == 1 ) { // the first field
myTimeMin = getTimeValue(anIter->Value());
- for(; anIter->More(); anIter->Next()) {
+ myTimeMax = getTimeValue(anIter->Value());
+ }
+ for(; anIter->More(); anIter->Next()) {
+ if ( myTimeMin > getTimeValue(anIter->Value()) )
+ myTimeMin = getTimeValue(anIter->Value());
+ if ( myTimeMax < getTimeValue(anIter->Value()) )
myTimeMax = getTimeValue(anIter->Value());
- }
}
return true;
//------------------------------------------------------------------------
-void VISU_TimeAnimation::clearData(FieldData& theData) {
+void VISU_TimeAnimation::_clearData(FieldData& theData) {
if (!myView) {
MESSAGE("Viewer is not defined for animation");
return;
myView->update();
}
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::clearData(FieldData& theData) {
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TimeAnimation,FieldData&>
+ (this,&VISU_TimeAnimation::_clearData,theData));
+}
+
namespace
{
//------------------------------------------------------------------------
}
}
}
-
+
+double getMinFieldsValue( QValueList<FieldData>& theFieldsLst )
+{
+ // for consecutive animation mode only
+ double aRes = theFieldsLst[0].myPrs[0]->GetMin();
+ for (int i = 1; i < theFieldsLst.count(); i++) {
+ if ( aRes > theFieldsLst[i].myPrs[0]->GetMin() )
+ aRes = theFieldsLst[i].myPrs[0]->GetMin();
+ }
+ return aRes;
+}
+
+double getMaxFieldsValue( QValueList<FieldData>& theFieldsLst )
+{
+ // for consecutive animation mode only
+ double aRes = theFieldsLst[0].myPrs[0]->GetMax();
+ for (int i = 1; i < theFieldsLst.count(); i++) {
+ if ( aRes < theFieldsLst[i].myPrs[0]->GetMax() )
+ aRes = theFieldsLst[i].myPrs[0]->GetMax();
+ }
+ return aRes;
+}
+
void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
FieldData& aData = myFieldsLst[theFieldNum];
MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
return;
}
+
+ if ( myAnimationMode == 1 ) { // consecutive animation mode
+ if ( isRangeDefined() ) {
+ if ( myFieldsAbsFrames.size() == getNbFields() )
+ myFieldsAbsFrames.clear();
+ if ( theFieldNum > 0 )
+ myFieldsAbsFrames.push_back(myFieldsAbsFrames.back() + aData.myNbFrames);
+ else
+ myFieldsAbsFrames.push_back(aData.myNbFrames);
+ }
+ if ((theFieldNum == getNbFields() - 1) && aData.myPrsType != VISU::TGAUSSPOINTS){
+ double aMin = getMinFieldsValue(myFieldsLst);
+ double aMax = getMaxFieldsValue(myFieldsLst);
+ for (int i = 0; i < getNbFields(); i++)
+ for(long aFrameId = 0; aFrameId < myFieldsLst[i].myNbFrames; aFrameId++)
+ if (aData.myPrsType == VISU::TISOSURFACE) {
+ if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(myFieldsLst[i].myPrs[aFrameId]))
+ aPrs->SetSubRange(aMin, aMax);
+ }
+ else
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(myFieldsLst[i].myPrs[aFrameId]))
+ aPrs->SetRange(aMin, aMax);
+ }
+ }
}
aData.myPrs[j]->SetOffset(aData.myOffset);
aActor = aData.myPrs[j]->CreateActor();
myView->AddActor(aActor);
- if(j == 0)
+ bool condition = ( myAnimationMode == 0 ) ? (j == 0) : (j == 0 && i == 0);
+ if(condition)
aActor->VisibilityOn();
else
aActor->VisibilityOff();
return;
}
stopAnimation();
- if (myFrame < (myFieldsLst[0].myNbFrames-1)) {
+ if (myFrame < getNbFrames() - 1 ) { //(myFieldsLst[0].myNbFrames-1)) {
int i;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ std::pair<int,long> aPair;
+ int aFieldId;
+ long aFrameId;
+
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ visibilityOff(aFieldId, aFrameId);
+ }
myFrame++;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ }
myView->Repaint();
}
}
stopAnimation();
if (myFrame > 0) {
int i;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ std::pair<int,long> aPair;
+ int aFieldId;
+ long aFrameId;
+
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ visibilityOff(aFieldId, aFrameId);
+ }
myFrame--;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ }
myView->Repaint();
}
}
}
stopAnimation();
int i;
- for (i = 0; i < getNbFields(); i++)
- if(!myFieldsLst[i].myActors.empty())
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if(!myFieldsLst[i].myActors.empty())
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
+ }
+ else { //consecutive animation mode
+ std::pair<int,long> aPair = getRelativeFrameNumber(myFrame);
+ int aFieldId = aPair.first;
+ long aFrameId = aPair.second;
+ if(!myFieldsLst[aFieldId].myActors.empty())
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ visibilityOff(aFieldId, aFrameId);
+ }
myFrame = 0;
- for (i = 0; i < getNbFields(); i++)
+
+ int imax;
+ if ( myAnimationMode == 0 ) // parallel animation mode
+ imax = getNbFields();
+ else //consecutive animation mode
+ imax = 1;
+
+ for (i = 0; i < imax; i++)
if(!myFieldsLst[i].myActors.empty())
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+
if(!myFieldsLst[0].myTiming.empty()){
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
myFrame, myFieldsLst[0].myTiming[myFrame]));
}
stopAnimation();
int i;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ std::pair<int,long> aPair;
+ int aFieldId;
+ long aFrameId;
- myFrame = myFieldsLst[0].myNbFrames-1;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ visibilityOff(aFieldId, aFrameId);
+ }
+
+ myFrame = getNbFrames() - 1; //myFieldsLst[0].myNbFrames-1;
+
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ }
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
myView->Repaint();
}
return;
stopAnimation();
int i;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- visibilityOff(i, myFrame);
+ std::pair<int,long> aPair;
+ int aFieldId;
+ long aFrameId;
+
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ visibilityOff(i, myFrame);
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ visibilityOff(aFieldId, aFrameId);
+ }
myFrame = theFrame;
- for (i = 0; i < getNbFields(); i++)
- if (myFieldsLst[i].myActors[myFrame] != 0)
- myFieldsLst[i].myActors[myFrame]->VisibilityOn();
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
- myFrame, myFieldsLst[0].myTiming[myFrame]));
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ for (i = 0; i < getNbFields(); i++)
+ if (myFieldsLst[i].myActors[myFrame] != 0)
+ myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[0].myTiming[myFrame]));
+ }
+ else { //consecutive animation mode
+ aPair = getRelativeFrameNumber(myFrame);
+ aFieldId = aPair.first;
+ aFrameId = aPair.second;
+ if (myFieldsLst[aFieldId].myActors[aFrameId] != 0)
+ myFieldsLst[aFieldId].myActors[aFrameId]->VisibilityOn();
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrameId]));
+ }
+
myView->Repaint();
}
//------------------------------------------------------------------------
CORBA::Long VISU_TimeAnimation::getNbFrames() {
- return (getNbFields() > 0)? myFieldsLst[0].myNbFrames : 0;
+ if ( myAnimationMode == 0 ) // parallel animation mode
+ return (getNbFields() > 0)? myFieldsLst[0].myNbFrames : 0;
+ else //consecutive animation mode
+ return (getNbFields() > 0) ? myFieldsAbsFrames[myFieldsAbsFrames.size()-1] : 0;
}
+//------------------------------------------------------------------------
+long VISU_TimeAnimation::getAbsoluteFrameNumber(std::pair<int,long> theFieldTimeStamp)
+{
+ long aRes = -1;
+ if ( getNbFields() > 0 ) {
+ int aFieldId = theFieldTimeStamp.first;
+ long aFrameNum = theFieldTimeStamp.second + 1;
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( aFrameNum <= myFieldsAbsFrames[0] )
+ aRes = aFrameNum;
+ }
+ else { //consecutive animation mode
+ if ( aFieldId == 0 && aFrameNum <= myFieldsAbsFrames[aFieldId] )
+ aRes = aFrameNum;
+ else if ( aFieldId && aFrameNum <= myFieldsAbsFrames[aFieldId] - myFieldsAbsFrames[aFieldId-1] )
+ aRes = myFieldsAbsFrames[aFieldId-1] + aFrameNum;
+ }
+ }
+ return aRes - 1;
+}
//------------------------------------------------------------------------
-void VISU_TimeAnimation::run()
-{
- if (!myView) {
- MESSAGE("Viewer is not defined for animation");
- return;
+std::pair<int,long> VISU_TimeAnimation::getRelativeFrameNumber(long theFrame)
+{
+ std::pair<int,long> aRes;
+ if ( getNbFields() > 0 && theFrame < getNbFrames() ) {
+ theFrame = theFrame + 1;
+ if ( myAnimationMode == 0 ) { // parallel animation mode
+ aRes.first = 0;
+ aRes.second = theFrame - 1;
+ }
+ else { //consecutive animation mode
+ for (int i = 0, iEnd = myFieldsAbsFrames.size(); i < iEnd; i++)
+ if ( myFieldsAbsFrames[i] >= theFrame ) {
+ aRes.first = i;
+ if ( i == 0 )
+ aRes.second = theFrame - 1;
+ else
+ aRes.second = theFrame-myFieldsAbsFrames[i-1] - 1;
+ break;
+ }
+ }
}
+ return aRes;
+}
+
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QValueList<int>& theIndexList )
+{
double k = 1;
- bool isDumping = !myDumpPath.isEmpty();
double aOneVal = 1;
if (myFieldsLst[0].myNbFrames > 2)
- aOneVal = myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0];
- myFileIndex = 0;
+ aOneVal = ( myTimeMax - myTimeMin ) / getNbFrames();
int aNbFiles = 0;
- QValueList<int> anIndexList;
-
+
while (myIsActive) {
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
myFrame, myFieldsLst[0].myTiming[myFrame]));
}
}
int delay = (int)(1000. * k / mySpeed);
- isDumping = !myDumpPath.isEmpty();
- if (delay < 1 && isDumping) {
+ theIsDumping = !myDumpPath.isEmpty();
+ if (delay < 1 && theIsDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
delay = 1;
}
return;
}
- if (isDumping) {
+ if (theIsDumping) {
// We must unlock mutex for some time before grabbing to allow view updating
msleep(delay);
if (!myIsActive) { // this check was taken from WP_DEB branch
}
if(!(myFieldsLst[0].myField)) // break, if field was deleted.
break;
- if (myDumpFormat.compare("AVI") != 0) {
- QString aFile(myDumpPath);
- QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
- int aPos = -1;
- while ((aPos = aName.find(".")) > -1 )
- aName.replace(aPos, 1, "_");
- aFile += aName;
- aFile += ".";
- aFile += myDumpFormat.lower();
- ProcessEvent(new TMemFun2ArgEvent<SVTK_ViewWindow,bool,const QString&,const QString&>
- (myView,&SVTK_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
- } else {
- QFileInfo aFileInfo(myDumpPath);
- QString aDirPath = aFileInfo.dirPath(true);
- QString aBaseName = aFileInfo.fileName();
-
- switch (myFrame) {
- case 0:
- break;
- case 1:
- myFileIndex += 5;
- break;
- default:
- if (myProportional) {
- double p = (myFieldsLst[0].myTiming[myFrame] -
- myFieldsLst[0].myTiming[myFrame-1]) / aOneVal;
- myFileIndex += (long) (5*p);
- } else {
- myFileIndex += 5;
- }
- }
-
- QString aFile = aDirPath + QDir::separator() + aBaseName;
- aFile += "_";
- aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0');
- aFile += ".jpeg";
-
- /* check image size is divisable 16
- myView->dumpViewToFormat(aFile,"JPEG");
- */
- SUIT_ViewWindow* aView = myView;
- QImage img = ProcessEvent(new TMemFunEvent<SUIT_ViewWindow,QImage>(aView,&SUIT_ViewWindow::dumpView));
- if (!img.isNull()) {
- int width = img.width(); width = (width/16)*16;
- int height = img.height(); height = (height/16)*16;
- QImage copy = img.copy(0, 0, width, height);
- if (copy.save(aFile, "JPEG")) {
- anIndexList.append(myFileIndex);
- aNbFiles++;
- }
- }
- }
+ saveImages( 0, aOneVal, aNbFiles, theIndexList );
}
if (!myIsActive) break;
myFrame = 0;
}
}
+}
+
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::consecutiveAnimation( bool& theIsDumping, QValueList<int>& theIndexList )
+{
+ if ( myFrame >= getNbFrames() - 1 )
+ return;
+
+ double k = 1;
+ double aOneVal = 1;
+ if (myFieldsLst[0].myNbFrames > 2)
+ aOneVal = ( myTimeMax - myTimeMin ) / getNbFrames();
+ int aNbFiles = 0;
+ long aFrame = myFrame;
+
+ while (myIsActive) {
+
+ for (int aFieldId = 0; (aFieldId < getNbFields()) && (myFieldsLst[aFieldId].myField); aFieldId++) {
+
+ FieldData& aData = myFieldsLst[aFieldId];
+ while (aFrame < aData.myNbFrames) {
+
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
+ myFrame, myFieldsLst[aFieldId].myTiming[aFrame]));
+
+ if (aFrame > 0) {
+ if (aData.myActors[aFrame-1] != 0)
+ visibilityOff(aFieldId, aFrame-1);
+ } else if ( myFrame > 0) {
+ if (myFieldsLst[aFieldId-1].myActors[myFieldsLst[aFieldId-1].myNbFrames-1] != 0)
+ visibilityOff(aFieldId-1, myFieldsLst[aFieldId-1].myNbFrames-1);
+ } else if ( myCycling ) {
+ if (myFieldsLst[getNbFields()-1].myActors[myFieldsLst[getNbFields()-1].myNbFrames-1] != 0)
+ visibilityOff(getNbFields()-1, myFieldsLst[getNbFields()-1].myNbFrames-1);
+ } else {
+ if (aData.myActors[aData.myNbFrames-1] != 0)
+ visibilityOff(aFieldId, aData.myNbFrames-1);
+ }
+ if (aData.myActors[aFrame] != 0) {
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[aFrame],
+ &VISU_Actor::VisibilityOn));
+ }
+
+ bool repainArg = false;
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
+ &SVTK_ViewWindow::Repaint,
+ repainArg));
+
+ k = 1;
+ if (myProportional) {
+ switch (aFrame) {
+ case 0:
+ break;
+ case 1:
+ if (myFieldsLst[0].myNbFrames > 2)
+ k = (myFieldsLst[0].myTiming[aFrame+1] -
+ myFieldsLst[0].myTiming[aFrame]) / aOneVal;
+ break;
+ default:
+ if (aFrame < (myFieldsLst[0].myNbFrames - 1))
+ k = (myFieldsLst[0].myTiming[aFrame+1] -
+ myFieldsLst[0].myTiming[aFrame]) / aOneVal;
+ }
+ }
+ int delay = (int)(1000. * k / mySpeed);
+ theIsDumping = !myDumpPath.isEmpty();
+ if (delay < 1 && theIsDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ delay = 1;
+ }
+ msleep(delay);
+ if (!myIsActive) {
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
+ return;
+ }
+
+ if (theIsDumping) {
+ // We must unlock mutex for some time before grabbing to allow view updating
+ msleep(delay);
+ if (!myIsActive) { // this check was taken from WP_DEB branch
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
+ return;
+ }
+
+ if(!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
+ break;
+
+ saveImages( aFieldId, aOneVal, aNbFiles, theIndexList );
+ }
+
+ if (!myIsActive) break;
+
+ aFrame++;
+ myFrame++;
+ }
+
+ aFrame = 0;
+ }
+
+ if (!myCycling) {
+ myIsActive = false;
+ myFrame--;
+ break;
+ } else {
+ myFrame = 0;
+ aFrame = myFrame;
+ }
+ }
+
+}
+
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::saveImages( int theFieldId,
+ double& theOneVal, int& theNbFiles,
+ QValueList<int>& theIndexList )
+{
+ if (myDumpFormat.compare("AVI") != 0) {
+ QString aFile(myDumpPath);
+ QString aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[myFrame]);
+ int aPos = -1;
+ while ((aPos = aName.find(".")) > -1 )
+ aName.replace(aPos, 1, "_");
+ aFile += aName;
+ aFile += ".";
+ aFile += myDumpFormat.lower();
+ ProcessEvent(new TMemFun2ArgEvent<SVTK_ViewWindow,bool,const QString&,const QString&>
+ (myView,&SVTK_ViewWindow::dumpViewToFormat,aFile,myDumpFormat));
+ } else {
+ QFileInfo aFileInfo(myDumpPath);
+ QString aDirPath = aFileInfo.dirPath(true);
+ QString aBaseName = aFileInfo.fileName();
+
+ switch (myFrame) {
+ case 0:
+ break;
+ case 1:
+ myFileIndex += 5;
+ break;
+ default:
+ if (myProportional) {
+ double p = (myFieldsLst[0].myTiming[myFrame] -
+ myFieldsLst[0].myTiming[myFrame-1]) / theOneVal;
+ myFileIndex += (long) (5*p);
+ } else {
+ myFileIndex += 5;
+ }
+ }
+
+ QString aFile = aDirPath + QDir::separator() + aBaseName;
+ aFile += "_";
+ aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0');
+ aFile += ".jpeg";
+
+ /* check image size is divisable 16
+ myView->dumpViewToFormat(aFile,"JPEG");
+ */
+ SUIT_ViewWindow* aView = myView;
+ QImage img = ProcessEvent(new TMemFunEvent<SUIT_ViewWindow,QImage>(aView,&SUIT_ViewWindow::dumpView));
+ if (!img.isNull()) {
+ int width = img.width(); width = (width/16)*16;
+ int height = img.height(); height = (height/16)*16;
+ QImage copy = img.copy(0, 0, width, height);
+ if (copy.save(aFile, "JPEG")) {
+ theIndexList.append(myFileIndex);
+ theNbFiles++;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+void VISU_TimeAnimation::run()
+{
+ if (!myView) {
+ MESSAGE("Viewer is not defined for animation");
+ return;
+ }
+
+ bool isDumping = !myDumpPath.isEmpty();
+ myFileIndex = 0;
+ QValueList<int> anIndexList;
+
+ if ( myAnimationMode == 0 ) // parallel animation mode
+ parallelAnimation( isDumping, anIndexList );
+ else //consecutive animation mode
+ consecutiveAnimation( isDumping, anIndexList );
// make AVI file if need
if (isDumping && myDumpFormat.compare("AVI") == 0) {
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
- VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g;myMode=%d",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal,myAnimationMode);
string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","",
GenerateName(),"",aComment,true);
std::string aSComponentEntry = aSComponent->GetID();
QString aComment;
- aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g",
- VISU::TANIMATION,myTimeMinVal,myTimeMaxVal);
+ aComment.sprintf("myComment=ANIMATION;myType=%d;myTimeMinVal=%g;myTimeMaxVal=%g;myMode=%d",
+ VISU::TANIMATION,myTimeMinVal,myTimeMaxVal,myAnimationMode);
_PTR(GenericAttribute) anAttr;
anAttr = aStudyBuilder->FindOrCreateAttribute(aAnimSObject, "AttributeString");
myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble();
myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble();
+ myAnimationMode = VISU::Storable::FindValue(aMap,"myMode",&isExist).toInt();
_PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
for (anIter->Init(); anIter->More(); anIter->Next()) {
return myAnim->addField(theField);
}
+void VISU_TimeAnimation_i::clearFields ()
+{
+ for (int i = 0; i < myAnim->getNbFields(); i++) {
+ myAnim->clearData(myAnim->getFieldData(i));
+ }
+ myAnim->clearFieldData();
+}
+
CORBA::Boolean VISU_TimeAnimation_i::generateFrames()
{
//return ProcessEvent(new TMemFunEvent<VISU_TimeAnimation,bool>
{
myAnim->saveAnimation();
}
+
+void VISU_TimeAnimation_i::setAnimationMode(VISU::Animation::AnimationMode theMode)
+{
+ myAnim->setAnimationMode(theMode);
+}
+
+VISU::Animation::AnimationMode VISU_TimeAnimation_i::getAnimationMode()
+{
+ return VISU::Animation::AnimationMode(myAnim->getAnimationMode());
+}