]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Update for bug IPAL13188.
authorskl <skl@opencascade.com>
Thu, 19 Jun 2008 09:23:25 +0000 (09:23 +0000)
committerskl <skl@opencascade.com>
Thu, 19 Jun 2008 09:23:25 +0000 (09:23 +0000)
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.h

index e7a09f20754fcaaed30f6ebe16c1211443b292b2..234ec7af6e4512ce95c5811dde818d3ca4709906 100644 (file)
@@ -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++)
index aa3c93bc50aaa6ef8fe423fb8e653519216e140a..2a5ce7ff4554b99e9e535d9e9f57e54b6cb414b5 100644 (file)
@@ -99,6 +99,7 @@ VISU::Prs3d_i::~Prs3d_i()
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
   ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal));
+  SetCResult( NULL );
 }
 
 
@@ -157,8 +158,13 @@ VISU::Prs3d_i
   if(GetCResult() == theResult)
     return;
 
-  if(theResult)
+  if(theResult) {
     SetStudyDocument(theResult->GetStudyDocument());
+    theResult->Register();
+  }
+  if(myResult) {
+    myResult->Destroy();
+  }
   
   VISU::TSetModified aModified(this);
   
index edfbf5b937722b6c31309abb638d0ceec7046f5f..67e6c7111fb06cd33da79f96f33bfa5f286bb2b2 100644 (file)
@@ -61,7 +61,7 @@
 #include <Bnd_Box.hxx>
 
 #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 = "<<this);
   myStudy = VISU::GetStudy(myStudyDocument);
 }
 
@@ -175,7 +176,9 @@ VISU::Result_i
   myIsAllDone(false),
   myIsBuildParts(false),
   myIsPartsDone(false)
-{}
+{
+  if(MYDEBUG) MESSAGE("Result_i::Result_i - this = "<<this);
+}
 
 
 //---------------------------------------------------------------
index c843845bf051d0ce75ab92f8e24006a25e9bd5a6..ffe3504d8764625dd01ce4b189f1587223aa6573 100644 (file)
@@ -260,6 +260,15 @@ bool VISU_TimeAnimation::addField (_PTR(SObject) theField)
   aNewData.myNbFrames = 0;
   aNewData.myPrsType = VISU::TSCALARMAP;
   aNewData.myOffset[0] = aNewData.myOffset[1] = aNewData.myOffset[2] = 0;
+
+  // initialize myResult in aNewData
+  _PTR(SObject) aSObj = theField->GetFather();
+  aSObj = aSObj->GetFather();
+  aSObj = aSObj->GetFather();
+  CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObj);
+  if (CORBA::is_nil(anObject)) return false;
+  aNewData.myResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
+
   VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(aNewData.myField);
   if(VISU::Storable::FindValue(aMap,"myComment") != "FIELD")
     return false;
@@ -489,7 +498,12 @@ double getMaxFieldsValue( QValueList<FieldData>& 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();
index 85a0b415297a24279b38883b089661ee4faa52b5..d9196f587cd1e80a8dbffef4f3ae9bdfb7771ab3 100644 (file)
@@ -26,6 +26,9 @@
 
 #include "VISUConfig.hh"
 
+#include "VISU_Result_i.hh"
+#include "SALOME_GenericObjPointer.hh"
+
 #include <vector>
 
 #include <qobject.h>
@@ -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<VISU_Actor*> myActors;         // Actors
   std::vector<double> myTiming;              // time values
   CORBA::Float myOffset[3];
+  typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
+  TResultPtr myResult;
 };