First draft of the doc

This commit is contained in:
Maxime Gimeno 2019-01-15 12:38:04 +01:00
parent b939551b38
commit ce72dd895f
3 changed files with 30 additions and 6 deletions

View File

@ -5,9 +5,35 @@ namespace CGAL {
/// Note that contrary to `Nef_polyhedron_3::convert_to_polyhedron()`, the output is not triangulated
/// (but faces with more than one connected component of the boundary).
/// The polygon mesh can be triangulated by setting `triangulate_all_faces` to `true` or by calling the function `triangulate_faces()`.
/// @tparam Nef_polyhedron an object of type `Nef_polyhedron_3`.
/// @tparam Polygon_mesh a model of `MutableFaceGraph`.
///
/// @param nef the input.
/// @param pm the output.
/// @param triangulate_all_faces the bool for triangulating the faces.
///
/// \pre `Polygon_mesh` must have an internal point property map with value type being `Nef_polyhedron_3::Point_3`.
/// \pre `nef.simple()`
template <class Nef_polyhedron, class Polygon_mesh>
void convert_nef_polyhedron_to_polygon_mesh(const Nef_polyhedron& nef, Polygon_mesh& pm, bool triangulate_all_faces = false);
/// \ingroup PkgNef3IOFunctions
/// Converts an objet of type `Nef_polyhedron_3` into a polygon soup.
/// The polygons can be triangulated by setting `triangulate_all_faces` to `true`.
/// @tparam Output_kernel the Kernel from which the point type of points come from.
/// @tparam Nef_polyhedron an object of type `Nef_polyhedron_3`.
/// @tparam Polygon_mesh a model of `MutableFaceGraph`.
/// @tparam PolygonRange a container of collections of indices of the points in their range.
/// @tparam PointRange a container of `Output_kernel::Point_3`.
///
/// @param nef the input.
/// @param pm the output.
/// @param triangulate_all_faces the bool for triangulating the faces.
/// \pre `nef.simple()`
template <class Output_kernel, class Nef_polyhedron, typename PolygonRange, typename PointRange>
void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef,
PointRange& points,
PolygonRange& polygons,
bool triangulate_all_faces = false);
}

View File

@ -371,14 +371,14 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef,
triangulate_all_faces);
}
template <class Nef_polyhedron, class Polygon_mesh, typename PolygonRange, typename PointRange>
template <class Nef_polyhedron, class Polygon_mesh>
void convert_nef_polyhedron_to_polygon_mesh(const Nef_polyhedron& nef, Polygon_mesh& pm, bool triangulate_all_faces = false)
{
typedef typename boost::property_traits<typename boost::property_map<Polygon_mesh, vertex_point_t>::type>::value_type PM_Point;
typedef typename Kernel_traits<PM_Point>::Kernel PM_Kernel;
PointRange points;
PolygonRange polygons;
std::vector<PM_Point> points;
std::vector<std::vector<std::size_t> > polygons;
convert_nef_polyhedron_to_polygon_soup<PM_Kernel>(nef, points, polygons, triangulate_all_faces);
Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, pm);
}

View File

@ -45,9 +45,7 @@ int main()
PolygonMesh pm;
CGAL::convert_nef_polyhedron_to_polygon_mesh<
Nef_polyhedron,
PolygonMesh,
std::vector<std::vector<std::size_t> >,
std::vector<Point> >(nef, pm);
PolygonMesh>(nef, pm);
return 0;
}