X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FIO%2FMEDFileFieldRepresentationTree.hxx;h=be6da38535b584f6daefc78aa3e1e95eefa34485;hb=eb9a54c7c13624ca227d587e5ae33fcdba29e40f;hp=6ee4b8e0551ef4bb5513edf0a8fa35388025eef3;hpb=a8ecf8056dd2b5fb0546474a74488830eed2a18f;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 6ee4b8e0..be6da385 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2014 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 @@ -23,10 +23,12 @@ #include "MEDFileMesh.hxx" #include "MEDFileField.hxx" +#include "MEDLoaderForPV.h" #include "vtkType.h" #include +#include class vtkQuadratureSchemeDefinition; class vtkMutableDirectedGraph; @@ -36,20 +38,24 @@ class vtkStructuredGrid; class vtkVariantArray; class vtkIdTypeArray; class vtkDoubleArray; +class vtkDataArray; class vtkDataSet; class TimeKeeper; class MEDTimeReq; +class ExportedTinyInfo; class ELGACmp { public: - vtkIdTypeArray *findOrCreate(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const; + template + vtkIdTypeArray *findOrCreate(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDataArray *vtkd, vtkDataSet *ds, bool& isNew, ExportedTinyInfo *internalInfo) const; void appendELGAIfAny(vtkDataSet *ds) const; ~ELGACmp(); private: - vtkIdTypeArray *isExisting(const std::vector& locsReallyUsed, vtkDoubleArray *vtkd) const; - vtkIdTypeArray *createNew(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const; + vtkIdTypeArray *isExisting(const std::vector& locsReallyUsed, vtkDataArray *vtkd) const; + template + vtkIdTypeArray *createNew(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDataArray *vtkd, vtkDataSet *ds, ExportedTinyInfo *internalInfo) const; private: //! size of _loc_names is equal to _elgas. mutable std::vector< std::vector > _loc_names; @@ -59,11 +65,11 @@ private: mutable std::vector< std::vector< std::pair< vtkQuadratureSchemeDefinition *, unsigned char > > > _defs; }; -class MEDFileFieldRepresentationLeavesArrays : public ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeavesArrays : public MEDCoupling::MCAuto { public: MEDFileFieldRepresentationLeavesArrays(); - MEDFileFieldRepresentationLeavesArrays(const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr& arr); + MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MCAuto& arr); MEDFileFieldRepresentationLeavesArrays& operator=(const MEDFileFieldRepresentationLeavesArrays& other); int getId() const; void setId(int& id) const; @@ -73,7 +79,7 @@ public: 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 appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshStruct *mst, vtkDataSet *ds, ExportedTinyInfo *internalInfo) const; void appendELGAIfAny(vtkDataSet *ds) const; public: static const char ZE_SEP[]; @@ -83,6 +89,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; @@ -91,22 +98,23 @@ private: ELGACmp _elga_cmp; }; -class MEDFileFieldRepresentationLeaves +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeaves { public: MEDFileFieldRepresentationLeaves(); - MEDFileFieldRepresentationLeaves(const std::vector< ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr >& arr, - const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr& fsp); + MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MCAuto >& arr, + const MEDCoupling::MCAuto& fsp); ~MEDFileFieldRepresentationLeaves(); bool empty() const; void setId(int& id) const; std::string getMeshName() const; int getNumberOfArrays() const; int getNumberOfTS() const; - void feedSIL(const ParaMEDMEM::MEDFileMeshes *ms, const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; + void feedSIL(const MEDCoupling::MEDFileMeshes *ms, const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; void computeFullNameInLeaves(const std::string& tsName, const std::string& meshName, const std::string& comSupStr) const; bool containId(int id) const; bool containZeName(const char *name, int& id) const; + void dumpState(std::map& status) const; bool isActivated() const; void printMySelf(std::ostream& os) const; void activateAllArrays() const; @@ -114,19 +122,19 @@ public: std::vector getTimeSteps(const TimeKeeper& tk) const; std::vector< std::pair > getTimeStepsInCoarseMEDFileFormat(std::vector& ts) const; std::string getHumanReadableOverviewOfTS() const; - vtkDataSet *buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDFileMeshes *meshes) const; + vtkDataSet *buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDFileMeshes *meshes, ExportedTinyInfo *internalInfo=0) const; private: - vtkUnstructuredGrid *buildVTKInstanceNoTimeInterpolationUnstructured(ParaMEDMEM::MEDUMeshMultiLev *mm) const; - vtkRectilinearGrid *buildVTKInstanceNoTimeInterpolationCartesian(ParaMEDMEM::MEDCMeshMultiLev *mm) const; - vtkStructuredGrid *buildVTKInstanceNoTimeInterpolationCurveLinear(ParaMEDMEM::MEDCurveLinearMeshMultiLev *mm) const; - void appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshes *meshes, vtkDataSet *ds) const; + vtkUnstructuredGrid *buildVTKInstanceNoTimeInterpolationUnstructured(MEDCoupling::MEDUMeshMultiLev *mm) const; + vtkRectilinearGrid *buildVTKInstanceNoTimeInterpolationCartesian(MEDCoupling::MEDCMeshMultiLev *mm) const; + vtkStructuredGrid *buildVTKInstanceNoTimeInterpolationCurveLinear(MEDCoupling::MEDCurveLinearMeshMultiLev *mm) const; + void appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshes *meshes, vtkDataSet *ds, ExportedTinyInfo *internalInfo=0) const; private: std::vector _arrays; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _fsp; + MEDCoupling::MCAuto _fsp; mutable vtkDataSet *_cached_ds; }; -class MEDFileFieldRepresentationTree +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationTree { public: MEDFileFieldRepresentationTree(); @@ -135,6 +143,7 @@ public: void activateTheFirst() const; void computeFullNameInLeaves() const; void feedSIL(vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; + std::string getActiveMeshName() 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; @@ -145,10 +154,12 @@ public: // std::string getDftMeshName() const; std::vector getTimeSteps(int& lev0, const TimeKeeper& tk) const; - vtkDataSet *buildVTKInstance(bool isStdOrMode, double timeReq, std::string& meshName, const TimeKeeper& tk) const; + vtkDataSet *buildVTKInstance(bool isStdOrMode, double timeReq, std::string& meshName, const TimeKeeper& tk, ExportedTinyInfo *internalInfo=0) const; void printMySelf(std::ostream& os) const; + std::map dumpState() const; //non const methods - void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv); + void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts); + void loadInMemory(MEDCoupling::MEDFileFields *fields, MEDCoupling::MEDFileMeshes *meshes); void removeEmptyLeaves(); // static methods static bool IsFieldMeshRegardingInfo(const std::vector& compInfos); @@ -160,17 +171,18 @@ public: private: const MEDFileFieldRepresentationLeavesArrays& getLeafArr(int id) const; const MEDFileFieldRepresentationLeaves& getTheSingleActivated(int& lev0, int& lev1, int& lev2) const; - static ParaMEDMEM::MEDFileFields *BuildFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms); - static void AppendFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms, ParaMEDMEM::MEDFileFields *ret); + static MEDCoupling::MEDFileFields *BuildFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms); + static void AppendFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms, MEDCoupling::MEDFileFields *ret); + static std::string BuildAUniqueArrayNameForMesh(const std::string& meshName, const MEDCoupling::MEDFileFields *ret); static std::vector SplitFieldNameIntoParts(const std::string& fullFieldName, char sep); private: // 1st : timesteps, 2nd : meshName, 3rd : common support std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > > _data_structure; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _ms; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _fields; + MEDCoupling::MCAuto _ms; + MEDCoupling::MCAuto _fields; }; -class TimeKeeper +class MEDLOADERFORPV_EXPORT TimeKeeper { public: TimeKeeper(int policy);