]> 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... V4_1_0_maintainance_20090629 V4_1_0_maintainance_20090706 V4_1_0_maintainance_20090713 V4_1_0_maintainance_20090720
authorouv <ouv@opencascade.com>
Wed, 24 Jun 2009 10:03:21 +0000 (10:03 +0000)
committerouv <ouv@opencascade.com>
Wed, 24 Jun 2009 10:03:21 +0000 (10:03 +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 0d3b636015d60bad1ea0f8fbcf6802847c431f1d..19565907cfdbd3fa5601136f9afe22da4d5b2f5c 100644 (file)
@@ -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);
index 25f38eac0af467be17aaf44124c7626bba10e710..1969a68aaa73b568237c852690b2bf03186e18e1 100644 (file)
@@ -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();
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 ed7c39e8460b539e265a5f26ea6c8af853358878..429328b018ad8ba11215f0da86fb1f21919a203f 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 d39f1812af19550325a4ab6ec2c7c88287fa39cb..6d2a45c8b8d041edddbbaad7e8e823d7d5ce67dd 100644 (file)
@@ -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();
   }