From 0cf6e8d55c0ca3997ce3c0d395fa6ec4d258ef86 Mon Sep 17 00:00:00 2001 From: enk Date: Mon, 15 Jan 2007 14:41:59 +0000 Subject: [PATCH] Fix for Bug IPAL14356: Application hangs up after trying to create StreamLines. --- src/PIPELINE/VISU_StreamLinesPL.cxx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index cea287a7..697e99d0 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -34,6 +34,7 @@ #include #include +#include #include #ifdef _DEBUG_ @@ -82,7 +83,7 @@ void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ aPipeLine->GetUsedPoints(), aPipeLine->GetDirection()); } - VISU_DeformedShapePL::ShallowCopy(thePipeLine); + Superclass::ShallowCopy(thePipeLine); } @@ -230,7 +231,11 @@ VISU_StreamLinesPL ::GetVelocityCoeff(vtkPointSet* theDataSet) { vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange(); - return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0; + vtkFloatingPointType aVelocity = (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0; + if (aVelocity < EPS) + return EPS; + + return aVelocity; } @@ -494,7 +499,7 @@ void VISU_StreamLinesPL ::Init() { - VISU_PrsMergerPL::Init(); + Superclass::Init(); vtkPointSet* aDataSet = myExtractor->GetOutput(); vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet); vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet); @@ -509,9 +514,16 @@ VISU_StreamLinesPL GetInput2()->Update(); VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform); vtkFloatingPointType *aBounds = GetInput2()->GetBounds(); + + myStream->Update(); + // check: Is streamlines exists? If no points in stream lines, return input2 + if(myStream->GetOutput()->GetNumberOfPoints() == 0) + myGeomFilter->SetInput(GetInput2()); + else + myGeomFilter->SetInput(myStream->GetOutput()); + myGeomFilter->SetExtent(aBounds); myGeomFilter->ExtentClippingOn(); - myGeomFilter->SetInput(myStream->GetOutput()); return myGeomFilter->GetOutput(); } @@ -519,12 +531,12 @@ void VISU_StreamLinesPL ::Update() { - VISU_PrsMergerPL::Update(); + Superclass::Update(); } void VISU_StreamLinesPL ::SetMapScale(vtkFloatingPointType theMapScale) { - VISU_ScalarMapPL::SetMapScale(theMapScale); + Superclass::SetMapScale(theMapScale); } -- 2.39.2