From c799124132434bad2101639ad5216586bdb3f361 Mon Sep 17 00:00:00 2001 From: skl Date: Thu, 19 Jun 2008 09:23:25 +0000 Subject: [PATCH] Update for bug IPAL13188. --- src/VISUGUI/VisuGUI_TimeAnimation.cxx | 2 ++ src/VISU_I/VISU_Prs3d_i.cc | 8 +++++++- src/VISU_I/VISU_Result_i.cc | 7 +++++-- src/VISU_I/VISU_TimeAnimation.cxx | 22 +++++++++++++++++++++- src/VISU_I/VISU_TimeAnimation.h | 7 ++++++- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index e7a09f20..234ec7af 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -638,6 +638,8 @@ void SetupDlg::initialize() FieldData& aData = myAnimator->getFieldData( 0 ); _PTR(SObject) aField = aData.myField; + if(!aField) return; + _PTR(ChildIterator) anIter = aStudy->NewChildIterator(aField); anIter->Next(); // First is reference on support for(int index = 1; anIter->More(); anIter->Next(), index++) diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index aa3c93bc..2a5ce7ff 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -99,6 +99,7 @@ VISU::Prs3d_i::~Prs3d_i() { if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<GetStudyDocument()); + theResult->Register(); + } + if(myResult) { + myResult->Destroy(); + } VISU::TSetModified aModified(this); diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index edfbf5b9..67e6c711 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -61,7 +61,7 @@ #include #ifdef _DEBUG_ -static int MYDEBUG = 0; +static int MYDEBUG = 1; #else static int MYDEBUG = 0; #endif @@ -161,6 +161,7 @@ VISU::Result_i myIsBuildParts(false), myIsPartsDone(false) { + if(MYDEBUG) MESSAGE("Result_i::Result_i - this = "<& theFieldsLst ) return aRes; } -void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) { +void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) +{ + int nbf = myFieldsLst.size(); + if( theFieldNum<0 || theFieldNum>nbf-1 ) + return; + FieldData& aData = myFieldsLst[theFieldNum]; // Delete previous presentations @@ -1834,9 +1848,15 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField) for (anIter->Init(); anIter->More(); anIter->Next()) { _PTR(SObject) aRefObj = anIter->Value(); _PTR(SObject) aFieldObj; + if (!aRefObj->ReferencedObject(aFieldObj) ) continue; + int nbAttr = aFieldObj->GetAllAttributes().size(); + //std::string name1 = aFieldObj->GetName(); + if(nbAttr<1) + continue; + addField(aFieldObj); if ( isRangeDefined() || isSequenceDefined() ) myFieldsAbsFrames.pop_back(); diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index 85a0b415..d9196f58 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -26,6 +26,9 @@ #include "VISUConfig.hh" +#include "VISU_Result_i.hh" +#include "SALOME_GenericObjPointer.hh" + #include #include @@ -37,7 +40,7 @@ class VISU_Actor; namespace VISU { - class Result_i; + //class Result_i; class ColoredPrs3d_i; class ExecutionState; } @@ -52,6 +55,8 @@ struct FieldData std::vector myActors; // Actors std::vector myTiming; // time values CORBA::Float myOffset[3]; + typedef SALOME::GenericObjPtr TResultPtr; + TResultPtr myResult; }; -- 2.39.2