Skip to content

Commit

Permalink
Properly fix the Tetrahedron node ordering with VTK. This was reporte…
Browse files Browse the repository at this point in the history
…d into

PR #203 back this summer 2016. A memory overwrite is happening if the enum are not
properly sized
  • Loading branch information
Jean-Marie Verdun authored and yorikvanhavre committed Mar 4, 2017
1 parent 19f8fd4 commit 732bd85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/3rdParty/salomesmesh/inc/SMDSAbs_ElementType.hxx
Expand Up @@ -30,7 +30,7 @@
///////////////////////////////////////////////////////////////////////////////
/// Type (node, edge, face or volume) of elements
///////////////////////////////////////////////////////////////////////////////
enum SMDSAbs_ElementType
enum SMDSAbs_ElementType : unsigned long
{
SMDSAbs_All,
SMDSAbs_Node,
Expand All @@ -43,7 +43,7 @@ enum SMDSAbs_ElementType
};

/*! enumeration for element geometry type */
enum SMDSAbs_GeometryType
enum SMDSAbs_GeometryType : unsigned long
{
// 0D element
SMDSGeom_POINT,
Expand All @@ -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 */
Expand All @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/3rdParty/salomesmesh/src/SMDS/SMDS_VtkCellIterator.cpp
Expand Up @@ -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();
Expand All @@ -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:
Expand Down

0 comments on commit 732bd85

Please sign in to comment.