From: ouv Date: Wed, 24 Jun 2009 10:02:56 +0000 (+0000) Subject: Fix of remark for bug 0020123: EDF VISU 914 : Pyramids are not displayed for ELGA... X-Git-Tag: V5_1_2rc3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1bb14a0972c0fb171a328901782b98fcf6fb0901;p=modules%2Fvisu.git Fix of remark for bug 0020123: EDF VISU 914 : Pyramids are not displayed for ELGA field --- diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index 0a0b7340..7fcfb1fd 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -160,6 +160,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 ca90de17..c9b541cc 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -156,15 +156,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 d19c4667..d9d244c8 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 8c3d9aea..adfc6ac4 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -196,18 +196,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); @@ -221,7 +224,7 @@ VISU_Plot3DPL } if ( !aPolyData || aPolyData->GetNumberOfCells() == 0 ) { - myGeometryFilter->SetInput(aDataSet); + myGeometryFilter->SetInput(aMergedInput); aPolyData = myGeometryFilter->GetOutput(); aPolyData->Update(); }