namespace {
void GeneratePresentations(int theFieldId, VISU_TimeAnimation* theAnimator)
{
+ if(theAnimator->getNbFields() == 0)
+ return;
+
theAnimator->generatePresentations(theFieldId);
FieldData& aFieldData = theAnimator->getFieldData(theFieldId);
double aMaxTime = myAnimator->getMaxTime();
double aMinTime = myAnimator->getMinTime();
double aStep;
- if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL )
- aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
- else { // successive animation mode
- std::pair<int,long> aLastFieldFrame(myAnimator->getNbFields() - 1,
- myAnimator->getFieldData(myAnimator->getNbFields() - 1).myNbTimes - 1);
- aStep = (aMaxTime - aMinTime) / myAnimator->getAbsoluteFrameNumber(aLastFieldFrame);
+ if( myAnimator->getNbFields() > 0 ) {
+ if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL )
+ aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
+ else { // successive 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", myUseRangeBox);
_PTR(Study) aStudy = myAnimator->getStudy();
+ if( myAnimator->getNbFields() == 0 )
+ return;
+
FieldData& aData = myAnimator->getFieldData( 0 );
_PTR(SObject) aField = aData.myField;
myTypeId2ComboId.clear();
myComboId2TypeId.clear();
+ if( myAnimator->getNbFields() == 0 )
+ return;
+
// 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();
void SetupDlg::onPreferencesDlg()
{
+ if(myAnimator->getNbFields() == 0){
+ SUIT_MessageBox::warn1(this,
+ tr("ERROR"),
+ VisuGUI_TimeAnimationDlg::tr("MSG_NO_ANIMATIONDATA"),
+ tr("&OK"));
+ return;
+ }
+
SUIT_OverrideCursor c;
VISU::Animation::AnimationMode aMode = myAnimator->getAnimationMode();