]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL13720
authorenk <enk@opencascade.com>
Mon, 30 Oct 2006 11:51:45 +0000 (11:51 +0000)
committerenk <enk@opencascade.com>
Mon, 30 Oct 2006 11:51:45 +0000 (11:51 +0000)
enk/PRSMERGER: Fatal error on edit CutLines on group

src/PIPELINE/VISU_PrsMergerPL.cxx
src/PIPELINE/VISU_PrsMergerPL.hxx

index 8e5ab8ca0e8688cadc7d03fe3cb0c2b148777e4e..def0ac4880a3e9e2cc661a603e4d2a18e638d884 100644 (file)
@@ -97,23 +97,24 @@ VISU_PrsMergerPL
     if (MYDEBUG) MESSAGE("aNbGeoms="<<aNbGeoms);
     myMeshGeometryList.clear();
     for(int i=0; i<aNbGeoms; i++){
-      AddBackGeometry(aPipeLine->GetGeometry(i));
+      AddBackGeometry(aPipeLine->GetGeometry(i),false);
     }
-    SetScalars(aPipeLine->GetScalars());
+    SetScalars(aPipeLine->GetScalars(),true);
   }
   Superclass::ShallowCopy(thePipeLine);
 }
 
 bool
 VISU_PrsMergerPL
-::SetGeometry(VISU_PipeLine* theGeometry)
+::SetGeometry(VISU_PipeLine* theGeometry,bool theUpdate)
 {
   myMeshGeometryList.clear();
   if(this->checkGeometry(theGeometry)){
     myMeshGeometryList.push_back(theGeometry);
     if (MYDEBUG) MESSAGE("this->GetGeometry(0)->GetIDMapper()="<<this->GetGeometry(0)->GetIDMapper());
-
-    this->Execute();
+    
+    if(theUpdate)
+      this->Execute();
 
     return true;
   } else
@@ -123,15 +124,16 @@ VISU_PrsMergerPL
 
 int
 VISU_PrsMergerPL
-::AddBackGeometry(VISU_PipeLine* theGeometry)
+::AddBackGeometry(VISU_PipeLine* theGeometry,bool theUpdate)
 {
   if(theGeometry == NULL) return -1;
   int aGeomNum = this->GetGeometryNumber(theGeometry);
   if(aGeomNum == -1){
     if(this->checkGeometry(theGeometry)){
       myMeshGeometryList.push_back(theGeometry);
-
-      this->Execute();
+      
+      if(theUpdate)
+       this->Execute();
 
       return (myMeshGeometryList.size()-1);
     } else {
@@ -199,13 +201,15 @@ VISU_PrsMergerPL
 
 bool
 VISU_PrsMergerPL
-::SetScalars(VISU_PipeLine* theInput)
+::SetScalars(VISU_PipeLine* theInput,bool theUpdate)
 {
   if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::SetScalars()");
   if ( this->checkScalars( theInput ) ){
     myScalars = theInput;
     VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
     myScalarRanges = aScalarMap->GetScalarRange();
+    if(theUpdate)
+      this->Execute();
     return true;
   } else
     return false;
@@ -550,8 +554,6 @@ VISU_PrsMergerPL
       aDSArrays->Delete();
       aArrays->Delete();
       
-      myOutput->ShallowCopy(aMergeFilter->GetOutput());
-      
       aMergeFilter->Delete();
     }
   else
@@ -560,16 +562,9 @@ VISU_PrsMergerPL
        {
          VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
          VISU_PrsMergerPL* aPrsMerger = dynamic_cast<VISU_PrsMergerPL*>(this->GetScalars());
-         if(aPrsMerger != NULL){
-           myOutput = NULL;
-         }
          if(aScalarMap != NULL){
            SetInput(aScalarMap->GetInput());
-           vtkDataSet* aOut = aScalarMap->GetOutput();
-           myOutput = aOut;
-           
          }
-         
        }
     }
 }
index 6d76830e6b7c83d780ee233745be37a7cc159197..e0cc94ff585677f0e2550600533c443b01aa3afa 100644 (file)
@@ -57,20 +57,24 @@ public:
 
   /*!
    * Add geometry of presentation to myMeshGeometryList.
+   * \params theGeometry - visu pipeline with geometry.
+   * \params theUpdate - update pipeline if true.
    * \retval TRUE - if geometry and scalars on the common mesh, esle FALSE.
    */
   virtual
   bool
-  SetGeometry(VISU_PipeLine* theGeometry);
+  SetGeometry(VISU_PipeLine* theGeometry,bool theUpdate=true);
 
   /*!
    * Add geometry to back of myMeshGeometryList.
+   * \params theInput - visu pipeline with geometry.
+   * \params theUpdate - update pipeline if true.
    * \retval index of added geometry. (must be >= 0)
    * \retval -1, if geometry not added.
    */
   virtual
   int
-  AddBackGeometry(VISU_PipeLine* theGeometry);
+  AddBackGeometry(VISU_PipeLine* theGeometry,bool theUpdate=true);
 
   /*!
    * Get geometry id of myMeshGeometryList.
@@ -114,11 +118,13 @@ public:
 
   /*!
    * Sets scalar values and ids by VISU_ScalarMapPL object.
+   * \params theInput - visu pipeline with scalar values
+   * \params theUpdate - update pipeline if true.
    * \retval TRUE - if scalars and geometry on the common mesh, esle FALSE.
    */
   virtual
   bool
-  SetScalars(VISU_PipeLine* theInput);
+  SetScalars(VISU_PipeLine* theInput,bool theUpdate=false);
   
   /*!
    * Gets input VISU_ScalarMapPL, which contain scalar values and ids.
@@ -154,8 +160,6 @@ protected:
 
   vtkFloatingPointType* myScalarRanges;
 
-  VISU_ScalarMapPL::THook* myOutput;
-  
 private:
   
   /*!