]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix of remark for bug 0020123: EDF VISU 914 : Pyramids are not displayed for ELGA... V5_1_2rc3
authorouv <ouv@opencascade.com>
Wed, 24 Jun 2009 10:02:56 +0000 (10:02 +0000)
committerouv <ouv@opencascade.com>
Wed, 24 Jun 2009 10:02:56 +0000 (10:02 +0000)
src/PIPELINE/VISU_CutLinesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_PipeLineUtils.cxx
src/PIPELINE/VISU_PipeLineUtils.hxx
src/PIPELINE/VISU_Plot3DPL.cxx

index 0a0b7340bf5b0190124f7ee5d706b46ad87f292f..7fcfb1fd4d11b8308a11ece0f670a0f4351e6388 100644 (file)
@@ -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);
index ca90de17199298b574eea11196a3356400ac8093..c9b541cc54fb1e3e5f427fd16039ca5f417422a7 100644 (file)
@@ -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();
index 259682e779fdb60dc777c805f6adff0a392c3ca2..2223fb868d294dbe334de3fd55c2cf8238af0520 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "VISU_OpenGLPointSpriteMapper.hxx"
 
+#include <vtkCell.h>
 #include <vtkDataSetMapper.h>
 #include <vtkPolyDataMapper.h>
 
@@ -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;
+  }
+
+
   //----------------------------------------------------------------------------
 }
index d19c466707d667789d05129810ba6e73ab8bb6b2..d9d244c86f1f73ad15930d4530fb6c4c54793aa6 100644 (file)
@@ -147,6 +147,11 @@ namespace VISU
                     vtkFloatingPointType theDirection[3], 
                     vtkFloatingPointType thePos[3], 
                     vtkFloatingPointType& theDist);
+
+
+  //----------------------------------------------------------------------------
+  bool VISU_PIPELINE_EXPORT
+  IsQuadraticData(vtkDataSet* theDataSet);
 }
 
 #endif
index 8c3d9aeac9cfb9693c3e56e537d53b88805d3f4a..adfc6ac421c20a2ab8d9decda9ccc40c707ebf0a 100644 (file)
@@ -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();
   }