Salome HOME
Fixing various C++ covariances mismatches in the API
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingUMesh.cxx
index d50bf73c257e0c5b1224da089a71538fea7ce103..7a0926ef3a273ab524523998afe1397008c60429 100644 (file)
@@ -53,7 +53,9 @@ using namespace ParaMEDMEM;
 
 double MEDCouplingUMesh::EPS_FOR_POLYH_ORIENTATION=1.e-14;
 
+/// @cond INTERNAL
 const INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::MEDMEM_ORDER[N_MEDMEM_ORDER] = { INTERP_KERNEL::NORM_POINT1, INTERP_KERNEL::NORM_SEG2, INTERP_KERNEL::NORM_SEG3, INTERP_KERNEL::NORM_SEG4, INTERP_KERNEL::NORM_POLYL, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_TRI7, INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_QUAD9, INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_QPOLYG, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_PYRA5, INTERP_KERNEL::NORM_PENTA6, INTERP_KERNEL::NORM_HEXA8, INTERP_KERNEL::NORM_HEXGP12, INTERP_KERNEL::NORM_TETRA10, INTERP_KERNEL::NORM_PYRA13, INTERP_KERNEL::NORM_PENTA15, INTERP_KERNEL::NORM_HEXA20, INTERP_KERNEL::NORM_HEXA27, INTERP_KERNEL::NORM_POLYHED };
+/// @endcond
 
 MEDCouplingUMesh *MEDCouplingUMesh::New()
 {
@@ -98,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<MEDCouplingUMesh> ret=clone(false);
@@ -2003,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 !");
@@ -2030,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<MEDCouplingUMesh *>(MEDCouplingPointSet::buildPartOfMySelf2(start,end,step,keepCoords));
   else
     {
       int newNbOfCells=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCouplingUMesh::buildPartOfMySelf2 for -1 dimension mesh ");
@@ -2058,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.
@@ -2069,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<MEDCouplingUMesh *>(MEDCouplingPointSet::buildPartOfMySelf(begin,end,keepCoords));
   else
     {
       if(end-begin!=1)
@@ -2248,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.
@@ -2259,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<DataArrayInt> desc,descIndx,revDesc,revDescIndx;
   desc=DataArrayInt::New(); descIndx=DataArrayInt::New(); revDesc=DataArrayInt::New(); revDescIndx=DataArrayInt::New();
   MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> subMesh=buildDescendingConnectivity(desc,descIndx,revDesc,revDescIndx);
   desc=0; descIndx=0; revDesc=0; revDescIndx=0;
-  return subMesh->buildPartOfMySelfNode(begin,end,fullyIn);
+  return static_cast<MEDCouplingUMesh*>(subMesh->buildPartOfMySelfNode(begin,end,fullyIn));
 }
 
 /*!
@@ -2274,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.
@@ -2284,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();
@@ -2302,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;
 }
 
@@ -3353,7 +3355,7 @@ void MEDCouplingUMesh::unserialization(const std::vector<double>& 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();
@@ -3398,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();
@@ -4160,6 +4162,8 @@ DataArrayDouble *MEDCouplingUMesh::distanceToPoints(const DataArrayDouble *pts,
   return ret0.retn();
 }
 
+/// @cond INTERNAL
+
 /*!
  * \param [in] pt the start pointer (included) of the coordinates of the point
  * \param [in] cellIdsBg the start pointer (included) of cellIds
@@ -4231,6 +4235,7 @@ void MEDCouplingUMesh::DistanceToPoint2DCurveAlg(const double *pt, const int *ce
       }
     }
 }
+/// @endcond
 
 /*!
  * Finds cells in contact with a ball (i.e. a point with precision). 
@@ -4664,8 +4669,13 @@ DataArrayInt *MEDCouplingUMesh::convexEnvelop2D()
  * This method is \b NOT const because it can modify \a this.
  * \a this is expected to be an unstructured mesh with meshDim==2 and spaceDim==3. If not an exception will be thrown.
  * \param mesh1D is an unstructured mesh with MeshDim==1 and spaceDim==3. If not an exception will be thrown.
- * \param policy specifies the type of extrusion chosen. \b 0 for translation (most simple),
- * \b 1 for translation and rotation around point of 'mesh1D'.
+ * \param policy specifies the type of extrusion chosen:
+ *   - \b 0 for translation only (most simple): the cells of the 1D mesh represent the vectors along which the 2D mesh
+ *   will be repeated to build each level
+ *   - \b 1 for translation and rotation: the translation is done as above. For each level, an arc of circle is fitted on
+ *   the 3 preceding points of the 1D mesh. The center of the arc is the center of rotation for each level, the rotation is done
+ *   along an axis normal to the plane containing the arc, and finally the angle of rotation is defined by the first two points on the
+ *   arc.
  * \return an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than \a this.  
  */
 MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy)