From: geay Date: Wed, 14 May 2014 08:45:27 +0000 (+0200) Subject: First try to correct MEDReader problem under Windows. X-Git-Tag: V7_4_0rc1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a8ecf8056dd2b5fb0546474a74488830eed2a18f;p=modules%2Fparavis.git First try to correct MEDReader problem under Windows. --- diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index f3b575f2..26a9c6cd 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -234,6 +234,11 @@ std::string MEDFileFieldRepresentationLeavesArrays::getZeName() const return _ze_full_name; } +const char *MEDFileFieldRepresentationLeavesArrays::getZeNameC() const +{ + return _ze_full_name.c_str(); +} + void MEDFileFieldRepresentationLeavesArrays::feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const { vtkIdType refId(sil->AddChild(root,edge)); @@ -1038,6 +1043,12 @@ std::string MEDFileFieldRepresentationTree::getNameOf(int id) const return elt.getZeName(); } +const char *MEDFileFieldRepresentationTree::getNameOfC(int id) const +{ + const MEDFileFieldRepresentationLeavesArrays& elt(getLeafArr(id)); + return elt.getZeNameC(); +} + bool MEDFileFieldRepresentationTree::getStatusOf(int id) const { const MEDFileFieldRepresentationLeavesArrays& elt(getLeafArr(id)); diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 4df798d6..6ee4b8e0 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -72,6 +72,7 @@ public: bool getStatus() const; bool setStatus(bool status) const; std::string getZeName() const; + const char *getZeNameC() const; void appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshStruct *mst, vtkDataSet *ds) const; void appendELGAIfAny(vtkDataSet *ds) const; public: @@ -136,6 +137,7 @@ public: void feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; std::string feedSILForFamsAndGrps(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; std::string getNameOf(int id) const; + const char *getNameOfC(int id) const; bool getStatusOf(int id) const; int getIdHavingZeName(const char *name) const; bool changeStatusOfAndUpdateToHaveCoherentVTKDataSet(int id, bool status) const; diff --git a/src/Plugins/MEDReader/IO/vtkMEDReader.cxx b/src/Plugins/MEDReader/IO/vtkMEDReader.cxx index 70adeab5..769e87a4 100644 --- a/src/Plugins/MEDReader/IO/vtkMEDReader.cxx +++ b/src/Plugins/MEDReader/IO/vtkMEDReader.cxx @@ -371,9 +371,8 @@ int vtkMEDReader::GetNumberOfFieldsTreeArrays() const char *vtkMEDReader::GetFieldsTreeArrayName(int index) { - std::string ret(this->Internal->Tree.getNameOf(index)); + return this->Internal->Tree.getNameOfC(index); //std::cerr << "vtkMEDReader::GetFieldsTreeArrayName(" << index << ") called ! " << ret << std::endl; - return ret.c_str(); } int vtkMEDReader::GetFieldsTreeArrayStatus(const char *name)