Salome HOME
Porting to ParaView version b5c4c893ca879ecb55742e811cc47c289e3c383
[modules/paravis.git] / src / Plugins / MEDReader / IO / MEDUtilities.cxx
index 4dbf970341939e573fcb84b7b772f354556f1c59..22eaf3768bf1291fbf3adfce5bd85b8120b4a4f5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "vtkInformationIntegerKey.h"
 #include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
 
+#include <algorithm>
+
 vtkInformationKeyMacro(MEDUtilities,ELGA,Integer);
 vtkInformationKeyMacro(MEDUtilities,ELNO,Integer);
+
+void ExportedTinyInfo::pushGaussAdditionnalInfo(int ct, int dim, const std::vector<double>& refCoo, const std::vector<double>& posInRefCoo)
+{
+  prepareForAppend();
+  std::vector<double> tmp(1,(double)ct);
+  tmp.push_back((double)dim);
+  tmp.insert(tmp.end(),refCoo.begin(),refCoo.end());
+  tmp.insert(tmp.end(),posInRefCoo.begin(),posInRefCoo.end());
+  _data.push_back((double)tmp.size());
+  _data.insert(_data.end(),tmp.begin(),tmp.end());
+}
+
+void ExportedTinyInfo::prepareForAppend()
+{
+  if(_data.empty())
+    _data.push_back(1.);
+  else
+    {
+      double val(_data[0]);
+      int val2((int) val);
+      _data[0]=++val2;
+    }
+}