X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingCMesh.hxx;h=e19f6a099b719fa04d3aaf71695a76f09526aa10;hb=f13ce72017fd205546293a53f7b041824cb50eec;hp=39407ebb61b38ad370837674e2035cd18a8ee09e;hpb=293a6104470482e450701aa8061d9b244f2057d5;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index 39407ebb6..e19f6a099 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2014 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 // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -22,90 +22,71 @@ #define __PARAMEDMEM_MEDCOUPLINGCMESH_HXX__ #include "MEDCoupling.hxx" -#include "MEDCouplingMesh.hxx" +#include "MEDCouplingStructuredMesh.hxx" namespace ParaMEDMEM { - class DataArrayDouble; - class MEDCouplingUMesh; - - class MEDCOUPLING_EXPORT MEDCouplingCMesh : public MEDCouplingMesh + class MEDCouplingCMesh : public MEDCouplingStructuredMesh { public: - static MEDCouplingCMesh *New(); - static MEDCouplingCMesh *New(const char *meshName); - MEDCouplingMesh *deepCpy() const; - MEDCouplingCMesh *clone(bool recDeepCpy) const; - void updateTime() const; - MEDCouplingMeshType getType() const { return CARTESIAN; } - void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception); - bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception); - bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; - void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec, - DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw(INTERP_KERNEL::Exception); - void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec, - DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception); - void checkCoherency() const throw(INTERP_KERNEL::Exception); - void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception); - void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception); - int getNumberOfCells() const; - int getNumberOfNodes() const; - int getSpaceDimension() const; - int getMeshDimension() const; - int getCellIdFromPos(int i, int j, int k) const; - int getNodeIdFromPos(int i, int j, int k) const; - static void GetPosFromId(int nodeId, int spaceDim, const int *split, int *res); - INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const; - std::set getAllGeoTypes() const; - int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; - void getNodeIdsOfCell(int cellId, std::vector& conn) const; - void getCoordinatesOfNode(int nodeId, std::vector& coo) const throw(INTERP_KERNEL::Exception); - std::string simpleRepr() const; - std::string advancedRepr() const; - const DataArrayDouble *getCoordsAt(int i) const throw(INTERP_KERNEL::Exception); - DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception); - void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception); - void setCoords(const DataArrayDouble *coordsX, - const DataArrayDouble *coordsY=0, - const DataArrayDouble *coordsZ=0); + MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(); + MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(const std::string& meshName); + MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; + MEDCOUPLING_EXPORT MEDCouplingCMesh *clone(bool recDeepCpy) const; + MEDCOUPLING_EXPORT void updateTime() const; + MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; + MEDCOUPLING_EXPORT std::vector getDirectChildren() const; + MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return CARTESIAN; } + MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other); + MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const; + MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; + MEDCOUPLING_EXPORT void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec, + DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const; + MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec, + DataArrayInt *&cellCor) const; + MEDCOUPLING_EXPORT void checkCoherency() const; + MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; + MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; + MEDCOUPLING_EXPORT int getSpaceDimension() const; + MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector& coo) const; + MEDCOUPLING_EXPORT std::string simpleRepr() const; + MEDCOUPLING_EXPORT std::string advancedRepr() const; + MEDCOUPLING_EXPORT const DataArrayDouble *getCoordsAt(int i) const; + MEDCOUPLING_EXPORT DataArrayDouble *getCoordsAt(int i); + MEDCOUPLING_EXPORT void setCoordsAt(int i, const DataArrayDouble *arr); + MEDCOUPLING_EXPORT void setCoords(const DataArrayDouble *coordsX, + const DataArrayDouble *coordsY=0, + const DataArrayDouble *coordsZ=0); // tools - std::vector getDistributionOfTypes() const throw(INTERP_KERNEL::Exception); - DataArrayInt *checkTypeConsistencyAndContig(const std::vector& code, const std::vector& idsPerType) const throw(INTERP_KERNEL::Exception); - void splitProfilePerType(const DataArrayInt *profile, std::vector& code, std::vector& idsInPflPerType, std::vector& idsPerType) const throw(INTERP_KERNEL::Exception); - MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception); - MEDCouplingMesh *buildPart(const int *start, const int *end) const; - MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const; - DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception); - void getBoundingBox(double *bbox) const; - MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; - MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const; - MEDCouplingFieldDouble *buildOrthogonalField() const; - int getCellContainingPoint(const double *pos, double eps) const; - void rotate(const double *center, const double *vector, double angle); - void translate(const double *vector); - void scale(const double *point, double factor); - MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const; - DataArrayDouble *getCoordinatesAndOwner() const; - DataArrayDouble *getBarycenterAndOwner() const; - void renumberCells(const int *old2NewBg, bool check=true) throw(INTERP_KERNEL::Exception); - void fill1DUnstructuredMesh(MEDCouplingUMesh *m) const; - void fill2DUnstructuredMesh(MEDCouplingUMesh *m) const; - void fill3DUnstructuredMesh(MEDCouplingUMesh *m) const; + MEDCOUPLING_EXPORT void getBoundingBox(double *bbox) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const; + MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const; + MEDCOUPLING_EXPORT void rotate(const double *center, const double *vector, double angle); + MEDCOUPLING_EXPORT void translate(const double *vector); + MEDCOUPLING_EXPORT void scale(const double *point, double factor); + MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const; + MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const; + MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const; + MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const; + MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true); //some useful methods - void getSplitCellValues(int *res) const; - void getSplitNodeValues(int *res) const; + MEDCOUPLING_EXPORT void getNodeGridStructure(int *res) const; + MEDCOUPLING_EXPORT std::vector getNodeGridStructure() const; + MEDCouplingStructuredMesh *buildStructuredSubPart(const std::vector< std::pair >& cellPart) const; //serialisation-unserialization - void getTinySerializationInformation(std::vector& tinyInfoD, std::vector& tinyInfo, std::vector& littleStrings) const; - void resizeForUnserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector& littleStrings) const; - void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const; - void unserialization(const std::vector& tinyInfoD, const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, - const std::vector& littleStrings); + MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector& tinyInfoD, std::vector& tinyInfo, std::vector& littleStrings) const; + MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector& littleStrings) const; + MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const; + MEDCOUPLING_EXPORT void unserialization(const std::vector& tinyInfoD, const std::vector& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, + const std::vector& littleStrings); + MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const; private: MEDCouplingCMesh(); MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy); ~MEDCouplingCMesh(); - void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception); - std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception); + void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const; + std::string getVTKDataSetType() const; private: DataArrayDouble *_x_array; DataArrayDouble *_y_array;