if ( !myFieldsLst.isEmpty() && myFieldsLst.first().myNbTimes != aNewData.myNbTimes )
return false;
if ( myFieldsLst.isEmpty() )
- myFieldsAbsFrames.push_back(aNewData.myNbTimes);
+ myFieldsAbsFrames.push_back(aNewData.myNbTimes);
}
else { // succcessive animation mode
if ( aNewData.myNbTimes < 1 )
double getMinFieldsValue( QValueList<FieldData>& theFieldsLst )
{
// for succcessive animation mode only
- double aRes = theFieldsLst[0].myPrs[0]->GetMin();
- for (int i = 1; i < theFieldsLst.count(); i++) {
+ double aRes;
+ for (int i = 0; i < theFieldsLst.count(); i++) {
+ if ( theFieldsLst[i].myPrs[0] ) {
+ aRes = theFieldsLst[i].myPrs[0]->GetMin();
+ break;
+ }
+ }
+
+ for (int i = 1; i < theFieldsLst.count() && theFieldsLst[i].myPrs[0]; i++) {
if ( aRes > theFieldsLst[i].myPrs[0]->GetMin() )
aRes = theFieldsLst[i].myPrs[0]->GetMin();
}
double getMaxFieldsValue( QValueList<FieldData>& theFieldsLst )
{
// for succcessive animation mode only
- double aRes = theFieldsLst[0].myPrs[0]->GetMax();
- for (int i = 1; i < theFieldsLst.count(); i++) {
+ double aRes;
+ for (int i = 0; i < theFieldsLst.count(); i++) {
+ if ( theFieldsLst[i].myPrs[0] ) {
+ aRes = theFieldsLst[i].myPrs[0]->GetMax();
+ break;
+ }
+ }
+
+ for (int i = 1; i < theFieldsLst.count() && theFieldsLst[i].myPrs[0]; i++) {
if ( aRes < theFieldsLst[i].myPrs[0]->GetMax() )
aRes = theFieldsLst[i].myPrs[0]->GetMax();
}
//------------------------------------------------------------------------
void VISU_TimeAnimation::_visibilityOff(int num_field, int num_frame) {
+ if ( num_field < 0 || num_frame < 0 ) return;
FieldData& aData = myFieldsLst[num_field];
VISU_Actor* aActor = aData.myActors[num_frame];
if (! myCleaningMemoryAtEachFrame) {
if ( myAnimationMode == 0 ) // parallel animation mode
return (getNbFields() > 0)? myFieldsLst[0].myNbFrames : 0;
else //succcessive animation mode
- return (getNbFields() > 0) ? myFieldsAbsFrames[myFieldsAbsFrames.size()-1] : 0;
+ return (getNbFields() > 0 && !myFieldsAbsFrames.empty()) ? myFieldsAbsFrames[myFieldsAbsFrames.size()-1] : 0;
}
//------------------------------------------------------------------------
//------------------------------------------------------------------------
void VISU_TimeAnimation::succcessiveAnimation( bool& theIsDumping, QValueList<int>& theIndexList )
{
- if ( myFrame >= getNbFrames() - 1 )
+ if ( myFrame >= getNbFrames() - 1 )
+ {
+ myIsActive = false;
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
return;
+ }
double k = 1;
double aOneVal = 1;
for (int aFieldId = 0; (aFieldId < getNbFields()) && (myFieldsLst[aFieldId].myField); aFieldId++) {
FieldData& aData = myFieldsLst[aFieldId];
+ if ( !aData.myPrs[0] ) continue;
while (aFrame < aData.myNbFrames) {
ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
-
- _PTR(SObject) newObj = aStudyBuilder->NewObject(aAnimSObject);
- aStudyBuilder->Addreference(newObj, aData.myField);
-
- if (aData.myPrs.empty()) {
- generatePresentations(i);
+ if ( aData.myPrs[0] ) {
+ _PTR(SObject) newObj = aStudyBuilder->NewObject(aAnimSObject);
+ aStudyBuilder->Addreference(newObj, aData.myField);
+
+ if (aData.myPrs.empty()) {
+ generatePresentations(i);
+ }
+ ostringstream strOut;
+ aData.myPrs[0]->ToStream(strOut);
+ string aPrsComment = strOut.str();
+ VISU::CreateAttributes(myStudy, newObj->GetID().c_str(),"","",
+ aData.myPrs[0]->GetComment(),"",aPrsComment.c_str(),true);
}
- ostringstream strOut;
- aData.myPrs[0]->ToStream(strOut);
- string aPrsComment = strOut.str();
- VISU::CreateAttributes(myStudy, newObj->GetID().c_str(),"","",
- aData.myPrs[0]->GetComment(),"",aPrsComment.c_str(),true);
}
aStudyBuilder->CommitCommand();
_PTR(SObject) aRefObj = anIter->Value();
_PTR(SObject) aFieldObj;
if (!aRefObj->ReferencedObject(aFieldObj) ) continue;
+
addField(aFieldObj);
+ if ( isRangeDefined() ) myFieldsAbsFrames.pop_back();
+
FieldData& aData = getFieldData(getNbFields()-1);
// Get Presentation object