docs(fwData): improve doxygen of Image, Mesh and Array
Description
Some mistakes are written in Mesh documentation, and Image and Array could be improved.
Proposal
Update mesh doxygen:
diff --git a/libs/core/fwData/include/fwData/Mesh.hpp b/libs/core/fwData/include/fwData/Mesh.hpp
index 5dea92343..33eb2856a 100644
--- a/libs/core/fwData/include/fwData/Mesh.hpp
+++ b/libs/core/fwData/include/fwData/Mesh.hpp
@@ -42,28 +42,29 @@ namespace fwData
/**
* @brief Data holding a geometric structure composed of points, lines, triangles, quads or polygons.
*
- * It is the new structure that represent mesh in sight. For the moment, this new structure is available
- * to register mesh with triangle cells, with quad cells or with triangle and quad cells. Peharps, in future
- * work other cell type will be available (ex: POLYGON)
+ * @section Structure Structure
*
- * This structure contains some information stock in ::fwData::Array \n
+ * The mesh structure contains some information stock in ::fwData::Array
*
- * An array (m_points) which contains point coord (x,y,z) \n
- * An array (m_cellTypes) which contains cell type (TRIAN or QUAD for the moment) \n
- * An array (m_cellData) which contains point indexes in m_points used to create cells, 3 indexes are necessary to
- * create a triangle cell, 4 for quad cell. \n
- * An array (m_cellDataOffsets) which contains indexes relative to m_cellData, to retrieve the first point necessary
- * to the cell creation. \n
+ * - An array (m_points) which contains point coord (x,y,z)
+ * - An array (m_cellTypes) which contains cell type (TRIAN or QUAD for the moment)
+ * - An array (m_cellData) which contains point indexes in m_points used to create cells, 3 indexes are necessary to
+ * create a triangle cell, 4 for quad cell.
+ * - An array (m_cellDataOffsets) which contains indexes relative to m_cellData, to retrieve the first point necessary
+ * to the cell creation.
+ * An some additional arrays to store the mesh attributes (normals, texture coordinates and colors for points and
+ * cells).
*
- * Example : \n
- * m_points.size = number of mesh points * 3 \n
+ * \b Example : \n
+ * m_nbPoints = number of mesh points * 3 \n
* m_points = [ x0, y0, z0, x1, y1, z1, x2, y2, z2, x3, y3, z3, ... ] \n
- * m_cellTypes.size = number of mesh cells \n
+ * m_nbCells = number of mesh cells \n
+ * m_cellTypes.size = m_nbCells \n
* m_cellTypes = [TRIANGLE, TRIANGLE, QUAD, QUAD, TRIANGLE ... ] \n
- * m_cellDataOffsets.size = number of mesh cells \n
+ * m_cellDataOffsets.size = m_nbCells \n
* m_cellDataOffsets = [0, 3, 6, 10, 14, ... ] (offset shifting in m_cellData = +3 if triangle cell rr +4 if quad cell)
* \n
- * number of mesh cells * 3 (if only triangle cell) < m_cellData.size < number of mesh cells * 4 (if only quad cell) \n
+ * m_cellsDataSize = m_nbCells * <nb_points_per_cell> (m_nbCells * 3 if only triangle cell)
* m_cellData = [0, 1, 2, 0, 1, 3, 0, 1, 3, 5... ] ( correspond to point id ) \n
*
* Get the points coordinates of the third cell \n
@@ -78,14 +79,13 @@ namespace fwData
* p3 = [ x3=m_points[9] y3 z3 ] ( 3 * 3 = 9 ) \n
* p4 = [ x5=m_points[15] y5 z5 ] ( 5 * 3 = 15 ) \n
*
- * We have another array to stock normal by points, normal by edges, color by points or color by cells, to short : \n
+ * There is other arrays to stock normal by points, normal by edges, color by points or color by cells, to short : \n
* Normal arrays contains normal vector (x,y,z) \n
- * normals.size = number of mesh points (respc cells) * 3 \n
+ * normals.size = number of mesh points (respc cells) \n
* normals = [ x0, y0, z0, x1, y1, z1, x2, y2, z2, x3, y3, z3, ... ] \n
- * Color arrays contains RGB or RGBA colors ( check the number of components 3 or 4 of array ) \n
- * colors.size = number of mesh points (respc cells) * 3 (respc 4) \n
- * colors = [ r0, g0, b0, r1, g1, b1, ... ] \n
- * or colors = [ r0, g0, b0, a0, r1, g1, b1, a1, ... ] \n
+ * Color arrays contains RGBA colors \n
+ * colors.size = number of mesh points (respc cells) * 4 \n
+ * colors = [ r0, g0, b0, a0, r1, g1, b1, a1, ... ] \n
*
* @section Usage Usage
*
@@ -184,7 +184,7 @@ namespace fwData
* Example to iterate through points:
* @code{.cpp}
::fwData::Mesh::sptr mesh = ::fwData::Mesh::New();
- mesh->resize(25, 33, ::fwData::Mesh::TRIANGLE);
+ mesh->resize(25, 33, ::fwData::Mesh::CellType::TRIANGLE);
auto iter = mesh->begin< ::fwData::iterator::PointIterator >();
const auto iterEnd = mesh->end< ::fwData::iterator::PointIterator >();
float p[3] = {12.f, 16.f, 18.f};
@@ -201,7 +201,7 @@ namespace fwData
*
* @code{.cpp}
::fwData::Mesh::sptr mesh = ::fwData::Mesh::New();
- mesh->resize(25, 33, ::fwData::Mesh::TRIANGLE);
+ mesh->resize(25, 33, ::fwData::Mesh::TCellType::RIANGLE);
auto iter = mesh->begin< ::fwData::iterator::ConstCellIterator >();
const auto endItr = mesh->end< ::fwData::iterator::ConstCellIterator >();
@@ -231,11 +231,11 @@ namespace fwData
*
* @code{.cpp}
::fwData::Mesh::sptr mesh = ::fwData::Mesh::New();
- mesh->resize(25, 33, ::fwData::Mesh::QUAD);
+ mesh->resize(25, 33, ::fwData::Mesh::CellType::QUAD);
auto it = mesh->begin< ::fwData::iterator::CellIterator >();
const auto itEnd = mesh->end< ::fwData::iterator::CellIterator >();
- const auto cellType = ::fwData::Mesh::QUAD;
+ const auto cellType = ::fwData::Mesh::CellType::QUAD;
const size_t nbPointPerCell = 4;
size_t count = 0;
And add little fixes on Image and Array
--- a/libs/core/fwData/include/fwData/Array.hpp
+++ b/libs/core/fwData/include/fwData/Array.hpp
@@ -44,7 +44,7 @@ namespace fwData
* destruction of the buffer. Else, this class will provide an array "view" of the buffer.
*
* The array can be multi-dimensional, the number of dimensions is defined by the number of elements in the size vector
- * (@see setSize()).
+ * (setSize()).
*
* @section Usage Usage
*
@@ -57,6 +57,9 @@ namespace fwData
* It may be useful when you don't want to reallocate the image too often, but you need to be sure to allocate enough
* memory.
*
+ * To resize the array, you must define the Type ([u]int[8|16|32|64], double, float) and the size of the buffer. You can
+ * use setSize(size) and setType(type) or directly call `esize(size, type).
+ *
* @section Access Buffer access
*
* You can access buffer values using at<type>(const size_t& offset) or at<type>({x, y, z}) methods. These methods are
diff --git a/libs/core/fwData/include/fwData/Image.hpp b/libs/core/fwData/include/fwData/Image.hpp
index f9bd1c22c..9f26cc0e7 100644
--- a/libs/core/fwData/include/fwData/Image.hpp
+++ b/libs/core/fwData/include/fwData/Image.hpp
@@ -71,6 +71,10 @@ class PointList;
* @warning The allocated size can be different from the image size: it can happen if you called setSize() without
* calling resize(). It may be useful when you don't want to reallocate the image too often, but you need to be sure to
* allocate enough memory.
+ *
+ * To resize the image, you must you must define the Type ([u]int[8|16|32|64], double, float), the size and the pixel
+ * format of the buffer. You can use setSize(size), setType(type) and setPixelFormalt(format) or directly call
+`* resize(size, type, format).
*
* @section Access Buffer access
*