Commit 1c653d2a authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#9 Mesh: fix Doxygen comments; replace one argument of MeshLabel constructor.

parent 27ec88a6
......@@ -37,10 +37,10 @@ namespace HappyHeart
} // namespace anonymous
MeshLabel::MeshLabel(const GeometricMeshRegion& geometric_mesh_region,
MeshLabel::MeshLabel(const unsigned int geometric_mesh_region_id,
const unsigned int index,
std::string&& description)
: mesh_identifier_(geometric_mesh_region.GetUniqueId()),
: mesh_identifier_(geometric_mesh_region_id),
index_(index),
description_(DescriptionHelper(std::move(description), index))
{ }
......
......@@ -73,7 +73,7 @@ namespace HappyHeart
/*!
* \brief Constructor
*
* \param[in] geometric_mesh_region GeometricMeshRegion object to which the label belongs to.
* \param[in] geometric_mesh_region_id Identifier of the \a GeometricMeshRegion to which the label belongs to.
* \param[in] index Identifier related to the label. This identifier should be unique for a given
* \a GeometricMeshRegion (i.e. that a given mesh should get at most one MeshLabel object with a given
* unique id).
......@@ -82,7 +82,7 @@ namespace HappyHeart
* \param[in] description Description of the label. Might be empty.
*
*/
explicit MeshLabel(const GeometricMeshRegion& geometric_mesh_region,
explicit MeshLabel(unsigned int geometric_mesh_region_id,
unsigned int index,
std::string&& description);
......
......@@ -42,3 +42,10 @@
///@} // addtogroup
/*!
* \class doxygen_hide_space_unit_arg
*
* \param[in] space_unit The unit of the mesh, in meters.
*/
......@@ -171,17 +171,67 @@ namespace HappyHeart
/// \name Special members.
///@{
/*!
* \class doxygen_hide_geometric_mesh_region_constructor_1
*
* \param[in] unique_id Unique identifier of the \a GeometricMeshRegion.
* \param[in] dimension Dimension of the mesh.
* \copydoc doxygen_hide_space_unit_arg
*/
/*!
* \class doxygen_hide_geometric_mesh_region_constructor_2
*
* \copydoc doxygen_hide_geometric_mesh_region_constructor_1
* \param[in] do_build_edge Whether edges should be built or not.
* \param[in] do_build_face Whether faces should be built or not.
* \param[in] do_build_volume Whether volumes should be built or not.
* \param[in] do_build_pseudo_normals Whether pseudo-normals should be built or not.
*/
// BEWARE: if parameters are in/out, use the 3_bis comment!
/*!
* \class doxygen_hide_geometric_mesh_region_constructor_3
*
* \param[in] unsort_element_list List of \a GeometricElt. No specific order is expected here.
* \param[in] coords_list List of \a Coords objects.
* \param[in] mesh_label_list List of \a MeshLabels.
*/
/*!
* \class doxygen_hide_geometric_mesh_region_constructor_3_bis
*
* \param[in,out] unsort_element_list List of \a GeometricElt. No specific order is expected here.
* \param[in,out] coords_list List of \a Coords objects.
* \param[in,out] mesh_label_list List of \a MeshLabels.
*/
/*!
* \class doxygen_hide_geometric_mesh_region_constructor_4
*
* \param[in] mesh_file File from which the data will be loaded.
*/
/*!
* \class doxygen_hide_geometric_mesh_region_constructor_5
*
* \copydoc doxygen_hide_geometric_mesh_region_constructor_4
* \param[in] format Format of the input file.
*/
/*!
* \brief Constructor from a file.
*
* The constructor is private on purpose: GeometricMeshRegion objects are intended to be created
* through GeometricMeshRegionManager singleton class, which performs additional bookkeeping on them.
*
* \param[in] mesh_file File from which the data will be loaded.
* \param[in] dimension Dimension of the mesh.
* \param[in] format Format of the input file.
* \param[in] do_build_edge Whether edges should be built or not.
* \param[in] do_build_face Whether faces should be built or not.
* \copydoc doxygen_hide_geometric_mesh_region_constructor_1
* \copydoc doxygen_hide_geometric_mesh_region_constructor_5
*/
explicit GeometricMeshRegion(unsigned int unique_id,
const std::string& mesh_file,
......@@ -199,6 +249,9 @@ namespace HappyHeart
*
* The constructor is private on purpose: GeometricMeshRegion objects are intended to be created
* through GeometricMeshRegionManager singleton class, which performs additional bookkeeping on them.
*
* \copydoc doxygen_hide_geometric_mesh_region_constructor_2
* \copydoc doxygen_hide_geometric_mesh_region_constructor_3
*/
explicit GeometricMeshRegion(unsigned int unique_id,
unsigned int dimension,
......@@ -476,9 +529,7 @@ namespace HappyHeart
*
* This method should be called by a any constructor, as it builds and sorts the expected content of the class.
*
* \param[in] unsort_element_list List of geometric elements. No specific order is expected here.
* \param[in] coords_list List of \a Coords objects.
* \param[in] mesh_label_list List of \a MeshLabels.
* \copydoc doxygen_hide_geometric_mesh_region_constructor_3
*/
void Construct(GeometricElt::vector_shared_ptr&& unsort_element_list,
Coords::vector_shared_ptr&& coords_list,
......
......@@ -497,15 +497,15 @@ namespace HappyHeart
getline(stream, description);
}
auto current_label = std::make_shared<MeshLabel>(mesh, index, std::move(description));
auto current_label = std::make_shared<MeshLabel>(mesh.GetUniqueId(), index, std::move(description));
const auto& geometric_elt_factory = ::HappyHeart::Private::GeometricEltFactory::GetInstance();
// In the following, we should get one block per geometric geometric elementpresent in the label
// Format is:
// - one line for the name of the geometric elementconsiderd
// - one line to tell how many geometric elements are expected
// - and then a line per geometric elementof this kind in the label
// - one line for the name of the geometric element considered.
// - one line to tell how many geometric elements are expected.
// - and then a line per geometric element of this kind in the label.
while (stream)
{
// Description of the geometric geometric elementthat will be read in Ensight format(e.g. "tria3"), and the number of objects considered
......
......@@ -65,11 +65,15 @@ namespace HappyHeart
*
* An Ensight case file is also required to read it with Ensight client.
*
* \copydoc doxygen_hide_geometry_format_common_arg
* \copydoc doxygen_hide_geometric_mesh_region_constructor_3_bis
* \copydoc doxygen_hide_geometric_mesh_region_constructor_4
* \copydoc doxygen_hide_space_unit_arg
* \param[out] dimension Dimension of the mesh, as read in the input file.
* \param[in] mesh
*
*/
void ReadFile(const GeometricMeshRegion& mesh,
const std::string& file,
const std::string& mesh_file,
double space_unit,
unsigned int& dimension,
GeometricElt::vector_shared_ptr& unsort_element_list,
......
......@@ -6,7 +6,7 @@
* \param[in] mesh The \a GeometricMeshRegion being build that called the present function. It is
* there only because a reference to the mnesh is required to build a \a MeshLabel.
* \param[in] file Path to the file being read.
* \param[in] space_unit The unit of the mesh, in meters.
* \copydoc doxygen_hide_space_unit_arg
* \param[out] dimension NUmber of components considered in the Coords objects. It is format_dependant: Ensight
* always returns 3 regarless of rthe mesh considered whereas Medit may return 2 or 3.
* \param[out] unsort_element_list List of geometric elements read in the file. No specific order is expected here;
......
......@@ -160,7 +160,7 @@ namespace HappyHeart
public:
//! Constructor.
explicit LabelHelper(const GeometricMeshRegion& geometric_mesh_region);
explicit LabelHelper(unsigned int geometric_mesh_region_id);
//! Returns a Label object matching the index (if not existent create it on the fly)
MeshLabel::const_shared_ptr FetchLabel(unsigned int index);
......@@ -173,8 +173,8 @@ namespace HappyHeart
private:
//! Geometric mesh region for which the label are built.
const GeometricMeshRegion& geometric_mesh_region_;
//! Unique id of the geometric mesh region for which the label are built.
const unsigned int geometric_mesh_region_id_;
//! Relationship between integer indexes (given as keys) and label objects
std::unordered_map<unsigned int, MeshLabel::const_shared_ptr> objects_;
......@@ -258,8 +258,8 @@ namespace HappyHeart
{
LabelHelper::LabelHelper(const GeometricMeshRegion& geometric_mesh_region)
: geometric_mesh_region_(geometric_mesh_region)
LabelHelper::LabelHelper(const unsigned int geometric_mesh_region_id)
: geometric_mesh_region_id_(geometric_mesh_region_id)
{
objects_.max_load_factor(Utilities::DefaultMaxLoadFactor());
}
......@@ -272,9 +272,10 @@ namespace HappyHeart
if (it != objects_.cend())
return it->second;
MeshLabel::const_shared_ptr new_surface = std::make_shared<MeshLabel>(geometric_mesh_region_,
index,
"");
MeshLabel::const_shared_ptr new_surface =
std::make_shared<MeshLabel>(geometric_mesh_region_id_,
index,
"");
// Register the Label in the class
objects_.insert(std::make_pair(index, new_surface));
......@@ -346,7 +347,7 @@ namespace HappyHeart
}
// Local object that won't survive beyond constructor.
LabelHelper label_helper(mesh);
LabelHelper label_helper(mesh.GetUniqueId());
// Read coords.
ReadCoords(space_unit, label_helper);
......
......@@ -58,10 +58,11 @@ namespace HappyHeart
/*!
* \brief Read a mesh in Medit format.
*
* \copydoc doxygen_hide_geometry_format_common_arg
* \copydoc doxygen_hide_geometric_mesh_region_constructor_3_bis
* \copydoc doxygen_hide_geometric_mesh_region_constructor_4
*/
void ReadFile(const GeometricMeshRegion& mesh,
const std::string& file,
const std::string& mesh_file,
double space_unit,
unsigned int& dimension,
GeometricElt::vector_shared_ptr& unsort_element_list,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment