]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Make the vtkMEDReader::META_DATA info key accessible from the outside without dependa...
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 19 Apr 2016 06:35:10 +0000 (08:35 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 19 Apr 2016 06:35:10 +0000 (08:35 +0200)
src/Plugins/MEDReader/IO/vtkMEDReader.cxx

index 4169733c35c696f36fe4d1c999fc5b3f6e10777e..7c4b308cb9e3f0ba9c631f19c7a089d6352284db 100644 (file)
@@ -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))
 {