From 1a571c221ebf007a7fe1ae1163fdb60a08faa320 Mon Sep 17 00:00:00 2001 From: akl Date: Fri, 14 Sep 2007 16:03:06 +0000 Subject: [PATCH] NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): + static int IsCompatibleCellTypes(); to check mesh cell types. --- src/VISU_I/VISU_PrsMerger_i.cc | 28 ++++++++++++++++++++++++++++ src/VISU_I/VISU_PrsMerger_i.hh | 2 ++ 2 files changed, 30 insertions(+) diff --git a/src/VISU_I/VISU_PrsMerger_i.cc b/src/VISU_I/VISU_PrsMerger_i.cc index f7eb19c6..57397049 100644 --- a/src/VISU_I/VISU_PrsMerger_i.cc +++ b/src/VISU_I/VISU_PrsMerger_i.cc @@ -56,6 +56,34 @@ static int MYDEBUG = 0; static int INCMEMORY = 4; +int VISU::PrsMerger_i::IsCompatibleCellTypes(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, int theIteration) +{ + // check cell types + VISU::PIDMapper anIDMapper = + theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration); + vtkUnsignedCharArray* cellTypes = vtkUnsignedCharArray::New(); + VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput(); + aDataSet->Update(); + aDataSet->GetListOfUniqueCellTypes(cellTypes); + for(vtkIdType anId = 0; anId < cellTypes->GetNumberOfTuples(); anId++){ + const vtkIdType aType = (const vtkIdType)cellTypes->GetValue(anId); + if(aType == VTK_QUADRATIC_EDGE || + aType == VTK_QUADRATIC_TRIANGLE || + aType == VTK_QUADRATIC_QUAD || + aType == VTK_QUADRATIC_TETRA || + aType == VTK_QUADRATIC_HEXAHEDRON || + aType == VTK_CONVEX_POINT_SET) + { + cellTypes->Delete(); + return 0; + } + } + cellTypes->Delete(); + return 1; +} + + int VISU::PrsMerger_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration, int isMemoryCheck) { diff --git a/src/VISU_I/VISU_PrsMerger_i.hh b/src/VISU_I/VISU_PrsMerger_i.hh index 5c3b6980..2583b17a 100644 --- a/src/VISU_I/VISU_PrsMerger_i.hh +++ b/src/VISU_I/VISU_PrsMerger_i.hh @@ -98,6 +98,8 @@ namespace VISU{ public: + static int IsCompatibleCellTypes(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, int theIteration); static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, int theIteration, int isMemoryCheck = true); -- 2.39.2