From c1754b24c3f5502d2981c494a2072da39ec2ac6d Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 2 Apr 2015 17:48:04 +0300 Subject: [PATCH] 23033: EDF 10568 SMESH: wrong header when exporting 2D to gmf Write 'MeshVersionFormatted 2' instead of 'MeshVersionFormatted 3' though '3' is strongly recomended by libmesh manual + IPAL52653: Some quality controls does not work (SIGSEGV) --- src/DriverGMF/DriverGMF_Write.cxx | 2 +- src/OBJECT/SMESH_DeviceActor.cxx | 25 ++++++++++++------------- src/SMESH/SMESH_Algo.hxx | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/DriverGMF/DriverGMF_Write.cxx b/src/DriverGMF/DriverGMF_Write.cxx index f2dc95be7..158eea067 100644 --- a/src/DriverGMF/DriverGMF_Write.cxx +++ b/src/DriverGMF/DriverGMF_Write.cxx @@ -121,7 +121,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform() { Kernel_Utils::Localizer loc; - const int dim = 3, version = sizeof(long) == 4 ? 2 : 3; + const int dim = 3, version = sizeof(double) < 8 ? 1 : 2; int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim ); if ( !meshID ) diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 19ddd5bc6..cf6405554 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -516,17 +516,17 @@ SMESH_DeviceActor myVisualObj->UpdateFunctor(theFunctor); using namespace SMESH::Controls; - if ( dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get())) + Predicate* aPredicate = 0; + if (( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get()))) { - Predicate* aPredicate = dynamic_cast(theFunctor.get()); myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid(); vtkIdType aNbCells = aGrid->GetNumberOfCells(); @@ -588,10 +588,9 @@ SMESH_DeviceActor SetUnstructuredGrid(aDataSet); aDataSet->Delete(); } - else if(dynamic_cast(theFunctor.get()) || - dynamic_cast(theFunctor.get())) + else if (( aPredicate = dynamic_cast(theFunctor.get())) || + ( aPredicate = dynamic_cast(theFunctor.get()))) { - Predicate* aPredicate = dynamic_cast(theFunctor.get()); myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node); for( vtkIdType i = 0; i < aNbNodes; i++ ){ diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 5c4b46cec..3462f0a0d 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -425,7 +425,7 @@ protected: bool _requireDiscreteBoundary;// GetDim()-1 mesh must be present. Default TRUE bool _requireShape; // work with GetDim()-1 mesh bound to geom only. Default TRUE bool _supportSubmeshes; // if !_requireDiscreteBoundary. Default FALSE - bool _neededLowerHyps[4]; // hyp dims needed by algo that !NeedDiscreteBoundary(). Df. FALSE + bool _neededLowerHyps[4]; // hyp dims needed by algo that !_requireDiscreteBoundary. Df. FALSE // indicates if quadratic mesh creation is required, // is usually set like this: _quadraticMesh = SMESH_MesherHelper::IsQuadraticSubMesh(shape) -- 2.39.2