]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL16752 (SIGSEGV on cutpanes, cutlines, plot3D on cronoshexa.med file):
authorakl <akl@opencascade.com>
Fri, 14 Sep 2007 16:03:06 +0000 (16:03 +0000)
committerakl <akl@opencascade.com>
Fri, 14 Sep 2007 16:03:06 +0000 (16:03 +0000)
+ static int IsCompatibleCellTypes();
to check mesh cell types.

src/VISU_I/VISU_PrsMerger_i.cc
src/VISU_I/VISU_PrsMerger_i.hh

index f7eb19c6bba8417c385e68bcf4cbd9bd766f058f..57397049f0f7a2e99f51ce6dca11ee5372fa0b5d 100644 (file)
@@ -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)
 {
index 5c3b6980653ef723a9107bdbad38a5f9f056725a..2583b17ae81e7c3571c62c4dfb406b0a3c889e83 100644 (file)
@@ -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);