X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileField1TS.hxx;h=007239a91afa9e66449d3094b490ee06aa9bd8a7;hb=3ccbd6672d4cab9ddd873774deb1276b43ccb621;hp=91efa14a6c0a93cf5ac7e1fb7db683c26fb16eed;hpb=f2ab61e92f55ee52cf5196f7904f625d93c8c2d0;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileField1TS.hxx b/src/MEDLoader/MEDFileField1TS.hxx index 91efa14a6..007239a91 100644 --- a/src/MEDLoader/MEDFileField1TS.hxx +++ b/src/MEDLoader/MEDFileField1TS.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D +// Copyright (C) 2007-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -32,7 +32,7 @@ namespace MEDCoupling { class TimeHolder; class MEDFileMeshes; - + /*! * SDA is for Shared Data Arrays such as profiles. */ @@ -117,9 +117,11 @@ namespace MEDCoupling MEDLOADER_EXPORT void allocNotFromFile(mcIdType newNbOfTuples); MEDLOADER_EXPORT bool allocIfNecessaryTheArrayToReceiveDataFromFile(); MEDLOADER_EXPORT void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities, const MEDFileCapability *capability = nullptr); + MEDLOADER_EXPORT void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities, const MEDFileCapability *capability = nullptr); MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc); MEDLOADER_EXPORT void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc); MEDLOADER_EXPORT void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const MEDFileMeshes *ms, const MEDFileEntities *entities); + MEDLOADER_EXPORT void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc, const PartDefinition *pd, const MEDFileEntities *entities); MEDLOADER_EXPORT void unloadArrays(); MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const; MEDLOADER_EXPORT static std::string FieldNameToMEDFileConvention(const std::string& nonCorrectFieldName); @@ -185,6 +187,8 @@ namespace MEDCoupling MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *shallowCpy() const; MEDLOADER_EXPORT MEDFileField1TSWithoutSDA *deepCopy() const; MEDLOADER_EXPORT MEDFileInt32Field1TSWithoutSDA *convertToInt() const; + MEDLOADER_EXPORT MEDFileInt64Field1TSWithoutSDA *convertToInt64() const; + MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA *convertToFloat() const; public: static const char TYPE_STR[]; }; @@ -198,7 +202,7 @@ namespace MEDCoupling MEDFileField1TSNDTemplateWithoutSDA() { } MEDFileField1TSNDTemplateWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos):MEDFileField1TSTemplateWithoutSDA(fieldName,meshName,csit,iteration,order) { } }; - + /*! * SDA is for Shared Data Arrays such as profiles. */ @@ -276,6 +280,8 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); + MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, int iteration, int order, const PartDefinition *pd, const MEDFileEntities *entities); + MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *AllocateContentFrom(med_idt fid, const std::string& fieldName, int iteration=-1, int order=-1); MEDLOADER_EXPORT void writeLL(med_idt fid) const; // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content public: @@ -287,6 +293,9 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true); MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities); MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileEntities *entities); + MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *NewAdv(med_idt fid, const std::string& fieldName, int iteration, int order, const MEDFileEntities *entities, const std::vector& distrib); + + MEDLOADER_EXPORT virtual MCAuto buildNewEmpty() const = 0; MEDLOADER_EXPORT int getDimension() const; MEDLOADER_EXPORT int getIteration() const; MEDLOADER_EXPORT int getOrder() const; @@ -372,6 +381,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static typename MLFieldTraits::F1TSType *New(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll=true); MEDLOADER_EXPORT static typename MLFieldTraits::F1TSType *New(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll=true); MEDLOADER_EXPORT static typename MLFieldTraits::F1TSType *New(const typename MLFieldTraits::F1TSWSDAType& other, bool shallowCopyOfContent); + public: MEDLOADER_EXPORT static typename Traits::ArrayType *ReturnSafelyTypedDataArray(MCAuto& arr); MEDLOADER_EXPORT typename Traits::ArrayType *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayIdType *&pfl) const; @@ -413,7 +423,9 @@ namespace MEDCoupling friend class MEDFileTemplateField1TS; public: MEDLOADER_EXPORT MEDFileInt32Field1TS *convertToInt(bool isDeepCpyGlobs=true) const; + MEDLOADER_EXPORT MEDFileInt64Field1TS *convertToInt64(bool isDeepCpyGlobs=true) const; public: + MEDLOADER_EXPORT MCAuto buildNewEmpty() const; MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const; MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; @@ -435,6 +447,8 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT MEDFileField1TS *convertToDouble(bool isDeepCpyGlobs=true) const; + MEDLOADER_EXPORT MEDFileField1TS *convertToInt(bool isDeepCpyGlobs=true) const; + MEDLOADER_EXPORT MEDFileField1TS *convertToInt64(bool isDeepCpyGlobs=true) const; protected: ~MEDFileNDTemplateField1TS() { } MEDFileNDTemplateField1TS() { } @@ -448,6 +462,7 @@ namespace MEDCoupling { friend class MEDFileTemplateField1TS; public: + MEDLOADER_EXPORT MCAuto buildNewEmpty() const; MEDLOADER_EXPORT MEDFileInt32Field1TS *shallowCpy() const { return new MEDFileInt32Field1TS(*this); } MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt32Field1TS"); } public: @@ -473,6 +488,7 @@ namespace MEDCoupling { friend class MEDFileTemplateField1TS; public: + MEDLOADER_EXPORT MCAuto buildNewEmpty() const; MEDLOADER_EXPORT MEDFileInt64Field1TS *shallowCpy() const { return new MEDFileInt64Field1TS(*this); } MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileInt64Field1TS"); } public: @@ -501,6 +517,7 @@ namespace MEDCoupling med_field_type getMEDFileFieldType() const { return MED_FLOAT32; } MEDLOADER_EXPORT MEDFileFloatField1TS *shallowCpy() const { return new MEDFileFloatField1TS(*this); } MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFloatField1TS"); } + MEDLOADER_EXPORT MCAuto buildNewEmpty() const; private: ~MEDFileFloatField1TS() { } MEDFileFloatField1TS() { }