From: Anthony Geay Date: Tue, 19 Apr 2016 06:35:10 +0000 (+0200) Subject: Make the vtkMEDReader::META_DATA info key accessible from the outside without dependa... X-Git-Tag: V7_8_0a2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e54758a2008aa21844f649b1379360bf1a1ee61c;p=modules%2Fparavis.git Make the vtkMEDReader::META_DATA info key accessible from the outside without dependancies. --- diff --git a/src/Plugins/MEDReader/IO/vtkMEDReader.cxx b/src/Plugins/MEDReader/IO/vtkMEDReader.cxx index 4169733c..7c4b308c 100644 --- a/src/Plugins/MEDReader/IO/vtkMEDReader.cxx +++ b/src/Plugins/MEDReader/IO/vtkMEDReader.cxx @@ -197,7 +197,24 @@ private: }; vtkStandardNewMacro(vtkMEDReader); -vtkInformationKeyMacro(vtkMEDReader, META_DATA, DataObjectMetaData); + +// vtkInformationKeyMacro(vtkMEDReader, META_DATA, DataObjectMetaData); // Here we need to customize vtkMEDReader::META_DATA method +// start of overload of vtkInformationKeyMacro +static vtkInformationDataObjectMetaDataKey *vtkMEDReader_META_DATA=new vtkInformationDataObjectMetaDataKey("META_DATA","vtkMEDReader"); + +vtkInformationDataObjectMetaDataKey *vtkMEDReader::META_DATA() +{ + static const char ZE_KEY[]="vtkMEDReader::META_DATA"; + vtkInformationDataObjectMetaDataKey *ret(vtkMEDReader_META_DATA); + ParaMEDMEM::GlobalDict *gd(ParaMEDMEM::GlobalDict::GetInstance()); + if(!gd->hasKey(ZE_KEY)) + {// here META_DATA is put on global var to be exchanged with other filters without dependancy of MEDReader. Please do not change ZE_KEY ! + std::ostringstream oss; oss << ret; + gd->setKeyValue(ZE_KEY,oss.str()); + } + return ret; +} +// end of overload of vtkInformationKeyMacro vtkMEDReader::vtkMEDReader():Internal(new vtkMEDReaderInternal(this)) {