From 110bda1b01a0359d69e30d272346cc98bef709f0 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 29 Jan 2016 15:15:09 +0100 Subject: [PATCH] GlobalNodeIds in MEDReader in // context. --- .../MEDReader/IO/MEDFileFieldRepresentationTree.cxx | 13 +++++++++++++ .../MEDReader/IO/MEDFileFieldRepresentationTree.hxx | 1 + 2 files changed, 14 insertions(+) diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index c065849c..d75937d5 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -68,6 +68,8 @@ const char MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME[]="Family const char MEDFileFieldRepresentationLeavesArrays::NUM_ID_NODE_NAME[]="NumIdNode"; +const char MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME[]="GlobalNodeIds";// WARNING DO NOT CHANGE IT BEFORE HAVING CHECKED IN PV SOURCES ! + const char MEDFileFieldRepresentationTree::ROOT_OF_GRPS_IN_TREE[]="zeGrps"; const char MEDFileFieldRepresentationTree::ROOT_OF_FAM_IDS_IN_TREE[]="zeFamIds"; @@ -879,6 +881,17 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio vtkTab->Delete(); numNodes->decrRef(); } + // Global Node Ids if any ! (In // mode) + DataArrayInt *gni(ptMML2->retrieveGlobalNodeIdsIfAny()); + if(gni) + { + vtkIntArray *vtkTab(vtkIntArray::New()); + vtkTab->SetNumberOfComponents(1); + vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME); + vtkTab->SetArray(gni->getPointer(),gni->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); + gni->accessToMemArray().setSpecificDeallocator(0); + gni->decrRef(); + } return ret; } diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 364a1c2c..9e4303c9 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -85,6 +85,7 @@ public: static const char NUM_ID_CELL_NAME[]; static const char FAMILY_ID_NODE_NAME[]; static const char NUM_ID_NODE_NAME[]; + static const char GLOBAL_NODE_ID_NAME[]; private: mutable bool _activated; mutable int _id; -- 2.39.2