Minor safety changes

This commit is contained in:
Mael Rouxel-Labbé 2017-01-20 18:36:17 +01:00
parent 3f87e9d4fb
commit 6308f2a94a
4 changed files with 14 additions and 12 deletions

View File

@ -618,7 +618,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
// Next is the gathering of the border halfedges of the connected component.
// It is wrong to pass the underlying mesh tMesh: a sphere split in half does
// not have any border according if border_halfedges() is run with tMesh.
// not have any border if border_halfedges() is run with tMesh.
//
// The proper way would be to completely redesign the plugin to use Seam meshes
// everywhere. But that's not worth it. Instead, we abuse the fact that faces
@ -786,9 +786,10 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
typedef boost::unordered_map<vertex_descriptor, SMP::Cone_type> Cones;
Cones cmap;
SMP::internal::locate_unordered_cones<Seam_mesh,
boost::unordered_set<T_vertex_descriptor>,
Cones>(sMesh, unordered_cones, cmap);
if(!SMP::internal::locate_unordered_cones<Seam_mesh,
boost::unordered_set<T_vertex_descriptor>,
Cones>(sMesh, unordered_cones, cmap))
return;
// vimap and uvmap
typedef boost::unordered_map<vertex_descriptor, int> Indices;

View File

@ -108,9 +108,9 @@ int main(int argc, char * argv[])
// Mark the cones in the seam mesh
typedef boost::unordered_map<vertex_descriptor, SMP::Cone_type> Cones;
Cones cmap;
SMP::internal::locate_cones<Mesh,
Cones_in_smesh_container,
Cones>(mesh, cone_sm_vds, cmap);
bool locate_status = SMP::internal::locate_cones<Mesh,
Cones_in_smesh_container,
Cones>(mesh, cone_sm_vds, cmap);
// The 2D points of the uv parametrisation will be written into this map
// Note that this is a halfedge property map, and that uv values

View File

@ -461,7 +461,7 @@ private:
typename VertexUVMap,
typename VertexIndexMap,
typename VertexParameterizedMap>
void fill_linear_system_matrix_mvc_from_ct_face(const CT& ct,
void fill_linear_system_matrix_mvc_from_ct_face(const CT& CGAL_precondition_code(ct),
typename CT::Finite_faces_iterator fh,
const VertexUVMap uvmap,
const VertexIndexMap vimap,

View File

@ -399,7 +399,7 @@ Error_code read_cones(const TriangleMesh& pm, const char* filename,
template<typename SeamMesh,
typename Cones_in_pmesh_vector,
typename ConeMap>
void locate_cones(const SeamMesh& mesh,
bool locate_cones(const SeamMesh& mesh,
const Cones_in_pmesh_vector& cone_tm_vds,
ConeMap& cones)
{
@ -438,7 +438,7 @@ void locate_cones(const SeamMesh& mesh,
}
}
check_input_validity(mesh, cones, cone_tm_vds);
return check_input_validity(mesh, cones, cone_tm_vds);
}
/// Same as above, but the cones are NOT ordered and we thus use seam mesh
@ -451,11 +451,12 @@ void locate_cones(const SeamMesh& mesh,
template<typename SeamMesh,
typename Cones_in_pmesh_set,
typename ConeMap>
void locate_unordered_cones(const SeamMesh& mesh,
bool locate_unordered_cones(const SeamMesh& mesh,
const Cones_in_pmesh_set& cone_tm_vds,
ConeMap& cones)
{
CGAL_precondition(cones.empty());
CGAL_precondition(cone_tm_vds.size() == 3 || cone_tm_vds.size() == 4);
typedef typename SeamMesh::TriangleMesh TriangleMesh;
@ -527,7 +528,7 @@ void locate_unordered_cones(const SeamMesh& mesh,
} while(vertex_on_seam != end);
check_input_validity(mesh, cones, cone_tm_vds);
return check_input_validity(mesh, cones, cone_tm_vds);
}
} // namespace internal