mirror of https://github.com/CGAL/cgal
First draft of the doc
This commit is contained in:
parent
b939551b38
commit
ce72dd895f
|
|
@ -5,9 +5,35 @@ namespace CGAL {
|
||||||
/// Note that contrary to `Nef_polyhedron_3::convert_to_polyhedron()`, the output is not triangulated
|
/// 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).
|
/// (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()`.
|
/// 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 `Polygon_mesh` must have an internal point property map with value type being `Nef_polyhedron_3::Point_3`.
|
||||||
/// \pre `nef.simple()`
|
/// \pre `nef.simple()`
|
||||||
|
|
||||||
template <class Nef_polyhedron, class Polygon_mesh>
|
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);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -371,14 +371,14 @@ void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef,
|
||||||
triangulate_all_faces);
|
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)
|
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 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;
|
typedef typename Kernel_traits<PM_Point>::Kernel PM_Kernel;
|
||||||
|
|
||||||
PointRange points;
|
std::vector<PM_Point> points;
|
||||||
PolygonRange polygons;
|
std::vector<std::vector<std::size_t> > polygons;
|
||||||
convert_nef_polyhedron_to_polygon_soup<PM_Kernel>(nef, points, polygons, triangulate_all_faces);
|
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);
|
Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, pm);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,7 @@ int main()
|
||||||
PolygonMesh pm;
|
PolygonMesh pm;
|
||||||
CGAL::convert_nef_polyhedron_to_polygon_mesh<
|
CGAL::convert_nef_polyhedron_to_polygon_mesh<
|
||||||
Nef_polyhedron,
|
Nef_polyhedron,
|
||||||
PolygonMesh,
|
PolygonMesh>(nef, pm);
|
||||||
std::vector<std::vector<std::size_t> >,
|
|
||||||
std::vector<Point> >(nef, pm);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue