From: akl Date: Fri, 14 Sep 2007 16:03:06 +0000 (+0000) Subject: NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): X-Git-Tag: T_24092007~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1a571c221ebf007a7fe1ae1163fdb60a08faa320;p=modules%2Fvisu.git NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file): + static int IsCompatibleCellTypes(); to check mesh cell types. --- 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);