X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingCurveLinearMesh.hxx;h=7c15664904701288fbd94bda0c742623ca0d7acc;hb=75006818415ac26dc594b6abb806ba3c292a545c;hp=c165d1fb0c6384bc234211361ed07678b46b2af8;hpb=d5e5bd810b3f16d1b4df62cfb7c15dc7840ae9a1;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx index c165d1fb0..7c1566490 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-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 // 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 @@ -23,75 +23,72 @@ #include "MEDCoupling.hxx" #include "MEDCouplingStructuredMesh.hxx" -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" -namespace ParaMEDMEM +namespace MEDCoupling { - class DataArrayDouble; - class MEDCouplingUMesh; - - class MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh : public MEDCouplingStructuredMesh + class MEDCouplingCurveLinearMesh : public MEDCouplingStructuredMesh { public: - static MEDCouplingCurveLinearMesh *New(); - static MEDCouplingCurveLinearMesh *New(const char *meshName); - MEDCouplingMesh *deepCpy() const; - MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const; - void updateTime() const; - std::size_t getHeapMemorySize() const; - MEDCouplingMeshType getType() const { return CURVE_LINEAR; } - 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; - void getCoordinatesOfNode(int nodeId, std::vector& coo) const throw(INTERP_KERNEL::Exception); - std::string simpleRepr() const; - std::string advancedRepr() const; - DataArrayDouble *getCoords() throw(INTERP_KERNEL::Exception); - const DataArrayDouble *getCoords() const throw(INTERP_KERNEL::Exception); - void setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception); - void setNodeGridStructure(const int *gridStructBg, const int *gridStructEnd) throw(INTERP_KERNEL::Exception); - std::vector getNodeGridStructure() const throw(INTERP_KERNEL::Exception); - MEDCouplingStructuredMesh *buildStructuredSubPart(const std::vector< std::pair >& cellPart) const throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(); + MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(const std::string& meshName); + MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *deepCopy() const; + MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const; + MEDCOUPLING_EXPORT void updateTime() const; + MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; + MEDCOUPLING_EXPORT std::vector getDirectChildrenWithNull() const; + MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return CURVE_LINEAR; } + 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 checkConsistencyLight() const; + MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const; + MEDCOUPLING_EXPORT std::size_t getNumberOfCells() const; + MEDCOUPLING_EXPORT int getNumberOfNodes() 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 *getDirectAccessOfCoordsArrIfInStructure() const; + MEDCOUPLING_EXPORT DataArrayDouble *getCoords(); + MEDCOUPLING_EXPORT const DataArrayDouble *getCoords() const; + MEDCOUPLING_EXPORT void setCoords(const DataArrayDouble *coords); + MEDCOUPLING_EXPORT void setNodeGridStructure(const int *gridStructBg, const int *gridStructEnd); + MEDCOUPLING_EXPORT std::vector getNodeGridStructure() const; + MEDCOUPLING_EXPORT MEDCouplingStructuredMesh *buildStructuredSubPart(const std::vector< std::pair >& cellPart) const; // tools - 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; - DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const throw(INTERP_KERNEL::Exception); - void renumberCells(const int *old2NewBg, bool check=true) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT void getBoundingBox(double *bbox) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const; + MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const; + MEDCOUPLING_EXPORT void getCellsContainingPoint(const double *pos, double eps, std::vector& elts) 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 *computeCellCenterOfMass() 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; - void getNodeGridStructure(int *res) const; + MEDCOUPLING_EXPORT void getNodeGridStructure(int *res) 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); - void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception); + 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; + MEDCOUPLING_EXPORT std::string getVTKFileExtension() const; private: - void getMeasureFieldMeshDim1(bool isAbs, MEDCouplingFieldDouble *field) const throw(INTERP_KERNEL::Exception); - void getMeasureFieldMeshDim2(bool isAbs, MEDCouplingFieldDouble *field) const throw(INTERP_KERNEL::Exception); - void getMeasureFieldMeshDim3(bool isAbs, MEDCouplingFieldDouble *field) const throw(INTERP_KERNEL::Exception); + void getMeasureFieldMeshDim1(bool isAbs, MEDCouplingFieldDouble *field) const; + void getMeasureFieldMeshDim2(bool isAbs, MEDCouplingFieldDouble *field) const; + void getMeasureFieldMeshDim3(bool isAbs, MEDCouplingFieldDouble *field) const; void getBarycenterAndOwnerMeshDim3(DataArrayDouble *bary) const; void getBarycenterAndOwnerMeshDim2(DataArrayDouble *bary) const; void getBarycenterAndOwnerMeshDim1(DataArrayDouble *bary) const; @@ -99,10 +96,10 @@ namespace ParaMEDMEM MEDCouplingCurveLinearMesh(); MEDCouplingCurveLinearMesh(const MEDCouplingCurveLinearMesh& other, bool deepCpy); ~MEDCouplingCurveLinearMesh(); - 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: - MEDCouplingAutoRefCountObjectPtr _coords; + MCAuto _coords; std::vector _structure; }; }