From 753f514d3b48fc4b635a5e1c8fa347b29556d2b4 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 13 May 2018 18:05:07 +0200 Subject: [PATCH] proper fix to keep nodes order intact when exporting to UNV format For more detailed information have a look here: https://forum.freecadweb.org/viewtopic.php?f=10&t=27744&sid=9a966f15219a156c83f12be7ac055791&start=70#p233460 --- src/3rdParty/salomesmesh/inc/SMDSAbs_ElementType.hxx | 10 ++++------ .../salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/3rdParty/salomesmesh/inc/SMDSAbs_ElementType.hxx b/src/3rdParty/salomesmesh/inc/SMDSAbs_ElementType.hxx index 0753fb4ab2..60b388fa3e 100644 --- a/src/3rdParty/salomesmesh/inc/SMDSAbs_ElementType.hxx +++ b/src/3rdParty/salomesmesh/inc/SMDSAbs_ElementType.hxx @@ -27,12 +27,10 @@ #ifndef _SMDSAbs_ElementType_HeaderFile #define _SMDSAbs_ElementType_HeaderFile -#include - /////////////////////////////////////////////////////////////////////////////// /// Type (node, edge, face or volume) of elements /////////////////////////////////////////////////////////////////////////////// -enum SMDSAbs_ElementType : size_t +enum SMDSAbs_ElementType { SMDSAbs_All, SMDSAbs_Node, @@ -45,7 +43,7 @@ enum SMDSAbs_ElementType : size_t }; /*! enumeration for element geometry type */ -enum SMDSAbs_GeometryType : size_t +enum SMDSAbs_GeometryType { // 0D element SMDSGeom_POINT, @@ -69,7 +67,7 @@ enum SMDSAbs_GeometryType : size_t }; -enum SMDSAbs_ElementOrder : size_t +enum SMDSAbs_ElementOrder { ORDER_ANY, /*! entities of any order */ ORDER_LINEAR, /*! entities of 1st order */ @@ -79,7 +77,7 @@ enum SMDSAbs_ElementOrder : size_t /*! * Enumeration of entity type used in mesh info array */ -enum SMDSAbs_EntityType : size_t +enum SMDSAbs_EntityType { SMDSEntity_Node, SMDSEntity_0D, diff --git a/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp b/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp index 2966af5ab4..deb05985f0 100644 --- a/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp +++ b/src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp @@ -68,8 +68,10 @@ SMDS_VtkCellIteratorToUNV::SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCel _vtkIdList = vtkIdList::New(); vtkIdType* pts; + vtkIdType npts; vtkUnstructuredGrid* grid = _mesh->getGrid(); - grid->GetCellPoints((vtkIdType)_cellId, (vtkIdType&)_nbNodes, pts); + grid->GetCellPoints((vtkIdType)_cellId, npts, pts); + _nbNodes = static_cast(npts); _vtkIdList->SetNumberOfIds(_nbNodes); const int *ids = 0; switch (_type)