From b6d8487b918f336af1a0d67f3c797a827ddcca3c Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 24 Jun 2009 10:03:21 +0000 Subject: [PATCH] Fix of remark for bug 0020123: EDF VISU 914 : Pyramids are not displayed for ELGA field --- src/PIPELINE/VISU_CutLinesPL.cxx | 4 ++++ src/PIPELINE/VISU_CutPlanesPL.cxx | 8 ++++++-- src/PIPELINE/VISU_PipeLineUtils.cxx | 13 +++++++++++++ src/PIPELINE/VISU_PipeLineUtils.hxx | 5 +++++ src/PIPELINE/VISU_Plot3DPL.cxx | 9 ++++++--- 5 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 0d3b6360..19565907 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -159,6 +159,10 @@ void VISU_CutLinesPL ::Update() { + vtkDataSet* aMergedInput = GetMergedInput(); + if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343 + throw std::runtime_error("Impossible to build presentation"); + ClearAppendPolyData(myAppendPolyData); SetPartPosition(1); diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 25f38eac..1969a68a 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -155,15 +155,19 @@ void VISU_CutPlanesPL ::Update() { + vtkDataSet* aMergedInput = GetMergedInput(); + if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343 + throw std::runtime_error("Impossible to build presentation"); + ClearAppendPolyData(myAppendPolyData); if(!myVectorialField || !IsDeformed()){ - SetMergeFilterInput(GetMergedInput(),GetMergedInput()); + SetMergeFilterInput(aMergedInput,aMergedInput); } - if(VISU::IsDataOnCells(GetMergedInput())) + if(VISU::IsDataOnCells(aMergedInput)) GetMapper()->SetScalarModeToUseCellData(); else GetMapper()->SetScalarModeToUsePointData(); diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx index 259682e7..2223fb86 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ b/src/PIPELINE/VISU_PipeLineUtils.cxx @@ -28,6 +28,7 @@ #include "VISU_OpenGLPointSpriteMapper.hxx" +#include #include #include @@ -245,5 +246,17 @@ namespace VISU } + //---------------------------------------------------------------------------- + bool + IsQuadraticData(vtkDataSet* theDataSet) + { + for(int i = 0, n = theDataSet->GetNumberOfCells(); i < n; i++) + if(vtkCell* aCell = theDataSet->GetCell(i)) + if(!aCell->IsLinear()) + return true; + return false; + } + + //---------------------------------------------------------------------------- } diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index ed7c39e8..429328b0 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -147,6 +147,11 @@ namespace VISU vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist); + + + //---------------------------------------------------------------------------- + bool VISU_PIPELINE_EXPORT + IsQuadraticData(vtkDataSet* theDataSet); } #endif diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index d39f1812..6d2a45c8 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -195,18 +195,21 @@ void VISU_Plot3DPL ::Update() { + vtkDataSet* aMergedInput = GetMergedInput(); + if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343 + throw std::runtime_error("Impossible to build presentation"); + vtkFloatingPointType aPlaneNormal[3]; vtkFloatingPointType anOrigin[3]; GetBasePlane( anOrigin, aPlaneNormal ); vtkPolyData* aPolyData = 0; vtkCutter *aCutPlane = 0; - vtkDataSet* aDataSet = GetMergedInput(); if ( !IsPlanarInput() ) { aCutPlane = vtkCutter::New(); - aCutPlane->SetInput(aDataSet); + aCutPlane->SetInput(aMergedInput); vtkPlane *aPlane = vtkPlane::New(); aPlane->SetOrigin(anOrigin); @@ -220,7 +223,7 @@ VISU_Plot3DPL } if ( !aPolyData || aPolyData->GetNumberOfCells() == 0 ) { - myGeometryFilter->SetInput(aDataSet); + myGeometryFilter->SetInput(aMergedInput); aPolyData = myGeometryFilter->GetOutput(); aPolyData->Update(); } -- 2.39.2