Properly fix the Tetrahedron node ordering with VTK. This was reported into

PR #203 back this summer 2016. A memory overwrite is happening if the enum are not
properly sized
This commit is contained in:
Jean-Marie Verdun 2017-03-03 22:10:29 +01:00 committed by Yorik van Havre
parent 19f8fd4c10
commit 732bd85c47
2 changed files with 7 additions and 6 deletions

View File

@ -30,7 +30,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Type (node, edge, face or volume) of elements
///////////////////////////////////////////////////////////////////////////////
enum SMDSAbs_ElementType
enum SMDSAbs_ElementType : unsigned long
{
SMDSAbs_All,
SMDSAbs_Node,
@ -43,7 +43,7 @@ enum SMDSAbs_ElementType
};
/*! enumeration for element geometry type */
enum SMDSAbs_GeometryType
enum SMDSAbs_GeometryType : unsigned long
{
// 0D element
SMDSGeom_POINT,
@ -67,7 +67,8 @@ enum SMDSAbs_GeometryType
};
enum SMDSAbs_ElementOrder {
enum SMDSAbs_ElementOrder : unsigned long
{
ORDER_ANY, /*! entities of any order */
ORDER_LINEAR, /*! entities of 1st order */
ORDER_QUADRATIC /*! entities of 2nd order */
@ -76,7 +77,8 @@ enum SMDSAbs_ElementOrder {
/*!
* Enumeration of entity type used in mesh info array
*/
enum SMDSAbs_EntityType {
enum SMDSAbs_EntityType : unsigned long
{
SMDSEntity_Node,
SMDSEntity_0D,
SMDSEntity_Edge,

View File

@ -63,7 +63,7 @@ SMDS_VtkCellIteratorToUNV::SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCel
_mesh = mesh;
_cellId = vtkCellId;
_index = 0;
// _type = aType;
_type = aType;
//MESSAGE("SMDS_VtkCellInterlacedIterator (UNV)" << _type);
_vtkIdList = vtkIdList::New();
@ -72,7 +72,6 @@ SMDS_VtkCellIteratorToUNV::SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCel
grid->GetCellPoints((vtkIdType)_cellId, (vtkIdType&)_nbNodes, pts);
_vtkIdList->SetNumberOfIds(_nbNodes);
const int *ids = 0;
_type = aType;
switch (_type)
{
case SMDSEntity_Quad_Edge: