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
This commit is contained in:
wmayer
2018-05-13 18:05:07 +02:00
parent 0b3f02ec5b
commit 753f514d3b
2 changed files with 7 additions and 7 deletions

View File

@@ -27,12 +27,10 @@
#ifndef _SMDSAbs_ElementType_HeaderFile
#define _SMDSAbs_ElementType_HeaderFile
#include <cstddef>
///////////////////////////////////////////////////////////////////////////////
/// 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,

View File

@@ -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<int>(npts);
_vtkIdList->SetNumberOfIds(_nbNodes);
const int *ids = 0;
switch (_type)