From: abn Date: Fri, 15 Jan 2016 14:14:55 +0000 (+0100) Subject: Fixing various C++ covariances mismatches in the API X-Git-Tag: V8_0_0b1~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a321a930be12a5b5d9add8b6a5c66feead02270;p=tools%2Fmedcoupling.git Fixing various C++ covariances mismatches in the API + MEDCouplingUMesh deepCpyConnectivityOnly mergeMyselfWithOnSameCoords buildPartOfMySelf buildPartOfMySelfNode buildPartOfMySelf2 buildFacePartOfMySelfNode buildBoundaryMesh buildPartOfMySelfKeepCoords buildPartOfMySelfKeepCoords2 + MEDCouplingExtrudedMesh deepCpy + MEDCouplingIMesh deepCpy --- diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index 3df24b33b..364fa8811 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -157,7 +157,7 @@ int MEDCouplingExtrudedMesh::getMeshDimension() const return 3; } -MEDCouplingMesh *MEDCouplingExtrudedMesh::deepCpy() const +MEDCouplingExtrudedMesh *MEDCouplingExtrudedMesh::deepCpy() const { return clone(true); } diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index c72f42cf4..f436e434d 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -46,7 +46,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT int getNumberOfNodes() const; MEDCOUPLING_EXPORT int getSpaceDimension() const; MEDCOUPLING_EXPORT int getMeshDimension() const; - MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; + MEDCOUPLING_EXPORT MEDCouplingExtrudedMesh *deepCpy() const; MEDCouplingExtrudedMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const; MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; diff --git a/src/MEDCoupling/MEDCouplingIMesh.cxx b/src/MEDCoupling/MEDCouplingIMesh.cxx index e7a4ae0ac..cd68a17da 100644 --- a/src/MEDCoupling/MEDCouplingIMesh.cxx +++ b/src/MEDCoupling/MEDCouplingIMesh.cxx @@ -65,7 +65,7 @@ MEDCouplingIMesh *MEDCouplingIMesh::New(const std::string& meshName, int spaceDi return ret.retn(); } -MEDCouplingMesh *MEDCouplingIMesh::deepCpy() const +MEDCouplingIMesh *MEDCouplingIMesh::deepCpy() const { return clone(true); } diff --git a/src/MEDCoupling/MEDCouplingIMesh.hxx b/src/MEDCoupling/MEDCouplingIMesh.hxx index 415770326..a9a1eb5f1 100644 --- a/src/MEDCoupling/MEDCouplingIMesh.hxx +++ b/src/MEDCoupling/MEDCouplingIMesh.hxx @@ -54,7 +54,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static void SpreadCoarseToFineGhost(const DataArrayDouble *coarseDA, const std::vector& coarseSt, DataArrayDouble *fineDA, const std::vector< std::pair >& fineLocInCoarse, const std::vector& facts, int ghostSize); MEDCOUPLING_EXPORT static void SpreadCoarseToFineGhostZone(const DataArrayDouble *coarseDA, const std::vector& coarseSt, DataArrayDouble *fineDA, const std::vector< std::pair >& fineLocInCoarse, const std::vector& facts, int ghostSize); // - MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; + MEDCOUPLING_EXPORT MEDCouplingIMesh *deepCpy() const; MEDCOUPLING_EXPORT MEDCouplingIMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCouplingIMesh *buildWithGhost(int ghostLev) const; MEDCOUPLING_EXPORT void updateTime() const; diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index f86207a30..7a0926ef3 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -100,7 +100,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::clone(bool recDeepCpy) const * \return MEDCouplingUMesh * - A new object instance holding the copy of \a this (deep for connectivity, shallow for coordiantes) * \sa MEDCouplingUMesh::deepCpy */ -MEDCouplingPointSet *MEDCouplingUMesh::deepCpyConnectivityOnly() const +MEDCouplingUMesh *MEDCouplingUMesh::deepCpyConnectivityOnly() const { checkConnectivityFullyDefined(); MEDCouplingAutoRefCountObjectPtr ret=clone(false); @@ -2005,7 +2005,7 @@ bool MEDCouplingUMesh::areCellsIncludedIn2(const MEDCouplingUMesh *other, DataAr return true; } -MEDCouplingPointSet *MEDCouplingUMesh::mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const +MEDCouplingUMesh *MEDCouplingUMesh::mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const { if(!other) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::mergeMyselfWithOnSameCoords : input other is null !"); @@ -2032,10 +2032,10 @@ MEDCouplingPointSet *MEDCouplingUMesh::mergeMyselfWithOnSameCoords(const MEDCoup * \warning This method modifies can generate an unstructured mesh whose cells are not sorted by geometric type order. * In view of the MED file writing, a renumbering of cells of returned unstructured mesh (using MEDCouplingUMesh::sortCellsInMEDFileFrmt) should be necessary. */ -MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelf2(int start, int end, int step, bool keepCoords) const +MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelf2(int start, int end, int step, bool keepCoords) const { if(getMeshDimension()!=-1) - return MEDCouplingPointSet::buildPartOfMySelf2(start,end,step,keepCoords); + return static_cast(MEDCouplingPointSet::buildPartOfMySelf2(start,end,step,keepCoords)); else { int newNbOfCells=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::buildPartOfMySelf2 for -1 dimension mesh "); @@ -2060,7 +2060,7 @@ MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelf2(int start, int end, in * \param [in] keepCoords - if \c true, the result mesh shares the node coordinates * array of \a this mesh, else "free" nodes are removed from the result mesh * by calling zipCoords(). - * \return MEDCouplingPointSet * - a new instance of MEDCouplingUMesh. The caller is + * \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is * to delete this mesh using decrRef() as it is no more needed. * \throw If the coordinates array is not set. * \throw If the nodal connectivity of cells is not defined. @@ -2071,10 +2071,10 @@ MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelf2(int start, int end, in * \ref py_mcumesh_buildPartOfMySelf "Here is a Python example". * \endif */ -MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelf(const int *begin, const int *end, bool keepCoords) const +MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelf(const int *begin, const int *end, bool keepCoords) const { if(getMeshDimension()!=-1) - return MEDCouplingPointSet::buildPartOfMySelf(begin,end,keepCoords); + return static_cast(MEDCouplingPointSet::buildPartOfMySelf(begin,end,keepCoords)); else { if(end-begin!=1) @@ -2250,7 +2250,7 @@ void MEDCouplingUMesh::fillCellIdsToKeepFromNodeIds(const int *begin, const int * \param [in] fullyIn - if \c true, then cells whose all nodes are in the * array \a begin are added, else cells whose any node is in the * array \a begin are added. - * \return MEDCouplingPointSet * - new instance of MEDCouplingUMesh. The caller is + * \return MEDCouplingUMesh * - new instance of MEDCouplingUMesh. The caller is * to delete this mesh using decrRef() as it is no more needed. * \throw If the coordinates array is not set. * \throw If the nodal connectivity of cells is not defined. @@ -2261,13 +2261,13 @@ void MEDCouplingUMesh::fillCellIdsToKeepFromNodeIds(const int *begin, const int * \ref py_mcumesh_buildFacePartOfMySelfNode "Here is a Python example". * \endif */ -MEDCouplingPointSet *MEDCouplingUMesh::buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const +MEDCouplingUMesh *MEDCouplingUMesh::buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const { MEDCouplingAutoRefCountObjectPtr desc,descIndx,revDesc,revDescIndx; desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=DataArrayInt::New(); revDescIndx=DataArrayInt::New(); MEDCouplingAutoRefCountObjectPtr subMesh=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx); desc=0; descIndx=0; revDesc=0; revDescIndx=0; - return subMesh->buildPartOfMySelfNode(begin,end,fullyIn); + return static_cast(subMesh->buildPartOfMySelfNode(begin,end,fullyIn)); } /*! @@ -2276,7 +2276,7 @@ MEDCouplingPointSet *MEDCouplingUMesh::buildFacePartOfMySelfNode(const int *begi * \param [in] keepCoords - if \c true, the result mesh shares the node coordinates * array of \a this mesh, else "free" nodes are removed from the result mesh * by calling zipCoords(). - * \return MEDCouplingPointSet * - a new instance of MEDCouplingUMesh. The caller is + * \return MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is * to delete this mesh using decrRef() as it is no more needed. * \throw If the coordinates array is not set. * \throw If the nodal connectivity of cells is not defined. @@ -2286,7 +2286,7 @@ MEDCouplingPointSet *MEDCouplingUMesh::buildFacePartOfMySelfNode(const int *begi * \ref py_mcumesh_buildBoundaryMesh "Here is a Python example". * \endif */ -MEDCouplingPointSet *MEDCouplingUMesh::buildBoundaryMesh(bool keepCoords) const +MEDCouplingUMesh *MEDCouplingUMesh::buildBoundaryMesh(bool keepCoords) const { DataArrayInt *desc=DataArrayInt::New(); DataArrayInt *descIndx=DataArrayInt::New(); @@ -2304,7 +2304,7 @@ MEDCouplingPointSet *MEDCouplingUMesh::buildBoundaryMesh(bool keepCoords) const if(revDescIndxC[i+1]-revDescIndxC[i]==1) boundaryCells.push_back(i); revDescIndx->decrRef(); - MEDCouplingPointSet *ret=meshDM1->buildPartOfMySelf(&boundaryCells[0],&boundaryCells[0]+boundaryCells.size(),keepCoords); + MEDCouplingUMesh *ret=meshDM1->buildPartOfMySelf(&boundaryCells[0],&boundaryCells[0]+boundaryCells.size(),keepCoords); return ret; } @@ -3355,7 +3355,7 @@ void MEDCouplingUMesh::unserialization(const std::vector& tinyInfoD, con * This is the low algorithm of MEDCouplingUMesh::buildPartOfMySelf2. * CellIds are given using range specified by a start an end and step. */ -MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const +MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const { checkFullyDefined(); int ncell=getNumberOfCells(); @@ -3400,7 +3400,7 @@ MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelfKeepCoords2(int start, i * Keeps from \a this only cells which constituing point id are in the ids specified by [ \a begin,\a end ). * The return newly allocated mesh will share the same coordinates as \a this. */ -MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const +MEDCouplingUMesh *MEDCouplingUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const { checkConnectivityFullyDefined(); int ncell=getNumberOfCells(); diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index e3bb9c6d7..4a06f26f3 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -44,7 +44,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(const std::string& meshName, int meshDim); MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; MEDCOUPLING_EXPORT MEDCouplingUMesh *clone(bool recDeepCpy) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const; + MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCpyConnectivityOnly() const; MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other); MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; @@ -126,15 +126,15 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static void ComputeNeighborsOfCellsAdv(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI, DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx); MEDCOUPLING_EXPORT void computeNeighborsOfNodes(DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelf(const int *begin, const int *end, bool keepCoords=true) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const; + MEDCOUPLING_EXPORT MEDCouplingUMesh *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; + MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelf(const int *begin, const int *end, bool keepCoords=true) const; + MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelf2(int start, int end, int step, bool keepCoords=true) const; MEDCOUPLING_EXPORT void setPartOfMySelf(const int *cellIdsBg, const int *cellIdsEnd, const MEDCouplingUMesh& otherOnSameCoordsThanThis); MEDCOUPLING_EXPORT void setPartOfMySelf2(int start, int end, int step, const MEDCouplingUMesh& otherOnSameCoordsThanThis); - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const; + MEDCOUPLING_EXPORT MEDCouplingUMesh *buildFacePartOfMySelfNode(const int *begin, const int *end, bool fullyIn) const; MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const; MEDCOUPLING_EXPORT DataArrayInt *findBoundaryNodes() const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const; + MEDCOUPLING_EXPORT MEDCouplingUMesh *buildBoundaryMesh(bool keepCoords) const; MEDCOUPLING_EXPORT DataArrayInt *findCellIdsOnBoundary() const; MEDCOUPLING_EXPORT void findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayInt *&cellIdsRk0, DataArrayInt *&cellIdsRk1) const; MEDCOUPLING_EXPORT MEDCouplingUMesh *computeSkin() const; @@ -294,8 +294,8 @@ namespace ParaMEDMEM DataArrayDouble *fillExtCoordsUsingTranslAndAutoRotation2D(const MEDCouplingUMesh *mesh1D, bool isQuad) const; DataArrayDouble *fillExtCoordsUsingTranslAndAutoRotation3D(const MEDCouplingUMesh *mesh1D, bool isQuad) const; static bool AreCellsEqualInPool(const std::vector& candidates, int compType, const int *conn, const int *connI, DataArrayInt *result) ; - MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; - MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; + MEDCouplingUMesh *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; + MEDCouplingUMesh *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; DataArrayInt *convertLinearCellsToQuadratic1D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set& types) const; DataArrayInt *convertLinearCellsToQuadratic2DAnd3D0(const MEDCouplingUMesh *m1D, const DataArrayInt *desc, const DataArrayInt *descI, DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set& types) const; DataArrayInt *convertLinearCellsToQuadratic2D0(DataArrayInt *&conn, DataArrayInt *&connI, DataArrayDouble *& coords, std::set& types) const; diff --git a/v8_work/TODO.txt b/v8_work/TODO.txt index 7534ff544..b7cc5c0c0 100644 --- a/v8_work/TODO.txt +++ b/v8_work/TODO.txt @@ -1,17 +1,19 @@ TODO for V8 %%%%%%%%%%% -Covariance fixes +Covariance fixes [DONE] ================ + MEDCouplingUMesh deepCpyConnectivityOnly + mergeMyselfWithOnSameCoords buildPartOfMySelf + buildPartOfMySelfNode buildPartOfMySelf2 buildFacePartOfMySelfNode buildBoundaryMesh buildPartOfMySelfKeepCoords buildPartOfMySelfKeepCoords2 - mergeMyselfWithOnSameCoords + + MEDCouplingExtrudedMesh deepCpy + MEDCouplingIMesh