mirror of https://github.com/CGAL/cgal
Minor safety changes
This commit is contained in:
parent
3f87e9d4fb
commit
6308f2a94a
|
|
@ -618,7 +618,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
|
||||||
|
|
||||||
// Next is the gathering of the border halfedges of the connected component.
|
// 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
|
// 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
|
// 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
|
// 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;
|
typedef boost::unordered_map<vertex_descriptor, SMP::Cone_type> Cones;
|
||||||
Cones cmap;
|
Cones cmap;
|
||||||
|
|
||||||
SMP::internal::locate_unordered_cones<Seam_mesh,
|
if(!SMP::internal::locate_unordered_cones<Seam_mesh,
|
||||||
boost::unordered_set<T_vertex_descriptor>,
|
boost::unordered_set<T_vertex_descriptor>,
|
||||||
Cones>(sMesh, unordered_cones, cmap);
|
Cones>(sMesh, unordered_cones, cmap))
|
||||||
|
return;
|
||||||
|
|
||||||
// vimap and uvmap
|
// vimap and uvmap
|
||||||
typedef boost::unordered_map<vertex_descriptor, int> Indices;
|
typedef boost::unordered_map<vertex_descriptor, int> Indices;
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ int main(int argc, char * argv[])
|
||||||
// Mark the cones in the seam mesh
|
// Mark the cones in the seam mesh
|
||||||
typedef boost::unordered_map<vertex_descriptor, SMP::Cone_type> Cones;
|
typedef boost::unordered_map<vertex_descriptor, SMP::Cone_type> Cones;
|
||||||
Cones cmap;
|
Cones cmap;
|
||||||
SMP::internal::locate_cones<Mesh,
|
bool locate_status = SMP::internal::locate_cones<Mesh,
|
||||||
Cones_in_smesh_container,
|
Cones_in_smesh_container,
|
||||||
Cones>(mesh, cone_sm_vds, cmap);
|
Cones>(mesh, cone_sm_vds, cmap);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ private:
|
||||||
typename VertexUVMap,
|
typename VertexUVMap,
|
||||||
typename VertexIndexMap,
|
typename VertexIndexMap,
|
||||||
typename VertexParameterizedMap>
|
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,
|
typename CT::Finite_faces_iterator fh,
|
||||||
const VertexUVMap uvmap,
|
const VertexUVMap uvmap,
|
||||||
const VertexIndexMap vimap,
|
const VertexIndexMap vimap,
|
||||||
|
|
|
||||||
|
|
@ -399,7 +399,7 @@ Error_code read_cones(const TriangleMesh& pm, const char* filename,
|
||||||
template<typename SeamMesh,
|
template<typename SeamMesh,
|
||||||
typename Cones_in_pmesh_vector,
|
typename Cones_in_pmesh_vector,
|
||||||
typename ConeMap>
|
typename ConeMap>
|
||||||
void locate_cones(const SeamMesh& mesh,
|
bool locate_cones(const SeamMesh& mesh,
|
||||||
const Cones_in_pmesh_vector& cone_tm_vds,
|
const Cones_in_pmesh_vector& cone_tm_vds,
|
||||||
ConeMap& cones)
|
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
|
/// 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,
|
template<typename SeamMesh,
|
||||||
typename Cones_in_pmesh_set,
|
typename Cones_in_pmesh_set,
|
||||||
typename ConeMap>
|
typename ConeMap>
|
||||||
void locate_unordered_cones(const SeamMesh& mesh,
|
bool locate_unordered_cones(const SeamMesh& mesh,
|
||||||
const Cones_in_pmesh_set& cone_tm_vds,
|
const Cones_in_pmesh_set& cone_tm_vds,
|
||||||
ConeMap& cones)
|
ConeMap& cones)
|
||||||
{
|
{
|
||||||
CGAL_precondition(cones.empty());
|
CGAL_precondition(cones.empty());
|
||||||
|
CGAL_precondition(cone_tm_vds.size() == 3 || cone_tm_vds.size() == 4);
|
||||||
|
|
||||||
typedef typename SeamMesh::TriangleMesh TriangleMesh;
|
typedef typename SeamMesh::TriangleMesh TriangleMesh;
|
||||||
|
|
||||||
|
|
@ -527,7 +528,7 @@ void locate_unordered_cones(const SeamMesh& mesh,
|
||||||
|
|
||||||
} while(vertex_on_seam != end);
|
} while(vertex_on_seam != end);
|
||||||
|
|
||||||
check_input_validity(mesh, cones, cone_tm_vds);
|
return check_input_validity(mesh, cones, cone_tm_vds);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue