Merge remote-tracking branch 'cgal/releases/CGAL-4.13-branch'

This commit is contained in:
Sébastien Loriot 2018-12-31 10:29:57 +01:00
commit 551be55235
4 changed files with 29 additions and 11 deletions

View File

@ -36,12 +36,15 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/tuple/tuple.hpp>
#include <cstdlib>
namespace CGAL {
namespace METIS {
template<typename TriangleMesh, typename METIS_options, typename NamedParameters>
void partition_dual_graph(const TriangleMesh& tm, int nparts,
void partition_dual_graph(const TriangleMesh& tm,
int nparts,
METIS_options options, // options array
const NamedParameters& np)
{
@ -93,11 +96,11 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts,
idx_t objval;
// partition info for the nodes
idx_t* npart = (idx_t*) calloc(nn, sizeof(idx_t));
idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t));
CGAL_assertion(npart != NULL);
// partition info for the elements
idx_t* epart = (idx_t*) calloc(ne, sizeof(idx_t));
idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t));
CGAL_assertion(epart != NULL);
// do not support Fortran-style arrays
@ -118,6 +121,12 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts,
Output_face_partition_ids fo;
vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id));
fo(tm, epart, get_param(np, internal_np::face_partition_id));
delete[] eptr;
delete[] eind;
std::free(npart);
std::free(epart);
}
template<typename TriangleMesh, typename NamedParameters>

View File

@ -34,6 +34,8 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/tuple/tuple.hpp>
#include <cstdlib>
namespace CGAL {
namespace METIS {
@ -76,7 +78,8 @@ struct Output_face_partition_ids
};
template<typename TriangleMesh, typename METIS_options, typename NamedParameters>
void partition_graph(const TriangleMesh& tm, int nparts,
void partition_graph(const TriangleMesh& tm,
int nparts,
METIS_options options, // pointer to the options array
const NamedParameters& np)
{
@ -125,11 +128,11 @@ void partition_graph(const TriangleMesh& tm, int nparts,
idx_t objval;
// partition info for the nodes
idx_t* npart = (idx_t*) calloc(nn, sizeof(idx_t));
idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t));
CGAL_assertion(npart != NULL);
// partition info for the elements
idx_t* epart = (idx_t*) calloc(ne, sizeof(idx_t));
idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t));
CGAL_assertion(epart != NULL);
// do not support Fortran-style arrays
@ -150,6 +153,12 @@ void partition_graph(const TriangleMesh& tm, int nparts,
Output_face_partition_ids fo;
vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id));
fo(tm, epart, get_param(np, internal_np::face_partition_id));
delete[] eptr;
delete[] eind;
std::free(npart);
std::free(epart);
}
template<typename TriangleMesh, typename NamedParameters>

View File

@ -76,13 +76,12 @@ namespace CGAL {
GT gt = choose_param(get_param(np, internal_np::geom_traits), GT());
typename GT::Construct_bbox_3 get_bbox = gt.construct_bbox_3_object();
typedef typename boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
halfedge_descriptor h0 = *(halfedges(pmesh).first);
CGAL::Bbox_3 bb = get(vpm, target(h0, pmesh)).bbox();
BOOST_FOREACH(halfedge_descriptor h, halfedges(pmesh))
CGAL::Bbox_3 bb;
BOOST_FOREACH(vertex_descriptor v, vertices(pmesh))
{
bb += get_bbox( get(vpm, target(h, pmesh)) );
bb += get_bbox( get(vpm, v) );
}
return bb;
}

View File

@ -675,6 +675,7 @@ namespace internal {
if (is_on_border(he) || is_on_mesh(he))
{
he = opposite(he, mesh_); //he now is PATCH_BORDER
e = edge(he, mesh_);
CGAL_assertion(is_on_patch_border(he));
}
}//end if(not on PATCH)