mirror of https://github.com/CGAL/cgal
Remove warnings
This commit is contained in:
parent
5e3d85ae8f
commit
1de5666a4f
|
|
@ -20,7 +20,7 @@ struct Facewidth_draw_functor : public CGAL::DefaultDrawingFunctorLCC
|
|||
{ return CGAL::Color(0, 255, 0); }
|
||||
|
||||
template<typename LCC>
|
||||
bool colored_edge(const LCC& alcc, typename LCC::Dart_const_handle dh) const
|
||||
bool colored_edge(const LCC& /*alcc*/, typename LCC::Dart_const_handle /*dh*/) const
|
||||
{ return false; }
|
||||
|
||||
template<typename LCC>
|
||||
|
|
@ -53,7 +53,7 @@ void draw_facewidth(const LCC& lcc,
|
|||
int nbv=0, nbf=0;
|
||||
typename LCC::size_type vertex_mark = lcc.get_new_mark();
|
||||
typename LCC::size_type face_mark = lcc.get_new_mark();
|
||||
for (int i=0; i<cycle.size(); ++i)
|
||||
for (std::size_t i=0; i<cycle.size(); ++i)
|
||||
{
|
||||
// Color the vertex
|
||||
if (!lcc.is_marked(cycle[i], vertex_mark))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ using Path_on_surface=CGAL::Surface_mesh_topology::Path_on_surface<LCC_3>;
|
|||
double cycle_length(const LCC_3& lcc, const Path_on_surface& cycle)
|
||||
{ // Compute the length of the given cycle.
|
||||
double res=0;
|
||||
for (int i=0; i<cycle.length(); ++i)
|
||||
for (std::size_t i=0; i<cycle.length(); ++i)
|
||||
{ res+=std::sqrt
|
||||
(CGAL::squared_distance(lcc.point(cycle.get_next_dart(i)), lcc.point(cycle[i]))); }
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ using Path_on_surface=CGAL::Surface_mesh_topology::Path_on_surface<Mesh>;
|
|||
double cycle_length(const Mesh& mesh, const Path_on_surface& cycle)
|
||||
{ // Compute the length of the given cycle.
|
||||
double res=0;
|
||||
for (int i=0; i<cycle.length(); ++i)
|
||||
for (std::size_t i=0; i<cycle.length(); ++i)
|
||||
{ res+=std::sqrt
|
||||
(CGAL::squared_distance(mesh.point(mesh.vertex(mesh.edge(cycle[i]), 0)),
|
||||
mesh.point(mesh.vertex(mesh.edge(cycle[i]), 1)))); }
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ int main(int argc, char* argv[])
|
|||
else
|
||||
{
|
||||
double cycle_length=0;
|
||||
for (int i=0; i<cycle.length(); ++i)
|
||||
for (std::size_t i=0; i<cycle.length(); ++i)
|
||||
{ cycle_length+=wf(cycle[i]); }
|
||||
|
||||
std::cout<<" Number of edges in cycle: "<<cycle.length()<<std::endl;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
lcccopy.mark_cell<0>(cycle[0], is_root_copy);
|
||||
double cycle_length=0;
|
||||
for (int i=0; i<cycle.length(); ++i)
|
||||
for (std::size_t i=0; i<cycle.length(); ++i)
|
||||
{
|
||||
cycle_length+=wf(cycle[i]);
|
||||
if (!lcccopy.is_marked(cycle[i], belong_to_cycle_copy))
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ public:
|
|||
}
|
||||
|
||||
std::size_t orient(size_type amark) const
|
||||
{ negate_mark(amark); }
|
||||
{ negate_mark(amark); return number_of_darts(); }
|
||||
|
||||
std::vector<unsigned int>
|
||||
count_marked_cells(size_type amark, const std::vector<unsigned int>& acells) const
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ namespace internal {
|
|||
{
|
||||
CGAL_assertion(&mmap==&(other.mmap));
|
||||
m_it=other.m_it;
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator Dart_handle() const
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ protected:
|
|||
const WeightFunctor& wf)
|
||||
{
|
||||
if (std::is_same<WeightFunctor, Unit_weight_functor>::value)
|
||||
{ compute_BFS_tree(root, spanning_tree, distance_from_root, trace_index, wf); }
|
||||
{ compute_BFS_tree(root, spanning_tree, distance_from_root, trace_index); }
|
||||
else
|
||||
{ compute_Dijkstra_tree(root, spanning_tree, distance_from_root, trace_index, wf); }
|
||||
}
|
||||
|
|
@ -295,7 +295,7 @@ protected:
|
|||
if (!get_local_map().is_marked(v, vertex_visited))
|
||||
{
|
||||
int v_index=++vertex_index;
|
||||
CGAL_assertion(v_index==distance_from_root.size());
|
||||
CGAL_assertion(v_index==static_cast<int>(distance_from_root.size()));
|
||||
distance_from_root.push_back(distance_from_root[u_index]+w);
|
||||
spanning_tree.push_back(it);
|
||||
trace_index.push_back(u_index-1);
|
||||
|
|
@ -324,11 +324,10 @@ protected:
|
|||
}
|
||||
|
||||
/// Create a spanning tree using BFS
|
||||
template <class WeightFunctor, class Distance_>
|
||||
template <class Distance_>
|
||||
void compute_BFS_tree(Dart_handle root, Dart_container& spanning_tree,
|
||||
std::vector<Distance_>& distance_from_root,
|
||||
std::vector<int>& trace_index,
|
||||
const WeightFunctor& wf)
|
||||
std::vector<int>& trace_index)
|
||||
{
|
||||
// Preparation
|
||||
std::queue<int> q;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ bool find_cycle_in_unweighted_cmap_and_polyhedron() {
|
|||
LCC_for_CMap_2::Dart_handle root1 = lcc.darts().begin();
|
||||
Point R = lcc.point_of_vertex_attribute(lcc.vertex_attribute(root1));
|
||||
CGAL::Surface_mesh_topology::Path_on_surface<LCC_for_CMap_2> cycle1 = cst1.compute_shortest_non_contractible_cycle_with_base_point(root1);
|
||||
for (int i = 0; i < cycle1.length(); ++i) {
|
||||
for (std::size_t i = 0; i < cycle1.length(); ++i) {
|
||||
auto e = cycle1[i];
|
||||
if (e == NULL) {
|
||||
std::cerr << "Fail find_cycle_in_unweighted_cmap_and_polyhedron: NULL dart handle found in cycle1\n";
|
||||
|
|
@ -118,7 +118,7 @@ bool find_cycle_in_unweighted_cmap_and_polyhedron() {
|
|||
return false;
|
||||
}
|
||||
CGAL::Surface_mesh_topology::Path_on_surface<Polyhedron> cycle2 = cst2.compute_shortest_non_contractible_cycle_with_base_point(*root2);
|
||||
for (int i = 0; i < cycle2.length(); ++i) {
|
||||
for (std::size_t i = 0; i < cycle2.length(); ++i) {
|
||||
auto e = cycle2[i];
|
||||
if (e == NULL) {
|
||||
std::cerr << "Fail find_cycle_in_unweighted_cmap_and_polyhedron: NULL dart handle found in cycle\n";
|
||||
|
|
@ -140,7 +140,7 @@ bool edge_width_in_unweighted_polyhedron() {
|
|||
}
|
||||
CGAL::Surface_mesh_topology::Curves_on_surface_topology<Polyhedron> cst(p);
|
||||
CGAL::Surface_mesh_topology::Path_on_surface<Polyhedron> cycle = cst.compute_edge_width();
|
||||
for (int i = 0; i < cycle.length(); ++i) {
|
||||
for (std::size_t i = 0; i < cycle.length(); ++i) {
|
||||
auto e = cycle[i];
|
||||
if (e == NULL) {
|
||||
std::cerr << "Fail edge_width_in_unweighted_polyhedron: NULL dart handle found in cycle\n";
|
||||
|
|
@ -189,7 +189,7 @@ bool find_cycle_in_nonorientable_gmap() { // Make a non-oriented case here
|
|||
gm.mark_cell<1>(gm.alpha<0>(faces[2]), chosen_cycle); // 5-1
|
||||
|
||||
unsigned int cycle_length = 0;
|
||||
for (int i = 0; i < cycle.length(); ++i) {
|
||||
for (std::size_t i = 0; i < cycle.length(); ++i) {
|
||||
cycle_length += wf(cycle[i]);
|
||||
auto dh = cycle[i];
|
||||
if (!gm.is_marked(dh, chosen_cycle)) {
|
||||
|
|
@ -251,7 +251,7 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
double cycle_length1, cycle_length2, cycle_length3;
|
||||
std::vector<Point> v1, v2, v3;
|
||||
|
||||
for (int i=0; i<cycle1.length(); ++i)
|
||||
for (std::size_t i=0; i<cycle1.length(); ++i)
|
||||
{
|
||||
auto e=cycle1.get_ith_real_dart(i);
|
||||
cycle_length1+=wf_cm(e);
|
||||
|
|
@ -259,7 +259,7 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
}
|
||||
v1.push_back(lcc_cm.point(cycle1.get_ith_real_dart(0)));
|
||||
|
||||
int i=0;
|
||||
std::size_t i=0;
|
||||
while (lcc_gm.point(cycle2.get_ith_real_dart(i))!=v1[0])
|
||||
{
|
||||
if (i==cycle2.length())
|
||||
|
|
@ -269,7 +269,7 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
}
|
||||
++i;
|
||||
}
|
||||
for (int j=0; j<cycle2.length(); ++j, i=cycle2.next_index(i))
|
||||
for (std::size_t j=0; j<cycle2.length(); ++j, i=cycle2.next_index(i))
|
||||
{
|
||||
auto e=cycle2.get_ith_real_dart(i);
|
||||
cycle_length2 += wf_gm(e);
|
||||
|
|
@ -287,7 +287,7 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
}
|
||||
++i;
|
||||
}
|
||||
for (int j=0; j<cycle3.length(); ++j, i=cycle3.next_index(i))
|
||||
for (std::size_t j=0; j<cycle3.length(); ++j, i=cycle3.next_index(i))
|
||||
{
|
||||
auto e=cycle3.get_ith_real_dart(i);
|
||||
cycle_length3+=wf_sm(e);
|
||||
|
|
@ -297,13 +297,13 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
|
||||
int v2orientation=0, v3orientation=0;
|
||||
bool same=true;
|
||||
for (int i=0; i<v1.size(); ++i)
|
||||
for (std::size_t i=0; i<v1.size(); ++i)
|
||||
{
|
||||
int j=v1.size()-i-1;
|
||||
std::size_t j=v1.size()-i-1;
|
||||
if (v2orientation==0)
|
||||
{
|
||||
if (v1[i]==v2[i] && v1[i]!=v2[j]) { v2orientation==1; }
|
||||
else if (v1[i]!=v2[i] && v1[i]==v2[j]) { v2orientation==2; }
|
||||
if (v1[i]==v2[i] && v1[i]!=v2[j]) { v2orientation=1; }
|
||||
else if (v1[i]!=v2[i] && v1[i]==v2[j]) { v2orientation=2; }
|
||||
else if (v1[i]!=v2[i] && v1[i]!=v2[j]) { same=false; }
|
||||
}
|
||||
else if (v2orientation==1)
|
||||
|
|
@ -313,8 +313,8 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
|
||||
if (v3orientation==0)
|
||||
{
|
||||
if (v1[i]==v3[i] && v1[i]!=v3[j]) { v3orientation==1; }
|
||||
else if (v1[i]!=v3[i] && v1[i]==v3[j]) { v3orientation==2; }
|
||||
if (v1[i]==v3[i] && v1[i]!=v3[j]) { v3orientation=1; }
|
||||
else if (v1[i]!=v3[i] && v1[i]==v3[j]) { v3orientation=2; }
|
||||
else if (v1[i]!=v3[i] && v1[i]!=v3[j]) { same=false; }
|
||||
}
|
||||
else if (v3orientation==1)
|
||||
|
|
@ -325,11 +325,11 @@ bool edge_width_in_weighted_cmap_gmap_mesh() {
|
|||
if (!same)
|
||||
{
|
||||
std::cerr << "Fail edge_width_in_weighted_cmap_gmap_mesh: Inconsistency in the vertex ordering.\n";
|
||||
for (int i=0; i<v1.size(); ++i) std::cerr<<v1[i]<<", ";
|
||||
for (std::size_t i=0; i<v1.size(); ++i) std::cerr<<v1[i]<<", ";
|
||||
std::cerr<<'\n';
|
||||
for (int i=0; i<v2.size(); ++i) std::cerr<<v2[i]<<", ";
|
||||
for (std::size_t i=0; i<v2.size(); ++i) std::cerr<<v2[i]<<", ";
|
||||
std::cerr<<'\n';
|
||||
for (int i=0; i<v3.size(); ++i) std::cerr<<v3[i]<<", ";
|
||||
for (std::size_t i=0; i<v3.size(); ++i) std::cerr<<v3[i]<<", ";
|
||||
std::cerr<<'\n';
|
||||
return false;
|
||||
}
|
||||
|
|
@ -362,7 +362,7 @@ bool unsew_edge_width_repeatedly_in_unweighted_gmap() {
|
|||
CGAL::Surface_mesh_topology::Path_on_surface<LCC_for_GMap_2> cycle = cst.compute_edge_width();
|
||||
length = cycle.length();
|
||||
LCC_for_GMap_2::size_type belong_to_cycle = lcc_gm.get_new_mark();
|
||||
for (int i = 0; i < cycle.length(); ++i) {
|
||||
for (std::size_t i = 0; i < cycle.length(); ++i) {
|
||||
auto e = cycle[i];
|
||||
if (e == NULL) {
|
||||
std::cerr << "Fail unsew_edge_width_repeatedly_in_unweighted_gmap: NULL dart handle found in cycle\n";
|
||||
|
|
@ -377,7 +377,7 @@ bool unsew_edge_width_repeatedly_in_unweighted_gmap() {
|
|||
cycle_lengths.push_back(length);
|
||||
lcc_gm.free_mark(belong_to_cycle);
|
||||
} while (length != 0);
|
||||
for (int i = 1; i < cycle_lengths.size(); ++i)
|
||||
for (std::size_t i = 1; i < cycle_lengths.size(); ++i)
|
||||
if (cycle_lengths[i] > cycle_lengths[i-1]) {
|
||||
std::cerr << "Fail unsew_edge_width_repeatedly_in_unweighted_gmap: Edge width length decreases instead of increases\n";
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue