From 9e181f737319cbc5989fabdf6d8b9acc0936cc87 Mon Sep 17 00:00:00 2001 From: enk Date: Mon, 30 Oct 2006 11:51:45 +0000 Subject: [PATCH] Fix for Bug IPAL13720 enk/PRSMERGER: Fatal error on edit CutLines on group --- src/PIPELINE/VISU_PrsMergerPL.cxx | 31 +++++++++++++------------------ src/PIPELINE/VISU_PrsMergerPL.hxx | 14 +++++++++----- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/PIPELINE/VISU_PrsMergerPL.cxx b/src/PIPELINE/VISU_PrsMergerPL.cxx index 8e5ab8ca..def0ac48 100644 --- a/src/PIPELINE/VISU_PrsMergerPL.cxx +++ b/src/PIPELINE/VISU_PrsMergerPL.cxx @@ -97,23 +97,24 @@ VISU_PrsMergerPL if (MYDEBUG) MESSAGE("aNbGeoms="<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()="<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(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(this->GetScalars()); VISU_PrsMergerPL* aPrsMerger = dynamic_cast(this->GetScalars()); - if(aPrsMerger != NULL){ - myOutput = NULL; - } if(aScalarMap != NULL){ SetInput(aScalarMap->GetInput()); - vtkDataSet* aOut = aScalarMap->GetOutput(); - myOutput = aOut; - } - } } } diff --git a/src/PIPELINE/VISU_PrsMergerPL.hxx b/src/PIPELINE/VISU_PrsMergerPL.hxx index 6d76830e..e0cc94ff 100644 --- a/src/PIPELINE/VISU_PrsMergerPL.hxx +++ b/src/PIPELINE/VISU_PrsMergerPL.hxx @@ -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: /*! -- 2.39.2