From cab912f3f123a9b73bc2ca2d4d21eaea174f39f0 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 29 Apr 2014 22:29:47 -0400 Subject: [PATCH 001/201] Initial Test Commit --- IvoHello.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 IvoHello.txt diff --git a/IvoHello.txt b/IvoHello.txt new file mode 100644 index 00000000000..e83f0cf94bf --- /dev/null +++ b/IvoHello.txt @@ -0,0 +1 @@ +Hello CGAL git From f8ca9e6ab7875bcb3a3a79dea975dedc3452d10d Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 20 Jun 2014 19:36:25 -0400 Subject: [PATCH 002/201] Initial implementation of the Reconstruction API includig a simple testcase example --- .../include/CGAL/Cost.h | 89 ++ .../include/CGAL/Dynamic_priority_queue.h | 201 +++ .../include/CGAL/Reconstruction_edge_2.h | 159 ++ .../include/CGAL/Reconstruction_face_base_2.h | 228 +++ .../CGAL/Reconstruction_simplification_2.h | 1298 +++++++++++++++++ .../CGAL/Reconstruction_triangulation_2.h | 1089 ++++++++++++++ .../CGAL/Reconstruction_vertex_base_2.h | 102 ++ .../include/CGAL/Sample.h | 122 ++ .../include/CGAL/console_color.h | 65 + .../CMakeLists.txt | 76 + .../data/stair-noise00.xy | 160 ++ .../examples/Triangulation_2/regular.cpp | 23 +- 12 files changed, 3611 insertions(+), 1 deletion(-) create mode 100644 Reconstruction_simplification_2/include/CGAL/Cost.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Sample.h create mode 100644 Reconstruction_simplification_2/include/CGAL/console_color.h create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt create mode 100755 Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy diff --git a/Reconstruction_simplification_2/include/CGAL/Cost.h b/Reconstruction_simplification_2/include/CGAL/Cost.h new file mode 100644 index 00000000000..56c30a00543 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Cost.h @@ -0,0 +1,89 @@ +#ifndef _COST_H_ +#define _COST_H_ + +#undef min +#undef max + +template +class Cost +{ +private: + FT m_norm; + FT m_tang; + FT m_max_norm; + FT m_max_tang; + +public: + Cost() + { + m_norm = 0.0; + m_tang = 0.0; + m_max_norm = 0.0; + m_max_tang = 0.0; + } + + Cost(const FT norm, const FT tang) + { + m_norm = norm; + m_tang = tang; + m_max_norm = norm; + m_max_tang = tang; + } + + ~Cost() { } + + Cost& operator = (const Cost& cost) + { + m_norm = cost.norm(); + m_tang = cost.tang(); + m_max_norm = cost.max_norm(); + m_max_tang = cost.max_tang(); + return *this; + } + + const FT norm() const { return m_norm; } + + const FT tang() const { return m_tang; } + + const FT max_norm() const { return m_max_norm; } + + const FT max_tang() const { return m_max_tang; } + + FT finalize(const FT alpha = 0.5) const + { + return 2.0 * (alpha * m_norm + (1.0 - alpha) * m_tang); + } + + void divide(const FT ratio) + { + assert(ratio != 0.0); + m_norm /= ratio; + m_tang /= ratio; + } + + void add(const Cost& cost, const FT mass = 1.0) + { + m_norm += mass * cost.norm(); + m_tang += mass * cost.tang(); + } + + void reset_max() + { + m_max_norm = 0.0; + m_max_tang = 0.0; + } + + void update_max(const Cost& cost) + { + m_max_norm = std::max(m_max_norm, cost.max_norm()); + m_max_tang = std::max(m_max_tang, cost.max_tang()); + } + + void compute_max(const FT norm, const FT tang) + { + m_max_norm = std::max(m_max_norm, norm); + m_max_tang = std::max(m_max_tang, tang); + } +}; + +#endif diff --git a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h new file mode 100644 index 00000000000..fbc6d23a53d --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h @@ -0,0 +1,201 @@ +#ifndef _DYNAMICS_PRIORITY_QUEUE_H_ +#define _DYNAMICS_PRIORITY_QUEUE_H_ 1 + +/* + * class DynamicPriorityQueue + * USAGE: + * + Implement abstract method 'compare(const T&, const T&)' + * + Class T must have operators '=' and '<' + */ + +#include +#include +#include + +template +class Dynamic_priority_queue { +protected: + typedef std::map Map; + std::vector _queue; + Map _elements; + +public: + Dynamic_priority_queue() { + + } + + virtual ~Dynamic_priority_queue() { + clean(); + } + + bool empty() const { + return _queue.empty(); + } + + unsigned int size() const { + return _queue.size(); + } + + const T& get_element(int i) const { + assert(i >= 0); + assert(i < size()); + return _queue[i]; + } + + bool contains(const T& x) { + return (get_position(x) >= 0); + } + + void clean() { + _queue.clear(); + _elements.clear(); + } + + void push(const T& x) { + int pos = insert(x); + move_up(pos); + } + + bool update_if_better(const T& x) { + int pos = get_position(x); + if (pos < 0) return false; + + const T& old = get_element(pos); + if (compare(old, x)) return false; + + return update(x); + } + + bool update(const T& x) { + bool ok = remove(x); + if (ok) push(x); + return ok; + } + + bool remove(const T& x) { + int pos = get_position(x); + if (pos < 0) return false; + + T old = get_element(pos); + erase(pos); + + if (size() < 2) return true; + if (pos == size()) return true; + + if (compare(old, get_element(pos))) + move_down(pos); + else + move_up(pos); + return true; + } + + bool extract(T& x) { + if (empty()) return false; + x = top(); + pop(); + return true; + } + + T top() const { + return _queue.front(); + } + + void pop() { + if (empty()) return; + erase(0); + if (empty()) return; + move_down(0); + } + + virtual bool compare(const T& a, const T& b) const = 0; + +protected: + int get_position(const T& x) { + typename Map::const_iterator it = _elements.find(x); + if (it == _elements.end()) return -1; + return it->second; + } + + int insert(const T& x) { + int pos = int( size() ); + _queue.push_back(x); + _elements[x] = pos; + return pos; + } + + void erase(int pos) { + swap(pos, size()-1); + drop_last_element(); + } + + void drop_last_element() { + T last = _queue.back(); + _queue.pop_back(); + _elements.erase(last); + } + + void swap(int i, int j) { + T x_i = get_element(i); + T x_j = get_element(j); + place(x_i, j); + place(x_j, i); + } + + void place(const T& x, int i) { + _queue[i] = x; + _elements[x] = i; + } + + int parent(int i) const { + if (i%2 == 0) return (i-2)/2; + return (i-1)/2; + } + + int left(int i) const { + return 2*i + 1; + } + + int right(int i) const { + return 2*i + 2; + } + + void move_down(int i) { + int pos = i; + int l = left(pos); + int r = right(pos); + T moving = get_element(pos); + + int better; + int N = int(size()); + while (l < N) { + if ( r < N && compare(get_element(r), get_element(l)) ) + better = r; + else + better = l; + + if ( compare(moving, get_element(better)) ) break; + + place(get_element(better), pos); + pos = better; + l = left(pos); + r = right(pos); + } + if (pos != i) place(moving, pos); + } + + void move_up(int i) { + int pos = i; + int p = parent(pos); + T moving = get_element(pos); + + while (pos > 0 && compare(moving, get_element(p))) { + place(get_element(p), pos); + pos = p; + p = parent(pos); + } + if (pos != i) place(moving, pos); + } +}; + + +#endif diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h new file mode 100644 index 00000000000..92f117042ea --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -0,0 +1,159 @@ +// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : TODO: WHO? and Ivo Vigan + +#ifndef _RECONSTRUCTION_EDGE_2_H_ +#define _RECONSTRUCTION_EDGE_2_H_ + +#import "Dynamic_priority_queue.h" + +//---------------CLASS CPEDGE--------------------- +template +class Reconstruction_edge_2 +{ +protected: + Edge m_edge; + Vertex_handle m_source; + Vertex_handle m_target; + + FT m_before_cost; + FT m_after_cost; + +public: + Reconstruction_edge_2() + { + m_edge = Edge(Face_handle(), 0); + m_source = Vertex_handle(); + m_target = Vertex_handle(); + + m_before_cost = 0.0; + m_after_cost = 0.0; + } + + Reconstruction_edge_2(const Reconstruction_edge_2& pedge) + { + m_edge = pedge.edge(); + m_source = pedge.source(); + m_target = pedge.target(); + + m_before_cost = pedge.before(); + m_after_cost = pedge.after(); + } + + Reconstruction_edge_2(const Edge& edge, + const FT before, + const FT after) + { + m_edge = edge; + get_vertices(); + + m_before_cost = before; + m_after_cost = after; + } + + Reconstruction_edge_2(const Edge& edge, + const FT priority = 0.0) + { + m_edge = edge; + get_vertices(); + + m_before_cost = 0.0; + m_after_cost = priority; + } + + Reconstruction_edge_2(Vertex_handle source, Vertex_handle target) + { + m_edge = Edge(Face_handle(), 0); + m_source = source; + m_target = target; + + m_before_cost = 0.0; + m_after_cost = 0.0; + } + + virtual ~Reconstruction_edge_2() { } + + Reconstruction_edge_2& operator = (const Reconstruction_edge_2& pedge) + { + m_edge = pedge.edge(); + m_source = pedge.source(); + m_target = pedge.target(); + + m_before_cost = pedge.before(); + m_after_cost = pedge.after(); + + return *this; + } + + bool operator == (const Reconstruction_edge_2& pedge) const + { + return (m_source->id() == pedge.source()->id() && + m_target->id() == pedge.target()->id()); + } + + bool operator < (const Reconstruction_edge_2& pedge) const + { + if (m_source->id() < pedge.source()->id()) return true; + if (m_source->id() > pedge.source()->id()) return false; + + if (m_target->id() < pedge.target()->id()) return true; + return false; + } + + const Edge& edge() const { return m_edge; } + + const Vertex_handle& source() const { return m_source; } + + const Vertex_handle& target() const { return m_target; } + + const FT before() const { return m_before_cost; } + + const FT after() const { return m_after_cost; } + + const FT priority() const { return after() - before(); } + +protected: + void get_vertices() + { + int index = m_edge.second; + m_source = m_edge.first->vertex( (index+1)%3 ); + m_target = m_edge.first->vertex( (index+2)%3 ); + } +}; + + + +//---------------CLASS CPQUEUE--------------------- +template +class Dynamic_priority_queue_edges : public Dynamic_priority_queue { +public: + Dynamic_priority_queue_edges() { } + + ~Dynamic_priority_queue_edges() { } + + // a < b + bool compare(const T& a, const T& b) const + { + return (a.priority() < b.priority()); + } +}; + +#endif + + +/* RECONSTRUCTION_EDGE_2_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h new file mode 100644 index 00000000000..d56f41f1e3c --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -0,0 +1,228 @@ +#ifndef RECONSTRUCTION_FACE_BASE_2_H_ +#define RECONSTRUCTION_FACE_BASE_2_H_ + +#include "Cost.h" +#include "Sample.h" +#include + +#include + + +/// The Reconstruction_face_base_2 class (corresponding to Reconstruction_face_base_2 in prototype) is the default +/// vertex class of the Reconstruction_face_base_2 class. +/// +/// - Each vertex stores a CSample as well as the corresponding relocated point +/// +namespace CGAL { +/// @param Kernel Geometric traits class +/// @param Vb Vertex base class, model of TriangulationFaceBase_2. +template < class Kernel, class Fb = Triangulation_face_base_2 > +class Reconstruction_face_base_2 : public Fb +{ +public: + typedef Fb Base; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Face_handle Face_handle; + + template < typename TDS2 > + struct Rebind_TDS { + typedef typename Base::template Rebind_TDS::Other Fb2; + typedef Reconstruction_face_base_2 Other; + }; + + typedef typename Kernel::FT FT; + typedef Cost Cost; + typedef Sample Sample; + typedef std::list Sample_list; + +private: + Sample_list m_samples[3]; + FT m_mass[3]; + + Cost m_cost0[3]; + Cost m_cost1[3]; + int m_plan[3]; + +public: + Reconstruction_face_base_2() + : Base() + { + init(); + } + + Reconstruction_face_base_2(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3) + : Base(v1,v2,v3) + { + init(); + } + + Reconstruction_face_base_2(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3, + Face_handle f1, + Face_handle f2, + Face_handle f3) + : Base(v1,v2,v3,f1,f2,f3) + { + init(); + } + + Reconstruction_face_base_2(Face_handle f) + : Base(f) + { + m_samples[0] = f->samples(0); + m_samples[1] = f->samples(1); + m_samples[2] = f->samples(2); + + m_mass[0] = f->mass(0); + m_mass[1] = f->mass(1); + m_mass[2] = f->mass(2); + + m_cost0[0] = f->vertex_cost(0); + m_cost0[1] = f->vertex_cost(1); + m_cost0[2] = f->vertex_cost(2); + + m_cost1[0] = f->edge_cost(0); + m_cost1[1] = f->edge_cost(1); + m_cost1[2] = f->edge_cost(2); + + m_plan[0] = f->plan(0); + m_plan[1] = f->plan(1); + m_plan[2] = f->plan(2); + } + + virtual ~Reconstruction_face_base_2() + { + clean_all_samples(); + } + + void init() + { + m_mass[0] = 0.0; + m_mass[1] = 0.0; + m_mass[2] = 0.0; + + m_cost0[0] = Cost(); + m_cost0[1] = Cost(); + m_cost0[2] = Cost(); + + m_cost1[0] = Cost(); + m_cost1[1] = Cost(); + m_cost1[2] = Cost(); + + m_plan[0] = 0; + m_plan[1] = 0; + m_plan[2] = 0; + } + + const int plan(int edge) const { return m_plan[edge]; } + int& plan(int edge) { return m_plan[edge]; } + + const FT& mass(int edge) const { return m_mass[edge]; } + FT& mass(int edge) { return m_mass[edge]; } + + const Cost& vertex_cost(int edge) const { return m_cost0[edge]; } + Cost& vertex_cost(int edge) { return m_cost0[edge]; } + + const Cost& edge_cost(int edge) const { return m_cost1[edge]; } + Cost& edge_cost(int edge) { return m_cost1[edge]; } + + const Cost& cost(int edge) const + { + if (plan(edge) == 0) return vertex_cost(edge); + return edge_cost(edge); + } + + const bool ghost(int edge) const + { + if (mass(edge) == 0.0) return true; + if (plan(edge) == 0) return true; + return false; + } + + const Sample_list& samples(int edge) const { return m_samples[edge]; } + Sample_list& samples(int edge) { return m_samples[edge]; } + + void add_sample(int edge, Sample* sample) + { + m_samples[edge].push_back(sample); + } + + void clean_samples(int edge) + { + m_samples[edge].clear(); + } + + void clean_all_samples() + { + for (int i = 0; i < 3; ++i) + clean_samples(i); + } +}; + +//---------------STRUCT LESS FACE_HANDLE--------------------- +template +struct less_Face_handle +{ + void get_vertices_id(const T& face, int& a, int& b, int& c) const + { + a = face->vertex(0)->id(); + b = face->vertex(1)->id(); + c = face->vertex(2)->id(); + } + + bool operator() (const T& a, const T& b) const + { + int a0, a1, a2; + get_vertices_id(a, a0, a1, a2); + + int b0, b1, b2; + get_vertices_id(b, b0, b1, b2); + + if (a0 < b0) return true; + if (a0 > b0) return false; + + if (a1 < b1) return true; + if (a1 > b1) return false; + + if (a2 < b2) return true; + return false; + } +}; + + +//---------------STRUCT LESS EDGE--------------------- +template +struct less_Edge +{ + void get_vertices_id(const T& a, int& i, int& j) const + { + i = a.first->vertex( (a.second+1)%3 )->id(); + j = a.first->vertex( (a.second+2)%3 )->id(); + if (i > j) std::swap(i, j); + } + + bool operator() (const T& a, const T& b) const + { + int a0, a1; + get_vertices_id(a, a0, a1); + + int b0, b1; + get_vertices_id(b, b0, b1); + + if (a0 < b0) return true; + if (a0 > b0) return false; + if (a1 < b1) return true; + return false; + } +}; + + + +} //end namespace + + + +#endif /* RECONSTRUCTION_FACE_BASE_2_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h new file mode 100644 index 00000000000..f74cb29204e --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -0,0 +1,1298 @@ +// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Fernando de Goes and Ivo Vigan + +#ifndef RECONSTRUCTION_SIMPLIFICATION_2_H_ +#define RECONSTRUCTION_SIMPLIFICATION_2_H_ + +//#include + +#include "Reconstruction_triangulation_2.h" +#include "Cost.h" +#include "Reconstruction_edge_2.h" +#include "Sample.h" +#include "console_color.h" + +#include + +#include +#include +#include + +#include + + +namespace CGAL { + +template +class Reconstruction_simplification_2 { + +public: + typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; + typedef typename Kernel::Vector_2 Vector; + + typedef Reconstruction_triangulation_2 Triangulation; + + typedef typename Triangulation::Vertex Vertex; + typedef typename Triangulation::Vertex_handle Vertex_handle; + typedef typename Triangulation::Vertex_iterator Vertex_iterator; + typedef typename Triangulation::Vertex_circulator Vertex_circulator; + typedef typename Triangulation::Finite_vertices_iterator Finite_vertices_iterator; + + typedef typename Triangulation::Edge Edge; + typedef typename Triangulation::Edge_iterator Edge_iterator; + typedef typename Triangulation::Edge_circulator Edge_circulator; + typedef typename Triangulation::Finite_edges_iterator Finite_edges_iterator; + + typedef typename Triangulation::Face Face; + typedef typename Triangulation::Face_handle Face_handle; + typedef typename Triangulation::Face_iterator Face_iterator; + typedef typename Triangulation::Face_circulator Face_circulator; + typedef typename Triangulation::Finite_faces_iterator Finite_faces_iterator; + + typedef typename Triangulation::Vertex_handle_map Vertex_handle_map; + typedef typename Triangulation::Face_handle_map Face_handle_map; + + typedef typename Triangulation::Vertex_handle_set Vertex_handle_set; + typedef typename Triangulation::Edge_set Edge_set; + + typedef typename Triangulation::Edge_list Edge_list; + + typedef typename Triangulation::Cost Cost; + typedef typename Triangulation::Sample Sample; + typedef typename Triangulation::Sample_list Sample_list; + typedef typename Triangulation::Sample_list_const_iterator Sample_list_const_iterator; + + typedef typename Triangulation::Point_list Point_list; + typedef typename Triangulation::Point_list_const_iterator Point_list_const_iterator; + + typedef typename Triangulation::PSample PSample; + typedef typename Triangulation::SQueue SQueue; + + typedef typename Triangulation::Reconstruction_edge_2 Reconstruction_edge_2; + typedef typename Triangulation::PQueue PQueue; + + + //------- + + + + //typedef Point_list_const_iterator InputIterator; + +protected: + Triangulation m_dt; + PQueue m_pqueue; + int m_ignore; + int m_verbose; + int m_mchoice; // # Edges + bool m_use_flip; + double m_alpha; // [0, 1] + double m_norm_tol; // [0,BBOX] + double m_tang_tol; // [0,BBOX] + double m_ghost; // ghost vs solid + unsigned m_relocation; // # relocations + + //TODO: IV NEW + + // bbox + double m_bbox_x; + double m_bbox_y; + double m_bbox_size; + + InputIterator start; + InputIterator beyond; + PointPMap point_pmap; + MassPMap mass_pmap; + + +public: + + //Constructor + //Reconstruction_simplicifaction_2(InputIterator start, InputIterator beyond, PropertyMap point_mass_map); + + /* Reconstruction_simplification_2(InputIterator start, InputIterator beyond) { + std::cout << "Reconstruction_simplification_2() " << std::flush; + for (InputIterator it = start; it != beyond; ++it) + std::cout << ' ' << *it; + std::cout << '\n'; + */ + + Reconstruction_simplification_2(InputIterator start_itr, + InputIterator beyond_itr, + PointPMap in_point_pmap, + MassPMap in_mass_pmap) { + + start = start_itr; + beyond = beyond_itr; + + point_pmap = in_point_pmap; + mass_pmap = in_mass_pmap; + + m_verbose = 0; + m_mchoice = 0; + m_use_flip = true; + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; + m_relocation = 0; + + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; + + m_ignore = 0; + } + + ~Reconstruction_simplification_2() { + clear(); + } + + void initialize() { + + clear(); + insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); + + + + init(start, beyond); + + //----THIS WAS BEFORE PROPERTY MAPS + std::list m_samples; + for (InputIterator it = start; it != beyond; it++) { + Point point = get(point_pmap, *it); + FT mass = get( mass_pmap, *it); + Sample* s = new Sample(point, mass); + m_samples.push_back(s); + } + + assign_samples(m_samples.begin(), m_samples.end()); + + } + + //Returns the solid edges present after the reconstruction process. + //TODO: determine suitable way of storing them + void extract_solid_eges() { + + std::cout << "------------extracted_solid_eges----------------------" << std::endl; + + + + PQueue queue; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_edge_relevance(edge); // >= 0 + queue.push(Reconstruction_edge_2(edge, value)); + } + + + //TODO: IV find nicer way to handle m_ignore + int nb_remove = std::min(m_ignore, int(queue.size())); + + for (int i = 0; i < nb_remove; ++i) + { + Reconstruction_edge_2 pedge = queue.top(); + queue.pop(); + } + + while (!queue.empty()) + { + Reconstruction_edge_2 pedge = queue.top(); + queue.pop(); + //--- + int i = (pedge.edge()).second; + Face_handle face = (pedge.edge()).first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + std::cout << "( " << a << " , " << b << " )" << std::endl; + //--- + } + + std::cout << "---------------------------------------------------" << std::endl; + } + + void normalize_points() + { + //noise(1e-5); TODO IV, removed the noise + compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); + if (m_bbox_size == 0.0) return; + + Point center(m_bbox_x, m_bbox_y); + InputIterator it; + for (it = start; it != beyond; ++it) + { + Sample& sample = *it; + Vector vec = (sample.point() - center) / m_bbox_size; + sample.point() = CGAL::ORIGIN + vec; + } + m_bbox_x = m_bbox_y = 0.0; + m_bbox_size = 1.0; + } + + + void compute_bbox(double &x, double &y, double &scale) + { + + FT x_min, x_max, y_min, y_max; + InputIterator it = start; + Point p = it->point(); + x_min = x_max = p.x(); + y_min = y_max = p.y(); + ++it; + for ( ; it != beyond; ++it) + { + p = it->point(); + x_min = std::min(x_min, p.x()); + x_max = std::max(x_max, p.x()); + y_min = std::min(y_min, p.y()); + y_max = std::max(y_max, p.y()); + } + + x = 0.5 * (x_min + x_max); + y = 0.5 * (y_min + y_max); + scale = std::max(x_max - x_min, y_max - y_min); + if (scale == 0.0) scale = 1.0; + } + + + //-----------OLD CODE----------- + + void clear() { + m_dt.clear(); + m_pqueue.clean(); + } + + double time_duration(const double init) { + return (clock() - init) / CLOCKS_PER_SEC; + } + + // PARAMETERS // + + void set_mchoice(const int mchoice) { + m_mchoice = mchoice; + } + + void set_verbose(const int verbose) { + m_verbose = verbose; + } + + void set_alpha(const double alpha) { + m_alpha = alpha; + } + + void set_use_flip(const bool use_flip) { + m_use_flip = use_flip; + } + + void set_norm_tol(const double norm_tol) { + m_norm_tol = norm_tol; + } + + double get_norm_tol() const { + return m_norm_tol; + } + + void set_tang_tol(const double tang_tol) { + m_tang_tol = tang_tol; + } + + double get_tang_tol() const { + return m_tang_tol; + } + + void set_relocation(const unsigned relocation) { + m_relocation = relocation; + } + + unsigned get_relocation() const { + return m_relocation; + } + + void set_ghost(const double g) { + m_ghost = g; + m_dt.ghost_factor() = m_ghost; + } + + double get_ghost() { + return m_ghost; + } + + // INIT // + + void insert_loose_bbox(const double x, const double y, const double size) { + double timer = clock(); + std::cerr << yellow << "insert loose bbox" << white << "..."; + + int nb = m_dt.number_of_vertices(); + insert_point(Point(x - size, y - size), true, nb++); + insert_point(Point(x - size, y + size), true, nb++); + insert_point(Point(x + size, y + size), true, nb++); + insert_point(Point(x + size, y - size), true, nb++); + + std::cerr << yellow << "done" << white << " (" << nb << " vertices, " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + template // value_type = Point* + void init(Iterator begin, Iterator end) { + double timer = clock(); + std::cerr << yellow << "init" << white << "..."; + + int nb = m_dt.number_of_vertices(); + m_dt.infinite_vertex()->pinned() = true; + for (Iterator it = begin; it != end; it++) { + Point point = get(point_pmap, *it); + Vertex_handle vertex = insert_point(point, false, nb++); + } + + std::cerr << yellow << "done" << white << " (" << nb << " vertices, " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + Vertex_handle insert_point(const Point& point, const bool pinned, + const int id) { + Vertex_handle v = m_dt.insert(point); + v->pinned() = pinned; + v->id() = id; + return v; + } + + // ASSIGNMENT // + + void cleanup_assignments() { + m_dt.cleanup_assignments(); + } + + template // value_type = Sample* + void assign_samples(Iterator begin, Iterator end) { + double timer = clock(); + std::cerr << yellow << "assign samples" << white << "..."; + + m_dt.assign_samples(begin, end); + m_dt.reset_all_costs(); + + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } + + void reassign_samples() { + Sample_list samples; + m_dt.collect_all_samples(samples); + m_dt.cleanup_assignments(); + m_dt.assign_samples(samples.begin(), samples.end()); + m_dt.reset_all_costs(); + } + + void reassign_samples_around_vertex(Vertex_handle vertex) { + Sample_list samples; + m_dt.collect_samples_from_vertex(vertex, samples, true); + m_dt.assign_samples(samples.begin(), samples.end()); + + Edge_list hull; + m_dt.get_edges_from_star_minus_link(vertex, hull, true); + update_cost(hull.begin(), hull.end()); + } + + // RECONSTRUCTION // + + void reconstruct_until(const unsigned nv) { + double timer = clock(); + std::cerr << yellow << "reconstruct until " << white << nv << " V"; + + unsigned N = nv + 4; + unsigned performed = 0; + while (m_dt.number_of_vertices() > N) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } + + std::cerr << yellow << " done" << white << " (" << performed + << " iters, " << m_dt.number_of_vertices() - 4 << " V " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + void reconstruct(const unsigned steps) { + double timer = clock(); + std::cerr << yellow << "reconstruct " << steps << white; + + unsigned performed = 0; + for (unsigned i = 0; i < steps; ++i) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } + + std::cerr << yellow << " done" << white << " (" << performed << "/" + << steps << " iters, " << m_dt.number_of_vertices() - 4 + << " V, " << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + bool decimate() { + bool ok; + Reconstruction_edge_2 pedge; + ok = pick_edge(m_mchoice, pedge); + if (!ok) + return false; + + ok = do_collapse(pedge.edge()); + if (!ok) + return false; + return true; + } + + bool do_collapse(Edge edge) { + bool ok; + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle t = m_dt.target_vertex(edge); + + if (m_verbose > 0) { + std::cerr << std::endl << green << "do collapse " << white << "(" + << s->id() << "->" << t->id() << ") ... " << std::endl; + } + + Sample_list samples; + m_dt.collect_samples_from_vertex(s, samples, true); + + Edge_list hull; + m_dt.get_edges_from_star_minus_link(s, hull, true); + + if (m_mchoice == 0) + remove_stencil_from_pqueue(hull.begin(), hull.end()); + + if (m_use_flip) + ok = m_dt.make_collapsible(edge, hull.begin(), hull.end(), + m_verbose); + + // debug test + ok = m_dt.check_kernel_test(edge); + if (!ok) { + std::cerr << red << "do_collapse: kernel test failed: " << white + << std::endl; + return false; + } + // + + m_dt.collapse(edge, m_verbose); + + m_dt.assign_samples(samples.begin(), samples.end()); + + update_cost(hull.begin(), hull.end()); + + if (m_mchoice == 0) + push_stencil_to_pqueue(hull.begin(), hull.end()); + + for (unsigned i = 0; i < m_relocation; ++i) { + relocate_one_ring(hull.begin(), hull.end()); + } + + if (m_verbose > 0) { + std::cerr << green << "done" << std::endl; + } + + return true; + } + + bool simulate_collapse(const Edge& edge, Cost& cost) { + bool ok; + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle t = m_dt.target_vertex(edge); + + if (m_verbose > 1) { + std::cerr << green << "simulate collapse " << white << "(" + << s->id() << "->" << t->id() << ") ... " << std::endl; + } + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_source = copy.source_vertex(copy_edge); + + if (m_use_flip) { + Edge_list copy_hull; + copy.get_edges_from_star_minus_link(copy_source, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), + copy_hull.end(), m_verbose); + if (!ok) { + std::cerr << yellow << "simulation: failed (make collapsible)" + << white << std::endl; + return false; + } + } + + ok = copy.check_kernel_test(copy_edge); + if (!ok) { + std::cerr << yellow << "simulation: failed (kernel test)" << white + << std::endl; + return false; + } + + copy.collapse(copy_edge, m_verbose); + + Sample_list samples; + m_dt.collect_samples_from_vertex(s, samples, false); + + backup_samples(samples.begin(), samples.end()); + copy.assign_samples_brute_force(samples.begin(), samples.end()); + copy.reset_all_costs(); + cost = copy.compute_total_cost(); + restore_samples(samples.begin(), samples.end()); + + if (m_verbose > 1) { + std::cerr << green << "done" << white << std::endl; + } + + return true; + } + + template // value_type = Sample* + void backup_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample* sample = *it; + sample->backup(); + } + } + + template // value_type = Sample* + void restore_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample* sample = *it; + sample->restore(); + } + } + + // PEDGE // + + bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { + Cost after_cost; + bool ok = simulate_collapse(edge, after_cost); + if (!ok) + return false; + + bool within_tol = is_within_tol(after_cost); + if (!within_tol) + return false; + + Vertex_handle source = m_dt.source_vertex(edge); + Cost before_cost = m_dt.compute_cost_around_vertex(source); + + FT before = before_cost.finalize(m_alpha); + FT after = after_cost.finalize(m_alpha); + pedge = Reconstruction_edge_2(edge, before, after); + return true; + } + + bool is_within_tol(const Cost& cost) const { + if (cost.max_norm() > m_norm_tol) + return false; + if (cost.max_tang() > m_tang_tol) + return false; + return true; + } + + // COST // + + void init_cost() { + m_dt.reset_all_costs(); + } + + template // value_type = Edge + void update_cost(Iterator begin, Iterator end) { + Edge_list edges; + collect_cost_stencil(m_dt, begin, end, edges); + + typename Edge_list::iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + m_dt.update_cost(edge); + } + } + + template // value_type = Edge + void collect_cost_stencil(const Triangulation& mesh, Iterator begin, + Iterator end, Edge_list& edges) { + Edge_set done; + Edge_list fifo; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + fifo.push_back(edge); + done.insert(edge); + } + + while (!fifo.empty()) { + Edge edge = fifo.front(); + fifo.pop_front(); + + edge = mesh.twin_edge(edge); + edges.push_back(edge); + + Edge next = mesh.next_edge(edge); + if (done.insert(next).second) + fifo.push_back(next); + + Edge prev = mesh.prev_edge(edge); + if (done.insert(prev).second) + fifo.push_back(prev); + } + } + + // PQUEUE (MCHOICE or EXHAUSTIVE) // + + bool pick_edge(int nb, Reconstruction_edge_2& best_pedge) { + if (m_dt.number_of_faces() < 2) + return false; + + int ne = int(2 * m_dt.tds().number_of_edges()); + if (nb > ne) + nb = ne; + + bool ok; + if (nb == 0) { + ok = pick_edge_from_pqueue(best_pedge); + return ok; + } + m_pqueue.clean(); + + if (nb == ne) { + ok = pick_edge_brute_force(best_pedge); + return ok; + } + + ok = pick_edge_randomly(nb, best_pedge); + return ok; + } + + bool pick_edge_from_pqueue(Reconstruction_edge_2& best_pedge) { + if (m_pqueue.empty()) + populate_pqueue(); + if (m_pqueue.empty()) + return false; + best_pedge = m_pqueue.top(); + m_pqueue.pop(); + return true; + } + + bool pick_edge_brute_force(Reconstruction_edge_2& best_pedge) { + PQueue pqueue; + Finite_edges_iterator ei; + for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); + ++ei) { + Edge edge = *ei; + push_to_pqueue(edge, pqueue); + + edge = m_dt.twin_edge(edge); + push_to_pqueue(edge, pqueue); + } + if (pqueue.empty()) + return false; + best_pedge = pqueue.top(); + return true; + } + + bool pick_edge_randomly(int nb, Reconstruction_edge_2& best_pedge) { + PQueue pqueue; + for (int i = 0; i < nb; ++i) { + Reconstruction_edge_2 pedge; + if (random_pedge(pedge)) + pqueue.push(pedge); + } + if (pqueue.empty()) + return false; + best_pedge = pqueue.top(); + return true; + } + + void populate_pqueue() { + Finite_edges_iterator ei; + for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); + ++ei) { + Edge edge = *ei; + push_to_pqueue(edge, m_pqueue); + + edge = m_dt.twin_edge(edge); + push_to_pqueue(edge, m_pqueue); + } + } + + bool push_to_pqueue(const Edge& edge, PQueue& pqueue) { + if (m_dt.is_pinned(edge)) + return false; + if (m_dt.is_target_cyclic(edge)) + return false; + + Reconstruction_edge_2 pedge; + bool ok = create_pedge(edge, pedge); + if (!ok) + return false; + pqueue.push(pedge); + return true; + } + + bool random_pedge(Reconstruction_edge_2& pedge) { + for (unsigned i = 0; i < 10; ++i) { + Edge edge = m_dt.random_finite_edge(); + if (m_dt.is_pinned(edge)) + continue; + if (m_dt.is_target_cyclic(edge)) + continue; + bool ok = create_pedge(edge, pedge); + if (ok) + return true; + } + return false; + } + + template // value_type = Edge + void remove_stencil_from_pqueue(Iterator begin, Iterator end) { + if (m_pqueue.empty()) + return; + + Edge_list edges; + collect_pqueue_stencil(m_dt, begin, end, edges); + + typename Edge_list::const_iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + m_pqueue.remove(Reconstruction_edge_2(edge)); + } + } + + template // value_type = Edge + void push_stencil_to_pqueue(Iterator begin, Iterator end) { + Edge_list edges; + collect_pqueue_stencil(m_dt, begin, end, edges); + + typename Edge_list::const_iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + push_to_pqueue(edge, m_pqueue); + } + } + + template // value_type = Edge + void collect_pqueue_stencil(const Triangulation& mesh, Iterator begin, + Iterator end, Edge_list& edges) { + Vertex_handle_set vertex_set; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + Edge twin = mesh.twin_edge(edge); + + Vertex_handle s = mesh.source_vertex(edge); + if (!s->pinned()) + vertex_set.insert(s); + + Vertex_handle t = mesh.target_vertex(edge); + if (!t->pinned()) + vertex_set.insert(t); + + Vertex_handle f = mesh.opposite_vertex(edge); + if (!f->pinned()) + vertex_set.insert(f); + + Vertex_handle b = mesh.opposite_vertex(twin); + if (!b->pinned()) + vertex_set.insert(b); + } + + typename Vertex_handle_set::const_iterator vi; + for (vi = vertex_set.begin(); vi != vertex_set.end(); ++vi) { + Vertex_handle v = *vi; + Edge_circulator ecirc = mesh.incident_edges(v); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (mesh.source_vertex(edge) != v) + edge = mesh.twin_edge(edge); + edges.push_back(edge); + } + } + } + + // COPY STAR // + + // edge must not be pinned or have cyclic target + Edge copy_star(const Edge& edge, Triangulation& copy) { + copy.tds().set_dimension(2); + copy.infinite_vertex()->pinned() = true; + + // copy vertices + Vertex_handle_map cvmap; + + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle cs = copy.tds().create_vertex(); + cvmap[s] = copy_vertex(s, cs); + + Vertex_circulator vcirc = m_dt.incident_vertices(s); + Vertex_circulator vend = vcirc; + CGAL_For_all(vcirc, vend) + { + Vertex_handle v = vcirc; + if (cvmap.find(v) == cvmap.end()) { + Vertex_handle cv = copy.tds().create_vertex(); + cvmap[v] = copy_vertex(v, cv); + } + } + + // copy faces + Face_handle_map cfmap; + Face_circulator fcirc = m_dt.incident_faces(s); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + Face_handle cf = copy.tds().create_face(); + cfmap[f] = copy_face(f, cf, cvmap); + } + + // set neighbors + fcirc = m_dt.incident_faces(s); + fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + copy_neighbors(f, s, cvmap, cfmap); + } + + // make copy homeomorphic to S^2 + close_copy_mesh(cs, copy); + + // copy samples surrounding star + copy_samples(s, cs, cfmap, copy); + + // get copy of edge + Edge copy_edge = get_copy_edge(edge, cvmap, cfmap); + return copy_edge; + } + + Vertex_handle copy_vertex(Vertex_handle v0, Vertex_handle v1) { + v1->id() = v0->id(); + v1->set_point(v0->point()); + v1->pinned() = v0->pinned(); + v1->set_sample(v0->get_sample()); + return v1; + } + + Face_handle copy_face(Face_handle f0, Face_handle f1, + Vertex_handle_map& vmap) { + for (unsigned i = 0; i < 3; ++i) { + Vertex_handle v0i = f0->vertex(i); + Vertex_handle v1i = vmap[v0i]; + f1->set_vertex(i, v1i); + v1i->set_face(f1); + } + return f1; + } + + void copy_neighbors(Face_handle f, Vertex_handle v, Vertex_handle_map& vmap, + Face_handle_map& fmap) { + int i = f->index(v); + Face_handle cf = fmap[f]; + Vertex_handle cv = vmap[v]; + + if (fmap.find(f->neighbor(i)) != fmap.end()) { + Face_handle fi = f->neighbor(i); + Face_handle cfi = fmap[fi]; + cf->set_neighbor(i, cfi); + } + + for (unsigned j = 0; j < 2; ++j) { + i = (i + 1) % 3; + Face_handle fi = f->neighbor(i); + Face_handle cfi = fmap[fi]; + cf->set_neighbor(i, cfi); + } + } + + void close_copy_mesh(Vertex_handle vertex, Triangulation& copy) { + std::vector outer_faces; + + Face_circulator fcirc = copy.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int i = face->index(vertex); + + if (face->neighbor(i) != Face_handle()) + continue; + + Vertex_handle v1 = face->vertex((i + 1) % 3); + Vertex_handle v2 = face->vertex((i + 2) % 3); + + Face_handle outer = copy.tds().create_face(); + outer->set_vertex(0, copy.infinite_vertex()); + outer->set_vertex(1, v2); + outer->set_vertex(2, v1); + + face->set_neighbor(i, outer); + outer->set_neighbor(0, face); + + outer_faces.push_back(outer); + } + + for (unsigned i = 0; i < outer_faces.size(); ++i) { + unsigned j = (i + 1) % outer_faces.size(); + outer_faces[i]->set_neighbor(2, outer_faces[j]); + outer_faces[j]->set_neighbor(1, outer_faces[i]); + } + + if (!outer_faces.empty()) + copy.infinite_vertex()->set_face(outer_faces[0]); + } + + void copy_samples(Vertex_handle vertex, Vertex_handle copy_vertex, + Face_handle_map& fmap, Triangulation& copy) { + Face_circulator fcirc = m_dt.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + Edge twin = m_dt.twin_edge(Edge(face, index)); + + Face_handle copy_face = fmap[face]; + index = copy_face->index(copy_vertex); + Edge copy_twin = copy.twin_edge(Edge(copy_face, index)); + + Sample_list samples; + m_dt.collect_samples_from_edge(twin, samples); + copy_twin.first->samples(copy_twin.second) = samples; + } + copy_vertex->set_sample(NULL); + } + + Edge get_copy_edge(const Edge& edge, Vertex_handle_map& vmap, + Face_handle_map& fmap) { + Face_handle f = edge.first; + Vertex_handle v = f->vertex(edge.second); + + Face_handle cf = fmap[f]; + Vertex_handle cv = vmap[v]; + + return Edge(cf, cf->index(cv)); + } + + // RELOCATION // + + void relocate_one_vertex(Vertex_handle vertex) { + std::swap(vertex->point(), vertex->relocated()); + reassign_samples_around_vertex(vertex); + } + + template // value_type = Edge + void relocate_one_ring(Iterator begin, Iterator end) { + Vertex_handle_set vertices; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + vertices.insert(m_dt.source_vertex(edge)); + vertices.insert(m_dt.target_vertex(edge)); + } + + typename Vertex_handle_set::const_iterator vi; + for (vi = vertices.begin(); vi != vertices.end(); ++vi) { + Vertex_handle v = *vi; + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); + } + + for (vi = vertices.begin(); vi != vertices.end(); ++vi) { + Vertex_handle v = *vi; + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; + + Edge_list hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); + + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + + if (norm_bef < norm_aft) { + // undo relocation + relocate_one_vertex(v); + } else if (m_mchoice == 0) { + // update queue + hull.clear(); + m_dt.get_edges_from_star_minus_link(v, hull, true); + remove_stencil_from_pqueue(hull.begin(), hull.end()); + push_stencil_to_pqueue(hull.begin(), hull.end()); + } + } + } + } + + void relocate_all_vertices() { + double timer = clock(); + std::cerr << yellow << "relocate all" << white << "..."; + + m_pqueue.clean(); // pqueue must be recomputed + + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); + } + + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; + + Edge_list hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); + + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + + // undo relocation + if (norm_bef < norm_aft) + relocate_one_vertex(v); + } + } + + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } + + Vector compute_gradient(Vertex_handle vertex) { + Vector grad(0.0, 0.0); + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + if (m_dt.get_plan(edge) == 0) + grad = grad + compute_gradient_for_plan0(edge); + else + grad = grad + compute_gradient_for_plan1(edge); + } + return grad; + } + + Point compute_relocation(Vertex_handle vertex) { + FT coef = 0.0; + Vector rhs(0.0, 0.0); + + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + if (m_dt.get_plan(edge) == 0) + compute_relocation_for_plan0(edge, coef, rhs); + else + compute_relocation_for_plan1(edge, coef, rhs); + } + compute_relocation_for_vertex(vertex, coef, rhs); + + if (coef == 0.0) + return vertex->point(); + return CGAL::ORIGIN + (rhs / coef); + } + + void compute_relocation_for_vertex(Vertex_handle vertex, FT& coef, + Vector& rhs) { + Sample* sample = vertex->get_sample(); + if (sample) { + const FT m = sample->mass(); + const Point& ps = sample->point(); + rhs = rhs + m * (ps - CGAL::ORIGIN); + coef += m; + } + } + + Vector compute_gradient_for_plan0(const Edge& edge) { + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + Sample_list samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + Vector grad(0.0, 0.0); + Sample_list_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) { + Sample* sample = *it; + const FT m = sample->mass(); + const Point& ps = sample->point(); + + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + if (Da < Db) + grad = grad + m * (pa - ps); + } + return grad; + } + + void compute_relocation_for_plan0(const Edge& edge, FT& coef, Vector& rhs) { + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + Sample_list samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + Sample_list_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) { + Sample* sample = *it; + const FT m = sample->mass(); + const Point& ps = sample->point(); + + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + + if (Da < Db) { + rhs = rhs + m * (ps - CGAL::ORIGIN); + coef += m; + } + } + } + + Vector compute_gradient_for_plan1(const Edge& edge) { + FT M = m_dt.get_mass(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + SQueue queue; + m_dt.sort_samples_from_edge(edge, queue); + + //FT start = 0.0; + Vector grad(0.0, 0.0); + while (!queue.empty()) { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + // normal + tangnetial + const FT coord = psample.priority(); + Point pf = CGAL::ORIGIN + (1.0 - coord) * (pa - CGAL::ORIGIN) + + coord * (pb - CGAL::ORIGIN); + grad = grad + m * (1.0 - coord) * (pf - ps); + + /* + // only normal + FT bin = m/M; + FT center = start + 0.5*bin; + Point pc = CGAL::ORIGIN + (1.0-center)*(pa - CGAL::ORIGIN) + center*(pb - CGAL::ORIGIN); + start += bin; + grad = grad + m*(bin*bin/12.0)*(pa - pb); + grad = grad + m*(1.0-center)*(pc - pf); + */ + } + return grad; + } + + void compute_relocation_for_plan1(const Edge& edge, FT& coef, Vector& rhs) { + FT M = m_dt.get_mass(edge); + const Point& pb = m_dt.target_vertex(edge)->point(); + + SQueue queue; + m_dt.sort_samples_from_edge(edge, queue); + + //FT start = 0.0; + while (!queue.empty()) { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + const FT coord = psample.priority(); + const FT one_minus_coord = 1.0 - coord; + + // normal + tangential + coef += m * one_minus_coord * one_minus_coord; + rhs = + rhs + + m * one_minus_coord + * ((ps - CGAL::ORIGIN) + - coord * (pb - CGAL::ORIGIN)); + + /* + // only normal + FT bin = m/M; + FT center = start + 0.5*bin; + FT one_minus_center = 1.0 - center; + start += bin; + + coef += m*bin*bin/12.0; + rhs = rhs + m*(bin*bin/12.0)*(pb - CGAL::ORIGIN); + + coef += m*one_minus_center*(coord - center); + rhs = rhs + m*one_minus_center*(coord - center)*(pb - CGAL::ORIGIN); + */ + } + } + + void print_stats_debug() const + { + int nb_solid = 0; + int nb_ghost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) nb_ghost++; + else nb_solid++; + } + + std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; + std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; + std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; + std::cerr << "# solid: " << nb_solid << std::endl; + std::cerr << "# ghost: " << nb_ghost << std::endl; + } + +}; +} + +#endif diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h new file mode 100644 index 00000000000..d622dea5d97 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -0,0 +1,1089 @@ +// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Fernando de Goes and Ivo Vigan + + +// STL +#include +#include +#include +#include +#include + +// CGAL +#include +#include +#include +#include + + +// local +#include "Dynamic_priority_queue.h" +#include "Sample.h" +#include "Reconstruction_edge_2.h" +#include "Cost.h" +#include "Reconstruction_vertex_base_2.h" +#include "Reconstruction_face_base_2.h" + + +#undef min +#undef max + +#define MINN -1e100 +#define MAXN 1e100 +#define EPS 1e-15 + +namespace CGAL { + +/// The Reconstruction_triangulation_2 class (corresponding to Triangulation in prototype) +/// provides the reconstruction simplex as well as the transportation plan. +/// +/// @param Kernel The underlying Kernel +/// @param Tds Model of TriangulationDataStructure_2. +/// The vertex class must derive from Reconstruction_vertex_base_2. +/// The face class must derive from Reconstruction_face_base_2. +template , Reconstruction_face_base_2 > > +class Reconstruction_triangulation_2 : public Delaunay_triangulation_2 { +public: + + //TODO: IV rename Dt + typedef Reconstruction_triangulation_2 Rt_2; + + + + //typedef typename Reconstruction_triangulation_2::Geom_traits Kernel; + typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; + typedef typename Kernel::Vector_2 Vector; + typedef typename Kernel::Ray_2 Ray; + typedef typename Kernel::Line_2 Line; + typedef typename Kernel::Segment_2 Segment; + typedef typename Kernel::Triangle_2 Triangle; + + typedef typename Rt_2::Vertex Vertex; + typedef typename Rt_2::Vertex_handle Vertex_handle; + typedef typename Rt_2::Vertex_iterator Vertex_iterator; + typedef typename Rt_2::Vertex_circulator Vertex_circulator; + typedef typename Rt_2::Finite_vertices_iterator Finite_vertices_iterator; + + typedef typename Rt_2::Edge Edge; + typedef typename Rt_2::Edge_iterator Edge_iterator; + typedef typename Rt_2::Edge_circulator Edge_circulator; + typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; + + typedef typename Rt_2::Face Face; + typedef typename Rt_2::Face_handle Face_handle; + typedef typename Rt_2::Face_iterator Face_iterator; + typedef typename Rt_2::Face_circulator Face_circulator; + typedef typename Rt_2::Finite_faces_iterator Finite_faces_iterator; + + typedef std::map< Vertex_handle, Vertex_handle, less_Vertex_handle > Vertex_handle_map; + typedef std::map< Face_handle, Face_handle, less_Face_handle > Face_handle_map; + + typedef std::set< Vertex_handle, less_Vertex_handle > Vertex_handle_set; + typedef std::set< Edge, less_Edge > Edge_set; + + typedef std::list Edge_list; + + typedef std::list Point_list; + typedef typename Point_list::const_iterator Point_list_const_iterator; + + typedef Cost Cost; + typedef Sample Sample; + typedef std::list Sample_list; + typedef typename Sample_list::const_iterator Sample_list_const_iterator; + + typedef Sample_with_priority PSample; + typedef std::priority_queue< PSample, std::vector, greater_priority > SQueue; + + typedef Reconstruction_edge_2 Reconstruction_edge_2; + typedef Dynamic_priority_queue_edges PQueue; + + double m_factor; // ghost vs solid + + public: + Reconstruction_triangulation_2() { + m_factor = 1.0; + } + + ~Reconstruction_triangulation_2() + {} + + double& ghost_factor() { return m_factor; } + + const double& ghost_factor() const { return m_factor; } + + Edge random_finite_edge() + { + int nbf = Rt_2::number_of_faces(); + int offset = random_int(0, nbf-1); + Finite_faces_iterator fi = Rt_2::finite_faces_begin(); + for (int i = 0; i < offset; i++) fi++; + Face_handle face = fi; + int index = random_int(0, 40) % 3; + return Edge(face, index); + } + + // ACCESS // + + Vertex_handle source_vertex(const Edge& edge) const + { + return edge.first->vertex( Rt_2::ccw(edge.second) ); + } + + Vertex_handle target_vertex(const Edge& edge) const + { + return edge.first->vertex( Rt_2::cw(edge.second) ); + } + + Vertex_handle opposite_vertex(const Edge& edge) const + { + return edge.first->vertex( edge.second ); + } + + bool is_pinned(const Edge& edge) const + { + Vertex_handle s = source_vertex(edge); + if (s->pinned()) return true; + return false; + } + + Edge twin_edge(const Edge& edge) const + { + Face_handle f = edge.first; + Vertex_handle v = source_vertex(edge); + Face_handle nf = f->neighbor(edge.second); + return Edge(nf, Rt_2::ccw(nf->index(v))); + } + + Edge next_edge(const Edge& edge) const + { + Face_handle f = edge.first; + int index = Rt_2::ccw(edge.second); + return Edge(f, index); + } + + Edge prev_edge(const Edge& edge) const + { + Face_handle f = edge.first; + int index = Rt_2::cw(edge.second); + return Edge(f, index); + } + + FT get_length(const Edge& edge) const + { + Segment segment = get_segment(edge); + return std::sqrt(segment.squared_length()); + } + + Segment get_segment(const Edge& edge) const + { + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + return Segment(ps, pt); + } + + Triangle get_triangle(Face_handle face) const + { + Vertex_handle v0 = face->vertex(0); + Vertex_handle v1 = face->vertex(1); + Vertex_handle v2 = face->vertex(2); + return Triangle(v0->point(), v1->point(), v2->point()); + } + + // GET LINK // + + void get_vertices_from_edge_link(const Edge& edge, + Vertex_handle_set& vertices) const + { + vertices.insert( opposite_vertex(edge) ); + vertices.insert( opposite_vertex(twin_edge(edge)) ); + } + + void get_vertices_from_vertex_link(Vertex_handle vertex, + Vertex_handle_set& vertices) const + { + Vertex_circulator vcirc = Rt_2::incident_vertices(vertex); + Vertex_circulator vend = vcirc; + CGAL_For_all(vcirc, vend) + { + Vertex_handle v = vcirc; + vertices.insert(v); + } + } + + // boundary of star(vertex) + // 'outward' chooses the orientation of the boundary + void get_edges_from_star_minus_link(Vertex_handle vertex, + Edge_list& hull, + bool outward = false) const + { + Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + Edge edge(face, index); + if (outward) edge = twin_edge(edge); + hull.push_back(edge); + } + } + + // ATTRIBUTES // + + bool is_ghost(const Edge& edge) const + { + return edge.first->ghost(edge.second); + } + + int get_plan(const Edge& edge) const + { + return edge.first->plan(edge.second); + } + + void set_plan(const Edge& edge, int simplex) + { + edge.first->plan(edge.second) = simplex; + } + + FT get_mass(const Edge& edge) const + { + return edge.first->mass(edge.second); + } + + void set_mass(const Edge& edge, const FT mass) + { + edge.first->mass(edge.second) = mass; + } + + const Cost& get_cost(const Edge& edge) const + { + return edge.first->cost(edge.second); + } + + void set_vertex_cost(const Edge& edge, const Cost& cost) + { + edge.first->vertex_cost(edge.second) = cost; + } + + void set_edge_cost(const Edge& edge, const Cost& cost) + { + edge.first->edge_cost(edge.second) = cost; + } + + FT get_vertex_minus_edge_cost(const Edge& edge) const + { + const Cost& vcost = edge.first->vertex_cost(edge.second); + const Cost& ecost = edge.first->edge_cost(edge.second); + return vcost.finalize() - m_factor*ecost.finalize(); + } + + FT get_vertex_over_edge_cost(const Edge& edge) const + { + FT vvalue = edge.first->vertex_cost(edge.second).finalize(); + FT evalue = edge.first->edge_cost(edge.second).finalize(); + if (evalue == vvalue) return 1.0/m_factor; + return vvalue / (m_factor*evalue); + } + + FT get_edge_relevance(const Edge& edge) const + { + FT M = get_mass(edge); + if (M == 0.0) return 0.0; + + FT L = get_length(edge); + FT cost = get_cost(edge).finalize(); + return M*L*L / cost; + } + + FT get_density(const Edge& edge) const + { + FT length = get_length(edge); + FT mass = get_mass(edge); + return (mass / length); + } + + unsigned int nb_samples(const Edge& edge) const + { + Edge twin = twin_edge(edge); + return edge.first->samples(edge.second).size() + + twin.first->samples(twin.second).size(); + } + + void collect_samples_from_edge(const Edge& edge, Sample_list& samples) + { + const Sample_list& edge_samples = edge.first->samples(edge.second); + samples.insert(samples.end(), edge_samples.begin(), edge_samples.end()); + } + + void collect_samples_from_vertex(Vertex_handle vertex, + Sample_list& samples, + bool cleanup) + { + Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + + Edge edge(face, index); + collect_samples_from_edge(edge, samples); + + Edge next = next_edge(edge); + collect_samples_from_edge(next, samples); + + Edge prev = prev_edge(edge); + collect_samples_from_edge(prev, samples); + + if (cleanup) face->clean_all_samples(); + } + Sample* sample = vertex->get_sample(); + if (sample) samples.push_back(sample); + if (cleanup) vertex->set_sample(NULL); + } + + void collect_all_samples(Sample_list& samples) + { + for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); ei != Rt_2::finite_edges_end(); ++ei) + { + Edge edge = *ei; + Edge twin = twin_edge(edge); + collect_samples_from_edge(edge, samples); + collect_samples_from_edge(twin, samples); + } + for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); vi != Rt_2::finite_vertices_end(); ++vi) + { + Vertex_handle v = vi; + Sample* sample = v->get_sample(); + if (sample) samples.push_back(sample); + } + } + + void cleanup_assignments() + { + for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); fi != Rt_2::finite_faces_end(); ++fi) + { + fi->clean_all_samples(); + } + for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); vi != Rt_2::finite_vertices_end(); ++vi) + { + vi->set_sample(NULL); + } + } + + // COST // + + Cost compute_total_cost() const + { + Cost sum; + for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); ei != Rt_2::finite_edges_end(); ++ei) + { + Edge edge = *ei; + const Cost& cost = get_cost(edge); + sum.update_max(cost); + sum.add(cost); + } + return sum; + } + + Cost compute_cost_around_vertex(Vertex_handle vertex) const + { + Cost inner; + Cost outer; + Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + + Edge edge(face, index); + Cost cost = Rt_2::get_cost(edge); + outer.update_max(cost); + outer.add(cost); + + edge = Rt_2::next_edge(edge); + cost = Rt_2::get_cost(edge); + inner.update_max(cost); + inner.add(cost); + + edge = Rt_2::next_edge(edge); + cost = Rt_2::get_cost(edge); + inner.update_max(cost); + inner.add(cost); + } + inner.divide(2.0); + + Cost sum; + sum.add(inner); + sum.add(outer); + sum.update_max(inner); + sum.update_max(outer); + return sum; + } + + void reset_all_costs() + { + for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); ei != Rt_2::finite_edges_end(); ++ei) + { + Edge edge = *ei; + update_cost(edge); + } + } + + void update_cost(const Edge& edge) + { + compute_mass(edge); + compute_edge_cost(edge); + compute_vertex_cost(edge); + select_plan(edge); + } + + void compute_mass(const Edge& edge) + { + FT mass = 0.0; + + typename Sample_list::const_iterator it; + const Sample_list& samples0 = edge.first->samples(edge.second); + for (it = samples0.begin(); it != samples0.end(); ++it) + { + Sample* sample = *it; + mass += sample->mass(); + } + + Edge twin = twin_edge(edge); + const Sample_list& samples1 = twin.first->samples(twin.second); + for (it = samples1.begin(); it != samples1.end(); ++it) + { + Sample* sample = *it; + mass += sample->mass(); + } + + set_mass(edge, mass); + set_mass(twin, mass); + } + + void select_plan(const Edge& edge) + { + // transport plan: + // 0 - to vertex + // 1 - to edge + + int plan = 0; + FT diff = get_vertex_minus_edge_cost(edge); + if (diff >= 0.0) plan = 1; + + Edge twin = twin_edge(edge); + set_plan(edge, plan); + set_plan(twin, plan); + } + + void compute_edge_cost(const Edge& edge) + { + SQueue squeue; + FT M = get_mass(edge); + FT L = get_length(edge); + sort_samples_from_edge(edge, squeue); + Cost cost = compute_cost_from_squeue(squeue, M, L); + + Edge twin = twin_edge(edge); + set_edge_cost(edge, cost); + set_edge_cost(twin, cost); + } + + void sort_samples_from_edge(const Edge& edge, SQueue& squeue) + { + typename Sample_list::const_iterator it; + const Sample_list& samples0 = edge.first->samples(edge.second); + for (it = samples0.begin(); it != samples0.end(); ++it) + { + Sample* sample = *it; + squeue.push( PSample(sample, sample->coordinate()) ); + } + + Edge twin = twin_edge(edge); + const Sample_list& samples1 = twin.first->samples(twin.second); + for (it = samples1.begin(); it != samples1.end(); ++it) + { + Sample* sample = *it; + squeue.push( PSample(sample, 1.0 - sample->coordinate()) ); + } + } + + Cost compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) + { + if (squeue.empty()) return Cost(); + if (M == 0.0) return Cost(); + + Cost sum; + FT start = 0.0; + FT coef = L / M; + while (!squeue.empty()) + { + PSample psample = squeue.top(); + squeue.pop(); + + FT mass = psample.sample()->mass(); + FT coord = psample.priority() * L; + FT bin = mass * coef; + FT center = start + 0.5*bin; + FT pos = coord - center; + + FT norm2 = psample.sample()->distance2(); + FT tang2 = bin*bin/12 + pos*pos; + + sum.add(Cost(norm2, tang2), mass); + sum.compute_max(norm2, tang2); + + start += bin; + } + return sum; + } + + void compute_vertex_cost(const Edge& edge) + { + Edge twin = twin_edge(edge); + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + + Sample_list samples; + collect_samples_from_edge(edge, samples); + collect_samples_from_edge(twin, samples); + + Cost sum; + for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) + { + Sample* sample = *it; + FT mass = sample->mass(); + const Point& query = sample->point(); + + FT Ds = CGAL::squared_distance(query, ps); + FT Dt = CGAL::squared_distance(query, pt); + FT dist2 = std::min(Ds, Dt); + + FT norm2 = sample->distance2(); + FT tang2 = dist2 - norm2; + + sum.add(Cost(norm2, tang2), mass); + sum.compute_max(norm2, tang2); + } + set_vertex_cost(edge, sum); + set_vertex_cost(twin, sum); + } + + // SAMPLE // + + template // value_type = Sample* + void assign_samples(Iterator begin, Iterator end) + { + for (Iterator it = begin; it != end; ++it) + { + Sample* sample = *it; + assign_sample(sample); + } + } + + template // value_type = Sample* + void assign_samples_brute_force(Iterator begin, Iterator end) + { + for (Iterator it = begin; it != end; ++it) + { + Sample* sample = *it; + assign_sample_brute_force(sample); + } + } + + bool assign_sample(Sample* sample) + { + const Point& point = sample->point(); + Face_handle face = Rt_2::locate(point); + + if (face == Face_handle() || Rt_2::is_infinite(face)) + { + std::cout << "free bird" << std::endl; + return false; + } + + Vertex_handle vertex = find_nearest_vertex(point, face); + if (vertex != Vertex_handle()) + { + assign_sample_to_vertex(sample, vertex); + return true; + } + + Edge edge = find_nearest_edge(point, face); + assign_sample_to_edge(sample, edge); + return true; + } + + bool assign_sample_brute_force(Sample* sample) + { + const Point& point = sample->point(); + Face_handle nearest_face = Face_handle(); + for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); fi != Rt_2::finite_faces_end(); ++fi) + { + Face_handle face = fi; + if (face_has_point(face, point)) + { + nearest_face = face; + break; + } + } + + if (nearest_face == Face_handle()) + { + std::cout << "free bird" << std::endl; + return false; + } + + Vertex_handle vertex = find_nearest_vertex(point, nearest_face); + if (vertex != Vertex_handle()) + { + assign_sample_to_vertex(sample, vertex); + return true; + } + + Edge edge = find_nearest_edge(point, nearest_face); + assign_sample_to_edge(sample, edge); + return true; + } + + bool face_has_point(Face_handle face, const Point& query) const + { + for (int i = 0; i < 3; ++i) + { + Edge edge(face, i); + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + if (!compute_triangle_ccw(ps, pt, query)) return false; + } + return true; + } + + Vertex_handle find_nearest_vertex(const Point& point, Face_handle face) const + { + for (int i = 0; i < 3; ++i) + { + Vertex_handle vi = face->vertex(i); + const Point& pi = vi->point(); + if (pi == point) return vi; + } + return Vertex_handle(); + } + + Edge find_nearest_edge(const Point& point, Face_handle face) const + { + FT min_dist2 = MAXN; + Edge nearest(Face_handle(), 0); + for (int i = 0; i < 3; ++i) + { + Edge edge(face, i); + Segment segment = get_segment(edge); + FT dist2 = compute_distance2(point, segment); + if (dist2 < min_dist2) + { + min_dist2 = dist2; + nearest = edge; + } + } + + if (nearest.first == Face_handle()) + { + std::cout << "nearest edge not found" << std::endl; + } + return nearest; + } + + void assign_sample_to_vertex(Sample* sample, Vertex_handle vertex) + { + // DEBUG + if (vertex->get_sample()) + { + std::cout << "assign to vertex: vertex already has sample" << std::endl; + } + // + + sample->distance2() = 0.0; + sample->coordinate() = 0.0; + vertex->set_sample(sample); + } + + void assign_sample_to_edge(Sample* sample, const Edge& edge) + { + Segment segment = get_segment(edge); + const Point& query = sample->point(); + sample->distance2() = compute_distance2(query, segment); + sample->coordinate() = compute_coordinate(query, segment); + edge.first->add_sample(edge.second, sample); + } + + FT compute_distance2(const Point& query, const Segment& segment) const + { + Line line = segment.supporting_line(); + if (line.has_on(query)) return 0.0; + + Point proj = line.projection(query); + return CGAL::squared_distance(query, proj); + } + + FT compute_coordinate(const Point& q, const Segment& segment) const + { + const Point& p0 = segment.source(); + const Point& p1 = segment.target(); + Vector p0p1 = p1 - p0; + Vector p0q = q - p0; + FT t = (p0q * p0p1) / (p0p1 * p0p1); + return t; // [0,1] + } + + // SIGNED DISTANCE // + + // signed distance from line(a,b) to point t + FT signed_distance(Vertex_handle a, Vertex_handle b, Vertex_handle t) const + { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pt = t->point(); + return compute_signed_distance(pa, pb, pt); + } + + // signed distance from line(a,b) to point t + FT compute_signed_distance(const Point& pa, const Point& pb, const Point& pt) const + { + if (pt == pa) return 0.0; + if (pt == pb) return 0.0; + if (pa == pb) return std::sqrt(CGAL::squared_distance(pa, pt)); + + Vector vab = pb - pa; + vab = vab / sqrt(vab*vab); + Vector vab90(-vab.y(), vab.x()); + Vector vat = pt - pa; + return (vat * vab90); + } + + // signed distance from t to the intersection of line(a,b) and line(t,s) + FT signed_distance_from_intersection(Vertex_handle a, Vertex_handle b, + Vertex_handle t, Vertex_handle s) const + { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pt = t->point(); + const Point& ps = s->point(); + return compute_signed_distance_from_intersection(pa, pb, pt, ps); + } + + // signed distance from t to the intersection of line(a,b) and line(t,s) + FT compute_signed_distance_from_intersection(const Point& pa, const Point& pb, + const Point& pt, const Point& ps) const + { + FT Dabt = compute_signed_distance(pa, pb, pt); + if (Dabt == 0.0) return 0.0; + + Line lab(pa, pb-pa); + Line lts(pt, ps-pt); + + FT Dqt = MAXN; + CGAL::Object result = CGAL::intersection(lab, lts); + const Point* iq = CGAL::object_cast(&result); + if (iq) Dqt = std::sqrt(CGAL::squared_distance(*iq, pt)); + + if (Dabt < 0.0) Dqt = -Dqt; + return Dqt; + } + + bool is_triangle_ccw(Vertex_handle a, Vertex_handle b, Vertex_handle c) const + { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pc = c->point(); + return compute_triangle_ccw(pa, pb, pc); + } + + bool compute_triangle_ccw(const Point& pa, const Point& pb, const Point& pc) const + { + FT dist = compute_signed_distance(pa, pb, pc); + return (dist > -EPS); + } + + // COMBINATORIAL TESTS // + + // (a,b) is cyclic if (a,b,c) and (a,c,b) exist + bool is_edge_cyclic(const Edge& edge) const + { + Vertex_handle f = opposite_vertex(edge); + Vertex_handle b = opposite_vertex(twin_edge(edge)); + return (f == b); + } + + // b from (a,b) is cyclic if (a,b,c) and (b,a,c) exist + bool is_target_cyclic(const Edge& edge) const + { + if (!is_edge_cyclic(edge)) return false; + + Edge twin = twin_edge(edge); + Edge prev = prev_edge(twin); + Face_handle fp = prev.first->neighbor(prev.second); + Face_handle ft = twin.first->neighbor(twin.second); + return (fp == ft); + } + + bool is_flippable(const Edge& edge) const + { + Edge twin = twin_edge(edge); + if (Rt_2::is_infinite(twin.first)) return false; + if (Rt_2::is_infinite(edge.first)) return false; + + Vertex_handle vs = source_vertex(edge); + Vertex_handle vt = target_vertex(edge); + Vertex_handle vf = opposite_vertex(edge); + Vertex_handle vb = opposite_vertex(twin); + + if (!is_triangle_ccw(vs, vb, vf)) return false; + if (!is_triangle_ccw(vt, vf, vb)) return false; + return true; + } + + bool is_collapsible(const Edge& edge) const + { + if (!check_link_test(edge)) return false; + if (!check_kernel_test(edge)) return false; + return true; + } + + bool check_link_test(const Edge& edge) const + { + Vertex_handle s = source_vertex(edge); + Vertex_handle t = target_vertex(edge); + + if (s == t) return false; + typename Vertex_handle_set::const_iterator it; + + Vertex_handle_set svertices; + get_vertices_from_vertex_link(s, svertices); + + Vertex_handle_set tvertices; + get_vertices_from_vertex_link(t, tvertices); + + // link(s) inter link(t) + Vertex_handle_set ivertices; + for (it = svertices.begin(); it != svertices.end(); ++it) + { + Vertex_handle v = *it; + if (tvertices.find(v) != tvertices.end()) + ivertices.insert(v); + } + + Vertex_handle_set evertices; + get_vertices_from_edge_link(edge, evertices); + + // link(edge) =? link(s) inter link(t) + if (evertices.size() != ivertices.size()) return false; + + for (it = evertices.begin(); it != evertices.end(); ++it) + { + Vertex_handle v = *it; + if (ivertices.find(v) == ivertices.end()) + return false; + } + return true; + } + + bool check_kernel_test(const Edge& edge) const + { + Vertex_handle s = source_vertex(edge); + Vertex_handle t = target_vertex(edge); + + Edge_list hull; + get_edges_from_star_minus_link(s, hull); + return is_in_kernel(t->point(), hull.begin(), hull.end()); + } + + template // value_type = Edge + bool is_in_kernel(const Point& query, Iterator begin, Iterator end) const + { + for (Iterator it = begin; it != end; ++it) + { + Edge edge = *it; + const Point& pa = source_vertex(edge)->point(); + const Point& pb = target_vertex(edge)->point(); + if (!compute_triangle_ccw(pa, pb, query)) return false; + } + return true; + } + + // COLLAPSE // + + // (s,a,b) + (s,b,c) -> (s,a,c) + (a,b,c) + // st = (source,target) from 'make_collapsible' + // return (a,c) + Edge flip(const Edge& sb, Edge& st, int verbose = 0) + { + Vertex_handle t = target_vertex(st); + + Edge sc = twin_edge(prev_edge(sb)); + Rt_2::tds().flip(sb.first, sb.second); + Edge ac = prev_edge(twin_edge(sc)); + + Vertex_handle a = source_vertex(ac); + if (a == t) st = prev_edge(ac); + + return ac; + } + + void collapse(const Edge& edge, int verbose = 0) + { + if (is_edge_cyclic(edge)) + { + collapse_cyclic_edge(edge); + return; + } + + Edge twin = twin_edge(edge); + Rt_2::tds().join_vertices(twin); + } + + // (a,b,c) + (c,b,a) + (a,c,i) + (c,a,j) -> + // (a,c,i) + (c,a,j) + void collapse_cyclic_edge(const Edge& bc, int verbose = 1) + { + if (verbose > 0) + std::cout << "collapse_cyclic_edge ... "; + + Edge cb = twin_edge(bc); + Face_handle abc = bc.first; + Face_handle cba = cb.first; + + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle a = opposite_vertex(bc); + + Edge ac = twin_edge(next_edge(bc)); + Edge ca = twin_edge(prev_edge(cb)); + + a->set_face(ac.first); + c->set_face(ca.first); + ac.first->set_neighbor(ac.second, ca.first); + ca.first->set_neighbor(ca.second, ac.first); + + //TODO: IV UNCOMMEN THIS + this->delete_face(abc); + this->delete_face(cba); + this->delete_vertex(b); + + if (verbose > 0) + std::cout << "done" << std::endl; + } + + template // value_type = Edge + bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) + { + Vertex_handle source = source_vertex(edge); + Vertex_handle target = target_vertex(edge); + + PQueue pqueue; + for (Iterator it = begin; it != end; ++it) + { + Edge ab = twin_edge(*it); + Vertex_handle a = source_vertex(ab); + Vertex_handle b = target_vertex(ab); + FT D = signed_distance_from_intersection(a, b, target, source); + if (D < 0.0) pqueue.push(Reconstruction_edge_2(ab, D)); + } + + int nb_flips = 0; + while (!pqueue.empty()) + { + Reconstruction_edge_2 pedge = pqueue.top(); + FT Dbc = pedge.priority(); + Edge bc = pedge.edge(); + pqueue.pop(); + + Edge sb = prev_edge(bc); + Edge ab = prev_edge(twin_edge(sb)); + Edge sc = twin_edge(next_edge(bc)); + Edge cd = next_edge(sc); + + Vertex_handle a = source_vertex(ab); + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle d = target_vertex(cd); + + FT Dac = MINN; + if (a != c && is_triangle_ccw(a, b, c)) + Dac = signed_distance_from_intersection(a, c, target, source); + + FT Dbd = MINN; + if (b != d && is_triangle_ccw(b, c, d)) + Dbd = signed_distance_from_intersection(b, d, target, source); + + if (Dac == MINN && Dbd == MINN) + { + // TODO: IV comment in std::cerr << red << "--- No flips available ---" << white << std::endl; + std::cerr << "--- No flips available ---" << std::endl; + return false; + } + + if (std::max(Dac, Dbd) + EPS < Dbc) + { + std::cerr.precision(10); + // TODO: IV comment in std::cerr << red << "--- Flip makes kernel worse ---" << white << std::endl; + std::cerr << "--- Flip makes kernel worse ---" << std::endl; + std::cerr << Dac << " or " << Dbd << " vs " << Dbc << std::endl; + std::cerr << "a: " << a->point() << std::endl; + std::cerr << "b: " << b->point() << std::endl; + std::cerr << "c: " << c->point() << std::endl; + std::cerr << "d: " << d->point() << std::endl; + std::cerr << "t: " << target->point() << std::endl; + std::cerr << "diff = " << Dbc - std::max(Dac, Dbd) << std::endl; + return false; + } + + if (Dac > Dbd) + { + pqueue.remove(Reconstruction_edge_2(ab)); + Edge ac = flip(sb, edge, verbose); + if (Dac < 0.0) pqueue.push(Reconstruction_edge_2(ac, Dac)); + } + else + { + pqueue.remove(Reconstruction_edge_2(cd)); + Edge bd = flip(sc, edge, verbose); + if (Dbd < 0.0) pqueue.push(Reconstruction_edge_2(bd, Dbd)); + } + nb_flips++; + } + + if (verbose > 1) + //TODO: IV Comment in std::cerr << red << "--- Flip makes kernel worse ---" << white << std::endl; + std::cerr << "Nb flips: " << nb_flips << std::endl; + + return true; + } + + int random_int(const int min, const int max) + { + int range = max - min; + return min + int((double(rand())/double(RAND_MAX)) * range); + } + + }; +} //namespace CGAL + diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h new file mode 100644 index 00000000000..15f9b483427 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -0,0 +1,102 @@ +/* + * Reconstruction_vertex_base_2.h + * + * Created on: Jun 17, 2014 + * Author: ivovigan + */ + +#ifndef RECONSTRUCTION_VERTEX_BASE_2_H_ +#define RECONSTRUCTION_VERTEX_BASE_2_H_ + +#include +#include "sample.h" + +/// The Reconstruction_vertex_base_2 class (corresponding to Reconstruction_vertex_base_2 in prototype) is the default +/// vertex class of the Reconstruction_triangulation_2 class. +/// +/// - Each vertex stores a CSample as well as the corresponding relocated point +/// +namespace CGAL { +/// @param Kernel Geometric traits class +/// @param Vb Vertex base class, model of TriangulationVertexBase_2. +template < class Kernel, class Vb = Triangulation_vertex_base_2 > +class Reconstruction_vertex_base_2 : public Vb +{ +public: + typedef Vb Base; + typedef Sample Sample; + typedef typename Kernel::Point_2 Point; + typedef typename Base::Face_handle Face_handle; + + template < typename TDS2 > + struct Rebind_TDS { + typedef typename Base::template Rebind_TDS::Other Vb2; + typedef Reconstruction_vertex_base_2 Other; + }; + +private: + int m_id; + bool m_pinned; + Sample* m_sample; + Point m_relocated; + +public: + Reconstruction_vertex_base_2() + : Base() + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + } + + Reconstruction_vertex_base_2(const Point & p) + : Base(p) + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + } + + Reconstruction_vertex_base_2(Face_handle f) + : Base(f) + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + } + + Reconstruction_vertex_base_2(const Point & p, Face_handle f) + : Base(p, f) + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + } + + virtual ~Reconstruction_vertex_base_2() { } + + int id() const { return m_id; } + int& id() { return m_id; } + + bool pinned() const { return m_pinned; } + bool& pinned() { return m_pinned; } + + Sample* get_sample() const { return m_sample; } + void set_sample(Sample* sample) { m_sample = sample; } + + const Point& relocated() const { return m_relocated; } + Point& relocated() { return m_relocated; } +}; +//---------------STRUCT LESS VERTEX_HANDLE--------------------- +template +struct less_Vertex_handle +{ + bool operator() (const T& a, const T& b) const + { + return (a->id() < b->id()); + } +}; + +} //end namespace + +#endif /* RECONSTRUCTION_VERTEX_BASE_2_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Sample.h b/Reconstruction_simplification_2/include/CGAL/Sample.h new file mode 100644 index 00000000000..0a07321cc34 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Sample.h @@ -0,0 +1,122 @@ +#ifndef _SAMPLE_H +#define _SAMPLE_H + +template +class Sample +{ +public: + typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; + +private: + Point m_point; + FT m_mass; + + FT m_dist2_to_edge; + FT m_coordinate; + + FT m_backup_dist2; + FT m_backup_coord; + +public: + Sample(const Point& point, + const FT mass = 1.0) + { + m_mass = mass; + m_point = point; + + m_dist2_to_edge = 0.0; + m_coordinate = 0.0; + + m_backup_dist2 = 0.0; + m_backup_coord = 0.0; + } + + Sample(const Sample& sample) + { + m_mass = sample.mass(); + m_point = sample.point(); + + m_dist2_to_edge = 0.0; + m_coordinate = 0.0; + + m_backup_dist2 = 0.0; + m_backup_coord = 0.0; + } + + ~Sample() { } + + const Point& point() const { return m_point; } + Point& point() { return m_point; } + + const FT& mass() const { return m_mass; } + FT& mass() { return m_mass; } + + const FT& distance2() const { return m_dist2_to_edge; } + FT& distance2() { return m_dist2_to_edge; } + + const FT& coordinate() const { return m_coordinate; } + FT& coordinate() { return m_coordinate; } + + void backup() + { + m_backup_dist2 = m_dist2_to_edge; + m_backup_coord = m_coordinate; + } + + void restore() + { + m_dist2_to_edge = m_backup_dist2; + m_coordinate = m_backup_coord; + } +}; + +template +class Sample_with_priority +{ +public: + typedef typename Sample::FT FT; + +private: + Sample* m_sample; + FT m_priority; + +public: + Sample_with_priority(Sample* sample, const FT priority = 0.0) + { + m_sample = sample; + m_priority = priority; + } + + Sample_with_priority(const Sample_with_priority& psample) + { + m_sample = psample.sample(); + m_priority = psample.priority(); + } + + ~Sample_with_priority() { } + + Sample_with_priority& operator = (const Sample_with_priority& psample) + { + m_sample = psample.sample(); + m_priority = psample.priority(); + return *this; + } + + Sample* sample() const { return m_sample; } + + const FT priority() const { return m_priority; } +}; + + +//TODO: IV: What is the correct place for this struct? +template +struct greater_priority +{ + bool operator() (const T& a, const T& b) const + { + return ( a.priority() > b.priority() ); + } +}; + +#endif // SAMPLE_H diff --git a/Reconstruction_simplification_2/include/CGAL/console_color.h b/Reconstruction_simplification_2/include/CGAL/console_color.h new file mode 100644 index 00000000000..480a8af690d --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/console_color.h @@ -0,0 +1,65 @@ +#ifndef _CONSOLE_COLOR_H_ +#define _CONSOLE_COLOR_H_ + +#include + +#if defined(WIN32) +#include +#endif + +inline std::ostream& blue(std::ostream &s) +{ +#if defined(WIN32) + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); +#else + s << "\e[0;34m"; +#endif + return s; +} + +inline std::ostream& red(std::ostream &s) +{ +#if defined(WIN32) + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY); +#else + s << "\e[0;31m"; +#endif + return s; +} + +inline std::ostream& green(std::ostream &s) +{ +#if defined(WIN32) + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY); +#else + s << "\e[0;32m"; +#endif + return s; +} + +inline std::ostream& yellow(std::ostream &s) +{ +#if defined(WIN32) + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); +#else + s << "\e[0;33m"; +#endif + return s; +} + +inline std::ostream& white(std::ostream &s) +{ +#if defined(WIN32) + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); +#else + s << "\e[0;37m"; +#endif + return s; +} + +#endif diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt new file mode 100644 index 00000000000..0cef852c806 --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -0,0 +1,76 @@ +# CMake +# Fernando de Goes (fdegoes@caltech.edu) +# Copyright @ 2011 +project(GSoC_pwsrec2D) + +cmake_minimum_required(VERSION 2.4.5) +cmake_policy(VERSION 2.4.5) + +set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) + +############ +# Packages # +############ + +set( QT_USE_QTXML TRUE ) +set( QT_USE_QTMAIN TRUE ) +set( QT_USE_QTSCRIPT TRUE ) +set( QT_USE_QTOPENGL TRUE ) + +find_package(OpenGL) +find_package(Qt4) +find_package(CGAL COMPONENTS Qt4) + +######### +# Files # +######### + +#set( +#HDRS +#console_color.h +#Cost.h +#Dynamic_priority_queue.h +#Reconstruction_triangulation_2.h +#Reconstruction_edge_2.h +#Reconstruction_simplification_2.h +#Reconstruction_simplification_kerneled_2.h +#Reconstruction_vertex_base_2.h +#Reconstruction_face_base_2.h +#Sample.h + +#) + +set( +SRCS +test_basic.cpp +) + +######### +# Build # +######### + +# Includes +include_directories(../../include/CGAL) +include_directories(BEFORE . ./build) +include(${QT_USE_FILE}) +include_directories(${GLUT_INCLUDE_DIR}) +include_directories(${OPENGL_INCLUDE_DIR}) +include(${CGAL_USE_FILE}) + + +# The executable itself. +add_executable( ${PROJECT_NAME} ${SRCS} ${MOCS} ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + +# Link with Qt libraries +target_link_libraries( ${PROJECT_NAME} ${QT_LIBRARIES} ) + +# Link with Glut and OpenGL +target_link_libraries( ${PROJECT_NAME} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ) + +# Link with CImg dependencies +if( NOT WIN32 ) + target_link_libraries( ${PROJECT_NAME} -L/usr/X11R6/lib -lm -lpthread -lX11 ) +endif() + +# Link with CGAL +target_link_libraries( ${PROJECT_NAME} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy new file mode 100755 index 00000000000..3d6f2434d85 --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy @@ -0,0 +1,160 @@ +0.00605396 0.00360027 +0.0117095 0.00496933 +0.00292489 -0.0056444 +0.018654 -0.00345866 +0.0208731 -0.00712699 +0.0349622 0.00520127 +0.0226514 0.00273598 +0.0443469 0.00641652 +0.0320264 -0.00785089 +0.0536853 -0.00492172 +0.0477706 0.00445479 +0.0639807 0.00509629 +0.0673864 -0.000544755 +0.068878 0.00636891 +0.0786834 -0.00880306 +0.0838299 0.00977294 +0.087326 -0.0021897 +0.079062 0.000772423 +0.0984893 0.00905454 +0.0994487 -0.00770074 +0.100736 0.00717826 +0.0994229 0.00250389 +0.100252 0.0167278 +0.0960604 0.00802011 +0.103545 0.0289233 +0.108446 0.0183656 +0.106763 0.0262313 +0.106452 0.0420934 +0.0997256 0.0427598 +0.107064 0.0403298 +0.0928101 0.0560955 +0.10136 0.0583232 +0.104819 0.0562105 +0.0902899 0.0706163 +0.10994 0.0770702 +0.0923621 0.0704878 +0.0919434 0.0865538 +0.0963674 0.0842679 +0.103725 0.0803259 +0.102273 0.101166 +0.100319 0.0952791 +0.108403 0.0942299 +0.113529 0.0981625 +0.108027 0.103066 +0.126272 0.0950435 +0.133506 0.0939314 +0.124776 0.107205 +0.131076 0.107853 +0.136759 0.109119 +0.15444 0.102357 +0.143707 0.104111 +0.160272 0.0974776 +0.165379 0.103348 +0.173751 0.0916309 +0.174657 0.0937715 +0.167267 0.0980068 +0.170889 0.0905988 +0.185414 0.102092 +0.189813 0.10002 +0.199397 0.0909473 +0.198222 0.107717 +0.198974 0.099872 +0.201479 0.108827 +0.205074 0.107075 +0.202 0.124977 +0.191185 0.121976 +0.206848 0.134009 +0.196679 0.137767 +0.19255 0.148035 +0.190151 0.143856 +0.195263 0.155428 +0.20595 0.148822 +0.204421 0.152387 +0.191967 0.169495 +0.197981 0.169699 +0.191872 0.176798 +0.207398 0.170317 +0.194859 0.178978 +0.190444 0.183389 +0.196073 0.192833 +0.200019 0.190352 +0.205824 0.198579 +0.217043 0.198723 +0.210708 0.208976 +0.225591 0.209213 +0.224774 0.208331 +0.228376 0.201784 +0.233852 0.192014 +0.230703 0.196273 +0.241172 0.192107 +0.241027 0.203219 +0.257393 0.199803 +0.266244 0.190504 +0.263176 0.1902 +0.279822 0.191442 +0.267419 0.200092 +0.270919 0.209937 +0.294279 0.199399 +0.292596 0.208336 +0.302111 0.206854 +0.297261 0.193606 +0.302447 0.195568 +0.307461 0.217454 +0.302133 0.219113 +0.300152 0.216012 +0.296763 0.223723 +0.302571 0.234727 +0.298522 0.237272 +0.307834 0.234066 +0.296568 0.250613 +0.298385 0.251664 +0.29308 0.261943 +0.295426 0.266549 +0.293096 0.259791 +0.292439 0.271056 +0.291263 0.275271 +0.300944 0.286063 +0.308624 0.284206 +0.306603 0.285177 +0.302574 0.289769 +0.303807 0.303483 +0.308102 0.301263 +0.316854 0.306492 +0.313448 0.299638 +0.325862 0.304911 +0.328301 0.305416 +0.335535 0.300855 +0.327652 0.299601 +0.334895 0.301131 +0.339451 0.303238 +0.356128 0.293215 +0.359167 0.306227 +0.350648 0.309557 +0.359385 0.291005 +0.360515 0.305818 +0.377582 0.301763 +0.373333 0.308693 +0.375172 0.299768 +0.398744 0.298911 +0.390985 0.295462 +0.39465 0.305079 +0.397266 0.302934 +0.391293 0.303944 +0.401355 0.307406 +0.391301 0.312749 +0.401141 0.331346 +0.403843 0.339273 +0.397447 0.32984 +0.401007 0.345187 +0.401435 0.350856 +0.404534 0.358367 +0.40019 0.350997 +0.401021 0.359769 +0.398586 0.362409 +0.403735 0.370503 +0.400571 0.381428 +0.409145 0.374727 +0.402981 0.379619 +0.406312 0.38398 +0.405032 0.387826 diff --git a/Triangulation_2/examples/Triangulation_2/regular.cpp b/Triangulation_2/examples/Triangulation_2/regular.cpp index 27332c82da5..39b16ded169 100644 --- a/Triangulation_2/examples/Triangulation_2/regular.cpp +++ b/Triangulation_2/examples/Triangulation_2/regular.cpp @@ -1,4 +1,4 @@ -#include +/*#include #include #include #include @@ -29,3 +29,24 @@ int main() std::cout << rt.number_of_hidden_vertices() << std::endl; return 0; } + +*/ + + +#include +#include +#include +#include +//#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point_2; +int main() +{ + Point_2 points[5] = { Point_2(0,0), Point_2(10,0), Point_2(10,10), Point_2(6,5), Point_2(4,1) }; + Point_2 result[5]; + Point_2 *ptr = CGAL::convex_hull_2( points, points+5, result ); + std::cout << ptr - result << " points on the convex hull" << std::endl; + return 0; +} From 3d694e35c89431f449e025a702d9afa6dd35740f Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 20 Jun 2014 19:37:58 -0400 Subject: [PATCH 003/201] Initial implementation of the Reconstruction API includig a simple testcase example --- .../test_basic.cpp | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp new file mode 100644 index 00000000000..1e69099483b --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -0,0 +1,100 @@ +// test_basic.cpp + +//---------------------------------------------------------- +// Test the cgal environment for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include "Reconstruction_simplification_2.h" + +#include + +#include +#include +#include // std::pair + +#include +#include + +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; +typedef PointMassList::const_iterator InputIterator; +typedef CGAL::value_type_traits::type MassPoint; +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + + +PointMassList* load_xy_file(const QString& fileName); +PointMassList* simple_point_set(); + + +int main () +{ + + //use the stair example for testing + PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + + PointPMap point_pmap; + MassPMap mass_pmap; + + MassPoint mp; + + CGAL::Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.initialize(); + + rs2.reconstruct(100); //100 steps + + rs2.print_stats_debug(); + + rs2.extract_solid_eges(); +} + + + +PointMassList* simple_point_set() { + + PointMassList *points = new PointMassList(); + + points->push_back(std::make_pair(Point(0.1,0.1), 1)); + points->push_back(std::make_pair(Point(0.4,0.1), 1)); + points->push_back(std::make_pair(Point(0.6,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.4), 1)); + points->push_back(std::make_pair(Point(0.9,0.6), 1)); + points->push_back(std::make_pair(Point(0.9,0.9), 1)); + points->push_back(std::make_pair(Point(0.6,0.9), 1)); + points->push_back(std::make_pair(Point(0.4,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.6), 1)); + points->push_back(std::make_pair(Point(0.1,0.4), 1)); + + return points; + +} + + +PointMassList* load_xy_file(const QString& fileName) +{ + PointMassList *points = new PointMassList(); + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points->push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + + return points; + +} From e8bd0632efc6603592b84c5cdb40bed5c9582f92 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 23 Jun 2014 10:42:47 +0200 Subject: [PATCH 004/201] CGALize the code --- .../include/CGAL/Reconstruction_edge_2.h | 2 +- .../include/CGAL/Reconstruction_face_base_2.h | 4 +- .../CGAL/Reconstruction_simplification_2.h | 13 ++- .../CGAL/Reconstruction_triangulation_2.h | 12 +- .../CGAL/Reconstruction_vertex_base_2.h | 2 +- .../CMakeLists.txt | 103 +++++------------- .../test_basic.cpp | 11 +- 7 files changed, 51 insertions(+), 96 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index 92f117042ea..075e80653d8 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -20,7 +20,7 @@ #ifndef _RECONSTRUCTION_EDGE_2_H_ #define _RECONSTRUCTION_EDGE_2_H_ -#import "Dynamic_priority_queue.h" +#include //---------------CLASS CPEDGE--------------------- template diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index d56f41f1e3c..c4c86c4bde3 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -1,8 +1,8 @@ #ifndef RECONSTRUCTION_FACE_BASE_2_H_ #define RECONSTRUCTION_FACE_BASE_2_H_ -#include "Cost.h" -#include "Sample.h" +#include +#include #include #include diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index f74cb29204e..b1c4dcca35e 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -22,17 +22,18 @@ //#include -#include "Reconstruction_triangulation_2.h" -#include "Cost.h" -#include "Reconstruction_edge_2.h" -#include "Sample.h" -#include "console_color.h" +#include +#include +#include +#include +#include #include #include #include #include +#include #include @@ -205,7 +206,7 @@ public: //TODO: IV find nicer way to handle m_ignore - int nb_remove = std::min(m_ignore, int(queue.size())); + int nb_remove = (std::min)(m_ignore, int(queue.size())); for (int i = 0; i < nb_remove; ++i) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index d622dea5d97..30eb31f3372 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -33,12 +33,12 @@ // local -#include "Dynamic_priority_queue.h" -#include "Sample.h" -#include "Reconstruction_edge_2.h" -#include "Cost.h" -#include "Reconstruction_vertex_base_2.h" -#include "Reconstruction_face_base_2.h" +#include +#include +#include +#include +#include +#include #undef min diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 15f9b483427..30943fb5e60 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -9,7 +9,7 @@ #define RECONSTRUCTION_VERTEX_BASE_2_H_ #include -#include "sample.h" +#include /// The Reconstruction_vertex_base_2 class (corresponding to Reconstruction_vertex_base_2 in prototype) is the default /// vertex class of the Reconstruction_triangulation_2 class. diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 0cef852c806..99b60c29a62 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -1,76 +1,31 @@ -# CMake -# Fernando de Goes (fdegoes@caltech.edu) -# Copyright @ 2011 -project(GSoC_pwsrec2D) +project( Reconstruction_simplification_2_test ) -cmake_minimum_required(VERSION 2.4.5) -cmake_policy(VERSION 2.4.5) - -set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) - -############ -# Packages # -############ - -set( QT_USE_QTXML TRUE ) -set( QT_USE_QTMAIN TRUE ) -set( QT_USE_QTSCRIPT TRUE ) -set( QT_USE_QTOPENGL TRUE ) - -find_package(OpenGL) -find_package(Qt4) -find_package(CGAL COMPONENTS Qt4) - -######### -# Files # -######### - -#set( -#HDRS -#console_color.h -#Cost.h -#Dynamic_priority_queue.h -#Reconstruction_triangulation_2.h -#Reconstruction_edge_2.h -#Reconstruction_simplification_2.h -#Reconstruction_simplification_kerneled_2.h -#Reconstruction_vertex_base_2.h -#Reconstruction_face_base_2.h -#Sample.h - -#) - -set( -SRCS -test_basic.cpp -) - -######### -# Build # -######### - -# Includes -include_directories(../../include/CGAL) -include_directories(BEFORE . ./build) -include(${QT_USE_FILE}) -include_directories(${GLUT_INCLUDE_DIR}) -include_directories(${OPENGL_INCLUDE_DIR}) -include(${CGAL_USE_FILE}) - - -# The executable itself. -add_executable( ${PROJECT_NAME} ${SRCS} ${MOCS} ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) - -# Link with Qt libraries -target_link_libraries( ${PROJECT_NAME} ${QT_LIBRARIES} ) - -# Link with Glut and OpenGL -target_link_libraries( ${PROJECT_NAME} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ) - -# Link with CImg dependencies -if( NOT WIN32 ) - target_link_libraries( ${PROJECT_NAME} -L/usr/X11R6/lib -lm -lpthread -lX11 ) +cmake_minimum_required(VERSION 2.6.2) +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) + if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) + cmake_policy(VERSION 2.8.4) + else() + cmake_policy(VERSION 2.6) + endif() endif() - -# Link with CGAL -target_link_libraries( ${PROJECT_NAME} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) + +find_package(CGAL QUIET COMPONENTS Core ) + +if ( CGAL_FOUND ) + + include( ${CGAL_USE_FILE} ) + + include( CGAL_CreateSingleSourceCGALProgram ) + + include_directories (BEFORE "../../include") + + include_directories (BEFORE "include") + + create_single_source_cgal_program( "test_basic.cpp" ) + +else() + + message(STATUS "This program requires the CGAL library, and will not be compiled.") + +endif() + diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 1e69099483b..963e89b933c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -5,19 +5,18 @@ //---------------------------------------------------------- #include -#include "Reconstruction_simplification_2.h" +#include #include #include +#include #include #include // std::pair #include #include -#include - typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef K::FT FT; @@ -30,7 +29,7 @@ typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; -PointMassList* load_xy_file(const QString& fileName); +PointMassList* load_xy_file(const std::string& fileName); PointMassList* simple_point_set(); @@ -81,10 +80,10 @@ PointMassList* simple_point_set() { } -PointMassList* load_xy_file(const QString& fileName) +PointMassList* load_xy_file(const std::string& fileName) { PointMassList *points = new PointMassList(); - std::ifstream ifs(qPrintable(fileName)); + std::ifstream ifs(fileName); std::cerr << "read xy..."; Point point; unsigned int nb = 0; From 75bc7ac1486e7de56ae55550b6b90e9d9062155a Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 24 Jun 2014 14:31:51 -0400 Subject: [PATCH 005/201] Clean Code --- .../include/CGAL/Reconstruction_simplification_2.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index f74cb29204e..0ba8c76fa86 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -20,15 +20,12 @@ #ifndef RECONSTRUCTION_SIMPLIFICATION_2_H_ #define RECONSTRUCTION_SIMPLIFICATION_2_H_ -//#include - #include "Reconstruction_triangulation_2.h" #include "Cost.h" #include "Reconstruction_edge_2.h" #include "Sample.h" #include "console_color.h" -#include #include #include From 7b084c3cdaa3146268dde863cc5a693d99f1f40b Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 24 Jun 2014 14:45:06 -0400 Subject: [PATCH 006/201] Header Includes Cleaned --- .../include/CGAL/Cost.h | 4 +- .../include/CGAL/Dynamic_priority_queue.h | 4 +- .../include/CGAL/Reconstruction_edge_2.h | 4 +- .../include/CGAL/Reconstruction_face_base_2.h | 2 - .../CGAL/Reconstruction_simplification_2.h | 38 ++----------------- .../CGAL/Reconstruction_triangulation_2.h | 4 +- .../include/CGAL/Sample.h | 4 +- .../include/CGAL/console_color.h | 4 +- 8 files changed, 16 insertions(+), 48 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Cost.h b/Reconstruction_simplification_2/include/CGAL/Cost.h index 56c30a00543..de809467085 100644 --- a/Reconstruction_simplification_2/include/CGAL/Cost.h +++ b/Reconstruction_simplification_2/include/CGAL/Cost.h @@ -1,5 +1,5 @@ -#ifndef _COST_H_ -#define _COST_H_ +#ifndef COST_H_ +#define COST_H_ #undef min #undef max diff --git a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h index fbc6d23a53d..1a5a40d8da3 100644 --- a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h +++ b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h @@ -1,5 +1,5 @@ -#ifndef _DYNAMICS_PRIORITY_QUEUE_H_ -#define _DYNAMICS_PRIORITY_QUEUE_H_ 1 +#ifndef DYNAMICS_PRIORITY_QUEUE_H_ +#define DYNAMICS_PRIORITY_QUEUE_H_ /* * class DynamicPriorityQueue diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index 075e80653d8..e3de6355835 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -17,8 +17,8 @@ // // Author(s) : TODO: WHO? and Ivo Vigan -#ifndef _RECONSTRUCTION_EDGE_2_H_ -#define _RECONSTRUCTION_EDGE_2_H_ +#ifndef RECONSTRUCTION_EDGE_2_H_ +#define RECONSTRUCTION_EDGE_2_H_ #include diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index c4c86c4bde3..76e422d11dc 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -223,6 +223,4 @@ struct less_Edge } //end namespace - - #endif /* RECONSTRUCTION_FACE_BASE_2_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7eaa78235a9..ea5890c005b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -21,22 +21,19 @@ #define RECONSTRUCTION_SIMPLIFICATION_2_H_ -//#include - #include #include #include #include #include +#include #include #include #include #include -#include - namespace CGAL { @@ -90,11 +87,6 @@ public: typedef typename Triangulation::PQueue PQueue; - //------- - - - - //typedef Point_list_const_iterator InputIterator; protected: Triangulation m_dt; @@ -109,8 +101,6 @@ protected: double m_ghost; // ghost vs solid unsigned m_relocation; // # relocations - //TODO: IV NEW - // bbox double m_bbox_x; double m_bbox_y; @@ -124,16 +114,6 @@ protected: public: - //Constructor - //Reconstruction_simplicifaction_2(InputIterator start, InputIterator beyond, PropertyMap point_mass_map); - - /* Reconstruction_simplification_2(InputIterator start, InputIterator beyond) { - std::cout << "Reconstruction_simplification_2() " << std::flush; - for (InputIterator it = start; it != beyond; ++it) - std::cout << ' ' << *it; - std::cout << '\n'; - */ - Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, PointPMap in_point_pmap, @@ -170,11 +150,8 @@ public: clear(); insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); - - init(start, beyond); - //----THIS WAS BEFORE PROPERTY MAPS std::list m_samples; for (InputIterator it = start; it != beyond; it++) { Point point = get(point_pmap, *it); @@ -193,8 +170,6 @@ public: std::cout << "------------extracted_solid_eges----------------------" << std::endl; - - PQueue queue; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { @@ -204,7 +179,6 @@ public: queue.push(Reconstruction_edge_2(edge, value)); } - //TODO: IV find nicer way to handle m_ignore int nb_remove = (std::min)(m_ignore, int(queue.size())); @@ -218,13 +192,12 @@ public: { Reconstruction_edge_2 pedge = queue.top(); queue.pop(); - //--- - int i = (pedge.edge()).second; + + int i = (pedge.edge()).second; Face_handle face = (pedge.edge()).first; Point a = face->vertex((i+1)%3)->point(); Point b = face->vertex((i+2)%3)->point(); std::cout << "( " << a << " , " << b << " )" << std::endl; - //--- } std::cout << "---------------------------------------------------" << std::endl; @@ -273,9 +246,6 @@ public: if (scale == 0.0) scale = 1.0; } - - //-----------OLD CODE----------- - void clear() { m_dt.clear(); m_pqueue.clean(); @@ -285,8 +255,6 @@ public: return (clock() - init) / CLOCKS_PER_SEC; } - // PARAMETERS // - void set_mchoice(const int mchoice) { m_mchoice = mchoice; } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 30eb31f3372..c4941ba45b7 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -17,6 +17,9 @@ // // Author(s) : Fernando de Goes and Ivo Vigan +#ifndef RECONSTRUCTION_TRIANGULATION_2_H +#define RECONSTRUCTION_TRIANGULATION_2_H + // STL #include @@ -31,7 +34,6 @@ #include #include - // local #include #include diff --git a/Reconstruction_simplification_2/include/CGAL/Sample.h b/Reconstruction_simplification_2/include/CGAL/Sample.h index 0a07321cc34..d74f49cde88 100644 --- a/Reconstruction_simplification_2/include/CGAL/Sample.h +++ b/Reconstruction_simplification_2/include/CGAL/Sample.h @@ -1,5 +1,5 @@ -#ifndef _SAMPLE_H -#define _SAMPLE_H +#ifndef SAMPLE_H +#define SAMPLE_H template class Sample diff --git a/Reconstruction_simplification_2/include/CGAL/console_color.h b/Reconstruction_simplification_2/include/CGAL/console_color.h index 480a8af690d..12b7f2553fa 100644 --- a/Reconstruction_simplification_2/include/CGAL/console_color.h +++ b/Reconstruction_simplification_2/include/CGAL/console_color.h @@ -1,5 +1,5 @@ -#ifndef _CONSOLE_COLOR_H_ -#define _CONSOLE_COLOR_H_ +#ifndef CONSOLE_COLOR_H_ +#define CONSOLE_COLOR_H_ #include From 89cd5a8cda9263ae5a15acad9ce269753def16ce Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 24 Jun 2014 14:53:22 -0400 Subject: [PATCH 007/201] Header Includes Cleaned --- .../CGAL/Reconstruction_triangulation_2.h | 2009 ++++++++--------- 1 file changed, 980 insertions(+), 1029 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index c4941ba45b7..9b81436ce4a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -20,7 +20,6 @@ #ifndef RECONSTRUCTION_TRIANGULATION_2_H #define RECONSTRUCTION_TRIANGULATION_2_H - // STL #include #include @@ -42,7 +41,6 @@ #include #include - #undef min #undef max @@ -52,1040 +50,993 @@ namespace CGAL { -/// The Reconstruction_triangulation_2 class (corresponding to Triangulation in prototype) +/// The Reconstruction_triangulation_2 class +// (corresponding to Triangulation in prototype) /// provides the reconstruction simplex as well as the transportation plan. /// /// @param Kernel The underlying Kernel /// @param Tds Model of TriangulationDataStructure_2. /// The vertex class must derive from Reconstruction_vertex_base_2. /// The face class must derive from Reconstruction_face_base_2. -template , Reconstruction_face_base_2 > > -class Reconstruction_triangulation_2 : public Delaunay_triangulation_2 { +template, + Reconstruction_face_base_2 > > +class Reconstruction_triangulation_2: public Delaunay_triangulation_2 { public: - //TODO: IV rename Dt - typedef Reconstruction_triangulation_2 Rt_2; - - - - //typedef typename Reconstruction_triangulation_2::Geom_traits Kernel; - typedef typename Kernel::FT FT; - typedef typename Kernel::Point_2 Point; - typedef typename Kernel::Vector_2 Vector; - typedef typename Kernel::Ray_2 Ray; - typedef typename Kernel::Line_2 Line; - typedef typename Kernel::Segment_2 Segment; - typedef typename Kernel::Triangle_2 Triangle; - - typedef typename Rt_2::Vertex Vertex; - typedef typename Rt_2::Vertex_handle Vertex_handle; - typedef typename Rt_2::Vertex_iterator Vertex_iterator; - typedef typename Rt_2::Vertex_circulator Vertex_circulator; - typedef typename Rt_2::Finite_vertices_iterator Finite_vertices_iterator; - - typedef typename Rt_2::Edge Edge; - typedef typename Rt_2::Edge_iterator Edge_iterator; - typedef typename Rt_2::Edge_circulator Edge_circulator; - typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; - - typedef typename Rt_2::Face Face; - typedef typename Rt_2::Face_handle Face_handle; - typedef typename Rt_2::Face_iterator Face_iterator; - typedef typename Rt_2::Face_circulator Face_circulator; - typedef typename Rt_2::Finite_faces_iterator Finite_faces_iterator; - - typedef std::map< Vertex_handle, Vertex_handle, less_Vertex_handle > Vertex_handle_map; - typedef std::map< Face_handle, Face_handle, less_Face_handle > Face_handle_map; - - typedef std::set< Vertex_handle, less_Vertex_handle > Vertex_handle_set; - typedef std::set< Edge, less_Edge > Edge_set; - - typedef std::list Edge_list; - - typedef std::list Point_list; - typedef typename Point_list::const_iterator Point_list_const_iterator; - - typedef Cost Cost; - typedef Sample Sample; - typedef std::list Sample_list; - typedef typename Sample_list::const_iterator Sample_list_const_iterator; - - typedef Sample_with_priority PSample; - typedef std::priority_queue< PSample, std::vector, greater_priority > SQueue; - - typedef Reconstruction_edge_2 Reconstruction_edge_2; - typedef Dynamic_priority_queue_edges PQueue; - - double m_factor; // ghost vs solid - - public: - Reconstruction_triangulation_2() { - m_factor = 1.0; - } - - ~Reconstruction_triangulation_2() - {} - - double& ghost_factor() { return m_factor; } - - const double& ghost_factor() const { return m_factor; } - - Edge random_finite_edge() - { - int nbf = Rt_2::number_of_faces(); - int offset = random_int(0, nbf-1); - Finite_faces_iterator fi = Rt_2::finite_faces_begin(); - for (int i = 0; i < offset; i++) fi++; - Face_handle face = fi; - int index = random_int(0, 40) % 3; - return Edge(face, index); - } - - // ACCESS // - - Vertex_handle source_vertex(const Edge& edge) const - { - return edge.first->vertex( Rt_2::ccw(edge.second) ); - } - - Vertex_handle target_vertex(const Edge& edge) const - { - return edge.first->vertex( Rt_2::cw(edge.second) ); - } - - Vertex_handle opposite_vertex(const Edge& edge) const - { - return edge.first->vertex( edge.second ); - } - - bool is_pinned(const Edge& edge) const - { - Vertex_handle s = source_vertex(edge); - if (s->pinned()) return true; - return false; - } - - Edge twin_edge(const Edge& edge) const - { - Face_handle f = edge.first; - Vertex_handle v = source_vertex(edge); - Face_handle nf = f->neighbor(edge.second); - return Edge(nf, Rt_2::ccw(nf->index(v))); - } - - Edge next_edge(const Edge& edge) const - { - Face_handle f = edge.first; - int index = Rt_2::ccw(edge.second); - return Edge(f, index); - } - - Edge prev_edge(const Edge& edge) const - { - Face_handle f = edge.first; - int index = Rt_2::cw(edge.second); - return Edge(f, index); - } - - FT get_length(const Edge& edge) const - { - Segment segment = get_segment(edge); - return std::sqrt(segment.squared_length()); - } - - Segment get_segment(const Edge& edge) const - { - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - return Segment(ps, pt); - } - - Triangle get_triangle(Face_handle face) const - { - Vertex_handle v0 = face->vertex(0); - Vertex_handle v1 = face->vertex(1); - Vertex_handle v2 = face->vertex(2); - return Triangle(v0->point(), v1->point(), v2->point()); - } - - // GET LINK // - - void get_vertices_from_edge_link(const Edge& edge, - Vertex_handle_set& vertices) const - { - vertices.insert( opposite_vertex(edge) ); - vertices.insert( opposite_vertex(twin_edge(edge)) ); - } - - void get_vertices_from_vertex_link(Vertex_handle vertex, - Vertex_handle_set& vertices) const - { - Vertex_circulator vcirc = Rt_2::incident_vertices(vertex); - Vertex_circulator vend = vcirc; - CGAL_For_all(vcirc, vend) - { - Vertex_handle v = vcirc; - vertices.insert(v); - } - } - - // boundary of star(vertex) - // 'outward' chooses the orientation of the boundary - void get_edges_from_star_minus_link(Vertex_handle vertex, - Edge_list& hull, - bool outward = false) const - { - Face_circulator fcirc = Rt_2::incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - Edge edge(face, index); - if (outward) edge = twin_edge(edge); - hull.push_back(edge); - } - } - - // ATTRIBUTES // - - bool is_ghost(const Edge& edge) const - { - return edge.first->ghost(edge.second); - } - - int get_plan(const Edge& edge) const - { - return edge.first->plan(edge.second); - } - - void set_plan(const Edge& edge, int simplex) - { - edge.first->plan(edge.second) = simplex; - } - - FT get_mass(const Edge& edge) const - { - return edge.first->mass(edge.second); - } - - void set_mass(const Edge& edge, const FT mass) - { - edge.first->mass(edge.second) = mass; - } - - const Cost& get_cost(const Edge& edge) const - { - return edge.first->cost(edge.second); - } - - void set_vertex_cost(const Edge& edge, const Cost& cost) - { - edge.first->vertex_cost(edge.second) = cost; - } - - void set_edge_cost(const Edge& edge, const Cost& cost) - { - edge.first->edge_cost(edge.second) = cost; - } - - FT get_vertex_minus_edge_cost(const Edge& edge) const - { - const Cost& vcost = edge.first->vertex_cost(edge.second); - const Cost& ecost = edge.first->edge_cost(edge.second); - return vcost.finalize() - m_factor*ecost.finalize(); - } - - FT get_vertex_over_edge_cost(const Edge& edge) const - { - FT vvalue = edge.first->vertex_cost(edge.second).finalize(); - FT evalue = edge.first->edge_cost(edge.second).finalize(); - if (evalue == vvalue) return 1.0/m_factor; - return vvalue / (m_factor*evalue); - } - - FT get_edge_relevance(const Edge& edge) const - { - FT M = get_mass(edge); - if (M == 0.0) return 0.0; - - FT L = get_length(edge); - FT cost = get_cost(edge).finalize(); - return M*L*L / cost; - } - - FT get_density(const Edge& edge) const - { - FT length = get_length(edge); - FT mass = get_mass(edge); - return (mass / length); - } - - unsigned int nb_samples(const Edge& edge) const - { - Edge twin = twin_edge(edge); - return edge.first->samples(edge.second).size() + - twin.first->samples(twin.second).size(); - } - - void collect_samples_from_edge(const Edge& edge, Sample_list& samples) - { - const Sample_list& edge_samples = edge.first->samples(edge.second); - samples.insert(samples.end(), edge_samples.begin(), edge_samples.end()); - } - - void collect_samples_from_vertex(Vertex_handle vertex, - Sample_list& samples, - bool cleanup) - { - Face_circulator fcirc = Rt_2::incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - - Edge edge(face, index); - collect_samples_from_edge(edge, samples); - - Edge next = next_edge(edge); - collect_samples_from_edge(next, samples); - - Edge prev = prev_edge(edge); - collect_samples_from_edge(prev, samples); - - if (cleanup) face->clean_all_samples(); - } - Sample* sample = vertex->get_sample(); - if (sample) samples.push_back(sample); - if (cleanup) vertex->set_sample(NULL); - } - - void collect_all_samples(Sample_list& samples) - { - for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); ei != Rt_2::finite_edges_end(); ++ei) - { - Edge edge = *ei; - Edge twin = twin_edge(edge); - collect_samples_from_edge(edge, samples); - collect_samples_from_edge(twin, samples); - } - for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); vi != Rt_2::finite_vertices_end(); ++vi) - { - Vertex_handle v = vi; - Sample* sample = v->get_sample(); - if (sample) samples.push_back(sample); - } - } - - void cleanup_assignments() - { - for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); fi != Rt_2::finite_faces_end(); ++fi) - { - fi->clean_all_samples(); - } - for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); vi != Rt_2::finite_vertices_end(); ++vi) - { - vi->set_sample(NULL); - } - } - - // COST // - - Cost compute_total_cost() const - { - Cost sum; - for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); ei != Rt_2::finite_edges_end(); ++ei) - { - Edge edge = *ei; - const Cost& cost = get_cost(edge); - sum.update_max(cost); - sum.add(cost); - } - return sum; - } - - Cost compute_cost_around_vertex(Vertex_handle vertex) const - { - Cost inner; - Cost outer; - Face_circulator fcirc = Rt_2::incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - - Edge edge(face, index); - Cost cost = Rt_2::get_cost(edge); - outer.update_max(cost); - outer.add(cost); - - edge = Rt_2::next_edge(edge); - cost = Rt_2::get_cost(edge); - inner.update_max(cost); - inner.add(cost); - - edge = Rt_2::next_edge(edge); - cost = Rt_2::get_cost(edge); - inner.update_max(cost); - inner.add(cost); - } - inner.divide(2.0); - - Cost sum; - sum.add(inner); - sum.add(outer); - sum.update_max(inner); - sum.update_max(outer); - return sum; - } - - void reset_all_costs() - { - for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); ei != Rt_2::finite_edges_end(); ++ei) - { - Edge edge = *ei; - update_cost(edge); - } - } - - void update_cost(const Edge& edge) - { - compute_mass(edge); - compute_edge_cost(edge); - compute_vertex_cost(edge); - select_plan(edge); - } - - void compute_mass(const Edge& edge) - { - FT mass = 0.0; - - typename Sample_list::const_iterator it; - const Sample_list& samples0 = edge.first->samples(edge.second); - for (it = samples0.begin(); it != samples0.end(); ++it) - { - Sample* sample = *it; - mass += sample->mass(); - } - - Edge twin = twin_edge(edge); - const Sample_list& samples1 = twin.first->samples(twin.second); - for (it = samples1.begin(); it != samples1.end(); ++it) - { - Sample* sample = *it; - mass += sample->mass(); - } - - set_mass(edge, mass); - set_mass(twin, mass); - } - - void select_plan(const Edge& edge) - { - // transport plan: - // 0 - to vertex - // 1 - to edge - - int plan = 0; - FT diff = get_vertex_minus_edge_cost(edge); - if (diff >= 0.0) plan = 1; - - Edge twin = twin_edge(edge); - set_plan(edge, plan); - set_plan(twin, plan); - } - - void compute_edge_cost(const Edge& edge) - { - SQueue squeue; - FT M = get_mass(edge); - FT L = get_length(edge); - sort_samples_from_edge(edge, squeue); - Cost cost = compute_cost_from_squeue(squeue, M, L); - - Edge twin = twin_edge(edge); - set_edge_cost(edge, cost); - set_edge_cost(twin, cost); - } - - void sort_samples_from_edge(const Edge& edge, SQueue& squeue) - { - typename Sample_list::const_iterator it; - const Sample_list& samples0 = edge.first->samples(edge.second); - for (it = samples0.begin(); it != samples0.end(); ++it) - { - Sample* sample = *it; - squeue.push( PSample(sample, sample->coordinate()) ); - } - - Edge twin = twin_edge(edge); - const Sample_list& samples1 = twin.first->samples(twin.second); - for (it = samples1.begin(); it != samples1.end(); ++it) - { - Sample* sample = *it; - squeue.push( PSample(sample, 1.0 - sample->coordinate()) ); - } - } - - Cost compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) - { - if (squeue.empty()) return Cost(); - if (M == 0.0) return Cost(); - - Cost sum; - FT start = 0.0; - FT coef = L / M; - while (!squeue.empty()) - { - PSample psample = squeue.top(); - squeue.pop(); - - FT mass = psample.sample()->mass(); - FT coord = psample.priority() * L; - FT bin = mass * coef; - FT center = start + 0.5*bin; - FT pos = coord - center; - - FT norm2 = psample.sample()->distance2(); - FT tang2 = bin*bin/12 + pos*pos; - - sum.add(Cost(norm2, tang2), mass); - sum.compute_max(norm2, tang2); - - start += bin; - } - return sum; - } - - void compute_vertex_cost(const Edge& edge) - { - Edge twin = twin_edge(edge); - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - - Sample_list samples; - collect_samples_from_edge(edge, samples); - collect_samples_from_edge(twin, samples); - - Cost sum; - for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) - { - Sample* sample = *it; - FT mass = sample->mass(); - const Point& query = sample->point(); - - FT Ds = CGAL::squared_distance(query, ps); - FT Dt = CGAL::squared_distance(query, pt); - FT dist2 = std::min(Ds, Dt); - - FT norm2 = sample->distance2(); - FT tang2 = dist2 - norm2; - - sum.add(Cost(norm2, tang2), mass); - sum.compute_max(norm2, tang2); - } - set_vertex_cost(edge, sum); - set_vertex_cost(twin, sum); - } - - // SAMPLE // - - template // value_type = Sample* - void assign_samples(Iterator begin, Iterator end) - { - for (Iterator it = begin; it != end; ++it) - { - Sample* sample = *it; - assign_sample(sample); - } - } - - template // value_type = Sample* - void assign_samples_brute_force(Iterator begin, Iterator end) - { - for (Iterator it = begin; it != end; ++it) - { - Sample* sample = *it; - assign_sample_brute_force(sample); - } - } - - bool assign_sample(Sample* sample) - { - const Point& point = sample->point(); - Face_handle face = Rt_2::locate(point); - - if (face == Face_handle() || Rt_2::is_infinite(face)) - { - std::cout << "free bird" << std::endl; - return false; - } - - Vertex_handle vertex = find_nearest_vertex(point, face); - if (vertex != Vertex_handle()) - { - assign_sample_to_vertex(sample, vertex); - return true; - } - - Edge edge = find_nearest_edge(point, face); - assign_sample_to_edge(sample, edge); - return true; - } - - bool assign_sample_brute_force(Sample* sample) - { - const Point& point = sample->point(); - Face_handle nearest_face = Face_handle(); - for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); fi != Rt_2::finite_faces_end(); ++fi) - { - Face_handle face = fi; - if (face_has_point(face, point)) - { - nearest_face = face; - break; - } - } - - if (nearest_face == Face_handle()) - { - std::cout << "free bird" << std::endl; - return false; - } - - Vertex_handle vertex = find_nearest_vertex(point, nearest_face); - if (vertex != Vertex_handle()) - { - assign_sample_to_vertex(sample, vertex); - return true; - } - - Edge edge = find_nearest_edge(point, nearest_face); - assign_sample_to_edge(sample, edge); - return true; - } - - bool face_has_point(Face_handle face, const Point& query) const - { - for (int i = 0; i < 3; ++i) - { - Edge edge(face, i); - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - if (!compute_triangle_ccw(ps, pt, query)) return false; - } - return true; - } - - Vertex_handle find_nearest_vertex(const Point& point, Face_handle face) const - { - for (int i = 0; i < 3; ++i) - { - Vertex_handle vi = face->vertex(i); - const Point& pi = vi->point(); - if (pi == point) return vi; - } - return Vertex_handle(); - } - - Edge find_nearest_edge(const Point& point, Face_handle face) const - { - FT min_dist2 = MAXN; - Edge nearest(Face_handle(), 0); - for (int i = 0; i < 3; ++i) - { - Edge edge(face, i); - Segment segment = get_segment(edge); - FT dist2 = compute_distance2(point, segment); - if (dist2 < min_dist2) - { - min_dist2 = dist2; - nearest = edge; - } - } - - if (nearest.first == Face_handle()) - { - std::cout << "nearest edge not found" << std::endl; - } - return nearest; - } - - void assign_sample_to_vertex(Sample* sample, Vertex_handle vertex) - { - // DEBUG - if (vertex->get_sample()) - { - std::cout << "assign to vertex: vertex already has sample" << std::endl; - } - // - - sample->distance2() = 0.0; - sample->coordinate() = 0.0; - vertex->set_sample(sample); - } - - void assign_sample_to_edge(Sample* sample, const Edge& edge) - { - Segment segment = get_segment(edge); - const Point& query = sample->point(); - sample->distance2() = compute_distance2(query, segment); - sample->coordinate() = compute_coordinate(query, segment); - edge.first->add_sample(edge.second, sample); - } - - FT compute_distance2(const Point& query, const Segment& segment) const - { - Line line = segment.supporting_line(); - if (line.has_on(query)) return 0.0; - - Point proj = line.projection(query); - return CGAL::squared_distance(query, proj); - } - - FT compute_coordinate(const Point& q, const Segment& segment) const - { - const Point& p0 = segment.source(); - const Point& p1 = segment.target(); - Vector p0p1 = p1 - p0; - Vector p0q = q - p0; - FT t = (p0q * p0p1) / (p0p1 * p0p1); - return t; // [0,1] - } - - // SIGNED DISTANCE // - - // signed distance from line(a,b) to point t - FT signed_distance(Vertex_handle a, Vertex_handle b, Vertex_handle t) const - { - const Point& pa = a->point(); - const Point& pb = b->point(); - const Point& pt = t->point(); - return compute_signed_distance(pa, pb, pt); - } - - // signed distance from line(a,b) to point t - FT compute_signed_distance(const Point& pa, const Point& pb, const Point& pt) const - { - if (pt == pa) return 0.0; - if (pt == pb) return 0.0; - if (pa == pb) return std::sqrt(CGAL::squared_distance(pa, pt)); - - Vector vab = pb - pa; - vab = vab / sqrt(vab*vab); - Vector vab90(-vab.y(), vab.x()); - Vector vat = pt - pa; - return (vat * vab90); - } - - // signed distance from t to the intersection of line(a,b) and line(t,s) - FT signed_distance_from_intersection(Vertex_handle a, Vertex_handle b, - Vertex_handle t, Vertex_handle s) const - { - const Point& pa = a->point(); - const Point& pb = b->point(); - const Point& pt = t->point(); - const Point& ps = s->point(); - return compute_signed_distance_from_intersection(pa, pb, pt, ps); - } - - // signed distance from t to the intersection of line(a,b) and line(t,s) - FT compute_signed_distance_from_intersection(const Point& pa, const Point& pb, - const Point& pt, const Point& ps) const - { - FT Dabt = compute_signed_distance(pa, pb, pt); - if (Dabt == 0.0) return 0.0; - - Line lab(pa, pb-pa); - Line lts(pt, ps-pt); - - FT Dqt = MAXN; - CGAL::Object result = CGAL::intersection(lab, lts); - const Point* iq = CGAL::object_cast(&result); - if (iq) Dqt = std::sqrt(CGAL::squared_distance(*iq, pt)); - - if (Dabt < 0.0) Dqt = -Dqt; - return Dqt; - } - - bool is_triangle_ccw(Vertex_handle a, Vertex_handle b, Vertex_handle c) const - { - const Point& pa = a->point(); - const Point& pb = b->point(); - const Point& pc = c->point(); - return compute_triangle_ccw(pa, pb, pc); - } - - bool compute_triangle_ccw(const Point& pa, const Point& pb, const Point& pc) const - { - FT dist = compute_signed_distance(pa, pb, pc); - return (dist > -EPS); - } - - // COMBINATORIAL TESTS // - - // (a,b) is cyclic if (a,b,c) and (a,c,b) exist - bool is_edge_cyclic(const Edge& edge) const - { - Vertex_handle f = opposite_vertex(edge); - Vertex_handle b = opposite_vertex(twin_edge(edge)); - return (f == b); - } - - // b from (a,b) is cyclic if (a,b,c) and (b,a,c) exist - bool is_target_cyclic(const Edge& edge) const - { - if (!is_edge_cyclic(edge)) return false; - - Edge twin = twin_edge(edge); - Edge prev = prev_edge(twin); - Face_handle fp = prev.first->neighbor(prev.second); - Face_handle ft = twin.first->neighbor(twin.second); - return (fp == ft); - } - - bool is_flippable(const Edge& edge) const - { - Edge twin = twin_edge(edge); - if (Rt_2::is_infinite(twin.first)) return false; - if (Rt_2::is_infinite(edge.first)) return false; - - Vertex_handle vs = source_vertex(edge); - Vertex_handle vt = target_vertex(edge); - Vertex_handle vf = opposite_vertex(edge); - Vertex_handle vb = opposite_vertex(twin); - - if (!is_triangle_ccw(vs, vb, vf)) return false; - if (!is_triangle_ccw(vt, vf, vb)) return false; - return true; - } - - bool is_collapsible(const Edge& edge) const - { - if (!check_link_test(edge)) return false; - if (!check_kernel_test(edge)) return false; - return true; - } - - bool check_link_test(const Edge& edge) const - { - Vertex_handle s = source_vertex(edge); - Vertex_handle t = target_vertex(edge); - - if (s == t) return false; - typename Vertex_handle_set::const_iterator it; - - Vertex_handle_set svertices; - get_vertices_from_vertex_link(s, svertices); - - Vertex_handle_set tvertices; - get_vertices_from_vertex_link(t, tvertices); - - // link(s) inter link(t) - Vertex_handle_set ivertices; - for (it = svertices.begin(); it != svertices.end(); ++it) - { - Vertex_handle v = *it; - if (tvertices.find(v) != tvertices.end()) - ivertices.insert(v); - } - - Vertex_handle_set evertices; - get_vertices_from_edge_link(edge, evertices); - - // link(edge) =? link(s) inter link(t) - if (evertices.size() != ivertices.size()) return false; - - for (it = evertices.begin(); it != evertices.end(); ++it) - { - Vertex_handle v = *it; - if (ivertices.find(v) == ivertices.end()) - return false; - } - return true; - } - - bool check_kernel_test(const Edge& edge) const - { - Vertex_handle s = source_vertex(edge); - Vertex_handle t = target_vertex(edge); - - Edge_list hull; - get_edges_from_star_minus_link(s, hull); - return is_in_kernel(t->point(), hull.begin(), hull.end()); - } - - template // value_type = Edge - bool is_in_kernel(const Point& query, Iterator begin, Iterator end) const - { - for (Iterator it = begin; it != end; ++it) - { - Edge edge = *it; - const Point& pa = source_vertex(edge)->point(); - const Point& pb = target_vertex(edge)->point(); - if (!compute_triangle_ccw(pa, pb, query)) return false; - } - return true; - } - - // COLLAPSE // - - // (s,a,b) + (s,b,c) -> (s,a,c) + (a,b,c) - // st = (source,target) from 'make_collapsible' - // return (a,c) - Edge flip(const Edge& sb, Edge& st, int verbose = 0) - { - Vertex_handle t = target_vertex(st); - - Edge sc = twin_edge(prev_edge(sb)); - Rt_2::tds().flip(sb.first, sb.second); - Edge ac = prev_edge(twin_edge(sc)); - - Vertex_handle a = source_vertex(ac); - if (a == t) st = prev_edge(ac); - - return ac; - } - - void collapse(const Edge& edge, int verbose = 0) - { - if (is_edge_cyclic(edge)) - { - collapse_cyclic_edge(edge); - return; - } - - Edge twin = twin_edge(edge); - Rt_2::tds().join_vertices(twin); - } - - // (a,b,c) + (c,b,a) + (a,c,i) + (c,a,j) -> - // (a,c,i) + (c,a,j) - void collapse_cyclic_edge(const Edge& bc, int verbose = 1) - { - if (verbose > 0) - std::cout << "collapse_cyclic_edge ... "; - - Edge cb = twin_edge(bc); - Face_handle abc = bc.first; - Face_handle cba = cb.first; - - Vertex_handle b = source_vertex(bc); - Vertex_handle c = target_vertex(bc); - Vertex_handle a = opposite_vertex(bc); - - Edge ac = twin_edge(next_edge(bc)); - Edge ca = twin_edge(prev_edge(cb)); - - a->set_face(ac.first); - c->set_face(ca.first); - ac.first->set_neighbor(ac.second, ca.first); - ca.first->set_neighbor(ca.second, ac.first); - - //TODO: IV UNCOMMEN THIS - this->delete_face(abc); - this->delete_face(cba); - this->delete_vertex(b); - - if (verbose > 0) - std::cout << "done" << std::endl; - } - - template // value_type = Edge - bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) - { - Vertex_handle source = source_vertex(edge); - Vertex_handle target = target_vertex(edge); - - PQueue pqueue; - for (Iterator it = begin; it != end; ++it) - { - Edge ab = twin_edge(*it); - Vertex_handle a = source_vertex(ab); - Vertex_handle b = target_vertex(ab); - FT D = signed_distance_from_intersection(a, b, target, source); - if (D < 0.0) pqueue.push(Reconstruction_edge_2(ab, D)); - } - - int nb_flips = 0; - while (!pqueue.empty()) - { - Reconstruction_edge_2 pedge = pqueue.top(); - FT Dbc = pedge.priority(); - Edge bc = pedge.edge(); - pqueue.pop(); - - Edge sb = prev_edge(bc); - Edge ab = prev_edge(twin_edge(sb)); - Edge sc = twin_edge(next_edge(bc)); - Edge cd = next_edge(sc); - - Vertex_handle a = source_vertex(ab); - Vertex_handle b = source_vertex(bc); - Vertex_handle c = target_vertex(bc); - Vertex_handle d = target_vertex(cd); - - FT Dac = MINN; - if (a != c && is_triangle_ccw(a, b, c)) - Dac = signed_distance_from_intersection(a, c, target, source); - - FT Dbd = MINN; - if (b != d && is_triangle_ccw(b, c, d)) - Dbd = signed_distance_from_intersection(b, d, target, source); - - if (Dac == MINN && Dbd == MINN) - { - // TODO: IV comment in std::cerr << red << "--- No flips available ---" << white << std::endl; - std::cerr << "--- No flips available ---" << std::endl; - return false; - } - - if (std::max(Dac, Dbd) + EPS < Dbc) - { - std::cerr.precision(10); - // TODO: IV comment in std::cerr << red << "--- Flip makes kernel worse ---" << white << std::endl; - std::cerr << "--- Flip makes kernel worse ---" << std::endl; - std::cerr << Dac << " or " << Dbd << " vs " << Dbc << std::endl; - std::cerr << "a: " << a->point() << std::endl; - std::cerr << "b: " << b->point() << std::endl; - std::cerr << "c: " << c->point() << std::endl; - std::cerr << "d: " << d->point() << std::endl; - std::cerr << "t: " << target->point() << std::endl; - std::cerr << "diff = " << Dbc - std::max(Dac, Dbd) << std::endl; - return false; - } - - if (Dac > Dbd) - { - pqueue.remove(Reconstruction_edge_2(ab)); - Edge ac = flip(sb, edge, verbose); - if (Dac < 0.0) pqueue.push(Reconstruction_edge_2(ac, Dac)); - } - else - { - pqueue.remove(Reconstruction_edge_2(cd)); - Edge bd = flip(sc, edge, verbose); - if (Dbd < 0.0) pqueue.push(Reconstruction_edge_2(bd, Dbd)); - } - nb_flips++; - } - - if (verbose > 1) - //TODO: IV Comment in std::cerr << red << "--- Flip makes kernel worse ---" << white << std::endl; - std::cerr << "Nb flips: " << nb_flips << std::endl; - - return true; - } - - int random_int(const int min, const int max) - { - int range = max - min; - return min + int((double(rand())/double(RAND_MAX)) * range); - } - - }; + //TODO: IV rename Dt + typedef Reconstruction_triangulation_2 Rt_2; + + //typedef typename Reconstruction_triangulation_2::Geom_traits Kernel; + typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; + typedef typename Kernel::Vector_2 Vector; + typedef typename Kernel::Ray_2 Ray; + typedef typename Kernel::Line_2 Line; + typedef typename Kernel::Segment_2 Segment; + typedef typename Kernel::Triangle_2 Triangle; + + typedef typename Rt_2::Vertex Vertex; + typedef typename Rt_2::Vertex_handle Vertex_handle; + typedef typename Rt_2::Vertex_iterator Vertex_iterator; + typedef typename Rt_2::Vertex_circulator Vertex_circulator; + typedef typename Rt_2::Finite_vertices_iterator Finite_vertices_iterator; + + typedef typename Rt_2::Edge Edge; + typedef typename Rt_2::Edge_iterator Edge_iterator; + typedef typename Rt_2::Edge_circulator Edge_circulator; + typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; + + typedef typename Rt_2::Face Face; + typedef typename Rt_2::Face_handle Face_handle; + typedef typename Rt_2::Face_iterator Face_iterator; + typedef typename Rt_2::Face_circulator Face_circulator; + typedef typename Rt_2::Finite_faces_iterator Finite_faces_iterator; + + typedef std::map > Vertex_handle_map; + typedef std::map > Face_handle_map; + + typedef std::set > Vertex_handle_set; + typedef std::set > Edge_set; + + typedef std::list Edge_list; + + typedef std::list Point_list; + typedef typename Point_list::const_iterator Point_list_const_iterator; + + typedef Cost Cost; + typedef Sample Sample; + typedef std::list Sample_list; + typedef typename Sample_list::const_iterator Sample_list_const_iterator; + + typedef Sample_with_priority PSample; + typedef std::priority_queue, + greater_priority > SQueue; + + typedef Reconstruction_edge_2 Reconstruction_edge_2; + typedef Dynamic_priority_queue_edges PQueue; + + double m_factor; // ghost vs solid + +public: + Reconstruction_triangulation_2() { + m_factor = 1.0; + } + + ~Reconstruction_triangulation_2() { + } + + double& ghost_factor() { + return m_factor; + } + + const double& ghost_factor() const { + return m_factor; + } + + Edge random_finite_edge() { + int nbf = Rt_2::number_of_faces(); + int offset = random_int(0, nbf - 1); + Finite_faces_iterator fi = Rt_2::finite_faces_begin(); + for (int i = 0; i < offset; i++) + fi++; + Face_handle face = fi; + int index = random_int(0, 40) % 3; + return Edge(face, index); + } + + // ACCESS // + + Vertex_handle source_vertex(const Edge& edge) const { + return edge.first->vertex(Rt_2::ccw(edge.second)); + } + + Vertex_handle target_vertex(const Edge& edge) const { + return edge.first->vertex(Rt_2::cw(edge.second)); + } + + Vertex_handle opposite_vertex(const Edge& edge) const { + return edge.first->vertex(edge.second); + } + + bool is_pinned(const Edge& edge) const { + Vertex_handle s = source_vertex(edge); + if (s->pinned()) + return true; + return false; + } + + Edge twin_edge(const Edge& edge) const { + Face_handle f = edge.first; + Vertex_handle v = source_vertex(edge); + Face_handle nf = f->neighbor(edge.second); + return Edge(nf, Rt_2::ccw(nf->index(v))); + } + + Edge next_edge(const Edge& edge) const { + Face_handle f = edge.first; + int index = Rt_2::ccw(edge.second); + return Edge(f, index); + } + + Edge prev_edge(const Edge& edge) const { + Face_handle f = edge.first; + int index = Rt_2::cw(edge.second); + return Edge(f, index); + } + + FT get_length(const Edge& edge) const { + Segment segment = get_segment(edge); + return std::sqrt(segment.squared_length()); + } + + Segment get_segment(const Edge& edge) const { + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + return Segment(ps, pt); + } + + Triangle get_triangle(Face_handle face) const { + Vertex_handle v0 = face->vertex(0); + Vertex_handle v1 = face->vertex(1); + Vertex_handle v2 = face->vertex(2); + return Triangle(v0->point(), v1->point(), v2->point()); + } + + // GET LINK // + + void get_vertices_from_edge_link(const Edge& edge, + Vertex_handle_set& vertices) const { + vertices.insert(opposite_vertex(edge)); + vertices.insert(opposite_vertex(twin_edge(edge))); + } + + void get_vertices_from_vertex_link(Vertex_handle vertex, + Vertex_handle_set& vertices) const { + Vertex_circulator vcirc = Rt_2::incident_vertices(vertex); + Vertex_circulator vend = vcirc; + CGAL_For_all(vcirc, vend) + { + Vertex_handle v = vcirc; + vertices.insert(v); + } + } + + // boundary of star(vertex) + // 'outward' chooses the orientation of the boundary + void get_edges_from_star_minus_link(Vertex_handle vertex, Edge_list& hull, + bool outward = false) const { + Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + Edge edge(face, index); + if (outward) + edge = twin_edge(edge); + hull.push_back(edge); + } + } + + // ATTRIBUTES // + + bool is_ghost(const Edge& edge) const { + return edge.first->ghost(edge.second); + } + + int get_plan(const Edge& edge) const { + return edge.first->plan(edge.second); + } + + void set_plan(const Edge& edge, int simplex) { + edge.first->plan(edge.second) = simplex; + } + + FT get_mass(const Edge& edge) const { + return edge.first->mass(edge.second); + } + + void set_mass(const Edge& edge, const FT mass) { + edge.first->mass(edge.second) = mass; + } + + const Cost& get_cost(const Edge& edge) const { + return edge.first->cost(edge.second); + } + + void set_vertex_cost(const Edge& edge, const Cost& cost) { + edge.first->vertex_cost(edge.second) = cost; + } + + void set_edge_cost(const Edge& edge, const Cost& cost) { + edge.first->edge_cost(edge.second) = cost; + } + + FT get_vertex_minus_edge_cost(const Edge& edge) const { + const Cost& vcost = edge.first->vertex_cost(edge.second); + const Cost& ecost = edge.first->edge_cost(edge.second); + return vcost.finalize() - m_factor * ecost.finalize(); + } + + FT get_vertex_over_edge_cost(const Edge& edge) const { + FT vvalue = edge.first->vertex_cost(edge.second).finalize(); + FT evalue = edge.first->edge_cost(edge.second).finalize(); + if (evalue == vvalue) + return 1.0 / m_factor; + return vvalue / (m_factor * evalue); + } + + FT get_edge_relevance(const Edge& edge) const { + FT M = get_mass(edge); + if (M == 0.0) + return 0.0; + + FT L = get_length(edge); + FT cost = get_cost(edge).finalize(); + return M * L * L / cost; + } + + FT get_density(const Edge& edge) const { + FT length = get_length(edge); + FT mass = get_mass(edge); + return (mass / length); + } + + unsigned int nb_samples(const Edge& edge) const { + Edge twin = twin_edge(edge); + return edge.first->samples(edge.second).size() + + twin.first->samples(twin.second).size(); + } + + void collect_samples_from_edge(const Edge& edge, Sample_list& samples) { + const Sample_list& edge_samples = edge.first->samples(edge.second); + samples.insert(samples.end(), edge_samples.begin(), edge_samples.end()); + } + + void collect_samples_from_vertex(Vertex_handle vertex, Sample_list& samples, + bool cleanup) { + Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + + Edge edge(face, index); + collect_samples_from_edge(edge, samples); + + Edge next = next_edge(edge); + collect_samples_from_edge(next, samples); + + Edge prev = prev_edge(edge); + collect_samples_from_edge(prev, samples); + + if (cleanup) + face->clean_all_samples(); + } + Sample* sample = vertex->get_sample(); + if (sample) + samples.push_back(sample); + if (cleanup) + vertex->set_sample(NULL); + } + + void collect_all_samples(Sample_list& samples) { + for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); + ei != Rt_2::finite_edges_end(); ++ei) { + Edge edge = *ei; + Edge twin = twin_edge(edge); + collect_samples_from_edge(edge, samples); + collect_samples_from_edge(twin, samples); + } + for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); + vi != Rt_2::finite_vertices_end(); ++vi) { + Vertex_handle v = vi; + Sample* sample = v->get_sample(); + if (sample) + samples.push_back(sample); + } + } + + void cleanup_assignments() { + for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); + fi != Rt_2::finite_faces_end(); ++fi) { + fi->clean_all_samples(); + } + for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); + vi != Rt_2::finite_vertices_end(); ++vi) { + vi->set_sample(NULL); + } + } + + // COST // + + Cost compute_total_cost() const { + Cost sum; + for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); + ei != Rt_2::finite_edges_end(); ++ei) { + Edge edge = *ei; + const Cost& cost = get_cost(edge); + sum.update_max(cost); + sum.add(cost); + } + return sum; + } + + Cost compute_cost_around_vertex(Vertex_handle vertex) const { + Cost inner; + Cost outer; + Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + + Edge edge(face, index); + Cost cost = Rt_2::get_cost(edge); + outer.update_max(cost); + outer.add(cost); + + edge = Rt_2::next_edge(edge); + cost = Rt_2::get_cost(edge); + inner.update_max(cost); + inner.add(cost); + + edge = Rt_2::next_edge(edge); + cost = Rt_2::get_cost(edge); + inner.update_max(cost); + inner.add(cost); + } + inner.divide(2.0); + + Cost sum; + sum.add(inner); + sum.add(outer); + sum.update_max(inner); + sum.update_max(outer); + return sum; + } + + void reset_all_costs() { + for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); + ei != Rt_2::finite_edges_end(); ++ei) { + Edge edge = *ei; + update_cost(edge); + } + } + + void update_cost(const Edge& edge) { + compute_mass(edge); + compute_edge_cost(edge); + compute_vertex_cost(edge); + select_plan(edge); + } + + void compute_mass(const Edge& edge) { + FT mass = 0.0; + + typename Sample_list::const_iterator it; + const Sample_list& samples0 = edge.first->samples(edge.second); + for (it = samples0.begin(); it != samples0.end(); ++it) { + Sample* sample = *it; + mass += sample->mass(); + } + + Edge twin = twin_edge(edge); + const Sample_list& samples1 = twin.first->samples(twin.second); + for (it = samples1.begin(); it != samples1.end(); ++it) { + Sample* sample = *it; + mass += sample->mass(); + } + + set_mass(edge, mass); + set_mass(twin, mass); + } + + void select_plan(const Edge& edge) { + // transport plan: + // 0 - to vertex + // 1 - to edge + + int plan = 0; + FT diff = get_vertex_minus_edge_cost(edge); + if (diff >= 0.0) + plan = 1; + + Edge twin = twin_edge(edge); + set_plan(edge, plan); + set_plan(twin, plan); + } + + void compute_edge_cost(const Edge& edge) { + SQueue squeue; + FT M = get_mass(edge); + FT L = get_length(edge); + sort_samples_from_edge(edge, squeue); + Cost cost = compute_cost_from_squeue(squeue, M, L); + + Edge twin = twin_edge(edge); + set_edge_cost(edge, cost); + set_edge_cost(twin, cost); + } + + void sort_samples_from_edge(const Edge& edge, SQueue& squeue) { + typename Sample_list::const_iterator it; + const Sample_list& samples0 = edge.first->samples(edge.second); + for (it = samples0.begin(); it != samples0.end(); ++it) { + Sample* sample = *it; + squeue.push(PSample(sample, sample->coordinate())); + } + + Edge twin = twin_edge(edge); + const Sample_list& samples1 = twin.first->samples(twin.second); + for (it = samples1.begin(); it != samples1.end(); ++it) { + Sample* sample = *it; + squeue.push(PSample(sample, 1.0 - sample->coordinate())); + } + } + + Cost compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) { + if (squeue.empty()) + return Cost(); + if (M == 0.0) + return Cost(); + + Cost sum; + FT start = 0.0; + FT coef = L / M; + while (!squeue.empty()) { + PSample psample = squeue.top(); + squeue.pop(); + + FT mass = psample.sample()->mass(); + FT coord = psample.priority() * L; + FT bin = mass * coef; + FT center = start + 0.5 * bin; + FT pos = coord - center; + + FT norm2 = psample.sample()->distance2(); + FT tang2 = bin * bin / 12 + pos * pos; + + sum.add(Cost(norm2, tang2), mass); + sum.compute_max(norm2, tang2); + + start += bin; + } + return sum; + } + + void compute_vertex_cost(const Edge& edge) { + Edge twin = twin_edge(edge); + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + + Sample_list samples; + collect_samples_from_edge(edge, samples); + collect_samples_from_edge(twin, samples); + + Cost sum; + for (Sample_list_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample* sample = *it; + FT mass = sample->mass(); + const Point& query = sample->point(); + + FT Ds = CGAL::squared_distance(query, ps); + FT Dt = CGAL::squared_distance(query, pt); + FT dist2 = std::min(Ds, Dt); + + FT norm2 = sample->distance2(); + FT tang2 = dist2 - norm2; + + sum.add(Cost(norm2, tang2), mass); + sum.compute_max(norm2, tang2); + } + set_vertex_cost(edge, sum); + set_vertex_cost(twin, sum); + } + + // SAMPLE // + + template // value_type = Sample* + void assign_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample* sample = *it; + assign_sample(sample); + } + } + + template // value_type = Sample* + void assign_samples_brute_force(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample* sample = *it; + assign_sample_brute_force(sample); + } + } + + bool assign_sample(Sample* sample) { + const Point& point = sample->point(); + Face_handle face = Rt_2::locate(point); + + if (face == Face_handle() || Rt_2::is_infinite(face)) { + std::cout << "free bird" << std::endl; + return false; + } + + Vertex_handle vertex = find_nearest_vertex(point, face); + if (vertex != Vertex_handle()) { + assign_sample_to_vertex(sample, vertex); + return true; + } + + Edge edge = find_nearest_edge(point, face); + assign_sample_to_edge(sample, edge); + return true; + } + + bool assign_sample_brute_force(Sample* sample) { + const Point& point = sample->point(); + Face_handle nearest_face = Face_handle(); + for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); + fi != Rt_2::finite_faces_end(); ++fi) { + Face_handle face = fi; + if (face_has_point(face, point)) { + nearest_face = face; + break; + } + } + + if (nearest_face == Face_handle()) { + std::cout << "free bird" << std::endl; + return false; + } + + Vertex_handle vertex = find_nearest_vertex(point, nearest_face); + if (vertex != Vertex_handle()) { + assign_sample_to_vertex(sample, vertex); + return true; + } + + Edge edge = find_nearest_edge(point, nearest_face); + assign_sample_to_edge(sample, edge); + return true; + } + + bool face_has_point(Face_handle face, const Point& query) const { + for (int i = 0; i < 3; ++i) { + Edge edge(face, i); + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + if (!compute_triangle_ccw(ps, pt, query)) + return false; + } + return true; + } + + Vertex_handle find_nearest_vertex(const Point& point, + Face_handle face) const { + for (int i = 0; i < 3; ++i) { + Vertex_handle vi = face->vertex(i); + const Point& pi = vi->point(); + if (pi == point) + return vi; + } + return Vertex_handle(); + } + + Edge find_nearest_edge(const Point& point, Face_handle face) const { + FT min_dist2 = MAXN; + Edge nearest(Face_handle(), 0); + for (int i = 0; i < 3; ++i) { + Edge edge(face, i); + Segment segment = get_segment(edge); + FT dist2 = compute_distance2(point, segment); + if (dist2 < min_dist2) { + min_dist2 = dist2; + nearest = edge; + } + } + + if (nearest.first == Face_handle()) { + std::cout << "nearest edge not found" << std::endl; + } + return nearest; + } + + void assign_sample_to_vertex(Sample* sample, Vertex_handle vertex) { + // DEBUG + if (vertex->get_sample()) { + std::cout << "assign to vertex: vertex already has sample" + << std::endl; + } + // + + sample->distance2() = 0.0; + sample->coordinate() = 0.0; + vertex->set_sample(sample); + } + + void assign_sample_to_edge(Sample* sample, const Edge& edge) { + Segment segment = get_segment(edge); + const Point& query = sample->point(); + sample->distance2() = compute_distance2(query, segment); + sample->coordinate() = compute_coordinate(query, segment); + edge.first->add_sample(edge.second, sample); + } + + FT compute_distance2(const Point& query, const Segment& segment) const { + Line line = segment.supporting_line(); + if (line.has_on(query)) + return 0.0; + + Point proj = line.projection(query); + return CGAL::squared_distance(query, proj); + } + + FT compute_coordinate(const Point& q, const Segment& segment) const { + const Point& p0 = segment.source(); + const Point& p1 = segment.target(); + Vector p0p1 = p1 - p0; + Vector p0q = q - p0; + FT t = (p0q * p0p1) / (p0p1 * p0p1); + return t; // [0,1] + } + + // SIGNED DISTANCE // + + // signed distance from line(a,b) to point t + FT signed_distance(Vertex_handle a, Vertex_handle b, + Vertex_handle t) const { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pt = t->point(); + return compute_signed_distance(pa, pb, pt); + } + + // signed distance from line(a,b) to point t + FT compute_signed_distance(const Point& pa, const Point& pb, + const Point& pt) const { + if (pt == pa) + return 0.0; + if (pt == pb) + return 0.0; + if (pa == pb) + return std::sqrt(CGAL::squared_distance(pa, pt)); + + Vector vab = pb - pa; + vab = vab / sqrt(vab * vab); + Vector vab90(-vab.y(), vab.x()); + Vector vat = pt - pa; + return (vat * vab90); + } + + // signed distance from t to the intersection of line(a,b) and line(t,s) + FT signed_distance_from_intersection(Vertex_handle a, Vertex_handle b, + Vertex_handle t, Vertex_handle s) const { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pt = t->point(); + const Point& ps = s->point(); + return compute_signed_distance_from_intersection(pa, pb, pt, ps); + } + + // signed distance from t to the intersection of line(a,b) and line(t,s) + FT compute_signed_distance_from_intersection(const Point& pa, + const Point& pb, const Point& pt, const Point& ps) const { + FT Dabt = compute_signed_distance(pa, pb, pt); + if (Dabt == 0.0) + return 0.0; + + Line lab(pa, pb - pa); + Line lts(pt, ps - pt); + + FT Dqt = MAXN; + CGAL::Object result = CGAL::intersection(lab, lts); + const Point* iq = CGAL::object_cast(&result); + if (iq) + Dqt = std::sqrt(CGAL::squared_distance(*iq, pt)); + + if (Dabt < 0.0) + Dqt = -Dqt; + return Dqt; + } + + bool is_triangle_ccw(Vertex_handle a, Vertex_handle b, + Vertex_handle c) const { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pc = c->point(); + return compute_triangle_ccw(pa, pb, pc); + } + + bool compute_triangle_ccw(const Point& pa, const Point& pb, + const Point& pc) const { + FT dist = compute_signed_distance(pa, pb, pc); + return (dist > -EPS); + } + + // COMBINATORIAL TESTS // + + // (a,b) is cyclic if (a,b,c) and (a,c,b) exist + bool is_edge_cyclic(const Edge& edge) const { + Vertex_handle f = opposite_vertex(edge); + Vertex_handle b = opposite_vertex(twin_edge(edge)); + return (f == b); + } + + // b from (a,b) is cyclic if (a,b,c) and (b,a,c) exist + bool is_target_cyclic(const Edge& edge) const { + if (!is_edge_cyclic(edge)) + return false; + + Edge twin = twin_edge(edge); + Edge prev = prev_edge(twin); + Face_handle fp = prev.first->neighbor(prev.second); + Face_handle ft = twin.first->neighbor(twin.second); + return (fp == ft); + } + + bool is_flippable(const Edge& edge) const { + Edge twin = twin_edge(edge); + if (Rt_2::is_infinite(twin.first)) + return false; + if (Rt_2::is_infinite(edge.first)) + return false; + + Vertex_handle vs = source_vertex(edge); + Vertex_handle vt = target_vertex(edge); + Vertex_handle vf = opposite_vertex(edge); + Vertex_handle vb = opposite_vertex(twin); + + if (!is_triangle_ccw(vs, vb, vf)) + return false; + if (!is_triangle_ccw(vt, vf, vb)) + return false; + return true; + } + + bool is_collapsible(const Edge& edge) const { + if (!check_link_test(edge)) + return false; + if (!check_kernel_test(edge)) + return false; + return true; + } + + bool check_link_test(const Edge& edge) const { + Vertex_handle s = source_vertex(edge); + Vertex_handle t = target_vertex(edge); + + if (s == t) + return false; + typename Vertex_handle_set::const_iterator it; + + Vertex_handle_set svertices; + get_vertices_from_vertex_link(s, svertices); + + Vertex_handle_set tvertices; + get_vertices_from_vertex_link(t, tvertices); + + // link(s) inter link(t) + Vertex_handle_set ivertices; + for (it = svertices.begin(); it != svertices.end(); ++it) { + Vertex_handle v = *it; + if (tvertices.find(v) != tvertices.end()) + ivertices.insert(v); + } + + Vertex_handle_set evertices; + get_vertices_from_edge_link(edge, evertices); + + // link(edge) =? link(s) inter link(t) + if (evertices.size() != ivertices.size()) + return false; + + for (it = evertices.begin(); it != evertices.end(); ++it) { + Vertex_handle v = *it; + if (ivertices.find(v) == ivertices.end()) + return false; + } + return true; + } + + bool check_kernel_test(const Edge& edge) const { + Vertex_handle s = source_vertex(edge); + Vertex_handle t = target_vertex(edge); + + Edge_list hull; + get_edges_from_star_minus_link(s, hull); + return is_in_kernel(t->point(), hull.begin(), hull.end()); + } + + template // value_type = Edge + bool is_in_kernel(const Point& query, Iterator begin, Iterator end) const { + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + const Point& pa = source_vertex(edge)->point(); + const Point& pb = target_vertex(edge)->point(); + if (!compute_triangle_ccw(pa, pb, query)) + return false; + } + return true; + } + + // COLLAPSE // + + // (s,a,b) + (s,b,c) -> (s,a,c) + (a,b,c) + // st = (source,target) from 'make_collapsible' + // return (a,c) + Edge flip(const Edge& sb, Edge& st, int verbose = 0) { + Vertex_handle t = target_vertex(st); + + Edge sc = twin_edge(prev_edge(sb)); + Rt_2::tds().flip(sb.first, sb.second); + Edge ac = prev_edge(twin_edge(sc)); + + Vertex_handle a = source_vertex(ac); + if (a == t) + st = prev_edge(ac); + + return ac; + } + + void collapse(const Edge& edge, int verbose = 0) { + if (is_edge_cyclic(edge)) { + collapse_cyclic_edge(edge); + return; + } + + Edge twin = twin_edge(edge); + Rt_2::tds().join_vertices(twin); + } + + // (a,b,c) + (c,b,a) + (a,c,i) + (c,a,j) -> + // (a,c,i) + (c,a,j) + void collapse_cyclic_edge(const Edge& bc, int verbose = 1) { + if (verbose > 0) + std::cout << "collapse_cyclic_edge ... "; + + Edge cb = twin_edge(bc); + Face_handle abc = bc.first; + Face_handle cba = cb.first; + + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle a = opposite_vertex(bc); + + Edge ac = twin_edge(next_edge(bc)); + Edge ca = twin_edge(prev_edge(cb)); + + a->set_face(ac.first); + c->set_face(ca.first); + ac.first->set_neighbor(ac.second, ca.first); + ca.first->set_neighbor(ca.second, ac.first); + + //TODO: IV UNCOMMEN THIS + this->delete_face(abc); + this->delete_face(cba); + this->delete_vertex(b); + + if (verbose > 0) + std::cout << "done" << std::endl; + } + + template // value_type = Edge + bool make_collapsible(Edge& edge, Iterator begin, Iterator end, + int verbose = 0) { + Vertex_handle source = source_vertex(edge); + Vertex_handle target = target_vertex(edge); + + PQueue pqueue; + for (Iterator it = begin; it != end; ++it) { + Edge ab = twin_edge(*it); + Vertex_handle a = source_vertex(ab); + Vertex_handle b = target_vertex(ab); + FT D = signed_distance_from_intersection(a, b, target, source); + if (D < 0.0) + pqueue.push(Reconstruction_edge_2(ab, D)); + } + + int nb_flips = 0; + while (!pqueue.empty()) { + Reconstruction_edge_2 pedge = pqueue.top(); + FT Dbc = pedge.priority(); + Edge bc = pedge.edge(); + pqueue.pop(); + + Edge sb = prev_edge(bc); + Edge ab = prev_edge(twin_edge(sb)); + Edge sc = twin_edge(next_edge(bc)); + Edge cd = next_edge(sc); + + Vertex_handle a = source_vertex(ab); + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle d = target_vertex(cd); + + FT Dac = MINN; + if (a != c && is_triangle_ccw(a, b, c)) + Dac = signed_distance_from_intersection(a, c, target, source); + + FT Dbd = MINN; + if (b != d && is_triangle_ccw(b, c, d)) + Dbd = signed_distance_from_intersection(b, d, target, source); + + if (Dac == MINN && Dbd == MINN) { + // TODO: IV comment in std::cerr << red << "--- + //No flips available ---" << white << std::endl; + std::cerr << "--- No flips available ---" << std::endl; + return false; + } + + if (std::max(Dac, Dbd) + EPS < Dbc) { + std::cerr.precision(10); + // TODO: IV comment in std::cerr << red << "--- + //Flip makes kernel worse ---" << white << std::endl; + std::cerr << "--- Flip makes kernel worse ---" << std::endl; + std::cerr << Dac << " or " << Dbd << " vs " << Dbc << std::endl; + std::cerr << "a: " << a->point() << std::endl; + std::cerr << "b: " << b->point() << std::endl; + std::cerr << "c: " << c->point() << std::endl; + std::cerr << "d: " << d->point() << std::endl; + std::cerr << "t: " << target->point() << std::endl; + std::cerr << "diff = " << Dbc - std::max(Dac, Dbd) << std::endl; + return false; + } + + if (Dac > Dbd) { + pqueue.remove(Reconstruction_edge_2(ab)); + Edge ac = flip(sb, edge, verbose); + if (Dac < 0.0) + pqueue.push(Reconstruction_edge_2(ac, Dac)); + } else { + pqueue.remove(Reconstruction_edge_2(cd)); + Edge bd = flip(sc, edge, verbose); + if (Dbd < 0.0) + pqueue.push(Reconstruction_edge_2(bd, Dbd)); + } + nb_flips++; + } + + if (verbose > 1) + //TODO: IV Comment in std::cerr << red << "--- Flip makes kernel + //worse ---" << white << std::endl; + std::cerr << "Nb flips: " << nb_flips << std::endl; + + return true; + } + + int random_int(const int min, const int max) { + int range = max - min; + return min + int((double(rand()) / double(RAND_MAX)) * range); + } + +}; } //namespace CGAL +#endif From 03351dae6c268f317812509cc3905d70fd11eec7 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 24 Jun 2014 15:30:33 -0400 Subject: [PATCH 008/201] min max usage cleaned --- .../include/CGAL/Cost.h | 11 +++---- .../include/CGAL/Reconstruction_edge_2.h | 2 -- .../include/CGAL/Reconstruction_face_base_2.h | 3 +- .../CGAL/Reconstruction_simplification_2.h | 17 ++++++---- .../CGAL/Reconstruction_triangulation_2.h | 31 +++++++++---------- .../CGAL/Reconstruction_vertex_base_2.h | 3 +- .../include/CGAL/console_color.h | 9 ++++-- 7 files changed, 40 insertions(+), 36 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Cost.h b/Reconstruction_simplification_2/include/CGAL/Cost.h index de809467085..7a810be66e8 100644 --- a/Reconstruction_simplification_2/include/CGAL/Cost.h +++ b/Reconstruction_simplification_2/include/CGAL/Cost.h @@ -1,9 +1,6 @@ #ifndef COST_H_ #define COST_H_ -#undef min -#undef max - template class Cost { @@ -75,14 +72,14 @@ public: void update_max(const Cost& cost) { - m_max_norm = std::max(m_max_norm, cost.max_norm()); - m_max_tang = std::max(m_max_tang, cost.max_tang()); + m_max_norm = (std::max)(m_max_norm, cost.max_norm()); + m_max_tang = (std::max)(m_max_tang, cost.max_tang()); } void compute_max(const FT norm, const FT tang) { - m_max_norm = std::max(m_max_norm, norm); - m_max_tang = std::max(m_max_tang, tang); + m_max_norm = (std::max)(m_max_norm, norm); + m_max_tang = (std::max)(m_max_tang, tang); } }; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index e3de6355835..77499041a26 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -22,7 +22,6 @@ #include -//---------------CLASS CPEDGE--------------------- template class Reconstruction_edge_2 { @@ -138,7 +137,6 @@ protected: -//---------------CLASS CPQUEUE--------------------- template class Dynamic_priority_queue_edges : public Dynamic_priority_queue { public: diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 76e422d11dc..a9b8c93628a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -8,7 +8,8 @@ #include -/// The Reconstruction_face_base_2 class (corresponding to Reconstruction_face_base_2 in prototype) is the default +/// The Reconstruction_face_base_2 class (corresponding to +//Reconstruction_face_base_2 in prototype) is the default /// vertex class of the Reconstruction_face_base_2 class. /// /// - Each vertex stores a CSample as well as the corresponding relocated point diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ea5890c005b..ecf20d2e796 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -51,7 +51,8 @@ public: typedef typename Triangulation::Vertex_handle Vertex_handle; typedef typename Triangulation::Vertex_iterator Vertex_iterator; typedef typename Triangulation::Vertex_circulator Vertex_circulator; - typedef typename Triangulation::Finite_vertices_iterator Finite_vertices_iterator; + typedef typename Triangulation::Finite_vertices_iterator + Finite_vertices_iterator; typedef typename Triangulation::Edge Edge; typedef typename Triangulation::Edge_iterator Edge_iterator; @@ -75,10 +76,12 @@ public: typedef typename Triangulation::Cost Cost; typedef typename Triangulation::Sample Sample; typedef typename Triangulation::Sample_list Sample_list; - typedef typename Triangulation::Sample_list_const_iterator Sample_list_const_iterator; + typedef typename Triangulation::Sample_list_const_iterator + Sample_list_const_iterator; typedef typename Triangulation::Point_list Point_list; - typedef typename Triangulation::Point_list_const_iterator Point_list_const_iterator; + typedef typename Triangulation::Point_list_const_iterator + Point_list_const_iterator; typedef typename Triangulation::PSample PSample; typedef typename Triangulation::SQueue SQueue; @@ -168,10 +171,11 @@ public: //TODO: determine suitable way of storing them void extract_solid_eges() { - std::cout << "------------extracted_solid_eges----------------------" << std::endl; + std::cout << "---------extracted_solid_eges------------" << std::endl; PQueue queue; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; @@ -1246,7 +1250,8 @@ public: { int nb_solid = 0; int nb_ghost = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) nb_ghost++; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 9b81436ce4a..a018304d182 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -41,11 +41,6 @@ #include #include -#undef min -#undef max - -#define MINN -1e100 -#define MAXN 1e100 #define EPS 1e-15 namespace CGAL { @@ -97,9 +92,11 @@ public: typedef std::map > Vertex_handle_map; - typedef std::map > Face_handle_map; + typedef std::map > + Face_handle_map; - typedef std::set > Vertex_handle_set; + typedef std::set > + Vertex_handle_set; typedef std::set > Edge_set; typedef std::list Edge_list; @@ -116,7 +113,8 @@ public: typedef std::priority_queue, greater_priority > SQueue; - typedef Reconstruction_edge_2 Reconstruction_edge_2; + typedef Reconstruction_edge_2 + Reconstruction_edge_2; typedef Dynamic_priority_queue_edges PQueue; double m_factor; // ghost vs solid @@ -549,7 +547,7 @@ public: FT Ds = CGAL::squared_distance(query, ps); FT Dt = CGAL::squared_distance(query, pt); - FT dist2 = std::min(Ds, Dt); + FT dist2 = (std::min)(Ds, Dt); FT norm2 = sample->distance2(); FT tang2 = dist2 - norm2; @@ -650,7 +648,7 @@ public: } Edge find_nearest_edge(const Point& point, Face_handle face) const { - FT min_dist2 = MAXN; + FT min_dist2 = std::numeric_limits::max(); Edge nearest(Face_handle(), 0); for (int i = 0; i < 3; ++i) { Edge edge(face, i); @@ -755,7 +753,7 @@ public: Line lab(pa, pb - pa); Line lts(pt, ps - pt); - FT Dqt = MAXN; + FT Dqt = std::numeric_limits::max(); CGAL::Object result = CGAL::intersection(lab, lts); const Point* iq = CGAL::object_cast(&result); if (iq) @@ -979,22 +977,23 @@ public: Vertex_handle c = target_vertex(bc); Vertex_handle d = target_vertex(cd); - FT Dac = MINN; + FT Dac = std::numeric_limits::min(); if (a != c && is_triangle_ccw(a, b, c)) Dac = signed_distance_from_intersection(a, c, target, source); - FT Dbd = MINN; + FT Dbd = std::numeric_limits::min(); if (b != d && is_triangle_ccw(b, c, d)) Dbd = signed_distance_from_intersection(b, d, target, source); - if (Dac == MINN && Dbd == MINN) { + if (Dac == std::numeric_limits::min() && + Dbd == std::numeric_limits::min()) { // TODO: IV comment in std::cerr << red << "--- //No flips available ---" << white << std::endl; std::cerr << "--- No flips available ---" << std::endl; return false; } - if (std::max(Dac, Dbd) + EPS < Dbc) { + if ((std::max)(Dac, Dbd) + EPS < Dbc) { std::cerr.precision(10); // TODO: IV comment in std::cerr << red << "--- //Flip makes kernel worse ---" << white << std::endl; @@ -1005,7 +1004,7 @@ public: std::cerr << "c: " << c->point() << std::endl; std::cerr << "d: " << d->point() << std::endl; std::cerr << "t: " << target->point() << std::endl; - std::cerr << "diff = " << Dbc - std::max(Dac, Dbd) << std::endl; + std::cerr << "diff = " << Dbc - (std::max)(Dac, Dbd) << std::endl; return false; } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 30943fb5e60..da70816ad35 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -11,7 +11,8 @@ #include #include -/// The Reconstruction_vertex_base_2 class (corresponding to Reconstruction_vertex_base_2 in prototype) is the default +/// The Reconstruction_vertex_base_2 class (corresponding to +//Reconstruction_vertex_base_2 in prototype) is the default /// vertex class of the Reconstruction_triangulation_2 class. /// /// - Each vertex stores a CSample as well as the corresponding relocated point diff --git a/Reconstruction_simplification_2/include/CGAL/console_color.h b/Reconstruction_simplification_2/include/CGAL/console_color.h index 12b7f2553fa..8b10ab8c566 100644 --- a/Reconstruction_simplification_2/include/CGAL/console_color.h +++ b/Reconstruction_simplification_2/include/CGAL/console_color.h @@ -11,7 +11,8 @@ inline std::ostream& blue(std::ostream &s) { #if defined(WIN32) HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); + SetConsoleTextAttribute(hStdout, + FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); #else s << "\e[0;34m"; #endif @@ -44,7 +45,8 @@ inline std::ostream& yellow(std::ostream &s) { #if defined(WIN32) HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); + SetConsoleTextAttribute(hStdout, + FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); #else s << "\e[0;33m"; #endif @@ -55,7 +57,8 @@ inline std::ostream& white(std::ostream &s) { #if defined(WIN32) HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); + SetConsoleTextAttribute(hStdout, + FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); #else s << "\e[0;37m"; #endif From e05aaad91408b2e3a71db7e9e3f031d3a212e619 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 25 Jun 2014 17:42:02 -0400 Subject: [PATCH 009/201] Revered to MINN and MAXN due to bug --- .../include/CGAL/Reconstruction_triangulation_2.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index a018304d182..650f29e84a5 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -42,6 +42,8 @@ #include #define EPS 1e-15 +#define MINN -1e100 +#define MAXN 1e100 namespace CGAL { @@ -648,7 +650,7 @@ public: } Edge find_nearest_edge(const Point& point, Face_handle face) const { - FT min_dist2 = std::numeric_limits::max(); + FT min_dist2 = MAXN; Edge nearest(Face_handle(), 0); for (int i = 0; i < 3; ++i) { Edge edge(face, i); @@ -753,7 +755,7 @@ public: Line lab(pa, pb - pa); Line lts(pt, ps - pt); - FT Dqt = std::numeric_limits::max(); + FT Dqt = MAXN; CGAL::Object result = CGAL::intersection(lab, lts); const Point* iq = CGAL::object_cast(&result); if (iq) @@ -977,16 +979,16 @@ public: Vertex_handle c = target_vertex(bc); Vertex_handle d = target_vertex(cd); - FT Dac = std::numeric_limits::min(); + FT Dac = MINN; if (a != c && is_triangle_ccw(a, b, c)) Dac = signed_distance_from_intersection(a, c, target, source); - FT Dbd = std::numeric_limits::min(); + FT Dbd = MINN; if (b != d && is_triangle_ccw(b, c, d)) Dbd = signed_distance_from_intersection(b, d, target, source); - if (Dac == std::numeric_limits::min() && - Dbd == std::numeric_limits::min()) { + if (Dac == MINN && + Dbd == MINN) { // TODO: IV comment in std::cerr << red << "--- //No flips available ---" << white << std::endl; std::cerr << "--- No flips available ---" << std::endl; From 8c1fc66223b392c92054904bd735512b06b9e6ac Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 25 Jun 2014 18:34:28 -0400 Subject: [PATCH 010/201] numeric_limits bug fixed --- .../CGAL/Reconstruction_triangulation_2.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 650f29e84a5..6b581d84c24 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -42,8 +42,6 @@ #include #define EPS 1e-15 -#define MINN -1e100 -#define MAXN 1e100 namespace CGAL { @@ -650,7 +648,7 @@ public: } Edge find_nearest_edge(const Point& point, Face_handle face) const { - FT min_dist2 = MAXN; + FT min_dist2 = std::numeric_limits::max(); Edge nearest(Face_handle(), 0); for (int i = 0; i < 3; ++i) { Edge edge(face, i); @@ -755,7 +753,7 @@ public: Line lab(pa, pb - pa); Line lts(pt, ps - pt); - FT Dqt = MAXN; + FT Dqt = std::numeric_limits::max(); CGAL::Object result = CGAL::intersection(lab, lts); const Point* iq = CGAL::object_cast(&result); if (iq) @@ -979,19 +977,19 @@ public: Vertex_handle c = target_vertex(bc); Vertex_handle d = target_vertex(cd); - FT Dac = MINN; + FT Dac = std::numeric_limits::lowest(); if (a != c && is_triangle_ccw(a, b, c)) Dac = signed_distance_from_intersection(a, c, target, source); - FT Dbd = MINN; + FT Dbd = std::numeric_limits::lowest(); if (b != d && is_triangle_ccw(b, c, d)) Dbd = signed_distance_from_intersection(b, d, target, source); - if (Dac == MINN && - Dbd == MINN) { + if (Dac == std::numeric_limits::lowest() && + Dbd == std::numeric_limits::lowest()) { // TODO: IV comment in std::cerr << red << "--- //No flips available ---" << white << std::endl; - std::cerr << "--- No flips available ---" << std::endl; + std::cerr << "--- No flips available ---" << std::flush; return false; } @@ -999,7 +997,7 @@ public: std::cerr.precision(10); // TODO: IV comment in std::cerr << red << "--- //Flip makes kernel worse ---" << white << std::endl; - std::cerr << "--- Flip makes kernel worse ---" << std::endl; + std::cerr << "--- Flip makes kernel worse ---" << std::flush; std::cerr << Dac << " or " << Dbd << " vs " << Dbc << std::endl; std::cerr << "a: " << a->point() << std::endl; std::cerr << "b: " << b->point() << std::endl; From 3f812111c85470a15ee24234f2dd2ffc837ad970 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 26 Jun 2014 21:53:27 -0400 Subject: [PATCH 011/201] Reconstruction Demo V1 implemented --- .gitignore | 2 + .../CMakeLists.txt | 91 ++ ...Reconstruction_simplification_kerneled_2.h | 156 +++ .../data/blob00.xy | 320 +++++ .../data/maple_leaf_embroidery.bmp | Bin 0 -> 58726 bytes .../data/round_rect00.xy | 288 +++++ .../data/skyline_noisy00.xy | 430 +++++++ .../data/stair-noise00.xy | 160 +++ .../dialog_options.h | 69 ++ .../glviewer.cpp | 189 +++ .../glviewer.h | 130 ++ .../icons/Voronoi_diagram_2.png | Bin 0 -> 3093 bytes .../icons/fileNew.png | Bin 0 -> 768 bytes .../icons/fileOpen.png | Bin 0 -> 1662 bytes .../icons/fileSave.png | Bin 0 -> 1205 bytes .../icons/fit-page-32.png | Bin 0 -> 1330 bytes .../icons/inputPoint.png | Bin 0 -> 1145 bytes .../icons/snapshot.png | Bin 0 -> 9179 bytes .../icons/triangulation.png | Bin 0 -> 7547 bytes .../icons/until.png | Bin 0 -> 1380 bytes .../icons/vertex.png | Bin 0 -> 360 bytes .../Reconstruction_simplification_2/main.cpp | 12 + .../moc_dialog_options.cxx | 84 ++ .../moc_glviewer.cxx | 81 ++ .../moc_window.cxx | 290 +++++ .../options.ui | 328 +++++ .../pwsrec.qrc | 14 + .../Reconstruction_simplification_2/pwsrec.ui | 712 +++++++++++ .../Reconstruction_simplification_2/random.h | 26 + .../render.cpp | 944 ++++++++++++++ .../Reconstruction_simplification_2/scene.h | 1080 +++++++++++++++++ .../ui_options.h | 316 +++++ .../ui_pwsrec.h | 557 +++++++++ .../window.cpp | 728 +++++++++++ .../Reconstruction_simplification_2/window.h | 150 +++ .../include/CGAL/Dynamic_priority_queue.h | 1 + .../include/CGAL/Reconstruction_edge_2.h | 16 + .../CGAL/Reconstruction_simplification_2.h | 81 +- .../CGAL/Reconstruction_triangulation_2.h | 192 +-- .../CMakeLists.txt | 3 +- 40 files changed, 7358 insertions(+), 92 deletions(-) create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/blob00.xy create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/maple_leaf_embroidery.bmp create mode 100755 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy create mode 100755 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy create mode 100755 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/Voronoi_diagram_2.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileNew.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileOpen.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileSave.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fit-page-32.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/inputPoint.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/snapshot.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/triangulation.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/until.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/vertex.png create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/options.ui create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.qrc create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.ui create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h diff --git a/.gitignore b/.gitignore index 9a1d742f1fe..fecbad160c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.svn +.svn-base /*build* AABB_tree/demo/AABB_tree/AABB_demo AABB_tree/demo/AABB_tree/CMakeLists.txt diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt new file mode 100644 index 00000000000..2a508cabf9c --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt @@ -0,0 +1,91 @@ +# CMake +# Fernando de Goes (fdegoes@caltech.edu) +# Copyright @ 2011 +project(pwsrec2D) + +cmake_minimum_required(VERSION 2.4.5) +cmake_policy(VERSION 2.4.5) + +set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) + +############ +# Packages # +############ + +set( QT_USE_QTXML TRUE ) +set( QT_USE_QTMAIN TRUE ) +set( QT_USE_QTSCRIPT TRUE ) +set( QT_USE_QTOPENGL TRUE ) + +find_package(OpenGL) +find_package(Qt4) +find_package(CGAL COMPONENTS Qt4) + + + +set( +SRCS +glviewer.cpp +main.cpp +window.cpp +render.cpp +) + +set( +MOCS +moc_dialog_options.cxx +moc_glviewer.cxx +moc_window.cxx +) + +set( +UIS +pwsrec.ui +options.ui +) + +######### +# Build # +######### + +# Includes +include_directories(BEFORE . ./build) +include(${QT_USE_FILE}) +include_directories(${GLUT_INCLUDE_DIR}) +include_directories(${OPENGL_INCLUDE_DIR}) +include(${CGAL_USE_FILE}) + + + + include_directories (BEFORE "../../include") + include_directories (BEFORE "include") + + + +# UI files +qt4_wrap_ui( DT_UI_FILES ${UIS} ) + +# QRC files +qt4_add_resources( DT_RESOURCE_FILES pwsrec.qrc ) + +# MOC files +qt4_generate_moc( window.h moc_window.cxx ) +qt4_generate_moc( glviewer.h moc_glviewer.cxx ) +qt4_generate_moc( dialog_options.h moc_dialog_options.cxx ) + +# The executable itself. +add_executable( ${PROJECT_NAME} ${SRCS} ${MOCS} ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + +# Link with Qt libraries +target_link_libraries( ${PROJECT_NAME} ${QT_LIBRARIES} ) + +# Link with Glut and OpenGL +target_link_libraries( ${PROJECT_NAME} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ) + +# Link with CImg dependencies +if( NOT WIN32 ) + target_link_libraries( ${PROJECT_NAME} -L/usr/X11R6/lib -lm -lpthread -lX11 ) +endif() + +# Link with CGAL +target_link_libraries( ${PROJECT_NAME} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h new file mode 100644 index 00000000000..14bf4bcd50b --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -0,0 +1,156 @@ +#ifndef RECONSTRUCTION_SIMPLIFICATION_KERNEL_2_H_ +#define RECONSTRUCTION_SIMPLIFICATION_KERNEL_2_H_ + +#include +#include + +#include +#include + +#include +#include // std::pair +#include + +//Qt +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; +typedef PointMassList::const_iterator InputIterator; + +typedef CGAL::value_type_traits::type MassPoint; + +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + +typedef CGAL::Reconstruction_simplification_2 Reconstruction_simplification_2; + +class Reconstruction_simplification_kerneled_2: + public Reconstruction_simplification_2 { + +public: + + Reconstruction_simplification_kerneled_2(InputIterator start, + InputIterator beyond, PointPMap point_pmap, MassPMap mass_pmap) : + Reconstruction_simplification_2(start, beyond, point_pmap, + mass_pmap) { + } + + Reconstruction_simplification_kerneled_2() : + Reconstruction_simplification_2() { + } + + // RENDER // + void print_stats() const; + + QColor get_color(float value) const; + + void draw_point(const Point& point); + + void draw_segment(const Point& s, const Point& t); + + void draw_edge(const Edge& edge); + + void draw_face(Face_handle face); + + void draw_edge_with_arrow(const Point& s, const Point& t); + + void draw_vertices(const float point_size, const float red, + const float green, const float blue); + + void draw_edges(const float line_width, const float red, const float green, + const float blue); + + void draw_footpoints(const float line_width, const float red, + const float green, const float blue); + + void draw_mesh_footpoints(const Triangulation& mesh, const float line_width, + const float red, const float green, const float blue); + + void draw_edge_footpoints(const Triangulation& mesh, const Edge& edge, + const float red, const float green, const float blue); + + void draw_pedges(const float line_width); + + void draw_one_pedge(const Edge& edge, const FT value, const FT min_value, + const FT max_value, const float line_width); + + void draw_costs(const float line_width, const bool view_ghost); + + void draw_one_cost(const Edge& edge, const FT min_value, const FT max_value, + const bool view_ghost); + + void draw_relevance(const float line_width, const int nb, + const bool incolors); + + void draw_bins(const float thickness); + + void draw_bins_plan0(const Edge& edge); + + void draw_bins_plan1(const Edge& edge); + + void draw_relocation(); + + void draw_bezier_curves(const unsigned int nb); + + void draw_one_bezier_curve(const Edge& edge, const unsigned int nb); + + bool locate_edge(const Point& query, Edge& edge); + + void draw_one_ring(const float point_size, const float line_width, + const Point& query); + + void draw_mesh_one_ring(const float point_size, const float line_width, + const Triangulation& mesh, const Edge& edge); + + void draw_blocking_edges(const float point_size, const float line_width, + const Point& query); + + void draw_mesh_blocking_edges(const float point_size, + const float line_width, const Triangulation& mesh, + const Edge& edge); + + void draw_collapsible_edge(const float point_size, const float line_width, + const Point& query); + + void draw_simulation(const float point_size, const float line_width, + const Point& query); + + void draw_cost_stencil(const float point_size, const float line_width, + const Point& query); + + void draw_remove_queue_stencil(const float point_size, + const float line_width, const Point& query); + + void draw_push_queue_stencil(const float point_size, const float line_width, + const Point& query); + + void draw_bg_faces(const Triangulation& mesh, const float red, + const float green, const float blue, const float alpha); + + void draw_bg_edges(const Triangulation& mesh, const float ri, + const float gi, const float bi, const float ro, const float go, + const float bo); + + void draw_bg_vertices(const Triangulation& mesh, const float red, + const float green, const float blue); + + void draw_vertex_faces(Vertex_handle vertex, const Triangulation& mesh, + const float red, const float green, const float blue, + const float alpha); + + void draw_vertex_edges(Vertex_handle vertex, const Triangulation& mesh, + const float ri, const float gi, const float bi, const float ro, + const float go, const float bo); + + void save_edges(std::ofstream& ofs, const int nb); + + void save_one_edge(std::ofstream& ofs, const Edge& edge); + +}; +#endif diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/blob00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/blob00.xy new file mode 100644 index 00000000000..648acc40927 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/blob00.xy @@ -0,0 +1,320 @@ +0.21658 0.688199 +0.225464 0.697612 +0.234416 0.706629 +0.243414 0.71525 +0.25244 0.723472 +0.261474 0.731295 +0.270497 0.738718 +0.279488 0.745738 +0.28843 0.752355 +0.297301 0.758568 +0.306083 0.764374 +0.314756 0.769774 +0.3233 0.774765 +0.331697 0.779347 +0.339925 0.783517 +0.347967 0.787275 +0.355802 0.79062 +0.363411 0.79355 +0.370775 0.796064 +0.377873 0.798161 +0.384686 0.799839 +0.391196 0.801097 +0.397381 0.801934 +0.403224 0.802348 +0.408703 0.802339 +0.4138 0.801904 +0.418496 0.801044 +0.42277 0.799755 +0.426603 0.798038 +0.429976 0.795891 +0.432869 0.793312 +0.435263 0.790301 +0.437137 0.786855 +0.438474 0.782974 +0.43931 0.778689 +0.439685 0.774028 +0.439636 0.769024 +0.439204 0.763707 +0.438424 0.758106 +0.437338 0.752252 +0.435982 0.746177 +0.434395 0.739909 +0.432617 0.73348 +0.430684 0.72692 +0.428636 0.720259 +0.426511 0.713529 +0.424348 0.706758 +0.422185 0.699978 +0.420061 0.69322 +0.418013 0.686513 +0.416081 0.679888 +0.414303 0.673375 +0.412718 0.667006 +0.411363 0.660809 +0.410278 0.654817 +0.4095 0.649058 +0.409069 0.643564 +0.409022 0.638366 +0.409399 0.633492 +0.410238 0.628975 +0.411576 0.624843 +0.413454 0.621129 +0.415908 0.617862 +0.418978 0.615072 +0.422702 0.61279 +0.427118 0.611047 +0.432186 0.609809 +0.437863 0.609043 +0.444108 0.608716 +0.45088 0.608795 +0.458138 0.609247 +0.465839 0.610037 +0.473943 0.611135 +0.482408 0.612505 +0.491193 0.614115 +0.500256 0.615932 +0.509556 0.617923 +0.519051 0.620054 +0.5287 0.622293 +0.538462 0.624605 +0.548295 0.626958 +0.558157 0.62932 +0.568008 0.631655 +0.577805 0.633933 +0.587508 0.636118 +0.597075 0.638179 +0.606464 0.640081 +0.615635 0.641793 +0.624545 0.64328 +0.633154 0.644509 +0.641419 0.645448 +0.6493 0.646062 +0.656755 0.64632 +0.663742 0.646187 +0.670221 0.645631 +0.676149 0.644619 +0.681485 0.643117 +0.686188 0.641091 +0.690293 0.638571 +0.693832 0.635583 +0.696841 0.632154 +0.699353 0.628314 +0.701403 0.624088 +0.703024 0.619505 +0.704252 0.614592 +0.705119 0.609377 +0.70566 0.603888 +0.70591 0.598152 +0.705902 0.592197 +0.70567 0.58605 +0.705249 0.579739 +0.704673 0.573291 +0.703976 0.566734 +0.703192 0.560097 +0.702355 0.553405 +0.7015 0.546688 +0.70066 0.539972 +0.69987 0.533285 +0.699163 0.526655 +0.698575 0.52011 +0.698138 0.513676 +0.697888 0.507382 +0.697858 0.501255 +0.698082 0.495323 +0.698595 0.489613 +0.699431 0.484153 +0.700624 0.478971 +0.702208 0.474094 +0.704217 0.469549 +0.706685 0.465365 +0.709587 0.46152 +0.712898 0.457993 +0.716593 0.454762 +0.720646 0.451807 +0.725032 0.449105 +0.729725 0.446635 +0.734701 0.444376 +0.739935 0.442308 +0.7454 0.440407 +0.751072 0.438654 +0.756925 0.437026 +0.762935 0.435503 +0.769075 0.434063 +0.775321 0.432684 +0.781648 0.431346 +0.788029 0.430027 +0.794441 0.428706 +0.800857 0.427361 +0.807252 0.425972 +0.813602 0.424516 +0.81988 0.422972 +0.826062 0.42132 +0.832122 0.419537 +0.838035 0.417603 +0.843776 0.415496 +0.849319 0.413195 +0.85464 0.410678 +0.859712 0.407924 +0.864511 0.404912 +0.869012 0.40162 +0.873189 0.398028 +0.877017 0.394113 +0.880496 0.389894 +0.883627 0.385387 +0.88641 0.380611 +0.888846 0.375582 +0.890935 0.37032 +0.892678 0.36484 +0.894074 0.35916 +0.895126 0.353299 +0.895832 0.347273 +0.896193 0.341101 +0.89621 0.334799 +0.895883 0.328385 +0.895213 0.321877 +0.894201 0.315292 +0.892845 0.308648 +0.891148 0.301962 +0.889109 0.295252 +0.886729 0.288536 +0.884008 0.28183 +0.880947 0.275153 +0.877547 0.268521 +0.873807 0.261954 +0.869727 0.255467 +0.86531 0.249079 +0.860554 0.242807 +0.855461 0.236669 +0.850031 0.230681 +0.844264 0.224863 +0.838161 0.219231 +0.831722 0.213802 +0.824947 0.208595 +0.817838 0.203627 +0.81041 0.198897 +0.802681 0.194407 +0.794667 0.190157 +0.786386 0.186146 +0.777853 0.182375 +0.769085 0.178845 +0.7601 0.175555 +0.750913 0.172505 +0.741543 0.169696 +0.732004 0.167128 +0.722315 0.164802 +0.712492 0.162717 +0.702552 0.160874 +0.692511 0.159272 +0.682386 0.157913 +0.672194 0.156796 +0.661951 0.155922 +0.651675 0.155291 +0.641382 0.154902 +0.631089 0.154757 +0.620812 0.154855 +0.610569 0.155197 +0.600376 0.155783 +0.590249 0.156614 +0.580206 0.157688 +0.570263 0.159007 +0.560437 0.160571 +0.550745 0.16238 +0.541204 0.164434 +0.531829 0.166734 +0.522639 0.169279 +0.513649 0.17207 +0.504849 0.17509 +0.496229 0.178322 +0.487776 0.181749 +0.479481 0.185355 +0.471332 0.189121 +0.463319 0.193031 +0.455431 0.197069 +0.447657 0.201217 +0.439987 0.205458 +0.432409 0.209776 +0.424913 0.214153 +0.417487 0.218572 +0.410121 0.223017 +0.402805 0.22747 +0.395527 0.231915 +0.388277 0.236334 +0.381043 0.240711 +0.373816 0.245028 +0.366583 0.249269 +0.359335 0.253417 +0.35206 0.257455 +0.344747 0.261365 +0.337387 0.265132 +0.329968 0.268737 +0.322478 0.272164 +0.314908 0.275396 +0.307247 0.278416 +0.299483 0.281208 +0.291607 0.283753 +0.283606 0.286035 +0.27547 0.288038 +0.267189 0.289744 +0.258785 0.29118 +0.250279 0.292376 +0.241694 0.293357 +0.233052 0.294152 +0.224375 0.294789 +0.215686 0.295294 +0.207005 0.295697 +0.198356 0.296024 +0.189761 0.296302 +0.181241 0.296561 +0.172819 0.296827 +0.164517 0.297128 +0.156358 0.297491 +0.148362 0.297945 +0.140553 0.298517 +0.132952 0.299234 +0.125581 0.300124 +0.118464 0.301215 +0.111621 0.302535 +0.105075 0.304111 +0.0988486 0.305971 +0.0929632 0.308142 +0.087441 0.310653 +0.0823044 0.31353 +0.0775753 0.316801 +0.0732759 0.320494 +0.0694284 0.324638 +0.0660549 0.329258 +0.0631774 0.334384 +0.0608182 0.340042 +0.0589994 0.34626 +0.057743 0.353066 +0.0570342 0.36043 +0.0568581 0.36832 +0.0571998 0.376706 +0.0580445 0.385557 +0.0593773 0.394842 +0.0611832 0.404531 +0.0634474 0.414593 +0.066155 0.424998 +0.0692912 0.435714 +0.072841 0.446711 +0.0767896 0.457959 +0.081122 0.469426 +0.0858234 0.481082 +0.090879 0.492896 +0.0962737 0.504838 +0.101993 0.516876 +0.108021 0.528981 +0.114345 0.541121 +0.120947 0.553266 +0.127815 0.565385 +0.134933 0.577447 +0.142285 0.589422 +0.149858 0.601278 +0.157636 0.612986 +0.165604 0.624515 +0.173748 0.635833 +0.182053 0.646911 +0.190503 0.657717 +0.199085 0.668221 +0.207782 0.678392 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/maple_leaf_embroidery.bmp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/maple_leaf_embroidery.bmp new file mode 100644 index 0000000000000000000000000000000000000000..385ccb11a485265db4f38c28d711816d0ea56c51 GIT binary patch literal 58726 zcmc(|f0!Iqoi98IX))w|FCh>VP-Ym?Y)GE>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sc`+bvQk-gjvpjsFjtMumQ!~>EeE(@%vL`{USbco z-3-w=^`-j;8X=b@xGWIHlFLDvjAL5%a}U)QSPox0#B>Y~um)SL>!sz@Vo9{nND!h0 zTh~vPIskU85m41r6nyY<6%dayl@VG$DYZi&Xu#X#oibe8xzvU@En43t!%cN?H&r?l zSJj0zLb6JBhv}S7fEM#(Y1nzJtSZ6`GtdaFJ`7V#t7A$`a5^KC%<4H|yGxTw%yO&@ zx9sRAQyt*7u|~jvE3AuG1{cRxR!^24Ik}Jqzsz1)hqseECbF8IShR^*&<+@u;-#!6 zw2r*6My#GXbWCD(Ju%?bGAE~NmU-XRlkQ0`Z9ekVlJ4qGlVqftaITt0oDy{a;H#w( zNy)^cuMx{o GhyM-eV5^e= literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy new file mode 100755 index 00000000000..5bb7f3c39d0 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy @@ -0,0 +1,288 @@ +0.117614 0.576166 +0.119993 0.581164 +0.122674 0.586089 +0.125649 0.590936 +0.128908 0.595702 +0.132444 0.600382 +0.136246 0.604972 +0.140307 0.609469 +0.144618 0.613869 +0.149169 0.618167 +0.153953 0.622359 +0.15896 0.626442 +0.164182 0.630412 +0.16961 0.634264 +0.175235 0.637995 +0.181049 0.6416 +0.187042 0.645075 +0.193207 0.648417 +0.199533 0.651622 +0.206013 0.654685 +0.212638 0.657603 +0.219399 0.660371 +0.226287 0.662985 +0.233294 0.665442 +0.24041 0.667738 +0.247628 0.669868 +0.254937 0.671828 +0.262331 0.673616 +0.269799 0.675225 +0.277333 0.676653 +0.284925 0.677896 +0.292565 0.678949 +0.300245 0.679808 +0.307956 0.68047 +0.315696 0.680947 +0.323466 0.681251 +0.331264 0.681394 +0.339088 0.681388 +0.346937 0.681246 +0.35481 0.68098 +0.362707 0.680601 +0.370626 0.680124 +0.378565 0.679558 +0.386524 0.678918 +0.394502 0.678215 +0.402496 0.677461 +0.410508 0.676668 +0.418534 0.675849 +0.426574 0.675016 +0.434627 0.674181 +0.442692 0.673357 +0.450767 0.672555 +0.458851 0.671788 +0.466944 0.671068 +0.475044 0.670408 +0.48315 0.669819 +0.49126 0.669313 +0.499375 0.668904 +0.507491 0.668603 +0.515609 0.668423 +0.523728 0.668375 +0.531845 0.668472 +0.539961 0.668726 +0.548073 0.66915 +0.556181 0.669755 +0.564283 0.670555 +0.572369 0.671529 +0.580427 0.672659 +0.588447 0.673926 +0.596417 0.675311 +0.604327 0.676796 +0.612164 0.678361 +0.619919 0.679988 +0.627581 0.681657 +0.635137 0.683349 +0.642578 0.685046 +0.649892 0.68673 +0.657069 0.688379 +0.664096 0.689977 +0.670963 0.691504 +0.67766 0.692941 +0.684174 0.694269 +0.690496 0.69547 +0.696613 0.696523 +0.702516 0.697412 +0.708192 0.698115 +0.713632 0.698616 +0.718823 0.698894 +0.723755 0.69893 +0.728416 0.698707 +0.732797 0.698205 +0.736885 0.697404 +0.74067 0.696287 +0.744141 0.694834 +0.747286 0.693026 +0.750095 0.690845 +0.752557 0.688271 +0.75466 0.685285 +0.756424 0.681902 +0.757869 0.678134 +0.759015 0.673994 +0.759882 0.669497 +0.760489 0.664656 +0.760855 0.659484 +0.761001 0.653994 +0.760947 0.6482 +0.760711 0.642116 +0.760314 0.635754 +0.759776 0.629129 +0.759115 0.622253 +0.758353 0.615141 +0.757508 0.607805 +0.7566 0.600259 +0.75565 0.592516 +0.754676 0.584591 +0.753699 0.576495 +0.752738 0.568244 +0.751813 0.559849 +0.750943 0.551325 +0.750149 0.542685 +0.749449 0.533942 +0.748865 0.52511 +0.748415 0.516203 +0.748119 0.507233 +0.747997 0.498214 +0.748069 0.48916 +0.748354 0.480084 +0.748872 0.470999 +0.749642 0.46192 +0.750686 0.452858 +0.751974 0.443823 +0.753479 0.434822 +0.755172 0.425865 +0.757027 0.416958 +0.759016 0.408111 +0.761109 0.39933 +0.763281 0.390626 +0.765502 0.382005 +0.767745 0.373475 +0.769983 0.365046 +0.772187 0.356725 +0.774329 0.348521 +0.776382 0.34044 +0.778318 0.332493 +0.780108 0.324686 +0.781726 0.317029 +0.783144 0.309529 +0.784333 0.302194 +0.785265 0.295032 +0.785914 0.288053 +0.78625 0.281263 +0.786247 0.274671 +0.785876 0.268286 +0.785109 0.262115 +0.783919 0.256167 +0.782278 0.250449 +0.780159 0.244971 +0.777532 0.239739 +0.774371 0.234763 +0.770647 0.23005 +0.766333 0.225609 +0.761401 0.221447 +0.755874 0.217555 +0.749779 0.213923 +0.743138 0.210538 +0.735975 0.207392 +0.728316 0.204474 +0.720184 0.201773 +0.711603 0.199279 +0.702598 0.196981 +0.693193 0.19487 +0.683413 0.192935 +0.67328 0.191165 +0.662821 0.18955 +0.652058 0.188079 +0.641016 0.186743 +0.62972 0.18553 +0.618193 0.184431 +0.60646 0.183435 +0.594546 0.182532 +0.582473 0.18171 +0.570267 0.180961 +0.557951 0.180273 +0.545551 0.179635 +0.53309 0.179039 +0.520592 0.178472 +0.508082 0.177926 +0.495584 0.177388 +0.483121 0.17685 +0.47072 0.1763 +0.458402 0.175729 +0.446194 0.175125 +0.434119 0.174478 +0.422201 0.173779 +0.410446 0.173037 +0.398859 0.172265 +0.387448 0.171472 +0.376218 0.17067 +0.365173 0.16987 +0.354321 0.169082 +0.343667 0.168319 +0.333217 0.16759 +0.322977 0.166907 +0.312952 0.166281 +0.303149 0.165722 +0.293573 0.165242 +0.28423 0.164852 +0.275125 0.164562 +0.266266 0.164383 +0.257657 0.164328 +0.249304 0.164405 +0.241214 0.164628 +0.233392 0.165005 +0.225843 0.165549 +0.218575 0.166271 +0.211591 0.167181 +0.204899 0.16829 +0.198505 0.169609 +0.192413 0.17115 +0.18663 0.172923 +0.181162 0.174939 +0.176014 0.17721 +0.171193 0.179745 +0.166703 0.182557 +0.162552 0.185656 +0.158744 0.189053 +0.155266 0.192737 +0.152101 0.196696 +0.149236 0.200921 +0.146654 0.205398 +0.144342 0.210119 +0.142284 0.21507 +0.140466 0.220242 +0.138872 0.225622 +0.137487 0.2312 +0.136297 0.236965 +0.135287 0.242906 +0.134442 0.24901 +0.133747 0.255268 +0.133186 0.261668 +0.132746 0.268199 +0.132411 0.27485 +0.132166 0.28161 +0.131997 0.288467 +0.131887 0.29541 +0.131824 0.302428 +0.131791 0.309511 +0.131773 0.316646 +0.131757 0.323824 +0.131726 0.331031 +0.131666 0.338259 +0.131562 0.345494 +0.131399 0.352727 +0.131162 0.359946 +0.130837 0.36714 +0.130408 0.374298 +0.12986 0.381408 +0.129179 0.38846 +0.128378 0.395453 +0.127471 0.402386 +0.126473 0.40926 +0.125397 0.416075 +0.124256 0.422829 +0.123066 0.429522 +0.121839 0.436154 +0.120589 0.442726 +0.119332 0.449235 +0.118079 0.455683 +0.116846 0.462068 +0.115646 0.468391 +0.114493 0.474651 +0.113401 0.480847 +0.112384 0.48698 +0.111455 0.493049 +0.110629 0.499053 +0.10992 0.504993 +0.109341 0.510868 +0.108906 0.516677 +0.108629 0.522421 +0.108524 0.528098 +0.108605 0.533709 +0.108886 0.539254 +0.109381 0.544731 +0.110103 0.550141 +0.111067 0.555483 +0.112286 0.560757 +0.113774 0.565962 +0.115545 0.571099 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy new file mode 100755 index 00000000000..ee61170ab1b --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy @@ -0,0 +1,430 @@ +-0.00122166 -0.00773919 +0.0183746 0.00256813 +0.0257372 0.00893185 +0.0313877 0.00746208 +0.0402316 -0.00500961 +0.053375 -0.00536058 +0.0583786 0.00420576 +0.0666756 -0.00384259 +0.0767904 -0.00160924 +0.080896 0.00804865 +0.102811 -0.000804773 +0.100045 0.0114237 +0.0936988 0.0130573 +0.100168 0.0220594 +0.100379 0.0424473 +0.108123 0.0565801 +0.101391 0.0665227 +0.0921094 0.0633638 +0.102654 0.084326 +0.0945808 0.0863143 +0.108688 0.103644 +0.0981637 0.109591 +0.100887 0.128656 +0.095212 0.131452 +0.108508 0.149497 +0.0916187 0.155325 +0.107963 0.166861 +0.105509 0.176219 +0.0960659 0.174764 +0.0914405 0.190623 +0.0928504 0.194605 +0.0907416 0.208006 +0.0995773 0.223629 +0.0985995 0.23203 +0.107564 0.230937 +0.108538 0.249637 +0.103462 0.264162 +0.104897 0.27609 +0.106605 0.279925 +0.103956 0.294133 +0.104045 0.301213 +0.094297 0.315367 +0.0989206 0.314798 +0.0970699 0.321979 +0.0977609 0.331805 +0.0967513 0.356959 +0.0923615 0.364591 +0.103043 0.360892 +0.10186 0.383019 +0.0945277 0.383511 +0.0906269 0.403283 +0.104707 0.408077 +0.107607 0.412389 +0.101042 0.436739 +0.102723 0.441435 +0.0976382 0.455005 +0.105984 0.450792 +0.0921784 0.463431 +0.104911 0.480336 +0.107742 0.494669 +0.1059 0.507837 +0.100127 0.493978 +0.115167 0.508639 +0.131321 0.501357 +0.144884 0.499756 +0.149705 0.49338 +0.160131 0.501503 +0.177664 0.502911 +0.172299 0.499796 +0.187188 0.494765 +0.194559 0.502235 +0.204116 0.495498 +0.225035 0.491108 +0.221635 0.495403 +0.233281 0.50643 +0.24366 0.500873 +0.25572 0.502142 +0.268722 0.505225 +0.275647 0.50861 +0.294994 0.496143 +0.293419 0.504528 +0.307066 0.497833 +0.302486 0.471365 +0.30511 0.466037 +0.296839 0.453476 +0.297052 0.454022 +0.305558 0.436998 +0.29437 0.427669 +0.30003 0.410664 +0.292164 0.407791 +0.309504 0.401659 +0.294089 0.397803 +0.290587 0.389628 +0.302815 0.374862 +0.306305 0.351988 +0.296607 0.342618 +0.300362 0.343648 +0.302669 0.33369 +0.302228 0.324261 +0.30787 0.319981 +0.308656 0.29615 +0.297473 0.298987 +0.297284 0.286021 +0.302508 0.274198 +0.297926 0.253585 +0.306388 0.257729 +0.29718 0.240226 +0.291417 0.233297 +0.301991 0.220826 +0.295808 0.20768 +0.297772 0.191886 +0.311828 0.198778 +0.326733 0.199057 +0.335699 0.208398 +0.342018 0.197207 +0.359893 0.207891 +0.363299 0.206163 +0.37842 0.204762 +0.389431 0.195227 +0.395761 0.198392 +0.393806 0.199621 +0.400052 0.202976 +0.398032 0.221961 +0.391155 0.225816 +0.409545 0.241894 +0.40423 0.259094 +0.398803 0.267038 +0.409451 0.263238 +0.401676 0.288315 +0.408467 0.280029 +0.402643 0.292844 +0.408256 0.313541 +0.404447 0.317483 +0.392981 0.337074 +0.399816 0.336164 +0.394484 0.34418 +0.39088 0.36415 +0.39203 0.371914 +0.391907 0.372317 +0.401941 0.394448 +0.400987 0.394615 +0.417735 0.405143 +0.416278 0.401803 +0.421395 0.405243 +0.442464 0.404613 +0.446405 0.397278 +0.463014 0.39944 +0.473157 0.401332 +0.483901 0.399705 +0.497374 0.392277 +0.504382 0.406005 +0.51216 0.396118 +0.52048 0.398171 +0.524319 0.403554 +0.536782 0.402375 +0.545539 0.398904 +0.552183 0.396395 +0.569099 0.392493 +0.575202 0.406169 +0.592704 0.39466 +0.59449 0.396764 +0.608074 0.389467 +0.600166 0.370886 +0.597923 0.366287 +0.601587 0.358051 +0.600937 0.347348 +0.597195 0.347548 +0.605395 0.329387 +0.602064 0.328311 +0.59204 0.31753 +0.608754 0.308838 +0.606836 0.289521 +0.607122 0.280267 +0.604228 0.268436 +0.598703 0.255744 +0.601548 0.241982 +0.591276 0.249206 +0.595159 0.236543 +0.609262 0.226699 +0.599003 0.204057 +0.605558 0.193364 +0.596138 0.18989 +0.590449 0.189215 +0.603921 0.179793 +0.603214 0.15682 +0.603442 0.154098 +0.602044 0.134035 +0.593844 0.127262 +0.597918 0.114888 +0.602149 0.100883 +0.608039 0.0917652 +0.609219 0.0883285 +0.594468 0.0820023 +0.602469 0.0790759 +0.603586 0.0520185 +0.595973 0.0409149 +0.591989 0.0421134 +0.608567 0.0281289 +0.594461 0.0250548 +0.600593 0.0137657 +0.599639 0.00157628 +0.599895 -0.00585589 +0.609005 -0.0140797 +0.597701 -0.0362877 +0.604811 -0.0354598 +0.605016 -0.0516227 +0.602587 -0.0589084 +0.590137 -0.0645576 +0.593835 -0.0891583 +0.607939 -0.091738 +0.594551 -0.102387 +0.611534 -0.106239 +0.625184 -0.103605 +0.636941 -0.109081 +0.637672 -0.105261 +0.651393 -0.0916382 +0.655172 -0.103922 +0.675896 -0.100824 +0.680108 -0.101927 +0.692671 -0.0989151 +0.696164 -0.0908692 +0.698107 -0.0999176 +0.699853 -0.0837907 +0.691846 -0.0743095 +0.707274 -0.0529615 +0.702629 -0.0440761 +0.691692 -0.0401254 +0.691509 -0.0298807 +0.697568 -0.0160726 +0.693099 -0.0122629 +0.706651 0.00356731 +0.695429 0.0112607 +0.701771 0.0294537 +0.699069 0.0313291 +0.703952 0.0496973 +0.69614 0.0522159 +0.708468 0.0641917 +0.699825 0.0657888 +0.695468 0.0752284 +0.705016 0.092067 +0.700804 0.0975295 +0.690721 0.114507 +0.702671 0.120819 +0.70485 0.128139 +0.709694 0.148057 +0.702008 0.148686 +0.706089 0.162461 +0.69493 0.160769 +0.699519 0.186452 +0.690159 0.19336 +0.707262 0.205622 +0.718621 0.190568 +0.726335 0.20088 +0.731698 0.205912 +0.743185 0.201885 +0.753439 0.20819 +0.768572 0.20488 +0.779528 0.207082 +0.773272 0.208088 +0.793631 0.206596 +0.790237 0.207751 +0.801759 0.204492 +0.798805 0.227969 +0.795254 0.225817 +0.796624 0.24745 +0.80304 0.248654 +0.794884 0.256301 +0.793752 0.260228 +0.802505 0.285979 +0.80838 0.281491 +0.794885 0.305537 +0.804035 0.318303 +0.792846 0.327277 +0.809482 0.337347 +0.80741 0.334948 +0.793053 0.344887 +0.796001 0.357606 +0.793567 0.37651 +0.805741 0.382263 +0.794882 0.395962 +0.809418 0.408449 +0.794707 0.41122 +0.809794 0.417814 +0.808296 0.425908 +0.797844 0.441896 +0.797649 0.454191 +0.800572 0.461172 +0.806847 0.477273 +0.804025 0.478534 +0.794143 0.489622 +0.807117 0.50029 +0.801441 0.513039 +0.791911 0.527842 +0.791773 0.526715 +0.805963 0.533142 +0.795421 0.551382 +0.802361 0.561075 +0.795285 0.575691 +0.79309 0.571865 +0.792141 0.582944 +0.801339 0.606662 +0.800409 0.606302 +0.808378 0.629401 +0.795045 0.630595 +0.800627 0.648091 +0.800197 0.648853 +0.792557 0.668632 +0.800245 0.6717 +0.79102 0.684302 +0.803844 0.697712 +0.796665 0.694028 +0.811602 0.692884 +0.828034 0.692578 +0.838018 0.707326 +0.843995 0.705784 +0.858299 0.697298 +0.850106 0.693934 +0.870688 0.70074 +0.884555 0.696456 +0.884922 0.694385 +0.909299 0.701009 +0.897453 0.690613 +0.902015 0.670114 +0.904041 0.662144 +0.894504 0.668457 +0.890369 0.652726 +0.893162 0.64397 +0.901281 0.631899 +0.907147 0.625835 +0.909279 0.612008 +0.899858 0.592522 +0.902907 0.585558 +0.909383 0.572996 +0.895638 0.561044 +0.893485 0.554201 +0.895898 0.555388 +0.90481 0.537979 +0.908845 0.531096 +0.891901 0.520505 +0.890527 0.516273 +0.891665 0.497401 +0.915065 0.505611 +0.928901 0.50764 +0.93544 0.500482 +0.948531 0.499346 +0.958566 0.506247 +0.956153 0.490662 +0.975229 0.504936 +0.972534 0.508754 +0.985539 0.50138 +0.997672 0.500121 +0.990516 0.490971 +0.990056 0.475313 +0.990432 0.467124 +0.996754 0.461194 +1.00053 0.456609 +0.99993 0.443855 +0.994772 0.430845 +0.995444 0.415335 +1.00819 0.401313 +1.00914 0.407238 +1.0085 0.387177 +1.00648 0.384405 +1.00765 0.363267 +1.00105 0.36174 +1.00379 0.356538 +0.997746 0.337323 +0.994447 0.329128 +0.996059 0.324951 +0.9914 0.316145 +1.00923 0.299199 +0.998003 0.296301 +1.00485 0.276163 +0.999457 0.26353 +1.00249 0.262979 +1.00675 0.2577 +0.994071 0.239261 +1.00483 0.222556 +1.00256 0.223583 +1.00569 0.209015 +1.00454 0.208112 +0.996931 0.191932 +0.992461 0.174545 +1.00648 0.178477 +1.00196 0.154454 +0.994058 0.156229 +1.00012 0.147162 +0.990015 0.139125 +1.0001 0.118295 +0.99221 0.119393 +0.997846 0.0921192 +1.01149 0.0935713 +1.01652 0.100792 +1.03643 0.0907672 +1.03424 0.103647 +1.04798 0.0912647 +1.06076 0.0996512 +1.0746 0.103602 +1.0787 0.106149 +1.09854 0.10826 +1.09504 0.107013 +1.09384 0.0860707 +1.09834 0.0833482 +1.10677 0.0794806 +1.10749 0.069845 +1.09925 0.0447871 +1.10746 0.0499304 +1.09588 0.0334837 +1.09782 0.0128309 +1.09528 0.000820948 +1.1095 0.00567797 +1.10628 -0.000269173 +1.09555 -0.0162337 +1.10959 -0.0217853 +1.09146 -0.0478845 +1.10567 -0.0416535 +1.09068 -0.0585604 +1.09931 -0.0750066 +1.09092 -0.0883508 +1.10159 -0.0976098 +1.09694 -0.0939674 +1.10991 -0.10331 +1.11541 -0.0907923 +1.12653 -0.0973824 +1.14744 -0.107995 +1.15653 -0.107649 +1.15443 -0.10362 +1.16549 -0.0952522 +1.18291 -0.096512 +1.19779 -0.106942 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy new file mode 100755 index 00000000000..3d6f2434d85 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy @@ -0,0 +1,160 @@ +0.00605396 0.00360027 +0.0117095 0.00496933 +0.00292489 -0.0056444 +0.018654 -0.00345866 +0.0208731 -0.00712699 +0.0349622 0.00520127 +0.0226514 0.00273598 +0.0443469 0.00641652 +0.0320264 -0.00785089 +0.0536853 -0.00492172 +0.0477706 0.00445479 +0.0639807 0.00509629 +0.0673864 -0.000544755 +0.068878 0.00636891 +0.0786834 -0.00880306 +0.0838299 0.00977294 +0.087326 -0.0021897 +0.079062 0.000772423 +0.0984893 0.00905454 +0.0994487 -0.00770074 +0.100736 0.00717826 +0.0994229 0.00250389 +0.100252 0.0167278 +0.0960604 0.00802011 +0.103545 0.0289233 +0.108446 0.0183656 +0.106763 0.0262313 +0.106452 0.0420934 +0.0997256 0.0427598 +0.107064 0.0403298 +0.0928101 0.0560955 +0.10136 0.0583232 +0.104819 0.0562105 +0.0902899 0.0706163 +0.10994 0.0770702 +0.0923621 0.0704878 +0.0919434 0.0865538 +0.0963674 0.0842679 +0.103725 0.0803259 +0.102273 0.101166 +0.100319 0.0952791 +0.108403 0.0942299 +0.113529 0.0981625 +0.108027 0.103066 +0.126272 0.0950435 +0.133506 0.0939314 +0.124776 0.107205 +0.131076 0.107853 +0.136759 0.109119 +0.15444 0.102357 +0.143707 0.104111 +0.160272 0.0974776 +0.165379 0.103348 +0.173751 0.0916309 +0.174657 0.0937715 +0.167267 0.0980068 +0.170889 0.0905988 +0.185414 0.102092 +0.189813 0.10002 +0.199397 0.0909473 +0.198222 0.107717 +0.198974 0.099872 +0.201479 0.108827 +0.205074 0.107075 +0.202 0.124977 +0.191185 0.121976 +0.206848 0.134009 +0.196679 0.137767 +0.19255 0.148035 +0.190151 0.143856 +0.195263 0.155428 +0.20595 0.148822 +0.204421 0.152387 +0.191967 0.169495 +0.197981 0.169699 +0.191872 0.176798 +0.207398 0.170317 +0.194859 0.178978 +0.190444 0.183389 +0.196073 0.192833 +0.200019 0.190352 +0.205824 0.198579 +0.217043 0.198723 +0.210708 0.208976 +0.225591 0.209213 +0.224774 0.208331 +0.228376 0.201784 +0.233852 0.192014 +0.230703 0.196273 +0.241172 0.192107 +0.241027 0.203219 +0.257393 0.199803 +0.266244 0.190504 +0.263176 0.1902 +0.279822 0.191442 +0.267419 0.200092 +0.270919 0.209937 +0.294279 0.199399 +0.292596 0.208336 +0.302111 0.206854 +0.297261 0.193606 +0.302447 0.195568 +0.307461 0.217454 +0.302133 0.219113 +0.300152 0.216012 +0.296763 0.223723 +0.302571 0.234727 +0.298522 0.237272 +0.307834 0.234066 +0.296568 0.250613 +0.298385 0.251664 +0.29308 0.261943 +0.295426 0.266549 +0.293096 0.259791 +0.292439 0.271056 +0.291263 0.275271 +0.300944 0.286063 +0.308624 0.284206 +0.306603 0.285177 +0.302574 0.289769 +0.303807 0.303483 +0.308102 0.301263 +0.316854 0.306492 +0.313448 0.299638 +0.325862 0.304911 +0.328301 0.305416 +0.335535 0.300855 +0.327652 0.299601 +0.334895 0.301131 +0.339451 0.303238 +0.356128 0.293215 +0.359167 0.306227 +0.350648 0.309557 +0.359385 0.291005 +0.360515 0.305818 +0.377582 0.301763 +0.373333 0.308693 +0.375172 0.299768 +0.398744 0.298911 +0.390985 0.295462 +0.39465 0.305079 +0.397266 0.302934 +0.391293 0.303944 +0.401355 0.307406 +0.391301 0.312749 +0.401141 0.331346 +0.403843 0.339273 +0.397447 0.32984 +0.401007 0.345187 +0.401435 0.350856 +0.404534 0.358367 +0.40019 0.350997 +0.401021 0.359769 +0.398586 0.362409 +0.403735 0.370503 +0.400571 0.381428 +0.409145 0.374727 +0.402981 0.379619 +0.406312 0.38398 +0.405032 0.387826 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h new file mode 100644 index 00000000000..e0640378d2e --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h @@ -0,0 +1,69 @@ +#ifndef DIAL_OPT_H_ +#define DIAL_OPT_H_ + +#include "ui_options.h" + +class Dialog_options : public QDialog, private Ui::Dialog_options +{ + Q_OBJECT + +public: + Dialog_options(QWidget *parent = 0) + { + setupUi(this); + } + + void set_all_ranges() + { + verbose_spinbox->setRange(0, 2); + mchoice_spinbox->setRange(0, 500); + percent_spinbox->setRange(0, 100); + norm_tol_spinbox->setRange(0., 500.); + tang_tol_spinbox->setRange(0., 500.); + alpha_spinbox->setRange(0., 100.); + relocation_spinbox->setRange(0, 50); + ghost_spinbox->setRange(0., 100000.); + } + + int get_verbose() const { return verbose_spinbox->value(); } + void set_verbose(int verbose) { verbose_spinbox->setValue(verbose); } + + int get_mchoice() const { return mchoice_spinbox->value(); } + void set_mchoice(const int mchoice) { mchoice_spinbox->setValue(mchoice); } + + double get_percent() const { return percent_spinbox->value(); } + void set_percent(const double percent) { percent_spinbox->setValue(percent); } + + double get_norm_tol() const { return norm_tol_spinbox->value(); } + void set_norm_tol(const double tol) { norm_tol_spinbox->setValue(tol); } + + double get_tang_tol() const { return tang_tol_spinbox->value(); } + void set_tang_tol(const double tol) { tang_tol_spinbox->setValue(tol); } + + double get_alpha() const { return alpha_spinbox->value(); } + void set_alpha(const double alpha) { alpha_spinbox->setValue(alpha); } + + int get_relocation() const { return relocation_spinbox->value(); } + void set_relocation(const int value) { + return relocation_spinbox->setValue(value); + } + + double get_ghost() const { return ghost_spinbox->value(); } + void set_ghost(double ghost) { ghost_spinbox->setValue(ghost); } + + bool get_use_flip() const { return use_flip_checkbox->isChecked(); } + void set_use_flip(const bool flip) { + return use_flip_checkbox->setChecked(flip); + } + + double get_line_thickness() const { return thickness_spinbox->value(); } + void set_line_thickness(const double t) { thickness_spinbox->setValue(t); } + + double get_point_size() const { return point_size_spinbox->value(); } + void set_point_size(const double t) { point_size_spinbox->setValue(t); } + + double get_vertex_size() const { return vertex_size_spinbox->value(); } + void set_vertex_size(const double t) { vertex_size_spinbox->setValue(t); } +}; + +#endif diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp new file mode 100644 index 00000000000..498667fa1eb --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp @@ -0,0 +1,189 @@ +// Qt +#include + +// local +#include "glviewer.h" + +GlViewer::GlViewer(QWidget *pParent) +: QGLWidget(QGLFormat(QGL::SampleBuffers), pParent) +{ + m_scene = NULL; + + m_view_points = true; + m_view_vertices = true; + m_view_edges = false; + m_view_ghost_edges = false; + m_view_edge_cost = false; + m_view_edge_priority = false; + m_view_bins = false; + m_view_foot_points = false; + m_view_relocation = false; + m_view_tolerance = false; + m_view_incolors = false; + m_view_edge_relevance = true; + + m_insert_points = false; + m_activate_simulation = 0; + m_simulation_stage = 0; + + m_line_thickness = 2.0; + m_point_size = 2.0; + m_vertex_size = 2.0; + + m_scale = 1.0; + m_center_x = m_center_y = 0.5; + + setAutoFillBackground(false); +} + +void GlViewer::resizeGL(int width, int height) +{ + glViewport(0, 0, width, height); + double aspect_ratio = double(height) / double(width); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-1.0, 1.0, -aspect_ratio, aspect_ratio, -1.0, 1.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +void GlViewer::initializeGL() +{ + glClearColor(1., 1., 1., 0.); + glDisable(GL_DEPTH_TEST); + glEnable(GL_SMOOTH); +} + +void GlViewer::paintGL() +{ + glClear(GL_COLOR_BUFFER_BIT); + if (!m_scene) return; + + glPushMatrix(); + glScaled(m_scale, m_scale, m_scale); + glTranslated(-m_center_x, -m_center_y, 0.0); + + m_scene->render(m_view_points, + m_view_vertices, + m_view_edges, + m_view_ghost_edges, + m_view_edge_cost, + m_view_edge_priority, + m_view_bins, + m_view_foot_points, + m_view_relocation, + m_view_tolerance, + m_view_incolors, + m_view_edge_relevance, + float(m_point_size), + float(m_vertex_size), + float(m_line_thickness)); + + if (m_activate_simulation == 2) + m_scene->render_simulation(m_mouse_pick, + m_simulation_stage, + float(2*m_vertex_size), + float(m_line_thickness)); + + glPopMatrix(); +} + +void GlViewer::wheelEvent(QWheelEvent *event) +{ + if (!m_scene) return; + m_scale += 0.05 * (event->delta() / 120); + if (m_scale <= 0.0) m_scale = 0.0; + updateGL(); +} + +void GlViewer::mousePressEvent(QMouseEvent *event) +{ + if (!m_scene) return; + m_mouse_click = event->pos(); + + if (event->button() == Qt::LeftButton) + { + if (m_activate_simulation != 0) m_activate_simulation = 1; + setCursor(QCursor(Qt::PointingHandCursor)); + sample_mouse_path(m_mouse_click); + } + else + { + setCursor(QCursor(Qt::ClosedHandCursor)); + } +} + +void GlViewer::mouseMoveEvent(QMouseEvent *event) +{ + if(!m_scene) return; + m_mouse_move = event->pos(); + + if (event->buttons() == Qt::LeftButton) + { + if (m_mouse_move != m_mouse_click) + sample_mouse_path(m_mouse_move); + } + else + { + move_camera(m_mouse_click, m_mouse_move); + } + + m_mouse_click = m_mouse_move; + updateGL(); +} + +void GlViewer::mouseReleaseEvent(QMouseEvent *event) +{ + if (!m_scene) return; + m_mouse_move = event->pos(); + + if (event->button() == Qt::LeftButton) + { + if (m_mouse_move != m_mouse_click) + sample_mouse_path(m_mouse_move); + } + else + { + move_camera(m_mouse_click, m_mouse_move); + } + + m_mouse_click = m_mouse_move; + setCursor(QCursor(Qt::ArrowCursor)); + updateGL(); +} + +void GlViewer::sample_mouse_path(const QPoint& point) +{ + double x, y; + convert_to_world_space(point, x, y); + + if (m_insert_points) + m_scene->add_sample(Point(x, y)); + + if (m_activate_simulation == 1) + { + m_activate_simulation = 2; + m_mouse_pick = Point(x, y); + } +} + +void GlViewer::move_camera(const QPoint& p0, const QPoint& p1) +{ + m_center_x -= double(p1.x() - p0.x()) / double(width()); + m_center_y += double(p1.y() - p0.y()) / double(height()); +} + +void GlViewer::convert_to_world_space(const QPoint& point, double &x, double &y) +{ + double aspect_ratio = double(height()) / double(width()); + + x = double(point.x()) / double(width()); + x = (2.0*x - 1.0) / m_scale; + x += m_center_x; + + y = 1.0 - double(point.y()) / double(height()); + y = (2.0*y - 1.0) * aspect_ratio / m_scale; + y += m_center_y; +} diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h new file mode 100644 index 00000000000..795026735e1 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h @@ -0,0 +1,130 @@ +#ifndef GLWIDGET_H +#define GLWIDGET_H + +// Qt +#include +#include + +// local +#include "scene.h" + +class GlViewer : public QGLWidget +{ + Q_OBJECT + +private: + typedef Scene::Point Point; + Scene* m_scene; + + // toggles + bool m_view_points; + bool m_view_vertices; + bool m_view_edges; + bool m_view_ghost_edges; + bool m_view_edge_cost; + bool m_view_edge_priority; + bool m_view_bins; + bool m_view_foot_points; + bool m_view_relocation; + bool m_view_tolerance; + bool m_view_incolors; + bool m_view_edge_relevance; + + // interactive modes + bool m_insert_points; + int m_activate_simulation; + int m_simulation_stage; + + // rendering options + double m_line_thickness; + double m_point_size; + double m_vertex_size; + + // camera + double m_scale; + double m_center_x, m_center_y; + + // mouse + QPoint m_mouse_click; + QPoint m_mouse_move; + Point m_mouse_pick; + +public: + GlViewer(QWidget *parent); + + void set_scene(Scene* pScene) { m_scene = pScene; } + + void set_camera(const double x, const double y, const double s) + { + m_center_x = x; + m_center_y = y; + m_scale = s; + } + + // options + double& line_thickness() { return m_line_thickness; } + const double& line_thickness() const { return m_line_thickness; } + + double& point_size() { return m_point_size; } + const double& point_size() const { return m_point_size; } + + double& vertex_size() { return m_vertex_size; } + const double& vertex_size() const { return m_vertex_size; } + + // toggles + void toggle_view_points() { m_view_points = !m_view_points; } + + void toggle_view_vertices() { m_view_vertices = !m_view_vertices; } + + void toggle_view_edges() { m_view_edges = !m_view_edges; } + + void toggle_view_ghost_edges() { m_view_ghost_edges = !m_view_ghost_edges; } + + void toggle_view_edge_cost() { m_view_edge_cost = !m_view_edge_cost; } + + void toggle_view_edge_priority() { + m_view_edge_priority = !m_view_edge_priority; + } + + void toggle_view_bins () { m_view_bins = !m_view_bins; } + + void toggle_view_foot_points() { m_view_foot_points = !m_view_foot_points; } + + void toggle_view_relocation() { m_view_relocation = !m_view_relocation; } + + void toggle_view_tolerance() { m_view_tolerance = !m_view_tolerance; } + + void toggle_view_incolors() { m_view_incolors = !m_view_incolors; } + + void toggle_view_edge_relevance() { + m_view_edge_relevance = !m_view_edge_relevance; + } + + void toggle_insert_points() { m_insert_points = !m_insert_points; } + + void toggle_activate_simulation() { + m_activate_simulation = (m_activate_simulation == 0); + } + + void toggle_simulation_stage() { + m_simulation_stage = (m_simulation_stage+1)%7; + } + +protected: + // GL + void paintGL(); + void initializeGL(); + void resizeGL(int width, int height); + + // mouse + void wheelEvent(QWheelEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + + void sample_mouse_path(const QPoint& point); + void move_camera(const QPoint& p0, const QPoint& p1); + void convert_to_world_space(const QPoint& point, double &x, double &y); +}; + +#endif diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/Voronoi_diagram_2.png b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/Voronoi_diagram_2.png new file mode 100644 index 0000000000000000000000000000000000000000..62437e6bfc9600f5cb7d68d911ac76502edb2221 GIT binary patch literal 3093 zcmXZe2{=^U8vyV-Mhud%j_lL&eIz7FVZtR+NJzGru_TdQjD0WZ`=}`Uk`}U;>@n1* zvZSmfq%>p85@X-~_gw$qGxy$S?sM-sbIzRiJ#U<`ksddv2qy$V-1=v9OpvP?a+u=T zkn@GD4OQgAW`9mkXB)*~u{?;};qW|T=>tJ~-hu;@EW1Y(+`Qqb<&0d>_aT1k)i4O+ z%F)-+G7A`(zHEKwq835I!*aN*%%rEQf<~yLPBEhP3A*qKaGIpuzRG(+iftf@5NM1S z9P2HHUS}k#cjBry1?j&7C_BaUfa~d znPG!bU;O+56_3I`$-_F5%vD_zt!>_@3(pBn< zmBMflleo_WI+kcGPJBc?h1a_GFTROS636p=zfRd(b~s0sg>;~_VSFAqs(BjNrD+9- z&^FhXXTLY{%ps?+?X6Ub^)17C^3VxcfGY;_M0@dI5iV30VB~7w+#{~aO7;LcTm3x& z2*(9D!1T?G$M!$87NZB7OhNz>QSwyq%G?hu(FgT={VQMz2L=H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!~C6$<=Z7!JfwD*Cq zBMB)Anxfbt-^t`njS`V3riqNIs(Lddt7%)#L{pe+~9B&nO%t1v_0snhmj(;drwH zLJ~i+l~o1uOQ73e2cHjBL&emoTq8dsXZ4Pd&@q`9@u%T&ACUg2^S?MGYRS4mEp5B+ z^XGRNz0OIGE1%jKnpMV-%-(=H&k)O*O|4goS0YEdZA!6|E%x^{riHsZ#;+N{d&Ew7 zj?ggh`0hJ@)P+ALcT3%Jx;HAZdhCtO+PvbKqUS(!v^c{)YJ-xnwwVO9D@uhcGR%Y1TW zO1b8{AFgISD^0VrxT?&U)HpmSwU!eI&oqn$-bCsYp)W@XZDP?36Yzm6wblEJKc!BR-sN82lA zQ26HYox1=pJZ^R1GrO`7Qu;;iRAiYP_vIJy%}HEvj+N9}RxpwE`L0K^9|+*9y0jfG z;u^%*#lh1`*q5%4-3b9nc>KYD+XXRF|II4DDR%o5eZ3LS`;KGVxbf(1sOADOELP}Q R9a1_&`lpR_N?>y2{{SxM_d@^x literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileNew.png b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileNew.png new file mode 100644 index 0000000000000000000000000000000000000000..af5d1221412881e8727fe26930e5d0b5b0633aae GIT binary patch literal 768 zcmV+b1ONPqP)R27cmB`+Wkx8a_@65j^u^siVQp>_ zPwn8;)Y0kK7)l|lBE%wFmC-v$eL~)Yfy# z^Ob>gz1owlwa4nuL@ZOXxYpY|_=&3meg}r2l-hGYxpQ6xt+akF&AwE-Rj{%5WonE%=bMnbMjE6fFxi8F4En`*+~J=7Qars`&=Io zhuwOigX}AaoB2WbpNI;Z{V^LaLk(JDtl#%qy z0f>Sm3j{{aCY8&CEXN`MM|ZE8%R+uhohP>-UnM8m)ey5NDv83-9qxc}B#Vq3KoHKA zr9$dh3?K|tQxUGnzF?FXfupNPBJcqpK@|`Kj_Uz9$Li`v=>Q=x&=v?xE!YNlY%Pp2 z`(c97k@x;0y2r zSkx79I6z~aP_V?vz+;97?mOd?a$#bTcUmw3OasdW&9Ju0FEPu=Z0000NkluMLp6h%0z3=<;A2g_#%st8T@8|R6`^WPY zN+~|cy!}H_Tu~a@KD%tm_m%7DBeBj`kG8vQU){vgw8h}2SJgOx_Wy$a@FNi_DPZfe z`nBJwsC#Z*QE@GJoQ`tuDa(UlIM}E5i50 zBA$rOU%pfGhYOm1CieM!Vph$nt*?~TY^loi`LXV`5}%pm#t@`))-rF!=crz=2waH* z;&%?&t(Tk+00|(JQV1c$vDa8QD>{33#j+hQ&7QY9D6ARciDBIrh-i^WiBC;mWoDv} z!6`vsx{B(RFHl;wgmA7OUDr{{iz~czzq@99`0t%p{lXW}qVfl#^_OC$#}{5(QTOzo zk_Fo%L2DS5x`{{AAP_~_I{M52cSceSW=aW^ZDx7>212EvwFb$?inmyRDnA3U(o1R+5=&d7U!}&E2ZTB0{=@8pPcNL+3uBftDi44tm{OIN(koEl8E)va^lqVyXUj5-2)s2 zuHBC#0hkYqo2M57N?UsXwh`2YX_07*qo IM6N<$f-Pt`I{*Lx literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileSave.png b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fileSave.png new file mode 100644 index 0000000000000000000000000000000000000000..8feec99bee8685290ec292e7baeb2e23ba4bdf0c GIT binary patch literal 1205 zcmV;m1WNmfP)NMq!WhGU zDb0?ir%%5E<_$1MjY0D7B#lW{;<)?El`Cg|1R~9@%$x6h^uLpO_>ug@xmmgJ*No_P znnEHG0)+hmDMa6YiFRG4o_LlgUp&G194;$ z#|Q7e%Hu~Tky2s+BT^*7)&c<-q*B=0DRAb}Cf_b=^dCQH;0Q1UG+z@p-S0s>z(fLJdaXofa#Y{a{XE!DHR|93_w4?hG<8kq+lom3=aj}y`daH}yY*TMGX*PU}a?k^Z$mMe=dBBKr3MP(B@#**TcTpzBa|A=h93v%QS-kjptJB{4u^z@&y0LCI4T6TSa45CS|$;yRAqEsIM__GKF%A16&yfb3{?Ev3O= zWp`NK(`0awX_vDHsHDgM8ZYP2344@ECC0|a7#$t8fc=zn6g_`~Gzu^#jRElxKudw6 z9$4;tmaREZLZad}%d_8@%6e3-*Khp}bb(|KKnidjfs}wT93TtVTG{6kY+YmJ^6l=8 z>lZ#>U;q0&umyDY?jo%iDv^z46gTJE4_y{w-(;l(uB)>!J7T{u)|M^Y%M$(Q0;0yWQjJ)lC|WuBldAVWm>@ zYqi>@@7LCS|K4h~T3%gTynM%)v;o`!%0SCx>I0b8{Dmvcx$`r{^6IAfuzWTu7V=>n zht*cAvEloba;37qRxV#(t5)yUfG*GhflRd$wsDcfR`M{f{>xbi>|uW%=st z#`gB=U1QP^==3?TwFS`Yb4+F%ysJLI!or#FfIoo|Kmay)=NJKTf0)V094!6;(N7PE TmU#bB00000NkvXXu0mjf&~!wG literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fit-page-32.png b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/fit-page-32.png new file mode 100644 index 0000000000000000000000000000000000000000..98bc12d3ed62cb77729ba88caff73e6a356cc540 GIT binary patch literal 1330 zcmV-21IF@x9@EKIX4D0x-=2@ zTo3R(kC-Hc6mzbeQ+xEi+S$PQz#8!42V=*tfXIR(26*lHK|D_SVtksFU$(Pr0{^AVAuPxx} zbOQ0jF81<84cM!QyR@Fht#}ew=-k(r@8a`|ckt2PR%i!r5kXwSyq822Z|JU#IYEaf&4s>R;fS6D3PBU>VQry z4PkA6B?ZLFP;U!#GUSFz)&~RQ!3ad?a91M$nWW_va8(GT<fI|6#5JwVt7}N(%nr`BzW$V|1t!g`$faa~mx6ayz@c zjpS|)2Rj?^=BWYp5_rvLAER0l>cApcLNK2?wjW0iw(>Z>wu_R>i%29NA(JbR+hcfX zv{!n^ReeMn=Yq%8OEC*I2~Q0%GSJR$E|fg%WbzC~Lv%DpaDej0G$2c{;=tY23lVRw z+6NAHH6Z<{0Gr$#BE;sHhgdiQK!67zYLLQc`6c=8ncOFlq8ML=ODplOq;-FM=v9yt)CX^CqeE=F_xVMR>ekJxPP^GR?hDv6^ZT;uU3Tk#9S`vr5R8dmzI3JZ z2j!EAl21196h*LE>NLwtbL2a%(4IQsu+a&kgxi{8V>V|t_m5tSit{fL z*9s_VYM6E`xFUA)+l$1v4E5b7){5Dg%;dc+u{1V++RU=us%-~~o-Po3`F+poI8Mbq z0u$S(-d(Z(oY&@iroYxLKTy&mwfS)T$KN`u^R@3TUlpa}W!|~@p47(MvJ3k)w#rnzS(!?*Wal5cv}`8IV)x3+U--pb21 zh_HRxEPo_&qt4>e%)iUCt%9Ym8MYZ5>gX*!DI@mfbbFERvSkhZ*Gra}ttqvO&v-Wf z>BgqZWoIRsq_n5kZ~u4K_C!eanOiGk>M#Gk+P9{hM?O-+?sRhO(({+USJ{=ljfl

LQG!4D3T)BC)qx5E}{N$IF z+x=(S+&5*Pcco-mS&FTC*-^=hKl?0-r(O(E`+e%O%^|OX*j2xIKdf119ICAS^vrwV z%Uab(YC>LS$OZm(4UE1zr^@2-98esAF4L3TbyYxt-bi`Usa{uTWd2X{Slt%uGnIH;QbfvpOSxb(melZ zu8>XI_GMm&&5HM~w`&jIKA`y^$Vz;l?b<&QJ8mxd>a%%wvFwgR+w&vtFz0ohnBz7p z>wW?A4W%@Twb6I5=l)B}@NG?#e*UI?is#mpNAo;Op2c(RKX1p%2gOH@ z+|5jy<$Axg!n>xWlF8`AUPA~9Zw5DlWM-L+hu$W-*boFyt=akR{ E0M>H=ssI20 literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/snapshot.png b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/snapshot.png new file mode 100644 index 0000000000000000000000000000000000000000..9b5b9efe7224136bfd6d9d0023df577b3927c570 GIT binary patch literal 9179 zcmV<1BP863P)00009a7bBm000XU z000XU0RWnu7ytkO1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)*q-@0IK+z7ytrrX$3g|f-p=sh5tWSBFwfEV!Xj^3vKD3iX}|~WF0Bz1V+5! zo2#{~$mm9FHLy=O<#xRge^uevs=oa?j<%eUgjeEnyOn4ff(fhyM{A5fqeO*O1d_u| ls@%hz3*KsAlOK-&0|1AFDwkRCW)%Pc002ovPDHLkV1o3lD2@OC literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/triangulation.png b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/icons/triangulation.png new file mode 100644 index 0000000000000000000000000000000000000000..ce082a6e08fbd3afdf8d463ae8eee02d35ccf99a GIT binary patch literal 7547 zcmV->9fabEP)fQi=HSuO9k zzmEXMn4!QtYi&|*Zvyj; zF;^L5hW9mHO@lFJ6X0s(A-tZE?eMXWL`{T5(_+pd^NXNYp1q~&Z=OHIRf}8BISd;^#20> z4jhRHg?_bjyR~-TmJ(#G?NFsP63YcR6b z*Yv#td^k~W0Ps&$XLL*H>gyMtxcL#l>nShtMRk5tqD>dD7jO~qTn;lV0B#0O0M=^r zeeDQ5o1o`LV2zCWUsd&f@$bX{x2PL`K%M^>n63VQFbBuxz?r~3Zp27qh8{%L_&Ts{ z3-6}`I17i-9%Y@eJU;O#hH(0jH_|rvYEq%n^ulScR!##fI)@ zZQ!m%KaT*L2e$vAYWK}|Gy?z|D2}(l!S3ty{|`r$GtaBCLreBiW~#WU&Qt*$Nbjla zB4A(%9P1-XMGL&v6l3-~25`gVpVWi8(v|;Am3_#S9j?lr1-feVTYIVijs<@280rS# zlfX|BIA#JLuSnzd3eV@>sSI$2y2+P-RbBZ+RlcDsGst@1mw%}t8ioO%q1;sQE25Q& z{?*6rzj$r^`OGGi_zqY;9wW;dn2dVPiRrxGnXu~w=sX|XVWsaqY z%u@S>0rxAsl}3_&$pFZl{)oD{A0@8OaOHDS+Un8ado8AOG{sXz^0=hI{ts1n?|dgQ z!1vURJ(c*%yWEIifyYwXZcZd1Ed-x8e?`P zviC0sj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yOwq zBhA>IPWRgSwn(hUUq7t9@ z*P)SsgfpTUy|*5OFvOFL?88Bfaak32R%Q;3ZhZG-K~Qkfd#4J|eOEOiP&ao@UAkL8 zKB;rL4(uNfo-Z!a8dh$m(8|dpvvTwK8|0&>3eSdBqA-o^6W>HPf}{RD7wt94&g87& zZW^7!obKXC;X9*G^4lMBByC_s={qxCY+n(0I+Z8XAXn3K#+MDFGUd{h*rqnN7=3jZ z_x+^EV?twC0dt6@rYVVWL1VpevxXhb6s!F$e%4wl5pT!V{^}Qj^y@SO_zUi=6%Rb0mM%nd4^0yyvhf4qeLr*J*z23q>OfLlP z#FqxP#*SAF24AseiYA(0iF_L5tt?? zJYsXQ2`h1`uC-HWS20rV5gCyL>PQL6Q50=R>0#swskbwH3_+t{xR>k+g1( z6p`_S>KUmC?F6;}Z+{(GkMn`m0R7Gts4++1#x$YRp=%JYTAHx7Raiq4f>SZ!3E9lB z*d}CuXk3Ny2n@h;8by{U7U42VUD?7X)$*R#@G5F~mCfUDysKY=IMz4((~%!Nc+;%A ms(`TYR>Y3)J|2p1hw>Myq?`jdXeaq8mpTtGWp41wSzh(O&nZquDY3)yx%awMg$7n`F`bAF0tcGF4330@ zU3>!iSM`;I{Qveknw`G_qI&}i$dw5Pg+N3Tt2dAc aohQ6=onNDnU8fn)&kUZfelF{r5}E*{sE3^Z literal 0 HcmV?d00001 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp new file mode 100644 index 00000000000..370e19a48eb --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp @@ -0,0 +1,12 @@ +#include +#include "window.h" + +int main(int argv, char **args) +{ + srand(1); + QApplication app(argv, args); + app.setApplicationName("Reconstruction_simplification_2 Demo"); + MainWindow window; + window.show(); + return app.exec(); +} diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx new file mode 100644 index 00000000000..dc69376b0c1 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx @@ -0,0 +1,84 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'dialog_options.h' +** +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "dialog_options.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'dialog_options.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.6. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_Dialog_options[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +static const char qt_meta_stringdata_Dialog_options[] = { + "Dialog_options\0" +}; + +void Dialog_options::qt_static_metacall(QObject *_o, + QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +const QMetaObjectExtraData Dialog_options::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject Dialog_options::staticMetaObject = { + { &QDialog::staticMetaObject, qt_meta_stringdata_Dialog_options, + qt_meta_data_Dialog_options, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &Dialog_options::getStaticMetaObject() { + return staticMetaObject; +} +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *Dialog_options::metaObject() const +{ + return QObject::d_ptr->metaObject ? + QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *Dialog_options::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_Dialog_options)) + return static_cast(const_cast< Dialog_options*>(this)); + return QDialog::qt_metacast(_clname); +} + +int Dialog_options::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx new file mode 100644 index 00000000000..d887fb71e79 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx @@ -0,0 +1,81 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'glviewer.h' +** +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "glviewer.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'glviewer.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.6. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_GlViewer[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +static const char qt_meta_stringdata_GlViewer[] = { + "GlViewer\0" +}; + +void GlViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); +} + +const QMetaObjectExtraData GlViewer::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject GlViewer::staticMetaObject = { + { &QGLWidget::staticMetaObject, qt_meta_stringdata_GlViewer, + qt_meta_data_GlViewer, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &GlViewer::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *GlViewer::metaObject() const +{ + return QObject::d_ptr->metaObject ? + QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *GlViewer::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_GlViewer)) + return static_cast(const_cast< GlViewer*>(this)); + return QGLWidget::qt_metacast(_clname); +} + +int GlViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QGLWidget::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + return _id; +} +QT_END_MOC_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx new file mode 100644 index 00000000000..61baf5cf9d0 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx @@ -0,0 +1,290 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'window.h' +** +** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include "window.h" +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'window.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 63 +#error "This file was generated using the moc from 4.8.6. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +static const uint qt_meta_data_MainWindow[] = { + + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 64, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount + + // signals: signature, parameters, type, tag, flags + 21, 12, 11, 11, 0x05, + + // slots: signature, parameters, type, tag, flags + 51, 45, 11, 11, 0x09, + 74, 45, 11, 11, 0x09, + 99, 45, 11, 11, 0x09, + 132, 11, 11, 11, 0x09, + 153, 11, 11, 11, 0x09, + 188, 179, 11, 11, 0x09, + 232, 214, 11, 11, 0x09, + 269, 264, 11, 11, 0x29, + 297, 11, 292, 11, 0x09, + 327, 322, 11, 11, 0x09, + 341, 322, 11, 11, 0x09, + 355, 11, 11, 11, 0x0a, + 364, 11, 11, 11, 0x0a, + 394, 11, 11, 11, 0x0a, + 421, 11, 11, 11, 0x0a, + 453, 11, 11, 11, 0x0a, + 479, 11, 11, 11, 0x0a, + 510, 11, 11, 11, 0x0a, + 540, 11, 11, 11, 0x0a, + 573, 11, 11, 11, 0x0a, + 605, 11, 11, 11, 0x0a, + 636, 11, 11, 11, 0x0a, + 666, 11, 11, 11, 0x0a, + 711, 11, 11, 11, 0x0a, + 737, 11, 11, 11, 0x0a, + 762, 11, 11, 11, 0x0a, + 788, 11, 11, 11, 0x0a, + 815, 11, 11, 11, 0x0a, + 842, 11, 11, 11, 0x0a, + 869, 11, 11, 11, 0x0a, + 897, 11, 11, 11, 0x0a, + 925, 11, 11, 11, 0x0a, + 954, 11, 11, 11, 0x0a, + 987, 11, 11, 11, 0x0a, + 1021, 11, 11, 11, 0x0a, + 1057, 11, 11, 11, 0x0a, + 1098, 11, 11, 11, 0x0a, + 1144, 11, 11, 11, 0x0a, + 1191, 11, 11, 11, 0x0a, + 1237, 11, 11, 11, 0x0a, + 1268, 11, 11, 11, 0x0a, + 1304, 11, 11, 11, 0x0a, + 1345, 11, 11, 11, 0x0a, + 1390, 11, 11, 11, 0x0a, + 1435, 11, 11, 11, 0x0a, + 1481, 11, 11, 11, 0x0a, + 1528, 11, 11, 11, 0x0a, + 1570, 11, 11, 11, 0x0a, + 1609, 11, 11, 11, 0x0a, + 1642, 11, 11, 11, 0x0a, + 1673, 11, 11, 11, 0x0a, + 1706, 11, 11, 11, 0x0a, + 1736, 11, 11, 11, 0x0a, + 1766, 11, 11, 11, 0x0a, + 1800, 11, 11, 11, 0x0a, + 1838, 11, 11, 11, 0x0a, + 1871, 11, 11, 11, 0x0a, + 1905, 11, 11, 11, 0x0a, + 1934, 11, 11, 11, 0x0a, + 1970, 11, 11, 11, 0x0a, + 2005, 11, 11, 11, 0x0a, + 2039, 11, 11, 11, 0x0a, + 2078, 11, 11, 11, 0x0a, + + 0 // eod +}; + +static const char qt_meta_stringdata_MainWindow[] = { + "MainWindow\0\0filename\0openRecentFile(QString)\0" + "event\0dropEvent(QDropEvent*)\0" + "closeEvent(QCloseEvent*)\0" + "dragEnterEvent(QDragEnterEvent*)\0" + "openRecentFile_aux()\0updateRecentFileActions()\0" + "fileName\0addToRecentFiles(QString)\0" + "menu,insertBefore\0addRecentFiles(QMenu*,QAction*)\0" + "menu\0addRecentFiles(QMenu*)\0uint\0" + "maxNumberOfRecentFiles()\0file\0" + "open(QString)\0save(QString)\0update()\0" + "on_actionRecenter_triggered()\0" + "on_actionClear_triggered()\0" + "on_actionLoadPoints_triggered()\0" + "on_actionSave_triggered()\0" + "on_actionInsertPoint_toggled()\0" + "on_actionSnapshot_triggered()\0" + "on_actionInvert_mass_triggered()\0" + "on_actionClamp_mass_triggered()\0" + "on_actionSubdivide_triggered()\0" + "on_actionDecimate_triggered()\0" + "on_actionKeep_one_point_out_of_n_triggered()\0" + "on_actionStar_triggered()\0" + "on_actionBox_triggered()\0" + "on_actionLine_triggered()\0" + "on_actionStair_triggered()\0" + "on_actionBoxes_triggered()\0" + "on_actionNoise_triggered()\0" + "on_actionSpiral_triggered()\0" + "on_actionCircle_triggered()\0" + "on_actionSkyline_triggered()\0" + "on_actionHalf_circle_triggered()\0" + "on_actionAdd_outliers_triggered()\0" + "on_actionParallel_lines_triggered()\0" + "on_actionBox_with_boundaries_triggered()\0" + "on_actionBox_with_missing_corners_triggered()\0" + "on_actionIncreasingly_sharp_angles_triggered()\0" + "on_actionWidely_variable_sampling_triggered()\0" + "on_actionSet_MChoice_toggled()\0" + "on_actionSet_parameters_triggered()\0" + "on_actionReconstruction_init_triggered()\0" + "on_actionReconstruction_one_step_triggered()\0" + "on_actionReconstruction_10_steps_triggered()\0" + "on_actionReconstruction_100_steps_triggered()\0" + "on_actionReconstruction_1000_steps_triggered()\0" + "on_actionReconstruction_until_triggered()\0" + "on_actionRelocate_vertices_triggered()\0" + "on_actionPrint_Stats_triggered()\0" + "on_actionView_points_toggled()\0" + "on_actionView_vertices_toggled()\0" + "on_actionView_edges_toggled()\0" + "on_actionView_ghost_toggled()\0" + "on_actionView_edge_cost_toggled()\0" + "on_actionView_edge_priority_toggled()\0" + "on_actionView_incolors_toggled()\0" + "on_actionView_relevance_toggled()\0" + "on_actionView_bins_toggled()\0" + "on_actionView_foot_points_toggled()\0" + "on_actionView_relocation_toggled()\0" + "on_actionView_tolerance_toggled()\0" + "on_actionActivate_simulation_toggled()\0" + "on_actionView_simulation_triggered()\0" +}; + +void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MainWindow *_t = static_cast(_o); + switch (_id) { + case 0: _t->openRecentFile((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 1: _t->dropEvent((*reinterpret_cast< QDropEvent*(*)>(_a[1]))); break; + case 2: _t->closeEvent((*reinterpret_cast< QCloseEvent*(*)>(_a[1]))); break; + case 3: _t->dragEnterEvent((*reinterpret_cast< QDragEnterEvent*(*)>(_a[1]))); break; + case 4: _t->openRecentFile_aux(); break; + case 5: _t->updateRecentFileActions(); break; + case 6: _t->addToRecentFiles((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 7: _t->addRecentFiles((*reinterpret_cast< QMenu*(*)>(_a[1])),(*reinterpret_cast< QAction*(*)>(_a[2]))); break; + case 8: _t->addRecentFiles((*reinterpret_cast< QMenu*(*)>(_a[1]))); break; + case 9: { uint _r = _t->maxNumberOfRecentFiles(); + if (_a[0]) *reinterpret_cast< uint*>(_a[0]) = _r; } break; + case 10: _t->open((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 11: _t->save((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 12: _t->update(); break; + case 13: _t->on_actionRecenter_triggered(); break; + case 14: _t->on_actionClear_triggered(); break; + case 15: _t->on_actionLoadPoints_triggered(); break; + case 16: _t->on_actionSave_triggered(); break; + case 17: _t->on_actionInsertPoint_toggled(); break; + case 18: _t->on_actionSnapshot_triggered(); break; + case 19: _t->on_actionInvert_mass_triggered(); break; + case 20: _t->on_actionClamp_mass_triggered(); break; + case 21: _t->on_actionSubdivide_triggered(); break; + case 22: _t->on_actionDecimate_triggered(); break; + case 23: _t->on_actionKeep_one_point_out_of_n_triggered(); break; + case 24: _t->on_actionStar_triggered(); break; + case 25: _t->on_actionBox_triggered(); break; + case 26: _t->on_actionLine_triggered(); break; + case 27: _t->on_actionStair_triggered(); break; + case 28: _t->on_actionBoxes_triggered(); break; + case 29: _t->on_actionNoise_triggered(); break; + case 30: _t->on_actionSpiral_triggered(); break; + case 31: _t->on_actionCircle_triggered(); break; + case 32: _t->on_actionSkyline_triggered(); break; + case 33: _t->on_actionHalf_circle_triggered(); break; + case 34: _t->on_actionAdd_outliers_triggered(); break; + case 35: _t->on_actionParallel_lines_triggered(); break; + case 36: _t->on_actionBox_with_boundaries_triggered(); break; + case 37: _t->on_actionBox_with_missing_corners_triggered(); break; + case 38: _t->on_actionIncreasingly_sharp_angles_triggered(); break; + case 39: _t->on_actionWidely_variable_sampling_triggered(); break; + case 40: _t->on_actionSet_MChoice_toggled(); break; + case 41: _t->on_actionSet_parameters_triggered(); break; + case 42: _t->on_actionReconstruction_init_triggered(); break; + case 43: _t->on_actionReconstruction_one_step_triggered(); break; + case 44: _t->on_actionReconstruction_10_steps_triggered(); break; + case 45: _t->on_actionReconstruction_100_steps_triggered(); break; + case 46: _t->on_actionReconstruction_1000_steps_triggered(); break; + case 47: _t->on_actionReconstruction_until_triggered(); break; + case 48: _t->on_actionRelocate_vertices_triggered(); break; + case 49: _t->on_actionPrint_Stats_triggered(); break; + case 50: _t->on_actionView_points_toggled(); break; + case 51: _t->on_actionView_vertices_toggled(); break; + case 52: _t->on_actionView_edges_toggled(); break; + case 53: _t->on_actionView_ghost_toggled(); break; + case 54: _t->on_actionView_edge_cost_toggled(); break; + case 55: _t->on_actionView_edge_priority_toggled(); break; + case 56: _t->on_actionView_incolors_toggled(); break; + case 57: _t->on_actionView_relevance_toggled(); break; + case 58: _t->on_actionView_bins_toggled(); break; + case 59: _t->on_actionView_foot_points_toggled(); break; + case 60: _t->on_actionView_relocation_toggled(); break; + case 61: _t->on_actionView_tolerance_toggled(); break; + case 62: _t->on_actionActivate_simulation_toggled(); break; + case 63: _t->on_actionView_simulation_triggered(); break; + default: ; + } + } +} + +const QMetaObjectExtraData MainWindow::staticMetaObjectExtraData = { + 0, qt_static_metacall +}; + +const QMetaObject MainWindow::staticMetaObject = { + { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, + qt_meta_data_MainWindow, &staticMetaObjectExtraData } +}; + +#ifdef Q_NO_DATA_RELOCATION +const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; } +#endif //Q_NO_DATA_RELOCATION + +const QMetaObject *MainWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; +} + +void *MainWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) + return static_cast(const_cast< MainWindow*>(this)); + if (!strcmp(_clname, "Ui_MainWindow")) + return static_cast< Ui_MainWindow*>(const_cast< MainWindow*>(this)); + return QMainWindow::qt_metacast(_clname); +} + +int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 64) + qt_static_metacall(this, _c, _id, _a); + _id -= 64; + } + return _id; +} + +// SIGNAL 0 +void MainWindow::openRecentFile(QString _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} +QT_END_MOC_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/options.ui b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/options.ui new file mode 100644 index 00000000000..b9bb3a1a257 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/options.ui @@ -0,0 +1,328 @@ + + Dialog_options + + + + 0 + 0 + 409 + 379 + + + + Options + + + + + 40 + 330 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + 220 + 20 + 159 + 21 + + + + use flip + + + + + + 20 + 20 + 188 + 304 + + + + + + + + + Verbose + + + + + + + 2 + + + + + + + + + + + Multiply Choice # + + + + + + + 100 + + + 100 + + + + + + + + + + + Init with % + + + + + + + 100 + + + 100 + + + + + + + + + + + Normal Tol + + + + + + + 3 + + + 100.000000000000000 + + + 0.050000000000000 + + + 100.000000000000000 + + + + + + + + + + + Tangential Tol + + + + + + + 3 + + + 100.000000000000000 + + + 0.050000000000000 + + + 100.000000000000000 + + + + + + + + + + + Alpha + + + + + + + 3 + + + 100.000000000000000 + + + 0.050000000000000 + + + 100.000000000000000 + + + + + + + + + + + Relocation + + + + + + + + + + + + + + Ghost vs solid + + + + + + + 3 + + + 100.000000000000000 + + + 0.050000000000000 + + + 100.000000000000000 + + + + + + + + + + + 220 + 210 + 174 + 109 + + + + + + + + + Line thickness + + + + + + + + + + + + + + Point size + + + + + + + + + + + + + + Vertex size + + + + + + + + + + + + + + + buttonBox + accepted() + Dialog_options + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog_options + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.qrc b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.qrc new file mode 100644 index 00000000000..04068c6b8db --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.qrc @@ -0,0 +1,14 @@ + + + icons/Voronoi_diagram_2.png + icons/fileNew.png + icons/fileOpen.png + icons/fileSave.png + icons/fit-page-32.png + icons/inputPoint.png + icons/snapshot.png + icons/triangulation.png + icons/until.png + icons/vertex.png + + diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.ui b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.ui new file mode 100644 index 00000000000..a847c6e38f4 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/pwsrec.ui @@ -0,0 +1,712 @@ + + + Pierre Alliez + MainWindow + + + + 0 + 0 + 680 + 680 + + + + PWS Rec 2D + + + + + + + + + Qt::StrongFocus + + + + + + + + + + + + Qt::Horizontal + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Discard + + + + + + + 10000 + + + + + + + + + + + + + + + + + + 0 + 0 + 680 + 22 + + + + + &File + + + + + + + + + Data + + + + Predefined + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Algorithms + + + + Decimate + + + + + + + + + + + + + + + + + + + View + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + toolBar + + + + + + TopToolBarArea + + + false + + + + + + + + + + + + + + Quit + + + Ctrl+Q + + + + + true + + + false + + + + :/icons/inputPoint.png:/icons/inputPoint.png + + + Insert mode + + + Insert Point + + + Insert Point + + + + + + :/icons/fileNew.png:/icons/fileNew.png + + + Clear + + + Clear + + + Space + + + + + + :/icons/fileOpen.png:/icons/fileOpen.png + + + Load Points + + + Load Points + + + Ctrl+O + + + + + + :/icons/fileSave.png:/icons/fileSave.png + + + Save + + + Save Points + + + Ctrl+S + + + + + Circle... + + + + + Half circle... + + + + + Box... + + + B + + + + + Line... + + + + + Init + + + I + + + + + 1 step + + + R + + + + + true + + + false + + + Foot points + + + View foot points + + + T + + + + + true + + + true + + + Points + + + View points + + + P + + + + + true + + + false + + + Edges + + + View edges + + + E + + + + + + :/icons/fit-page-32.png:/icons/fit-page-32.png + + + Recenter + + + + + true + + + true + + + Vertices + + + V + + + + + Two boxes... + + + + + Stair... + + + + + Skyline... + + + + + true + + + false + + + Edge priority + + + Z + + + + + 10 steps + + + 1 + + + + + 100 steps + + + 2 + + + + + 1000 steps + + + 3 + + + + + Add outliers + + + O + + + + + + :/icons/snapshot.png:/icons/snapshot.png + + + Snapshot + + + Ctrl+C + + + + + Increasingly sharp angles... + + + + + Box with boundaries... + + + + + Box with missing corners... + + + + + Star... + + + + + Spiral... + + + + + Parameters + + + Ctrl+P + + + + + true + + + false + + + Edge cost + + + C + + + + + until + + + U + + + + + Parallel lines... + + + + + Noise + + + N + + + + + true + + + + :/icons/vertex.png:/icons/vertex.png + + + Simulation + + + + + Simulation stage + + + A + + + + + Relocate + + + L + + + + + true + + + Relocation + + + Shift+L + + + + + true + + + false + + + Ghost edges + + + G + + + + + Invert mass + + + Shift+I + + + + + true + + + true + + + Relevance + + + Shift+R + + + + + true + + + Tolerance + + + Shift+T + + + + + true + + + false + + + In colors + + + + + Clamp mass + + + + + true + + + Bins + + + Shift+B + + + + + Print Stats + + + Shift+S + + + + + Subdivide + + + + + Widely variable sampling + + + + + Decimate + + + + + One point out of n + + + + + true + + + Multiple Choice + + + M + + + + + + GlViewer + QWidget +

glviewer.h
+ 1 + + + + min_mass_slider + discard_spinbox + + + + + + diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h new file mode 100644 index 00000000000..4cb1fc65900 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h @@ -0,0 +1,26 @@ +#ifndef _RANDOM_ +#define _RANDOM_ 1 + +inline +double random_double(const double min, const double max) +{ + double range = max - min; + return min + (double(rand()) / double(RAND_MAX)) * range; +} + +inline +int random_int(const int min, const int max) +{ + int range = max - min; + return min + int((double(rand())/double(RAND_MAX)) * range); +} + +template +Vector random_vec(const double scale) +{ + double dx = random_double(-scale, scale); + double dy = random_double(-scale, scale); + return Vector(dx, dy); +} + +#endif diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp new file mode 100644 index 00000000000..b72abad51c8 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -0,0 +1,944 @@ +// Qt +#include + +// local +#include "Reconstruction_simplification_kerneled_2.h" +#include + + +typedef Reconstruction_simplification_kerneled_2::Reconstruction_edge_2 PEdge; +typedef Reconstruction_simplification_kerneled_2 R_s_k_2; + +void R_s_k_2::print_stats() const +{ + int nb_solid = 0; + int nb_ghost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) nb_ghost++; + else nb_solid++; + } + + std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; + std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; + std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; + std::cerr << "# solid: " << nb_solid << std::endl; + std::cerr << "# ghost: " << nb_ghost << std::endl; +} + +QColor R_s_k_2::get_color(float value) const +{ + float hue = 240.0*(1.0 - value); + QColor color; + color.setHsv(hue, 255, 255); + return color; +} + +void R_s_k_2::draw_point(const Point& point) +{ + ::glBegin(GL_POINTS); + ::glVertex2f(point.x(), point.y()); + ::glEnd(); +} + +void R_s_k_2::draw_segment(const Point& s, const Point& t) +{ + ::glBegin(GL_LINES); + ::glVertex2d(s.x(), s.y()); + ::glVertex2d(t.x(), t.y()); + ::glEnd(); +} + +void R_s_k_2::draw_edge(const Edge& edge) +{ + int i = edge.second; + Face_handle face = edge.first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + draw_segment(a, b); +} + +void R_s_k_2::draw_face(Face_handle face) +{ + ::glBegin(GL_TRIANGLES); + for (int i = 0; i < 3; ++i) + { + Point p = face->vertex(i)->point(); + ::glVertex2f(p.x(), p.y()); + } + ::glEnd(); +} + +void R_s_k_2:: + draw_edge_with_arrow(const Point& s, const Point& t) +{ + Vector vec = t - s; + Vector vec90(-vec.y(),vec.x()); + + // draw edge + draw_segment(s, t); + + // draw an arrow toward merged vertex + Point a = t - 0.4 * vec; + Point b = a - 0.2 * vec - 0.1 * vec90; + Point c = a - 0.2 * vec + 0.1 * vec90; + ::glBegin(GL_TRIANGLES); + ::glVertex2d(a.x(), a.y()); + ::glVertex2d(b.x(), b.y()); + ::glVertex2d(c.x(), c.y()); + ::glEnd(); +} + +void R_s_k_2:: + draw_vertices(const float point_size, + const float red, + const float green, + const float blue) +{ + for (Finite_vertices_iterator vi = m_dt.finite_vertices_begin(); vi + != m_dt.finite_vertices_end(); vi++) + { + Vertex_handle vertex = vi; + if (vertex->pinned()) + { + ::glPointSize(point_size); + ::glColor3f(0.0f, 0.0f, 0.0f); + } + else + { + ::glPointSize(3*point_size); + ::glColor3f(red,green,blue); + } + draw_point(vertex->point()); + } +} + +void R_s_k_2::draw_edges(const float line_width, + const float red, + const float green, + const float blue) +{ + ::glLineWidth(line_width); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ei++) + { + Edge edge = *ei; + Edge twin = m_dt.twin_edge(edge); + if (m_dt.is_pinned(edge) && m_dt.is_pinned(twin)) + ::glColor3f(0.9f,0.9f,0.75f); + else + ::glColor3f(red,green,blue); + draw_edge(edge); + } +} + +void R_s_k_2:: +draw_footpoints(const float line_width, + const float red, + const float green, + const float blue) +{ + draw_mesh_footpoints(m_dt, line_width, red, green, blue); +} + +void R_s_k_2::draw_mesh_footpoints(const Triangulation& mesh, + const float line_width, + const float red, + const float green, + const float blue) +{ + ::glLineWidth(line_width); + for (Finite_edges_iterator ei = mesh.finite_edges_begin(); ei != mesh.finite_edges_end(); ei++) + { + Edge edge = *ei; + draw_edge_footpoints(mesh, edge, red, green, blue); + draw_edge_footpoints(mesh, mesh.twin_edge(edge), red, green, blue); + } +} + +void R_s_k_2::draw_edge_footpoints(const Triangulation& mesh, + const Edge& edge, + const float red, + const float green, + const float blue) +{ + const Point& a = mesh.source_vertex(edge)->point(); + const Point& b = mesh.target_vertex(edge)->point(); + const Sample_list& samples = edge.first->samples(edge.second); + + Sample_list::const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) + { + Sample* sample = *it; + Point p = sample->point(); + FT m = 0.5*(1.0 - sample->mass()); + + Point q; + if (mesh.get_plan(edge) == 0) + { + ::glColor3f(0.8f + m, m, m); + FT Da = CGAL::squared_distance(p, a); + FT Db = CGAL::squared_distance(p, b); + if (Da < Db) q = a; + else q = b; + } + else + { + ::glColor3f(red + m, green + m, blue + m); + FT t = sample->coordinate(); + q = CGAL::ORIGIN + (1.0 - t)*(a - CGAL::ORIGIN) + t*(b - CGAL::ORIGIN); + } + draw_segment(p, q); + } +} + +void R_s_k_2::draw_pedges(const float line_width) +{ + int nb_edges = 0; + int nb_pinned = 0; + int nb_cyclic = 0; + int nb_discart = 0; + FT min_value = std::numeric_limits::max(); + FT max_value = std::numeric_limits::lowest(); + std::vector values; + std::vector edges; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + for (unsigned i = 0; i < 2; ++i) + { + if (m_dt.is_pinned(edge)) + { + nb_pinned++; + continue; + } + + if (m_dt.is_target_cyclic(edge)) + { + nb_cyclic++; + continue; + } + + PEdge pedge; + bool ok = create_pedge(edge, pedge); + if (ok) + { + edges.push_back(edge); + values.push_back(pedge.priority()); + min_value = std::min(min_value, values.back()); + max_value = std::max(max_value, values.back()); + } + else + { + nb_discart++; + ::glColor3f(1.0, 0.0, 1.0); + draw_edge(edge); + } + edge = m_dt.twin_edge(edge); + nb_edges++; + } + } + if (min_value == max_value) max_value += 1.0; + + unsigned N = values.size(); + for (unsigned i = 0; i < N; ++i) + draw_one_pedge(edges[i], values[i], min_value, max_value, line_width); + + std::cout << "There are: " << N << " pedges" + << " x " << nb_discart << " discarted" + << " x " << nb_pinned << " pinned" + << " x " << nb_cyclic << " cyclic" + << " = " << nb_edges << " edges" + << std::endl; +} + +void R_s_k_2::draw_one_pedge(const Edge& edge, + const FT value, + const FT min_value, + const FT max_value, + const float line_width) +{ + if (value == min_value) + { + ::glLineWidth(2*line_width); + ::glColor3f(0.0f, 0.0f, 0.0f); + } + else + { + ::glLineWidth(line_width); + FT color = (value - min_value) / (max_value - min_value); + QColor qcolor = get_color(color); + ::glColor3f(qcolor.redF(), qcolor.greenF(), qcolor.blueF()); + } + + Point s = m_dt.source_vertex(edge)->point(); + Point t = m_dt.target_vertex(edge)->point(); + Point c = CGAL::midpoint(s, t); + draw_edge_with_arrow(c, t); +} + +void R_s_k_2::draw_costs(const float line_width, const bool view_ghost) +{ + FT min_value = std::numeric_limits::max(); + FT max_value = std::numeric_limits::lowest(); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_cost(edge).finalize(m_alpha); + min_value = std::min(min_value, value); + max_value = std::max(max_value, value); + } + if (min_value == max_value) max_value += 1.0; + + ::glLineWidth(line_width); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + draw_one_cost(edge, min_value, max_value, view_ghost); + } +} + +void R_s_k_2::draw_one_cost(const Edge& edge, + const FT min_value, + const FT max_value, + const bool view_ghost) +{ + FT mass = m_dt.get_mass(edge); + if (mass == 0.0) + { + if (!view_ghost) return; + ::glColor3f(0.5f, 0.5f, 0.5f); + draw_edge(edge); + return; + } + + if (m_dt.is_ghost(edge)) + { + if (!view_ghost) return; + ::glColor3f(0.5f, 0.5f, 0.5f); + draw_edge(edge); + return; + } + + FT value = m_dt.get_cost(edge).finalize(m_alpha); + FT color = (value - min_value) / (max_value - min_value); + ::glColor3d(0.0, 1.0-color, color); // [green, blue] + draw_edge(edge); +} + +void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool incolors) +{ + PQueue queue; + FT min_value = std::numeric_limits::max(); + FT max_value = std::numeric_limits::lowest(); + unsigned nb_initial = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_edge_relevance(edge); // >= 0 + + nb_initial++; + min_value = std::min(min_value, value); + max_value = std::max(max_value, value); + queue.push(PEdge(edge, value)); + } + if (min_value == max_value) max_value += 1.0; + + ::glLineWidth(line_width); + int nb_remove = std::min(nb, int(queue.size())); + + ::glColor3d(0.5, 0.1, 0.1); + for (int i = 0; i < nb_remove; ++i) + { + PEdge pedge = queue.top(); + queue.pop(); + if (incolors) draw_edge(pedge.edge()); + } + + ::glColor3d(0.0, 0.5, 0.0); + while (!queue.empty()) + { + PEdge pedge = queue.top(); + queue.pop(); + if (incolors) + { + FT value = pedge.priority(); + value = (value - min_value) / (max_value - min_value); + value = 0.7*(1.0 - value); + ::glColor3d(value, value, value); + } + draw_edge(pedge.edge()); + } +} + +void R_s_k_2::draw_bins(const float thickness) +{ + ::glLineWidth(thickness); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.get_plan(edge) == 0) + draw_bins_plan0(edge); + else + draw_bins_plan1(edge); + } +} + +void R_s_k_2::draw_bins_plan0(const Edge& edge) +{ + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + Sample_list samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + ::glColor3f(0.0f, 1.0f, 0.0f); + Sample_list_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) + { + Sample* sample = *it; + const Point& ps = sample->point(); + + Point q = pa; + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + if (Da > Db) q = pb; + + draw_segment(ps, q); + } +} + +void R_s_k_2::draw_bins_plan1(const Edge& edge) +{ + FT M = m_dt.get_mass(edge); + Vector va = m_dt.source_vertex(edge)->point() - CGAL::ORIGIN; + Vector vb = m_dt.target_vertex(edge)->point() - CGAL::ORIGIN; + + ::glColor3f(1.0f, 0.0f, 0.0f); + SQueue queue; + FT start = 0.0; + m_dt.sort_samples_from_edge(edge, queue); + while (!queue.empty()) + { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + FT bin = m/M; + FT alpha = start + 0.5*bin; + Point q = CGAL::ORIGIN + (1.0-alpha)*va + alpha*vb; + start += bin; + + draw_segment(ps, q); + } +} + +void R_s_k_2::draw_relocation() +{ + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); v != m_dt.finite_vertices_end(); ++v) + { + Vertex_handle vertex = v; + if (vertex->pinned()) continue; + + const Point& pv = vertex->point(); + v->relocated() = compute_relocation(vertex); + + Vector move(0.0, 0.0); + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + Vector grad(0.0, 0.0); + if (m_dt.get_plan(edge) == 0) + grad = compute_gradient_for_plan0(edge); + else + grad = compute_gradient_for_plan1(edge); + + move = move + grad; + ::glLineWidth(2.0f); + ::glColor3f(1.0f, 1.0f, 0.0f); + draw_edge_with_arrow(pv, pv-grad); + } + + ::glLineWidth(1.0f); + ::glColor3f(1.0f, 0.0f, 0.0f); + draw_edge_with_arrow(pv, pv-move); + } + + ::glBegin(GL_LINES); + ::glLineWidth(3.0f); + ::glColor3f(0.1f, 1.0f, 1.0f); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + Edge twin = m_dt.twin_edge(edge); + if (m_dt.is_pinned(edge) || m_dt.is_pinned(twin)) continue; + + const Point& pa = m_dt.source_vertex(edge)->relocated(); + const Point& pb = m_dt.target_vertex(edge)->relocated(); + ::glVertex2d(pa.x(), pa.y()); + ::glVertex2d(pb.x(), pb.y()); + } + ::glEnd(); +} + +bool R_s_k_2::locate_edge(const Point& query, Edge& edge) +{ + if (m_dt.number_of_faces() == 0) return false; + + Face_handle face = m_dt.locate(query); + if (face == Face_handle()) return false; + if (m_dt.is_infinite(face)) return false; + + edge = m_dt.find_nearest_edge(query, face); + if (edge.first == Face_handle()) return false; + + if (m_dt.is_pinned(edge) || m_dt.is_target_cyclic(edge)) + return false; + + return true; +} + +void R_s_k_2::draw_one_ring(const float point_size, const float line_width, const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + draw_mesh_one_ring(point_size, line_width, copy, copy_edge); +} + +void R_s_k_2::draw_mesh_one_ring(const float point_size, + const float line_width, + const Triangulation& mesh, + const Edge& edge) +{ + Vertex_handle s = mesh.source_vertex(edge); + Vertex_handle t = mesh.target_vertex(edge); + + draw_bg_faces(mesh, 1.0f, 0.7f, 0.7f, 0.5f); + draw_vertex_faces(s, mesh, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(line_width); + draw_bg_edges(mesh, 0.7f, 0.3f, 0.7f, 1.f, 0.f, 0.f); + draw_vertex_edges(s, mesh, 0.f, 0.8f, 0.f, 0.f, 0.2f, 0.2f); + + ::glLineWidth(2.0f*line_width); + ::glColor3f(0., 0., 1.); + //draw_edge(edge); + draw_edge_with_arrow(s->point(), t->point()); + + ::glPointSize(0.5*point_size); + draw_bg_vertices(mesh, 0.f, 0.f, 0.f); + ::glPointSize(point_size); + ::glColor3f(0., 1., 0.); + draw_point(s->point()); + ::glColor3f(1., 1., 0.); + draw_point(t->point()); +} + +void R_s_k_2::draw_blocking_edges(const float point_size, const float line_width, const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); +} + +void R_s_k_2::draw_mesh_blocking_edges(const float point_size, + const float line_width, + const Triangulation& mesh, + const Edge& edge) +{ + Vertex_handle s = mesh.source_vertex(edge); + Vertex_handle t = mesh.target_vertex(edge); + + draw_mesh_one_ring(point_size, line_width, mesh, edge); + + ::glColor3f(0.0f, 0.0f, 0.0f); + ::glLineWidth(2.0f*line_width); + Face_circulator fcirc = mesh.incident_faces(s); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + Edge ab(f, f->index(s)); + Vertex_handle a = mesh.source_vertex(ab); + Vertex_handle b = mesh.target_vertex(ab); + if (!mesh.is_triangle_ccw(a, b, t)) + { + draw_segment(a->point(), b->point()); + } + } +} + +void R_s_k_2::draw_collapsible_edge(const float point_size, + const float line_width, + const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + + Edge_list copy_hull; + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + + if (ok) + draw_mesh_one_ring(point_size, line_width, copy, copy_edge); + else + draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); +} + +void R_s_k_2::draw_simulation(const float point_size, + const float line_width, + const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + + Edge_list copy_hull; + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + + if (!ok) + { + draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); + return; + } + + copy.collapse(copy_edge, m_verbose); + + draw_bg_faces(copy, 1.0f, 0.7f, 0.7f, 0.5f); + draw_vertex_faces(copy_dst, copy, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(line_width); + draw_bg_edges(copy, 0.7f, 0.3f, 0.7f, 1.f, 0.f, 0.f); + draw_vertex_edges(copy_dst, copy, 0.f, 0.8f, 0.f, 0.f, 0.8f, 0.8f); + + ::glPointSize(0.5*point_size); + draw_bg_vertices(copy, 0.f, 0.f, 0.f); + ::glPointSize(point_size); + ::glColor3f(1., 1., 0.); + draw_point(copy_dst->point()); +} + +void R_s_k_2::draw_cost_stencil(const float point_size, + const float line_width, + const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + + Edge_list copy_hull; + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + if (!ok) return; + copy.collapse(copy_edge, m_verbose); + + draw_bg_faces(copy, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(line_width); + ::glPointSize(point_size); + + Edge_list stencil; + collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), stencil); + for (Edge_list::const_iterator it = stencil.begin(); it != stencil.end(); ++it) + { + Edge e = *it; + ::glColor3f(0.7f, 0.4f, 0.0f); + draw_edge(e); + ::glColor3f(0.0f, 0.0f, 0.0f); + draw_point(copy.source_vertex(e)->point()); + draw_point(copy.target_vertex(e)->point()); + } +} + +void R_s_k_2::draw_remove_queue_stencil(const float point_size, + const float line_width, + const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Edge_list hull; + Edge_list stencil; + Edge_list::const_iterator it; + Vertex_handle src = m_dt.source_vertex(edge); + m_dt.get_edges_from_star_minus_link(src, hull, true); + collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); + + draw_vertex_faces(src, m_dt, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(0.5*line_width); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + ::glColor3f(1.0f, 0.6f, 1.0f); + draw_edge(ab); + } + + ::glLineWidth(line_width); + ::glPointSize(point_size); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + Vertex_handle va = ab.first->vertex( (ab.second+1)%3 ); + Vertex_handle vb = ab.first->vertex( (ab.second+2)%3 ); + const Point& pa = va->point(); + const Point& pb = vb->point(); + Point pc = CGAL::midpoint(pa, pb); + ::glColor3f(0.8f, 0.2f, 0.8f); + draw_edge_with_arrow(pc, pb); + ::glColor3f(0.0f, 0.0f, 0.0f); + draw_point(pa); + draw_point(pb); + } +} + +void R_s_k_2::draw_push_queue_stencil(const float point_size, + const float line_width, + const Point& query) +{ + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Edge_list hull; + Edge_list stencil; + Vertex_handle src = m_dt.source_vertex(edge); + m_dt.get_edges_from_star_minus_link(src, hull, true); + collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); + + Edge_list::iterator it = stencil.begin(); + while (it != stencil.end()) + { + Edge edge = *it; + if (m_dt.source_vertex(edge) == src) + it = stencil.erase(it); + else if (m_dt.target_vertex(edge) == src) + it = stencil.erase(it); + else + it++; + } + + Triangulation copy; + Edge_list copy_hull; + Edge_list copy_stencil; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + if (!ok) return; + copy.collapse(copy_edge, m_verbose); + collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), copy_stencil); + + for (it = copy_stencil.begin(); it != copy_stencil.end(); ++it) + { + Edge edge = *it; + Edge twin = copy.twin_edge(edge); + if (!copy.is_pinned(edge)) stencil.push_back(edge); + if (!copy.is_pinned(twin)) stencil.push_back(twin); + } + + draw_bg_faces(copy, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(0.5*line_width); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + ::glColor3f(1.0f, 0.6f, 1.0f); + draw_edge(ab); + } + + ::glLineWidth(line_width); + ::glPointSize(point_size); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + Vertex_handle va = ab.first->vertex( (ab.second+1)%3 ); + Vertex_handle vb = ab.first->vertex( (ab.second+2)%3 ); + const Point& pa = va->point(); + const Point& pb = vb->point(); + Point pc = CGAL::midpoint(pa, pb); + ::glColor3f(0.8f, 0.2f, 0.8f); + draw_edge_with_arrow(pc, pb); + ::glColor3f(0.0f, 0.0f, 0.0f); + draw_point(pa); + draw_point(pb); + } +} + +void R_s_k_2::draw_bg_faces(const Triangulation& mesh, + const float red, + const float green, + const float blue, + const float alpha) +{ + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ::glColor4f(red, green, blue, alpha); + for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) + { + Face_handle f = fi; + draw_face(f); + } + ::glDisable(GL_BLEND); +} + +void R_s_k_2::draw_bg_edges(const Triangulation& mesh, + const float ri, + const float gi, + const float bi, + const float ro, + const float go, + const float bo) +{ + for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) + { + Face_handle f = fi; + for (unsigned i = 0; i < 3; ++i) + { + Edge e(f, i); + e = mesh.twin_edge(e); + if (mesh.is_infinite(e.first)) + ::glColor3f(ro, go, bo); + else + ::glColor3f(ri, gi, bi); + draw_edge(e); + } + } +} + +void R_s_k_2::draw_bg_vertices(const Triangulation& mesh, + const float red, + const float green, + const float blue) +{ + ::glColor3f(red, green, blue); + for (Finite_vertices_iterator vi = mesh.finite_vertices_begin(); vi != mesh.finite_vertices_end(); ++vi) + { + Vertex_handle v = vi; + draw_point(v->point()); + } +} + +void R_s_k_2::draw_vertex_faces(Vertex_handle vertex, + const Triangulation& mesh, + const float red, + const float green, + const float blue, + const float alpha) +{ + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ::glColor4f(red, green, blue, alpha); + Face_circulator fcirc = mesh.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + if (mesh.is_infinite(f)) continue; + draw_face(f); + } + ::glDisable(GL_BLEND); +} + +void R_s_k_2::draw_vertex_edges(Vertex_handle vertex, + const Triangulation& mesh, + const float ri, + const float gi, + const float bi, + const float ro, + const float go, + const float bo) +{ + Face_circulator fcirc = mesh.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + int index = f->index(vertex); + for (unsigned i = 0; i < 3; ++i) + { + Edge e(f, i); + if (mesh.is_infinite(e)) continue; + if (i == index) ::glColor3f(ro, go, bo); + else ::glColor3f(ri, gi, bi); + draw_edge(e); + } + } +} + +void R_s_k_2::save_edges(std::ofstream& ofs, const int nb) +{ + PQueue queue; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_edge_relevance(edge); // >= 0 + queue.push(PEdge(edge, value)); + } + + int nb_remove = std::min(nb, int(queue.size())); + for (int i = 0; i < nb_remove; ++i) + { + PEdge pedge = queue.top(); + queue.pop(); + } + + while (!queue.empty()) + { + PEdge pedge = queue.top(); + queue.pop(); + save_one_edge(ofs, pedge.edge()); + } +} + +void R_s_k_2::save_one_edge(std::ofstream& ofs, const Edge& edge) +{ + int i = edge.second; + Face_handle face = edge.first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + //TODO: IV COMMNT IN AGAIN +// ofs << a << " " << b << std::endl; +} diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h new file mode 100644 index 00000000000..3e565116965 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -0,0 +1,1080 @@ +#ifndef SCENE_H_ +#define SCENE_H_ + +// STL +#include + +//Qt +#include + +// local +#include +#include "Reconstruction_simplification_kerneled_2.h" +#include "../../include/CGAL/Reconstruction_simplification_2.h" +#include "third/CImg.h" +#include "random.h" +#include // std::pair +#include +#include + +class Scene { + +public: + typedef std::pair PointMassPair; + + typedef std::list PointMassList; + typedef PointMassList::const_iterator InputIterator; + + typedef CGAL::value_type_traits::type MassPoint; + + typedef CGAL::First_of_pair_property_map PointPMap; + typedef CGAL::Second_of_pair_property_map MassPMap; + + typedef CGAL::Reconstruction_simplification_2 R_s_2; + typedef R_s_2::FT FT; + typedef R_s_2::Point Point; + typedef R_s_2::Vector Vector; + + typedef R_s_2::Vertex Vertex; + typedef R_s_2::Vertex_handle Vertex_handle; + typedef R_s_2::Vertex_iterator Vertex_iterator; + typedef R_s_2::Vertex_circulator Vertex_circulator; + typedef R_s_2::Finite_vertices_iterator Finite_vertices_iterator; + + typedef R_s_2::Edge Edge; + typedef R_s_2::Edge_iterator Edge_iterator; + typedef R_s_2::Edge_circulator Edge_circulator; + typedef R_s_2::Finite_edges_iterator Finite_edges_iterator; + + typedef R_s_2::Face Face; + typedef R_s_2::Face_handle Face_handle; + typedef R_s_2::Face_iterator Face_iterator; + typedef R_s_2::Face_circulator Face_circulator; + typedef R_s_2::Finite_faces_iterator Finite_faces_iterator; + + typedef R_s_2::Vertex_handle_map Vertex_handle_map; + typedef R_s_2::Face_handle_map Face_handle_map; + + typedef R_s_2::Vertex_handle_set Vertex_handle_set; + typedef R_s_2::Edge_set Edge_set; + + typedef R_s_2::Edge_list Edge_list; + + typedef R_s_2::Cost Cost; + typedef R_s_2::Sample Sample; + typedef R_s_2::Sample_list Sample_list; + typedef R_s_2::Sample_list_const_iterator Sample_list_const_iterator; + + typedef R_s_2::Point_list Point_list; + typedef R_s_2::Point_list_const_iterator Point_list_const_iterator; + + typedef R_s_2::PSample PSample; + typedef R_s_2::SQueue SQueue; + + typedef R_s_2::Reconstruction_edge_2 PEdge; + typedef R_s_2::PQueue PQueue; + +private: + // data + std::list m_samples; + double m_min_mass; + double m_max_mass; + + Reconstruction_simplification_kerneled_2* m_pwsrec; + int m_ignore; + + // bbox + double m_bbox_x; + double m_bbox_y; + double m_bbox_size; + +public: + Scene() { + srand(0); // for sake of repeatability + m_min_mass = 0.0; + m_max_mass = 0.0; + m_ignore = 0; + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; + + m_pwsrec = new Reconstruction_simplification_kerneled_2(); + } + + ~Scene() { + clear(); + } + + void clear() { + m_pwsrec->clear(); + m_samples.clear(); + m_max_mass = 0.0; + } + + void set_min_mass(const double min_value) { + m_min_mass = min_value; + } + + void set_nb_edges_to_ignore(int nb) { + m_ignore = nb; + } + + void invert_mass() { + double new_max_mass = 0.0; + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample& sample = *it; + sample.mass() = m_max_mass - sample.mass(); + new_max_mass = std::max(new_max_mass, sample.mass()); + } + m_max_mass = new_max_mass; + } + + void clamp_mass() { + std::list new_samples; + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample& sample = *it; + if (sample.mass() > m_min_mass) { + sample.mass() = 1.0; + new_samples.push_back(sample); + } + } + m_samples = new_samples; + m_max_mass = 1.0; + } + + void subdivide() { + if (m_samples.size() < 3) + return; + + std::list new_samples; + std::list::const_iterator it = m_samples.begin(); + std::list::const_iterator last = it++; + while (it != m_samples.end()) { + Point p = CGAL::midpoint(last->point(), it->point()); + FT m = 0.5 * (last->mass() + it->mass()); + new_samples.push_back(Sample(p, m)); + last = it++; + } + it = m_samples.begin(); + Point p = CGAL::midpoint(last->point(), it->point()); + FT m = 0.5 * (last->mass() + it->mass()); + new_samples.push_back(Sample(p, m)); + + std::list final_samples; + std::list::const_iterator it2 = new_samples.begin(); + while (it != m_samples.end() && it2 != new_samples.end()) { + final_samples.push_back(*it); + final_samples.push_back(*it2); + it++; + it2++; + } + + m_samples = final_samples; + } + + // SAMPLE // + + void add_sample(const Point& point, const FT mass = 1.0) { + m_samples.push_back(Sample(point, mass)); + m_max_mass = std::max(m_max_mass, mass); + } + + void add_outliers(const unsigned int nb) { + std::cerr << "add " << nb << " outliers..."; + for (unsigned int i = 0; i < nb; i++) { + Point outlier = CGAL::ORIGIN + random_vec(1.3); + m_samples.push_back(outlier); + } + std::cerr << "done" << std::endl; + } + + void noise(const FT scale) { + std::cerr << "noise by " << scale << "..."; + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++) { + Sample& sample = *it; + Point& point = sample.point(); + point = point + random_vec(scale); + } + std::cerr << "done" << std::endl; + } + + void normalize_points() { + noise(1e-5); + compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); + if (m_bbox_size == 0.0) + return; + + Point center(m_bbox_x, m_bbox_y); + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample& sample = *it; + Vector vec = (sample.point() - center) / m_bbox_size; + sample.point() = CGAL::ORIGIN + vec; + } + m_bbox_x = m_bbox_y = 0.0; + m_bbox_size = 1.0; + } + + void compute_bbox(double &x, double &y, double &scale) { + if (m_samples.empty()) { + x = y = 0.0; + scale = 1.0; + return; + } + + FT x_min, x_max, y_min, y_max; + std::list::const_iterator it = m_samples.begin(); + Point p = it->point(); + x_min = x_max = p.x(); + y_min = y_max = p.y(); + ++it; + for (; it != m_samples.end(); ++it) { + p = it->point(); + x_min = std::min(x_min, p.x()); + x_max = std::max(x_max, p.x()); + y_min = std::min(y_min, p.y()); + y_max = std::max(y_max, p.y()); + } + + x = 0.5 * (x_min + x_max); + y = 0.5 * (y_min + y_max); + scale = std::max(x_max - x_min, y_max - y_min); + if (scale == 0.0) + scale = 1.0; + } + + // IO SAMPLES // + + void load(const QString& filename, const bool gradient) { + // TODO: load xml + + if (filename.contains(".xy", Qt::CaseInsensitive)) { + load_xy_file(filename); + normalize_points(); + return; + } + + if (filename.contains(".txt", Qt::CaseInsensitive)) { + load_xy_file(filename); + normalize_points(); + return; + } + + if (filename.contains(".gtn", Qt::CaseInsensitive)) { + load_gathan_file(filename); + normalize_points(); + return; + } + + if (filename.contains(".dat", Qt::CaseInsensitive)) { + load_dat_file(filename); + normalize_points(); + return; + } + + if (filename.contains(".bmp", Qt::CaseInsensitive)) { + if (gradient) + load_gradient(filename); + else + load_image(filename); + normalize_points(); + return; + } + + std::cerr << "Invalid file (try .xy, .dat, .bmp)" << std::endl; + } + + void load_xy_file(const QString& fileName) { + + std::cout << "FILENAME " << fileName.toUtf8().constData() << std::endl; + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) { + add_sample(point, 1.0); + nb++; + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + } + + void load_gathan_file(const QString& fileName) { + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read gathan..."; + Point point; + unsigned nb, x, y, z; + ifs >> nb >> x >> y >> z; + for (unsigned i = 0; i < nb; ++i) { + ifs >> x >> point; + add_sample(point, 1.0); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + } + + void load_dat_file(const QString& fileName) { + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read dat..."; + Point point; + unsigned int n, m, nb = 0; + ifs >> n; + for (unsigned int i = 0; i < n; ++i) { + ifs >> m; + for (unsigned int j = 0; j < m; ++j) { + ifs >> point; + add_sample(point, 1.0); + } + nb += m; + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + } + + void load_image(const QString& fileName) { + std::cerr << "read image..."; + cimg_library::CImg image(qPrintable(fileName)); + std::cerr << "done" << std::endl; + + std::cerr << "compute grayscale..."; + cimg_library::CImg grayscale = + image.RGBtoHSV().get_channel(2).normalize(0.0f, 1.0f); + std::cerr << "done" << std::endl; + + // turn pixels into weighted samples + std::cerr << "add samples..."; + for (int i = 0; i < grayscale.width(); i++) { + for (int j = 0; j < grayscale.height(); j++) { + float mass = 1.0f - grayscale.atXY(i, j); + double x = double(i) / grayscale.width(); + double y = 1.0 - double(j) / grayscale.height(); + add_sample(Point(x, y), mass); + } + } + std::cerr << "done (" << m_samples.size() << ")" << std::endl; + } + + void load_gradient(const QString& fileName) { + std::cerr << "read image..."; + cimg_library::CImg image(qPrintable(fileName)); + std::cerr << "done" << std::endl; + + std::cerr << "compute gradient..."; + cimg_library::CImgList grad = image.get_gradient(); + cimg_library::CImg normgrad = sqrt( + grad[0].pow(2) + grad[1].pow(2)).normalize(0.0f, 1.0f); + std::cerr << "done" << std::endl; + + // turn pixels into weighted samples + std::cerr << "add samples..."; + for (int i = 0; i < normgrad.width(); i++) { + for (int j = 0; j < normgrad.height(); j++) { + float mass = normgrad.atXY(i, j); + double x = double(i) / normgrad.width(); + double y = 1.0 - double(j) / normgrad.height(); + add_sample(Point(x, y), mass); + } + } + std::cerr << "done (" << m_samples.size() << ")" << std::endl; + } + + void save(const QString& filename) { + std::cout << "SAVE-------------" << std::endl; + m_pwsrec->extract_solid_eges(); + + if (filename.contains(".edges", Qt::CaseInsensitive)) { + std::ofstream ofs(qPrintable(filename)); + m_pwsrec->save_edges(ofs, m_ignore); + ofs.close(); + return; + } + + Sample_list samples; + for (std::list::iterator it = m_samples.begin(); + it != m_samples.end(); ++it) { + Sample& s = *it; + if (s.mass() < m_min_mass) + continue; + samples.push_back(&s); + } + + if (filename.contains(".xy", Qt::CaseInsensitive)) { + save_xy(filename, samples); + return; + } + + if (filename.contains(".poff", Qt::CaseInsensitive)) { + save_poff(filename, samples); + return; + } + + if (filename.contains(".gtn", Qt::CaseInsensitive)) { + save_gtn(filename, samples); + return; + } + + if (filename.contains(".pwn", Qt::CaseInsensitive)) { + save_pwn(filename, samples); + return; + } + } + + void save_pwn(const QString& filename, const Sample_list& samples) { + std::list normals; + compute_normals(samples, normals); + std::ofstream ofs(qPrintable(filename)); + std::list::const_iterator ni = normals.begin(); + for (Sample_list_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample* sample = *it; + ofs << sample->point() << " " << *ni << std::endl; + ni++; + } + ofs.close(); + } + + void compute_normals(const Sample_list& samples, + std::list& normals) { + normals.clear(); + Point last = samples.back()->point(); + Sample_list_const_iterator si = samples.begin(); + while (si != samples.end()) { + Point p = (*si)->point(); + si++; + Point next = samples.front()->point(); + if (si != samples.end()) + next = (*si)->point(); + + Vector ab = p - last; + Vector bc = next - p; + Vector ab90(ab.y(), -ab.x()); + Vector bc90(bc.y(), -bc.x()); + + Vector ni = ab90 + bc90; + FT norm = std::sqrt(ni * ni); + if (norm != 0.0) + ni = ni / norm; + normals.push_back(ni); + + last = p; + } + } + + void save_xy(const QString& filename, const Sample_list& samples) { + std::ofstream ofs(qPrintable(filename)); + for (Sample_list_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample* sample = *it; + ofs << sample->point() << std::endl; + } + ofs.close(); + } + + void save_poff(const QString& filename, const Sample_list& samples) { + std::ofstream ofs(qPrintable(filename)); + ofs << "POFF " << samples.size() << " 0 0" << std::endl; + for (Sample_list_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample* sample = *it; + ofs << sample->point() << std::endl; + } + ofs.close(); + } + + void save_gtn(const QString& filename, const Sample_list& samples) { + std::ofstream ofs(qPrintable(filename)); + ofs << samples.size() << " 2 0 0" << std::endl; + unsigned i = 0; + for (Sample_list_const_iterator it = samples.begin(); + it != samples.end(); ++it, ++i) { + Sample* sample = *it; + ofs << i << " " << sample->point() << std::endl; + } + ofs.close(); + } + + // RECONSTRUCTION // + + void set_parameters(const int verbose, const int mchoice, + const bool use_flip, const double alpha, const double norm_tol, + const double tang_tol, const unsigned relocation, + const double ghost) { + + m_pwsrec->set_verbose(verbose); + m_pwsrec->set_mchoice(mchoice); + m_pwsrec->set_use_flip(use_flip); + m_pwsrec->set_alpha(alpha); + m_pwsrec->set_tang_tol(tang_tol * m_bbox_size); + m_pwsrec->set_norm_tol(norm_tol * m_bbox_size); + m_pwsrec->set_relocation(relocation); + m_pwsrec->set_ghost(ghost); + } + + bool init_reconstruction(const double percentage) { + std::cout << " init_reconstruction " << std::endl; + + if (m_samples.empty()) { + std::cerr << "initialization failed (empty point set)" << std::endl; + return false; + } + + Sample_list vertices, samples; + select_samples(percentage, vertices, samples); + + PointMassList point_mass_list; + Sample_list_const_iterator it; + for (it = vertices.begin(); it != vertices.end(); it++) { + std::cout << "Sample in Scene " << (*it)->point() << " : " + << (*it)->mass() << std::endl; + point_mass_list.push_back( + std::make_pair((*it)->point(), (*it)->mass())); + } + + PointPMap point_pmap; + MassPMap mass_pmap; + MassPoint mp; + + m_pwsrec->initialize(point_mass_list.begin(), point_mass_list.end(), + point_pmap, mass_pmap); + + return true; + } + + void decimate(const double percentage) { + std::cout << "Decimate from " << m_samples.size() << " to..."; + std::list selected; + + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++) { + const double rd = random_double(0.0, 1.0); + if (rd >= percentage) + selected.push_back(*it); + } + + m_samples.clear(); + std::copy(selected.begin(), selected.end(), + std::back_inserter(m_samples)); + std::cout << m_samples.size() << std::endl; + } + + void keep_one_point_out_of(const int n) { + std::cout << "Decimate from " << m_samples.size() << " to..."; + std::list selected; + + int index = 0; + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++, index++) { + if (index % n == 0) + selected.push_back(*it); + } + + m_samples.clear(); + std::copy(selected.begin(), selected.end(), + std::back_inserter(m_samples)); + std::cout << m_samples.size() << std::endl; + } + + void select_samples(const double percentage, Sample_list& vertices, + Sample_list& samples) { + std::list::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample& s = *it; + if (s.mass() <= m_min_mass) + continue; + + samples.push_back(&s); + FT rv = random_double(0.0, 1.0); + if (rv <= percentage) + vertices.push_back(&s); + } + } + + void reconstruct_until(const unsigned nv) { + std::cout << "reconstruct_until" << std::endl; + m_pwsrec->reconstruct_until(nv); + } + + void reconstruct(const unsigned steps) { + std::cout << "reconstruct" << std::endl; + m_pwsrec->reconstruct(steps); + } + + void relocate_all_vertices() { + std::cout << "relocate_all_vertices" << std::endl; + m_pwsrec->relocate_all_vertices(); + } + + void print_stats() { + std::cout << "print_stats" << std::endl; + m_pwsrec->print_stats(); + } + + // RENDER // + + void render(const bool view_points, const bool view_vertices, + const bool view_edges, const bool view_ghost_edges, + const bool view_edge_cost, const bool view_edge_priority, + const bool view_bins, const bool view_foot_points, + const bool view_relocation, const bool view_tolerance, + const bool view_incolors, const bool view_edge_relevance, + const float point_size, const float vertex_size, + const float line_thickness) { + if (m_pwsrec == NULL) { + return; + } + + if (view_edges) + m_pwsrec->draw_edges(0.5f * line_thickness, 0.4f, 0.4f, 0.4f); + + if (view_edge_cost) + m_pwsrec->draw_costs(line_thickness, view_ghost_edges); + + if (view_edge_priority) + m_pwsrec->draw_pedges(line_thickness); + + if (view_edge_relevance) + m_pwsrec->draw_relevance(line_thickness, m_ignore, view_incolors); + + if (view_relocation) + m_pwsrec->draw_relocation(); + + if (view_vertices) + m_pwsrec->draw_vertices(vertex_size, 0.0f, 0.0f, 0.5f); + + if (view_bins) + m_pwsrec->draw_bins(0.5f * line_thickness); + + if (view_foot_points) + m_pwsrec->draw_footpoints(line_thickness, 0.2f, 0.8f, 0.2f); + + if (view_tolerance) + draw_circles(); + + if (view_points) + draw_samples(point_size); + } + + void render_simulation(const Point& point, int option, + const float vertex_size, const float line_width) { + + std::cout << "render_simulation" << std::endl; + + switch (option) { + case 0: + m_pwsrec->draw_one_ring(vertex_size, line_width, point); + break; + case 1: + m_pwsrec->draw_blocking_edges(vertex_size, line_width, point); + break; + case 2: + m_pwsrec->draw_collapsible_edge(vertex_size, line_width, point); + break; + case 3: + m_pwsrec->draw_simulation(vertex_size, line_width, point); + break; + case 4: + m_pwsrec->draw_remove_queue_stencil(vertex_size, line_width, point); + break; + case 5: + m_pwsrec->draw_cost_stencil(vertex_size, line_width, point); + break; + case 6: + m_pwsrec->draw_push_queue_stencil(vertex_size, line_width, point); + break; + default: + break; + } + } + + void draw_samples(const float point_size) { + double max_value = m_max_mass; + if (max_value == 0.0) + max_value = 1.0; + + ::glPointSize(point_size); + ::glBegin(GL_POINTS); + std::list::const_iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++) { + double mass = it->mass(); + if (mass <= m_min_mass) + continue; + + float value = mass / m_max_mass; + float grey = 0.9 * (1.0f - value); + ::glColor3f(grey, grey, grey); + const Point& p = it->point(); + ::glVertex2d(p.x(), p.y()); + } + ::glEnd(); + } + + void draw_circles() { + Sample_list vertices, samples; + select_samples(1.0, vertices, samples); + double percentage = 500.0 / double(vertices.size()); + percentage = std::min(percentage, 1.0); + + samples.clear(); + vertices.clear(); + select_samples(percentage, vertices, samples); + + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ::glColor4f(1.0f, 1.0f, 0.2f, 0.25f); + for (Sample_list_const_iterator it = samples.begin(); + it != samples.end(); it++) { + Sample* sample = *it; + draw_one_circle(sample->point()); + } + ::glDisable(GL_BLEND); + } + + void draw_one_circle(const Point& center) { + unsigned N = 10; + const double r = std::sqrt(m_pwsrec->get_norm_tol()); + const double x = center.x(); + const double y = center.y(); + ::glBegin (GL_POLYGON); + for (unsigned i = 0; i < N; ++i) { + double angle = 2.0 * M_PI * (double(i) / double(N)); + double u = r * std::cos(angle) + x; + double v = r * std::sin(angle) + y; + ::glVertex2d(u, v); + } + ::glEnd(); + } + + // PREDEFINED EXAMPLES // + + void make_line(const unsigned int nb, const Point& start, + const Point& end) { + Point curr = start; + Vector incr = (end - start) / nb; + for (unsigned int i = 0; i < nb; i++) { + add_sample(curr); + curr = curr + incr; + } + } + + void make_circle_arc(const unsigned int nb, const Point& c, + const double radius, const double min_angle = 0.0, + const double max_angle = 360.0) { + const double range = max_angle - min_angle; + const double incr = range / double(nb); + for (double angle = min_angle; angle < max_angle; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + } + } + + void append_widely_variable_sampling(const float d1, const float d2) { + double angle; + double incr = d1; + Point c = Point(0.5, 0.5); + const double radius = 0.5; + // 0-90 deg -> d1 + for (angle = 0.0; angle < 90.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + } + // 90-180 deg -> d1 -> d2 + for (angle = 90.0; angle < 180.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + incr = d1 + (d2 - d1) / 90.0 * (angle - 90); + } + // 180-270 deg -> d2 + incr = d2; + for (angle = 180.0; angle < 270.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + } + // 270-360 deg -> d2 -> d1 + incr = d2; + for (angle = 270.0; angle < 360.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + incr = d2 + (d1 - d2) / 90.0 * (angle - 270.0); + } + } + + void append_predefined_line(const int density) { + std::cerr << "append line..."; + Point start(0.0, 0.5); + Point end(1.0, 0.5); + make_line(density, start, end); + std::cerr << "done" << std::endl; + } + + void append_predefined_parallel_lines(const int nb_lines, const float space, + const int density) { + std::cerr << "append parallel lines..."; + FT x[4]; + x[0] = 0.0; + x[1] = 0.75; + x[2] = 1.0; + x[3] = 1.75; + FT y = 0.0; + for (int i = 0; i < nb_lines; ++i) { + int j = i % 2; + Point start(x[j], y); + Point end(x[j + 2], y); + make_line(density, start, end); + y += space; + } + std::cerr << "done" << std::endl; + } + + void append_predefined_circle(const int density, const float x, + const float y, const float radius) { + std::cerr << "append circle..."; + Point center(x, y); + make_circle_arc(density, center, radius); + std::cerr << "done" << std::endl; + } + + void append_predefined_spiral(const int nb_loops, const int density) { + std::cerr << "append spiral..."; + Point center(0.5, 0.5); + const FT max_radius = 0.5; + const FT spacing = 10. / density; // target spacing + double radius = max_radius; + const double max_angle = nb_loops * 360.0; + for (double angle = max_angle; angle > 0.0; /**/) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = center.x() + radius * cos(angle_rad); + double y = center.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + + const double angle_incr = atan(spacing / radius); + angle -= angle_incr; + radius = max_radius * angle / max_angle; + } + std::cerr << "done" << std::endl; + } + + void append_predefined_half_circle(const int density) { + std::cerr << "append half circle..."; + Point center(0.5, 0.5); + make_circle_arc(density, center, 0.5, 0.0, 180.0); + std::cerr << "done" << std::endl; + } + + void append_predefined_box(const int density, const float x, const float y, + const float size_x, const float size_y) { + std::cerr << "append box..."; + Point a(x - size_x / 2, y - size_y / 2); + Point b(x + size_x / 2, y - size_y / 2); + Point c(x + size_x / 2, y + size_y / 2); + Point d(x - size_x / 2, y + size_y / 2); + make_line(density, a, b); + make_line(density, b, c); + make_line(density, c, d); + make_line(density, d, a); + std::cerr << "done" << std::endl; + } + + void append_predefined_box_with_boundaries(const int density) { + std::cerr << "append box with boundaries..."; + + Point a(0.1, 0.1); + Point b(0.4, 0.1); + Point c(0.6, 0.1); + Point d(0.9, 0.1); + Point e(0.9, 0.4); + Point f(0.9, 0.6); + Point g(0.9, 0.9); + Point h(0.6, 0.9); + Point i(0.4, 0.9); + Point j(0.1, 0.9); + Point k(0.1, 0.6); + Point l(0.1, 0.4); + + make_line(density, a, b); + make_line(density, c, d); + make_line(density, d, e); + make_line(density, f, g); + make_line(density, g, h); + make_line(density, i, j); + make_line(density, j, k); + make_line(density, l, a); + + std::cerr << "done" << std::endl; + } + + void append_predefined_box_with_missing_corners(const int density) { + std::cerr << "append box with missing corners..."; + Point a(0.12, 0.1); + Point b(0.88, 0.1); + Point c(0.9, 0.12); + Point d(0.9, 0.88); + Point e(0.88, 0.9); + Point f(0.12, 0.9); + Point g(0.1, 0.88); + Point h(0.1, 0.12); + make_line(density, a, b); + make_line(density, c, d); + make_line(density, e, f); + make_line(density, g, h); + std::cerr << "done" << std::endl; + } + + void append_predefined_boxes(const int density) { + std::cerr << "append two boxes..."; + Point a(0.0, 0.0); + Point b(0.2, 0.0); + Point c(0.2, 1.0); + Point d(0.0, 1.0); + make_line(2 * density, a, b); + make_line(10 * density, b, c); + make_line(2 * density, c, d); + make_line(10 * density, d, a); + + Point e(0.3, 0.0); + Point f(0.4, 0.0); + Point g(0.4, 0.3); + Point h(0.3, 0.3); + make_line(1 * density, e, f); + make_line(3 * density, f, g); + make_line(1 * density, g, h); + make_line(3 * density, h, e); + std::cerr << "done" << std::endl; + } + + void append_predefined_stair(const int density) { + std::cerr << "append stair..."; + Point a(0.0, 0.0); + Point b(0.1, 0.0); + Point c(0.1, 0.1); + Point d(0.2, 0.1); + Point e(0.2, 0.2); + Point f(0.3, 0.2); + Point g(0.3, 0.3); + Point h(0.4, 0.3); + Point i(0.4, 0.4); + + make_line(density, a, b); + make_line(density, b, c); + make_line(density, c, d); + make_line(density, d, e); + make_line(density, e, f); + make_line(density, f, g); + make_line(density, g, h); + make_line(density, h, i); + std::cerr << "done" << std::endl; + } + + void append_predefined_skyline(const int density) { + std::cerr << "append skyline..."; + Point a(0.0, 0.0); + Point b(0.1, 0.0); + Point c(0.1, 0.5); + Point d(0.3, 0.5); + Point e(0.3, 0.2); + Point f(0.4, 0.2); + Point g(0.4, 0.4); + Point h(0.6, 0.4); + Point i(0.6, -0.1); + Point j(0.7, -0.1); + Point k(0.7, 0.2); + Point l(0.8, 0.2); + Point m(0.8, 0.7); + Point n(0.9, 0.7); + Point o(0.9, 0.5); + Point p(1.0, 0.5); + Point q(1.0, 0.1); + Point r(1.1, 0.1); + Point s(1.1, -0.1); + Point t(1.2, -0.1); + + make_line(1 * density, a, b); + make_line(5 * density, b, c); + make_line(2 * density, c, d); + make_line(3 * density, d, e); + make_line(1 * density, e, f); + make_line(2 * density, f, g); + make_line(2 * density, g, h); + make_line(5 * density, h, i); + make_line(1 * density, i, j); + make_line(3 * density, j, k); + make_line(1 * density, k, l); + make_line(5 * density, l, m); + make_line(1 * density, m, n); + make_line(2 * density, n, o); + make_line(1 * density, o, p); + make_line(4 * density, p, q); + make_line(1 * density, q, r); + make_line(2 * density, r, s); + make_line(1 * density, s, t); + std::cerr << "done" << std::endl; + } + + void append_star(const int nb_branches, const int density) { + std::cerr << "append star..."; + const double deg_in_rad = 3.1415926535897932384626 / 180.0; + const double incr = 180.0 / nb_branches; + double angle = 0.0; + const Point center(0.5, 0.5); + for (int i = 0; i < nb_branches; i++) { + const double angle_rad = angle * deg_in_rad; + Vector v(sin(angle_rad), cos(angle_rad)); + Point a = center + v; + Point b = center - v; + make_line(density, a, b); + angle += incr; + } + std::cerr << "done" << std::endl; + } + + void append_predefined_increasingly_sharp_angles(const int density, + const double min_angle) { + const double deg_in_rad = 3.1415926535897932384626 / 180.0; + double prev_angle = 0.0; + double curr_angle = min_angle; + double incr = min_angle; + const double r1 = 0.5; + const Point center(0.5, 0.5); + while (curr_angle < 360.0) { + Vector va(r1 * cos(prev_angle * deg_in_rad), + r1 * sin(prev_angle * deg_in_rad)); + Vector vb(r1 * cos(curr_angle * deg_in_rad), + r1 * sin(curr_angle * deg_in_rad)); + const double average_angle = 0.5 * (prev_angle + curr_angle); + Vector vc(r1 * cos(average_angle * deg_in_rad), + r1 * sin(average_angle * deg_in_rad)); + Point a = center + va; + Point b = center + vb; + Point c = center + 2 * vc; + + make_line(density, a, c); + make_line(density, b, c); + + prev_angle = curr_angle; + curr_angle += incr; + incr += 2.0; + } + noise(1e-5); + } +}; + +#endif // SCENE_H_ diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h new file mode 100644 index 00000000000..3da363dd12d --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h @@ -0,0 +1,316 @@ +/******************************************************************************** +** Form generated from reading UI file 'options.ui' +** +** Created by: Qt User Interface Compiler version 4.8.6 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_OPTIONS_H +#define UI_OPTIONS_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_Dialog_options +{ +public: + QDialogButtonBox *buttonBox; + QCheckBox *use_flip_checkbox; + QWidget *layoutWidget; + QVBoxLayout *vboxLayout; + QHBoxLayout *hboxLayout; + QLabel *verbose_label; + QSpinBox *verbose_spinbox; + QHBoxLayout *hboxLayout1; + QLabel *mchoice_label; + QSpinBox *mchoice_spinbox; + QHBoxLayout *hboxLayout2; + QLabel *percent_label; + QSpinBox *percent_spinbox; + QHBoxLayout *hboxLayout3; + QLabel *norm_tol_label; + QDoubleSpinBox *norm_tol_spinbox; + QHBoxLayout *hboxLayout4; + QLabel *tang_tol_label; + QDoubleSpinBox *tang_tol_spinbox; + QHBoxLayout *hboxLayout5; + QLabel *alpha_label; + QDoubleSpinBox *alpha_spinbox; + QHBoxLayout *hboxLayout6; + QLabel *relocation_label; + QSpinBox *relocation_spinbox; + QHBoxLayout *hboxLayout7; + QLabel *ghost_vs_solid_label; + QDoubleSpinBox *ghost_spinbox; + QWidget *widget; + QVBoxLayout *vboxLayout1; + QHBoxLayout *hboxLayout8; + QLabel *thickness; + QDoubleSpinBox *thickness_spinbox; + QHBoxLayout *hboxLayout9; + QLabel *point_size; + QDoubleSpinBox *point_size_spinbox; + QHBoxLayout *hboxLayout10; + QLabel *vertex_size; + QDoubleSpinBox *vertex_size_spinbox; + + void setupUi(QDialog *Dialog_options) + { + if (Dialog_options->objectName().isEmpty()) + Dialog_options->setObjectName(QString::fromUtf8("Dialog_options")); + Dialog_options->resize(409, 379); + buttonBox = new QDialogButtonBox(Dialog_options); + buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setGeometry(QRect(40, 330, 341, 32)); + buttonBox->setOrientation(Qt::Horizontal); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); + use_flip_checkbox = new QCheckBox(Dialog_options); + use_flip_checkbox->setObjectName(QString::fromUtf8("use_flip_checkbox")); + use_flip_checkbox->setGeometry(QRect(220, 20, 159, 21)); + layoutWidget = new QWidget(Dialog_options); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(20, 20, 188, 304)); + vboxLayout = new QVBoxLayout(layoutWidget); + vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setContentsMargins(0, 0, 0, 0); + hboxLayout = new QHBoxLayout(); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + verbose_label = new QLabel(layoutWidget); + verbose_label->setObjectName(QString::fromUtf8("verbose_label")); + + hboxLayout->addWidget(verbose_label); + + verbose_spinbox = new QSpinBox(layoutWidget); + verbose_spinbox->setObjectName(QString::fromUtf8("verbose_spinbox")); + verbose_spinbox->setMaximum(2); + + hboxLayout->addWidget(verbose_spinbox); + + + vboxLayout->addLayout(hboxLayout); + + hboxLayout1 = new QHBoxLayout(); + hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + mchoice_label = new QLabel(layoutWidget); + mchoice_label->setObjectName(QString::fromUtf8("mchoice_label")); + + hboxLayout1->addWidget(mchoice_label); + + mchoice_spinbox = new QSpinBox(layoutWidget); + mchoice_spinbox->setObjectName(QString::fromUtf8("mchoice_spinbox")); + mchoice_spinbox->setMaximum(100); + mchoice_spinbox->setValue(100); + + hboxLayout1->addWidget(mchoice_spinbox); + + + vboxLayout->addLayout(hboxLayout1); + + hboxLayout2 = new QHBoxLayout(); + hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + percent_label = new QLabel(layoutWidget); + percent_label->setObjectName(QString::fromUtf8("percent_label")); + + hboxLayout2->addWidget(percent_label); + + percent_spinbox = new QSpinBox(layoutWidget); + percent_spinbox->setObjectName(QString::fromUtf8("percent_spinbox")); + percent_spinbox->setMaximum(100); + percent_spinbox->setValue(100); + + hboxLayout2->addWidget(percent_spinbox); + + + vboxLayout->addLayout(hboxLayout2); + + hboxLayout3 = new QHBoxLayout(); + hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + norm_tol_label = new QLabel(layoutWidget); + norm_tol_label->setObjectName(QString::fromUtf8("norm_tol_label")); + + hboxLayout3->addWidget(norm_tol_label); + + norm_tol_spinbox = new QDoubleSpinBox(layoutWidget); + norm_tol_spinbox->setObjectName(QString::fromUtf8("norm_tol_spinbox")); + norm_tol_spinbox->setDecimals(3); + norm_tol_spinbox->setMaximum(100); + norm_tol_spinbox->setSingleStep(0.05); + norm_tol_spinbox->setValue(100); + + hboxLayout3->addWidget(norm_tol_spinbox); + + + vboxLayout->addLayout(hboxLayout3); + + hboxLayout4 = new QHBoxLayout(); + hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); + tang_tol_label = new QLabel(layoutWidget); + tang_tol_label->setObjectName(QString::fromUtf8("tang_tol_label")); + + hboxLayout4->addWidget(tang_tol_label); + + tang_tol_spinbox = new QDoubleSpinBox(layoutWidget); + tang_tol_spinbox->setObjectName(QString::fromUtf8("tang_tol_spinbox")); + tang_tol_spinbox->setDecimals(3); + tang_tol_spinbox->setMaximum(100); + tang_tol_spinbox->setSingleStep(0.05); + tang_tol_spinbox->setValue(100); + + hboxLayout4->addWidget(tang_tol_spinbox); + + + vboxLayout->addLayout(hboxLayout4); + + hboxLayout5 = new QHBoxLayout(); + hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); + alpha_label = new QLabel(layoutWidget); + alpha_label->setObjectName(QString::fromUtf8("alpha_label")); + + hboxLayout5->addWidget(alpha_label); + + alpha_spinbox = new QDoubleSpinBox(layoutWidget); + alpha_spinbox->setObjectName(QString::fromUtf8("alpha_spinbox")); + alpha_spinbox->setDecimals(3); + alpha_spinbox->setMaximum(100); + alpha_spinbox->setSingleStep(0.05); + alpha_spinbox->setValue(100); + + hboxLayout5->addWidget(alpha_spinbox); + + + vboxLayout->addLayout(hboxLayout5); + + hboxLayout6 = new QHBoxLayout(); + hboxLayout6->setObjectName(QString::fromUtf8("hboxLayout6")); + relocation_label = new QLabel(layoutWidget); + relocation_label->setObjectName(QString::fromUtf8("relocation_label")); + + hboxLayout6->addWidget(relocation_label); + + relocation_spinbox = new QSpinBox(layoutWidget); + relocation_spinbox->setObjectName(QString::fromUtf8("relocation_spinbox")); + + hboxLayout6->addWidget(relocation_spinbox); + + + vboxLayout->addLayout(hboxLayout6); + + hboxLayout7 = new QHBoxLayout(); + hboxLayout7->setObjectName(QString::fromUtf8("hboxLayout7")); + ghost_vs_solid_label = new QLabel(layoutWidget); + ghost_vs_solid_label->setObjectName(QString::fromUtf8("ghost_vs_solid_label")); + + hboxLayout7->addWidget(ghost_vs_solid_label); + + ghost_spinbox = new QDoubleSpinBox(layoutWidget); + ghost_spinbox->setObjectName(QString::fromUtf8("ghost_spinbox")); + ghost_spinbox->setDecimals(3); + ghost_spinbox->setMaximum(100); + ghost_spinbox->setSingleStep(0.05); + ghost_spinbox->setValue(100); + + hboxLayout7->addWidget(ghost_spinbox); + + + vboxLayout->addLayout(hboxLayout7); + + widget = new QWidget(Dialog_options); + widget->setObjectName(QString::fromUtf8("widget")); + widget->setGeometry(QRect(220, 210, 174, 109)); + vboxLayout1 = new QVBoxLayout(widget); + vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setContentsMargins(0, 0, 0, 0); + hboxLayout8 = new QHBoxLayout(); + hboxLayout8->setObjectName(QString::fromUtf8("hboxLayout8")); + thickness = new QLabel(widget); + thickness->setObjectName(QString::fromUtf8("thickness")); + + hboxLayout8->addWidget(thickness); + + thickness_spinbox = new QDoubleSpinBox(widget); + thickness_spinbox->setObjectName(QString::fromUtf8("thickness_spinbox")); + + hboxLayout8->addWidget(thickness_spinbox); + + + vboxLayout1->addLayout(hboxLayout8); + + hboxLayout9 = new QHBoxLayout(); + hboxLayout9->setObjectName(QString::fromUtf8("hboxLayout9")); + point_size = new QLabel(widget); + point_size->setObjectName(QString::fromUtf8("point_size")); + + hboxLayout9->addWidget(point_size); + + point_size_spinbox = new QDoubleSpinBox(widget); + point_size_spinbox->setObjectName(QString::fromUtf8("point_size_spinbox")); + + hboxLayout9->addWidget(point_size_spinbox); + + + vboxLayout1->addLayout(hboxLayout9); + + hboxLayout10 = new QHBoxLayout(); + hboxLayout10->setObjectName(QString::fromUtf8("hboxLayout10")); + vertex_size = new QLabel(widget); + vertex_size->setObjectName(QString::fromUtf8("vertex_size")); + + hboxLayout10->addWidget(vertex_size); + + vertex_size_spinbox = new QDoubleSpinBox(widget); + vertex_size_spinbox->setObjectName(QString::fromUtf8("vertex_size_spinbox")); + + hboxLayout10->addWidget(vertex_size_spinbox); + + + vboxLayout1->addLayout(hboxLayout10); + + + retranslateUi(Dialog_options); + QObject::connect(buttonBox, SIGNAL(accepted()), Dialog_options, SLOT(accept())); + QObject::connect(buttonBox, SIGNAL(rejected()), Dialog_options, SLOT(reject())); + + QMetaObject::connectSlotsByName(Dialog_options); + } // setupUi + + void retranslateUi(QDialog *Dialog_options) + { + Dialog_options->setWindowTitle(QApplication::translate("Dialog_options", "Options", 0, QApplication::UnicodeUTF8)); + use_flip_checkbox->setText(QApplication::translate("Dialog_options", "use flip", 0, QApplication::UnicodeUTF8)); + verbose_label->setText(QApplication::translate("Dialog_options", "Verbose", 0, QApplication::UnicodeUTF8)); + mchoice_label->setText(QApplication::translate("Dialog_options", "Multiply Choice #", 0, QApplication::UnicodeUTF8)); + percent_label->setText(QApplication::translate("Dialog_options", "Init with %", 0, QApplication::UnicodeUTF8)); + norm_tol_label->setText(QApplication::translate("Dialog_options", "Normal Tol", 0, QApplication::UnicodeUTF8)); + tang_tol_label->setText(QApplication::translate("Dialog_options", "Tangential Tol", 0, QApplication::UnicodeUTF8)); + alpha_label->setText(QApplication::translate("Dialog_options", "Alpha", 0, QApplication::UnicodeUTF8)); + relocation_label->setText(QApplication::translate("Dialog_options", "Relocation", 0, QApplication::UnicodeUTF8)); + ghost_vs_solid_label->setText(QApplication::translate("Dialog_options", "Ghost vs solid", 0, QApplication::UnicodeUTF8)); + thickness->setText(QApplication::translate("Dialog_options", "Line thickness", 0, QApplication::UnicodeUTF8)); + point_size->setText(QApplication::translate("Dialog_options", "Point size", 0, QApplication::UnicodeUTF8)); + vertex_size->setText(QApplication::translate("Dialog_options", "Vertex size", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class Dialog_options: public Ui_Dialog_options {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_OPTIONS_H diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h new file mode 100644 index 00000000000..946d1f3f0c0 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h @@ -0,0 +1,557 @@ +/******************************************************************************** +** Form generated from reading UI file 'pwsrec.ui' +** +** Created by: Qt User Interface Compiler version 4.8.6 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PWSREC_H +#define UI_PWSREC_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "glviewer.h" + +QT_BEGIN_NAMESPACE + +class Ui_MainWindow +{ +public: + QAction *actionQuit; + QAction *actionInsertPoint; + QAction *actionClear; + QAction *actionLoadPoints; + QAction *actionSave; + QAction *actionCircle; + QAction *actionHalf_circle; + QAction *actionBox; + QAction *actionLine; + QAction *actionReconstruction_init; + QAction *actionReconstruction_one_step; + QAction *actionView_foot_points; + QAction *actionView_points; + QAction *actionView_edges; + QAction *actionRecenter; + QAction *actionView_vertices; + QAction *actionBoxes; + QAction *actionStair; + QAction *actionSkyline; + QAction *actionView_edge_priority; + QAction *actionReconstruction_10_steps; + QAction *actionReconstruction_100_steps; + QAction *actionReconstruction_1000_steps; + QAction *actionAdd_outliers; + QAction *actionSnapshot; + QAction *actionIncreasingly_sharp_angles; + QAction *actionBox_with_boundaries; + QAction *actionBox_with_missing_corners; + QAction *actionStar; + QAction *actionSpiral; + QAction *actionSet_parameters; + QAction *actionView_edge_cost; + QAction *actionReconstruction_until; + QAction *actionParallel_lines; + QAction *actionNoise; + QAction *actionActivate_simulation; + QAction *actionView_simulation; + QAction *actionRelocate_vertices; + QAction *actionView_relocation; + QAction *actionView_ghost; + QAction *actionInvert_mass; + QAction *actionView_relevance; + QAction *actionView_tolerance; + QAction *actionView_incolors; + QAction *actionClamp_mass; + QAction *actionView_bins; + QAction *actionPrint_Stats; + QAction *actionSubdivide; + QAction *actionWidely_variable_sampling; + QAction *actionDecimate; + QAction *actionKeep_one_point_out_of_n; + QAction *actionSet_MChoice; + QWidget *centralwidget; + QGridLayout *gridLayout; + QVBoxLayout *vboxLayout; + GlViewer *viewer; + QVBoxLayout *vboxLayout1; + QSlider *min_mass_slider; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QHBoxLayout *hboxLayout1; + QLabel *label; + QSpinBox *discard_spinbox; + QStatusBar *statusbar; + QMenuBar *menubar; + QMenu *menuFile; + QMenu *menuPoint_set; + QMenu *menuPredefined; + QMenu *menuAlgorithms; + QMenu *menuReconstruction; + QMenu *menuView; + QToolBar *toolBar; + + void setupUi(QMainWindow *MainWindow) + { + if (MainWindow->objectName().isEmpty()) + MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->resize(680, 680); + actionQuit = new QAction(MainWindow); + actionQuit->setObjectName(QString::fromUtf8("actionQuit")); + actionInsertPoint = new QAction(MainWindow); + actionInsertPoint->setObjectName(QString::fromUtf8("actionInsertPoint")); + actionInsertPoint->setCheckable(true); + actionInsertPoint->setChecked(false); + QIcon icon; + icon.addFile(QString::fromUtf8(":/icons/inputPoint.png"), QSize(), QIcon::Normal, QIcon::Off); + actionInsertPoint->setIcon(icon); + actionClear = new QAction(MainWindow); + actionClear->setObjectName(QString::fromUtf8("actionClear")); + QIcon icon1; + icon1.addFile(QString::fromUtf8(":/icons/fileNew.png"), QSize(), QIcon::Normal, QIcon::Off); + actionClear->setIcon(icon1); + actionLoadPoints = new QAction(MainWindow); + actionLoadPoints->setObjectName(QString::fromUtf8("actionLoadPoints")); + QIcon icon2; + icon2.addFile(QString::fromUtf8(":/icons/fileOpen.png"), QSize(), QIcon::Normal, QIcon::Off); + actionLoadPoints->setIcon(icon2); + actionSave = new QAction(MainWindow); + actionSave->setObjectName(QString::fromUtf8("actionSave")); + QIcon icon3; + icon3.addFile(QString::fromUtf8(":/icons/fileSave.png"), QSize(), QIcon::Normal, QIcon::Off); + actionSave->setIcon(icon3); + actionCircle = new QAction(MainWindow); + actionCircle->setObjectName(QString::fromUtf8("actionCircle")); + actionHalf_circle = new QAction(MainWindow); + actionHalf_circle->setObjectName(QString::fromUtf8("actionHalf_circle")); + actionBox = new QAction(MainWindow); + actionBox->setObjectName(QString::fromUtf8("actionBox")); + actionLine = new QAction(MainWindow); + actionLine->setObjectName(QString::fromUtf8("actionLine")); + actionReconstruction_init = new QAction(MainWindow); + actionReconstruction_init->setObjectName(QString::fromUtf8("actionReconstruction_init")); + actionReconstruction_one_step = new QAction(MainWindow); + actionReconstruction_one_step->setObjectName(QString::fromUtf8("actionReconstruction_one_step")); + actionView_foot_points = new QAction(MainWindow); + actionView_foot_points->setObjectName(QString::fromUtf8("actionView_foot_points")); + actionView_foot_points->setCheckable(true); + actionView_foot_points->setChecked(false); + actionView_points = new QAction(MainWindow); + actionView_points->setObjectName(QString::fromUtf8("actionView_points")); + actionView_points->setCheckable(true); + actionView_points->setChecked(true); + actionView_edges = new QAction(MainWindow); + actionView_edges->setObjectName(QString::fromUtf8("actionView_edges")); + actionView_edges->setCheckable(true); + actionView_edges->setChecked(false); + actionRecenter = new QAction(MainWindow); + actionRecenter->setObjectName(QString::fromUtf8("actionRecenter")); + QIcon icon4; + icon4.addFile(QString::fromUtf8(":/icons/fit-page-32.png"), QSize(), QIcon::Normal, QIcon::Off); + actionRecenter->setIcon(icon4); + actionView_vertices = new QAction(MainWindow); + actionView_vertices->setObjectName(QString::fromUtf8("actionView_vertices")); + actionView_vertices->setCheckable(true); + actionView_vertices->setChecked(true); + actionBoxes = new QAction(MainWindow); + actionBoxes->setObjectName(QString::fromUtf8("actionBoxes")); + actionStair = new QAction(MainWindow); + actionStair->setObjectName(QString::fromUtf8("actionStair")); + actionSkyline = new QAction(MainWindow); + actionSkyline->setObjectName(QString::fromUtf8("actionSkyline")); + actionView_edge_priority = new QAction(MainWindow); + actionView_edge_priority->setObjectName(QString::fromUtf8("actionView_edge_priority")); + actionView_edge_priority->setCheckable(true); + actionView_edge_priority->setChecked(false); + actionReconstruction_10_steps = new QAction(MainWindow); + actionReconstruction_10_steps->setObjectName(QString::fromUtf8("actionReconstruction_10_steps")); + actionReconstruction_100_steps = new QAction(MainWindow); + actionReconstruction_100_steps->setObjectName(QString::fromUtf8("actionReconstruction_100_steps")); + actionReconstruction_1000_steps = new QAction(MainWindow); + actionReconstruction_1000_steps->setObjectName(QString::fromUtf8("actionReconstruction_1000_steps")); + actionAdd_outliers = new QAction(MainWindow); + actionAdd_outliers->setObjectName(QString::fromUtf8("actionAdd_outliers")); + actionSnapshot = new QAction(MainWindow); + actionSnapshot->setObjectName(QString::fromUtf8("actionSnapshot")); + QIcon icon5; + icon5.addFile(QString::fromUtf8(":/icons/snapshot.png"), QSize(), QIcon::Normal, QIcon::Off); + actionSnapshot->setIcon(icon5); + actionIncreasingly_sharp_angles = new QAction(MainWindow); + actionIncreasingly_sharp_angles->setObjectName(QString::fromUtf8("actionIncreasingly_sharp_angles")); + actionBox_with_boundaries = new QAction(MainWindow); + actionBox_with_boundaries->setObjectName(QString::fromUtf8("actionBox_with_boundaries")); + actionBox_with_missing_corners = new QAction(MainWindow); + actionBox_with_missing_corners->setObjectName(QString::fromUtf8("actionBox_with_missing_corners")); + actionStar = new QAction(MainWindow); + actionStar->setObjectName(QString::fromUtf8("actionStar")); + actionSpiral = new QAction(MainWindow); + actionSpiral->setObjectName(QString::fromUtf8("actionSpiral")); + actionSet_parameters = new QAction(MainWindow); + actionSet_parameters->setObjectName(QString::fromUtf8("actionSet_parameters")); + actionView_edge_cost = new QAction(MainWindow); + actionView_edge_cost->setObjectName(QString::fromUtf8("actionView_edge_cost")); + actionView_edge_cost->setCheckable(true); + actionView_edge_cost->setChecked(false); + actionReconstruction_until = new QAction(MainWindow); + actionReconstruction_until->setObjectName(QString::fromUtf8("actionReconstruction_until")); + actionParallel_lines = new QAction(MainWindow); + actionParallel_lines->setObjectName(QString::fromUtf8("actionParallel_lines")); + actionNoise = new QAction(MainWindow); + actionNoise->setObjectName(QString::fromUtf8("actionNoise")); + actionActivate_simulation = new QAction(MainWindow); + actionActivate_simulation->setObjectName(QString::fromUtf8("actionActivate_simulation")); + actionActivate_simulation->setCheckable(true); + QIcon icon6; + icon6.addFile(QString::fromUtf8(":/icons/vertex.png"), QSize(), QIcon::Normal, QIcon::Off); + actionActivate_simulation->setIcon(icon6); + actionView_simulation = new QAction(MainWindow); + actionView_simulation->setObjectName(QString::fromUtf8("actionView_simulation")); + actionRelocate_vertices = new QAction(MainWindow); + actionRelocate_vertices->setObjectName(QString::fromUtf8("actionRelocate_vertices")); + actionView_relocation = new QAction(MainWindow); + actionView_relocation->setObjectName(QString::fromUtf8("actionView_relocation")); + actionView_relocation->setCheckable(true); + actionView_ghost = new QAction(MainWindow); + actionView_ghost->setObjectName(QString::fromUtf8("actionView_ghost")); + actionView_ghost->setCheckable(true); + actionView_ghost->setChecked(false); + actionInvert_mass = new QAction(MainWindow); + actionInvert_mass->setObjectName(QString::fromUtf8("actionInvert_mass")); + actionView_relevance = new QAction(MainWindow); + actionView_relevance->setObjectName(QString::fromUtf8("actionView_relevance")); + actionView_relevance->setCheckable(true); + actionView_relevance->setChecked(true); + actionView_tolerance = new QAction(MainWindow); + actionView_tolerance->setObjectName(QString::fromUtf8("actionView_tolerance")); + actionView_tolerance->setCheckable(true); + actionView_incolors = new QAction(MainWindow); + actionView_incolors->setObjectName(QString::fromUtf8("actionView_incolors")); + actionView_incolors->setCheckable(true); + actionView_incolors->setChecked(false); + actionClamp_mass = new QAction(MainWindow); + actionClamp_mass->setObjectName(QString::fromUtf8("actionClamp_mass")); + actionView_bins = new QAction(MainWindow); + actionView_bins->setObjectName(QString::fromUtf8("actionView_bins")); + actionView_bins->setCheckable(true); + actionPrint_Stats = new QAction(MainWindow); + actionPrint_Stats->setObjectName(QString::fromUtf8("actionPrint_Stats")); + actionSubdivide = new QAction(MainWindow); + actionSubdivide->setObjectName(QString::fromUtf8("actionSubdivide")); + actionWidely_variable_sampling = new QAction(MainWindow); + actionWidely_variable_sampling->setObjectName(QString::fromUtf8("actionWidely_variable_sampling")); + actionDecimate = new QAction(MainWindow); + actionDecimate->setObjectName(QString::fromUtf8("actionDecimate")); + actionKeep_one_point_out_of_n = new QAction(MainWindow); + actionKeep_one_point_out_of_n->setObjectName(QString::fromUtf8("actionKeep_one_point_out_of_n")); + actionSet_MChoice = new QAction(MainWindow); + actionSet_MChoice->setObjectName(QString::fromUtf8("actionSet_MChoice")); + actionSet_MChoice->setCheckable(true); + centralwidget = new QWidget(MainWindow); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + gridLayout = new QGridLayout(centralwidget); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + vboxLayout = new QVBoxLayout(); + vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + viewer = new GlViewer(centralwidget); + viewer->setObjectName(QString::fromUtf8("viewer")); + viewer->setFocusPolicy(Qt::StrongFocus); + viewer->setLocale(QLocale(QLocale::English, QLocale::UnitedStates)); + + vboxLayout->addWidget(viewer); + + vboxLayout1 = new QVBoxLayout(); + vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + min_mass_slider = new QSlider(centralwidget); + min_mass_slider->setObjectName(QString::fromUtf8("min_mass_slider")); + min_mass_slider->setOrientation(Qt::Horizontal); + + vboxLayout1->addWidget(min_mass_slider); + + hboxLayout = new QHBoxLayout(); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + hboxLayout1 = new QHBoxLayout(); + hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + label = new QLabel(centralwidget); + label->setObjectName(QString::fromUtf8("label")); + + hboxLayout1->addWidget(label); + + discard_spinbox = new QSpinBox(centralwidget); + discard_spinbox->setObjectName(QString::fromUtf8("discard_spinbox")); + discard_spinbox->setMaximum(10000); + + hboxLayout1->addWidget(discard_spinbox); + + + hboxLayout->addLayout(hboxLayout1); + + + vboxLayout1->addLayout(hboxLayout); + + + vboxLayout->addLayout(vboxLayout1); + + + gridLayout->addLayout(vboxLayout, 0, 0, 1, 1); + + MainWindow->setCentralWidget(centralwidget); + statusbar = new QStatusBar(MainWindow); + statusbar->setObjectName(QString::fromUtf8("statusbar")); + MainWindow->setStatusBar(statusbar); + menubar = new QMenuBar(MainWindow); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 680, 22)); + menuFile = new QMenu(menubar); + menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuPoint_set = new QMenu(menubar); + menuPoint_set->setObjectName(QString::fromUtf8("menuPoint_set")); + menuPredefined = new QMenu(menuPoint_set); + menuPredefined->setObjectName(QString::fromUtf8("menuPredefined")); + menuAlgorithms = new QMenu(menubar); + menuAlgorithms->setObjectName(QString::fromUtf8("menuAlgorithms")); + menuReconstruction = new QMenu(menuAlgorithms); + menuReconstruction->setObjectName(QString::fromUtf8("menuReconstruction")); + menuView = new QMenu(menubar); + menuView->setObjectName(QString::fromUtf8("menuView")); + MainWindow->setMenuBar(menubar); + toolBar = new QToolBar(MainWindow); + toolBar->setObjectName(QString::fromUtf8("toolBar")); + toolBar->setLocale(QLocale(QLocale::English, QLocale::UnitedStates)); + MainWindow->addToolBar(Qt::TopToolBarArea, toolBar); + QWidget::setTabOrder(min_mass_slider, discard_spinbox); + + menubar->addAction(menuFile->menuAction()); + menubar->addAction(menuPoint_set->menuAction()); + menubar->addAction(menuAlgorithms->menuAction()); + menubar->addAction(menuView->menuAction()); + menuFile->addAction(actionLoadPoints); + menuFile->addAction(actionSave); + menuFile->addAction(actionSnapshot); + menuFile->addAction(actionQuit); + menuPoint_set->addAction(menuPredefined->menuAction()); + menuPoint_set->addAction(actionNoise); + menuPoint_set->addAction(actionAdd_outliers); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionDecimate); + menuPoint_set->addAction(actionKeep_one_point_out_of_n); + menuPoint_set->addAction(actionSubdivide); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionInvert_mass); + menuPoint_set->addAction(actionClamp_mass); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionInsertPoint); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionClear); + menuPredefined->addAction(actionLine); + menuPredefined->addAction(actionParallel_lines); + menuPredefined->addAction(actionCircle); + menuPredefined->addAction(actionHalf_circle); + menuPredefined->addAction(actionWidely_variable_sampling); + menuPredefined->addAction(actionSpiral); + menuPredefined->addAction(actionBox); + menuPredefined->addAction(actionBoxes); + menuPredefined->addAction(actionBox_with_boundaries); + menuPredefined->addAction(actionBox_with_missing_corners); + menuPredefined->addAction(actionStar); + menuPredefined->addAction(actionStair); + menuPredefined->addAction(actionSkyline); + menuPredefined->addAction(actionIncreasingly_sharp_angles); + menuAlgorithms->addAction(actionSet_parameters); + menuAlgorithms->addAction(actionSet_MChoice); + menuAlgorithms->addSeparator(); + menuAlgorithms->addAction(actionReconstruction_init); + menuAlgorithms->addAction(menuReconstruction->menuAction()); + menuAlgorithms->addAction(actionRelocate_vertices); + menuAlgorithms->addSeparator(); + menuAlgorithms->addAction(actionPrint_Stats); + menuReconstruction->addAction(actionReconstruction_one_step); + menuReconstruction->addAction(actionReconstruction_10_steps); + menuReconstruction->addAction(actionReconstruction_100_steps); + menuReconstruction->addAction(actionReconstruction_1000_steps); + menuReconstruction->addAction(actionReconstruction_until); + menuView->addAction(actionView_points); + menuView->addSeparator(); + menuView->addAction(actionView_vertices); + menuView->addAction(actionView_edges); + menuView->addSeparator(); + menuView->addAction(actionView_ghost); + menuView->addAction(actionView_relevance); + menuView->addAction(actionView_incolors); + menuView->addSeparator(); + menuView->addAction(actionView_edge_cost); + menuView->addAction(actionView_edge_priority); + menuView->addSeparator(); + menuView->addAction(actionView_bins); + menuView->addAction(actionView_foot_points); + menuView->addAction(actionView_relocation); + menuView->addAction(actionView_tolerance); + menuView->addSeparator(); + menuView->addAction(actionActivate_simulation); + menuView->addAction(actionView_simulation); + menuView->addSeparator(); + menuView->addAction(actionRecenter); + toolBar->addAction(actionClear); + toolBar->addAction(actionLoadPoints); + toolBar->addAction(actionSave); + toolBar->addAction(actionSnapshot); + toolBar->addSeparator(); + toolBar->addAction(actionInsertPoint); + toolBar->addAction(actionActivate_simulation); + toolBar->addSeparator(); + toolBar->addAction(actionRecenter); + + retranslateUi(MainWindow); + + QMetaObject::connectSlotsByName(MainWindow); + } // setupUi + + void retranslateUi(QMainWindow *MainWindow) + { + MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Reconstruction_simplification_2 Demo", 0, QApplication::UnicodeUTF8)); + actionQuit->setText(QApplication::translate("MainWindow", "Quit", 0, QApplication::UnicodeUTF8)); + actionQuit->setShortcut(QApplication::translate("MainWindow", "Ctrl+Q", 0, QApplication::UnicodeUTF8)); + actionInsertPoint->setText(QApplication::translate("MainWindow", "Insert mode", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + actionInsertPoint->setToolTip(QApplication::translate("MainWindow", "Insert Point", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP +#ifndef QT_NO_STATUSTIP + actionInsertPoint->setStatusTip(QApplication::translate("MainWindow", "Insert Point", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionClear->setText(QApplication::translate("MainWindow", "Clear", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_STATUSTIP + actionClear->setStatusTip(QApplication::translate("MainWindow", "Clear", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionClear->setShortcut(QApplication::translate("MainWindow", "Space", 0, QApplication::UnicodeUTF8)); + actionLoadPoints->setText(QApplication::translate("MainWindow", "Load Points", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_STATUSTIP + actionLoadPoints->setStatusTip(QApplication::translate("MainWindow", "Load Points", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionLoadPoints->setShortcut(QApplication::translate("MainWindow", "Ctrl+O", 0, QApplication::UnicodeUTF8)); + actionSave->setText(QApplication::translate("MainWindow", "Save", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_STATUSTIP + actionSave->setStatusTip(QApplication::translate("MainWindow", "Save Points", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionSave->setShortcut(QApplication::translate("MainWindow", "Ctrl+S", 0, QApplication::UnicodeUTF8)); + actionCircle->setText(QApplication::translate("MainWindow", "Circle...", 0, QApplication::UnicodeUTF8)); + actionHalf_circle->setText(QApplication::translate("MainWindow", "Half circle...", 0, QApplication::UnicodeUTF8)); + actionBox->setText(QApplication::translate("MainWindow", "Box...", 0, QApplication::UnicodeUTF8)); + actionBox->setShortcut(QApplication::translate("MainWindow", "B", 0, QApplication::UnicodeUTF8)); + actionLine->setText(QApplication::translate("MainWindow", "Line...", 0, QApplication::UnicodeUTF8)); + actionReconstruction_init->setText(QApplication::translate("MainWindow", "Init", 0, QApplication::UnicodeUTF8)); + actionReconstruction_init->setShortcut(QApplication::translate("MainWindow", "I", 0, QApplication::UnicodeUTF8)); + actionReconstruction_one_step->setText(QApplication::translate("MainWindow", "1 step", 0, QApplication::UnicodeUTF8)); + actionReconstruction_one_step->setShortcut(QApplication::translate("MainWindow", "R", 0, QApplication::UnicodeUTF8)); + actionView_foot_points->setText(QApplication::translate("MainWindow", "Foot points", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_STATUSTIP + actionView_foot_points->setStatusTip(QApplication::translate("MainWindow", "View foot points", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionView_foot_points->setShortcut(QApplication::translate("MainWindow", "T", 0, QApplication::UnicodeUTF8)); + actionView_points->setText(QApplication::translate("MainWindow", "Points", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_STATUSTIP + actionView_points->setStatusTip(QApplication::translate("MainWindow", "View points", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionView_points->setShortcut(QApplication::translate("MainWindow", "P", 0, QApplication::UnicodeUTF8)); + actionView_edges->setText(QApplication::translate("MainWindow", "Edges", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_STATUSTIP + actionView_edges->setStatusTip(QApplication::translate("MainWindow", "View edges", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_STATUSTIP + actionView_edges->setShortcut(QApplication::translate("MainWindow", "E", 0, QApplication::UnicodeUTF8)); + actionRecenter->setText(QApplication::translate("MainWindow", "Recenter", 0, QApplication::UnicodeUTF8)); + actionView_vertices->setText(QApplication::translate("MainWindow", "Vertices", 0, QApplication::UnicodeUTF8)); + actionView_vertices->setShortcut(QApplication::translate("MainWindow", "V", 0, QApplication::UnicodeUTF8)); + actionBoxes->setText(QApplication::translate("MainWindow", "Two boxes...", 0, QApplication::UnicodeUTF8)); + actionStair->setText(QApplication::translate("MainWindow", "Stair...", 0, QApplication::UnicodeUTF8)); + actionSkyline->setText(QApplication::translate("MainWindow", "Skyline...", 0, QApplication::UnicodeUTF8)); + actionView_edge_priority->setText(QApplication::translate("MainWindow", "Edge priority", 0, QApplication::UnicodeUTF8)); + actionView_edge_priority->setShortcut(QApplication::translate("MainWindow", "Z", 0, QApplication::UnicodeUTF8)); + actionReconstruction_10_steps->setText(QApplication::translate("MainWindow", "10 steps", 0, QApplication::UnicodeUTF8)); + actionReconstruction_10_steps->setShortcut(QApplication::translate("MainWindow", "1", 0, QApplication::UnicodeUTF8)); + actionReconstruction_100_steps->setText(QApplication::translate("MainWindow", "100 steps", 0, QApplication::UnicodeUTF8)); + actionReconstruction_100_steps->setShortcut(QApplication::translate("MainWindow", "2", 0, QApplication::UnicodeUTF8)); + actionReconstruction_1000_steps->setText(QApplication::translate("MainWindow", "1000 steps", 0, QApplication::UnicodeUTF8)); + actionReconstruction_1000_steps->setShortcut(QApplication::translate("MainWindow", "3", 0, QApplication::UnicodeUTF8)); + actionAdd_outliers->setText(QApplication::translate("MainWindow", "Add outliers", 0, QApplication::UnicodeUTF8)); + actionAdd_outliers->setShortcut(QApplication::translate("MainWindow", "O", 0, QApplication::UnicodeUTF8)); + actionSnapshot->setText(QApplication::translate("MainWindow", "Snapshot", 0, QApplication::UnicodeUTF8)); + actionSnapshot->setShortcut(QApplication::translate("MainWindow", "Ctrl+C", 0, QApplication::UnicodeUTF8)); + actionIncreasingly_sharp_angles->setText(QApplication::translate("MainWindow", "Increasingly sharp angles...", 0, QApplication::UnicodeUTF8)); + actionBox_with_boundaries->setText(QApplication::translate("MainWindow", "Box with boundaries...", 0, QApplication::UnicodeUTF8)); + actionBox_with_missing_corners->setText(QApplication::translate("MainWindow", "Box with missing corners...", 0, QApplication::UnicodeUTF8)); + actionStar->setText(QApplication::translate("MainWindow", "Star...", 0, QApplication::UnicodeUTF8)); + actionSpiral->setText(QApplication::translate("MainWindow", "Spiral...", 0, QApplication::UnicodeUTF8)); + actionSet_parameters->setText(QApplication::translate("MainWindow", "Parameters", 0, QApplication::UnicodeUTF8)); + actionSet_parameters->setShortcut(QApplication::translate("MainWindow", "Ctrl+P", 0, QApplication::UnicodeUTF8)); + actionView_edge_cost->setText(QApplication::translate("MainWindow", "Edge cost", 0, QApplication::UnicodeUTF8)); + actionView_edge_cost->setShortcut(QApplication::translate("MainWindow", "C", 0, QApplication::UnicodeUTF8)); + actionReconstruction_until->setText(QApplication::translate("MainWindow", "until", 0, QApplication::UnicodeUTF8)); + actionReconstruction_until->setShortcut(QApplication::translate("MainWindow", "U", 0, QApplication::UnicodeUTF8)); + actionParallel_lines->setText(QApplication::translate("MainWindow", "Parallel lines...", 0, QApplication::UnicodeUTF8)); + actionNoise->setText(QApplication::translate("MainWindow", "Noise", 0, QApplication::UnicodeUTF8)); + actionNoise->setShortcut(QApplication::translate("MainWindow", "N", 0, QApplication::UnicodeUTF8)); + actionActivate_simulation->setText(QApplication::translate("MainWindow", "Simulation", 0, QApplication::UnicodeUTF8)); + actionView_simulation->setText(QApplication::translate("MainWindow", "Simulation stage", 0, QApplication::UnicodeUTF8)); + actionView_simulation->setShortcut(QApplication::translate("MainWindow", "A", 0, QApplication::UnicodeUTF8)); + actionRelocate_vertices->setText(QApplication::translate("MainWindow", "Relocate", 0, QApplication::UnicodeUTF8)); + actionRelocate_vertices->setShortcut(QApplication::translate("MainWindow", "L", 0, QApplication::UnicodeUTF8)); + actionView_relocation->setText(QApplication::translate("MainWindow", "Relocation", 0, QApplication::UnicodeUTF8)); + actionView_relocation->setShortcut(QApplication::translate("MainWindow", "Shift+L", 0, QApplication::UnicodeUTF8)); + actionView_ghost->setText(QApplication::translate("MainWindow", "Ghost edges", 0, QApplication::UnicodeUTF8)); + actionView_ghost->setShortcut(QApplication::translate("MainWindow", "G", 0, QApplication::UnicodeUTF8)); + actionInvert_mass->setText(QApplication::translate("MainWindow", "Invert mass", 0, QApplication::UnicodeUTF8)); + actionInvert_mass->setShortcut(QApplication::translate("MainWindow", "Shift+I", 0, QApplication::UnicodeUTF8)); + actionView_relevance->setText(QApplication::translate("MainWindow", "Relevance", 0, QApplication::UnicodeUTF8)); + actionView_relevance->setShortcut(QApplication::translate("MainWindow", "Shift+R", 0, QApplication::UnicodeUTF8)); + actionView_tolerance->setText(QApplication::translate("MainWindow", "Tolerance", 0, QApplication::UnicodeUTF8)); + actionView_tolerance->setShortcut(QApplication::translate("MainWindow", "Shift+T", 0, QApplication::UnicodeUTF8)); + actionView_incolors->setText(QApplication::translate("MainWindow", "In colors", 0, QApplication::UnicodeUTF8)); + actionClamp_mass->setText(QApplication::translate("MainWindow", "Clamp mass", 0, QApplication::UnicodeUTF8)); + actionView_bins->setText(QApplication::translate("MainWindow", "Bins", 0, QApplication::UnicodeUTF8)); + actionView_bins->setShortcut(QApplication::translate("MainWindow", "Shift+B", 0, QApplication::UnicodeUTF8)); + actionPrint_Stats->setText(QApplication::translate("MainWindow", "Print Stats", 0, QApplication::UnicodeUTF8)); + actionPrint_Stats->setShortcut(QApplication::translate("MainWindow", "Shift+S", 0, QApplication::UnicodeUTF8)); + actionSubdivide->setText(QApplication::translate("MainWindow", "Subdivide", 0, QApplication::UnicodeUTF8)); + actionWidely_variable_sampling->setText(QApplication::translate("MainWindow", "Widely variable sampling", 0, QApplication::UnicodeUTF8)); + actionDecimate->setText(QApplication::translate("MainWindow", "Decimate", 0, QApplication::UnicodeUTF8)); + actionKeep_one_point_out_of_n->setText(QApplication::translate("MainWindow", "One point out of n", 0, QApplication::UnicodeUTF8)); + actionSet_MChoice->setText(QApplication::translate("MainWindow", "Multiple Choice", 0, QApplication::UnicodeUTF8)); + actionSet_MChoice->setShortcut(QApplication::translate("MainWindow", "M", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MainWindow", "Discard", 0, QApplication::UnicodeUTF8)); + menuFile->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8)); + menuPoint_set->setTitle(QApplication::translate("MainWindow", "Data", 0, QApplication::UnicodeUTF8)); + menuPredefined->setTitle(QApplication::translate("MainWindow", "Predefined", 0, QApplication::UnicodeUTF8)); + menuAlgorithms->setTitle(QApplication::translate("MainWindow", "Algorithms", 0, QApplication::UnicodeUTF8)); + menuReconstruction->setTitle(QApplication::translate("MainWindow", "Decimate", 0, QApplication::UnicodeUTF8)); + menuView->setTitle(QApplication::translate("MainWindow", "View", 0, QApplication::UnicodeUTF8)); + toolBar->setWindowTitle(QApplication::translate("MainWindow", "toolBar", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class MainWindow: public Ui_MainWindow {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PWSREC_H diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp new file mode 100644 index 00000000000..5c4fd392797 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp @@ -0,0 +1,728 @@ +// STL +#include + +// Qt +#include +#include +#include +#include +#include +#include + +// local +#include "window.h" +#include "ui_options.h" +#include "dialog_options.h" + +MainWindow::MainWindow() : +QMainWindow(), Ui_MainWindow(), +maxNumRecentFiles(15), recentFileActs(15) +{ + setupUi(this); + + // init scene + m_scene = new Scene; + viewer->set_scene(m_scene); + + // options + m_verbose = 0; + m_mchoice = 0; + m_ghost = 1.0; + m_alpha = 50.0; + m_use_flip = true; + m_percent = 100.0; + m_norm_tol = 100.0; + m_tang_tol = 100.0; + m_relocation = 0; + + // accepts drop events + setAcceptDrops(true); + + // Handling actions + addRecentFiles(menuFile, actionQuit); + connect(actionQuit, SIGNAL(triggered()), this, SLOT(close())); + connect(min_mass_slider, SIGNAL(valueChanged(int)), this, SLOT(update())); + connect(discard_spinbox, SIGNAL(valueChanged(int)), this, SLOT(update())); + connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); +} + +MainWindow::~MainWindow() +{ + delete m_scene; +} + +void MainWindow::addToRecentFiles(QString fileName) +{ + QSettings settings; + QStringList files = settings.value("recentFileList").toStringList(); + files.removeAll(fileName); + files.prepend(fileName); + while (files.size() > (int)maxNumRecentFiles) + files.removeLast(); + settings.setValue("recentFileList", files); + updateRecentFileActions(); +} + +void MainWindow::dropEvent(QDropEvent *event) +{ + Q_FOREACH(QUrl url, event->mimeData()->urls()) + { + QString filename = url.toLocalFile(); + if (!filename.isEmpty()) + { + QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename); + open(filename); + } + } + event->acceptProposedAction(); +} + +void MainWindow::closeEvent(QCloseEvent *event) +{ + event->accept(); +} + +void MainWindow::dragEnterEvent(QDragEnterEvent *event) +{ + if (event->mimeData()->hasFormat("text/uri-list")) + event->acceptProposedAction(); +} + +void MainWindow::openRecentFile_aux() +{ + QAction* action = qobject_cast(sender()); + if (action) + emit openRecentFile(action->data().toString()); +} + +void MainWindow::updateRecentFileActions() +{ + QSettings settings; + QStringList files = settings.value("recentFileList").toStringList(); + + int numRecentFiles = qMin(files.size(), (int)maxNumberOfRecentFiles()); + for (int i = 0; i < numRecentFiles; ++i) { + QString strippedName = QFileInfo(files[i]).fileName(); + QString text = tr("&%1 %2").arg(i).arg(strippedName); + recentFileActs[i]->setText(text); + recentFileActs[i]->setData(files[i]); + recentFileActs[i]->setVisible(true); + } + for (unsigned int j = numRecentFiles; j < maxNumberOfRecentFiles(); ++j) + recentFileActs[j]->setVisible(false); + + recentFilesSeparator->setVisible(numRecentFiles > 0); +} + +void MainWindow::addRecentFiles(QMenu* menu, QAction* insertBeforeAction) +{ + if (insertBeforeAction) + recentFilesSeparator = menu->insertSeparator(insertBeforeAction); + else + recentFilesSeparator = menu->addSeparator(); + recentFilesSeparator->setVisible(false); + + for (unsigned int i = 0; i < maxNumberOfRecentFiles(); ++i) { + recentFileActs[i] = new QAction(this); + recentFileActs[i]->setVisible(false); + connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile_aux())); + if (insertBeforeAction) + menu->insertAction(insertBeforeAction, recentFileActs[i]); + else + menu->addAction(recentFileActs[i]); + } + updateRecentFileActions(); +} + +void MainWindow::open(const QString& filename) +{ + bool use_grad = false; + if (filename.contains(".bmp", Qt::CaseInsensitive)) + { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, tr("Open BMP"), "Use gradient?", + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); + if (reply == QMessageBox::Yes) + use_grad = true; + else if (reply == QMessageBox::No) + use_grad = false; + else + return; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->load(filename, use_grad); + QApplication::restoreOverrideCursor(); + addToRecentFiles(filename); + update(); +} + +void MainWindow::save(const QString& filename) +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->save(filename); + QApplication::restoreOverrideCursor(); + std::cout << "File " << filename.toStdString() << " saved" << std::endl; +} + +void MainWindow::update() +{ + m_scene->set_min_mass(min_mass()); + m_scene->set_nb_edges_to_ignore(ignore_edges()); + viewer->repaint(); +} + +void MainWindow::on_actionClear_triggered() +{ + m_scene->clear(); + update(); +} + +void MainWindow::on_actionLoadPoints_triggered() +{ + QString fileName = + QFileDialog::getOpenFileName(this, tr("Open point set"), "."); + if (fileName.isEmpty()) return; + open(fileName); +} + +void MainWindow::on_actionSave_triggered() +{ + QString filename = + QFileDialog::getSaveFileName(this, tr("Save point set"), "."); + if (filename.isEmpty()) return; + save(filename); +} + +void MainWindow::on_actionSnapshot_triggered() +{ + std::cout << "snapshot..."; + QApplication::setOverrideCursor(Qt::WaitCursor); + QClipboard *qb = QApplication::clipboard(); + viewer->makeCurrent(); + viewer->raise(); + QImage snapshot = viewer->grabFrameBuffer(true); + qb->setImage(snapshot); + QApplication::restoreOverrideCursor(); + std::cout << "done" << std::endl; +} + +void MainWindow::on_actionInsertPoint_toggled() +{ + viewer->toggle_insert_points(); + update(); +} + +void MainWindow::on_actionRecenter_triggered() +{ + double center_x, center_y, scale; + m_scene->compute_bbox(center_x, center_y, scale); + viewer->set_camera(center_x, center_y, 1. / scale); + update(); +} + +void MainWindow::on_actionInvert_mass_triggered() +{ + m_scene->invert_mass(); + update(); +} + +void MainWindow::on_actionClamp_mass_triggered() +{ + m_scene->clamp_mass(); + update(); +} + +/////////////////////////// +// PREDEFINED POINT SETS // +/////////////////////////// + +void MainWindow::on_actionCircle_triggered() +{ + bool ok; + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 300, 10, 10000, 1, &ok); + if (!ok) return; + + float x = QInputDialog::getDouble( + this, tr("Center x"), tr("Center x:"), 0.0, 0.0, 10, 1, &ok); + if (!ok) return; + + float y = QInputDialog::getDouble( + this, tr("Center y"), tr("Center y:"), 0.0, 0.0, 10, 1, &ok); + if (!ok) return; + + float radius = QInputDialog::getDouble( + this, tr("Radius"), tr("Radius:"), 0.5, 0.1, 10, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_circle(density, x, y, radius); + update(); +} + +void MainWindow::on_actionHalf_circle_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 150, 10, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_half_circle(density); + update(); +} + +void MainWindow::on_actionSpiral_triggered() +{ + bool ok; + + int loops = QInputDialog::getInteger( + this, tr("Loops"), tr("Number:"), 3, 1, 10000, 1, &ok); + if (!ok) return; + + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_spiral(loops,density); + update(); +} + + +void MainWindow::on_actionLine_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 50, 1, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_line(density); + update(); +} + +void MainWindow::on_actionBox_triggered() +{ + bool ok; + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); + if (!ok) return; + + float x = QInputDialog::getDouble( + this, tr("x"), tr("x:"), 0.0, 0.0, 10.0, 1, &ok); + if (!ok) return; + + float y = QInputDialog::getDouble( + this, tr("y"), tr("y:"), 0.0, 0.0, 10.0, 1, &ok); + if (!ok) return; + + float sx = QInputDialog::getDouble( + this, tr("size x"), tr("size x:"), 1.0, 0.1, 10.0, 1, &ok); + if (!ok) return; + + float sy = QInputDialog::getDouble( + this, tr("size y"), tr("size y:"), 1.0, 0.1, 10.0, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_box(density, x, y, sx, sy); + update(); +} + +void MainWindow::on_actionBoxes_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_boxes(density); + update(); +} + +void MainWindow::on_actionParallel_lines_triggered() +{ + bool ok; + + int lines = QInputDialog::getInteger( + this, tr("Lines"), tr("Number:"), 3, 1, 10000, 1, &ok); + if(!ok) return; + + float space = QInputDialog::getDouble( + this, tr("Space"), tr("Space:"), 0.2, 0.1, 10, 1, &ok); + if (!ok) return; + + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if(!ok) return; + + m_scene->append_predefined_parallel_lines(lines, space, density); + update(); +} + +void MainWindow::on_actionBox_with_boundaries_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_box_with_boundaries(density); + update(); +} + +void MainWindow::on_actionBox_with_missing_corners_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_box_with_missing_corners(density); + update(); +} + +void MainWindow::on_actionStar_triggered() +{ + bool ok; + int nb_branches = QInputDialog::getInteger( + this, tr("Branches"), tr("Branches:"), 20, 2, 10000, 1, &ok); + if(!ok) return; + + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 100, 10, 10000, 1, &ok); + if(!ok) return; + + m_scene->append_star(nb_branches,density); + update(); +} + + +void MainWindow::on_actionStair_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 30, 2, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_stair(density); + on_actionRecenter_triggered(); + update(); +} + +void MainWindow::on_actionSkyline_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; + + m_scene->append_predefined_skyline(density); + on_actionRecenter_triggered(); + update(); +} + +void MainWindow::on_actionIncreasingly_sharp_angles_triggered() +{ + bool ok; + unsigned density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); + if (!ok) return; + + double min_angle = QInputDialog::getDouble( + this, tr("Min Angle"), tr("Min Angle:"), 1.0, 1.0, 360.0, 1.0, &ok); + if (!ok) return; + + m_scene->append_predefined_increasingly_sharp_angles(density, min_angle); + on_actionRecenter_triggered(); + update(); +} + +void MainWindow::on_actionWidely_variable_sampling_triggered() +{ + bool ok; + float d1 = QInputDialog::getDouble( + this, tr("Delta-angle"), tr("Delta-angle:"), 1, 0.01, 20.0, 0.01, &ok); + if (!ok) return; + + float d2 = QInputDialog::getDouble( + this, tr("Delta-angle"), tr("Delta-angle:"), 10, 0.01, 30.0, 0.01, &ok); + if (!ok) return; + + m_scene->append_widely_variable_sampling(d1, d2); + update(); +} + +void MainWindow::on_actionNoise_triggered() +{ + bool ok; + double noise = QInputDialog::getDouble( + this, tr("Noise"), tr("Amount:"), 0.003, 0.0, 1000.0, 8, &ok); + if (!ok) return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->noise(noise); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionAdd_outliers_triggered() +{ + bool ok; + unsigned int nb = (unsigned) + QInputDialog::getInteger( + this, tr("Outliers"), tr("How many:"), 10, 1, 100000, 1, &ok); + if (!ok) return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->add_outliers(nb); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionSubdivide_triggered() +{ + m_scene->subdivide(); + update(); +} + +void MainWindow::on_actionDecimate_triggered() +{ + bool ok; + int percent = QInputDialog::getInteger( + this, tr("Decimate"), tr("Percentage:"), 50, 1, 100, 1, &ok); + if (!ok) return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + const double percentage = double(percent) / 100.0; + m_scene->decimate(percentage); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionKeep_one_point_out_of_n_triggered() +{ + bool ok; + int n = QInputDialog::getInteger( + this, tr("Keep one point out of"), tr("n:"), 2, 2, 1000, 1, &ok); + if (!ok) return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->keep_one_point_out_of(n); + QApplication::restoreOverrideCursor(); + update(); +} + +//////////////////// +// RECONSTRUCTION // +//////////////////// + +void MainWindow::set_scene_parameters() +{ + m_scene->set_parameters(m_verbose, m_mchoice, m_use_flip, + alpha(), norm_tol(), tang_tol(), + m_relocation, m_ghost); +} + +void MainWindow::on_actionReconstruction_init_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->init_reconstruction(percentage()); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionReconstruction_one_step_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(1); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionReconstruction_10_steps_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(10); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionReconstruction_100_steps_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(100); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionReconstruction_1000_steps_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(1000); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionReconstruction_until_triggered() +{ + bool ok; + int nb_points = QInputDialog::getInteger( + this, tr("Number of Points"), tr("Nb:"), 4, 1, 1000000, 1, &ok); + if (!ok) return; + + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct_until(nb_points); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionRelocate_vertices_triggered() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->relocate_all_vertices(); + QApplication::restoreOverrideCursor(); + update(); +} + +void MainWindow::on_actionPrint_Stats_triggered() +{ + m_scene->print_stats(); +} + +////////// +// VIEW // +////////// + +void MainWindow::on_actionView_points_toggled() +{ + viewer->toggle_view_points(); + update(); +} + +void MainWindow::on_actionView_vertices_toggled() +{ + viewer->toggle_view_vertices(); + update(); +} + +void MainWindow::on_actionView_edges_toggled() +{ + viewer->toggle_view_edges(); + update(); +} + +void MainWindow::on_actionView_ghost_toggled() +{ + viewer->toggle_view_ghost_edges(); + update(); +} + +void MainWindow::on_actionView_edge_cost_toggled() +{ + viewer->toggle_view_edge_cost(); + update(); +} + +void MainWindow::on_actionView_edge_priority_toggled() +{ + viewer->toggle_view_edge_priority(); + update(); +} + +void MainWindow::on_actionView_bins_toggled() +{ + viewer->toggle_view_bins(); + update(); +} + +void MainWindow::on_actionView_foot_points_toggled() +{ + viewer->toggle_view_foot_points(); + update(); +} + +void MainWindow::on_actionView_relocation_toggled() +{ + viewer->toggle_view_relocation(); + update(); +} + +void MainWindow::on_actionView_tolerance_toggled() +{ + viewer->toggle_view_tolerance(); + update(); +} + +void MainWindow::on_actionView_incolors_toggled() +{ + viewer->toggle_view_incolors(); + update(); +} + +void MainWindow::on_actionView_relevance_toggled() +{ + viewer->toggle_view_edge_relevance(); + update(); +} + +void MainWindow::on_actionActivate_simulation_toggled() +{ + viewer->toggle_activate_simulation(); + update(); +} + +void MainWindow::on_actionView_simulation_triggered() +{ + viewer->toggle_simulation_stage(); + update(); +} + +void MainWindow::on_actionSet_parameters_triggered() +{ + Dialog_options dlg; + dlg.set_all_ranges(); + dlg.set_verbose(m_verbose); + dlg.set_mchoice(m_mchoice); + dlg.set_percent(m_percent); + dlg.set_norm_tol(m_norm_tol); + dlg.set_tang_tol(m_tang_tol); + dlg.set_alpha(m_alpha); + dlg.set_relocation(m_relocation); + dlg.set_ghost(m_ghost); + dlg.set_use_flip(m_use_flip); + dlg.set_line_thickness(viewer->line_thickness()); + dlg.set_point_size(viewer->point_size()); + dlg.set_vertex_size(viewer->vertex_size()); + + if (dlg.exec() == QDialog::Accepted) + { + m_verbose = dlg.get_verbose(); + m_mchoice = dlg.get_mchoice(); + m_percent = dlg.get_percent(); + m_norm_tol = dlg.get_norm_tol(); + m_tang_tol = dlg.get_tang_tol(); + m_alpha = dlg.get_alpha(); + m_relocation = dlg.get_relocation(); + m_ghost = dlg.get_ghost(); + m_use_flip = dlg.get_use_flip(); + + set_scene_parameters(); + viewer->line_thickness() = dlg.get_line_thickness(); + viewer->point_size() = dlg.get_point_size(); + viewer->vertex_size() = dlg.get_vertex_size(); + update(); + } +} + +void MainWindow::on_actionSet_MChoice_toggled() +{ + if (m_mchoice == 0) + m_mchoice = 10; + else + m_mchoice = 0; + set_scene_parameters(); +} diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h new file mode 100644 index 00000000000..34bb2912891 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h @@ -0,0 +1,150 @@ +#ifndef WINDOW_ +#define WINDOW_ + +// SLT +#include + +// Qt +#include +#include + +// local +#include "scene.h" +#include "ui_pwsrec.h" + +class MainWindow : public QMainWindow, public Ui_MainWindow +{ + Q_OBJECT + +private: + Scene* m_scene; + + // main options + int m_verbose; + int m_mchoice; + bool m_use_flip; + double m_alpha; + double m_ghost; + double m_percent; + double m_norm_tol; + double m_tang_tol; + double m_relocation; + + unsigned int maxNumRecentFiles; + QAction* recentFilesSeparator; + QVector recentFileActs; + +public: + MainWindow(); + ~MainWindow(); + + // Parameters + void set_scene_parameters(); + + double percentage() const { return m_percent / 100.0; } + + double norm_tol() const { return m_norm_tol / 100.0; } + + double tang_tol() const { return m_tang_tol / 100.0; } + + double alpha() const { return m_alpha / 100.0; } + + double min_mass() const + { + double value = double(min_mass_slider->value()); + double max_value = double(min_mass_slider->maximum()); + return value / max_value; + } + + int ignore_edges() const + { + return discard_spinbox->value(); + } + +protected slots: + // drag and drop + void dropEvent(QDropEvent *event); + void closeEvent(QCloseEvent *event); + void dragEnterEvent(QDragEnterEvent *event); + + // recent files + void openRecentFile_aux(); + void updateRecentFileActions(); + void addToRecentFiles(QString fileName); + void addRecentFiles(QMenu* menu, QAction* insertBefore = 0); + unsigned int maxNumberOfRecentFiles() const {return maxNumRecentFiles;} + + // io + void open(const QString& file); + void save(const QString& file); + +public slots: + // render + void update(); + void on_actionRecenter_triggered(); + + // io + void on_actionClear_triggered(); + void on_actionLoadPoints_triggered(); + void on_actionSave_triggered(); + void on_actionInsertPoint_toggled(); + void on_actionSnapshot_triggered(); + void on_actionInvert_mass_triggered(); + void on_actionClamp_mass_triggered(); + void on_actionSubdivide_triggered(); + void on_actionDecimate_triggered(); + void on_actionKeep_one_point_out_of_n_triggered(); + + // data + void on_actionStar_triggered(); + void on_actionBox_triggered(); + void on_actionLine_triggered(); + void on_actionStair_triggered(); + void on_actionBoxes_triggered(); + void on_actionNoise_triggered(); + void on_actionSpiral_triggered(); + void on_actionCircle_triggered(); + void on_actionSkyline_triggered(); + void on_actionHalf_circle_triggered(); + void on_actionAdd_outliers_triggered(); + void on_actionParallel_lines_triggered(); + void on_actionBox_with_boundaries_triggered(); + void on_actionBox_with_missing_corners_triggered(); + void on_actionIncreasingly_sharp_angles_triggered(); + void on_actionWidely_variable_sampling_triggered(); + + // reconstruction + void on_actionSet_MChoice_toggled(); + void on_actionSet_parameters_triggered(); + void on_actionReconstruction_init_triggered(); + void on_actionReconstruction_one_step_triggered(); + void on_actionReconstruction_10_steps_triggered(); + void on_actionReconstruction_100_steps_triggered(); + void on_actionReconstruction_1000_steps_triggered(); + void on_actionReconstruction_until_triggered(); + void on_actionRelocate_vertices_triggered(); + void on_actionPrint_Stats_triggered(); + + // view + void on_actionView_points_toggled(); + void on_actionView_vertices_toggled(); + void on_actionView_edges_toggled(); + void on_actionView_ghost_toggled(); + void on_actionView_edge_cost_toggled(); + void on_actionView_edge_priority_toggled(); + void on_actionView_incolors_toggled(); + void on_actionView_relevance_toggled(); + + void on_actionView_bins_toggled(); + void on_actionView_foot_points_toggled(); + void on_actionView_relocation_toggled(); + void on_actionView_tolerance_toggled(); + + void on_actionActivate_simulation_toggled(); + void on_actionView_simulation_triggered(); + +signals: + void openRecentFile(QString filename); +}; + +#endif // WINDOW_ diff --git a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h index 1a5a40d8da3..e412c93d453 100644 --- a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h +++ b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h @@ -195,6 +195,7 @@ protected: } if (pos != i) place(moving, pos); } + }; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index 77499041a26..294ff19ae6d 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -136,6 +136,22 @@ protected: }; +//---------------Reconstruction_edge_2--------------------- +template +struct less_Recon_Edge_2 +{ + bool operator() (const T& a, const T& b) const + { + if (a.priority() < b.priority()) + return true; + if (a.priority() > b.priority()) + return false; + return a < b; + } +}; + + + template class Dynamic_priority_queue_edges : public Dynamic_priority_queue { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ecf20d2e796..ce43f4271e0 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -128,6 +128,23 @@ public: point_pmap = in_point_pmap; mass_pmap = in_mass_pmap; + initialize_parameters(); + } + + + Reconstruction_simplification_2() { + initialize_parameters(); + } + + + ~Reconstruction_simplification_2() { + clear(); + } + + + void initialize_parameters() { + + m_verbose = 0; m_mchoice = 0; m_use_flip = true; @@ -144,8 +161,21 @@ public: m_ignore = 0; } - ~Reconstruction_simplification_2() { - clear(); + //Function if one wants to create a Reconstruction_simplification_2 + //without specifying the input yet in the constructor + void initialize(InputIterator start_itr, + InputIterator beyond_itr, + PointPMap in_point_pmap, + MassPMap in_mass_pmap) { + + start = start_itr; + beyond = beyond_itr; + + point_pmap = in_point_pmap; + mass_pmap = in_mass_pmap; + + initialize(); + } void initialize() { @@ -167,12 +197,14 @@ public: } + //Returns the solid edges present after the reconstruction process. //TODO: determine suitable way of storing them void extract_solid_eges() { std::cout << "---------extracted_solid_eges------------" << std::endl; + PQueue queue; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) @@ -207,9 +239,52 @@ public: std::cout << "---------------------------------------------------" << std::endl; } + //Returns the solid edges present after the reconstruction process. + //TODO: determine suitable way of storing them + void extract_solid_eges(std::vector& solid_edges) { + + std::cout << "---------extracted_solid_eges------------" << std::endl; + + + PQueue queue; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_edge_relevance(edge); // >= 0 + queue.push(Reconstruction_edge_2(edge, value)); + } + + //TODO: IV find nicer way to handle m_ignore + int nb_remove = (std::min)(m_ignore, int(queue.size())); + + for (int i = 0; i < nb_remove; ++i) + { + Reconstruction_edge_2 pedge = queue.top(); + queue.pop(); + } + + while (!queue.empty()) + { + Reconstruction_edge_2 pedge = queue.top(); + queue.pop(); + + solid_edges.push_back(pedge); + + int i = (pedge.edge()).second; + Face_handle face = (pedge.edge()).first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + std::cout << "( " << a << " , " << b << " )" << std::endl; + } + + std::cout << "---------------------------------------------------" << std::endl; + } + void normalize_points() { - //noise(1e-5); TODO IV, removed the noise + //noise(1e-5); TODO IV, killed that noise compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); if (m_bbox_size == 0.0) return; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 6b581d84c24..0301390bc87 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -61,10 +61,8 @@ class Reconstruction_triangulation_2: public Delaunay_triangulation_2 { public: - //TODO: IV rename Dt typedef Reconstruction_triangulation_2 Rt_2; - //typedef typename Reconstruction_triangulation_2::Geom_traits Kernel; typedef typename Kernel::FT FT; typedef typename Kernel::Point_2 Point; typedef typename Kernel::Vector_2 Vector; @@ -117,8 +115,12 @@ public: Reconstruction_edge_2; typedef Dynamic_priority_queue_edges PQueue; + typedef std::set > PQueue_set; + double m_factor; // ghost vs solid + + public: Reconstruction_triangulation_2() { m_factor = 1.0; @@ -547,7 +549,7 @@ public: FT Ds = CGAL::squared_distance(query, ps); FT Dt = CGAL::squared_distance(query, pt); - FT dist2 = (std::min)(Ds, Dt); + FT dist2 = ((std::min))(Ds, Dt); FT norm2 = sample->distance2(); FT tang2 = dist2 - norm2; @@ -935,7 +937,6 @@ public: ac.first->set_neighbor(ac.second, ca.first); ca.first->set_neighbor(ca.second, ac.first); - //TODO: IV UNCOMMEN THIS this->delete_face(abc); this->delete_face(cba); this->delete_vertex(b); @@ -944,91 +945,106 @@ public: std::cout << "done" << std::endl; } - template // value_type = Edge - bool make_collapsible(Edge& edge, Iterator begin, Iterator end, - int verbose = 0) { - Vertex_handle source = source_vertex(edge); - Vertex_handle target = target_vertex(edge); - - PQueue pqueue; - for (Iterator it = begin; it != end; ++it) { - Edge ab = twin_edge(*it); - Vertex_handle a = source_vertex(ab); - Vertex_handle b = target_vertex(ab); - FT D = signed_distance_from_intersection(a, b, target, source); - if (D < 0.0) - pqueue.push(Reconstruction_edge_2(ab, D)); - } - - int nb_flips = 0; - while (!pqueue.empty()) { - Reconstruction_edge_2 pedge = pqueue.top(); - FT Dbc = pedge.priority(); - Edge bc = pedge.edge(); - pqueue.pop(); - - Edge sb = prev_edge(bc); - Edge ab = prev_edge(twin_edge(sb)); - Edge sc = twin_edge(next_edge(bc)); - Edge cd = next_edge(sc); - - Vertex_handle a = source_vertex(ab); - Vertex_handle b = source_vertex(bc); - Vertex_handle c = target_vertex(bc); - Vertex_handle d = target_vertex(cd); - - FT Dac = std::numeric_limits::lowest(); - if (a != c && is_triangle_ccw(a, b, c)) - Dac = signed_distance_from_intersection(a, c, target, source); - - FT Dbd = std::numeric_limits::lowest(); - if (b != d && is_triangle_ccw(b, c, d)) - Dbd = signed_distance_from_intersection(b, d, target, source); - - if (Dac == std::numeric_limits::lowest() && - Dbd == std::numeric_limits::lowest()) { - // TODO: IV comment in std::cerr << red << "--- - //No flips available ---" << white << std::endl; - std::cerr << "--- No flips available ---" << std::flush; - return false; - } - - if ((std::max)(Dac, Dbd) + EPS < Dbc) { - std::cerr.precision(10); - // TODO: IV comment in std::cerr << red << "--- - //Flip makes kernel worse ---" << white << std::endl; - std::cerr << "--- Flip makes kernel worse ---" << std::flush; - std::cerr << Dac << " or " << Dbd << " vs " << Dbc << std::endl; - std::cerr << "a: " << a->point() << std::endl; - std::cerr << "b: " << b->point() << std::endl; - std::cerr << "c: " << c->point() << std::endl; - std::cerr << "d: " << d->point() << std::endl; - std::cerr << "t: " << target->point() << std::endl; - std::cerr << "diff = " << Dbc - (std::max)(Dac, Dbd) << std::endl; - return false; - } - - if (Dac > Dbd) { - pqueue.remove(Reconstruction_edge_2(ab)); - Edge ac = flip(sb, edge, verbose); - if (Dac < 0.0) - pqueue.push(Reconstruction_edge_2(ac, Dac)); - } else { - pqueue.remove(Reconstruction_edge_2(cd)); - Edge bd = flip(sc, edge, verbose); - if (Dbd < 0.0) - pqueue.push(Reconstruction_edge_2(bd, Dbd)); - } - nb_flips++; - } - - if (verbose > 1) - //TODO: IV Comment in std::cerr << red << "--- Flip makes kernel - //worse ---" << white << std::endl; - std::cerr << "Nb flips: " << nb_flips << std::endl; - - return true; + //TODO IV remove -------- + void print_edge(Reconstruction_edge_2 edge) { + int i = ((edge).edge()).second; + Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); + Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); + std::cout <<"( " << (edge).priority() << ") ( " << a << " , " << b << " )" << std::endl; } + //-------- + + template // value_type = Edge + bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) + { + Vertex_handle source = source_vertex(edge); + Vertex_handle target = target_vertex(edge); + + PQueue pqueue; + for (Iterator it = begin; it != end; ++it) + { + Edge ab = twin_edge(*it); + Vertex_handle a = source_vertex(ab); + Vertex_handle b = target_vertex(ab); + FT D = signed_distance_from_intersection(a, b, target, source); + if (D < 0.0) pqueue.push(Reconstruction_edge_2(ab, D)); + } + + int nb_flips = 0; + while (!pqueue.empty()) + { + Reconstruction_edge_2 pedge = pqueue.top(); + FT Dbc = pedge.priority(); + Edge bc = pedge.edge(); + pqueue.pop(); + + Edge sb = prev_edge(bc); + Edge ab = prev_edge(twin_edge(sb)); + Edge sc = twin_edge(next_edge(bc)); + Edge cd = next_edge(sc); + + Vertex_handle a = source_vertex(ab); + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle d = target_vertex(cd); + + FT Dac = std::numeric_limits::lowest(); + if (a != c && is_triangle_ccw(a, b, c)) + Dac = signed_distance_from_intersection(a, c, target, source); + + FT Dbd = std::numeric_limits::lowest(); + if (b != d && is_triangle_ccw(b, c, d)) + Dbd = signed_distance_from_intersection(b, d, target, source); + + if (Dac == std::numeric_limits::lowest() && Dbd == + std::numeric_limits::lowest()) + { + // TODO: IV comment in std::cerr << red << "--- + //No flips available ---" << white << std::endl; + std::cerr << "--- No flips available ---" << std::endl; + return false; + } + + if (std::max(Dac, Dbd) + EPS < Dbc) + { + std::cerr.precision(10); + // TODO: IV comment in std::cerr << red << "-- + //- Flip makes kernel worse ---" << white << std::endl; + std::cerr << "--- Flip makes kernel worse ---" + << std::endl; + std::cerr << Dac << " or " << Dbd << " vs " + << Dbc << std::endl; + std::cerr << "a: " << a->point() << std::endl; + std::cerr << "b: " << b->point() << std::endl; + std::cerr << "c: " << c->point() << std::endl; + std::cerr << "d: " << d->point() << std::endl; + std::cerr << "t: " << target->point() << std::endl; + std::cerr << "diff = " << Dbc - std::max(Dac, Dbd) << std::endl; + return false; + } + + if (Dac > Dbd) + { + pqueue.remove(Reconstruction_edge_2(ab)); + Edge ac = flip(sb, edge, verbose); + if (Dac < 0.0) pqueue.push(Reconstruction_edge_2(ac, Dac)); + } + else + { + pqueue.remove(Reconstruction_edge_2(cd)); + Edge bd = flip(sc, edge, verbose); + if (Dbd < 0.0) pqueue.push(Reconstruction_edge_2(bd, Dbd)); + } + nb_flips++; + } + + if (verbose > 1) + //TODO: IV Comment in std::cerr << red << "--- + //Flip makes kernel worse ---" << white << std::endl; + std::cerr << "Nb flips: " << nb_flips << std::endl; + + return true; + } int random_int(const int min, const int max) { int range = max - min; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 99b60c29a62..c50ec79a790 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,8 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_basic.cpp" ) + #create_single_source_cgal_program( "test_basic.cpp" ) +create_single_source_cgal_program( "test_priority_queue.cpp" ) else() From 218d8e892b1303d3de34f3f6863583f4e049d4a2 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 26 Jun 2014 22:52:40 -0400 Subject: [PATCH 012/201] Reconstruction Demo V1 implemented --- .../qrc_pwsrec.cxx | 1896 +++++++++++++++++ 1 file changed, 1896 insertions(+) create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx new file mode 100644 index 00000000000..442a4f18233 --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx @@ -0,0 +1,1896 @@ +/**************************************************************************** +** Resource object code +** +** Created by: The Resource Compiler for Qt version 4.8.6 +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include + +static const unsigned char qt_resource_data[] = { + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fit-page-32.png + 0x0,0x0,0x5,0x32, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, + 0x0,0x0,0x4,0xf9,0x49,0x44,0x41,0x54,0x78,0x5e,0xb5,0x57,0x59,0x68,0x5c,0x65, + 0x14,0xfe,0xee,0x9d,0x7b,0xe7,0xce,0x4c,0xf6,0xad,0x49,0xd3,0x25,0x9b,0x4d,0x1f, + 0x4c,0x6b,0x10,0x15,0x5a,0x8b,0x55,0x4a,0x5f,0xc4,0x25,0x56,0xf4,0x41,0xf1,0x5d, + 0xf0,0x45,0x1f,0x7c,0xf4,0xdd,0x57,0x1f,0xb4,0xf4,0x49,0x44,0x41,0x4,0x45,0xd3, + 0x8a,0xa0,0x15,0xa5,0x96,0xd4,0x52,0xb,0xcd,0xd2,0x92,0xa4,0x74,0xb2,0xb6,0x93, + 0x85,0xc9,0x24,0x99,0x4e,0x27,0x33,0xce,0xcc,0xbd,0x1e,0xe,0xff,0xfd,0xff,0x9f, + 0xcb,0x6c,0x8,0x3d,0xc9,0xe1,0xfc,0xf9,0xb7,0xef,0x6c,0xff,0x39,0x37,0x6,0x34, + 0xba,0x34,0x11,0xf7,0x5c,0xf,0xf0,0x3c,0x8f,0x98,0x24,0x84,0x14,0x73,0xae,0x9c, + 0x53,0x7b,0xf4,0xbd,0xda,0xd9,0xc0,0xf9,0xc0,0x1a,0xf0,0xe2,0x7,0x63,0xc7,0xaf, + 0x80,0xc8,0x82,0x22,0x6,0x78,0xed,0xf9,0x41,0x3c,0x4e,0xfa,0x62,0x7c,0x9a,0x95, + 0x60,0xa,0x28,0xc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,0xd,0x31,0x32,0xd0,0xce,0x6e, + 0x2e,0x94,0x3c,0xec,0x64,0xf2,0xc,0x46,0x43,0x74,0x34,0x47,0x70,0x80,0xf2,0xc6, + 0x34,0x20,0x4b,0xb1,0xe2,0xc0,0xdd,0xd5,0xb,0x11,0x6f,0xae,0xda,0x7,0xe,0x76, + 0x35,0x20,0xfd,0xa8,0x0,0x9b,0xdc,0x1c,0x22,0xc4,0xe6,0x98,0x87,0x58,0x38,0x2, + 0x40,0x80,0x7,0x2c,0x57,0x4f,0x8f,0xe7,0x6a,0xbf,0x2,0x81,0xaf,0x40,0x1,0xbd, + 0x0,0xf1,0xac,0x61,0x80,0xc1,0x89,0x61,0x85,0x38,0x92,0xa,0xac,0x6c,0x73,0x42, + 0xed,0x67,0xe8,0x56,0xf2,0x80,0x2,0xe6,0x1b,0x12,0x54,0x17,0xc8,0xed,0x6c,0xb9, + 0x49,0x9a,0x64,0xf6,0xa,0xc,0xd4,0xde,0x14,0x56,0x4a,0x68,0xdd,0xb0,0x7e,0xf, + 0xa8,0x4d,0x6a,0x2e,0x90,0xb,0xb3,0x2b,0xdb,0x78,0x94,0x2b,0x72,0xcc,0xa3,0x61, + 0x87,0x2d,0xca,0x15,0x4a,0xdc,0x3b,0x76,0x88,0xfb,0xba,0x1b,0x24,0x30,0xb3,0x2b, + 0xb9,0x9e,0x52,0xcc,0x42,0x1e,0x96,0xae,0x14,0x17,0x5e,0xa7,0x77,0x1e,0x4f,0xa4, + 0x19,0xb4,0xb7,0x3d,0x2a,0x55,0xdc,0xd7,0xe2,0xa0,0x54,0x72,0xb1,0xb4,0x91,0xa1, + 0x26,0x94,0x12,0x67,0xe4,0x39,0xc1,0xae,0x1e,0xa6,0xea,0xa,0xa8,0xe4,0x11,0xda, + 0x8b,0xa,0x37,0xb3,0x98,0xe2,0x98,0x8f,0xf4,0xb7,0xb2,0xeb,0x7d,0x0,0x1a,0x62, + 0xb8,0xb7,0x89,0xa4,0x87,0xb9,0xd5,0x1d,0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xe2,0x56,0x2c,0x2f,0xa,0x7a,0x80,0x63,0x3e,0xb5,0x8e,0xbb,0xe4,0x76,0x9d, + 0xa8,0x51,0xd5,0xff,0x4d,0x98,0xce,0x16,0xe0,0xd8,0x26,0xba,0x5a,0xa2,0x14,0xfb, + 0x8,0xa8,0x97,0xd3,0x38,0xc2,0x97,0x97,0x5c,0xb7,0x4c,0x99,0x85,0xf6,0x62,0x5c, + 0xc,0x1f,0x68,0xe2,0xbe,0x40,0xf5,0x2,0x89,0x54,0x96,0xef,0x23,0xe6,0xf,0x9a, + 0xba,0x4a,0xf1,0x47,0xe7,0x9e,0xf4,0x27,0xe4,0x66,0xdd,0xd5,0x41,0x60,0xdd,0xb, + 0x86,0x61,0x50,0xaf,0x68,0xe4,0x5c,0x8,0x51,0x28,0x42,0xa6,0xc9,0x21,0xa1,0x31, + 0xa2,0x8e,0x25,0xc2,0x57,0xc3,0x3,0xa5,0x92,0x57,0xb1,0xc,0xd3,0x6f,0xd0,0xfd, + 0x52,0x71,0x93,0x1,0xd,0x62,0x6,0x94,0xd2,0x12,0xe3,0x6a,0xa5,0x38,0x44,0x1c, + 0xf6,0x73,0xe0,0x50,0x4f,0x1b,0x1e,0x13,0x31,0x78,0x3a,0xb5,0x19,0x1,0x60,0x13, + 0x17,0x2d,0x1,0x4e,0x13,0x70,0x8,0x1f,0x9f,0xfd,0x30,0x9,0x12,0x5a,0x37,0xd3, + 0xdc,0x5f,0xee,0x1f,0x53,0x3d,0x3c,0xfa,0x99,0xf2,0x7b,0x79,0x4f,0xf6,0xe1,0x8e, + 0x23,0x30,0x73,0x86,0xf2,0x0,0x6b,0xe4,0x4,0x38,0x2c,0xa4,0x2d,0xc6,0xb6,0xf0, + 0x9a,0xaf,0xb8,0x21,0xd8,0x15,0x5c,0x14,0x5c,0x10,0xfc,0xaf,0xe0,0xbc,0x94,0x92, + 0x79,0xbe,0x68,0x20,0x40,0xe2,0x42,0x53,0x0,0x58,0xba,0xd4,0xd8,0x54,0xe0,0xaa, + 0xc9,0x69,0x8a,0x94,0x84,0x22,0xa5,0x32,0x63,0xf,0x1a,0xfd,0x7,0xfa,0xd6,0x9e, + 0x29,0x1d,0x33,0x88,0x11,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/inputPoint.png + 0x0,0x0,0x4,0x79, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x4b,0x0,0x0,0x0,0x4b,0x8,0x6,0x0,0x0,0x0,0x38,0x4e,0x7a,0xea, + 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x8,0xa7,0x0,0x0,0x8,0xa7, + 0x1,0x32,0xc6,0x2,0x3,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, + 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61, + 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x3,0xf6,0x49,0x44, + 0x41,0x54,0x78,0x9c,0xed,0x9a,0xbf,0x8b,0x15,0x49,0x10,0xc7,0x3f,0xbd,0xab,0xbb, + 0xab,0x6f,0x41,0x14,0xf,0x31,0x55,0x8c,0x4,0x4d,0x8c,0x8e,0x5,0xe1,0x60,0x91, + 0x33,0x30,0x3c,0x58,0xfc,0xf,0xfc,0x6b,0xee,0x4f,0x10,0x39,0x30,0x30,0x14,0x39, + 0xd8,0x44,0x3,0x31,0x30,0x38,0x4c,0x4c,0x4,0x8d,0xf,0x15,0xc5,0x60,0x6f,0x75, + 0x7d,0xf3,0xca,0xa0,0xbb,0x6e,0x7a,0xda,0xd9,0xd5,0x42,0xbb,0x7,0xb1,0xbe,0x50, + 0xbc,0x99,0xf7,0xa6,0x7b,0xba,0x3e,0xaf,0xfa,0xc7,0x54,0x4f,0x10,0x11,0x5c,0x5f, + 0xa7,0xa5,0xa9,0x1b,0xf0,0x23,0xc9,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39, + 0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3,0x32,0xc8,0x61,0x19, + 0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87, + 0x65,0x90,0xc3,0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83, + 0x1c,0x96,0x41,0x87,0xa6,0x6e,0x40,0x8,0x61,0x9,0x38,0xb,0x9c,0x7,0x4e,0x2, + 0xc7,0x80,0x75,0x60,0x7,0x78,0x7,0xbc,0x2,0x9e,0x2,0xcf,0x45,0x64,0x31,0x55, + 0x3b,0x1,0xc2,0x54,0xfb,0x86,0x21,0x84,0x35,0x60,0x13,0xd8,0x0,0x8e,0x13,0xff, + 0xb8,0x43,0xc4,0x68,0xf,0xe9,0x32,0x1,0x16,0xc0,0x9c,0x8,0xee,0x3e,0xb0,0x2d, + 0x22,0xef,0x9b,0x37,0x98,0x89,0x60,0x85,0x10,0x7e,0x5,0xae,0x11,0x23,0x69,0x15, + 0x58,0x1,0xe,0x73,0x30,0xac,0x8f,0xc0,0x1e,0xf0,0x1a,0xb8,0x23,0x22,0x8f,0x1a, + 0x37,0xbb,0x2d,0xac,0x10,0xc2,0x32,0xf0,0x7,0x70,0x19,0x38,0xa,0xac,0x25,0xcb, + 0x61,0x2d,0x33,0x84,0xd5,0x31,0x84,0xf5,0x3e,0xd9,0x36,0x70,0x5b,0x44,0xba,0x66, + 0xed,0x6f,0x5,0x2b,0x81,0xba,0x1,0x5c,0x20,0x82,0x3a,0xa,0x1c,0x21,0xc2,0x5a, + 0x25,0x42,0xca,0xa3,0x4a,0xa5,0xd1,0xd5,0x1,0x1f,0x88,0xa0,0x76,0x81,0xff,0x80, + 0x7f,0x80,0x3f,0x5b,0x1,0x6b,0x9,0x6b,0xb,0xf8,0x8d,0x38,0x78,0xcf,0xe8,0x61, + 0xad,0x10,0x21,0x29,0x28,0x35,0x88,0xa0,0xd4,0x16,0xc9,0xf6,0xe8,0x61,0xed,0x0, + 0x7f,0x8b,0xc8,0xad,0x16,0x3e,0x34,0x99,0xd,0xd3,0x18,0xa5,0x5d,0x6f,0x96,0x99, + 0x76,0xbb,0x25,0x86,0xc0,0x72,0xe5,0xa0,0x16,0xe9,0xf7,0xbc,0xab,0x5e,0x9,0x21, + 0xbc,0x10,0x91,0x87,0x95,0xdd,0xa8,0xbf,0xce,0x4a,0xb3,0xde,0x35,0xfa,0xae,0xa7, + 0xc0,0x74,0x8c,0x1a,0xb3,0xc3,0x5f,0xf1,0xfb,0x2c,0xab,0x6f,0x2b,0xdd,0xa7,0xaa, + 0x5a,0x2c,0x4a,0x37,0x89,0xb3,0xde,0x1a,0xb1,0xdb,0x1d,0xa1,0x8f,0x28,0xb5,0x1c, + 0xd0,0x7e,0x36,0x56,0x46,0xeb,0xfb,0x5,0xb8,0x5a,0xdb,0x91,0xaa,0xb0,0xd2,0x82, + 0x73,0x83,0x38,0x80,0xe7,0x33,0x5f,0xe9,0x74,0x19,0x35,0x63,0xc7,0x6a,0x79,0xd9, + 0x95,0xac,0xde,0xcd,0x74,0xbf,0x6a,0xaa,0x1d,0x59,0x67,0x89,0xb,0xce,0x95,0x64, + 0xab,0xc,0xc7,0xa7,0x83,0x80,0x1d,0x4,0x2a,0xaf,0x43,0xd7,0x69,0x27,0x80,0x73, + 0x35,0x9d,0xa9,0xd,0xeb,0x3c,0x43,0xe7,0x4b,0x47,0x97,0xf9,0x72,0x77,0x2c,0xa3, + 0x69,0xac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b,0xc4,0x7c,0x54,0xe9, + 0x68,0x1e,0x51,0xfb,0x45,0x56,0x1e,0x61,0x25,0xac,0xf,0xa9,0xee,0xed,0xda,0x39, + 0xfa,0x16,0xf,0xd2,0xdb,0xc4,0x54,0xb0,0x66,0x38,0xf7,0x18,0x46,0xc9,0x18,0xa8, + 0xb1,0xe3,0x12,0x58,0x47,0x9f,0x39,0x7d,0x9,0xdc,0xad,0xed,0x48,0x75,0x58,0x69, + 0x73,0xe1,0xe,0x7d,0x86,0x73,0x97,0xcf,0x9d,0xce,0xa3,0x69,0x3f,0x1b,0x2b,0xa3, + 0xf5,0xfd,0x25,0x22,0xbb,0xb5,0x7d,0x69,0x92,0xfc,0x13,0x91,0x47,0x21,0x84,0x33, + 0xc0,0xef,0xf4,0x2b,0xf9,0x19,0xfd,0x6c,0x66,0x49,0xfe,0x29,0xa8,0x1d,0x62,0xb6, + 0xf4,0x9e,0x88,0x3c,0xa8,0xef,0x45,0xdb,0x7d,0xc3,0xdb,0xc0,0x29,0xe0,0x52,0x3a, + 0x17,0xbe,0x3d,0xad,0xfc,0x18,0xb8,0xd9,0xa4,0xf5,0x4c,0xb3,0xbb,0x73,0x1d,0xb8, + 0xc2,0xb7,0x6f,0x58,0xdc,0x3,0x6e,0x8a,0xc8,0x9c,0x46,0x9a,0x6a,0xdf,0x70,0x3, + 0xd8,0x22,0x66,0x38,0xad,0x5b,0x61,0x2f,0x89,0x63,0xd4,0x83,0xb6,0xad,0x9e,0x7e, + 0x47,0xfa,0x2a,0x31,0xed,0x7c,0x82,0x2f,0x6f,0xb2,0xbe,0x21,0xce,0xac,0x77,0x5b, + 0xc,0xe6,0x63,0x9a,0xc,0xd6,0xff,0xd,0x88,0xa9,0xe0,0x73,0xc4,0xc4,0xdd,0x69, + 0x62,0x9a,0x45,0xdf,0x75,0x78,0x4b,0x7c,0x84,0x79,0x2,0x3c,0xfb,0x69,0xdf,0x75, + 0xf8,0x11,0xe5,0xaf,0x1c,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c, + 0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3,0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc, + 0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3, + 0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41, + 0xe,0xcb,0xa0,0x4f,0xa2,0xac,0x82,0xb6,0x88,0x8c,0x1,0x8,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/vertex.png + 0x0,0x0,0x1,0x68, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x4b,0x0,0x0,0x0,0x4b,0x8,0x6,0x0,0x0,0x0,0x38,0x4e,0x7a,0xea, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x8,0xa7,0x0,0x0,0x8,0xa7,0x1, + 0x32,0xc6,0x2,0x3,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xda,0x9,0x1e, + 0x17,0x1d,0x3,0xbd,0xab,0x5f,0x67,0x0,0x0,0x0,0xe8,0x49,0x44,0x41,0x54,0x78, + 0xda,0xed,0xdb,0xc1,0xd,0x83,0x30,0xc,0x5,0xd0,0x3a,0xea,0xbe,0xcc,0xd2,0x89, + 0xc3,0xa5,0x3,0x80,0x4a,0x6c,0xa7,0x7a,0xff,0x8e,0x42,0x5e,0x1c,0x22,0x61,0x88, + 0x39,0xe7,0x4b,0xae,0x65,0x20,0x80,0x5,0xb,0x16,0x2c,0x58,0xb0,0x10,0xc0,0x82, + 0x5,0xb,0x16,0x2c,0x58,0x8,0x60,0xc1,0x82,0x5,0xb,0x16,0x2c,0x4,0xb0,0x60, + 0xc1,0xda,0x28,0xef,0xea,0x1b,0xf8,0x44,0x5c,0xee,0xc5,0x1d,0x73,0x46,0xe5,0xbd, + 0x46,0x55,0xdf,0xf0,0xe,0x52,0x17,0xb4,0xb1,0x1b,0xd4,0x13,0xd7,0x6f,0x51,0x59, + 0x2b,0x26,0x99,0x59,0x65,0x63,0x67,0xa8,0xec,0x2a,0x73,0x1a,0x76,0xc3,0x5a,0xbd, + 0xfa,0x59,0xd5,0x35,0x76,0x87,0xca,0x1c,0xc7,0x36,0xec,0x82,0x95,0x7d,0xc4,0xaf, + 0x1e,0x4f,0x65,0xc1,0x82,0x5,0xb,0x16,0x2c,0x81,0x5,0xb,0x16,0x2c,0x58,0xdf, + 0x64,0xbf,0xfe,0x5d,0x3d,0x9e,0xca,0xea,0x84,0x95,0x55,0x5d,0x19,0xe3,0x8c,0x7f, + 0x98,0x48,0xd6,0x82,0xd8,0x86,0x1d,0xb1,0x56,0xad,0x7e,0xe6,0x21,0x52,0xd2,0x64, + 0x7d,0xe2,0x25,0x5d,0x45,0xa3,0xb5,0x64,0x1b,0xfe,0x3a,0xd1,0xaa,0x8e,0x74,0x54, + 0xff,0xf6,0xeb,0x5b,0x7,0xf,0x78,0x81,0x5,0xb,0x16,0x2c,0x58,0xb0,0x4,0x16, + 0x2c,0x58,0xb0,0x60,0xc1,0x12,0x58,0xb0,0x60,0xc1,0x82,0x5,0x4b,0x60,0xc1,0x82, + 0x55,0x9e,0x13,0xb9,0xae,0x4e,0x81,0x12,0x3e,0x89,0x36,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/until.png + 0x0,0x0,0x5,0x64, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x2,0x0,0x0,0x0,0xfc,0x18,0xed,0xa3, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc3,0x0,0x0,0xe,0xc3,0x1,0xc7,0x6f, + 0xa8,0x64,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61, + 0x72,0x65,0x0,0x50,0x61,0x69,0x6e,0x74,0x2e,0x4e,0x45,0x54,0x20,0x76,0x33,0x2e, + 0x35,0x2e,0x35,0x49,0x8a,0xfc,0xe0,0x0,0x0,0x4,0xd4,0x49,0x44,0x41,0x54,0x48, + 0x4b,0xb5,0x56,0xf9,0x4f,0xd3,0x67,0x1c,0xf6,0x2f,0xd9,0xdc,0x70,0x26,0xfe,0xb2, + 0x1f,0x96,0xec,0x87,0x4d,0x1d,0x23,0x9a,0x98,0xcd,0xc5,0xc4,0xb8,0x30,0x27,0x4e, + 0x11,0x75,0xa,0xc,0xc2,0xad,0x9c,0x4e,0x41,0x1c,0xe3,0x56,0x90,0x3a,0xa7,0x40, + 0xb9,0xa1,0x2d,0x14,0x68,0xa1,0x65,0x40,0x61,0x83,0x52,0xa0,0x7,0x57,0xa1,0x7, + 0x2d,0xbd,0xf,0x68,0x29,0xe5,0xee,0xc1,0xf6,0x60,0x43,0x47,0xe6,0x97,0x96,0x2e, + 0x5b,0xf3,0xe6,0x4d,0xd3,0xbe,0xef,0xe7,0xf9,0x9c,0xcf,0xf3,0x1e,0xf9,0xf3,0x7f, + 0xfe,0x1c,0xf1,0x61,0xdf,0xe1,0x70,0x19,0xcd,0xf6,0x39,0xb9,0x99,0x3f,0xad,0x1b, + 0xe6,0xab,0x87,0xf9,0x2a,0xec,0xfc,0x29,0x9d,0x58,0x66,0xd2,0x19,0x57,0xb6,0xb6, + 0x9d,0x87,0xf1,0x8d,0x18,0xc0,0x6c,0x59,0xab,0xa7,0x4f,0x24,0x66,0x33,0xc3,0x13, + 0x29,0x11,0x49,0xd4,0x3b,0x69,0x6d,0x91,0x19,0xf4,0xa8,0xc,0x7a,0x64,0x46,0x7b, + 0x64,0x1a,0x3d,0x22,0x99,0x76,0x2d,0x81,0x12,0xf7,0x90,0x51,0x4d,0x15,0x18,0x17, + 0x57,0x7d,0xc3,0x10,0x0,0x88,0xc4,0x86,0xcb,0x31,0x8d,0xf1,0x8f,0x18,0xf4,0x1e, + 0xb1,0x52,0x6d,0xb5,0xd9,0x37,0x37,0x36,0x1d,0x9b,0x5b,0x4e,0xcf,0xc2,0xf7,0x95, + 0xd5,0x2d,0x8d,0xde,0xc6,0x1a,0x90,0xde,0xff,0x89,0x15,0x1a,0xd5,0x30,0x21,0x36, + 0xf8,0xc0,0x20,0x0,0x48,0x2f,0x60,0x7f,0x71,0xbd,0x9a,0x3f,0xa9,0xdd,0x76,0xb8, + 0x7c,0xdc,0x74,0xba,0xdc,0xd3,0x12,0xe3,0x97,0xe1,0xe4,0xd4,0x3c,0xd6,0xce,0xce, + 0x81,0x7,0x9,0x0,0x62,0x1f,0x74,0x5e,0x8d,0x6b,0xbe,0x93,0xda,0x96,0x59,0xd8, + 0xd3,0xd4,0x31,0x39,0x2a,0xd2,0xa8,0x74,0xcb,0xb6,0x95,0x4d,0xfb,0xea,0x16,0x76, + 0xad,0xc1,0x26,0x9c,0xd1,0xb7,0xb1,0xc4,0xd9,0xa5,0x7d,0x91,0xe9,0xf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f,0xdf,0x6f,0xd,0xfa,0xac,0xe8,0xc3, + 0x73,0xcf,0x3e,0x3a,0xff,0x1c,0x7b,0xd0,0xe9,0xa2,0x8b,0xdf,0xd7,0xa1,0x91,0x80, + 0x84,0x33,0xa2,0x19,0xbd,0xb7,0x1e,0x84,0x30,0xc4,0x93,0x8c,0xec,0xc3,0x41,0x8c, + 0x71,0x59,0x15,0x77,0x56,0x66,0xe,0x8d,0x6e,0x7c,0xf7,0x64,0x41,0x50,0x70,0xd1, + 0x7b,0xa7,0xa,0xcf,0x7d,0x57,0x35,0x22,0x50,0x37,0x77,0x4e,0x5d,0xba,0x5b,0x3f, + 0x3e,0xa9,0x73,0xb9,0xe,0xec,0x1f,0xf,0x9e,0x2f,0x2e,0xd2,0x1a,0x56,0x6e,0xa6, + 0xd0,0xca,0xc9,0x23,0xb3,0x72,0xf3,0xf9,0x1b,0xe4,0xa3,0xa7,0xa,0xcf,0x86,0x55, + 0xa2,0x30,0x8d,0xed,0x13,0xdf,0x44,0x37,0x82,0xa3,0xfe,0x3d,0x17,0xed,0x35,0xc9, + 0xce,0xe4,0xac,0xe1,0x6e,0x1a,0x9d,0xc2,0x9c,0xee,0xe2,0x48,0xe1,0x3b,0xa3,0x4f, + 0xf2,0xdb,0x1f,0x72,0x24,0x6d,0x60,0x44,0xe9,0x3b,0x33,0x5e,0x6c,0x5f,0x11,0x78, + 0x3a,0x95,0x27,0xd4,0x20,0x57,0xd3,0x73,0xc6,0x97,0xd,0xa3,0x32,0xe5,0xd2,0x95, + 0xd8,0xa6,0x36,0xb6,0x18,0x7d,0x75,0x18,0xf7,0xfd,0xa4,0xc8,0x63,0x42,0x63,0x58, + 0x1,0x73,0x88,0xa5,0xa6,0x29,0x89,0x71,0x41,0x63,0xbd,0x70,0xb3,0x86,0x27,0xd2, + 0x1c,0xd2,0x7d,0xff,0x0,0xe0,0x6d,0x30,0x52,0x1e,0x69,0xc0,0xe1,0x74,0xaf,0xae, + 0x6d,0x39,0x9d,0xae,0x5f,0x1b,0xc6,0x40,0xd4,0x4a,0x8d,0xf5,0x3f,0x88,0x0,0x94, + 0x90,0x5b,0xc6,0x1,0xed,0xa0,0xda,0x5e,0x73,0xa0,0x8d,0x9c,0xa7,0x7d,0x20,0x73, + 0x8c,0xdb,0x61,0x30,0xe,0xac,0x81,0x7d,0x6d,0x2b,0x8f,0x34,0xf8,0x43,0x56,0x87, + 0xc6,0x60,0xfb,0x87,0x21,0x70,0x6a,0x56,0x51,0x6f,0x4a,0x6e,0xf7,0x92,0x75,0xdd, + 0x2f,0x6,0x31,0x80,0x65,0x79,0x23,0xaf,0x62,0x10,0xdd,0xa2,0xd6,0x2d,0x13,0x9a, + 0xc0,0xb4,0x23,0xb2,0x87,0x25,0xbd,0x7e,0x31,0x8,0x0,0x20,0xb6,0x2f,0x1b,0xc6, + 0xc2,0x13,0xa9,0xd3,0x52,0x93,0xd7,0x3a,0x58,0x8,0x33,0xb5,0x5f,0x58,0x14,0x6a, + 0x2b,0x78,0x82,0x54,0x37,0xea,0x5b,0x97,0x8,0x0,0xa6,0x25,0xa6,0x5b,0xf7,0x68, + 0x20,0x83,0xfd,0xad,0x32,0xaf,0xb2,0x90,0xea,0x78,0xf2,0x5,0xcb,0x3e,0xc8,0x5d, + 0x46,0xd9,0xf5,0x43,0xf2,0xb7,0x1f,0x6f,0x87,0x4b,0x0,0x0,0x43,0x4f,0x2b,0x87, + 0xbd,0xde,0xc2,0x41,0x4c,0x2f,0x4,0xee,0xc4,0x99,0x52,0x88,0xcf,0xd8,0x84,0x76, + 0x7d,0xc3,0xe1,0x35,0x54,0x5e,0xcd,0x2d,0xab,0xe6,0x6,0x46,0x76,0x19,0x5,0x3d, + 0xb4,0xee,0x19,0xdc,0x41,0x4,0xa,0x95,0x5,0x74,0x4,0x89,0x7e,0xff,0x74,0x21, + 0x28,0xf,0x7b,0xc8,0xe5,0x57,0xb9,0xe5,0x1c,0xf8,0xee,0x89,0x8f,0xd9,0x27,0x49, + 0xfb,0x99,0x1d,0x18,0x40,0x52,0xe,0x13,0x92,0x80,0x1e,0x85,0x20,0x9f,0xb9,0xf2, + 0xfa,0x78,0x48,0xc9,0xb1,0xe0,0xa2,0xf,0x3e,0x2f,0xf6,0x2c,0x50,0x1e,0xf6,0x4f, + 0x2e,0xbe,0xf8,0xa5,0x7e,0x14,0xcf,0x8b,0x1,0x9e,0x12,0x63,0x11,0x98,0x26,0x27, + 0x3c,0x62,0x80,0xf7,0x5f,0x35,0x8d,0x1f,0xf,0x29,0x7e,0xe7,0xd3,0x7c,0x38,0xe, + 0x80,0x63,0xc1,0xc5,0x7b,0xab,0x8,0xbf,0x1c,0x3d,0x59,0x0,0x66,0x2d,0x79,0x3d, + 0xd4,0xcf,0x55,0xc4,0x64,0xb5,0x7,0xaa,0xc9,0x2c,0x58,0x1f,0xe4,0x29,0xf1,0x1e, + 0xf9,0x2a,0x82,0xfc,0xf1,0x85,0x8a,0x13,0x67,0x4b,0x11,0x87,0x67,0xa1,0x12,0x10, + 0x6,0x10,0x5f,0x7c,0x36,0x13,0xc4,0x47,0xa6,0xa,0x92,0x73,0xbb,0x7c,0x30,0x7, + 0x41,0x91,0xfb,0x86,0xe7,0x43,0xa3,0x1b,0xaa,0x29,0x82,0x79,0xb5,0x15,0xcd,0x3, + 0xae,0x1e,0x15,0x69,0x91,0xb4,0x6e,0x8e,0x14,0x91,0xf1,0x84,0xea,0x19,0xa9,0x9, + 0xed,0x4,0xb6,0x0,0x6f,0x7f,0x1d,0x59,0x8f,0xf3,0x81,0xd5,0x0,0xfd,0xce,0x15, + 0xa8,0x31,0x47,0xdf,0xc6,0x34,0xa1,0xd3,0xa1,0x6b,0x10,0xaf,0x5a,0x9a,0xb0,0xb6, + 0x55,0x58,0x43,0x13,0x82,0x53,0x31,0xe1,0x9,0xd9,0xcc,0xb0,0xd8,0x26,0x64,0x7f, + 0x68,0x5c,0x85,0xf1,0x8,0xc,0xc0,0x73,0x1a,0x45,0x96,0x28,0x16,0xe1,0x32,0x4a, + 0x5d,0xd9,0xc2,0x27,0xd5,0xf2,0x9e,0xd7,0xf0,0x2a,0x6a,0x79,0x95,0xcd,0xe3,0x70, + 0xbc,0xab,0x5f,0x82,0x38,0xd6,0x37,0xfc,0xd3,0x91,0x1f,0x3d,0x78,0xd3,0xac,0xbb, + 0xaa,0x80,0xb0,0xf0,0x56,0xc4,0x8e,0xef,0x3e,0x1e,0x8a,0x6f,0x87,0xf2,0x17,0xaa, + 0xa4,0x9c,0x3,0x38,0x69,0x5c,0x58,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/triangulation.png + 0x0,0x0,0x1d,0x7b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x8,0x6,0x0,0x0,0x0,0xc3,0x3e,0x61,0xcb, + 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xf,0xa0,0x0,0x0,0xf,0xa0, + 0x1,0xa0,0x6a,0x8c,0x77,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, + 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61, + 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x1c,0xf8,0x49,0x44, + 0x41,0x54,0x78,0x9c,0xed,0x9d,0x77,0xbc,0x1f,0x45,0xb5,0xc0,0xbf,0x73,0x6f,0x2e, + 0x21,0x10,0x12,0x4a,0x82,0x21,0x80,0x84,0x2a,0x10,0x7a,0x51,0x9a,0x2,0x8a,0x2, + 0xa2,0x80,0x20,0x1d,0x24,0x4,0x11,0x14,0x9f,0xa0,0x20,0xf0,0x88,0x28,0x1a,0xb, + 0xf0,0x94,0x27,0xe8,0xc3,0xf2,0x14,0x2,0x88,0x94,0x87,0x52,0x82,0x80,0x6,0x8, + 0x46,0x40,0x10,0x89,0x20,0x48,0x2f,0x41,0x4a,0x12,0x42,0x8,0xa4,0x97,0x9b,0x3b, + 0xef,0x8f,0x33,0xc3,0x9e,0xdd,0xbb,0x65,0xb6,0xfc,0x7e,0xf7,0x8a,0x9c,0xcf,0x67, + 0x3f,0xbf,0xfd,0xcd,0xce,0x9c,0x39,0xbb,0x7b,0x76,0xe6,0xcc,0x69,0x63,0xac,0xb5, + 0xbc,0xb,0xff,0xbe,0x30,0xa0,0xaf,0x9,0x78,0x17,0x4,0x8c,0x31,0x23,0x80,0xfd, + 0x80,0x4d,0x80,0xa7,0x80,0x89,0xd6,0xda,0x59,0x2d,0xef,0xb7,0xbf,0x8f,0x0,0xc6, + 0x98,0xa1,0xc0,0x3c,0x6b,0x6d,0x4f,0x5f,0xd3,0xd2,0x2a,0x30,0xc6,0x7c,0xa,0xb8, + 0x1c,0x18,0xc,0x74,0x3,0x5d,0xc0,0x5b,0xc0,0x51,0xd6,0xda,0xdf,0xb5,0xb2,0xef, + 0x8e,0x56,0x22,0xaf,0x3,0xc6,0x98,0x13,0x8c,0x31,0x2f,0x3,0x6f,0x2,0xf3,0x8d, + 0x31,0x57,0x19,0x63,0x86,0xf7,0x35,0x5d,0x4d,0x83,0x31,0x66,0x13,0xe0,0x6a,0xe4, + 0xe5,0x1b,0xe4,0xe5,0x3,0xc,0x1,0xae,0x35,0xc6,0xac,0xdb,0xd2,0xfe,0xfb,0xe3, + 0x8,0x60,0x8c,0x39,0x1f,0x38,0x23,0x51,0xbc,0x1c,0x98,0x1,0x8c,0xb6,0xd6,0xbe, + 0xd5,0x6,0x1a,0x3a,0x81,0x15,0x80,0x81,0xee,0x37,0xef,0xb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0xa4,0xc1, + 0xfe,0xf,0x55,0x78,0xef,0x7c,0x27,0x31,0xc0,0xf7,0xd4,0x8d,0x3d,0x95,0xf8,0xca, + 0xbb,0xdc,0x88,0x60,0x81,0xc7,0x52,0xda,0x6e,0x4e,0x24,0x20,0x2d,0x4,0xd6,0x69, + 0x13,0xcd,0x7e,0xaa,0x78,0xa3,0xe0,0xeb,0xff,0x59,0x83,0x7d,0x76,0x2,0xd3,0x14, + 0xfe,0x6d,0x9a,0xbc,0xa7,0x3e,0x31,0x79,0x1a,0x63,0x76,0x25,0xb2,0xf7,0x2f,0x7, + 0x8e,0xb1,0xd6,0x2e,0x52,0x55,0x46,0x10,0x59,0x3,0x5f,0x4d,0xb6,0xb7,0xd6,0x3e, + 0xe,0x5c,0xea,0xfe,0xe,0x2,0xc6,0xb7,0x88,0xd4,0x64,0xbf,0xaf,0x5b,0x6b,0xaf, + 0x0,0x7e,0x83,0x30,0x60,0x1a,0x74,0x91,0x42,0x73,0x8d,0x3e,0x97,0x23,0xd3,0x91, + 0x87,0xaf,0x34,0x85,0xdb,0x77,0xd0,0xee,0x2f,0x7f,0x65,0xe2,0x5a,0xb1,0x6f,0xa5, + 0xd4,0xf9,0x80,0xba,0x7e,0x59,0x6,0x9e,0xb5,0x80,0xf9,0x44,0x2,0xd8,0x56,0x6d, + 0xbc,0x87,0x2d,0x89,0x46,0xa8,0xb4,0xe3,0x95,0x26,0xe9,0x41,0xec,0x6,0x5e,0x38, + 0x5d,0xa,0x8c,0xfc,0x57,0x1e,0x1,0x7e,0x0,0x6c,0xe8,0xce,0xa7,0x92,0xfe,0xf5, + 0xae,0xad,0xce,0x53,0xbf,0x26,0x6b,0xed,0x74,0x87,0xb,0x64,0x29,0x79,0x7e,0x53, + 0x4,0x6,0x80,0x1e,0xa1,0x34,0x78,0xbf,0xc5,0x91,0xc0,0x3d,0xc6,0x98,0x46,0xfc, + 0x16,0xac,0xb5,0x73,0x81,0x5f,0xb8,0xbf,0x5d,0xc0,0x17,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0x37,0x33,0x6d,0x64,0x21,0x12,0x42,0x97,0x91,0x23,0x98,0x21,0xbe,0x8c,0xf7,0x28, + 0x7c,0x16,0xf8,0x46,0x5,0x9a,0x6,0xbb,0x51,0xce,0xf7,0xf9,0xde,0x7e,0xc5,0x0, + 0x88,0xc0,0xa4,0xad,0x58,0x97,0x97,0x68,0xbb,0x87,0x6a,0x57,0xda,0xa8,0x82,0xa8, + 0x4d,0x7d,0xfb,0xab,0x6a,0xde,0xc7,0xf0,0xc4,0xd0,0x7d,0x78,0x46,0xbd,0x3b,0x55, + 0x9d,0x11,0x5,0x38,0x7,0x22,0xb1,0x80,0x9a,0x9,0x2e,0x7,0x56,0x28,0x49,0xdb, + 0x5,0xaa,0xfd,0xf7,0xfb,0x1b,0x3,0x8c,0x53,0xc4,0xbd,0x48,0x9,0x93,0x2d,0x70, + 0x94,0x6a,0xfb,0xb5,0xa,0x7d,0xf,0x23,0x92,0x21,0x7a,0x80,0xed,0x6b,0xdc,0xc7, + 0xaf,0x14,0x2d,0xbf,0xcb,0xa9,0x77,0x85,0xaa,0xb7,0x5d,0x0,0x5e,0x3,0x7c,0x37, + 0xc1,0x4,0x93,0x71,0xbe,0x10,0x81,0xb4,0xad,0xe3,0xbe,0x7e,0xeb,0xee,0x77,0x95, + 0x7e,0xc1,0x0,0xc0,0xb6,0x6a,0x18,0xee,0x21,0xe1,0xf6,0x1c,0xd0,0x5e,0x7b,0xc4, + 0x8e,0xad,0x48,0xc3,0x59,0xa,0xc7,0x5d,0x15,0x71,0xec,0xa3,0x70,0xcc,0xcb,0x1b, + 0x66,0x89,0x5b,0x36,0x3f,0x59,0xa2,0x8f,0xe3,0xd5,0x4b,0xb4,0x88,0xd3,0xc7,0xfa, + 0x25,0xda,0xff,0x5a,0xb5,0x3d,0xb5,0xcf,0x19,0xc0,0xd,0x6f,0x5a,0x15,0xfa,0xc3, + 0xa,0x38,0xb4,0x33,0xe4,0xde,0x15,0xe9,0x18,0x84,0x78,0x17,0x79,0x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,0x51,0x70,0xc6, + 0xcc,0x9a,0x5d,0x79,0xc6,0x1d,0x99,0x5b,0xab,0x41,0xb0,0xd6,0x3e,0x8b,0x24,0x9c, + 0xbc,0xc7,0x15,0xad,0x0,0xfc,0x2f,0xf0,0xf,0xf7,0xdf,0x20,0xb9,0xa,0x32,0x11, + 0x14,0xd,0x33,0x83,0x88,0xcf,0x29,0x8d,0x39,0x5b,0x26,0xfa,0xd1,0x5e,0xbd,0x13, + 0x1a,0xc4,0xbb,0x17,0xf1,0xf0,0xea,0xbc,0x63,0x3a,0xf5,0x3c,0x88,0xb4,0x4,0x9e, + 0x9a,0x2,0xae,0x85,0xd3,0xc1,0x40,0xe2,0xe,0x22,0x96,0x48,0xde,0x59,0x82,0xc4, + 0x4e,0x1e,0x4c,0xc2,0xbe,0x11,0x82,0xf8,0x62,0x85,0xf0,0x1f,0x49,0x4,0xd,0xde, + 0x80,0xf6,0x77,0xf,0xb2,0xc2,0x15,0xe0,0x1b,0x2,0xfc,0x3c,0xf1,0x40,0x16,0x13, + 0x77,0xf3,0xf2,0xf,0x67,0x8e,0xfa,0x3f,0x1f,0xd8,0xaf,0x62,0x9f,0x57,0x2a,0x3c, + 0x6d,0x8b,0x56,0x56,0xfd,0x1b,0xe0,0xdb,0x19,0xcc,0xed,0x99,0xe1,0x19,0x94,0x89, + 0xbb,0x8,0xe1,0x47,0x88,0x22,0x5b,0x96,0x12,0xe0,0xef,0x56,0x83,0x78,0xed,0x55, + 0x73,0x72,0x4d,0x5c,0xfb,0x12,0xf7,0x8,0xb2,0x88,0x93,0xea,0x66,0xc4,0xbd,0x68, + 0x26,0x23,0xc1,0x9e,0x6b,0x11,0x5f,0x81,0x74,0x3,0x9f,0xaf,0xd0,0xef,0x79,0xa, + 0x47,0x2f,0x75,0x6d,0x1b,0x19,0x61,0x2c,0xd9,0x2,0xef,0x32,0xc4,0xe4,0xbe,0x92, + 0xb5,0x29,0x42,0xa0,0x31,0x66,0x80,0x31,0x66,0x53,0x63,0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0xf1,0x55,0x2,0x42,0xf,0x4a,0xe1,0xf4, + 0x29,0xc0,0x46,0x19,0xf5,0xbb,0xd4,0x8,0xf7,0x52,0x1,0xee,0xc3,0x89,0x8f,0x86, + 0x4f,0x52,0xe0,0xb2,0xd,0xac,0xab,0xea,0xdf,0xd2,0xa6,0x97,0xbe,0x1a,0xe2,0x11, + 0x34,0x95,0xfc,0x97,0xae,0x8f,0x6e,0x60,0x33,0xcd,0x0,0x5f,0xcb,0xf8,0xfa,0xfd, + 0xf1,0x14,0x2d,0x48,0x52,0x98,0xb8,0x91,0xe0,0x80,0x50,0xc4,0x11,0xe5,0xda,0x4, + 0x8d,0xf3,0x81,0xff,0xc8,0xa3,0xd3,0x7d,0x21,0xbe,0x7e,0x61,0xd8,0x19,0x22,0x17, + 0xe8,0xc8,0xe6,0x99,0xe4,0x4c,0x4f,0xc8,0xfc,0xea,0xa5,0xed,0xbf,0xb5,0xf0,0x59, + 0x75,0x20,0xee,0xe4,0x57,0x93,0x3e,0x65,0x77,0x23,0xf2,0xcc,0xa3,0x29,0x1f,0xb3, + 0x5,0xce,0x78,0x1b,0x97,0x43,0x78,0x2e,0xc5,0x6a,0xd2,0xe9,0xc8,0xb2,0xaa,0xb1, + 0x84,0xca,0xea,0x86,0x74,0x40,0xe8,0x5f,0xb,0xea,0x1e,0x8a,0x18,0xa1,0x34,0x6d, + 0x77,0x15,0x7d,0x9d,0xae,0xed,0x58,0xd5,0x26,0x68,0x8e,0x46,0xf4,0xeb,0x3a,0xd, + 0xcc,0x2,0xe0,0x80,0x9c,0xfa,0xde,0x79,0x63,0x66,0xb,0x5e,0xfc,0x7a,0xee,0x5d, + 0x4d,0xcb,0x78,0x47,0xcf,0x20,0xa,0xbb,0xb5,0x5d,0xfd,0x81,0x8a,0x41,0x7a,0x10, + 0xa7,0x9d,0x58,0xe0,0x8a,0x47,0xfc,0xf1,0x82,0x97,0x9f,0x3c,0xe6,0x23,0xe9,0x4a, + 0x8e,0xa1,0x81,0x30,0x6c,0x2,0x2,0x42,0x91,0x1d,0x44,0x7e,0x93,0xa0,0x63,0x1e, + 0xf0,0x79,0x2,0x47,0x27,0x24,0xed,0xbc,0x6f,0xfb,0x89,0x12,0xf4,0xad,0x49,0x3c, + 0x45,0xed,0x72,0xe0,0x8b,0x19,0x75,0xbd,0xbd,0xa4,0x87,0x1a,0xb9,0x8c,0x15,0xbe, + 0x15,0x91,0x1c,0x3,0x93,0x48,0xcf,0x4c,0xb6,0x0,0x11,0xa0,0x77,0x4f,0x3e,0x7, + 0xe2,0x2e,0x76,0xa9,0x53,0x92,0xae,0x3c,0x89,0xde,0xa3,0x40,0x37,0xe2,0x28,0x79, + 0x37,0xf1,0x9c,0xf7,0xc9,0x3a,0x93,0x11,0xdb,0x40,0xb0,0x33,0x62,0x82,0xd0,0x3d, + 0x14,0xbe,0x9f,0xa4,0x5c,0x3f,0x8a,0xde,0x82,0xcd,0x24,0xa,0x32,0x8d,0xa4,0xe0, + 0xb9,0x4f,0xb5,0x2f,0x95,0x9,0x1c,0xd1,0x17,0xdc,0x98,0xa0,0xe1,0x7,0x29,0xf, + 0x5d,0xbb,0x75,0x97,0xa2,0x2f,0x81,0x67,0x3b,0xc7,0xb0,0x59,0x49,0x29,0xef,0x47, + 0xbc,0x7e,0x32,0x2d,0x98,0xee,0xe3,0xf0,0xf5,0xcf,0x2e,0x62,0x80,0xa1,0xc0,0x55, + 0x89,0x4e,0x66,0x0,0x5b,0xa8,0xeb,0x87,0x23,0xf3,0xce,0x9b,0x19,0x44,0x59,0x64, + 0xef,0x9b,0xf1,0x88,0xc2,0x25,0xf4,0xcb,0x4c,0xd,0x8,0x45,0x74,0xea,0x37,0x27, + 0xf0,0xbf,0x5,0x9c,0x50,0xe1,0x81,0x76,0x12,0x85,0xab,0x4f,0xaf,0xf8,0x52,0x3a, + 0x88,0x6b,0x46,0x2d,0x89,0xdc,0x3f,0x88,0x1f,0xbf,0xbf,0xb6,0x73,0x49,0xfc,0xab, + 0x23,0xde,0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0x2a,0xf0,0xdf, + 0xa,0x67,0xed,0xec,0x5a,0xe,0xe7,0xce,0x48,0xca,0x7a,0x8f,0x77,0x16,0xf1,0x0, + 0xd9,0xbf,0xa3,0x3c,0x72,0x10,0xcb,0xea,0x51,0xee,0xde,0xd3,0x4,0xba,0xf9,0x88, + 0xfa,0x7d,0xb7,0x6,0x68,0xd3,0x1,0xab,0x17,0x67,0xd6,0xcb,0x68,0xfc,0x94,0x6b, + 0xb8,0x98,0x1a,0xeb,0x7f,0x44,0x49,0x71,0x34,0x32,0x4f,0xce,0x4b,0xb9,0xe1,0xbc, + 0x63,0x1,0x92,0x44,0xba,0xf6,0x8b,0x72,0xb4,0xe8,0x28,0xda,0x4a,0xd3,0x48,0x6, + 0xde,0x8d,0x88,0xc7,0xe6,0xe9,0xa3,0xc7,0x1d,0x3f,0x47,0x76,0x12,0xc9,0x92,0x9d, + 0xee,0x43,0x72,0x5,0x54,0x4a,0xf2,0x90,0x41,0x97,0x66,0xc4,0x4c,0x2f,0xe5,0xac, + 0xc6,0xda,0xfd,0xb8,0x91,0x2d,0xd6,0x90,0x35,0xe9,0xbe,0x88,0xae,0x3d,0xa9,0xb3, + 0x4f,0x7b,0x70,0xbd,0x52,0xae,0xd5,0xe8,0xdb,0x20,0x53,0x90,0x5,0x66,0x35,0x85, + 0x57,0xe1,0x1f,0x46,0x3c,0xa8,0x34,0xe4,0x98,0x81,0xa4,0x79,0xa9,0x1c,0x4a,0x57, + 0x40,0x93,0x5e,0xf1,0x64,0x26,0xb7,0xc8,0xf2,0x8,0x9a,0xa6,0xce,0x47,0x65,0xd4, + 0x29,0x5,0xd6,0xda,0x25,0xd6,0xda,0xdb,0xac,0xb5,0x27,0x21,0x73,0xff,0x6d,0x44, + 0xc9,0x95,0x93,0xd0,0x83,0x2c,0x3f,0x9b,0x82,0x8d,0x91,0x8,0x66,0x10,0x95,0x69, + 0xa3,0x60,0xad,0x7d,0x9d,0xe8,0xa3,0xc9,0x83,0x6e,0x64,0x55,0x73,0x20,0xe2,0x82, + 0x7e,0x86,0xb5,0xf6,0xc9,0xa6,0xe9,0x31,0xc6,0xc,0x44,0xe4,0x32,0x80,0x57,0xac, + 0x4,0xc6,0xa4,0x42,0x16,0x3,0xbc,0xa8,0xce,0x47,0x35,0x44,0xd7,0xdb,0x60,0x85, + 0x45,0x6f,0xce,0xa9,0xd2,0x89,0x8,0x55,0x4d,0xc1,0x76,0xea,0xfc,0xa1,0x6,0xf1, + 0x6a,0x18,0x45,0x36,0x43,0x83,0xd8,0xe0,0xd7,0xb5,0xd6,0x1e,0x60,0xad,0xbd,0xc9, + 0xb6,0x76,0xdf,0xe2,0xed,0x91,0x11,0x17,0x64,0x24,0xc8,0x84,0x90,0x11,0x60,0xbd, + 0x6,0x8,0x4a,0x83,0x4b,0x11,0x59,0x23,0xb,0x4e,0x36,0xc6,0x8c,0x6e,0xa8,0x2f, + 0xcd,0x0,0x8d,0x8f,0x0,0xce,0xe9,0x72,0x7,0xb2,0x9d,0x4e,0x97,0x21,0x2b,0xaa, + 0x19,0x4d,0xf7,0x9d,0x1,0xbb,0xa8,0xf3,0xda,0xc,0x30,0xaa,0x26,0x31,0xa9,0x60, + 0xad,0x5d,0x8a,0xe8,0x11,0x62,0xc5,0x88,0xa0,0x4,0xa2,0xfa,0xbd,0xdb,0x18,0xb3, + 0x75,0x3,0xdd,0x69,0x27,0x90,0xc6,0x18,0xc0,0x18,0x33,0xc8,0x18,0x33,0x1e,0x31, + 0xba,0x6c,0x90,0x53,0xb5,0x3,0x71,0xd4,0x6c,0x17,0x4,0x33,0x40,0x96,0x0,0xd1, + 0x48,0xc6,0x8b,0x0,0x41,0x45,0xaf,0xf7,0x4f,0x44,0xd4,0xad,0x6b,0x10,0x17,0xa8, + 0x66,0x53,0xd3,0x15,0x8d,0x48,0x9d,0xda,0x48,0xec,0xbe,0xc3,0xf9,0x9,0x7a,0xef, + 0x2a,0xb6,0x88,0x74,0x81,0xaf,0xb1,0x48,0xe7,0x40,0xda,0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0x22,0x9d,0xf8,0x29,0x28,0x71,0x61,0x9,0x22,0x77, + 0x57,0xb8,0x73,0x53,0x9b,0x21,0xce,0x22,0x93,0x55,0xfd,0x5,0x94,0x88,0xe1,0x43, + 0xb6,0x6f,0xf5,0x6d,0x37,0x29,0x49,0xe7,0x8,0x7a,0x5b,0x48,0x7b,0x90,0x10,0xed, + 0x35,0x54,0x3d,0x9d,0xa4,0xe9,0x16,0x55,0xfe,0x51,0x55,0x7e,0x5f,0x9b,0x18,0x40, + 0xdb,0x63,0x86,0xd5,0x61,0x0,0x9d,0xac,0xe1,0xb0,0x86,0x89,0x9c,0xa0,0x70,0x17, + 0x66,0xd6,0x44,0x84,0xc3,0x49,0xaa,0xcd,0x42,0xe0,0x63,0x81,0x7d,0x79,0xef,0xa1, + 0xb9,0x84,0x9b,0xa7,0x3b,0x11,0xf7,0xb2,0xa4,0xea,0xf6,0x61,0x12,0x26,0x5e,0xc4, + 0x32,0xaa,0xd,0x3a,0x3b,0xa9,0x6b,0x1d,0xc4,0xbd,0x77,0x52,0x47,0xba,0x6,0x9f, + 0xeb,0x2a,0x44,0x56,0xca,0xa7,0x82,0xda,0xe4,0x20,0xd3,0x69,0xd2,0xcf,0x68,0x82, + 0x40,0x87,0x77,0x30,0x51,0xe2,0xa3,0x45,0x4,0xe6,0xb2,0x71,0xc3,0xec,0x6d,0x8a, + 0xa6,0xc5,0x14,0x44,0xf0,0x10,0x5f,0xcd,0x14,0xa,0x44,0xae,0xcd,0x7,0xe8,0xed, + 0x60,0x39,0x17,0x71,0x78,0xe9,0xe5,0xac,0x8a,0xe8,0xf0,0x33,0x85,0x4c,0xe2,0xa6, + 0xee,0x96,0x3a,0xd7,0x22,0x72,0x53,0x29,0xc1,0x33,0xf,0x99,0x1e,0xa6,0x9b,0xdc, + 0xb,0xf7,0x38,0x85,0xb7,0xd4,0x66,0x7,0x88,0x76,0x4b,0xef,0x1b,0xbc,0x84,0x7c, + 0xff,0x3c,0x9d,0xc2,0x2e,0x77,0x29,0x86,0x8,0x70,0x3f,0xa3,0xb7,0x95,0xee,0x6a, + 0x32,0xec,0x21,0x6e,0xa4,0xd0,0x86,0xa0,0x3d,0x53,0xea,0x8c,0x52,0x38,0x67,0x50, + 0x31,0x87,0x62,0xe0,0xf3,0xd1,0xa3,0x76,0x90,0xd3,0x4c,0x1e,0xb2,0xf5,0x14,0xb2, + 0x5b,0x1b,0x24,0x52,0x5b,0xe5,0x82,0x86,0xf1,0x44,0xfb,0x2e,0xe2,0xd9,0xc9,0x96, + 0x92,0xe1,0x78,0x81,0xf8,0x28,0xf8,0x7a,0xa9,0xbb,0x73,0x20,0x42,0xdc,0x58,0xe2, + 0x66,0x5d,0x8b,0xb8,0x81,0x7f,0xa4,0x80,0x16,0xed,0xc9,0x74,0x6f,0x4e,0x3d,0x3d, + 0x7d,0x65,0x32,0x6c,0x3,0xcf,0x56,0xcb,0x3b,0xa3,0xeb,0x32,0x40,0x27,0x91,0xab, + 0xf8,0xe3,0xd,0x11,0xb8,0xa1,0xfa,0x1a,0x5e,0xa2,0xe2,0xb6,0x67,0x88,0xfb,0xb5, + 0x76,0xb,0xef,0x26,0x25,0xa9,0x54,0x62,0xb4,0xe8,0xe5,0x46,0x5,0x6c,0x45,0xef, + 0x1d,0x3c,0x16,0x22,0x5e,0x3d,0xb9,0x1b,0x38,0x38,0xc6,0xd1,0x6b,0xfd,0xcc,0x8c, + 0xe4,0x88,0x53,0xa7,0xaf,0x57,0x6a,0x17,0x94,0x12,0xcf,0xa4,0x83,0x48,0x66,0x99, + 0x43,0xa8,0xbc,0x53,0x80,0x74,0x9a,0x43,0xb8,0xa0,0x21,0x22,0xbf,0xa5,0x1e,0x44, + 0xad,0x8,0x60,0xc7,0xa0,0x3a,0x22,0xa8,0x1b,0xf8,0x4c,0xa2,0x8e,0x37,0x3b,0xcf, + 0xd7,0xcc,0x86,0x8,0x4b,0x17,0xd2,0xdb,0x19,0x65,0x22,0x81,0xdb,0xcc,0x10,0xf, + 0x3,0x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0x4e,0x3b,0xa6, + 0x3,0x47,0xd6,0xe8,0xe3,0xc3,0xa,0xd7,0xb3,0x94,0x8,0x9b,0x47,0x94,0x4b,0xbe, + 0x6d,0xe9,0x84,0xd4,0x39,0x78,0x87,0x2b,0xbc,0xa5,0x62,0x12,0x8b,0x92,0x44,0x4d, + 0x53,0xe7,0xa3,0xa,0xea,0xe6,0xc1,0x61,0x88,0x47,0x2c,0x48,0x66,0xd1,0xa6,0x13, + 0x4c,0x79,0xf0,0x16,0xcc,0x2c,0x98,0x82,0xe4,0xb,0xf8,0x75,0x8d,0x3e,0xc6,0xa9, + 0xf3,0xf3,0xac,0x32,0x62,0x5,0xc0,0x55,0x44,0x6,0xa2,0xc3,0x8c,0x31,0x2b,0xd7, + 0xa0,0x43,0x43,0x39,0x3,0x90,0x82,0x76,0x31,0xc0,0x18,0x75,0x7e,0x59,0xd,0x3c, + 0x45,0xb0,0x31,0xd9,0x99,0xc0,0xba,0x91,0xaf,0xa3,0x32,0xf3,0x19,0x63,0x76,0x46, + 0x46,0x0,0x90,0xa0,0x97,0x2b,0xca,0xb4,0xb7,0xd6,0xbe,0x81,0x98,0x92,0x41,0x34, + 0xa2,0x87,0x54,0xa5,0x25,0x1,0x2d,0x63,0x80,0x97,0x88,0xfc,0xdc,0xd6,0x2b,0x83, + 0xd8,0x83,0x73,0x97,0xf2,0x4,0xbe,0x88,0x18,0x76,0x5a,0x5,0x79,0xe9,0xe5,0x3a, + 0x11,0x8b,0x5e,0x1d,0xf8,0x9a,0x3a,0xbf,0xc0,0x8a,0x57,0x53,0x59,0xb8,0x54,0x9d, + 0x8f,0xad,0x49,0x8f,0x87,0xca,0xc,0x10,0x32,0xbf,0xf8,0x64,0x4b,0xf3,0x2a,0xce, + 0x4f,0x7a,0x83,0xc4,0x6f,0xb6,0x62,0xee,0x77,0xfd,0x7c,0x86,0xec,0x20,0x93,0xe5, + 0xc8,0x3a,0xbc,0xf2,0x52,0x96,0x78,0x26,0xee,0x19,0x54,0xdc,0x14,0x2,0xf9,0xe8, + 0xf4,0x72,0x78,0xe3,0xaa,0x34,0x39,0x7c,0x5d,0x44,0x9e,0x48,0xc1,0x9b,0x6d,0x87, + 0xca,0x0,0x10,0x79,0x8,0xf,0x36,0xc6,0xac,0x51,0x86,0xb9,0x8c,0x31,0x1d,0xee, + 0xc5,0xe0,0x8,0xbc,0xbc,0x4c,0xfb,0xd0,0x3e,0x8c,0x31,0xe7,0x39,0xdc,0x3e,0xd3, + 0xa7,0x7f,0xb8,0x1e,0x16,0x21,0xbe,0x0,0xb3,0x6a,0x74,0xa5,0xbf,0xfe,0xb,0xad, + 0xb5,0x8b,0xaa,0x20,0xb1,0xe2,0x6c,0x33,0x41,0x15,0xd5,0x1d,0x5,0xb6,0x43,0x14, + 0x4d,0x50,0xf6,0xeb,0x77,0x4,0x15,0x71,0x98,0x5e,0xbe,0x95,0xca,0x15,0x44,0x7c, + 0xd7,0xae,0xbb,0x5b,0xf0,0xd5,0xaf,0x4c,0x6f,0xf7,0xac,0x6b,0x10,0x27,0x50,0xbd, + 0x22,0xa8,0x95,0xb0,0x9,0x49,0x4,0xed,0x97,0x95,0xb3,0xa9,0x19,0xc1,0x43,0xdc, + 0x40,0xf4,0xa,0x35,0x12,0x70,0x21,0xb9,0x90,0xfc,0x7d,0x7e,0xa5,0x15,0x23,0xc0, + 0x34,0x75,0x5e,0x56,0xe,0x38,0x4e,0x9d,0x4f,0x28,0xd9,0x36,0x17,0x8c,0x31,0xeb, + 0x22,0x51,0xb9,0xde,0x3d,0xcb,0x22,0xdb,0xd5,0x1d,0x6e,0x65,0x97,0x8d,0x8b,0x55, + 0xf5,0xba,0x29,0xdb,0xce,0x26,0x12,0x2e,0x2f,0xb6,0xd6,0xce,0xab,0x83,0xcc,0x5a, + 0x3b,0xd,0x89,0xf,0x4,0x9,0x81,0xdf,0xa7,0x6,0xba,0xea,0xf3,0xbf,0x23,0xa6, + 0x88,0xc3,0x4e,0xa0,0x2,0x87,0x21,0x7e,0x7c,0x7e,0x6e,0x9a,0x7,0xac,0xdc,0xe0, + 0x97,0xbf,0x13,0xf1,0xe4,0x50,0xb,0x81,0x43,0x53,0xbe,0xb2,0xda,0xa3,0xf,0x12, + 0xfb,0xe7,0x8d,0x62,0x73,0xa9,0xb0,0x9f,0x50,0x6,0xde,0x23,0x15,0x7d,0x95,0xc3, + 0xe0,0x88,0xd4,0xda,0x8b,0x29,0xb9,0x3,0xb9,0xb5,0x5,0x8a,0x20,0xd7,0x81,0x76, + 0x6b,0xca,0x8c,0x32,0x4d,0x69,0xa7,0xb3,0x53,0x5c,0xd6,0xe0,0xcb,0x3f,0x92,0xb8, + 0xfb,0xf5,0xab,0xa4,0xa8,0xa9,0x11,0x61,0xcb,0xd7,0xab,0x94,0x10,0xc2,0xe1,0xd1, + 0x3b,0x74,0x9c,0xd7,0xe0,0x7d,0xac,0x48,0x94,0xff,0x60,0x29,0x15,0x4,0x54,0xe2, + 0x26,0xfb,0x4a,0xea,0xf5,0x32,0x42,0xa0,0xff,0xaa,0x42,0x61,0x8c,0x3a,0xaf,0xbd, + 0xf6,0x37,0x2,0xe3,0x11,0x65,0x8a,0x17,0x7a,0xa6,0x22,0x2f,0xbf,0xd7,0x4e,0x20, + 0x56,0x84,0x2d,0x9f,0x46,0x7d,0x84,0x31,0x66,0x68,0x85,0x3e,0xd7,0x25,0x12,0x62, + 0x17,0x11,0xdf,0x8d,0xa3,0x16,0x58,0x6b,0x17,0x23,0xc9,0x9d,0x41,0x24,0xf9,0x63, + 0x2a,0xa0,0xa9,0x37,0xfc,0x3b,0x42,0x8a,0xb8,0x6c,0x20,0x91,0xc0,0xf2,0x48,0x20, + 0x67,0xea,0xdd,0x33,0x9e,0xa3,0xfe,0x76,0x72,0x2b,0x21,0x7b,0xe3,0x68,0x61,0xef, + 0x7a,0x8a,0xb7,0x82,0xd5,0x1b,0x51,0x57,0xc9,0x3e,0xaa,0x2d,0x78,0xa5,0x77,0x42, + 0xf,0xc0,0xbf,0xbd,0xc2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,0x60,0xe3,0x6, + 0x22,0x43,0x7c,0x1a,0x4d,0x83,0x4d,0x91,0x10,0x7a,0x80,0x7,0xea,0x3c,0xa3,0xc6, + 0x64,0x0,0x63,0xcc,0x56,0x44,0xd2,0xfa,0xd3,0xd6,0xda,0xa0,0x79,0xc9,0x18,0x73, + 0x10,0xe2,0x9b,0xef,0xb7,0x78,0x99,0x85,0x4,0x7f,0x56,0x5e,0x3d,0x24,0x40,0x27, + 0x61,0x2a,0x5a,0x9,0x9c,0x88,0x64,0xfc,0x2,0xc9,0x26,0xfa,0x70,0x43,0x34,0x84, + 0xc0,0x65,0x44,0x16,0xcc,0x31,0xce,0x92,0x9a,0x5,0xbb,0xaa,0xf3,0xea,0xf3,0x3f, + 0x81,0xc,0xe0,0x86,0x72,0x6f,0x4a,0x1d,0x95,0x51,0x6d,0x8c,0x3a,0x9f,0x10,0x82, + 0xd7,0x18,0x33,0xe,0xa7,0xd0,0x71,0x45,0x8f,0x21,0x6b,0xe1,0x7b,0x43,0xda,0x7, + 0x42,0xd0,0x8,0xe0,0x32,0x6b,0x9d,0xae,0x8a,0xbe,0xdd,0x20,0xd,0x85,0x60,0xad, + 0x7d,0x81,0xc8,0x59,0x66,0x1d,0xe0,0x63,0x39,0xd5,0x9b,0x11,0x0,0x5d,0xc7,0xa1, + 0x82,0x8a,0x4e,0x97,0x3e,0x34,0x71,0xad,0x8b,0x28,0xa,0x77,0x39,0x5,0xbb,0x70, + 0x23,0xf3,0x71,0x72,0x9b,0x97,0x5b,0x68,0x30,0x51,0xa2,0xea,0x4b,0x67,0x8,0xc9, + 0x14,0xb0,0x80,0x2f,0xa8,0x7a,0xb5,0x33,0x89,0x54,0xa4,0x55,0x87,0x9a,0x5d,0x97, + 0x53,0xef,0x49,0xf5,0xac,0x6b,0x39,0xd8,0x96,0x21,0x4e,0xab,0x55,0xb7,0x4a,0x5c, + 0x3b,0x40,0x5d,0xcb,0xcd,0x29,0x84,0x4,0x6c,0xfc,0x39,0xf1,0xf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4,0xfa,0x8,0xa0,0x75,0x1,0x63, + 0xd4,0x79,0x6c,0xed,0x6f,0x8c,0x59,0xc1,0x18,0x33,0x1,0x51,0xe8,0xf8,0xbe,0x6e, + 0x47,0x74,0xfa,0x2d,0x53,0xaf,0xa6,0x40,0xea,0x8,0xe0,0x14,0x2a,0x67,0xab,0x6b, + 0x7d,0xfd,0xf5,0x7b,0x48,0x1d,0x5,0x8c,0x31,0x3,0x88,0x74,0x25,0xaf,0x59,0x6b, + 0x9f,0xab,0xdd,0x53,0x9,0x1,0x65,0x15,0x22,0x21,0xe9,0x21,0x57,0xa6,0x3,0x1e, + 0x1f,0x4f,0xd4,0x1f,0x4e,0x3c,0xc3,0x97,0x5,0x2e,0xa2,0xc5,0x3b,0x90,0x66,0xd0, + 0xbe,0xa3,0xa2,0xe1,0x7a,0x55,0xae,0x73,0xea,0x7,0x5,0x79,0xb6,0x89,0x5e,0xad, + 0x52,0x9f,0x83,0xdb,0x92,0x86,0xb8,0x71,0xeb,0x86,0x26,0xfa,0xa,0x1e,0x1,0xac, + 0x38,0x42,0xbe,0xe1,0xfe,0x8e,0x72,0xbf,0x63,0x54,0x95,0xb7,0xbf,0x7e,0x63,0xcc, + 0x16,0x88,0xb0,0xb7,0x9b,0x2b,0xea,0x46,0x92,0x41,0x9d,0x62,0xcb,0x85,0x52,0x35, + 0x5,0x59,0x32,0x80,0xe,0xf3,0xfa,0xae,0x75,0x4f,0xb9,0xaf,0xc1,0xc6,0xd,0x44, + 0xab,0x22,0x8c,0xa,0xd,0xf,0xff,0xbe,0xb3,0x32,0x9c,0xa9,0x1d,0x10,0xd6,0x40, + 0x72,0xe5,0x59,0xe4,0x5,0xaf,0xe5,0xea,0xec,0x47,0x94,0x9b,0xdf,0x22,0x4c,0x13, + 0x9c,0xd6,0xad,0x85,0x5f,0x55,0xcc,0x28,0x44,0x7c,0x6f,0xa4,0x52,0x41,0x9e,0x6d, + 0xa2,0x57,0xd3,0x37,0xc9,0x95,0x69,0x43,0xd9,0xae,0x8d,0xf4,0x53,0x92,0x28,0x9d, + 0x9b,0x47,0xfb,0xa3,0xdf,0xe2,0xae,0x27,0x37,0x53,0x7a,0x92,0x9a,0x91,0x2f,0xd, + 0x3e,0xd0,0xc9,0x8a,0xae,0xd,0x88,0xa7,0x86,0x69,0x4b,0x12,0xc7,0x92,0xf4,0x76, + 0x10,0x45,0x65,0xf5,0x20,0x72,0x97,0x4f,0x47,0xb7,0x84,0x86,0x36,0xef,0x2c,0x23, + 0x4,0x42,0x5c,0x10,0x3c,0x42,0x9d,0x5f,0x69,0x8c,0xf9,0x5,0xb2,0x8f,0x9e,0xc7, + 0x79,0x7,0x22,0xec,0x3d,0x43,0xff,0x0,0xbd,0x12,0x38,0x84,0x48,0x9f,0x5e,0x3a, + 0xc8,0xb3,0x1d,0x60,0x7b,0x1b,0x88,0x4e,0x41,0xf6,0x26,0x6,0x49,0x49,0xd3,0x6b, + 0xb5,0x55,0x5,0xea,0x30,0x80,0x5f,0x9e,0xcc,0x41,0xd4,0xa8,0xc7,0xab,0x6b,0x97, + 0x0,0xfb,0x5a,0x6b,0xdf,0xa4,0xff,0x80,0x96,0x3,0x4e,0x54,0xe7,0x55,0x83,0x3c, + 0xdb,0x1,0x31,0x3,0x91,0x2a,0x6f,0x66,0xfe,0xa7,0x3c,0x3,0x68,0x7f,0xc0,0xe, + 0xf5,0xfb,0x21,0x77,0xee,0xb7,0x54,0x3d,0xd9,0xb6,0x76,0x47,0x8c,0x52,0x60,0x8c, + 0x19,0x8c,0x38,0x5d,0x78,0x58,0xdf,0xfd,0xce,0x46,0xfc,0xfe,0xfb,0x25,0x58,0x59, + 0x2a,0x7b,0x5b,0xbf,0x7e,0xf6,0xc3,0xdd,0x12,0xb6,0x91,0x4e,0x42,0xe7,0xa4,0xb3, + 0x88,0x2f,0xe9,0x92,0xc7,0x1c,0xe0,0xa3,0x7d,0x3d,0x77,0x66,0xd0,0x7e,0x23,0x71, + 0xd9,0xc4,0x1f,0x8b,0x28,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ba,0x54, + 0x1f,0x25,0x88,0xd9,0xd,0xd9,0xbf,0xde,0x22,0x5e,0xbb,0x3d,0x88,0x14,0x7d,0x7c, + 0x5f,0x3f,0xa8,0x0,0xda,0x57,0x44,0xe2,0x15,0x97,0xaa,0x7,0x39,0x5,0xd8,0xa8, + 0xaf,0x69,0xb,0xa0,0x7d,0x4f,0xe2,0xbb,0x93,0xbd,0x49,0x60,0x2a,0xf8,0x90,0x23, + 0x68,0x15,0xe0,0xc1,0x85,0x58,0xef,0xf,0x8c,0x46,0x94,0x42,0xb7,0x59,0x6b,0x5f, + 0xcc,0x6d,0xd4,0x8f,0xc0,0x18,0xd3,0x85,0x64,0x2c,0x9f,0x61,0xfb,0x97,0x92,0xaa, + 0x10,0x8c,0x31,0x23,0x11,0x46,0x7e,0xc1,0x96,0x79,0x69,0x45,0x78,0x1b,0xc4,0xf5, + 0x2e,0xfc,0xb,0xc2,0xff,0x3,0x27,0x66,0x5a,0x57,0xe3,0x95,0xc6,0xc3,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fileSave.png + 0x0,0x0,0x4,0xb5, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x4,0x7c,0x49,0x44,0x41,0x54,0x78,0x5e,0xb5,0x94,0xdd,0x6b,0x1c,0xd5, + 0x1f,0xc6,0x3f,0xe7,0x65,0x66,0x67,0x5f,0xf2,0x6e,0xd2,0xb4,0x69,0xc1,0x37,0xea, + 0xb,0xe2,0x4d,0xf4,0xce,0x4b,0xa1,0x88,0x82,0x48,0x41,0xe8,0x95,0x7a,0x21,0xbd, + 0xf4,0xc7,0xef,0xf,0xf0,0x46,0xf4,0x52,0xf0,0xd2,0x4b,0x11,0x5b,0x14,0x2d,0x8a, + 0x8a,0x42,0xac,0x28,0xc1,0x68,0x6d,0xda,0x9b,0x94,0x26,0x6d,0x9a,0xb6,0x49,0x37, + 0x4d,0x9a,0xee,0x6e,0x76,0x67,0x77,0x67,0x77,0x66,0x67,0xe6,0x38,0x3d,0x84,0xb0, + 0xa1,0x90,0x80,0xe0,0x3,0xcf,0xce,0x7e,0x99,0x99,0xe7,0xf3,0x3d,0xdf,0x39,0x33, + 0xc2,0x18,0xc3,0x7f,0x29,0xcd,0x8e,0xa6,0xa7,0x4f,0xbf,0x2,0xe6,0xd,0x30,0x47, + 0x8d,0x41,0xf2,0xef,0x24,0x8d,0x49,0x56,0xe2,0xb8,0xfb,0xcb,0x95,0x2b,0x67,0x7f, + 0x4,0x22,0xcd,0xae,0xcc,0x9b,0xef,0x7d,0xf4,0xbf,0x93,0x7a,0xf8,0x91,0xfc,0xc5, + 0xb9,0x59,0xb9,0xf0,0xd7,0x8c,0xe8,0x76,0x9a,0x42,0x22,0x11,0x2,0x84,0xfd,0x1, + 0x29,0x44,0xdf,0x7f,0x89,0x76,0x5d,0xa6,0x9e,0x78,0x96,0x27,0x5f,0x3c,0xc1,0xf8, + 0xe4,0x61,0xe6,0x67,0xe7,0x5e,0x9a,0xfb,0xec,0x8b,0xe3,0xc0,0x25,0xe0,0x5e,0x1f, + 0x80,0xe3,0xce,0xf0,0x98,0xf7,0x6b,0x59,0xe9,0xaf,0xbf,0x3c,0xc7,0x7,0xef,0xbe, + 0xca,0xe3,0x47,0x27,0x91,0x52,0x62,0x0,0x23,0x52,0x24,0xc2,0xd6,0x2,0x1,0x18, + 0xa4,0x52,0xd8,0xda,0x29,0x70,0xe6,0xd2,0x26,0xdf,0x2e,0x6b,0xf4,0x1f,0x3f,0x68, + 0xe0,0x8,0x30,0x5,0x34,0x76,0x1,0xc6,0x98,0x66,0xa5,0xea,0xa7,0x37,0x36,0xf3, + 0xd4,0xb7,0x7d,0x6,0x3d,0x45,0xc1,0x15,0xf4,0xe2,0x8,0x0,0x89,0x44,0x6b,0x9d, + 0x59,0xd9,0x15,0xf4,0x7a,0x11,0x69,0x9a,0x20,0x52,0x81,0xe7,0x2a,0xa2,0xc5,0x9f, + 0xf1,0x7,0x5e,0x63,0x20,0x8c,0x93,0x24,0xe9,0x45,0x40,0x1,0x50,0x9a,0x3e,0x49, + 0x9,0x45,0x47,0xda,0x80,0xd2,0xe0,0x10,0x85,0x62,0x91,0x38,0x8e,0xc9,0xee,0xb0, + 0xa1,0x4a,0xd9,0x70,0xeb,0x9d,0xee,0xf1,0x3c,0x8f,0x52,0x69,0x80,0xe9,0x97,0x4f, + 0x72,0xfd,0x5a,0x1e,0x29,0x15,0x20,0x0,0xc,0x40,0x3f,0xc0,0x86,0x68,0x47,0xa2, + 0xa4,0x60,0x28,0x3,0xc,0xf,0xf,0x13,0x86,0x21,0xbd,0x5e,0x6f,0x17,0xb2,0x23, + 0x5b,0x67,0xa6,0xdd,0x6e,0x13,0x85,0x21,0xc5,0xe1,0x49,0xf2,0xf9,0x88,0x68,0xf7, + 0x9a,0x87,0x1,0x68,0x21,0xc8,0x69,0x89,0x56,0x92,0x7a,0xbd,0xce,0x60,0xc1,0xf2, + 0x6d,0xe7,0xae,0xeb,0xda,0x11,0x29,0xdb,0xb9,0x5d,0xa5,0xad,0x9d,0xcc,0xf9,0x42, + 0x9e,0xdb,0xab,0xa,0xcf,0xa9,0xd3,0x13,0x86,0x7e,0xed,0x1d,0x91,0x10,0xb8,0x8e, + 0x44,0x1a,0xc3,0xc4,0xe4,0x4,0x47,0xa6,0xe,0x13,0xf7,0x7a,0x76,0x4c,0x3b,0xb2, + 0xe1,0x80,0x5d,0x55,0xa7,0xd3,0x21,0x30,0x86,0x7a,0x7d,0x9b,0x38,0x1c,0xa3,0xe0, + 0x28,0xda,0x42,0xec,0x3,0x90,0x90,0xd7,0x12,0xc7,0x73,0x9,0x3b,0x1d,0x3a,0x41, + 0x60,0x3b,0xf4,0xbc,0x1c,0x8e,0xe3,0xe2,0x68,0x85,0xd2,0x1a,0x21,0xec,0x18,0x11, + 0x52,0x61,0x57,0xe7,0x68,0x5a,0xb7,0x23,0xf2,0x2b,0x15,0x84,0xdc,0x7,0xa0,0xa5, + 0x24,0xa7,0x5,0x3,0x87,0x9f,0xe6,0xa9,0x67,0x9e,0xe3,0xd8,0xc4,0x10,0x8,0x30, + 0x69,0x4a,0x6a,0xc8,0x6c,0x48,0x52,0xe8,0x25,0x86,0x4e,0x2,0x61,0x4,0x51,0x22, + 0x41,0xc0,0x76,0xd7,0x90,0x77,0x25,0x12,0xf6,0x1,0x8,0x70,0x94,0xe1,0xd1,0x17, + 0x4e,0x30,0x73,0x4b,0xf0,0x58,0x60,0xb2,0x5a,0xd2,0x89,0x15,0x9d,0x28,0xa5,0x19, + 0x26,0x4,0x9d,0x88,0x7a,0xab,0x8b,0xdf,0x6c,0x53,0x6f,0x36,0x69,0x36,0x7c,0x8c, + 0x72,0xd0,0x3,0x87,0xc8,0xe5,0x73,0x28,0x79,0xc0,0x88,0x72,0xa,0x26,0x8e,0x4c, + 0xf1,0xe9,0xf7,0xf3,0xe4,0x13,0x1f,0x11,0xb5,0xe9,0x76,0x3,0xa2,0x4e,0x40,0x1a, + 0x77,0x51,0x26,0xc6,0x73,0x4,0x43,0xc5,0x1c,0x23,0x25,0x8f,0xb1,0x91,0x12,0x13, + 0x13,0x87,0xa8,0xb9,0x63,0x24,0xba,0x80,0x14,0xfb,0xac,0x40,0x9,0x41,0x21,0xe7, + 0xd2,0xb8,0x35,0xcf,0xf3,0x4e,0x8d,0x63,0x53,0xc3,0x94,0xbc,0x7c,0x16,0x36,0x42, + 0x31,0x27,0x19,0x1d,0x2c,0x32,0x92,0xb9,0x54,0x2c,0xe0,0xe5,0x5c,0x94,0x94,0x44, + 0x71,0x4c,0xd0,0x6a,0x72,0xd9,0x77,0xb9,0x19,0x68,0x84,0xdc,0x6f,0x44,0x4a,0x90, + 0x73,0x35,0x7e,0xf9,0x1a,0xa7,0xff,0xff,0x3a,0xbf,0xcd,0xfc,0xc4,0xd6,0x5a,0x85, + 0xbb,0x71,0xc2,0xa9,0x53,0xa7,0x30,0xc6,0x90,0xcb,0x39,0x28,0x25,0x31,0x40,0x62, + 0xc0,0xa4,0x86,0x14,0x41,0xc9,0x53,0x14,0x13,0xbd,0xff,0x33,0x10,0x2,0x3c,0x47, + 0xe2,0x3a,0x8e,0xdd,0x2d,0x8b,0x4b,0x4b,0xf6,0x65,0x1b,0x1f,0x1f,0x27,0x4d,0x53, + 0x80,0xec,0x68,0x76,0x2d,0xa5,0xc1,0x60,0x65,0x77,0x58,0xde,0xd3,0x64,0x70,0x91, + 0x69,0x97,0xb3,0x7,0xa8,0xa4,0xc8,0x0,0x1a,0x2f,0xe7,0xd0,0x9,0x7b,0x94,0x4a, + 0x25,0xc6,0xc6,0xc6,0x18,0x1d,0x1d,0xb5,0x80,0xfd,0x94,0x73,0x14,0x3d,0x7f,0x83, + 0x34,0xa,0x30,0x26,0x8d,0x1,0xf1,0x10,0x40,0x4b,0x81,0xa3,0x1e,0x58,0xee,0x7c, + 0x96,0xad,0x39,0x50,0x42,0xa2,0xe2,0x36,0xcb,0xb3,0xdf,0x98,0xca,0x7a,0x54,0xad, + 0xd7,0x6f,0xfd,0xe,0x74,0x81,0x64,0xf,0x40,0xa,0x70,0x1d,0x81,0x94,0x80,0x31, + 0x1c,0x20,0xb,0xd7,0x5a,0xd9,0xe7,0x12,0x6c,0x5d,0x63,0xe5,0xf2,0xed,0xee,0x8d, + 0xeb,0x17,0x3e,0x5f,0x5f,0xff,0xfb,0x3c,0xb0,0x5,0x74,0xf7,0xee,0x22,0xad,0x18, + 0x2a,0x91,0x8d,0x65,0x14,0x37,0xe7,0xda,0xf,0x5d,0x16,0x62,0xdf,0x64,0xa5,0x4, + 0xae,0xab,0xb3,0x30,0x3b,0x67,0x82,0x20,0x34,0xf5,0x7a,0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x96,0x78,0xff,0x51,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/Voronoi_diagram_2.png + 0x0,0x0,0xc,0x15, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x54,0x0,0x0,0x0,0x53,0x10,0x6,0x0,0x0,0x0,0x51,0xfe,0xfc,0x3a, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0xff,0xff,0xff,0xff,0xff,0xff,0x9,0x58, + 0xf7,0xdc,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc4,0x0,0x0, + 0xe,0xc4,0x1,0x95,0x2b,0xe,0x1b,0x0,0x0,0x0,0x9,0x76,0x70,0x41,0x67,0x0, + 0x0,0x0,0x54,0x0,0x0,0x0,0x53,0x0,0x13,0x5b,0xf9,0x7f,0x0,0x0,0xb,0xa0, + 0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x5d,0x5b,0x48,0x55,0x41,0x17,0x1e,0x6f,0x59, + 0xde,0xd2,0xb0,0x52,0xd4,0xd2,0xb4,0xc0,0x17,0xbb,0x79,0xeb,0xe6,0x83,0x22,0x15, + 0x69,0x11,0x14,0xa,0x52,0x9a,0x8a,0x68,0x11,0x51,0x20,0x6,0xda,0x83,0x17,0x7a, + 0x50,0x10,0x15,0x12,0x84,0xd4,0x4a,0x45,0x22,0x12,0x3,0xb1,0x32,0x43,0x14,0xb, + 0xd4,0x34,0xa3,0xe8,0x46,0xa9,0xa5,0x68,0xe6,0x15,0xf3,0x92,0x9a,0xae,0xff,0x61, + 0xfe,0xf5,0xf,0x9c,0xf3,0x1f,0xce,0xc5,0x7d,0xf6,0xec,0x73,0x9c,0xef,0xe5,0x63, + 0x9f,0xa3,0x67,0xd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,0xd9, + 0xd9,0x59,0x42,0x7a,0x7b,0x7b,0x7b,0x7b,0x7b,0x9,0x69,0x68,0x68,0x68,0x68,0x68, + 0xe0,0xfd,0x94,0xa4,0x83,0x10,0xa8,0x9e,0xd0,0xd4,0xc4,0x33,0x9f,0x25,0x2d,0x3e, + 0x7f,0xfe,0xfc,0xf9,0xf3,0x67,0x75,0x61,0xaa,0x62,0x7e,0x7e,0x7e,0x7e,0x7e,0x9e, + 0xfd,0xbd,0xb9,0x40,0x8,0x54,0x4f,0x78,0x78,0x78,0x78,0x78,0x78,0x10,0xb2,0x6d, + 0xdb,0xb6,0x6d,0xdb,0xb6,0x11,0x32,0x39,0x39,0x39,0x39,0x39,0x49,0xc8,0x8f,0x1f, + 0x3f,0x7e,0xfc,0xf8,0x21,0x7d,0x79,0xb4,0x69,0x27,0x84,0x36,0xed,0x9a,0xff,0x6e, + 0xd3,0xa6,0x4d,0x9b,0x36,0x6d,0x22,0xe4,0xf0,0xe1,0xc3,0x87,0xf,0x1f,0xe6,0xfd, + 0x94,0xa4,0x83,0x10,0xa8,0x9e,0x90,0x3b,0xd,0x2f,0x3c,0x3c,0x3c,0x3c,0x3c,0x9c, + 0x90,0x98,0x98,0x98,0x98,0x98,0x18,0x42,0x1c,0x1d,0x1d,0x1d,0x1d,0x1d,0x99,0x60, + 0xf1,0xfa,0xc2,0x85,0xb,0x17,0x2e,0x5c,0x20,0xe4,0xd8,0xb1,0x63,0xc7,0x8e,0x1d, + 0x33,0xa3,0xe1,0x2e,0xde,0x9d,0x60,0x43,0x79,0x69,0x69,0x69,0x69,0x69,0x9,0xa0, + 0xbc,0xbc,0xbc,0xbc,0xbc,0x1c,0x20,0x35,0x35,0x35,0x35,0x35,0x15,0xe0,0xde,0xbd, + 0x7b,0xf7,0xee,0xdd,0x3,0xc0,0xe0,0xc2,0x58,0xe5,0xcb,0x1d,0x2c,0x21,0x77,0x75, + 0x75,0x75,0x75,0x75,0x1,0xdc,0xbd,0x7b,0xf7,0xee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7,0xee,0xdd,0x3b,0x0,0x67,0x67,0x67,0x67,0x67, + 0x67,0x56,0x41,0x18,0x54,0xac,0x55,0x98,0x4a,0x49,0xf7,0xd3,0xc4,0xe6,0xe6,0x59, + 0xb9,0x1b,0x20,0x15,0x7f,0xfd,0xfa,0xf5,0xeb,0xd7,0xaf,0x0,0xdb,0xb7,0x6f,0xdf, + 0xbe,0x7d,0x3b,0xab,0x90,0x73,0xe7,0xce,0x9d,0x3b,0x77,0x4e,0x3a,0xa1,0x3c,0x7a, + 0xf4,0xe8,0xd1,0xa3,0x47,0xda,0x93,0x55,0x9c,0x9c,0x9c,0x9c,0x9c,0x9c,0x0,0x30, + 0x6f,0x94,0xd7,0x73,0xd1,0xe6,0x59,0x31,0xa7,0x41,0x2a,0xcf,0x8a,0xe,0x0,0x5b, + 0x18,0xcc,0x65,0xc0,0x71,0xdc,0xdf,0xbf,0x7f,0xff,0xfe,0xfd,0x1b,0x60,0x68,0x68, + 0x68,0x68,0x68,0x8,0x80,0xee,0x58,0xd,0x80,0xf5,0xa7,0xfa,0x7b,0xd6,0x98,0xd5, + 0xb4,0xb2,0xb2,0xb2,0xb2,0xb2,0x2,0x70,0xed,0xda,0xb5,0x6b,0xd7,0xae,0x49,0x90, + 0x26,0x25,0x13,0xa8,0x47,0x63,0x79,0xa2,0xf4,0x1,0x10,0x72,0xfc,0xf8,0xf1,0xe3, + 0xc7,0x8f,0x13,0x52,0x5d,0x5d,0x5d,0x5d,0x5d,0x4d,0x88,0x95,0x95,0x95,0x95,0x95, + 0xd5,0xda,0x97,0x42,0x18,0x9a,0xee,0x77,0xe6,0xcc,0x99,0x33,0x67,0xce,0xc8,0xff, + 0x7c,0xfc,0xfd,0xfd,0xfd,0xfd,0xfd,0x2d,0x2c,0x70,0xc2,0x81,0x9e,0x5e,0x42,0xc8, + 0xad,0x5b,0xb7,0x6e,0xdd,0xba,0x45,0x8,0xcd,0x61,0xc0,0x2c,0x31,0x42,0xb0,0x5, + 0xc0,0xe7,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,0x1b,0x1b,0xfd, + 0xaf,0xe9,0x73,0x90,0xe0,0xbe,0x79,0xbf,0xd1,0x52,0x31,0x6d,0x52,0x1,0xa2,0xa2, + 0xa2,0xa2,0xa2,0xa2,0xd4,0x83,0x96,0x96,0x96,0x96,0x96,0x96,0x16,0xe9,0x3d,0x99, + 0x52,0x17,0xb1,0xd1,0x25,0x31,0x9a,0xfb,0x9e,0x71,0x71,0x71,0x71,0x71,0x71,0x0, + 0xb8,0x42,0x80,0xb7,0xbd,0x9a,0x98,0xbb,0x1,0x52,0x33,0x36,0x11,0xb1,0xb1,0xb1, + 0xb1,0xb1,0xb1,0xac,0x42,0x36,0x6e,0xdc,0xb8,0x71,0xe3,0x46,0x0,0xba,0x46,0x49, + 0xb9,0x15,0x62,0x28,0x63,0xfe,0x6a,0x4e,0x4e,0x4e,0x4e,0x4e,0xe,0x0,0xf5,0x64, + 0xec,0xfe,0x71,0x2e,0xdf,0xd4,0xee,0x9f,0xbb,0x1,0xc6,0x62,0x8c,0xda,0x69,0x53, + 0xcc,0x2a,0xca,0xda,0xda,0xda,0xda,0xda,0x1a,0xa0,0xb6,0xb6,0xb6,0xb6,0xb6,0xd6, + 0x74,0x2a,0x4a,0x13,0xd3,0x9d,0x9e,0x1,0x2,0x2,0x2,0x2,0x2,0x2,0xd4,0x3d, + 0x25,0xde,0xbf,0xa9,0x8d,0x7f,0x22,0x73,0x37,0xc0,0xd8,0x8c,0x7d,0xeb,0xf4,0xf4, + 0xf4,0xf4,0xf4,0x74,0x56,0x71,0x34,0x46,0x4,0x28,0x2b,0x2b,0x2b,0x2b,0x2b,0x33, + 0x9d,0x8a,0xc3,0xae,0x4c,0x46,0x46,0x46,0x46,0x46,0x6,0xb,0x46,0xf0,0xbe,0x76, + 0xed,0xda,0xb5,0x6b,0xd7,0x2e,0x80,0x97,0x2f,0x5f,0xbe,0x7c,0xf9,0xd2,0x74,0xee, + 0x4b,0x13,0x73,0x37,0x40,0x2e,0x46,0xa1,0xe6,0xe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,0x62,0xee,0x6,0x98,0x1a,0x77,0x74,0x74,0x74, + 0x74,0x74,0xb0,0xe0,0x4,0x33,0xdb,0xe5,0xb6,0x43,0xa9,0xcb,0x9d,0xa5,0x66,0xeb, + 0x35,0xb9,0xdf,0x75,0x8,0xb9,0xfb,0x9e,0x9a,0x40,0xcf,0xad,0xb7,0xb0,0x50,0x3d, + 0xbf,0xde,0xdc,0x20,0xfa,0xa0,0x7a,0x42,0xee,0xbe,0xe7,0x7a,0x87,0x10,0xa8,0x9e, + 0x50,0x8a,0x7,0x5d,0x2f,0x30,0xf9,0x99,0x24,0xb9,0x80,0x3,0xe5,0x34,0x18,0xc1, + 0x9d,0x3c,0x58,0x92,0x88,0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x19,0xcc,0xdc,0x28,0xc, + 0xc2,0x83,0xea,0x8,0x1c,0x57,0x44,0x61,0xfa,0xf8,0xf8,0xf8,0xf8,0xf8,0x8,0x61, + 0x1a,0x1b,0x42,0xa0,0x3a,0x42,0xb5,0xef,0x29,0x9a,0x76,0x79,0x20,0x4,0xaa,0x23, + 0x44,0x70,0xc4,0x7,0x42,0xa0,0x3a,0x42,0x4,0x47,0x7c,0x20,0x82,0x24,0x2d,0xc0, + 0x19,0x1c,0x4c,0xab,0xc3,0xa4,0x8c,0x91,0x91,0x91,0x91,0x91,0x11,0x42,0xe8,0x5a, + 0x24,0xd1,0x7,0x35,0x16,0x84,0x7,0xd5,0x82,0xef,0xdf,0xbf,0x7f,0xff,0xfe,0x9d, + 0x9,0x93,0x2e,0xf5,0x10,0xc2,0x94,0xb,0x42,0xa0,0x5a,0x20,0xfa,0x9e,0x7c,0x21, + 0x4,0xaa,0x5,0xa2,0xef,0xc9,0x17,0x42,0xa0,0x5a,0x20,0x3c,0x28,0x5f,0x8,0x81, + 0x6a,0x0,0xe6,0x5,0x9,0xf,0xca,0x17,0x22,0x9b,0x49,0x3,0xfe,0xfc,0xf9,0xf3, + 0xe7,0xcf,0x1f,0x42,0xe8,0x96,0xda,0x6c,0x51,0x1c,0x3d,0xd7,0x87,0xb7,0x75,0xeb, + 0x7,0x62,0x98,0x49,0x47,0xe0,0x70,0x93,0x64,0xe7,0xff,0x8,0xe8,0x84,0xff,0x0, + 0xb9,0x51,0x21,0x7f,0x86,0x16,0xa7,0xbb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fileNew.png + 0x0,0x0,0x3,0x0, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x92,0x49,0x44,0x41,0x54,0x48,0xc7,0xb5, + 0x96,0x4d,0x4b,0x54,0x51,0x1c,0xc6,0x7f,0xe7,0xde,0x99,0x3b,0xbe,0xc,0x86,0x12, + 0x96,0xa6,0x34,0x44,0x8a,0x94,0x42,0x90,0xd9,0x62,0x10,0xfb,0xe,0x6d,0x6c,0x97, + 0x50,0xab,0x56,0x2d,0xdc,0xf6,0x2d,0xa2,0x45,0x50,0x14,0xb8,0xa8,0x90,0x12,0x37, + 0x51,0x1b,0xb5,0x30,0x2b,0x2a,0xad,0xc1,0x34,0x4c,0x57,0xa1,0xf9,0x92,0xa2,0xce, + 0x78,0xe7,0xde,0x7b,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+ 0x27,0x7d,0x80,0x76,0x60,0x8e,0xa2,0x7c,0x18,0x7,0x3,0x5c,0x14,0x2e,0xe4,0xb6, + 0x4d,0xf3,0xe9,0x13,0xb4,0x9c,0x6d,0xa0,0xb5,0xb5,0x8e,0x8e,0x8e,0x18,0x21,0xec, + 0xec,0x65,0xcd,0x12,0x22,0x50,0x5,0x11,0x48,0x40,0xa1,0x10,0x8,0x14,0x61,0x33, + 0xc4,0xa5,0xae,0x8b,0x80,0x5,0x44,0x39,0x16,0xb5,0xd0,0x74,0x79,0x24,0x8b,0x14, + 0x3e,0xe2,0x1f,0xa8,0xb,0x8,0x20,0xd,0xd4,0x90,0xcd,0x56,0x49,0x8d,0x96,0x5f, + 0x36,0x2,0x85,0xd2,0x92,0x99,0x28,0xd0,0xd0,0xac,0xc3,0xf2,0x28,0x80,0xbc,0x45, + 0x0,0x42,0x23,0x44,0xb6,0x11,0xcb,0x1d,0x15,0xf9,0xfc,0xdb,0x45,0xd2,0x59,0xbc, + 0x2a,0xf8,0x44,0x94,0x63,0x51,0x5a,0x5b,0x91,0x95,0xcc,0x98,0x94,0x91,0xf4,0xcb, + 0x1,0x88,0x82,0x24,0xb,0x4,0x46,0xce,0x26,0x95,0xcb,0x84,0x2c,0xc7,0x22,0x0, + 0x47,0x77,0xaf,0x99,0xcb,0x42,0x7e,0x49,0x9d,0x27,0xb7,0x20,0x5f,0x25,0x27,0xd9, + 0xd5,0x10,0xb3,0x28,0x2a,0x89,0xc2,0xd0,0x1d,0xee,0x80,0x71,0x24,0x8b,0x8c,0x1c, + 0x40,0x10,0xce,0x95,0xa5,0x42,0xea,0x58,0xc,0x20,0xc,0x54,0x53,0x11,0xae,0xc8, + 0xbe,0x60,0x94,0x18,0x81,0xa3,0xab,0x48,0x22,0xf0,0x1,0x1f,0x41,0x15,0x10,0x3, + 0x8e,0xeb,0x1,0x38,0xc7,0xea,0xea,0x46,0xe9,0x0,0x21,0x30,0xd0,0x16,0x8,0x4c, + 0x2d,0xd8,0x6,0x78,0x6c,0x2d,0x8c,0x31,0xfb,0x61,0x82,0xd1,0x91,0xf7,0xfe,0xb3, + 0xc1,0xaf,0xf3,0x3f,0x37,0x99,0xd1,0x83,0x2e,0x79,0x68,0x40,0xc4,0xaa,0x8c,0x40, + 0xa3,0x1e,0x92,0xd,0xa4,0x96,0x12,0x8c,0xbf,0xb8,0xcd,0x9b,0xd1,0x71,0x7f,0xe8, + 0xf5,0xf2,0xb7,0xa9,0x35,0x26,0x81,0x19,0xe0,0xb,0xf0,0x3,0x58,0xd4,0x15,0x71, + 0x38,0x40,0x63,0x9d,0x50,0xb0,0xc4,0xc8,0xc0,0x63,0x86,0x7,0xee,0x3b,0xe3,0x93, + 0x72,0x61,0x62,0x91,0x77,0x5a,0x30,0x1,0x4c,0x3,0xcb,0x5,0xcd,0xb0,0xb7,0x13, + 0x41,0xff,0x2a,0xba,0x9a,0xc5,0xb5,0xe4,0x6,0x37,0xe7,0xb7,0xf9,0x63,0xc3,0x28, + 0x30,0x5,0xcc,0x3,0xbf,0xf6,0xab,0xcb,0x5d,0x7a,0x41,0x3f,0x99,0x3d,0x2d,0x0, + 0x44,0x81,0xfa,0xbd,0xe6,0xfc,0x7e,0x80,0xc2,0xfd,0x17,0xfb,0xc6,0x93,0x82,0x32, + 0x2c,0x7f,0xcc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fileOpen.png + 0x0,0x0,0x6,0x7e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x6,0x45,0x49,0x44,0x41,0x54,0x48,0x89,0x9d,0x95,0x7b,0x6c,0x95,0x77, + 0x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xbf,0xbb,0x66,0x7c,0xf8,0xef,0x9d,0x57,0xfd,0xc2,0x17,0xd0, + 0xa2,0xf2,0x7,0xa2,0xf5,0x97,0x62,0xa5,0xc7,0x17,0x5e,0x5b,0x51,0xf7,0xf4,0x9e, + 0x92,0x5,0xdb,0x23,0x41,0x6b,0x18,0x95,0xba,0x89,0x47,0xd3,0x20,0x10,0x45,0xd9, + 0x3a,0xfa,0xcc,0x0,0x77,0x46,0x52,0xc,0x66,0x4a,0x9,0x94,0x6d,0x66,0x79,0xfd, + 0x6,0x42,0xb9,0x21,0x5c,0xdb,0x42,0x4a,0x89,0xeb,0x7a,0x49,0x26,0x27,0x18,0xe9, + 0xda,0x8f,0xd1,0x7b,0x50,0x2e,0x5c,0xbf,0x43,0xcb,0x8f,0x56,0x88,0xb,0xef,0xec, + 0x8a,0x69,0x91,0xa2,0x92,0xd7,0xa3,0x8f,0x6e,0xae,0x7f,0x64,0xc1,0xb6,0xa0,0x1a, + 0x6f,0x45,0x39,0x3a,0x1e,0x6f,0x0,0x29,0x25,0xb6,0x11,0x63,0x62,0x32,0xc9,0xb5, + 0xd1,0x20,0x9e,0x39,0xdb,0xa8,0x7b,0x6c,0x33,0x25,0x25,0x51,0xa4,0x65,0x60,0x19, + 0x59,0xa4,0xed,0x60,0x18,0x16,0x77,0x7b,0x9a,0xe9,0xee,0x38,0x46,0x6d,0xc5,0x1c, + 0xd6,0xef,0xd8,0xeb,0xf3,0x5,0xe3,0xa4,0xa7,0x53,0x28,0x22,0xb3,0x34,0x8f,0xd7, + 0x57,0xe5,0xf7,0x79,0x82,0xe9,0xa1,0x76,0x42,0x9e,0x14,0xc2,0x9b,0x8b,0x61,0x5a, + 0x24,0xd2,0x3a,0xd7,0x6,0x1d,0xd2,0x39,0x8f,0x51,0xbd,0xfe,0x19,0xca,0xca,0x2b, + 0xf1,0xa,0x7,0x23,0x9b,0xc6,0x51,0x2,0xcb,0xb4,0x18,0x1d,0xe8,0xa2,0xe3,0xf4, + 0xef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f,0x13,0xc3,0xb4,0x6c, + 0x14,0x5e,0xfc,0x79,0x95,0x4c,0x75,0x7f,0xc8,0xdf,0x7a,0x6e,0xb4,0x5d,0xbe,0xc5, + 0x49,0x60,0x52,0xb3,0x6d,0x17,0x4b,0xda,0x24,0x93,0x26,0x7d,0xfd,0x53,0x64,0xc4, + 0x5c,0xf2,0xb,0xa2,0x98,0xa6,0xc4,0xb2,0x3d,0x4c,0xc,0x75,0xd1,0x79,0xb1,0x81, + 0xf8,0xf8,0x5d,0x56,0x3f,0xbe,0x99,0x35,0xf5,0x95,0x8,0xd9,0xc7,0x48,0x77,0x3, + 0x99,0xac,0xc4,0xb4,0x24,0x8e,0x23,0x9,0x86,0xcb,0x48,0xde,0x4b,0xd0,0xf0,0x97, + 0xb6,0x9e,0xbd,0x2d,0xfc,0x2,0x18,0x5,0x74,0x4d,0x3a,0xa,0xc3,0xb4,0x89,0xa7, + 0x4c,0x7a,0x6f,0xdf,0x43,0x9b,0xb3,0x84,0x70,0x64,0x16,0x89,0xf8,0x4,0x9d,0xe7, + 0xff,0x48,0xec,0xfa,0x39,0x1e,0xa9,0x78,0x84,0xcf,0x7f,0x7d,0x37,0x5,0xc1,0x61, + 0x12,0x3,0x87,0x89,0xc7,0x13,0x64,0x75,0x13,0xdb,0x96,0x64,0x32,0x29,0xfc,0xa1, + 0x42,0x84,0x98,0xcb,0xd0,0x95,0xb7,0xf5,0xbd,0x27,0xf5,0xdf,0x98,0x92,0xbb,0x40, + 0x52,0x29,0xa5,0x34,0x69,0x29,0xc,0x43,0x12,0x4f,0x1a,0xc4,0xee,0x19,0x2c,0x5d, + 0x54,0x81,0x50,0x16,0xef,0x1f,0xf8,0x31,0x1,0x9f,0x60,0xdb,0xf6,0x97,0x29,0x2d, + 0xcf,0x41,0x1f,0x6e,0x62,0x2c,0x36,0x42,0x3a,0x63,0x91,0x48,0x26,0x40,0xb9,0x68, + 0xbe,0x20,0xbe,0xdc,0x72,0x72,0x72,0x4b,0xe9,0x3f,0x77,0x82,0x33,0x57,0x63,0x47, + 0x93,0x3a,0xed,0xc0,0x94,0x52,0xca,0x6,0xd0,0x4c,0xe9,0x92,0xd1,0x25,0x93,0xd3, + 0x12,0x6f,0xa0,0x90,0x39,0xa5,0x35,0x9c,0x6a,0xda,0xc7,0x9d,0xbe,0x5e,0x76,0x7f, + 0xf7,0x1b,0x94,0xe4,0xf5,0x30,0xd4,0xd9,0x4d,0x36,0x9b,0x41,0x8,0xd,0xdb,0x96, + 0x58,0x86,0x81,0x37,0x27,0x4a,0x7e,0xfe,0xa3,0x88,0x89,0x31,0x9a,0xdf,0xfb,0x7d, + 0xe6,0x50,0xfb,0xf4,0xc9,0x8b,0xb7,0xf9,0x35,0x70,0xf,0x30,0xff,0xf9,0x7e,0x34, + 0xdd,0x52,0x8,0x5d,0x32,0x35,0x63,0x61,0x11,0xc6,0x36,0xa6,0xe9,0xb8,0xf4,0x1, + 0x9b,0x9e,0x5a,0xc5,0xe8,0xad,0x23,0x64,0xc3,0xf9,0x48,0xdb,0xc1,0x34,0x4d,0x5c, + 0x57,0xc7,0xa3,0xe5,0x90,0x17,0x5d,0x8e,0x13,0xcf,0xd2,0xd3,0xd6,0xe8,0xec,0x3f, + 0xd6,0xdb,0xfb,0xd7,0x1e,0xe,0x65,0x4d,0x5a,0x80,0x7e,0x20,0xa5,0x1e,0x28,0x19, + 0xcd,0x30,0x5c,0x54,0x56,0x92,0xd2,0x5d,0x24,0x7e,0xae,0x9c,0x6f,0x60,0x41,0x75, + 0x31,0xb3,0x82,0x23,0x44,0xc2,0x61,0x10,0x1e,0x92,0xc9,0x38,0xae,0xf2,0x10,0xc, + 0x97,0xe3,0x15,0x5,0x8c,0x76,0x7e,0xa8,0xda,0xda,0x2f,0x8d,0xbe,0xd9,0x6c,0x1d, + 0x9d,0xc9,0xd2,0xc,0xdc,0x6,0xc6,0xee,0xc3,0x9d,0x7,0x1f,0xa8,0x66,0x58,0xa, + 0xd7,0x90,0x38,0xca,0x4f,0x2a,0x99,0xa0,0xb6,0x6a,0x2e,0xb,0x2b,0x4,0x79,0x41, + 0x17,0xc7,0xb1,0x71,0x1c,0x45,0x30,0x52,0x8e,0x10,0x85,0x98,0xa3,0x3,0x9c,0x69, + 0x69,0x48,0xfd,0xb6,0x39,0x75,0xea,0xd6,0x18,0x7f,0x2,0x7a,0xef,0x83,0x67,0x0, + 0x43,0x3d,0xa4,0x1e,0x35,0x47,0x81,0xab,0x4,0xca,0x4c,0x53,0x56,0x68,0xb1,0xac, + 0xae,0x80,0x90,0x88,0xe1,0xf,0x14,0x92,0x36,0x20,0xaf,0xa8,0xe,0x73,0x74,0x94, + 0xc1,0xae,0x46,0xf7,0x8d,0xc3,0xb7,0x3a,0x4e,0xdf,0xa4,0xc1,0x92,0x5c,0x4,0x86, + 0x80,0x29,0x40,0xff,0xcf,0xab,0xff,0x4d,0x10,0xf0,0x7b,0xc9,0xc9,0xd1,0x28,0xc, + 0x1a,0x2c,0x5d,0x59,0x8d,0x9b,0xee,0x21,0x2f,0x5a,0x8e,0xed,0x99,0x47,0x20,0x10, + 0x22,0x76,0xb6,0x85,0x23,0xcd,0x57,0x6,0xe,0x9c,0x75,0x8e,0xa6,0x4c,0x8e,0x3, + 0x31,0x60,0x1c,0x48,0x2b,0xa5,0xe4,0xff,0x2,0xff,0x4b,0x10,0x9f,0x9c,0xec,0x96, + 0xd9,0xee,0x95,0x75,0xab,0x9f,0x2f,0x34,0xac,0xeb,0x44,0x8a,0x4a,0x8,0xe6,0xd4, + 0x92,0x88,0xf5,0xd2,0x72,0xe2,0xd4,0xf4,0xbb,0xe7,0xb3,0xad,0xdd,0x3,0x1c,0x5, + 0xae,0xdd,0x8f,0x23,0x1,0x98,0xf,0x8b,0xe3,0xa1,0x82,0xb7,0x9a,0xdc,0x3f,0x57, + 0x17,0x8f,0x8b,0x9d,0x8b,0xed,0x8d,0x73,0x2b,0x37,0x10,0x4e,0xf,0xd2,0xd1,0x74, + 0xd0,0x7a,0xfd,0xc8,0xc0,0xb9,0xce,0x1,0x9a,0x4c,0xc9,0x59,0x60,0x4,0x98,0xbe, + 0x1f,0x87,0xfb,0x71,0xc0,0xf,0xce,0xfc,0xb9,0x45,0x3c,0xff,0xd6,0xf7,0xf2,0xae, + 0x37,0xfe,0x74,0x91,0xfa,0xd2,0xba,0x60,0x57,0xae,0x9f,0x3d,0xc0,0x46,0xa0,0x6, + 0x28,0x0,0x34,0xa5,0x14,0x9f,0x64,0xff,0x1,0x38,0xa4,0x6e,0x5f,0x55,0x49,0x82, + 0xf9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/snapshot.png + 0x0,0x0,0x23,0xdb, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x40,0x0,0x0,0x0,0x40,0x8,0x2,0x0,0x0,0x0,0x25,0xb,0xe6,0x89, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13, + 0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1, + 0x8e,0x7c,0xfb,0x51,0x93,0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a, + 0x25,0x0,0x0,0x80,0x83,0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75, + 0x30,0x0,0x0,0xea,0x60,0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5, + 0x46,0x0,0x0,0x23,0x51,0x49,0x44,0x41,0x54,0x78,0xda,0x14,0x8e,0xcb,0xe,0xc2, + 0x20,0x14,0x44,0xe1,0x42,0x81,0x36,0xb6,0x1a,0xa3,0x69,0x52,0xb7,0xfe,0xff,0x87, + 0xb8,0x77,0x6d,0x74,0x65,0x5a,0x83,0x11,0x2c,0x5,0xca,0x43,0x9c,0xc5,0xe4,0xac, + 0xce,0xc,0xbe,0x5c,0xef,0x94,0xfc,0x83,0x10,0x2,0x80,0x94,0x52,0x8,0x31,0xa3, + 0xcc,0x48,0x4e,0x31,0x86,0x10,0xac,0x77,0xa5,0x59,0x2d,0xb8,0xe0,0x31,0xe3,0x97, + 0xd4,0x26,0x24,0x9f,0xa1,0xb0,0x9e,0x35,0x8e,0xbe,0x6b,0x2a,0x5e,0x6f,0x1e,0xa3, + 0x92,0xb3,0x75,0xc0,0x99,0xe0,0x43,0xbf,0x3d,0xed,0x5b,0x25,0xc7,0x9b,0xb4,0x88, + 0x50,0xf5,0xd5,0xc5,0x99,0x50,0xb1,0x2,0xa6,0xf4,0x3c,0x1c,0xfa,0xae,0x36,0x3e, + 0x3f,0xa7,0x37,0x60,0x38,0xee,0xba,0xa8,0x3e,0x60,0xcc,0xa4,0xd5,0xca,0xca,0x6c, + 0x64,0x80,0x45,0x45,0xb6,0xd,0xab,0x29,0xe1,0x15,0x6d,0xd1,0x6a,0xcd,0xb2,0xd8, + 0xa5,0xdc,0xf0,0xde,0x5b,0x6b,0x8d,0x31,0xce,0x39,0xef,0x5c,0x81,0x9f,0x0,0x24, + 0x8f,0xd1,0xe,0x82,0x30,0xc,0x45,0xc7,0xba,0xb1,0x39,0x32,0xc1,0x98,0xc5,0xff, + 0xff,0x3a,0x1f,0x44,0x14,0x64,0xb0,0x1,0x6b,0xad,0x31,0xe9,0xcb,0x4d,0x93,0x7b, + 0xcf,0x51,0xb6,0xd6,0x12,0x98,0x5c,0xb2,0x0,0x21,0x16,0x2a,0x42,0x14,0xf8,0x47, + 0x22,0x50,0xe0,0x8d,0x47,0xc2,0x3,0x91,0x48,0xd8,0xda,0x84,0x60,0xc6,0x25,0xf3, + 0xcd,0x4b,0xea,0xbc,0xf,0xd7,0xee,0xdc,0xd8,0xbd,0x50,0x2c,0xf0,0x8c,0x77,0x64, + 0x48,0x51,0x8d,0x53,0x8c,0xaf,0x7e,0x1a,0x1e,0x9,0x8d,0x4,0x5d,0xb6,0xac,0x94, + 0xe2,0x4f,0xdb,0xfa,0x4a,0xc2,0xd4,0xf7,0x65,0x94,0x9b,0x80,0xb8,0x6e,0xbc,0x78, + 0x71,0xf6,0x16,0x42,0x7a,0xf,0xb9,0xa2,0x24,0x50,0xb,0xed,0xdd,0xa9,0x75,0xb6, + 0x31,0xa,0xf7,0xed,0xc8,0xeb,0x1c,0x3f,0x39,0x27,0x6,0x66,0x81,0x1f,0x12,0x80, + 0x73,0x4e,0x6b,0xcd,0xb6,0x5c,0xfb,0x15,0x80,0x23,0xb2,0xd9,0x41,0x18,0x86,0x61, + 0x70,0xd3,0xa6,0x74,0x6c,0x1c,0x10,0x9a,0x58,0xc5,0xfb,0x3f,0x18,0x3b,0x83,0x18, + 0x8c,0xee,0xa7,0xcb,0xda,0x90,0x62,0xf9,0x18,0xc9,0x5f,0x6c,0x4,0x60,0x50,0x42, + 0x58,0xa,0x2a,0xa0,0x14,0x5,0x55,0x23,0x5a,0xe7,0xe4,0xd,0x4a,0x49,0x36,0xd1, + 0xb6,0xe4,0x3,0x14,0xd7,0xae,0x2,0x63,0x8f,0xcd,0x79,0x18,0x3f,0x44,0x84,0xc2, + 0x97,0x98,0xf6,0x24,0x87,0xcc,0x39,0xd2,0x46,0x39,0x4f,0xdf,0xad,0xc2,0xdc,0x5e, + 0xba,0xd6,0xd4,0xbe,0xf3,0x7d,0x7f,0xf,0x21,0x58,0x34,0x27,0x6d,0x58,0xa9,0x79, + 0x5e,0x67,0xcd,0x24,0x19,0x68,0x65,0x98,0xf7,0xf0,0x3a,0xec,0x9b,0x49,0x74,0xf3, + 0xd7,0xac,0x41,0x86,0x6f,0x9c,0x53,0x99,0xc6,0xe7,0x23,0x2e,0x93,0xd5,0xa0,0xe2, + 0xba,0x93,0x80,0x14,0x1,0x0,0xfe,0x55,0x2a,0x17,0x74,0xe6,0x9f,0x0,0x2c,0x92, + 0xcd,0xe,0x82,0x30,0x10,0x84,0xbb,0xdb,0x1f,0x1b,0x4d,0x40,0x51,0x63,0x0,0xe3, + 0xc9,0xf7,0x7f,0x2b,0xe5,0xa4,0x98,0x94,0xd6,0xb6,0x50,0xea,0xa2,0xee,0x61,0x93, + 0xb9,0xcd,0xcc,0x37,0x2,0xf2,0xc,0x44,0x96,0x4,0xcb,0x1c,0x40,0x72,0x9e,0x91, + 0x52,0x22,0x19,0xe7,0x42,0x72,0x6,0x6f,0xef,0xf3,0x14,0x85,0xa2,0xcc,0x2,0x18, + 0xd2,0xc2,0x30,0x3,0x91,0xd5,0x4a,0x59,0x3b,0x98,0x1,0x75,0x55,0x2,0x2e,0xf9, + 0xea,0xba,0x71,0xdd,0xc3,0x86,0xb8,0xd6,0x4a,0x6c,0xb4,0x2e,0x76,0x68,0x23,0x75, + 0x70,0x69,0xce,0xa6,0x7f,0x9e,0xf6,0x55,0xf4,0xee,0xde,0xdd,0xae,0x6d,0x1b,0x11, + 0xc2,0x94,0xa4,0x5e,0x3d,0x5f,0xbd,0x1b,0x4c,0x88,0xfc,0x50,0x16,0xc7,0x6d,0x39, + 0x8d,0x71,0x81,0x3d,0x6,0x67,0x4d,0xe,0x5e,0xce,0x89,0x25,0x32,0x39,0x3,0xfe, + 0x8f,0x2a,0x23,0xfd,0xdb,0x52,0xfa,0xfe,0x8f,0x0,0x1c,0x92,0x3b,0xf,0xc2,0x30, + 0xc,0x84,0x93,0xb6,0xa1,0x49,0x85,0x98,0x78,0x95,0x81,0x81,0x81,0x81,0xff,0xff, + 0xa7,0x18,0x4a,0x1f,0x69,0x53,0x27,0xa6,0x16,0x17,0xa4,0xc8,0x3a,0x4b,0x8e,0x75, + 0xd6,0x7d,0xf9,0x80,0x42,0xe9,0x12,0x87,0x2a,0x3c,0x55,0x15,0x6,0x13,0x10,0x11, + 0x8c,0x4b,0xfe,0x69,0x76,0x26,0x32,0x2f,0x21,0xb8,0xc6,0x35,0x75,0x95,0x8,0x3b, + 0xd4,0xd4,0xf,0x7e,0x5d,0x61,0x1f,0x44,0x82,0xb6,0x61,0xf6,0x81,0x52,0x7b,0x7f, + 0xbc,0x7d,0x24,0x1e,0x45,0x15,0xfd,0x18,0x3e,0xdd,0x70,0xae,0x1d,0xb6,0xde,0xae, + 0xad,0xbb,0x9c,0x84,0xe9,0xb0,0xb7,0xc7,0xd7,0x73,0xa1,0xd4,0x4d,0x3e,0x81,0xe3, + 0x35,0x48,0x22,0x3,0x4,0xb4,0x58,0x67,0x4b,0xbd,0x6d,0x31,0x88,0x30,0x2,0xd5, + 0x44,0xa5,0x7c,0x61,0x83,0x11,0xe9,0x96,0x5,0x4c,0xf3,0x3f,0x7,0x98,0x86,0x40, + 0xcd,0x3d,0xf3,0x4f,0x0,0x12,0xca,0x65,0x7,0x81,0x10,0x8,0x82,0xc,0x8f,0x21, + 0xac,0x31,0xfe,0xff,0x7f,0x79,0xf0,0xa6,0x77,0x2f,0x26,0x2b,0x8c,0xc,0xa0,0x36, + 0x2c,0x5c,0x81,0x74,0x51,0xd,0x1e,0xb5,0x71,0xe4,0xa0,0x1f,0x7c,0x13,0x16,0xe9, + 0x17,0x81,0xb5,0x6e,0xcc,0xde,0xe3,0x19,0x84,0x68,0x6d,0xd5,0x56,0x55,0x27,0x1e, + 0xe1,0x6a,0xea,0x7b,0xdf,0xb1,0x6,0xc6,0x72,0x91,0x2c,0x70,0xac,0x32,0x46,0x79, + 0xdc,0xa5,0x14,0x54,0x65,0x6e,0x47,0x17,0xac,0x97,0xde,0x5e,0x25,0x3f,0x6f,0xd7, + 0x2d,0x6,0x76,0xe6,0x72,0x8a,0x89,0x43,0x4a,0x67,0xe,0xbc,0xc5,0x61,0xbc,0x61, + 0xa6,0xf6,0xf9,0x11,0xb2,0xe0,0xc,0x98,0xed,0x6a,0xbe,0x83,0xd1,0x54,0xef,0x3a, + 0x5c,0xf4,0x46,0x33,0x2,0x88,0xd6,0x5c,0xe3,0x0,0x0,0xcf,0xf1,0xc7,0xfc,0x5, + 0x20,0xa1,0xdc,0x76,0x10,0x6,0x81,0x20,0xda,0xe5,0x22,0xa0,0xb1,0xc6,0xf4,0xff, + 0x3f,0x11,0x41,0xd3,0xa6,0x85,0xb2,0xe0,0x40,0xdf,0xe0,0x8d,0x33,0x33,0x7,0x85, + 0x8c,0xa5,0xd6,0xd3,0x0,0x0,0xdf,0x34,0xf4,0x95,0x7d,0x52,0x12,0xe2,0xf6,0x56, + 0x30,0x5c,0x22,0x63,0x2c,0xa6,0x9b,0xf3,0xf,0x63,0x49,0x67,0x81,0x8e,0x0,0xa3, + 0x75,0x6b,0xfb,0xe9,0x3f,0x31,0x55,0x4e,0x8d,0xd7,0x10,0x20,0xa1,0x20,0x54,0x8c, + 0xea,0xc8,0x58,0x37,0xbf,0xee,0xf3,0xf3,0xf1,0x8d,0xc1,0x47,0xf,0x80,0x2d,0x89, + 0x65,0x79,0xb3,0xd0,0xc4,0xe4,0x9c,0x25,0x51,0x19,0x1,0x2a,0x84,0xaf,0xac,0x12, + 0x13,0x17,0x77,0x53,0x42,0x5a,0xc0,0xe4,0x56,0x70,0xaa,0x20,0xeb,0x72,0xf1,0xb1, + 0x1f,0xd7,0xa3,0xaf,0xaf,0x85,0xc6,0xfa,0x71,0x5,0xc1,0x5f,0x0,0x12,0xca,0x60, + 0x7,0x81,0x10,0x6,0xa2,0x60,0xb,0x15,0x56,0xe2,0xc9,0xff,0xff,0xc2,0x35,0x6a, + 0xe2,0xca,0xa2,0x14,0xa7,0x6c,0xcf,0x4d,0x9a,0xbe,0xcc,0x3c,0xf6,0x21,0xe8,0xac, + 0x27,0x78,0xb7,0xb9,0x61,0xed,0x70,0xe8,0x92,0x43,0x82,0x4c,0x2a,0x10,0xeb,0x50, + 0x16,0x9,0x58,0xc0,0xf7,0x43,0x2f,0x5,0x24,0x53,0x77,0x74,0xcb,0x4b,0xee,0xee, + 0x55,0xd,0x56,0x4e,0x71,0x5d,0xef,0xfa,0xd9,0x9,0xf4,0x15,0x55,0xb,0x91,0xfd, + 0xfb,0xbb,0x95,0x50,0xe4,0x5a,0x1e,0xdb,0xb3,0xda,0x39,0x45,0xa4,0xb4,0xee,0x69, + 0x50,0x8a,0xe2,0xb5,0x65,0x3e,0x9d,0x65,0x41,0xa3,0x98,0x62,0x1c,0x9d,0x70,0x6c, + 0xc0,0x6,0xea,0xc9,0xc8,0xc2,0xd,0x15,0x41,0xff,0xb5,0x83,0xfd,0x61,0x21,0x8b, + 0x9,0x6c,0x39,0xed,0x82,0xf9,0xb,0x40,0x52,0xb9,0x2b,0x21,0xc,0x2,0x51,0x14, + 0x36,0x40,0x40,0x13,0xfd,0xff,0x3f,0xb4,0x70,0x6c,0xc,0x23,0x12,0x82,0x39,0x8b, + 0xd,0x5,0xc5,0x32,0xdc,0xc7,0x59,0x57,0xf6,0x46,0x80,0x60,0x13,0x97,0x96,0x6, + 0xff,0x4c,0xd3,0x5a,0x6b,0xa1,0xed,0x64,0xcd,0x8,0x15,0x26,0x1,0xa9,0x84,0x68, + 0x97,0xc4,0x20,0x2a,0xae,0x43,0xe9,0x88,0x9f,0x8d,0xf,0xf3,0x72,0x8d,0xde,0xaf, + 0xf7,0x15,0xa4,0xe4,0xfc,0x0,0xed,0x29,0x46,0x1e,0x78,0xbf,0x9e,0x3d,0x48,0xd9, + 0x72,0xdd,0x2b,0xb6,0xb2,0x6d,0xac,0xb8,0xed,0x73,0x60,0x78,0xaf,0xdf,0x90,0xa6, + 0x25,0x85,0x5b,0x74,0x51,0x6,0x31,0x94,0xd3,0xbd,0x74,0x18,0xa6,0xb6,0x83,0xa8, + 0x43,0xf0,0xc9,0xaa,0xb8,0x54,0x74,0xac,0x29,0xce,0xff,0x1f,0xfa,0xc8,0x36,0x3a, + 0x37,0x91,0x53,0x0,0x8e,0xca,0x68,0x87,0x41,0x10,0x86,0xa2,0xa2,0x96,0x4a,0xb6, + 0x65,0xcf,0x26,0xfe,0xff,0xd7,0xc9,0x1c,0x93,0x31,0x5b,0x25,0xee,0x56,0x9e,0x9, + 0x6d,0xe9,0x39,0x6d,0xf,0x1e,0x8,0x37,0xc8,0x23,0x4b,0x3,0xcb,0xe,0x18,0x46, + 0x68,0x3c,0xe4,0xae,0xcd,0x60,0x23,0x16,0x2,0xd8,0xae,0xe8,0xda,0xb2,0x6d,0xd0, + 0x1,0xfd,0x40,0x1,0x29,0x41,0xc6,0x26,0xa3,0xbd,0xe5,0x17,0x3f,0x69,0x5d,0xde, + 0xcf,0xc7,0x6d,0x1a,0x47,0x26,0x86,0xf4,0xf3,0x1c,0xe3,0x37,0x83,0xdf,0x40,0x8c, + 0x2c,0xf0,0x81,0x22,0xc7,0xfe,0x5a,0xdd,0xfd,0xa4,0x43,0x99,0xcf,0xa1,0xe5,0xa, + 0x55,0x51,0x16,0x86,0x8d,0x56,0xd9,0x4b,0xe3,0x2a,0x91,0x57,0x4,0x13,0x45,0x11, + 0x3e,0x4,0xf2,0x43,0xd5,0x2c,0xd2,0x1b,0x49,0x20,0xdc,0xb4,0x36,0xac,0xcc,0xe9, + 0x4b,0x86,0xbf,0x0,0x24,0x95,0xcb,0xe,0xc2,0x20,0x10,0x45,0xc1,0x80,0x50,0x5b, + 0x8d,0x91,0x68,0x57,0xf5,0xff,0x3f,0xcd,0x74,0x61,0x34,0x94,0xd6,0x50,0x1a,0x3c, + 0x93,0xee,0x8,0x21,0xc3,0xcc,0x9d,0xfb,0x30,0xcd,0xa9,0x3,0x6b,0x29,0xc2,0xad, + 0x44,0xb0,0x9c,0x41,0x11,0xf5,0xf3,0x1a,0x68,0x30,0x1,0xfc,0x82,0xa9,0xac,0xb1, + 0xec,0x98,0x19,0x1c,0x34,0x2d,0x99,0xb0,0x7a,0xa7,0xf5,0xfb,0xdb,0xb2,0xf6,0x9f, + 0x28,0x59,0xd3,0x79,0xd7,0x3f,0x42,0x7f,0xf,0x64,0xa4,0x88,0x21,0xdc,0x8a,0xd2, + 0x24,0xc4,0xf0,0x1c,0xf8,0xfe,0x35,0x8e,0x31,0x26,0x8,0x1c,0xa7,0xd9,0xeb,0xe2, + 0x52,0xd5,0x79,0x52,0xad,0x3b,0xdb,0xe3,0xb5,0xbd,0xb0,0x9e,0xaa,0x6c,0xae,0xa, + 0xd3,0x59,0xf7,0x4e,0x11,0x46,0x3,0xb7,0xec,0x61,0xf3,0xcb,0x9c,0x88,0x5e,0xda, + 0xdd,0x69,0x23,0xf6,0x6f,0x44,0xb7,0x34,0xfe,0x17,0x80,0xc3,0x2a,0xc9,0x41,0x18, + 0x86,0x81,0x69,0x9c,0xb8,0xa2,0x2a,0x7,0xfe,0xff,0x39,0x6e,0x48,0x70,0x81,0xb6, + 0x4a,0x8a,0xe5,0x85,0x9,0x67,0xcb,0xab,0x66,0x71,0xa1,0xfe,0x19,0xcc,0xf8,0xf3, + 0x62,0xa1,0xe1,0xc9,0x31,0xbe,0x9,0x98,0xd9,0xfc,0x35,0xeb,0xe1,0x1d,0xe6,0x46, + 0x75,0xf2,0x54,0xf3,0x2c,0x41,0x5f,0x84,0x4c,0xcf,0x73,0xda,0x1b,0x6d,0x92,0x9b, + 0x53,0x77,0xd6,0x10,0x4a,0x2,0x5,0x78,0xbc,0x8f,0x57,0xbb,0xa3,0x3,0x44,0x68, + 0xf0,0x65,0x66,0x20,0xfa,0xd9,0x3a,0x50,0x8e,0x52,0x9a,0xd,0x78,0x51,0x2f,0x4d, + 0xb9,0x6f,0xb6,0x70,0x3e,0x3c,0x6e,0x97,0x74,0x7a,0x5b,0xb9,0x7a,0x62,0x24,0xa8, + 0xe1,0x70,0x35,0x65,0x35,0x81,0x3c,0x61,0x34,0x34,0xd6,0xb4,0x4e,0x4c,0x54,0xc4, + 0x81,0x5f,0x8d,0xab,0xca,0xd8,0xa2,0xc6,0x5e,0x4b,0xfc,0x4,0x60,0xa9,0xdc,0x96, + 0x18,0x4,0x61,0x20,0xa,0x99,0x34,0xea,0xff,0x7f,0xa8,0xad,0x62,0x34,0x54,0x86, + 0x1e,0xa6,0x3e,0xc0,0x23,0x97,0xcd,0x9e,0x5d,0xed,0x99,0xf0,0xe1,0xc5,0x95,0xdd, + 0x26,0x3,0xe7,0x7f,0xe2,0xc2,0x14,0xa4,0xa2,0x80,0x4,0x59,0x1f,0x62,0xb2,0x68, + 0xe2,0x2f,0x8e,0x18,0x5e,0x0,0x52,0x70,0x28,0xb5,0x5b,0xf9,0xfd,0x68,0xb8,0xae, + 0xdc,0x9d,0xd6,0xf7,0x46,0x6,0x70,0xe,0xed,0x71,0x9d,0x67,0x54,0x7,0x8c,0xb2, + 0xed,0x8f,0x2e,0x2d,0xc3,0x26,0x48,0xd,0x93,0xf6,0x8c,0xa9,0xea,0xd1,0x3c,0xbe, + 0x1f,0x50,0x1e,0x56,0x27,0x7b,0x15,0x9,0x59,0x13,0xd5,0xaf,0x73,0xf8,0x95,0xa4, + 0xe1,0x71,0x93,0xd7,0xac,0x8,0x50,0x82,0xa1,0xa5,0x4c,0x88,0xe0,0x93,0xdb,0x6e, + 0x86,0xf0,0x13,0x80,0xc4,0x72,0xc9,0x61,0x18,0x84,0xa1,0x20,0x94,0x4f,0x68,0xd8, + 0xf4,0xfe,0x7,0x4c,0x97,0x5d,0x34,0x84,0x10,0x20,0xee,0x58,0xdd,0x20,0x21,0x10, + 0x60,0x3f,0x33,0xcf,0xde,0x38,0x62,0x63,0x48,0xf6,0xdf,0x2a,0x20,0xdd,0x7d,0x7, + 0xe0,0xc6,0xcc,0x19,0xd,0xec,0x3c,0xd8,0x9e,0x16,0x90,0x6d,0x82,0x7f,0x78,0xbb, + 0x8c,0xc8,0x92,0x25,0xe1,0xf1,0xb3,0x9b,0x6f,0x2d,0xbd,0x49,0xcc,0x53,0xe2,0x1c, + 0x48,0xac,0x30,0x68,0x7b,0x6d,0x52,0x90,0xd3,0xa9,0xa7,0x2b,0x9,0xf8,0x9,0xc, + 0x38,0x21,0xa7,0x1e,0x54,0x82,0x82,0xce,0xe,0x45,0xe1,0x44,0xd1,0x2e,0x21,0x7b, + 0x75,0x24,0xb2,0xae,0x40,0xe7,0x22,0x7,0x56,0x69,0xe2,0x2e,0x4a,0xe5,0xa,0x29, + 0x5a,0x49,0xd2,0xb2,0x7b,0xae,0x2f,0xdf,0x6b,0xc1,0x13,0xb7,0xf7,0x86,0x5b,0xf3, + 0xda,0x9f,0x0,0x1c,0x96,0xb1,0xe,0xc2,0x30,0xc,0x44,0x51,0xea,0x88,0x22,0x28, + 0x2,0x46,0xfe,0xff,0x6b,0x98,0x99,0x98,0x90,0x48,0x5b,0xc1,0x0,0x3,0xad,0x50, + 0xdc,0x24,0xe5,0xb9,0xb3,0x93,0xe8,0xa4,0xf8,0xde,0x9d,0xc,0x31,0xf1,0xda,0xd2, + 0x2c,0x4c,0xbf,0xf1,0x60,0x59,0xb5,0xb5,0x33,0x90,0x32,0xd8,0x88,0xd4,0x54,0x83, + 0x79,0xd6,0x38,0x66,0xe,0x4f,0x89,0x9f,0xc0,0x73,0x5c,0x39,0x9f,0x76,0x87,0x63, + 0x73,0xf,0xe1,0xfd,0xfb,0x66,0x57,0x27,0x8d,0xb0,0x9c,0x5,0xdb,0x8a,0x47,0x41, + 0x65,0xad,0x84,0x34,0x47,0x7c,0x1,0x29,0xce,0x7b,0xa5,0x2a,0x25,0x62,0x0,0xc0, + 0x53,0x11,0x40,0x3,0x90,0x81,0x7b,0x24,0x70,0x99,0xcc,0x5c,0x2b,0x4b,0x6,0x1a, + 0x0,0x11,0xc8,0x98,0x12,0x81,0x1d,0x4b,0xa5,0x79,0x2f,0x4,0x82,0x39,0x32,0x77, + 0xaf,0xc7,0xed,0x7a,0xf9,0x3c,0xdb,0x3e,0x84,0x41,0xf1,0xbf,0xfb,0xb,0x40,0x62, + 0xd9,0xed,0x20,0x8,0x2,0x60,0x14,0x3,0x9b,0x81,0x33,0x67,0xef,0xff,0x34,0xdd, + 0xd4,0x45,0x5b,0x5b,0xef,0xa1,0xe9,0x54,0x50,0x11,0x3a,0xd8,0x13,0xf0,0x1,0xdf, + 0xcf,0x51,0x93,0xf3,0xc7,0xbb,0x23,0x9f,0xd3,0xf7,0x7f,0x5b,0x71,0xa3,0xc9,0x5a, + 0xec,0x63,0xca,0x2,0xf5,0x8b,0x63,0x6e,0xe7,0x71,0xe8,0x49,0x34,0x1a,0x30,0x0, + 0xa,0x5c,0xd8,0x73,0xbd,0xe8,0xaa,0x1,0x5d,0x84,0xdb,0xea,0x4a,0xd5,0xb7,0x86, + 0xcd,0x6,0x21,0xaf,0xda,0x90,0x76,0xbe,0x42,0xc8,0xd4,0xd7,0x6e,0xa3,0x3a,0x8b, + 0xf3,0xa5,0xec,0x86,0xb9,0xfb,0xf6,0x6b,0xa4,0xdd,0x81,0xe3,0xf5,0x98,0x99,0x53, + 0x4a,0x57,0x94,0x20,0x71,0x2e,0x82,0xe4,0x5e,0xec,0x71,0xc4,0x94,0xca,0x67,0x41, + 0x26,0xae,0x11,0x79,0xb6,0xe2,0x75,0xa3,0xb2,0xf7,0xe3,0xf9,0x79,0xdd,0xfd,0xd4, + 0xda,0xb1,0x5,0x83,0x2,0x79,0x8a,0xf2,0x27,0x0,0xc9,0xe5,0xb2,0x83,0x30,0x8, + 0x44,0x51,0x1e,0x1,0x94,0x6a,0x62,0x75,0x63,0x1a,0xe3,0xff,0x7f,0x8d,0x5f,0x60, + 0xa2,0x6b,0x75,0xd1,0x50,0xda,0xaa,0x3c,0xc6,0x3b,0x95,0x35,0x21,0xe1,0xce,0xcc, + 0xe1,0x80,0x12,0x19,0xb1,0x2c,0xb6,0x6,0x18,0xec,0x1f,0xb3,0x70,0xf,0x6d,0x31, + 0xd9,0x89,0x0,0x69,0x9c,0x8a,0x20,0xac,0xdb,0xee,0x28,0x97,0x15,0x53,0x5a,0x17, + 0x41,0x59,0x72,0x81,0xfa,0x10,0xf,0xed,0xfe,0xdc,0x35,0x50,0x5b,0xf4,0xf8,0x77, + 0x1a,0x61,0x15,0xf9,0x1d,0x70,0x4f,0xd6,0x44,0x3c,0x31,0x42,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10,0x88,0xa2,0x22,0x86,0x85,0x54,0x63,0xff, + 0xff,0x75,0xf6,0x52,0x3d,0x95,0xe6,0x20,0x82,0xd0,0xd9,0xea,0x7,0x98,0x61,0xf7, + 0x5e,0xce,0xa1,0x21,0xeb,0xff,0xc1,0x1b,0xc0,0x2b,0xfa,0xf0,0x43,0x59,0xae,0x9b, + 0x4,0xab,0xa8,0x58,0x12,0xac,0xf8,0x8,0xd4,0xa9,0x1c,0x11,0x62,0xcb,0xd4,0xc, + 0xac,0xd6,0xa7,0xa3,0xdb,0x11,0x3c,0x1f,0xaa,0x30,0xef,0x4b,0x94,0x9a,0x93,0x4, + 0xad,0xb7,0xef,0x27,0xe,0x69,0xd8,0xb8,0xb6,0xac,0x40,0x19,0xf4,0xdb,0x3a,0x9e, + 0xf6,0x5c,0x16,0xb5,0x8e,0x65,0x9a,0x2a,0x71,0xc7,0xcc,0xd9,0x45,0xac,0x38,0x45, + 0x2f,0xca,0x7b,0x68,0x15,0x8a,0x7a,0x7b,0xdc,0x87,0xeb,0xf0,0x1c,0xa1,0xcb,0x6b, + 0xf6,0x73,0xdf,0x27,0x6b,0x2a,0xeb,0xce,0xcc,0x1e,0x71,0xb1,0xdd,0xc5,0x74,0xad, + 0x7e,0xa3,0x62,0x6a,0xd,0xcb,0x47,0x0,0x8a,0xcb,0x6d,0x5,0x61,0x18,0x8,0xa2, + 0x6d,0x36,0x95,0x46,0x85,0xa2,0x2f,0x7d,0xc8,0xff,0x7f,0x53,0x41,0xb0,0xcf,0x42, + 0x55,0x14,0xe9,0x25,0x49,0x97,0x78,0xf2,0x5,0xbb,0x2c,0x3b,0x33,0x67,0xec,0x7b, + 0x7a,0x78,0xef,0x61,0xbd,0x42,0xa1,0x25,0x23,0x8a,0x8e,0x38,0x99,0x15,0xcd,0xb8, + 0x93,0xf2,0xc5,0x4d,0xb4,0xf5,0x2f,0xe8,0xb2,0x69,0x30,0x2,0xe5,0x40,0xa0,0x84, + 0xf1,0x15,0x52,0x23,0x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 0x57,0x4a,0x26,0x15,0x3,0x3a,0xaa,0xbd,0x9,0xd1,0xc9,0xeb,0xd3,0x5a,0x73,0x13, + 0x1,0xef,0xbf,0x2,0x70,0x5c,0xee,0x38,0x8,0xc3,0x40,0x10,0xb5,0x22,0x7f,0x62, + 0x82,0x28,0x88,0x84,0x72,0x4,0x72,0xff,0x33,0x40,0x41,0x4d,0x95,0x1b,0x50,0x20, + 0x10,0x8e,0x94,0x8f,0x63,0x9b,0xb7,0xb9,0xc1,0x68,0x77,0x34,0xf3,0x46,0x3f,0xee, + 0xb7,0x4b,0x7b,0xee,0xfb,0x2b,0xc8,0xba,0x77,0x8d,0x10,0x5,0xcd,0xa6,0xd2,0xa8, + 0xf6,0x20,0x2d,0x4b,0x82,0xa5,0xb1,0x6,0xc6,0xd9,0x74,0x59,0xf3,0xdc,0x78,0x6a, + 0xe5,0xe4,0x75,0x35,0x7d,0xdf,0x91,0x3d,0xbe,0x84,0xf,0x5d,0x5a,0x68,0x9a,0x14, + 0xb3,0x7c,0xb2,0x82,0x25,0xd1,0x9d,0x4,0xc,0x51,0xce,0x92,0x20,0x61,0x85,0xf, + 0x64,0x7b,0x8,0xe1,0xf3,0xc6,0x58,0xb0,0x7f,0xa4,0xd8,0x6c,0x6d,0xac,0xb5,0xe3, + 0x34,0x3d,0x87,0xe1,0x15,0x2,0x22,0xf,0x4d,0x5d,0x3c,0x41,0x48,0xf2,0xba,0x63, + 0xd7,0xae,0x32,0x1d,0x6c,0xf6,0x9a,0x13,0x33,0x23,0xac,0x63,0x55,0xff,0xd4,0x36, + 0x73,0x5c,0xe3,0xcc,0x5f,0x0,0x92,0xcb,0x65,0x7,0x41,0x18,0x88,0xa2,0x95,0xb6, + 0x54,0xa5,0x15,0x74,0x65,0xa2,0xff,0xff,0x3b,0x2e,0x58,0x98,0xb8,0x71,0xe5,0xc2, + 0xc4,0x98,0x0,0x3e,0x80,0x62,0xe3,0x19,0xfd,0x82,0xa6,0x93,0x3b,0x77,0xce,0x31, + 0xf5,0xa1,0x2e,0x7d,0xd8,0xef,0xb6,0x45,0x58,0xf6,0x6f,0x9,0x0,0x6f,0x72,0xa, + 0x71,0x56,0x91,0x1b,0xe6,0xe8,0xe8,0x76,0x48,0x5b,0x82,0x3a,0xc3,0x57,0xfa,0x81, + 0xde,0x96,0x3d,0x6b,0xa6,0xfe,0x85,0xc6,0x4c,0x2c,0x37,0x98,0xb4,0x4e,0x1a,0x23, + 0x19,0xa2,0x0,0x8a,0x95,0xab,0x4,0xff,0xd,0x3f,0x8f,0x85,0xea,0xf9,0x38,0x80, + 0xf5,0x17,0x57,0xa,0x8e,0xc9,0x3e,0x95,0xd4,0x8e,0xe1,0x2c,0xab,0x4f,0xcc,0x62, + 0xba,0x5d,0x2f,0xe7,0xd3,0x91,0xa6,0xb2,0xb9,0x72,0x79,0x32,0xd0,0x92,0x1d,0xcb, + 0x6a,0xee,0x2b,0x33,0x46,0x2,0xa8,0x8b,0xa0,0xda,0xc7,0xdd,0x6f,0x12,0x58,0xa3, + 0xb2,0x55,0xd7,0xe9,0xe4,0x9a,0x45,0xe5,0xbe,0x2,0x90,0x60,0x6,0x29,0xc,0xc2, + 0x40,0x14,0x9d,0x3a,0x41,0xa2,0x45,0xe8,0xc2,0x45,0xdd,0x88,0x7a,0xff,0x9b,0x58, + 0xe8,0x31,0x4a,0x71,0xd3,0x88,0x14,0xb,0x9,0xf6,0x4d,0xdc,0xcd,0x32,0x4c,0xfe, + 0xcc,0x7f,0x7f,0x90,0x86,0x22,0x41,0x5f,0xfb,0x71,0x1a,0x98,0xa3,0x9c,0x1c,0xe, + 0x44,0xfe,0xdd,0x41,0xc7,0xc8,0xf,0x58,0x56,0xc7,0x89,0xd8,0x78,0xc9,0x58,0xdd, + 0xc0,0xdc,0x14,0x26,0xbf,0x5c,0x24,0x46,0x15,0x87,0x39,0xc4,0xf4,0x47,0x59,0x80, + 0x3a,0xf1,0x44,0x40,0x4c,0x16,0xac,0x34,0xb6,0xc9,0x71,0x35,0xdf,0x2b,0xec,0x6e, + 0x20,0xf6,0x76,0x55,0xba,0x47,0x92,0x21,0x34,0xe8,0x25,0x6c,0x61,0x7e,0x3e,0x5e, + 0xcb,0x5b,0x54,0x9a,0x5b,0xc5,0xc2,0xa1,0xe3,0xe2,0x52,0xd7,0xdf,0x5d,0xe9,0xd6, + 0x10,0x44,0x23,0xd2,0x67,0xf0,0x48,0x2b,0xde,0x35,0x9f,0x65,0x63,0x4d,0x5c,0xdb, + 0x12,0x26,0xff,0xb,0xc0,0x81,0xb9,0xac,0x30,0x8,0x3,0x51,0x34,0xf1,0x11,0x5f, + 0x84,0xda,0x95,0x14,0x11,0xfc,0xff,0x2f,0x71,0xd1,0xaf,0x50,0xba,0x29,0xa5,0x5d, + 0x34,0x18,0xaa,0x43,0xed,0x99,0x6e,0x13,0x86,0xcc,0xc0,0xcc,0x9d,0x7b,0x92,0x16, + 0x5,0x3d,0xd,0x63,0x44,0x1a,0xb3,0xbb,0xf4,0xeb,0xca,0x9c,0xf1,0xbc,0x51,0x29, + 0x15,0x65,0x2b,0xfd,0x81,0x1,0xe7,0x38,0xdc,0xd4,0x27,0x7e,0x48,0xee,0x8b,0x71, + 0xa3,0xc9,0xac,0x45,0x9,0x32,0x87,0xda,0x8b,0x3d,0xb0,0xf2,0x38,0x46,0x8d,0x16, + 0x89,0xa8,0xc3,0xf6,0x77,0xbd,0x94,0x4c,0xf9,0x87,0x66,0xad,0x75,0x1a,0xa5,0x15, + 0xa4,0x58,0x8,0xc1,0x78,0x22,0xd3,0x46,0x42,0xc,0xd3,0x75,0x9a,0x6f,0xb,0x2b, + 0xc,0xb6,0x71,0x35,0x2e,0x14,0x1c,0xdc,0x4b,0xef,0x86,0xb1,0xe7,0x36,0xbc,0x5f, + 0xfe,0x54,0xf9,0xb6,0x61,0xc9,0x27,0x8c,0xb6,0xa4,0x8f,0xfb,0x13,0x42,0xad,0xce, + 0x79,0x59,0xe7,0x3f,0x1,0x48,0x2e,0x9b,0x16,0x4,0x42,0x20,0xc,0xeb,0x66,0x28, + 0x59,0x11,0x4,0xdd,0x82,0x2e,0x41,0x9d,0xfa,0xff,0xff,0x64,0xb,0xa,0x3a,0x6, + 0x19,0x4b,0x6d,0xae,0xa9,0x63,0xbd,0x63,0xf7,0x39,0x38,0x23,0xef,0xc7,0x83,0x8a, + 0x50,0xba,0xee,0x71,0x6c,0xdb,0x77,0x18,0x90,0x8d,0xbb,0xfd,0xc1,0xf5,0xaf,0x46, + 0x19,0x38,0x33,0xfc,0x81,0x81,0x2c,0xd7,0x57,0x20,0x95,0xe8,0x1b,0x1b,0xf2,0x22, + 0xb1,0x86,0xb1,0x46,0x8c,0xb2,0xd2,0x6,0xb6,0xc3,0x14,0x49,0x4a,0x21,0x94,0xf, + 0xf2,0x4d,0x22,0x37,0x4,0xf7,0x35,0xbe,0x37,0x31,0x88,0xe5,0x3f,0x1,0xf2,0xf9, + 0x99,0x8,0xc7,0xd5,0x88,0x31,0x9,0xbb,0xf7,0xe7,0xcb,0xc9,0xb9,0x5b,0xa5,0x23, + 0x65,0xe6,0xda,0x2e,0x74,0x12,0xfd,0x90,0xfd,0x66,0xbd,0xc5,0x57,0x3c,0xaf,0xf7, + 0xc9,0x8c,0x96,0x2b,0xb4,0x13,0x28,0x4b,0x43,0x17,0x1e,0x29,0x68,0x68,0x6a,0xd5, + 0xc8,0xc2,0xa0,0xcb,0x4f,0x0,0x12,0xac,0x66,0x85,0x41,0x18,0x6,0xb7,0x56,0x26, + 0x16,0x85,0x21,0x38,0xef,0xbb,0x8,0x7b,0x9a,0x5d,0xf6,0x86,0xc3,0x7,0xdb,0xcd, + 0x41,0xf,0xa,0x59,0x5c,0x69,0xe3,0xbe,0xcc,0x5b,0xc8,0x29,0x10,0xbe,0x5f,0xb8, + 0x43,0xe1,0x8d,0x43,0xd8,0x63,0x4e,0xd3,0x73,0xba,0x3f,0xec,0x75,0xbc,0xad,0x4, + 0x52,0x29,0x92,0xb6,0x41,0x80,0xa4,0x1a,0x63,0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3,0x32,0x9b,0x37,0xda,0x69,0x6b,0xdc,0x74,0x7f,0x5c,0xf, + 0x45,0xfa,0xf9,0x36,0xc7,0x3c,0xf3,0x7b,0x30,0x66,0x7,0xfc,0xea,0xb8,0xe8,0xea, + 0x91,0x7,0x9f,0x26,0x70,0xa,0xbc,0xfb,0x7b,0x77,0x7f,0x1,0x48,0x30,0x97,0x1c, + 0x84,0x61,0x18,0xa,0x26,0x21,0x5,0x52,0x24,0x76,0x2c,0x10,0x74,0x3,0x7,0xe2, + 0xd0,0x15,0xb7,0x80,0x23,0x54,0x6a,0x12,0xf2,0xc1,0x69,0x9,0xcf,0xed,0xde,0xb, + 0xcb,0x1a,0x3f,0x8d,0xad,0xeb,0x2a,0xe,0x44,0x71,0xf6,0x62,0x57,0xdc,0xfb,0xf5, + 0xec,0xfb,0xc7,0xe5,0x9a,0xb5,0x8,0x89,0x3c,0x65,0x24,0x4e,0x2e,0xc4,0x9f,0x9, + 0x34,0xd,0x73,0xa8,0x8c,0x4,0x20,0x62,0xeb,0x55,0xd,0x98,0xc4,0x94,0x59,0xaf, + 0xa5,0x6,0x5a,0x1b,0x88,0xef,0x54,0x4b,0x5c,0x76,0x4,0x72,0x23,0xb7,0xb2,0x11, + 0xac,0xf8,0xcb,0x71,0xb7,0xc6,0xb4,0xf8,0xc2,0x17,0xe6,0x18,0xc8,0xd9,0xa1,0x90, + 0xdf,0x9b,0xa,0x78,0x70,0x27,0xfb,0x34,0x4c,0x2a,0x9,0x55,0x6e,0xf7,0xee,0xdc, + 0x9d,0x5c,0x18,0x51,0x6e,0xda,0x3,0x9b,0xa8,0xe2,0xbf,0x10,0xf6,0xcb,0x8e,0xf6, + 0x68,0x5a,0xc4,0x2e,0xb4,0xe5,0xf7,0xd1,0x22,0xaa,0xbf,0x0,0x1c,0x97,0xcb,0xe, + 0x82,0x30,0x14,0x5,0x85,0xd2,0x56,0x1e,0x31,0xea,0xd2,0x85,0xc2,0x4e,0xff,0xff, + 0x73,0x5c,0x1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0xec, + 0x11,0x87,0xb,0x57,0xef,0x43,0x49,0x26,0x2e,0x17,0x18,0x9f,0x4e,0x94,0x24,0xe7, + 0xb4,0x80,0x14,0x15,0xc1,0xaf,0x88,0xa4,0x48,0x1a,0x44,0x8,0x56,0x8,0x52,0x57, + 0xaf,0xc4,0xb1,0x2a,0xe,0xa7,0xcc,0xa4,0xe3,0xb6,0x4c,0xd2,0xc2,0x8a,0xb5,0x95, + 0x76,0xde,0x97,0xd9,0xf9,0x52,0x2d,0x2d,0xa0,0x35,0x77,0xcf,0x76,0x72,0x93,0x8e, + 0xcd,0x26,0xdd,0x71,0x39,0x75,0xf3,0x60,0x87,0x79,0x96,0x2b,0xde,0x4c,0x43,0xd4, + 0x77,0xfe,0x53,0x3b,0xdf,0xfb,0x9f,0x0,0x24,0x98,0xb1,0xe,0xc2,0x30,0xc,0x44, + 0x93,0x26,0xc4,0xb4,0x36,0xad,0x60,0x42,0xea,0x44,0x59,0xf8,0xff,0x5f,0x42,0x59, + 0xa8,0x80,0xad,0x90,0xb6,0x10,0xce,0x61,0xf7,0x62,0x2b,0xb9,0x7b,0x77,0x8e,0xb8, + 0x29,0xd0,0xb5,0xa8,0x6e,0x64,0x30,0xb6,0x72,0xda,0x6d,0x1c,0x67,0xe3,0x4f,0xc3, + 0x80,0x2c,0x33,0x6b,0xd9,0x67,0xa0,0x34,0x5a,0x5a,0xe6,0xe5,0x63,0x35,0xfa,0x63, + 0x66,0x2d,0x8c,0xaa,0x50,0xe7,0xb1,0x7b,0x32,0x79,0xaa,0x10,0x3,0xc9,0x19,0xf, + 0x4f,0x48,0x0,0x1,0xeb,0x4b,0xd3,0x7,0x1c,0x77,0x2a,0x3c,0x78,0x4b,0xff,0x4d, + 0x40,0xcf,0xd4,0xd2,0xb1,0x67,0xe9,0x56,0xe2,0xc4,0x87,0x8d,0x6d,0x9c,0x15,0x6a, + 0x77,0xe1,0x72,0xee,0xbb,0xbd,0xc0,0x6b,0x63,0xbc,0xe2,0x5a,0x14,0x6a,0xae,0xc5, + 0x7e,0xb7,0xf,0x24,0x89,0xf4,0x12,0xe1,0x50,0x5,0xfc,0x3c,0x48,0xe1,0x3d,0x3e, + 0xf3,0x5b,0x9d,0xf1,0x27,0x0,0x47,0x66,0x97,0x83,0x20,0x10,0x3,0x61,0x74,0x97, + 0xfd,0x3,0x59,0xe2,0xbe,0x70,0x2,0x13,0xe3,0xfd,0xf,0x64,0xc4,0x7,0x1f,0xc4, + 0x65,0xb,0xa8,0x90,0x88,0x53,0x4e,0xd0,0x26,0xfd,0xd2,0xce,0x4c,0x5,0x98,0x1, + 0x8,0x68,0x81,0x97,0xcb,0x96,0x3,0x6d,0x69,0xcc,0x7a,0xbb,0x3e,0x94,0x31,0xa7, + 0xcb,0x19,0xe,0x70,0xe4,0x44,0x0,0x77,0x36,0x63,0xa5,0xc7,0x8f,0x1,0xf6,0x6e, + 0xda,0x40,0xae,0x3b,0x1c,0x7c,0x1a,0xa8,0x7b,0xb6,0xb1,0xbf,0xd3,0xd0,0xd3,0x18, + 0x85,0xcc,0xca,0xda,0x15,0x95,0x83,0x9d,0xd5,0x1a,0x3d,0xc8,0xdc,0x4a,0x65,0x78, + 0x2c,0xca,0x49,0x53,0x28,0x8,0xb1,0x63,0x13,0x76,0x92,0x68,0x6a,0x95,0xfd,0x2c, + 0xe0,0xde,0xec,0x6d,0xf0,0x4d,0xf0,0x1,0xa3,0x53,0x22,0xa5,0x9e,0x28,0x95,0x45, + 0x95,0x4b,0x2e,0x12,0xe3,0xb7,0x7b,0x1,0x36,0xe7,0xab,0x3,0x8c,0xf8,0x9c,0x96, + 0x19,0x32,0x68,0xca,0xde,0x20,0x6e,0xfd,0xfd,0x5,0xe0,0xc0,0x5c,0x72,0x10,0x84, + 0xa1,0x28,0xda,0x96,0xb6,0x50,0x3e,0x11,0x13,0x89,0xe,0x1c,0xa9,0xcb,0x77,0xe2, + 0x4a,0x5c,0x82,0x3,0x63,0x30,0xc1,0x10,0x29,0x9f,0x42,0x3f,0xd4,0x57,0xb7,0xf0, + 0x92,0x7b,0xef,0x39,0xf,0xe0,0x46,0xdb,0x95,0x62,0xc6,0xb5,0xfb,0x3f,0x75,0x43, + 0x7b,0x43,0x77,0x98,0xdc,0xb5,0xf7,0xdb,0xb5,0x12,0x6e,0x77,0xde,0xdb,0xfe,0x65, + 0x57,0xb9,0xd8,0xa1,0x3a,0x1d,0x67,0x86,0xa6,0xb1,0x85,0xe3,0x23,0x5c,0x2,0xa2, + 0x0,0xbc,0x29,0xff,0xf0,0x45,0x87,0x43,0x98,0x89,0xb7,0xd1,0x57,0x71,0xf9,0xa4, + 0x19,0x2c,0xf,0x8,0x10,0xba,0x50,0x5e,0x88,0xa4,0xa4,0x51,0xb0,0x76,0x63,0x7a, + 0xa8,0xc1,0x34,0xa9,0x99,0x7f,0x77,0xa3,0x8c,0xd0,0x0,0xe0,0x9a,0x91,0x35,0x15, + 0x10,0xc,0x47,0x2,0xb9,0x40,0x3c,0xf4,0xbc,0x98,0x72,0x7b,0x20,0x3c,0x96,0x12, + 0x7c,0x51,0x75,0xf6,0xc3,0x72,0xbf,0x11,0x39,0x9b,0xe2,0xa9,0xd1,0xba,0xb1,0x5e, + 0x11,0x6a,0x70,0xc,0x7e,0x4e,0xf1,0x4f,0x0,0x9a,0xac,0x1c,0x9,0x61,0x18,0x6, + 0x46,0xd8,0x92,0xc2,0x55,0xd1,0xf0,0x1e,0xa,0xda,0xfc,0xff,0x5,0x69,0x68,0x32, + 0xc6,0x39,0xb0,0x93,0xb0,0xcb,0xc,0x1f,0xb0,0xc7,0xd6,0x1e,0x5a,0x49,0xb8,0xcb, + 0x10,0xf9,0x4d,0xe6,0xb6,0xfd,0xff,0x4,0x6,0xf0,0x60,0xdc,0x67,0xdc,0x2e,0x8f, + 0xee,0x79,0xbc,0xb7,0x43,0x45,0x8b,0x3b,0xcd,0x51,0xde,0xb4,0xb1,0xcc,0x39,0xfb, + 0x66,0x60,0xbe,0xb6,0x80,0x44,0x6e,0x74,0x21,0xbe,0xe0,0x15,0x8,0x72,0xe2,0x42, + 0xde,0xf0,0x5c,0x74,0xcb,0x1a,0xdc,0xf4,0x6a,0xe0,0x4,0xee,0x88,0x6b,0x88,0x1f, + 0x3d,0x14,0x12,0xc4,0x18,0x25,0xe0,0x79,0xe,0x2b,0x62,0xe5,0xcb,0xc9,0xcf,0x4d, + 0x85,0xf4,0x41,0x88,0x2,0xaa,0x86,0xff,0xcc,0xe3,0x92,0x12,0xba,0x86,0x2,0x63, + 0xf1,0xdd,0xa7,0xd7,0x3c,0xf4,0x29,0x54,0x30,0x4f,0xcb,0x48,0x24,0x43,0x9a,0xbe, + 0x2,0xd0,0x64,0xee,0x4a,0x8,0x83,0x40,0x14,0xd,0xbb,0x44,0x89,0x96,0x56,0x36, + 0xfe,0xff,0xa7,0x39,0x56,0x4e,0x2,0xe1,0x11,0xcc,0x78,0xd6,0x8c,0x54,0x94,0x50, + 0x70,0xcf,0xb9,0x8b,0x1e,0xdf,0x4a,0xc7,0xc4,0x74,0xf8,0x2f,0xf6,0xa6,0x34,0x68, + 0x57,0x8d,0x5b,0x5f,0xef,0x8f,0x5b,0x13,0xec,0xbb,0x54,0x3,0x16,0x78,0xb0,0x3a, + 0x3a,0x2a,0x67,0x18,0x7f,0xed,0xbc,0xc0,0x59,0xc,0xda,0x46,0xa2,0x0,0x8a,0xcc, + 0x17,0x31,0x6e,0xa,0xb9,0xff,0x24,0x3f,0xc4,0x45,0xe7,0x16,0xa7,0x73,0xb8,0x26, + 0x3d,0x99,0x5,0xc8,0x30,0xf1,0xec,0x50,0x3b,0x4f,0x69,0x20,0x78,0x3f,0x9b,0x8a, + 0x43,0x59,0x72,0xe9,0xe7,0xcb,0x84,0x26,0x2d,0x29,0xa6,0x5c,0xb8,0x87,0x11,0xaf, + 0xab,0xec,0xbe,0xad,0xed,0xfd,0x9a,0xa9,0x70,0xc1,0x87,0xbd,0x19,0x3b,0x39,0x65, + 0xad,0xf9,0x2b,0x0,0x4d,0x66,0xa0,0xc3,0x20,0x8,0x3,0xd1,0x49,0x69,0xd0,0x6c, + 0x31,0xfb,0x82,0xfd,0xff,0xa7,0x2d,0x4b,0x16,0xe3,0x36,0x1,0x95,0xd2,0x5d,0x25, + 0x7e,0x2,0xa5,0xdc,0xbd,0x3b,0xa0,0x7e,0x4d,0x7e,0xb4,0xfd,0x32,0x9d,0x7,0x80, + 0xeb,0x59,0xc1,0x48,0x17,0x7d,0x3d,0xdf,0xbe,0xcf,0xf7,0xc7,0xf8,0xab,0x1f,0x44, + 0x1a,0x31,0x36,0xcd,0x2,0x40,0xaf,0x2e,0x30,0x94,0x48,0x99,0x90,0x85,0x8d,0xd9, + 0x48,0x60,0x66,0x1d,0x43,0xb2,0x10,0x68,0xb6,0x15,0x3e,0xcc,0xbe,0x18,0x6f,0x56, + 0xb6,0xba,0xf5,0x70,0xe,0x69,0x5,0xa3,0x99,0x2,0x46,0x58,0x62,0x5a,0xf0,0xb2, + 0x80,0x9,0x29,0x45,0x90,0xdf,0x70,0xbd,0x69,0x47,0x33,0xa6,0x5e,0xc4,0xf9,0x50, + 0x6c,0xa9,0xc8,0xed,0x61,0x5b,0xf6,0xef,0x14,0xe3,0x9c,0xbd,0x12,0x14,0x17,0x3e, + 0x78,0x5c,0x1a,0x41,0xe1,0xff,0x2,0x70,0x65,0xe6,0x3a,0xc,0x83,0x40,0x10,0x5, + 0x9f,0x28,0x8a,0xb0,0x94,0x22,0x45,0xfa,0xfc,0xff,0x8f,0xa5,0x71,0xe,0x4c,0x14, + 0xf0,0xfa,0x4d,0xdc,0xb9,0x43,0x54,0xab,0x65,0xd8,0x9d,0xa3,0xdd,0xe3,0x9a,0xc3, + 0xb,0xe8,0x23,0x78,0x53,0xf8,0xc4,0xe,0x31,0x47,0x3f,0x6e,0xf7,0x6b,0x19,0x44, + 0x37,0x28,0xc1,0xfb,0x2c,0xa3,0x16,0xae,0x40,0x9d,0xe9,0xb5,0xe6,0x37,0x7,0xcf, + 0xd8,0x37,0x61,0x92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0x12,0x51,0x31,0x61,0x9a, + 0x96,0xf0,0xa,0x72,0xdd,0xad,0xb4,0x20,0xe2,0x14,0xea,0x4d,0x0,0x7e,0xee,0xe7, + 0xb1,0x6e,0xb1,0x27,0xbe,0x43,0x9,0x90,0x4e,0x83,0x56,0xbb,0xc7,0x1c,0xd8,0x7b, + 0x5,0xa7,0x47,0x0,0xae,0xac,0x2d,0x7,0x40,0x10,0x86,0x61,0x96,0x69,0xbc,0x1, + 0xf1,0xfe,0xe7,0xd3,0x28,0xf1,0x39,0x19,0xb6,0xf8,0x61,0xe2,0x3f,0x1f,0xb0,0x75, + 0x74,0x6d,0xbf,0x21,0xfe,0xbf,0x0,0x7f,0xa,0x19,0xe1,0xad,0x5c,0x41,0x87,0x8f, + 0x79,0xcf,0x76,0xc7,0x21,0xa,0x9d,0xe8,0xcb,0x99,0x42,0x30,0x64,0xe,0x14,0xe6, + 0x5e,0xe3,0x10,0xd7,0x5a,0xe,0x82,0x86,0xce,0x0,0xa8,0xa1,0x2b,0xb9,0x35,0x93, + 0xf3,0x2,0xd6,0xc4,0xb1,0x2d,0x66,0x15,0x6c,0x9b,0x66,0x55,0x52,0xd0,0x5f,0x4, + 0xac,0x71,0xba,0x4a,0xbb,0x2,0xae,0x53,0xdc,0xff,0x76,0xcc,0xde,0x3a,0xa5,0x34, + 0x2e,0xe4,0x40,0xed,0x85,0xb6,0x21,0x24,0x3c,0x9a,0x4d,0x47,0xa1,0xa1,0x4e,0xc, + 0xc7,0xb9,0x1,0x9f,0x8f,0x0,0x5c,0x99,0x5b,0xe,0x40,0x40,0xc,0x45,0x87,0xf2, + 0x41,0xbc,0x63,0xff,0x3b,0x14,0x19,0x11,0x31,0xc1,0x70,0x2e,0x7f,0x36,0x30,0xe9, + 0xed,0xa4,0xb7,0xa7,0xad,0xe5,0x64,0x49,0x9b,0x38,0xf7,0x2b,0x62,0x8d,0x8a,0x89, + 0x96,0x2c,0xb8,0xc8,0x6b,0xab,0x27,0xa0,0xec,0x97,0xb5,0x1e,0xea,0x7e,0x6c,0x20, + 0x5,0xac,0x94,0x4e,0xa9,0x38,0xce,0x20,0x64,0x88,0xef,0x4,0x20,0xae,0x22,0x51, + 0x2a,0x7,0x7a,0x3c,0x96,0x8b,0xf6,0xef,0x84,0xa5,0x5d,0x97,0x51,0x3d,0x56,0x16, + 0x90,0x83,0xcb,0x35,0x53,0x22,0x4f,0x80,0x4f,0x58,0x80,0x83,0xf1,0x69,0xd1,0x85, + 0x6d,0xb7,0x98,0xe2,0x76,0x7e,0x9a,0x2d,0xc9,0xba,0xaa,0xe5,0x45,0x4,0xa3,0x41, + 0xda,0x48,0xa,0x4e,0x12,0x74,0x78,0xba,0xee,0x83,0xe0,0x1f,0x1,0xb8,0x30,0x97, + 0x24,0x0,0x41,0x18,0x86,0x56,0x47,0xf9,0xe8,0xfd,0xaf,0xe9,0x67,0x46,0x7,0x50, + 0x4,0x5f,0x71,0xe7,0x8e,0x65,0xd2,0x36,0x9,0xad,0x76,0xe0,0x53,0xf0,0x8f,0x40, + 0xd7,0x37,0x2,0x4a,0xa3,0x28,0xd1,0x47,0x7c,0xa5,0xa,0xb2,0x9e,0x7b,0x96,0x28, + 0x46,0x8,0x2b,0xe4,0x77,0x5d,0x64,0x43,0x4,0x2e,0xd3,0xb,0x8d,0x5b,0xd7,0xae, + 0xaa,0x32,0x68,0xe6,0xc6,0x14,0xa1,0x4c,0xac,0xc0,0xb4,0x3f,0x12,0x7b,0x1a,0x49, + 0x31,0x59,0xdb,0xca,0x42,0x1a,0x60,0x20,0xf8,0x30,0x9d,0xd3,0x4b,0xd9,0x80,0x71, + 0x3c,0x5,0x94,0x39,0xe4,0x7d,0xd9,0x78,0xcc,0xce,0x87,0x23,0x26,0x75,0xe4,0xe2, + 0xac,0x7,0xb,0x69,0x10,0x43,0x82,0xb0,0x9e,0x72,0x7b,0xf4,0x36,0xbe,0x2,0x90, + 0x69,0x2d,0x4b,0x0,0x82,0x20,0x50,0x49,0x7b,0x58,0x87,0xfe,0xff,0x23,0x3b,0x55, + 0x34,0x29,0xda,0x6e,0xd3,0xad,0x23,0x1e,0x64,0x18,0x58,0x58,0x5c,0xbf,0xc,0xfc, + 0x4b,0x48,0x2a,0xb5,0x44,0xcc,0x4a,0xe1,0xed,0xb0,0x1d,0xc0,0xc5,0x50,0x70,0x92, + 0xe3,0xbd,0xd5,0xb6,0xfb,0xe4,0x26,0x70,0x36,0xb1,0xc9,0x80,0xe9,0x11,0x3d,0xb, + 0x29,0x41,0x11,0x84,0x57,0xd7,0x34,0x8e,0x65,0xac,0x60,0xd9,0x3a,0x0,0xb7,0xc9, + 0xec,0x87,0xa5,0xc5,0x55,0x52,0xe4,0x5e,0x7c,0xf1,0xf,0x2,0x8,0x95,0xa7,0x72, + 0xc1,0x49,0x21,0xb2,0x0,0x1c,0x56,0xf4,0x54,0xdd,0x15,0x71,0x7b,0xd7,0x9f,0x5a, + 0xf4,0x28,0x21,0x47,0xf4,0x7e,0x38,0xba,0x69,0x66,0xbe,0x54,0x3a,0x2a,0xa5,0x81, + 0x44,0xbe,0x7b,0x4,0xa0,0xd3,0xc,0x72,0x0,0x4,0x61,0x20,0x48,0x41,0x25,0xf1, + 0xa0,0xc6,0xff,0xbf,0xd2,0x44,0xa3,0x88,0xc4,0x9d,0x7a,0x96,0x17,0x50,0x92,0xdd, + 0xb6,0x3b,0x74,0xe1,0xe7,0x60,0x4a,0xe1,0x63,0x6,0xc6,0x42,0x1c,0x51,0xa7,0xca, + 0xd0,0x78,0xa6,0x97,0x3b,0x8f,0x52,0x43,0xd3,0xd8,0xa2,0xf5,0x6b,0x5a,0xe6,0xbc, + 0xa6,0x6c,0x32,0xc5,0x1,0xa,0x43,0xb8,0xed,0x1,0x2b,0x66,0xb,0x2e,0x80,0x1, + 0xd4,0x96,0x46,0xff,0x54,0x22,0xa9,0x40,0x54,0x33,0x29,0x85,0xa7,0x36,0x91,0x4, + 0x18,0xc9,0xe8,0x4e,0x97,0xf6,0xf2,0x5b,0x2a,0x97,0x64,0xfb,0x7d,0x53,0x67,0x2e, + 0x34,0x5d,0xc,0xf8,0xa1,0x5f,0x57,0x47,0x36,0x66,0x2a,0x32,0x91,0x53,0x1,0x22, + 0x5f,0x1,0xe8,0x34,0x83,0x1d,0x0,0x41,0x18,0x86,0x2a,0xa2,0x98,0x18,0xfd,0xff, + 0x3f,0xf4,0xc0,0xd1,0x98,0x48,0x2,0x68,0x5f,0xef,0xde,0x77,0x28,0x6c,0xb0,0xad, + 0xed,0x6f,0x6,0xc6,0xc1,0xda,0xbe,0xd7,0x1d,0x5c,0x8,0x11,0x6f,0x3,0x14,0xd0, + 0x3a,0x2f,0x29,0x29,0x60,0x3f,0xb6,0xf2,0x94,0x7c,0x66,0xe5,0x54,0x53,0x80,0xba, + 0xe3,0xd4,0xfd,0x43,0x23,0xf1,0xeb,0xa4,0x48,0x82,0x34,0x43,0x3,0x7d,0x3d,0xb7, + 0xb0,0xdc,0xbb,0xd8,0xac,0xb3,0x57,0x24,0x48,0xe8,0x80,0x5e,0xed,0xb5,0x10,0xc2, + 0xa6,0xdb,0x55,0xaf,0x1d,0xa2,0xea,0xf1,0xbe,0x60,0xee,0xb0,0x1a,0x10,0x40,0xf5, + 0x9,0x54,0x83,0x25,0xd1,0x23,0x80,0x6b,0x43,0x53,0xe,0xe1,0x13,0x80,0x2e,0xb3, + 0x59,0x1,0x10,0x4,0x82,0x70,0x69,0xda,0x16,0x8,0x51,0xd0,0xfb,0xbf,0x5e,0xd0, + 0x31,0xf2,0x2f,0xab,0x19,0x3b,0x77,0xf3,0xa0,0xb,0xeb,0x2c,0xeb,0xce,0xe7,0xaf, + 0x2,0xc4,0x11,0xec,0xcc,0x2d,0x2d,0x3a,0xea,0xd1,0x42,0x60,0x38,0x18,0x2e,0xee, + 0x6f,0x6e,0x4d,0x98,0x45,0xed,0x2c,0x4b,0xf6,0xc5,0x6f,0xa1,0x1c,0x29,0xef,0x79, + 0x5a,0xdd,0xe8,0x4,0xc5,0xa1,0xd,0x92,0xc6,0x79,0x42,0x8a,0xa6,0xca,0xa8,0x2a, + 0x0,0xe8,0xcc,0x93,0x31,0x6d,0x26,0x8f,0x10,0x5a,0x45,0xba,0x9,0x22,0xf1,0xa, + 0x8e,0x68,0x16,0x50,0x59,0x2a,0x9c,0x44,0xf4,0x5,0x56,0x8a,0x60,0x92,0xdf,0x9b, + 0x48,0x15,0xfb,0x70,0xa7,0xe1,0x8a,0x78,0x29,0x44,0x86,0xde,0x40,0x1,0x76,0x8b, + 0x57,0x0,0x3e,0xcd,0x24,0x7,0x40,0x18,0x86,0x81,0x80,0x4a,0x29,0xa8,0x12,0xff, + 0x7f,0x27,0x62,0xe9,0x2,0x65,0x1c,0xee,0x5c,0xa3,0xf6,0x10,0x25,0xb1,0x63,0x39, + 0x3f,0x9,0x18,0xc1,0xd1,0x33,0xb3,0xc,0x2f,0x67,0xa7,0x2d,0x30,0xa6,0x9b,0x34, + 0xf4,0x84,0xba,0x3a,0x5c,0x5b,0x2,0x52,0x7c,0x33,0xb5,0xbb,0x97,0xf3,0x28,0x2d, + 0x6d,0x79,0xad,0x3e,0xba,0x25,0x4e,0x4a,0x55,0x57,0x7,0x66,0xf7,0x7f,0xd0,0xa, + 0x8b,0x36,0x9e,0xc9,0x18,0xd0,0x61,0x40,0xcf,0xa,0x7d,0x33,0x22,0x66,0xf,0xb1, + 0xb6,0x49,0xf2,0xa8,0x56,0x19,0x8d,0xfe,0xc0,0x3e,0x83,0xf4,0x47,0xa5,0x20,0xf4, + 0x1d,0x71,0x60,0x5f,0xd3,0x1c,0xc2,0xa8,0xfe,0xd1,0x16,0xca,0xa7,0x57,0x0,0x2a, + 0xcd,0x25,0x7,0x40,0x10,0x6,0xa2,0x16,0xa3,0xe0,0xfd,0x6f,0xaa,0x31,0x86,0x84, + 0x10,0xdf,0x6b,0xe2,0xc2,0x3d,0x2c,0xe8,0x67,0xda,0x99,0xc1,0x12,0xfa,0x3c,0x8d, + 0x1f,0x92,0x66,0xcd,0x47,0x3d,0x2a,0xb4,0x90,0xd8,0x83,0x79,0x3c,0x23,0xf4,0x53, + 0x3c,0xd9,0xb6,0x46,0x91,0xf4,0xa7,0xf,0xc6,0x19,0x4b,0x27,0x2d,0xa0,0xd7,0xe2, + 0x28,0xbd,0xce,0x9b,0x2e,0x54,0x8d,0x67,0x73,0x2d,0xa9,0x3b,0x46,0x65,0x57,0x75, + 0xbb,0x1a,0xaa,0xce,0x39,0xbf,0xb8,0xb2,0xaf,0x9a,0x70,0x89,0xbd,0x14,0xa9,0x1e, + 0x82,0xf4,0x5d,0x60,0x4d,0x4a,0x35,0x15,0x3c,0xfc,0x25,0x50,0xe0,0xd6,0x90,0xa3, + 0x14,0x86,0x49,0x2,0xb1,0x13,0x17,0x49,0xb0,0x2d,0xb0,0xbc,0x2,0x90,0x69,0x2e, + 0x39,0x0,0x83,0x20,0x14,0xec,0xc2,0xfb,0x9f,0xb5,0x8d,0x11,0xa3,0xb1,0x9f,0x19, + 0xba,0x74,0x67,0x88,0x89,0x28,0xf,0x78,0x8,0x86,0xd1,0x9d,0x47,0xfc,0x84,0x14, + 0x6b,0x82,0xb4,0xcc,0x2d,0x3a,0x80,0x99,0x2a,0x85,0xa0,0xa,0x16,0x14,0x11,0xdc, + 0x81,0x9a,0x42,0x66,0xad,0xd8,0xee,0xb2,0xfc,0xef,0x3d,0xe6,0x58,0xad,0xc6,0x75, + 0xd6,0x16,0xfd,0x59,0xbc,0x3a,0x1b,0x38,0x8e,0x28,0xae,0x7e,0xf9,0x25,0x5a,0x74, + 0xf,0xf5,0xf3,0xd7,0x4c,0x2,0x24,0x5d,0xb5,0x28,0x14,0xf4,0x58,0x60,0x40,0xb7, + 0x6f,0xe7,0x45,0x32,0x75,0xd8,0xe5,0xc6,0x68,0x8e,0x41,0x14,0x3b,0x7a,0xd9,0x81, + 0x7,0x90,0x2c,0x3f,0x1,0xb8,0x34,0x83,0x1d,0x0,0x41,0x18,0x86,0xa,0x12,0x9, + 0x44,0xff,0xff,0x27,0xbd,0xa8,0x21,0x41,0x34,0x6a,0x1f,0xbb,0x79,0xe1,0x46,0x42, + 0x46,0xd6,0x76,0x5d,0x83,0xbd,0xdb,0xce,0x5f,0x2b,0xab,0x40,0x34,0xa1,0x7f,0x25, + 0xb9,0x74,0x49,0x13,0x3d,0x6b,0xa8,0xa7,0x93,0x37,0xae,0x5a,0xd3,0xf8,0xe,0x3a, + 0x5,0x4b,0x88,0xc0,0x24,0xb8,0x8d,0xaa,0x7a,0x98,0xf0,0xa3,0x5b,0x3d,0xd6,0x5a, + 0xb7,0x7b,0xcf,0x25,0x65,0x29,0xe5,0x14,0x31,0x2f,0xdc,0xbc,0x64,0x1a,0xec,0xc4, + 0xe7,0xd2,0x20,0x81,0xff,0xce,0xf7,0x41,0x4,0x42,0x24,0x61,0x8d,0x23,0x34,0x26, + 0x3d,0x3b,0x46,0xe1,0xaa,0x48,0xf9,0x22,0x2b,0x40,0x69,0x24,0xf7,0x3c,0xab,0xc0, + 0xce,0x9a,0x96,0x28,0x18,0x3e,0x1,0xb8,0x34,0x7b,0x15,0x0,0x61,0x18,0x8,0x97, + 0x40,0x91,0xd0,0xc1,0xcd,0xf7,0x7f,0x40,0x5d,0xc4,0xa,0x52,0x6c,0xbd,0x2f,0xe, + 0x82,0xdd,0x3,0xf9,0xbd,0x1c,0xbd,0x7c,0x1,0xfc,0xbc,0xb7,0x60,0x35,0xef,0x9d, + 0x94,0xc,0xc,0x52,0x44,0xb9,0xe5,0xb7,0xcf,0x5e,0xcf,0xaa,0x78,0x5a,0x6f,0x7c, + 0x8,0xf1,0x22,0x54,0xb2,0x1f,0xe3,0x8f,0x12,0x95,0x9d,0xee,0x14,0xe4,0xdc,0x75, + 0xbb,0xf6,0xf5,0x10,0xef,0x2c,0x45,0x20,0x9c,0xfb,0x32,0xa6,0x92,0xc1,0xd4,0xc4, + 0x1,0x41,0xdc,0x43,0xa8,0xb2,0xea,0x7b,0x14,0x20,0x99,0xab,0x9e,0x1a,0x20,0xc6, + 0x6c,0x20,0x9b,0xb1,0xe6,0x42,0x97,0x4d,0x88,0x3d,0x4a,0x2a,0x44,0xc2,0x2,0x1b, + 0xe4,0xf3,0x23,0x0,0x9b,0x66,0x97,0x3,0x20,0x8,0xc3,0xe0,0x10,0x74,0xe0,0xdf, + 0xfd,0x2f,0xba,0x17,0x25,0xa8,0xfb,0x4a,0xe2,0x93,0x17,0x20,0x81,0x35,0x6d,0x69, + 0x37,0x82,0xad,0x1f,0x2f,0xf4,0x11,0x3f,0x98,0x81,0xd8,0xd9,0x23,0x89,0x83,0x96, + 0xca,0xbe,0x87,0xbb,0x4f,0xf8,0xff,0xb8,0x19,0x41,0xe3,0xa5,0xd0,0x56,0x6a,0x9e, + 0x19,0xba,0x7a,0xec,0x84,0x9a,0x9b,0x5c,0x83,0x75,0xcc,0x60,0xd0,0xd5,0xd9,0x32, + 0xa1,0x6f,0xd9,0xed,0xd8,0xd6,0x5a,0x66,0x1,0xef,0xe,0x82,0x81,0x11,0x1f,0xf2, + 0x31,0x1a,0x1d,0x46,0x2f,0x1d,0x11,0x8f,0x77,0xfd,0x5e,0xd2,0x40,0x8e,0xba,0x3c, + 0xde,0x8a,0x89,0x21,0xf6,0xaf,0x0,0x54,0x9a,0x51,0xe,0x80,0x30,0x8,0x43,0x75, + 0x73,0x5f,0x9c,0xc1,0xec,0xfe,0xb7,0x9b,0x5f,0x26,0xba,0x38,0xfb,0x3a,0x7f,0x3c, + 0x1,0x10,0xa0,0xd0,0xc2,0xb7,0x4a,0xcc,0xd,0xf5,0xd7,0xc4,0xfe,0xd5,0x92,0x97, + 0x11,0x1,0x9e,0xc,0x84,0x75,0x95,0x6f,0xdd,0x6b,0x3b,0x9a,0x20,0x5d,0xc6,0xb8, + 0x5,0x97,0x64,0x16,0x29,0x5e,0x72,0x23,0xcb,0x30,0x33,0xc4,0xb0,0x37,0xc6,0x6b, + 0x87,0x33,0x2e,0xce,0x3e,0xfa,0x99,0xb2,0xf2,0xc,0xf5,0x93,0xc2,0x3e,0x2f,0xe, + 0xb7,0x2,0x44,0xa0,0x71,0x4a,0xc4,0x7e,0x67,0x11,0xb9,0x2f,0xf4,0xa4,0x5,0x79, + 0x32,0xe,0x1,0xd7,0x8e,0xeb,0xcf,0x19,0x85,0xb8,0xba,0x1e,0x3a,0xd2,0x6a,0xb2, + 0x91,0x9c,0x5f,0x1,0x68,0x34,0xb7,0x15,0x0,0x41,0x20,0x88,0xb2,0x5e,0x2a,0xa2, + 0xc0,0xb7,0xfa,0xff,0x5f,0x14,0x29,0x12,0xa1,0x33,0x99,0xf,0xbe,0x9,0xee,0x2e, + 0xb3,0x97,0x59,0x27,0x74,0x61,0x45,0xcf,0xe3,0x4e,0x2c,0x15,0x39,0x12,0x53,0x42, + 0x91,0xc9,0x7d,0x9f,0x59,0xde,0x31,0x31,0x33,0x78,0xb8,0xf3,0x38,0xcb,0x55,0x28, + 0xe3,0x4c,0x41,0xa6,0x76,0x4f,0x3a,0x52,0x18,0x39,0x3c,0x10,0x47,0xfb,0x90,0x68, + 0x64,0x60,0xb2,0xfe,0x3e,0x9,0x26,0xf2,0x41,0xb0,0xcf,0x16,0xa7,0x15,0x1c,0xe4, + 0xbb,0xd5,0xf2,0x6c,0xbb,0xa5,0xb4,0x10,0x9,0x80,0x4f,0xe3,0x35,0x6d,0x6d,0x30, + 0xc2,0x69,0xc7,0xd6,0xb4,0x49,0xf3,0xe2,0x79,0x26,0xa2,0x24,0x99,0x1c,0xd6,0x73, + 0x57,0xb4,0x2c,0xcc,0x8a,0xe0,0x2b,0x0,0x91,0x56,0x90,0x3,0x20,0x8,0xc3,0x70, + 0xc1,0xa3,0xd3,0xe8,0xff,0xdf,0x67,0xc2,0x49,0x4f,0x1c,0x20,0xcc,0xb5,0x23,0xf1, + 0xce,0x85,0xc2,0xb6,0xae,0xed,0x5f,0x3,0x34,0xeb,0xc3,0xa2,0x1c,0xde,0x34,0x7d, + 0x58,0x50,0x26,0xb2,0xa9,0x52,0x98,0x6d,0xaa,0x4e,0x76,0xee,0x52,0x10,0x33,0xca, + 0x39,0x56,0xb9,0x25,0x9a,0x7c,0x8a,0x61,0x45,0xe7,0x3a,0x49,0x30,0x11,0x22,0x32, + 0xe5,0x2,0x10,0x3b,0x3e,0xf5,0x60,0xf4,0x70,0x96,0x4a,0xf7,0x95,0xc0,0xde,0xa7, + 0xd5,0x5a,0xcf,0xeb,0xd0,0x1d,0x12,0xa9,0xf7,0x37,0x88,0xad,0x38,0xda,0x91,0x97, + 0x3,0x29,0x7,0xde,0x4c,0xd,0x9,0xef,0x29,0xf1,0xbb,0xd,0xc8,0xae,0x9f,0x0, + 0x4c,0x9a,0xc1,0xa,0xc0,0x20,0xc,0x43,0xc5,0xed,0x30,0xfc,0xff,0x1f,0x75,0x50, + 0x3c,0x8c,0xe9,0xfa,0x92,0xd,0x76,0x93,0x42,0xa1,0x11,0x69,0x4d,0x93,0x97,0xf, + 0x78,0xe,0x88,0x4f,0x65,0xe9,0x47,0x6b,0x34,0x8a,0x2,0xd8,0x2d,0x1f,0x92,0xc, + 0xd,0x2b,0xe3,0x67,0xef,0x23,0x2,0x27,0x20,0x83,0xf0,0x3,0x3c,0xe7,0xdf,0x42, + 0xe5,0xe5,0x80,0x63,0xc6,0x6f,0xc3,0xa1,0xc9,0xb7,0xfe,0x85,0x40,0x55,0x2,0xc2, + 0x26,0x33,0x7a,0xae,0x88,0x91,0x6d,0xab,0x62,0xad,0xd8,0xed,0x17,0xbb,0xd8,0x60, + 0x4b,0x68,0xb9,0x8b,0xd9,0xa3,0xb2,0xb9,0xa5,0x3c,0x2,0x6,0xd1,0xaa,0x3e,0x2, + 0x30,0x69,0x2e,0x29,0x0,0xc3,0x20,0x10,0x25,0x4a,0x7b,0xff,0xd3,0xd6,0x42,0x16, + 0xc9,0x3c,0x87,0x86,0x6e,0xb3,0x12,0xd4,0xf9,0x98,0x49,0x59,0xb5,0x53,0x3d,0xc, + 0x25,0xf7,0x23,0xf3,0xc6,0x12,0x2e,0x95,0x8e,0x62,0x98,0x8,0x14,0xe9,0x1f,0xe1, + 0x4f,0x49,0xac,0xb3,0x65,0xe9,0xbe,0x39,0x78,0xe4,0xd2,0xcf,0x3d,0xe6,0x7f,0xdd, + 0xf8,0xd2,0x92,0xe1,0x76,0xf5,0xb,0x72,0xae,0xbf,0xe3,0x1,0xc3,0xe,0x36,0xa4, + 0xe6,0x5c,0xad,0xa8,0x7a,0xb9,0xa5,0x3c,0x13,0xd0,0x84,0x7b,0x21,0x71,0xcd,0xd3, + 0x15,0xf7,0x30,0x6,0x99,0x9d,0x62,0x90,0xc4,0x68,0xc7,0xaa,0x11,0xd9,0x2,0xf0, + 0x68,0xb5,0x2b,0x0,0x82,0x40,0xac,0xc8,0x1f,0x12,0x12,0xf4,0xfe,0x4f,0x6a,0x99, + 0xb5,0x8f,0xd8,0x5f,0x41,0xf,0xc7,0x71,0xdb,0x8e,0x95,0x6c,0xb2,0x5c,0x29,0x16, + 0x99,0xbc,0xcb,0x20,0x1d,0x51,0xac,0x50,0xf0,0xca,0x6c,0x12,0x44,0xf5,0x8c,0x89, + 0xcf,0x43,0x36,0x34,0x12,0x32,0x49,0x43,0xa6,0x9,0xfd,0x43,0xab,0x43,0xbc,0x31, + 0xe8,0x41,0x37,0x9d,0xbf,0x1e,0xf3,0x8c,0x45,0x4c,0xaa,0x20,0x8,0x89,0xe7,0x86, + 0xe1,0x9e,0xe7,0xd1,0xf6,0x56,0x71,0x7f,0xf4,0x8b,0x3b,0x2a,0xa1,0xbe,0xac,0xbf, + 0xd6,0x97,0x6b,0x27,0xaf,0x7d,0x2,0x10,0x69,0xee,0x38,0x0,0xc2,0x30,0xc,0x15, + 0x15,0x9f,0xe,0x2c,0xbd,0xff,0x41,0x29,0x50,0x55,0x3c,0xbb,0x10,0xc6,0xe,0x5d, + 0x92,0x28,0xb6,0x95,0x37,0x47,0xe5,0xa2,0x7e,0x3,0x8d,0x75,0x40,0x41,0x5f,0x12, + 0xc6,0x69,0xcb,0xf9,0xa8,0xd5,0xb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0x90,0xb5,0xc0,0x8a,0x9f,0x99,0x1,0x3c,0xa7,0x6,0x6a,0x73, + 0xfd,0x66,0xfc,0xd,0xee,0x2e,0xfc,0xf9,0xf5,0x5,0x34,0xc8,0xcd,0x9,0x5a,0x3b, + 0xb,0xca,0x42,0xa0,0xd6,0x1f,0xa8,0x59,0x0,0xaa,0xf8,0x99,0x18,0x0,0x2,0x70, + 0x69,0x5,0x39,0x0,0x82,0x30,0x4c,0x37,0x85,0xff,0x3f,0x57,0x22,0xcc,0xb6,0x13, + 0x62,0xbc,0xc1,0x6d,0xb,0x6d,0xe9,0xa0,0x8a,0x25,0x4d,0x2,0x64,0x1d,0x29,0xe7, + 0x4,0x46,0xbc,0xe1,0x9b,0xab,0xb5,0xac,0xc8,0xe8,0x46,0x6c,0x35,0xb0,0x4f,0x38, + 0xe5,0x76,0xbd,0x10,0x7f,0x55,0xe1,0xd7,0xaa,0xbe,0xfd,0x3a,0x8e,0xb6,0x9c,0x91, + 0x84,0x57,0xe2,0x72,0xbb,0x95,0x68,0x1a,0x82,0x9,0xac,0x4,0x47,0x6b,0x8c,0x3f, + 0xa3,0x44,0x85,0x55,0x4,0x92,0xc3,0x4d,0xaa,0xdc,0xc3,0x9c,0xb,0xde,0x6a,0x60, + 0x93,0x1f,0x8f,0x0,0x3,0x0,0x87,0x84,0x2a,0x97,0x59,0xf0,0x66,0x15,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + +}; + +static const unsigned char qt_resource_name[] = { + // icons + 0x0,0x5, + 0x0,0x6f,0xa6,0x53, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x73, + // fit-page-32.png + 0x0,0xf, + 0xe,0xe8,0x18,0x47, + 0x0,0x66, + 0x0,0x69,0x0,0x74,0x0,0x2d,0x0,0x70,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x2d,0x0,0x33,0x0,0x32,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // inputPoint.png + 0x0,0xe, + 0x6,0xae,0x65,0xe7, + 0x0,0x69, + 0x0,0x6e,0x0,0x70,0x0,0x75,0x0,0x74,0x0,0x50,0x0,0x6f,0x0,0x69,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // vertex.png + 0x0,0xa, + 0xa,0xc4,0xce,0x67, + 0x0,0x76, + 0x0,0x65,0x0,0x72,0x0,0x74,0x0,0x65,0x0,0x78,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // until.png + 0x0,0x9, + 0xa,0xff,0xaf,0xe7, + 0x0,0x75, + 0x0,0x6e,0x0,0x74,0x0,0x69,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // triangulation.png + 0x0,0x11, + 0x8,0x9f,0x38,0x7, + 0x0,0x74, + 0x0,0x72,0x0,0x69,0x0,0x61,0x0,0x6e,0x0,0x67,0x0,0x75,0x0,0x6c,0x0,0x61,0x0,0x74,0x0,0x69,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + + // fileSave.png + 0x0,0xc, + 0x5,0x68,0x2,0x67, + 0x0,0x66, + 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x53,0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // Voronoi_diagram_2.png + 0x0,0x15, + 0x3,0x5d,0x10,0x67, + 0x0,0x56, + 0x0,0x6f,0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x6f,0x0,0x69,0x0,0x5f,0x0,0x64,0x0,0x69,0x0,0x61,0x0,0x67,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x5f,0x0,0x32, + 0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // fileNew.png + 0x0,0xb, + 0x4,0x14,0x52,0x7, + 0x0,0x66, + 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x4e,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // fileOpen.png + 0x0,0xc, + 0xb,0x21,0x3,0x87, + 0x0,0x66, + 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x4f,0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // snapshot.png + 0x0,0xc, + 0x0,0x2e,0x58,0x67, + 0x0,0x73, + 0x0,0x6e,0x0,0x61,0x0,0x70,0x0,0x73,0x0,0x68,0x0,0x6f,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + +}; + +static const unsigned char qt_resource_struct[] = { + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, + // :/icons + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0x2, + // :/icons/snapshot.png + 0x0,0x0,0x1,0x38,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x48,0x5e, + // :/icons/Voronoi_diagram_2.png + 0x0,0x0,0x0,0xce,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x32,0xbf, + // :/icons/fileNew.png + 0x0,0x0,0x0,0xfe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3e,0xd8, + // :/icons/fileSave.png + 0x0,0x0,0x0,0xb0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x2e,0x6, + // :/icons/inputPoint.png + 0x0,0x0,0x0,0x34,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x5,0x36, + // :/icons/triangulation.png + 0x0,0x0,0x0,0x88,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x10,0x87, + // :/icons/vertex.png + 0x0,0x0,0x0,0x56,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9,0xb3, + // :/icons/until.png + 0x0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb,0x1f, + // :/icons/fileOpen.png + 0x0,0x0,0x1,0x1a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x41,0xdc, + // :/icons/fit-page-32.png + 0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, + +}; + +QT_BEGIN_NAMESPACE + +extern Q_CORE_EXPORT bool qRegisterResourceData + (int, const unsigned char *, const unsigned char *, const unsigned char *); + +extern Q_CORE_EXPORT bool qUnregisterResourceData + (int, const unsigned char *, const unsigned char *, const unsigned char *); + +QT_END_NAMESPACE + + +int QT_MANGLE_NAMESPACE(qInitResources_pwsrec)() +{ + QT_PREPEND_NAMESPACE(qRegisterResourceData) + (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_pwsrec)) + +int QT_MANGLE_NAMESPACE(qCleanupResources_pwsrec)() +{ + QT_PREPEND_NAMESPACE(qUnregisterResourceData) + (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; +} + +Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_pwsrec)) + From ef1072542e4e891e709bc23ae80976a4df8e65a7 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 27 Jun 2014 01:05:33 -0400 Subject: [PATCH 013/201] set changes removed --- .../include/CGAL/Reconstruction_edge_2.h | 16 ---------------- .../CGAL/Reconstruction_triangulation_2.h | 2 -- 2 files changed, 18 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index 294ff19ae6d..77499041a26 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -136,22 +136,6 @@ protected: }; -//---------------Reconstruction_edge_2--------------------- -template -struct less_Recon_Edge_2 -{ - bool operator() (const T& a, const T& b) const - { - if (a.priority() < b.priority()) - return true; - if (a.priority() > b.priority()) - return false; - return a < b; - } -}; - - - template class Dynamic_priority_queue_edges : public Dynamic_priority_queue { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 0301390bc87..ec4bb4eea44 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -115,8 +115,6 @@ public: Reconstruction_edge_2; typedef Dynamic_priority_queue_edges PQueue; - typedef std::set > PQueue_set; - double m_factor; // ghost vs solid From feb16e3b74061097be8eceb892f034011fe9e0b2 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 27 Jun 2014 11:12:40 +0200 Subject: [PATCH 014/201] Fix compilation on MSVC --- .../render.cpp | 22 +++++++++---------- .../Reconstruction_simplification_2/scene.h | 16 +++++++------- .../CGAL/Reconstruction_simplification_2.h | 10 ++++----- .../CGAL/Reconstruction_triangulation_2.h | 9 ++++---- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index b72abad51c8..79be770d3c0 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -201,7 +201,7 @@ void R_s_k_2::draw_pedges(const float line_width) int nb_pinned = 0; int nb_cyclic = 0; int nb_discart = 0; - FT min_value = std::numeric_limits::max(); + FT min_value = (std::numeric_limits::max)(); FT max_value = std::numeric_limits::lowest(); std::vector values; std::vector edges; @@ -228,8 +228,8 @@ void R_s_k_2::draw_pedges(const float line_width) { edges.push_back(edge); values.push_back(pedge.priority()); - min_value = std::min(min_value, values.back()); - max_value = std::max(max_value, values.back()); + min_value = (std::min)(min_value, values.back()); + max_value = (std::max)(max_value, values.back()); } else { @@ -282,15 +282,15 @@ void R_s_k_2::draw_one_pedge(const Edge& edge, void R_s_k_2::draw_costs(const float line_width, const bool view_ghost) { - FT min_value = std::numeric_limits::max(); + FT min_value = (std::numeric_limits::max)(); FT max_value = std::numeric_limits::lowest(); for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; FT value = m_dt.get_cost(edge).finalize(m_alpha); - min_value = std::min(min_value, value); - max_value = std::max(max_value, value); + min_value = (std::min)(min_value, value); + max_value = (std::max)(max_value, value); } if (min_value == max_value) max_value += 1.0; @@ -333,7 +333,7 @@ void R_s_k_2::draw_one_cost(const Edge& edge, void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool incolors) { PQueue queue; - FT min_value = std::numeric_limits::max(); + FT min_value = (std::numeric_limits::max)(); FT max_value = std::numeric_limits::lowest(); unsigned nb_initial = 0; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) @@ -343,14 +343,14 @@ void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool in FT value = m_dt.get_edge_relevance(edge); // >= 0 nb_initial++; - min_value = std::min(min_value, value); - max_value = std::max(max_value, value); + min_value = (std::min)(min_value, value); + max_value = (std::max)(max_value, value); queue.push(PEdge(edge, value)); } if (min_value == max_value) max_value += 1.0; ::glLineWidth(line_width); - int nb_remove = std::min(nb, int(queue.size())); + int nb_remove = (std::min)(nb, int(queue.size())); ::glColor3d(0.5, 0.1, 0.1); for (int i = 0; i < nb_remove; ++i) @@ -918,7 +918,7 @@ void R_s_k_2::save_edges(std::ofstream& ofs, const int nb) queue.push(PEdge(edge, value)); } - int nb_remove = std::min(nb, int(queue.size())); + int nb_remove = (std::min)(nb, int(queue.size())); for (int i = 0; i < nb_remove; ++i) { PEdge pedge = queue.top(); diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 3e565116965..9f5ae32030a 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -126,7 +126,7 @@ public: for (it = m_samples.begin(); it != m_samples.end(); ++it) { Sample& sample = *it; sample.mass() = m_max_mass - sample.mass(); - new_max_mass = std::max(new_max_mass, sample.mass()); + new_max_mass = (std::max)(new_max_mass, sample.mass()); } m_max_mass = new_max_mass; } @@ -179,7 +179,7 @@ public: void add_sample(const Point& point, const FT mass = 1.0) { m_samples.push_back(Sample(point, mass)); - m_max_mass = std::max(m_max_mass, mass); + m_max_mass = (std::max)(m_max_mass, mass); } void add_outliers(const unsigned int nb) { @@ -234,15 +234,15 @@ public: ++it; for (; it != m_samples.end(); ++it) { p = it->point(); - x_min = std::min(x_min, p.x()); - x_max = std::max(x_max, p.x()); - y_min = std::min(y_min, p.y()); - y_max = std::max(y_max, p.y()); + x_min = (std::min)(x_min, p.x()); + x_max = (std::max)(x_max, p.x()); + y_min = (std::min)(y_min, p.y()); + y_max = (std::max)(y_max, p.y()); } x = 0.5 * (x_min + x_max); y = 0.5 * (y_min + y_max); - scale = std::max(x_max - x_min, y_max - y_min); + scale = (std::max)(x_max - x_min, y_max - y_min); if (scale == 0.0) scale = 1.0; } @@ -716,7 +716,7 @@ public: Sample_list vertices, samples; select_samples(1.0, vertices, samples); double percentage = 500.0 / double(vertices.size()); - percentage = std::min(percentage, 1.0); + percentage = (std::min)(percentage, 1.0); samples.clear(); vertices.clear(); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ce43f4271e0..26de988d432 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -313,15 +313,15 @@ public: for ( ; it != beyond; ++it) { p = it->point(); - x_min = std::min(x_min, p.x()); - x_max = std::max(x_max, p.x()); - y_min = std::min(y_min, p.y()); - y_max = std::max(y_max, p.y()); + x_min = (std::min)(x_min, p.x()); + x_max = (std::max)(x_max, p.x()); + y_min = (std::min)(y_min, p.y()); + y_max = (std::max)(y_max, p.y()); } x = 0.5 * (x_min + x_max); y = 0.5 * (y_min + y_max); - scale = std::max(x_max - x_min, y_max - y_min); + scale = (std::max)(x_max - x_min, y_max - y_min); if (scale == 0.0) scale = 1.0; } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index ec4bb4eea44..137fe8b01ba 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -26,6 +26,7 @@ #include #include #include +#include // CGAL #include @@ -648,7 +649,7 @@ public: } Edge find_nearest_edge(const Point& point, Face_handle face) const { - FT min_dist2 = std::numeric_limits::max(); + FT min_dist2 = (std::numeric_limits::max)(); Edge nearest(Face_handle(), 0); for (int i = 0; i < 3; ++i) { Edge edge(face, i); @@ -753,7 +754,7 @@ public: Line lab(pa, pb - pa); Line lts(pt, ps - pt); - FT Dqt = std::numeric_limits::max(); + FT Dqt = (std::numeric_limits::max)(); CGAL::Object result = CGAL::intersection(lab, lts); const Point* iq = CGAL::object_cast(&result); if (iq) @@ -1003,7 +1004,7 @@ public: return false; } - if (std::max(Dac, Dbd) + EPS < Dbc) + if ((std::max)(Dac, Dbd) + EPS < Dbc) { std::cerr.precision(10); // TODO: IV comment in std::cerr << red << "-- @@ -1017,7 +1018,7 @@ public: std::cerr << "c: " << c->point() << std::endl; std::cerr << "d: " << d->point() << std::endl; std::cerr << "t: " << target->point() << std::endl; - std::cerr << "diff = " << Dbc - std::max(Dac, Dbd) << std::endl; + std::cerr << "diff = " << Dbc - (std::max)(Dac, Dbd) << std::endl; return false; } From 084da07c70c3377fda639acb474b84f4701e8e1e Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Sat, 28 Jun 2014 06:31:38 +0200 Subject: [PATCH 015/201] Test with boost::multi_index_container --- .../CGAL/Reconstruction_simplification_2.h | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 26de988d432..f535b0ad45c 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -34,12 +34,16 @@ #include #include +#include +#include +#include +#include + namespace CGAL { template class Reconstruction_simplification_2 { - public: typedef typename Kernel::FT FT; typedef typename Kernel::Point_2 Point; @@ -88,7 +92,20 @@ public: typedef typename Triangulation::Reconstruction_edge_2 Reconstruction_edge_2; typedef typename Triangulation::PQueue PQueue; - + + // TODO: this is a test + typedef boost::multi_index_container< + Reconstruction_edge_2, + boost::multi_index::indexed_by< + // sort by Reconstruction_edge_2::operator< + boost::multi_index::ordered_unique< boost::multi_index::identity< + Reconstruction_edge_2 > > , + // sort by Reconstruction_edge_2::priority() + boost::multi_index::ordered_non_unique< + boost::multi_index::const_mem_fun< + Reconstruction_edge_2,const FT,&Reconstruction_edge_2::priority> > + > + > Multi_index; protected: @@ -122,6 +139,10 @@ public: PointPMap in_point_pmap, MassPMap in_mass_pmap) { + // TODO: THIS IS TEST + Multi_index mi; + mi.get<1>().begin(); + start = start_itr; beyond = beyond_itr; From 2a639a0bc2b8e7400a905537dc3d456b55c82f7d Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 30 Jun 2014 18:36:55 -0400 Subject: [PATCH 016/201] PriorityQueue replaced with boost.Multi_index --- .../render.cpp | 36 ++-- .../Reconstruction_simplification_2/scene.h | 1 - .../include/CGAL/Dynamic_priority_queue.h | 202 ------------------ .../include/CGAL/Reconstruction_edge_2.h | 18 -- .../CGAL/Reconstruction_simplification_2.h | 90 ++++---- .../CGAL/Reconstruction_triangulation_2.h | 59 +++-- .../CMakeLists.txt | 5 +- 7 files changed, 114 insertions(+), 297 deletions(-) delete mode 100644 Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index b72abad51c8..9a2d9d5e930 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -332,7 +332,8 @@ void R_s_k_2::draw_one_cost(const Edge& edge, void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool incolors) { - PQueue queue; + MultiIndex mindex; + FT min_value = std::numeric_limits::max(); FT max_value = std::numeric_limits::lowest(); unsigned nb_initial = 0; @@ -345,26 +346,28 @@ void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool in nb_initial++; min_value = std::min(min_value, value); max_value = std::max(max_value, value); - queue.push(PEdge(edge, value)); + mindex.insert(PEdge(edge, value)); + } if (min_value == max_value) max_value += 1.0; ::glLineWidth(line_width); - int nb_remove = std::min(nb, int(queue.size())); + int nb_remove = std::min(nb, int(mindex.size())); ::glColor3d(0.5, 0.1, 0.1); for (int i = 0; i < nb_remove; ++i) { - PEdge pedge = queue.top(); - queue.pop(); + + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); if (incolors) draw_edge(pedge.edge()); } ::glColor3d(0.0, 0.5, 0.0); - while (!queue.empty()) + while (!mindex.empty()) { - PEdge pedge = queue.top(); - queue.pop(); + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); if (incolors) { FT value = pedge.priority(); @@ -909,26 +912,27 @@ void R_s_k_2::draw_vertex_edges(Vertex_handle vertex, void R_s_k_2::save_edges(std::ofstream& ofs, const int nb) { - PQueue queue; + MultiIndex mindex; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; FT value = m_dt.get_edge_relevance(edge); // >= 0 - queue.push(PEdge(edge, value)); + mindex.insert(PEdge(edge, value)); } - int nb_remove = std::min(nb, int(queue.size())); + int nb_remove = std::min(nb, int(mindex.size())); for (int i = 0; i < nb_remove; ++i) { - PEdge pedge = queue.top(); - queue.pop(); + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); + } - while (!queue.empty()) + while (!mindex.empty()) { - PEdge pedge = queue.top(); - queue.pop(); + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); save_one_edge(ofs, pedge.edge()); } } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 3e565116965..5019ae0d534 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -73,7 +73,6 @@ public: typedef R_s_2::SQueue SQueue; typedef R_s_2::Reconstruction_edge_2 PEdge; - typedef R_s_2::PQueue PQueue; private: // data diff --git a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h b/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h deleted file mode 100644 index e412c93d453..00000000000 --- a/Reconstruction_simplification_2/include/CGAL/Dynamic_priority_queue.h +++ /dev/null @@ -1,202 +0,0 @@ -#ifndef DYNAMICS_PRIORITY_QUEUE_H_ -#define DYNAMICS_PRIORITY_QUEUE_H_ - -/* - * class DynamicPriorityQueue - * USAGE: - * + Implement abstract method 'compare(const T&, const T&)' - * + Class T must have operators '=' and '<' - */ - -#include -#include -#include - -template -class Dynamic_priority_queue { -protected: - typedef std::map Map; - std::vector _queue; - Map _elements; - -public: - Dynamic_priority_queue() { - - } - - virtual ~Dynamic_priority_queue() { - clean(); - } - - bool empty() const { - return _queue.empty(); - } - - unsigned int size() const { - return _queue.size(); - } - - const T& get_element(int i) const { - assert(i >= 0); - assert(i < size()); - return _queue[i]; - } - - bool contains(const T& x) { - return (get_position(x) >= 0); - } - - void clean() { - _queue.clear(); - _elements.clear(); - } - - void push(const T& x) { - int pos = insert(x); - move_up(pos); - } - - bool update_if_better(const T& x) { - int pos = get_position(x); - if (pos < 0) return false; - - const T& old = get_element(pos); - if (compare(old, x)) return false; - - return update(x); - } - - bool update(const T& x) { - bool ok = remove(x); - if (ok) push(x); - return ok; - } - - bool remove(const T& x) { - int pos = get_position(x); - if (pos < 0) return false; - - T old = get_element(pos); - erase(pos); - - if (size() < 2) return true; - if (pos == size()) return true; - - if (compare(old, get_element(pos))) - move_down(pos); - else - move_up(pos); - return true; - } - - bool extract(T& x) { - if (empty()) return false; - x = top(); - pop(); - return true; - } - - T top() const { - return _queue.front(); - } - - void pop() { - if (empty()) return; - erase(0); - if (empty()) return; - move_down(0); - } - - virtual bool compare(const T& a, const T& b) const = 0; - -protected: - int get_position(const T& x) { - typename Map::const_iterator it = _elements.find(x); - if (it == _elements.end()) return -1; - return it->second; - } - - int insert(const T& x) { - int pos = int( size() ); - _queue.push_back(x); - _elements[x] = pos; - return pos; - } - - void erase(int pos) { - swap(pos, size()-1); - drop_last_element(); - } - - void drop_last_element() { - T last = _queue.back(); - _queue.pop_back(); - _elements.erase(last); - } - - void swap(int i, int j) { - T x_i = get_element(i); - T x_j = get_element(j); - place(x_i, j); - place(x_j, i); - } - - void place(const T& x, int i) { - _queue[i] = x; - _elements[x] = i; - } - - int parent(int i) const { - if (i%2 == 0) return (i-2)/2; - return (i-1)/2; - } - - int left(int i) const { - return 2*i + 1; - } - - int right(int i) const { - return 2*i + 2; - } - - void move_down(int i) { - int pos = i; - int l = left(pos); - int r = right(pos); - T moving = get_element(pos); - - int better; - int N = int(size()); - while (l < N) { - if ( r < N && compare(get_element(r), get_element(l)) ) - better = r; - else - better = l; - - if ( compare(moving, get_element(better)) ) break; - - place(get_element(better), pos); - pos = better; - l = left(pos); - r = right(pos); - } - if (pos != i) place(moving, pos); - } - - void move_up(int i) { - int pos = i; - int p = parent(pos); - T moving = get_element(pos); - - while (pos > 0 && compare(moving, get_element(p))) { - place(get_element(p), pos); - pos = p; - p = parent(pos); - } - if (pos != i) place(moving, pos); - } - -}; - - -#endif diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index 77499041a26..ff05b931df4 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -20,8 +20,6 @@ #ifndef RECONSTRUCTION_EDGE_2_H_ #define RECONSTRUCTION_EDGE_2_H_ -#include - template class Reconstruction_edge_2 { @@ -135,22 +133,6 @@ protected: } }; - - -template -class Dynamic_priority_queue_edges : public Dynamic_priority_queue { -public: - Dynamic_priority_queue_edges() { } - - ~Dynamic_priority_queue_edges() { } - - // a < b - bool compare(const T& a, const T& b) const - { - return (a.priority() < b.priority()); - } -}; - #endif diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ce43f4271e0..46749076ea8 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -29,6 +29,7 @@ #include + #include #include #include @@ -87,13 +88,13 @@ public: typedef typename Triangulation::SQueue SQueue; typedef typename Triangulation::Reconstruction_edge_2 Reconstruction_edge_2; - typedef typename Triangulation::PQueue PQueue; + typedef typename Triangulation::MultiIndex MultiIndex; protected: Triangulation m_dt; - PQueue m_pqueue; + MultiIndex m_mindex; int m_ignore; int m_verbose; int m_mchoice; // # Edges @@ -122,6 +123,7 @@ public: PointPMap in_point_pmap, MassPMap in_mass_pmap) { + start = start_itr; beyond = beyond_itr; @@ -205,29 +207,29 @@ public: std::cout << "---------extracted_solid_eges------------" << std::endl; - PQueue queue; + MultiIndex mindex; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; FT value = m_dt.get_edge_relevance(edge); // >= 0 - queue.push(Reconstruction_edge_2(edge, value)); + mindex.insert(Reconstruction_edge_2(edge, value)); } //TODO: IV find nicer way to handle m_ignore - int nb_remove = (std::min)(m_ignore, int(queue.size())); + int nb_remove = (std::min)(m_ignore, int(mindex.size())); for (int i = 0; i < nb_remove; ++i) { - Reconstruction_edge_2 pedge = queue.top(); - queue.pop(); + Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); + (mindex.template get<0>()).erase(pedge); } - while (!queue.empty()) + while (!mindex.empty()) { - Reconstruction_edge_2 pedge = queue.top(); - queue.pop(); + Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); + (mindex.template get<0>()).erase(pedge); int i = (pedge.edge()).second; Face_handle face = (pedge.edge()).first; @@ -246,29 +248,30 @@ public: std::cout << "---------extracted_solid_eges------------" << std::endl; - PQueue queue; + MultiIndex mindex; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) continue; FT value = m_dt.get_edge_relevance(edge); // >= 0 - queue.push(Reconstruction_edge_2(edge, value)); + mindex.insert(Reconstruction_edge_2(edge, value)); } //TODO: IV find nicer way to handle m_ignore - int nb_remove = (std::min)(m_ignore, int(queue.size())); + int nb_remove = (std::min)(m_ignore, int(mindex.size())); for (int i = 0; i < nb_remove; ++i) { - Reconstruction_edge_2 pedge = queue.top(); - queue.pop(); + Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); + (mindex.template get<0>()).erase(pedge); } - while (!queue.empty()) + while (!mindex.empty()) { - Reconstruction_edge_2 pedge = queue.top(); - queue.pop(); + Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); + (mindex.template get<0>()).erase(pedge); solid_edges.push_back(pedge); @@ -327,7 +330,7 @@ public: void clear() { m_dt.clear(); - m_pqueue.clean(); + m_mindex.clear(); } double time_duration(const double init) { @@ -722,7 +725,7 @@ public: ok = pick_edge_from_pqueue(best_pedge); return ok; } - m_pqueue.clean(); + m_mindex.clear(); if (nb == ne) { ok = pick_edge_brute_force(best_pedge); @@ -734,58 +737,61 @@ public: } bool pick_edge_from_pqueue(Reconstruction_edge_2& best_pedge) { - if (m_pqueue.empty()) + if (m_mindex.empty()) populate_pqueue(); - if (m_pqueue.empty()) + if (m_mindex.empty()) return false; - best_pedge = m_pqueue.top(); - m_pqueue.pop(); + best_pedge = *(m_mindex.template get<1>()).begin(); + (m_mindex.template get<0>()).erase(best_pedge); return true; } bool pick_edge_brute_force(Reconstruction_edge_2& best_pedge) { - PQueue pqueue; + MultiIndex mindex; Finite_edges_iterator ei; for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; - push_to_pqueue(edge, pqueue); + push_to_mindex(edge, mindex); + edge = m_dt.twin_edge(edge); - push_to_pqueue(edge, pqueue); + push_to_mindex(edge, mindex); } - if (pqueue.empty()) + if (mindex.empty()) return false; - best_pedge = pqueue.top(); + best_pedge = *(mindex.template get<1>()).begin(); return true; } bool pick_edge_randomly(int nb, Reconstruction_edge_2& best_pedge) { - PQueue pqueue; + MultiIndex mindex; for (int i = 0; i < nb; ++i) { Reconstruction_edge_2 pedge; if (random_pedge(pedge)) - pqueue.push(pedge); + mindex.insert(pedge); } - if (pqueue.empty()) + if (mindex.empty()) return false; - best_pedge = pqueue.top(); + best_pedge = *(mindex.template get<1>()).begin(); return true; } + //TODO: IV Rename void populate_pqueue() { Finite_edges_iterator ei; for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; - push_to_pqueue(edge, m_pqueue); + push_to_mindex(edge, m_mindex); edge = m_dt.twin_edge(edge); - push_to_pqueue(edge, m_pqueue); + push_to_mindex(edge, m_mindex); } } - bool push_to_pqueue(const Edge& edge, PQueue& pqueue) { + + bool push_to_mindex(const Edge& edge, MultiIndex& mindex) { if (m_dt.is_pinned(edge)) return false; if (m_dt.is_target_cyclic(edge)) @@ -795,10 +801,12 @@ public: bool ok = create_pedge(edge, pedge); if (!ok) return false; - pqueue.push(pedge); + mindex.insert(pedge); return true; } + + bool random_pedge(Reconstruction_edge_2& pedge) { for (unsigned i = 0; i < 10; ++i) { Edge edge = m_dt.random_finite_edge(); @@ -815,7 +823,7 @@ public: template // value_type = Edge void remove_stencil_from_pqueue(Iterator begin, Iterator end) { - if (m_pqueue.empty()) + if (m_mindex.empty()) return; Edge_list edges; @@ -824,7 +832,7 @@ public: typename Edge_list::const_iterator ei; for (ei = edges.begin(); ei != edges.end(); ++ei) { Edge edge = *ei; - m_pqueue.remove(Reconstruction_edge_2(edge)); + (m_mindex.template get<0>()).erase(Reconstruction_edge_2(edge)); } } @@ -836,7 +844,7 @@ public: typename Edge_list::const_iterator ei; for (ei = edges.begin(); ei != edges.end(); ++ei) { Edge edge = *ei; - push_to_pqueue(edge, m_pqueue); + push_to_mindex(edge, m_mindex); } } @@ -1104,7 +1112,7 @@ public: double timer = clock(); std::cerr << yellow << "relocate all" << white << "..."; - m_pqueue.clean(); // pqueue must be recomputed + m_mindex.clear(); // pqueue must be recomputed for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); v != m_dt.finite_vertices_end(); ++v) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index ec4bb4eea44..bb771cfa90c 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -34,13 +34,21 @@ #include // local -#include #include #include #include #include #include + +// boost +#include +#include +#include +#include +#include + + #define EPS 1e-15 namespace CGAL { @@ -113,12 +121,23 @@ public: typedef Reconstruction_edge_2 Reconstruction_edge_2; - typedef Dynamic_priority_queue_edges PQueue; + + typedef boost::multi_index_container< + Reconstruction_edge_2, + boost::multi_index::indexed_by< + // sort by Reconstruction_edge_2::operator< + boost::multi_index::ordered_unique< boost::multi_index::identity< + Reconstruction_edge_2 > > , + // sort by Reconstruction_edge_2::priority() + boost::multi_index::ordered_non_unique< + boost::multi_index::const_mem_fun< + Reconstruction_edge_2,const FT,&Reconstruction_edge_2::priority> > + > + > MultiIndex; double m_factor; // ghost vs solid - public: Reconstruction_triangulation_2() { m_factor = 1.0; @@ -952,29 +971,32 @@ public: } //-------- - template // value_type = Edge - bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) - { + template // value_type = Edge + bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) + { Vertex_handle source = source_vertex(edge); Vertex_handle target = target_vertex(edge); - PQueue pqueue; + MultiIndex multi_ind; for (Iterator it = begin; it != end; ++it) { Edge ab = twin_edge(*it); Vertex_handle a = source_vertex(ab); Vertex_handle b = target_vertex(ab); FT D = signed_distance_from_intersection(a, b, target, source); - if (D < 0.0) pqueue.push(Reconstruction_edge_2(ab, D)); + if (D < 0.0) { + multi_ind.insert(Reconstruction_edge_2(ab, D)); + } } + int nb_flips = 0; - while (!pqueue.empty()) + while (!multi_ind.empty()) { - Reconstruction_edge_2 pedge = pqueue.top(); - FT Dbc = pedge.priority(); + Reconstruction_edge_2 pedge = *(multi_ind.template get<1>()).begin(); + FT Dbc = pedge.priority(); Edge bc = pedge.edge(); - pqueue.pop(); + (multi_ind.template get<0>()).erase(pedge); Edge sb = prev_edge(bc); Edge ab = prev_edge(twin_edge(sb)); @@ -1023,15 +1045,20 @@ public: if (Dac > Dbd) { - pqueue.remove(Reconstruction_edge_2(ab)); + (multi_ind.template get<0>()).erase(Reconstruction_edge_2(ab)); + Edge ac = flip(sb, edge, verbose); - if (Dac < 0.0) pqueue.push(Reconstruction_edge_2(ac, Dac)); + if (Dac < 0.0) { + multi_ind.insert(Reconstruction_edge_2(ac, Dac)); + } } else { - pqueue.remove(Reconstruction_edge_2(cd)); + (multi_ind.template get<0>()).erase(Reconstruction_edge_2(cd)); Edge bd = flip(sc, edge, verbose); - if (Dbd < 0.0) pqueue.push(Reconstruction_edge_2(bd, Dbd)); + if (Dbd < 0.0) { + multi_ind.insert(Reconstruction_edge_2(bd, Dbd)); + } } nb_flips++; } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index c50ec79a790..b91624d27e5 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -19,10 +19,9 @@ if ( CGAL_FOUND ) include_directories (BEFORE "../../include") - include_directories (BEFORE "include") + include_directories (BEFORE "include") - #create_single_source_cgal_program( "test_basic.cpp" ) -create_single_source_cgal_program( "test_priority_queue.cpp" ) + create_single_source_cgal_program( "test_basic.cpp" ) else() From a5aa204fcde7623faf97bf582ea3376bd835eb59 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 3 Jul 2014 21:28:15 +0200 Subject: [PATCH 017/201] WIP --- Documentation/doc/Documentation/Doxyfile.in | 1 + Documentation/doc/Documentation/dependencies | 1 + Documentation/doc/Documentation/packages.txt | 1 + IvoHello.txt | 1 - .../doc/Doxyfile.in | 9 + .../doc/PackageDescription.txt | 35 ++ .../doc/Reconstruction_Simplification_2 | 324 ++++++++++++++++++ .../doc/dependencies | 3 + .../include/CGAL/Cost.h | 20 ++ .../include/CGAL/Reconstruction_edge_2.h | 5 +- .../include/CGAL/Reconstruction_face_base_2.h | 20 ++ .../CGAL/Reconstruction_simplification_2.h | 86 ++++- .../CGAL/Reconstruction_triangulation_2.h | 23 +- .../CGAL/Reconstruction_vertex_base_2.h | 26 +- .../include/CGAL/Sample.h | 22 ++ .../Reconstruction_simplification_2/copyright | 2 + .../description.txt | 0 .../license.txt | 1 + .../maintainer | 0 19 files changed, 558 insertions(+), 22 deletions(-) delete mode 100644 IvoHello.txt create mode 100644 Reconstruction_simplification_2/doc/Doxyfile.in create mode 100644 Reconstruction_simplification_2/doc/PackageDescription.txt create mode 100644 Reconstruction_simplification_2/doc/Reconstruction_Simplification_2 create mode 100644 Reconstruction_simplification_2/doc/dependencies create mode 100644 Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/copyright create mode 100644 Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/description.txt create mode 100644 Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/license.txt create mode 100644 Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/maintainer diff --git a/Documentation/doc/Documentation/Doxyfile.in b/Documentation/doc/Documentation/Doxyfile.in index 37bdcef0312..1e7cc3e7df2 100644 --- a/Documentation/doc/Documentation/Doxyfile.in +++ b/Documentation/doc/Documentation/Doxyfile.in @@ -112,3 +112,4 @@ IMAGE_PATH = ${CMAKE_SOURCE_DIR}/Documentation/doc/Documentation/fig \ ${CMAKE_SOURCE_DIR}/Surface_reconstruction_points_3/doc/Surface_reconstruction_points_3/fig \ ${CMAKE_SOURCE_DIR}/Stream_lines_2/doc/Stream_lines_2/fig \ ${CMAKE_SOURCE_DIR}/Stream_support/doc/Stream_support/fig \ + ${CMAKE_SOURCE_DIR}/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/fig diff --git a/Documentation/doc/Documentation/dependencies b/Documentation/doc/Documentation/dependencies index 5e3537debae..ce7a9766654 100644 --- a/Documentation/doc/Documentation/dependencies +++ b/Documentation/doc/Documentation/dependencies @@ -71,6 +71,7 @@ Spatial_searching Spatial_sorting Segment_Delaunay_graph_2 Straight_skeleton_2 +Reconstruction_Simplification_2 Voronoi_diagram_2 Surface_mesh_simplification Subdivision_method_3 diff --git a/Documentation/doc/Documentation/packages.txt b/Documentation/doc/Documentation/packages.txt index f1f45d261b3..cbd52558ba6 100644 --- a/Documentation/doc/Documentation/packages.txt +++ b/Documentation/doc/Documentation/packages.txt @@ -91,6 +91,7 @@ h1 { \package_listing{Surface_reconstruction_points_3} \package_listing{Skin_surface_3} \package_listing{Mesh_3} +\package_listing{Reconstruction_simplification_2} \section PartGeometryProcessing Geometry Processing diff --git a/IvoHello.txt b/IvoHello.txt deleted file mode 100644 index e83f0cf94bf..00000000000 --- a/IvoHello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello CGAL git diff --git a/Reconstruction_simplification_2/doc/Doxyfile.in b/Reconstruction_simplification_2/doc/Doxyfile.in new file mode 100644 index 00000000000..f4a99f5c506 --- /dev/null +++ b/Reconstruction_simplification_2/doc/Doxyfile.in @@ -0,0 +1,9 @@ +@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS} + +PROJECT_NAME = "CGAL ${CGAL_CREATED_VERSION_NUM} - 2D Reconstruction and Simplification from Point Set" + +INPUT = ${CMAKE_SOURCE_DIR}/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/ \ + ${CMAKE_SOURCE_DIR}/Reconstruction_simplification_2/include +EXTRACT_ALL = false +HIDE_UNDOC_CLASSES = true +WARN_IF_UNDOCUMENTED = false diff --git a/Reconstruction_simplification_2/doc/PackageDescription.txt b/Reconstruction_simplification_2/doc/PackageDescription.txt new file mode 100644 index 00000000000..1b33d4f63e3 --- /dev/null +++ b/Reconstruction_simplification_2/doc/PackageDescription.txt @@ -0,0 +1,35 @@ +/// \defgroup PkgReconstructionSimplification2 2D Reconstruction Simplification Reference +/// \defgroup PkgReconstructionSimplification2Concepts Concepts +/// \ingroup PkgReconstructionSimplification2 +/*! +\addtogroup PkgReconstructionSimplification2 +\todo check generated documentation +\cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} +\cgalPkgPicture{xxx.png} +\cgalPkgSummaryBegin +\cgalPkgAuthor{ Fernando de Goes, Ivo Vigan} +\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane using a transportation theory approach to match the input point with an output simplex.} +\cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} +\cgalPkgSummaryEnd +\cgalPkgShortInfoBegin +\cgalPkgSince{4.x} +\cgalPkgDependsOn{\ref PkgBGLSummary} +\cgalPkgDependsOn{\ref PkgPolyhedronSummary} +\cgalPkgBib{cgal:c-tsms-12} +\cgalPkgLicense{\ref licensesGPL "GPL"} +\cgalPkgDemo{XXXX.zip} +\cgalPkgShortInfoEnd +\cgalPkgDescriptionEnd + +\cgalClassifedRefPages + +## Concepts ## +- `PointPMap` +- `MassPMap` + + +## Classes ## +- `CGAL::Reconstruction_simplification_2 + +*/ + diff --git a/Reconstruction_simplification_2/doc/Reconstruction_Simplification_2 b/Reconstruction_simplification_2/doc/Reconstruction_Simplification_2 new file mode 100644 index 00000000000..733ecbf30bb --- /dev/null +++ b/Reconstruction_simplification_2/doc/Reconstruction_Simplification_2 @@ -0,0 +1,324 @@ +namespace CGAL { +/*! + +\mainpage User Manual +\anchor Chapter_2D_Reconstruction_Simplification + +\cgalAutoToc + +\authors Fernando de Goes, Ivo Vigan + +\image html process.png +\image latex process.png + +\section D_Reconstruction_SimplificationIntroduction Introduction + + +\cgalFigureBegin{Surface_reconstruction_points_3figintroduction,process.png} +From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. +\cgalFigureEnd + +The task addressed here is to reconstruct a shape from a noisy point set S in R^2, i.e. give a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. + +The algorithm presented here performs the reconstruction and simplification task jointly using a unifies ed framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. + +The algorithm can be summarized as: "Considering S as a measure mu consisting of Dirac masses, find a coarse simplicial complex T such that mu is well approximated by a linear combination of uniform measures on the edges and vertices of T." + +It performs a course to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan T \ e. + +The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then peramnetly assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. + +This sequence of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users has been reached. + +After that, edges which carry little mass can be filtered out. + + + + + + + + +can simplify any oriented 2-manifold surface, +with any number of connected components, with or without boundaries (border or holes) +and handles (arbitrary genus), using a method known as edge collapse. +Roughly speaking, the method consists of iteratively replacing an edge with a single vertex, +removing 2 triangles per collapse. + +Edges are collapsed according to a priority given by a user-supplied cost function, +and the coordinates of the replacing vertex are determined by another user-supplied +placement function. The algorithm terminates when a user-supplied stop predicate +is met, such as reaching the desired number of edges. + +The algorithm implemented here is generic in the sense that it does not require the surface mesh +to be of a particular type. Instead, it defines the concept of a `EdgeCollapsableSurfaceMesh`, +which presents the surface mesh as being a halfedge data structure, and any surface mesh that +is a model of that concept can be simplified. The concept is defined not in terms of a monolithic class, but in terms of a set +of functions and traits, making it easy to adapt any concrete surface mesh type, +even if it is not a halfedge data structure at all. +In particular, the concept definition follows the design of the + Boost Graph Library (Bgl) +\cgalCite{cgal:sll-bgl-02}. + +The design is policy-based +(http://en.wikipedia.org/wiki/Policy-based_design), +meaning that you can customize some aspects of the process by passing a set of +policy objects. Each policy object specifies a particular aspect of the algorithm, +such as how edges are selected and where the replacement vertex is placed. All policies have +a sensible default. +Furthermore, the API uses the so-called `named-parameters` technique which allows you +to pass only the relevant parameters, in any order, omitting those parameters whose +default is appropriate. + +\section Surface_mesh_simplificationOverview Overview of the Simplification Process + +The free function that implements the simplification algorithm takes not only the surface mesh +and the desired stop predicate but a number of additional parameters which control and +monitor the simplification process. This section briefly describes the process in order +to set the background for the discussion of the parameters to the algorithm. + +There are two slightly different "edge" collapse operations. One is known as +edge-collapse while the other is known as halfedge-collapse. +Given an edge `e` joining vertices `w` and `v`, the edge-collapse operation replaces +`e`,`w` and `v` for a new vertex `r`, while the halfedge-collapse operation +pulls `v` into `w`, dissapearing `e` and leaving `w` in place. +In both cases the operation removes the edge `e` along with the 2 triangles +adjacent to it. + +This package uses the halfedge-collapse operation, which is implemented by removing, +additionally, 1 vertex (`v`) and 2 edges, one per adjacent triangle. +It optionally moves the remaining vertex (`w`) into a new position, +called placement, in which case the net effect is the same as in +the edge-collapse operation. + +Naturally, the surface mesh that results from an edge collapse deviates from the initial +surface mesh by some amount, and since the goal of simplification is to reduce the number +of triangles while retaining the overall look of the surface mesh as much as possible, +it is necessary to measure such a deviation. Some methods attempt to measure the +total deviation from the initial surface mesh to the completely simplified surface mesh, +for example, by tracking an accumulated error while keeping a history of the simplification +changes. Other methods, like the one implemented in this package, attempt to measure only +the cost of each individual edge collapse (the local deviation introduced by +a single simplification step) and plan the entire process as a sequence of steps +of increasing cost. + +Global error tracking methods produce highly accurate simplifications but take up a lot +of additional space. Cost-driven methods, like the one in this package, produce slightly +less accurate simplifications but take up much less additional space, even none in some cases. + +The cost-driven method implemented in this package is mainly based on \cgalCite{cgal:lt-fmeps-98}, \cgalCite{cgal:lt-ems-99}, with contributions from \cgalCite{hddms-mo-93}, \cgalCite{gh-ssqem-97} +and \cgalCite{degn-tpec-98}. + +The algorithm proceeds in two stages. In the first stage, called collection stage, +an initial collapse cost is assigned to each and every edge in the surface mesh. +Then in the second stage, called collapsing stage, edges are +processed in order of increasing cost. Some processed edges are collapsed +while some are just discarded. Collapsed edges are replaced by a vertex and the collapse +cost of all the edges now incident on the replacement vertex is recalculated, affecting +the order of the remaining unprocessed edges. + +Not all edges selected for processing are collapsed. A processed edge can be discarded +right away, without being collapsed, if it does not satisfy certain topological +and geometric conditions. + +The algorithm presented in \cgalCite{gh-ssqem-97} contracts (collapses) arbitrary vertex pairs and not +only edges by considering certain vertex pairs as forming a pseudo-edge and proceeding to collapse +both edges and pseudo-edges in the same way as in \cgalCite{cgal:lt-fmeps-98}, \cgalCite{cgal:lt-ems-99} ( +which is the algorithm implemented here). However, contracting an arbitrary vertex-pair may result in a non-manifold surface mesh, but the current state of this package can only deal with manifold surface meshes, thus, it can only collapse edges. That is, this package cannot be used as a framework for vertex contraction. + +\section Surface_mesh_simplificationCost Cost Strategy + +The specific way in which the collapse cost and vertex placement is +calculated is called the cost strategy. The user can choose +different strategies in the form of policies and related parameters, +passed to the algorithm. + +The current version of the package provides a set of policies implementing +two strategies: the Lindstrom-Turk strategy, which is the default, and +a strategy consisting of an edge-length cost with an optional +midpoint placement (much faster but less accurate). + +\subsection SurfaceMeshSimplificationLindstromTurkStrategy Lindstrom-Turk Cost and Placement Strategy + +The main characteristic of the strategy presented in +\cgalCite{cgal:lt-fmeps-98}, \cgalCite{cgal:lt-ems-99} is that the simplified surface mesh +is not compared at each step with the original surface mesh (or the surface mesh +at a previous step) so there is no need to keep extra information, +such as the original surface mesh or a history of the local changes. Hence +the name memoryless simplification. + +At each step, all remaining edges are potential candidates for +collapsing and the one with the lowest cost is selected. + +The cost of collapsing an edge is given by the position chosen for the +vertex that replaces it. + +The replacement vertex position is computed as +the solution to a system of 3 linearly-independent linear equality constraints. +Each constraint is obtained by minimizing a quadratic objective function +subject to the previously computed constraints. + +There are several possible candidate constraints and each is considered in order of importance. +A candidate constraint might be incompatible with the previously accepted constraints, +in which case it is rejected and the next constraint is considered. + +Once 3 constraints have been accepted, the system is solved for the vertex position. + +The first constraints considered preserves the shape of the surface mesh boundaries +(in case the edge profile has boundary edges). +The next constraints preserve the total volume of the surface mesh. +The next constraints, if needed, optimize the local changes in volume and boundary shape. +Lastly, if a constraint is still needed (because the ones previously computed were incompatible), +a third (and last) constraint is added to favor equilateral triangles over elongated triangles. + +The cost is then a weighted sum of the shape, volume and boundary optimization terms, where the user specifies the unit weighting unit factor for each term. + +The local changes are computed independently for each edge using only +the triangles currently adjacent to it at the time when the edge +is about to be collapsed, that is, after all previous collapses. +Thus, the transitive path of minimal local changes yields at +the end a global change reasonably close to the absolute minimum. + +\subsection Surface_mesh_simplificationCostStrategyPolicies Cost Strategy Policies + +The cost strategy used by the algorithm is selected by means of two policies: +`GetPlacement` and `GetCost`. + +The `GetPlacement` policy is called to compute the new position +for the remaining vertex after the halfedge-collapse. It returns +an optional value, which can be absent, in which case the +remaining vertex is kept in its place. + +The `GetCost` policy is called to compute the cost +of collapsing an edge. This policy uses the placement to compute +the cost (which is an error measure) and determines the +ordering of the edges. + +The algorithm maintains an internal data structure (a mutable priority queue) +which allows each edge to be processed in increasing cost order. Such a data structure +requires some per-edge additional information, such as the edge's cost. +If the record of per-edge additional information occupies N bytes of storage, +simplifying a surface mesh of 1 million edges (a normal size) requires 1 million times N bytes +of additional storage. Thus, to minimize the amount of additional memory required to +simplify a surface mesh only the cost is attached to each edge and nothing else. + +But this is a tradeoff: the cost of a collapse is a function of the placement +(the new position chosen for the remaining vertex) so before `GetCost` +is called for each and every edge, `GetPlacement` must also be called to obtain +the placement parameter to the cost function. +But that placement, which is a 3D Point, is not attached to each and every edge since +that would easily triple the additional storage requirement. + +On the one hand, this dramatically saves on memory but on the other hand is +a processing waste because when an edge is effectively collapsed, `GetPlacement` +must be called again to know were to move the remaining vertex. + +Earlier prototypes shown that attaching the placement to the edge, thus avoiding one +redundant call to the placement function after the edge collapsed, has little +impact on the total running time. This is because the cost of an each edge is not just +computed once but changes several times during the process so the placement function +must be called several times just as well. Caching the placement can only avoid the +very last call, when the edge is collapsed, but not all the previous calls which +are needed because the placement (and cost) changes. + +\section Surface_mesh_simplificationAPI API + +\subsection Surface_mesh_simplificationAPIOverview API Overview + +Since the algorithm is free from robustness issues there is no need for exact predicates nor constructions and `Simple_cartesian` can be used safely. +\cgalFootnote{In the current version, 3.3, the LindstromTurk policies are not implemented for homogeneous coordinates, so a %Cartesian kernel must be used.} + +The simplification algorithm is implemented as the free template function +`Surface_mesh_simplification::edge_collapse()`. The function has two mandatory and several optional parameters. + +\subsection Surface_mesh_simplificationMandatoryParameters Mandatory Parameters + +There are two main parameters to the algorithm: the surface mesh to be simplified (in-place) and the stop predicate. + +The surface mesh to simplify must be a model of the `EdgeCollapsableSurfaceMesh` concept. +Many concrete surface mesh types, such as `Polyhedron_3` with only triangular faces, +become models of that concept via a technique known as +external adaptation, which is described in \cgalCite{cgal:sll-bgl-02} +and this Bgl web page: http://www.boost.org/libs/graph/doc/leda_conversion.html + +External adaptation is a way to add an interface to an +object without coercing the type of the object (which happens when you adapt it by means +of a wrapper). That is, the formal parameter to the `edge_collapse` function that +implements the simplification is the concrete surface mesh object itself, not an adaptor +which delegates the functionality to the concrete type. + +The stop predicate is called after each edge is selected for processing, before +it is classified as collapsible or not (thus before it is collapsed). If the stop predicate +returns `true` the algorithm terminates. + +\subsection Surface_mesh_simplificationOptionalNamed Optional Named Parameters + +The notion of named parameters was also introduced in the Bgl. You can read about it in \cgalCite{cgal:sll-bgl-02} or the following site: http://www.boost.org/libs/graph/doc/bgl_named_params.html. Named parameters allow the user to specify only those parameters which are really needed, by name, making the parameter ordering unimportant. + +Say there is a function `f()` that takes 3 parameters called `name`, `age` and `gender`, and you have variables `n,a and g` to pass as parameters to that function. Without named parameters, you would call it like this: `f(n,a,g)`, but with named parameters, you call it like this: `f(name(n).age(a).gender(g))`. + +That is, you give each parameter a name by wrapping it into a function whose name matches that of the parameter. The entire list of named parameters is really a composition of function calls separated by a dot (\f$ .\f$). Thus, if the function takes a mix of mandatory and named parameters, you use a comma to separate the last non-named parameter from the first named parameters, like this: + +`f(non_named_par0, non_named_pa1, name(n).age(a).gender(g)) ` + +When you use named parameters, the ordering is irrelevant, so this: `f(name(n).age(a).gender(g))` is equivalent to this: +`f(age(a).gender(g).name(n))`, and you can just omit any named parameter that has a default value. + +\subsection Surface_mesh_simplificationSampleCall Sample Call + +\code{.cpp} + +/* +surface_mesh : the surface_mesh to simplify +stop_predicate : policy indicating when the simplification must finish +vertex_index_map(vimap) : property-map giving each vertex a unique integer index +edge_index_map(eimap) : property-map giving each edge a unique integer index +edge_is_border_map(ebmap): property-map specifying whether an edge is a border edge or not +get_cost(cf) : function object computing the cost of a collapse +get_placement(pf) : function object computing the placement for the remaining vertex +visitor(vis) : function object tracking the simplification process +*/ + +int r = edge_collapse(surface_mesh + ,stop_predicate + ,vertex_index_map(vimap) + .edge_index_map(eimap) + .edge_is_border_map(ebmap) + .get_cost(cf) + .get_placement(pf) + .visitor(vis) + ); + +\endcode + +\subsection Surface_mesh_simplificationExamples Examples + +\subsection Surface_mesh_simplificationExampleUsinga Example Using a Default Polyhedron + +The following example illustrates the simplest of the cases. It uses +an ordinary polyhedron and only one of the optional parameters. +The unspecified cost strategy defaults to Lindstrom-Turk. +\cgalExample{Surface_mesh_simplification/edge_collapse_polyhedron.cpp} + +\subsection Surface_mesh_simplificationExampleUsingan Example Using an Enriched Polyhedron + +The following example is equivalent to the previous example but using an +enriched polyhedron whose halfedges support an `id` field to +store the edge index needed by the algorithm. It also shows how to +explicitly specify a cost strategy (other than the default) +and how to use a visitor object to track the simplification process. + +\cgalExample{Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp} + +\subsection Surface_mesh_simplificationExamplewithedges Example with Edges Marked as Non-Removable + +The following examples show how to use the optional named parameter `edge_is_constrained_map` to prevent +edges from being removed. Edges marked as contrained are guaranteed to be in the final surface mesh. However, +the vertices of the constrained edges may change and the placement may change the points. +The wrapper `CGAL::Constrained_placement` guarantees that these points are not changed. + +\cgalExample{Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp} + +*/ +} /* namespace CGAL */ + diff --git a/Reconstruction_simplification_2/doc/dependencies b/Reconstruction_simplification_2/doc/dependencies new file mode 100644 index 00000000000..3b9c6bbe266 --- /dev/null +++ b/Reconstruction_simplification_2/doc/dependencies @@ -0,0 +1,3 @@ +Manual +Kernel_23 +STL_Extension \ No newline at end of file diff --git a/Reconstruction_simplification_2/include/CGAL/Cost.h b/Reconstruction_simplification_2/include/CGAL/Cost.h index 7a810be66e8..980bd102c79 100644 --- a/Reconstruction_simplification_2/include/CGAL/Cost.h +++ b/Reconstruction_simplification_2/include/CGAL/Cost.h @@ -1,3 +1,23 @@ +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// + +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Fernando de Goes, Pierre Alliez + #ifndef COST_H_ #define COST_H_ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index ff05b931df4..10951df8121 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -1,6 +1,7 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. // All rights reserved. // + // This file is part of CGAL (www.cgal.org). // You can redistribute it and/or modify it under the terms of the GNU // General Public License as published by the Free Software Foundation, @@ -15,7 +16,7 @@ // $URL$ // $Id$ // -// Author(s) : TODO: WHO? and Ivo Vigan +// Author(s) : Fernando de Goes, Pierre Alliez #ifndef RECONSTRUCTION_EDGE_2_H_ #define RECONSTRUCTION_EDGE_2_H_ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index a9b8c93628a..f9a4ac2267d 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -1,3 +1,23 @@ +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// + +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Fernando de Goes, Pierre Alliez + #ifndef RECONSTRUCTION_FACE_BASE_2_H_ #define RECONSTRUCTION_FACE_BASE_2_H_ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 85fe3fec3c6..ab82f48f8d6 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. // All rights reserved. // // This file is part of CGAL (www.cgal.org). @@ -15,7 +15,7 @@ // $URL$ // $Id$ // -// Author(s) : Fernando de Goes and Ivo Vigan +// Author(s) : Fernando de Goes, Pierre Alliez, Ivo Vigan #ifndef RECONSTRUCTION_SIMPLIFICATION_2_H_ #define RECONSTRUCTION_SIMPLIFICATION_2_H_ @@ -43,15 +43,54 @@ namespace CGAL { + +/*! +\ingroup Reconstruction_simplification_2 + +\brief The class `Reconstruction_simplification_2` is the base class +designed to execute the reconstruction and simplification tasks. + +\details This class takes as input a collection of point-mass pairs $. + + +\tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. + +\tparam InputIterator is the iterator type of the algorithm input. + +\tparam PointPMap is a PropertyMap for accessing the input points. + +\tparam MassPMap is a PropertyMap for accessing the input points' + mass information. + + */ template class Reconstruction_simplification_2 { public: + + /// \name Types + /// @{ + + /*! + Number type. + */ typedef typename Kernel::FT FT; + + /*! + Point type. + */ typedef typename Kernel::Point_2 Point; + /*! + Vector type. + */ typedef typename Kernel::Vector_2 Vector; + /*! + The Output simplex. + */ typedef Reconstruction_triangulation_2 Triangulation; + /// @} + typedef typename Triangulation::Vertex Vertex; typedef typename Triangulation::Vertex_handle Vertex_handle; typedef typename Triangulation::Vertex_iterator Vertex_iterator; @@ -96,6 +135,7 @@ public: typedef typename Triangulation::MultiIndex MultiIndex; + protected: Triangulation m_dt; MultiIndex m_mindex; @@ -120,8 +160,19 @@ protected: MassPMap mass_pmap; -public: + // Public methods + public: + /// \name Creation + /// @{ + + /*! + \Instantiates a new Reconstruction_simplification_2. + + \details This function is a convenience function for people who do not feel comfortable with circulators. + + \tparam OutputIterator must be a model of `CopyConstructible`. + */ Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, PointPMap in_point_pmap, @@ -137,7 +188,7 @@ public: initialize_parameters(); } - + /// \cond SKIP_IN_MANUAL Reconstruction_simplification_2() { initialize_parameters(); } @@ -147,6 +198,8 @@ public: clear(); } + /// @} + void initialize_parameters() { @@ -184,6 +237,14 @@ public: } + /*! + First function to be called after instantiating a new + Reconstruction_simplification_2 object. + It computes an bounding box around the input points and creates an first + (fine) output simplex as well as an initial transportation plan. + + \param steps The number of edge contractions performed by the algorithm. + */ void initialize() { clear(); @@ -289,6 +350,7 @@ public: std::cout << "---------------------------------------------------" << std::endl; } + /// \cond SKIP_IN_MANUAL void normalize_points() { //noise(1e-5); TODO IV, killed that noise @@ -307,7 +369,7 @@ public: m_bbox_size = 1.0; } - + /// \cond SKIP_IN_MANUAL void compute_bbox(double &x, double &y, double &scale) { @@ -470,6 +532,13 @@ public: // RECONSTRUCTION // + /*! + This function must be called after initialization(). + It computes a shape consisting of nv vertices, reconstructing the input + points. + + \param nv The number of vertices which will be present in the output. + */ void reconstruct_until(const unsigned nv) { double timer = clock(); std::cerr << yellow << "reconstruct until " << white << nv << " V"; @@ -489,6 +558,13 @@ public: << std::endl; } + /*! + This function must be called after initialization(). + It computes a shape, reconstructing the input, by performing steps many + edge contractions on the output simplex. + + \param steps The number of edge contractions performed by the algorithm. + */ void reconstruct(const unsigned steps) { double timer = clock(); std::cerr << yellow << "reconstruct " << steps << white; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index bad2352c4ba..b4d7bed2ca1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -1,6 +1,7 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. // All rights reserved. // + // This file is part of CGAL (www.cgal.org). // You can redistribute it and/or modify it under the terms of the GNU // General Public License as published by the Free Software Foundation, @@ -15,7 +16,7 @@ // $URL$ // $Id$ // -// Author(s) : Fernando de Goes and Ivo Vigan +// Author(s) : Fernando de Goes, Pierre Alliez, Ivo Vigan #ifndef RECONSTRUCTION_TRIANGULATION_2_H #define RECONSTRUCTION_TRIANGULATION_2_H @@ -54,12 +55,20 @@ namespace CGAL { -/// The Reconstruction_triangulation_2 class -// (corresponding to Triangulation in prototype) -/// provides the reconstruction simplex as well as the transportation plan. + +/// \internal +/// The Reconstruction_triangulation_2 class +/// provides the reconstruction simplex as well as the transportation plan. +/// - Each vertex stores a normal vector. +/// - A vertex a Sample which got assinged to it by the transportation plan, +/// well as the corresponding relocated Point (of type Kernel::Point_2). +/// - In order to solve a linear system over the triangulation, a vertex may be constrained +/// or not (i.e. may contribute to the right or left member of the linear system), +/// and has a unique index. +/// The vertex class must derive from Reconstruction_vertex_base_3. /// -/// @param Kernel The underlying Kernel -/// @param Tds Model of TriangulationDataStructure_2. +/// @param Kernel The underlying Kernel +/// @param Tds Model of TriangulationDataStructure_2. /// The vertex class must derive from Reconstruction_vertex_base_2. /// The face class must derive from Reconstruction_face_base_2. template /// The Reconstruction_vertex_base_2 class (corresponding to -//Reconstruction_vertex_base_2 in prototype) is the default +/// Reconstruction_vertex_base_2 in prototype) is the default /// vertex class of the Reconstruction_triangulation_2 class. /// /// - Each vertex stores a CSample as well as the corresponding relocated point diff --git a/Reconstruction_simplification_2/include/CGAL/Sample.h b/Reconstruction_simplification_2/include/CGAL/Sample.h index d74f49cde88..8dff82a774b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Sample.h +++ b/Reconstruction_simplification_2/include/CGAL/Sample.h @@ -1,6 +1,28 @@ +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Fernando de Goes, Pierre Alliez + #ifndef SAMPLE_H #define SAMPLE_H + +/// \cond SKIP_IN_MANUAL + template class Sample { diff --git a/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/copyright b/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/copyright new file mode 100644 index 00000000000..8932b3233d2 --- /dev/null +++ b/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/copyright @@ -0,0 +1,2 @@ +INRIA Sophia-Antipolis (France) + diff --git a/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/description.txt b/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/description.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/license.txt b/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/license.txt new file mode 100644 index 00000000000..8bb8efcb72b --- /dev/null +++ b/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/license.txt @@ -0,0 +1 @@ +GPL (v3 or later) diff --git a/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/maintainer b/Reconstruction_simplification_2/package_info/Reconstruction_simplification_2/maintainer new file mode 100644 index 00000000000..e69de29bb2d From a45efccde219da568b3ab20077603c18bde979b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 3 Jul 2014 21:48:13 +0200 Subject: [PATCH 018/201] make the doc compilable --- Documentation/doc/Documentation/dependencies | 2 +- .../doc/{ => Reconstruction_simplification_2}/Doxyfile.in | 0 .../PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt} | 0 .../doc/{ => Reconstruction_simplification_2}/dependencies | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename Reconstruction_simplification_2/doc/{ => Reconstruction_simplification_2}/Doxyfile.in (100%) rename Reconstruction_simplification_2/doc/{ => Reconstruction_simplification_2}/PackageDescription.txt (97%) rename Reconstruction_simplification_2/doc/{Reconstruction_Simplification_2 => Reconstruction_simplification_2/Reconstruction_Simplification_2.txt} (100%) rename Reconstruction_simplification_2/doc/{ => Reconstruction_simplification_2}/dependencies (100%) diff --git a/Documentation/doc/Documentation/dependencies b/Documentation/doc/Documentation/dependencies index ce7a9766654..eb176cdff8f 100644 --- a/Documentation/doc/Documentation/dependencies +++ b/Documentation/doc/Documentation/dependencies @@ -71,7 +71,7 @@ Spatial_searching Spatial_sorting Segment_Delaunay_graph_2 Straight_skeleton_2 -Reconstruction_Simplification_2 +Reconstruction_simplification_2 Voronoi_diagram_2 Surface_mesh_simplification Subdivision_method_3 diff --git a/Reconstruction_simplification_2/doc/Doxyfile.in b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Doxyfile.in similarity index 100% rename from Reconstruction_simplification_2/doc/Doxyfile.in rename to Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Doxyfile.in diff --git a/Reconstruction_simplification_2/doc/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt similarity index 97% rename from Reconstruction_simplification_2/doc/PackageDescription.txt rename to Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 1b33d4f63e3..7b7aab03fd2 100644 --- a/Reconstruction_simplification_2/doc/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -17,7 +17,7 @@ \cgalPkgDependsOn{\ref PkgPolyhedronSummary} \cgalPkgBib{cgal:c-tsms-12} \cgalPkgLicense{\ref licensesGPL "GPL"} -\cgalPkgDemo{XXXX.zip} +\cgalPkgDemo{XXX, XXXX.zip} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd diff --git a/Reconstruction_simplification_2/doc/Reconstruction_Simplification_2 b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt similarity index 100% rename from Reconstruction_simplification_2/doc/Reconstruction_Simplification_2 rename to Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt diff --git a/Reconstruction_simplification_2/doc/dependencies b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/dependencies similarity index 100% rename from Reconstruction_simplification_2/doc/dependencies rename to Reconstruction_simplification_2/doc/Reconstruction_simplification_2/dependencies From 0867475830b3b6e9e1a9b76078faf7f4376caafb Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 4 Jul 2014 18:00:19 +0200 Subject: [PATCH 019/201] Set up the documentation environment --- Documentation/biblio/cgal_manual.bib | 14 + Documentation/how_to_cite_cgal.bib | 10 + .../PackageDescription.txt | 13 +- .../Reconstruction_Simplification_2.txt | 246 ++---------------- .../CGAL/Reconstruction_simplification_2.h | 4 +- 5 files changed, 60 insertions(+), 227 deletions(-) diff --git a/Documentation/biblio/cgal_manual.bib b/Documentation/biblio/cgal_manual.bib index 2285b00840a..8dcac2ac1cf 100644 --- a/Documentation/biblio/cgal_manual.bib +++ b/Documentation/biblio/cgal_manual.bib @@ -2335,6 +2335,20 @@ ADDRESS = "Saarbr{\"u}cken, Germany" series = {Texts and Monographs in Symbolic Computation} } + +@article{degoes:hal-00758019, + title = {{An Optimal Transport Approach to Robust Reconstruction and Simplification of 2D Shapes}}, + author = {De Goes, Fernando and Cohen-Steiner, David and Alliez, Pierre and Desbrun, Mathieu}, + booktitle = {{Eurographics Symposium on Geometry Processing 2011}}, + publisher = {Wiley}, + pages = {1593-1602}, + journal = {Computer Graphics Forum}, + volume = {30}, + number = {5 }, + year = {2011}, +} + + % ---------------------------------------------------------------------------- % END OF BIBFILE % ---------------------------------------------------------------------------- diff --git a/Documentation/how_to_cite_cgal.bib b/Documentation/how_to_cite_cgal.bib index f854b88ac17..e97f1f449dc 100644 --- a/Documentation/how_to_cite_cgal.bib +++ b/Documentation/how_to_cite_cgal.bib @@ -798,3 +798,13 @@ , url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:CGALIpelets" , year = 2012 } + + +@incollection{cgal:rec-simp2-14x +, author = " Fernando de Goes and Pierre Alliez and Ivo Vigan" +, title = "{2D} Reconstruction Simplification" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.4}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://www.cgal.org/Manual/4.1/doc_html/cgal_manual/packages.html#Pkg:ReconstructionSimplification2" +, year = 2014 diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 7b7aab03fd2..f1052555d0e 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -5,19 +5,18 @@ \addtogroup PkgReconstructionSimplification2 \todo check generated documentation \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} -\cgalPkgPicture{xxx.png} +\cgalPkgPicture{overview.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{ Fernando de Goes, Ivo Vigan} -\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane using a transportation theory approach to match the input point with an output simplex.} +\cgalPkgAuthor{ Fernando de Goes, Pierre Alliez, Ivo Vigan} +\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine to coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.x} -\cgalPkgDependsOn{\ref PkgBGLSummary} -\cgalPkgDependsOn{\ref PkgPolyhedronSummary} -\cgalPkgBib{cgal:c-tsms-12} +\cgalPkgDependsOn{\ref PkgTriangulation2} +\cgalPkgBib{cgal:rec-simp2-14x} \cgalPkgLicense{\ref licensesGPL "GPL"} -\cgalPkgDemo{XXX, XXXX.zip} +\cgalPkgDemo{XXXX.zip} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 733ecbf30bb..9da4ed8b34d 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -3,24 +3,23 @@ namespace CGAL { \mainpage User Manual \anchor Chapter_2D_Reconstruction_Simplification - \cgalAutoToc -\authors Fernando de Goes, Ivo Vigan +\authors Fernando de Goes, Pierre Alliez, Ivo Vigan -\image html process.png -\image latex process.png +\image html overview.png +\image latex overview.png -\section D_Reconstruction_SimplificationIntroduction Introduction +\section 2D_Reconstruction_SimplificationIntroduction Introduction -\cgalFigureBegin{Surface_reconstruction_points_3figintroduction,process.png} +\cgalFigureBegin{2D_Reconstruction_Simplification_process,process.png} From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. \cgalFigureEnd -The task addressed here is to reconstruct a shape from a noisy point set S in R^2, i.e. give a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. +The task addressed here is to reconstruct a shape from a noisy point set S in $R^2$, i.e. give a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. -The algorithm presented here performs the reconstruction and simplification task jointly using a unifies ed framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm (\cgalCite{degoes:hal-00758019}) presented here performs the reconstruction and simplification task jointly using a unifies ed framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. The algorithm can be summarized as: "Considering S as a measure mu consisting of Dirac masses, find a coarse simplicial complex T such that mu is well approximated by a linear combination of uniform measures on the edges and vertices of T." @@ -36,53 +35,9 @@ After that, edges which carry little mass can be filtered out. +\section 2D_Reconstruction_SimplificationOverview Overview of the Reconstruction Process - - -can simplify any oriented 2-manifold surface, -with any number of connected components, with or without boundaries (border or holes) -and handles (arbitrary genus), using a method known as edge collapse. -Roughly speaking, the method consists of iteratively replacing an edge with a single vertex, -removing 2 triangles per collapse. - -Edges are collapsed according to a priority given by a user-supplied cost function, -and the coordinates of the replacing vertex are determined by another user-supplied -placement function. The algorithm terminates when a user-supplied stop predicate -is met, such as reaching the desired number of edges. - -The algorithm implemented here is generic in the sense that it does not require the surface mesh -to be of a particular type. Instead, it defines the concept of a `EdgeCollapsableSurfaceMesh`, -which presents the surface mesh as being a halfedge data structure, and any surface mesh that -is a model of that concept can be simplified. The concept is defined not in terms of a monolithic class, but in terms of a set -of functions and traits, making it easy to adapt any concrete surface mesh type, -even if it is not a halfedge data structure at all. -In particular, the concept definition follows the design of the - Boost Graph Library (Bgl) -\cgalCite{cgal:sll-bgl-02}. - -The design is policy-based -(http://en.wikipedia.org/wiki/Policy-based_design), -meaning that you can customize some aspects of the process by passing a set of -policy objects. Each policy object specifies a particular aspect of the algorithm, -such as how edges are selected and where the replacement vertex is placed. All policies have -a sensible default. -Furthermore, the API uses the so-called `named-parameters` technique which allows you -to pass only the relevant parameters, in any order, omitting those parameters whose -default is appropriate. - -\section Surface_mesh_simplificationOverview Overview of the Simplification Process - -The free function that implements the simplification algorithm takes not only the surface mesh -and the desired stop predicate but a number of additional parameters which control and -monitor the simplification process. This section briefly describes the process in order -to set the background for the discussion of the parameters to the algorithm. - -There are two slightly different "edge" collapse operations. One is known as -edge-collapse while the other is known as halfedge-collapse. -Given an edge `e` joining vertices `w` and `v`, the edge-collapse operation replaces -`e`,`w` and `v` for a new vertex `r`, while the halfedge-collapse operation -pulls `v` into `w`, dissapearing `e` and leaving `w` in place. -In both cases the operation removes the edge `e` along with the 2 triangles +The task addressed is to reconstruct a shape from noisy data $S$ in $R^2$, i.e. give a (noisy) set of points, find a shape which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. While previous works address these two issues sequentially, they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set M of n sources and a set F of n targets (both can for example be pointsets in R^2). Given a cost function c : R^2 x R^2 -> R^+, the goal is to find a bijection between M and F such that the sum of the costs c gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. Given this theoretical background the algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached.In both cases the operation removes the edge `e` along with the 2 triangles adjacent to it. This package uses the halfedge-collapse operation, which is implemented by removing, @@ -91,137 +46,11 @@ It optionally moves the remaining vertex (`w`) into a new position, called placement, in which case the net effect is the same as in the edge-collapse operation. -Naturally, the surface mesh that results from an edge collapse deviates from the initial -surface mesh by some amount, and since the goal of simplification is to reduce the number -of triangles while retaining the overall look of the surface mesh as much as possible, -it is necessary to measure such a deviation. Some methods attempt to measure the -total deviation from the initial surface mesh to the completely simplified surface mesh, -for example, by tracking an accumulated error while keeping a history of the simplification -changes. Other methods, like the one implemented in this package, attempt to measure only -the cost of each individual edge collapse (the local deviation introduced by -a single simplification step) and plan the entire process as a sequence of steps -of increasing cost. -Global error tracking methods produce highly accurate simplifications but take up a lot -of additional space. Cost-driven methods, like the one in this package, produce slightly -less accurate simplifications but take up much less additional space, even none in some cases. +\section 2D_Reconstruction_SimplificationTrans Transportation Cost -The cost-driven method implemented in this package is mainly based on \cgalCite{cgal:lt-fmeps-98}, \cgalCite{cgal:lt-ems-99}, with contributions from \cgalCite{hddms-mo-93}, \cgalCite{gh-ssqem-97} -and \cgalCite{degn-tpec-98}. -The algorithm proceeds in two stages. In the first stage, called collection stage, -an initial collapse cost is assigned to each and every edge in the surface mesh. -Then in the second stage, called collapsing stage, edges are -processed in order of increasing cost. Some processed edges are collapsed -while some are just discarded. Collapsed edges are replaced by a vertex and the collapse -cost of all the edges now incident on the replacement vertex is recalculated, affecting -the order of the remaining unprocessed edges. - -Not all edges selected for processing are collapsed. A processed edge can be discarded -right away, without being collapsed, if it does not satisfy certain topological -and geometric conditions. - -The algorithm presented in \cgalCite{gh-ssqem-97} contracts (collapses) arbitrary vertex pairs and not -only edges by considering certain vertex pairs as forming a pseudo-edge and proceeding to collapse -both edges and pseudo-edges in the same way as in \cgalCite{cgal:lt-fmeps-98}, \cgalCite{cgal:lt-ems-99} ( -which is the algorithm implemented here). However, contracting an arbitrary vertex-pair may result in a non-manifold surface mesh, but the current state of this package can only deal with manifold surface meshes, thus, it can only collapse edges. That is, this package cannot be used as a framework for vertex contraction. - -\section Surface_mesh_simplificationCost Cost Strategy - -The specific way in which the collapse cost and vertex placement is -calculated is called the cost strategy. The user can choose -different strategies in the form of policies and related parameters, -passed to the algorithm. - -The current version of the package provides a set of policies implementing -two strategies: the Lindstrom-Turk strategy, which is the default, and -a strategy consisting of an edge-length cost with an optional -midpoint placement (much faster but less accurate). - -\subsection SurfaceMeshSimplificationLindstromTurkStrategy Lindstrom-Turk Cost and Placement Strategy - -The main characteristic of the strategy presented in -\cgalCite{cgal:lt-fmeps-98}, \cgalCite{cgal:lt-ems-99} is that the simplified surface mesh -is not compared at each step with the original surface mesh (or the surface mesh -at a previous step) so there is no need to keep extra information, -such as the original surface mesh or a history of the local changes. Hence -the name memoryless simplification. - -At each step, all remaining edges are potential candidates for -collapsing and the one with the lowest cost is selected. - -The cost of collapsing an edge is given by the position chosen for the -vertex that replaces it. - -The replacement vertex position is computed as -the solution to a system of 3 linearly-independent linear equality constraints. -Each constraint is obtained by minimizing a quadratic objective function -subject to the previously computed constraints. - -There are several possible candidate constraints and each is considered in order of importance. -A candidate constraint might be incompatible with the previously accepted constraints, -in which case it is rejected and the next constraint is considered. - -Once 3 constraints have been accepted, the system is solved for the vertex position. - -The first constraints considered preserves the shape of the surface mesh boundaries -(in case the edge profile has boundary edges). -The next constraints preserve the total volume of the surface mesh. -The next constraints, if needed, optimize the local changes in volume and boundary shape. -Lastly, if a constraint is still needed (because the ones previously computed were incompatible), -a third (and last) constraint is added to favor equilateral triangles over elongated triangles. - -The cost is then a weighted sum of the shape, volume and boundary optimization terms, where the user specifies the unit weighting unit factor for each term. - -The local changes are computed independently for each edge using only -the triangles currently adjacent to it at the time when the edge -is about to be collapsed, that is, after all previous collapses. -Thus, the transitive path of minimal local changes yields at -the end a global change reasonably close to the absolute minimum. - -\subsection Surface_mesh_simplificationCostStrategyPolicies Cost Strategy Policies - -The cost strategy used by the algorithm is selected by means of two policies: -`GetPlacement` and `GetCost`. - -The `GetPlacement` policy is called to compute the new position -for the remaining vertex after the halfedge-collapse. It returns -an optional value, which can be absent, in which case the -remaining vertex is kept in its place. - -The `GetCost` policy is called to compute the cost -of collapsing an edge. This policy uses the placement to compute -the cost (which is an error measure) and determines the -ordering of the edges. - -The algorithm maintains an internal data structure (a mutable priority queue) -which allows each edge to be processed in increasing cost order. Such a data structure -requires some per-edge additional information, such as the edge's cost. -If the record of per-edge additional information occupies N bytes of storage, -simplifying a surface mesh of 1 million edges (a normal size) requires 1 million times N bytes -of additional storage. Thus, to minimize the amount of additional memory required to -simplify a surface mesh only the cost is attached to each edge and nothing else. - -But this is a tradeoff: the cost of a collapse is a function of the placement -(the new position chosen for the remaining vertex) so before `GetCost` -is called for each and every edge, `GetPlacement` must also be called to obtain -the placement parameter to the cost function. -But that placement, which is a 3D Point, is not attached to each and every edge since -that would easily triple the additional storage requirement. - -On the one hand, this dramatically saves on memory but on the other hand is -a processing waste because when an edge is effectively collapsed, `GetPlacement` -must be called again to know were to move the remaining vertex. - -Earlier prototypes shown that attaching the placement to the edge, thus avoiding one -redundant call to the placement function after the edge collapsed, has little -impact on the total running time. This is because the cost of an each edge is not just -computed once but changes several times during the process so the placement function -must be called several times just as well. Caching the placement can only avoid the -very last call, when the edge is collapsed, but not all the previous calls which -are needed because the placement (and cost) changes. - -\section Surface_mesh_simplificationAPI API +\section 2D_Reconstruction_SimplificationAPI API \subsection Surface_mesh_simplificationAPIOverview API Overview @@ -264,60 +93,39 @@ That is, you give each parameter a name by wrapping it into a function whose nam When you use named parameters, the ordering is irrelevant, so this: `f(name(n).age(a).gender(g))` is equivalent to this: `f(age(a).gender(g).name(n))`, and you can just omit any named parameter that has a default value. -\subsection Surface_mesh_simplificationSampleCall Sample Call +\subsection 2D_Reconstruction_SimplificationSample Sample Call \code{.cpp} /* -surface_mesh : the surface_mesh to simplify -stop_predicate : policy indicating when the simplification must finish -vertex_index_map(vimap) : property-map giving each vertex a unique integer index -edge_index_map(eimap) : property-map giving each edge a unique integer index -edge_is_border_map(ebmap): property-map specifying whether an edge is a border edge or not -get_cost(cf) : function object computing the cost of a collapse -get_placement(pf) : function object computing the placement for the remaining vertex -visitor(vis) : function object tracking the simplification process +K : Kernel is the geometric kernel, used for the reconstruction and simplification task. +InputIterator : InputIterator is the iterator type of the algorithm input. +PointPMap : is a PropertyMap for accessing the input points. +MassPMap : MassPMap is a PropertyMap for accessing the input points' */ -int r = edge_collapse(surface_mesh - ,stop_predicate - ,vertex_index_map(vimap) - .edge_index_map(eimap) - .edge_is_border_map(ebmap) - .get_cost(cf) - .get_placement(pf) - .visitor(vis) - ); + +Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.initialize(); + + rs2.reconstruct(100); + + rs2.extract_solid_eges(); \endcode -\subsection Surface_mesh_simplificationExamples Examples +\subsection 2D_Reconstruction_SimplificationExamples Examples -\subsection Surface_mesh_simplificationExampleUsinga Example Using a Default Polyhedron +\subsection 2D_Reconstruction_SimplificationExampleSimple Simple reconstruction Example The following example illustrates the simplest of the cases. It uses an ordinary polyhedron and only one of the optional parameters. The unspecified cost strategy defaults to Lindstrom-Turk. \cgalExample{Surface_mesh_simplification/edge_collapse_polyhedron.cpp} -\subsection Surface_mesh_simplificationExampleUsingan Example Using an Enriched Polyhedron -The following example is equivalent to the previous example but using an -enriched polyhedron whose halfedges support an `id` field to -store the edge index needed by the algorithm. It also shows how to -explicitly specify a cost strategy (other than the default) -and how to use a visitor object to track the simplification process. - -\cgalExample{Surface_mesh_simplification/edge_collapse_enriched_polyhedron.cpp} - -\subsection Surface_mesh_simplificationExamplewithedges Example with Edges Marked as Non-Removable - -The following examples show how to use the optional named parameter `edge_is_constrained_map` to prevent -edges from being removed. Edges marked as contrained are guaranteed to be in the final surface mesh. However, -the vertices of the constrained edges may change and the placement may change the points. -The wrapper `CGAL::Constrained_placement` guarantees that these points are not changed. - -\cgalExample{Surface_mesh_simplification/edge_collapse_constrained_border_polyhedron.cpp} */ } /* namespace CGAL */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ab82f48f8d6..01d36491244 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -45,7 +45,9 @@ namespace CGAL { /*! -\ingroup Reconstruction_simplification_2 +\ingroup PkgReconstructionSimplification2 + + \brief The class `Reconstruction_simplification_2` is the base class designed to execute the reconstruction and simplification tasks. From f27b99d053f5feb4e7871ae605149253c7625b7e Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 7 Jul 2014 13:36:07 +0200 Subject: [PATCH 020/201] Documentation WIP --- .../PackageDescription.txt | 10 +-- .../Reconstruction_Simplification_2.txt | 72 ++++++------------- .../CGAL/Reconstruction_simplification_2.h | 11 +-- 3 files changed, 30 insertions(+), 63 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index f1052555d0e..da888c3e4d7 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -1,13 +1,10 @@ /// \defgroup PkgReconstructionSimplification2 2D Reconstruction Simplification Reference -/// \defgroup PkgReconstructionSimplification2Concepts Concepts -/// \ingroup PkgReconstructionSimplification2 /*! \addtogroup PkgReconstructionSimplification2 -\todo check generated documentation \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} \cgalPkgPicture{overview.png} -\cgalPkgSummaryBegin -\cgalPkgAuthor{ Fernando de Goes, Pierre Alliez, Ivo Vigan} +\cgalPkgSummaryBegin +\cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan} \cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine to coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd @@ -16,7 +13,6 @@ \cgalPkgDependsOn{\ref PkgTriangulation2} \cgalPkgBib{cgal:rec-simp2-14x} \cgalPkgLicense{\ref licensesGPL "GPL"} -\cgalPkgDemo{XXXX.zip} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd @@ -28,7 +24,7 @@ ## Classes ## -- `CGAL::Reconstruction_simplification_2 +- `CGAL::Reconstruction_simplification_2` */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 9da4ed8b34d..d9ba214bbe1 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -1,7 +1,7 @@ namespace CGAL { /*! -\mainpage User Manual +\mainpage 2D Reconstruction Simplification \anchor Chapter_2D_Reconstruction_Simplification \cgalAutoToc @@ -25,7 +25,7 @@ The algorithm can be summarized as: "Considering S as a measure mu consisting of It performs a course to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan T \ e. -The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then peramnetly assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. +The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. This sequence of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users has been reached. @@ -37,61 +37,31 @@ After that, edges which carry little mass can be filtered out. \section 2D_Reconstruction_SimplificationOverview Overview of the Reconstruction Process -The task addressed is to reconstruct a shape from noisy data $S$ in $R^2$, i.e. give a (noisy) set of points, find a shape which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. While previous works address these two issues sequentially, they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set M of n sources and a set F of n targets (both can for example be pointsets in R^2). Given a cost function c : R^2 x R^2 -> R^+, the goal is to find a bijection between M and F such that the sum of the costs c gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. Given this theoretical background the algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached.In both cases the operation removes the edge `e` along with the 2 triangles -adjacent to it. - -This package uses the halfedge-collapse operation, which is implemented by removing, -additionally, 1 vertex (`v`) and 2 edges, one per adjacent triangle. -It optionally moves the remaining vertex (`w`) into a new position, -called placement, in which case the net effect is the same as in -the edge-collapse operation. +The task addressed is to reconstruct a shape from noisy data $S$ in $R^2$, i.e. give a (noisy) set of points, find a shape which best approximates the non-noise subset of $S$. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. While previous works address these two issues sequentially, they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set M of n sources and a set $F$ of n targets (both can for example be point sets in $R^2$). Given a cost function $c : R^2 x R^2 -> R^+$, the goal is to find a bijection between M and F such that the sum of the costs c gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. Given this theoretical background the algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached. + + +\section 2D_Reconstruction_SimplificationTrans Optimal Transport Formulation + +The quality of an output simplex is measured as the total transportation cost of the input to the assigned simplex vertices and edges. +For the transportation cost, the 2-Wasserstein metric is chosen which is also known the Earth Mover Distance, and intuitively +corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, where the cost is measures as the $L_2$ distances. + +\subsection 2D_Reconstruction_SimplificationTransCost Transportation Plan & Cost from Points to Simplices + +Assuming that the algorithm is given an output simplex $T$, and a point-to-simplex assignment which maps every input point to either an edge or a vertex of $T$, +the total transportation cost is then computed using the following rules. For a point to vertex assignment, the cost is simply the sum of the weighted $L_2$-distances of all the points +assigned to the given vertex. + +For an edge of the simplex, the optimal plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. TODO: CONTINUE + -\section 2D_Reconstruction_SimplificationTrans Transportation Cost \section 2D_Reconstruction_SimplificationAPI API -\subsection Surface_mesh_simplificationAPIOverview API Overview - -Since the algorithm is free from robustness issues there is no need for exact predicates nor constructions and `Simple_cartesian` can be used safely. -\cgalFootnote{In the current version, 3.3, the LindstromTurk policies are not implemented for homogeneous coordinates, so a %Cartesian kernel must be used.} - -The simplification algorithm is implemented as the free template function -`Surface_mesh_simplification::edge_collapse()`. The function has two mandatory and several optional parameters. - -\subsection Surface_mesh_simplificationMandatoryParameters Mandatory Parameters - -There are two main parameters to the algorithm: the surface mesh to be simplified (in-place) and the stop predicate. - -The surface mesh to simplify must be a model of the `EdgeCollapsableSurfaceMesh` concept. -Many concrete surface mesh types, such as `Polyhedron_3` with only triangular faces, -become models of that concept via a technique known as -external adaptation, which is described in \cgalCite{cgal:sll-bgl-02} -and this Bgl web page: http://www.boost.org/libs/graph/doc/leda_conversion.html - -External adaptation is a way to add an interface to an -object without coercing the type of the object (which happens when you adapt it by means -of a wrapper). That is, the formal parameter to the `edge_collapse` function that -implements the simplification is the concrete surface mesh object itself, not an adaptor -which delegates the functionality to the concrete type. - -The stop predicate is called after each edge is selected for processing, before -it is classified as collapsible or not (thus before it is collapsed). If the stop predicate -returns `true` the algorithm terminates. - -\subsection Surface_mesh_simplificationOptionalNamed Optional Named Parameters - -The notion of named parameters was also introduced in the Bgl. You can read about it in \cgalCite{cgal:sll-bgl-02} or the following site: http://www.boost.org/libs/graph/doc/bgl_named_params.html. Named parameters allow the user to specify only those parameters which are really needed, by name, making the parameter ordering unimportant. - -Say there is a function `f()` that takes 3 parameters called `name`, `age` and `gender`, and you have variables `n,a and g` to pass as parameters to that function. Without named parameters, you would call it like this: `f(n,a,g)`, but with named parameters, you call it like this: `f(name(n).age(a).gender(g))`. - -That is, you give each parameter a name by wrapping it into a function whose name matches that of the parameter. The entire list of named parameters is really a composition of function calls separated by a dot (\f$ .\f$). Thus, if the function takes a mix of mandatory and named parameters, you use a comma to separate the last non-named parameter from the first named parameters, like this: - -`f(non_named_par0, non_named_pa1, name(n).age(a).gender(g)) ` - -When you use named parameters, the ordering is irrelevant, so this: `f(name(n).age(a).gender(g))` is equivalent to this: -`f(age(a).gender(g).name(n))`, and you can just omit any named parameter that has a default value. +The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class +exposed to the user is the Reconstruction_simplification_2 class. \subsection 2D_Reconstruction_SimplificationSample Sample Call diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 01d36491244..d35918c16b2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -52,17 +52,18 @@ namespace CGAL { \brief The class `Reconstruction_simplification_2` is the base class designed to execute the reconstruction and simplification tasks. -\details This class takes as input a collection of point-mass pairs $. +\details This class takes as input a collection of point-mass pairs, where both +the points and their masses are accessed using PropertyMaps. -\tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. +\tparam Kernel is the geometric kernel, used for the reconstruction and + simplification task. \tparam InputIterator is the iterator type of the algorithm input. -\tparam PointPMap is a PropertyMap for accessing the input points. +\tparam PointPMap is a model of ReadablePropertyMap with a value_type = Point_2 -\tparam MassPMap is a PropertyMap for accessing the input points' - mass information. +\tparam MassPMap is a model of ReadablePropertyMap with a value_type = FT */ template From f25502e1da129400a182174e2858a9fe36a0fffa Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 7 Jul 2014 15:36:47 +0200 Subject: [PATCH 021/201] Documentation WIP --- .../PackageDescription.txt | 13 +++--------- .../Reconstruction_Simplification_2.txt | 21 +++++++++---------- .../CGAL/Reconstruction_simplification_2.h | 20 +++++++++++------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index da888c3e4d7..7a52c4eb397 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -1,4 +1,7 @@ /// \defgroup PkgReconstructionSimplification2 2D Reconstruction Simplification Reference + +/// \defgroup PkgReconstructionSimplification2Classes Classes +/// \ingroup PkgReconstructionSimplification2 /*! \addtogroup PkgReconstructionSimplification2 \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} @@ -16,15 +19,5 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd -\cgalClassifedRefPages - -## Concepts ## -- `PointPMap` -- `MassPMap` - - -## Classes ## -- `CGAL::Reconstruction_simplification_2` - */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index d9ba214bbe1..b72ef48e525 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -1,16 +1,15 @@ namespace CGAL { /*! -\mainpage 2D Reconstruction Simplification +\mainpage User Manual \anchor Chapter_2D_Reconstruction_Simplification \cgalAutoToc \authors Fernando de Goes, Pierre Alliez, Ivo Vigan -\image html overview.png -\image latex overview.png -\section 2D_Reconstruction_SimplificationIntroduction Introduction + +\section Reconstruction_simplification_2Introduction Introduction \cgalFigureBegin{2D_Reconstruction_Simplification_process,process.png} @@ -35,18 +34,18 @@ After that, edges which carry little mass can be filtered out. -\section 2D_Reconstruction_SimplificationOverview Overview of the Reconstruction Process +\section Reconstruction_simplification_2Overview Overview of the Reconstruction Process The task addressed is to reconstruct a shape from noisy data $S$ in $R^2$, i.e. give a (noisy) set of points, find a shape which best approximates the non-noise subset of $S$. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. While previous works address these two issues sequentially, they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set M of n sources and a set $F$ of n targets (both can for example be point sets in $R^2$). Given a cost function $c : R^2 x R^2 -> R^+$, the goal is to find a bijection between M and F such that the sum of the costs c gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. Given this theoretical background the algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached. -\section 2D_Reconstruction_SimplificationTrans Optimal Transport Formulation +\section Reconstruction_simplification_2Trans Optimal Transport Formulation The quality of an output simplex is measured as the total transportation cost of the input to the assigned simplex vertices and edges. For the transportation cost, the 2-Wasserstein metric is chosen which is also known the Earth Mover Distance, and intuitively corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, where the cost is measures as the $L_2$ distances. -\subsection 2D_Reconstruction_SimplificationTransCost Transportation Plan & Cost from Points to Simplices +\subsection Reconstruction_simplification_2TransCost Transportation Plan & Cost from Points to Simplices Assuming that the algorithm is given an output simplex $T$, and a point-to-simplex assignment which maps every input point to either an edge or a vertex of $T$, the total transportation cost is then computed using the following rules. For a point to vertex assignment, the cost is simply the sum of the weighted $L_2$-distances of all the points @@ -58,12 +57,12 @@ For an edge of the simplex, the optimal plan and its cost is computed indirectly -\section 2D_Reconstruction_SimplificationAPI API +\section Reconstruction_simplification_2API API The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. -\subsection 2D_Reconstruction_SimplificationSample Sample Call +\subsection Reconstruction_simplification_2Sample Sample Call \code{.cpp} @@ -86,9 +85,9 @@ Reconstruction_simplification_2 \endcode -\subsection 2D_Reconstruction_SimplificationExamples Examples +\subsection Reconstruction_simplification_2Examples Examples -\subsection 2D_Reconstruction_SimplificationExampleSimple Simple reconstruction Example +\subsection Reconstruction_simplification_2ExampleSimple Simple reconstruction Example The following example illustrates the simplest of the cases. It uses an ordinary polyhedron and only one of the optional parameters. diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index d35918c16b2..7265ab95ca0 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -45,7 +45,7 @@ namespace CGAL { /*! -\ingroup PkgReconstructionSimplification2 +\ingroup PkgReconstructionSimplification2Classes @@ -172,9 +172,16 @@ protected: /*! \Instantiates a new Reconstruction_simplification_2. - \details This function is a convenience function for people who do not feel comfortable with circulators. + \details Instantiates a new Reconstruction_simplification_2 object + for a given collection of point-mass pairs. - \tparam OutputIterator must be a model of `CopyConstructible`. + \param start_itr An InputIterator pointing the the first point-mass + pair in a collection. + \param beyond_itr An InputIterator pointing beyond the last point-mass + pair in a collection. + \param in_point_pmap A PropertyMap used to access the input points + + \param in_mass_pmap A PropertyMap used to access the input points' mass. */ Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, @@ -243,10 +250,9 @@ protected: /*! First function to be called after instantiating a new Reconstruction_simplification_2 object. - It computes an bounding box around the input points and creates an first - (fine) output simplex as well as an initial transportation plan. - - \param steps The number of edge contractions performed by the algorithm. + It computes an bounding box around the input points and creates a first + (fine) output simplex as well as an initial transportation plan. This + first output simplex */ void initialize() { From 9f354f44c659a6de4809d815b2b329b7d6eadfc9 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 9 Jul 2014 15:06:10 +0200 Subject: [PATCH 022/201] List Outputmodel Implemented --- .../moc_dialog_options.cxx | 10 +- .../moc_glviewer.cxx | 3 +- .../Reconstruction_simplification_2/scene.h | 39 +++- .../PackageDescription.txt | 24 ++ .../include/CGAL/List_output.h | 205 ++++++++++++++++++ .../CGAL/Reconstruction_simplification_2.h | 93 ++------ .../CGAL/Reconstruction_triangulation_2.h | 3 +- .../CGAL/Reconstruction_vertex_base_2.h | 7 +- .../CMakeLists.txt | 2 +- .../test_basic.cpp | 22 +- .../test_list_output.cpp | 138 ++++++++++++ 11 files changed, 440 insertions(+), 106 deletions(-) create mode 100644 Reconstruction_simplification_2/include/CGAL/List_output.h create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx index dc69376b0c1..ffe0301508d 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx @@ -36,8 +36,7 @@ static const char qt_meta_stringdata_Dialog_options[] = { "Dialog_options\0" }; -void Dialog_options::qt_static_metacall(QObject *_o, - QMetaObject::Call _c, int _id, void **_a) +void Dialog_options::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { Q_UNUSED(_o); Q_UNUSED(_id); @@ -55,15 +54,12 @@ const QMetaObject Dialog_options::staticMetaObject = { }; #ifdef Q_NO_DATA_RELOCATION -const QMetaObject &Dialog_options::getStaticMetaObject() { - return staticMetaObject; -} +const QMetaObject &Dialog_options::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *Dialog_options::metaObject() const { - return QObject::d_ptr->metaObject ? - QObject::d_ptr->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *Dialog_options::qt_metacast(const char *_clname) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx index d887fb71e79..ba1e5ae5d78 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx @@ -59,8 +59,7 @@ const QMetaObject &GlViewer::getStaticMetaObject() { return staticMetaObject; } const QMetaObject *GlViewer::metaObject() const { - return QObject::d_ptr->metaObject ? - QObject::d_ptr->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *GlViewer::qt_metacast(const char *_clname) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 669401b032a..7681b56f6c3 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -11,6 +11,9 @@ #include #include "Reconstruction_simplification_kerneled_2.h" #include "../../include/CGAL/Reconstruction_simplification_2.h" +#include "../../include/CGAL/List_output.h" + + #include "third/CImg.h" #include "random.h" #include // std::pair @@ -74,6 +77,9 @@ public: typedef R_s_2::Reconstruction_edge_2 PEdge; + typedef CGAL::List_output::Output_Vertex_Iterator Output_Vertex_Iterator; + typedef CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; + private: // data std::list m_samples; @@ -381,9 +387,40 @@ public: std::cerr << "done (" << m_samples.size() << ")" << std::endl; } + void print_vertex(Vertex vertex) { + std::cout <<"vertex " << vertex << std::endl; + } + + + void print_edge(PEdge edge) { + int i = ((edge).edge()).second; + Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); + Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); + std::cout <<"( " << (edge).priority() << ") ( " << a + << " , " << b << " )" << std::endl; + } + + + void debug_print() { + + CGAL::List_output list_output; + + m_pwsrec->extract_solid_eges(list_output); + + for (Output_Vertex_Iterator it = list_output.vertices_start(); + it != list_output.vertices_beyond(); it++) { + print_vertex(*it); + } + + for (Output_Edge_Iterator it = list_output.edges_start(); + it != list_output.edges_beyond(); it++) { + print_edge(*it); + } + } + void save(const QString& filename) { std::cout << "SAVE-------------" << std::endl; - m_pwsrec->extract_solid_eges(); + debug_print(); if (filename.contains(".edges", Qt::CaseInsensitive)) { std::ofstream ofs(qPrintable(filename)); diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 7a52c4eb397..651a5549af9 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -2,6 +2,13 @@ /// \defgroup PkgReconstructionSimplification2Classes Classes /// \ingroup PkgReconstructionSimplification2 + +/// \defgroup PkgReconstructionSimplification2Concepts Concepts +/// \ingroup PkgReconstructionSimplification2 + +/// \defgroup PkgReconstructionSimplification2Models Models +/// \ingroup PkgReconstructionSimplification2 + /*! \addtogroup PkgReconstructionSimplification2 \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} @@ -19,5 +26,22 @@ \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd + +\cgalClassifedRefPages + +## Concepts ## +- `OutputModel` +- `PointPMap` +- `MassPMap` + + +## Models ## +- `CGAL::List_output` + + +## Classes ## +- `CGAL::Reconstruction_simplification_2` + + */ diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h new file mode 100644 index 00000000000..bf9ec117187 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -0,0 +1,205 @@ +#ifndef LIST_OUTPUT_H_ +#define LIST_OUTPUT_H_ + +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// + +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Ivo Vigan + +//CGAL +#include + +//local +#include +#include + + +// boost +#include +#include +#include +#include +#include + +namespace CGAL { + +template +class List_output { +public: + typedef typename Kernel::FT FT; + typedef Cost Cost; + typedef Reconstruction_triangulation_2 Rt_2; + typedef typename Kernel::Segment_2 Segment; + typedef typename Kernel::Point_2 Point; + + typedef typename Rt_2::Vertex_handle Vertex_handle; + typedef typename Rt_2::Triangulation_data_structure Tds_2; + + typedef typename Tds_2::Edge_iterator Edge_iterator; + typedef typename Tds_2::Vertex_iterator Vertex_iterator; + + typedef typename Rt_2::Vertex Vertex; + typedef typename Rt_2::Edge Edge; + + typedef std::list Vertices; + typedef std::list Edges; + typedef typename Vertices::const_iterator Output_Vertex_Iterator; + typedef typename Edges::const_iterator Output_Edge_Iterator; + + typedef typename Rt_2::Reconstruction_edge_2 Reconstruction_edge_2; + typedef typename Rt_2::MultiIndex MultiIndex; + + + +private: + + Vertices vertices; + Edges edges; + + FT get_mass(const Edge& edge) const { + return edge.first->mass(edge.second); + } + + const Cost& get_cost(const Edge& edge) const { + return edge.first->cost(edge.second); + } + + Vertex_handle source_vertex(const Edge& edge) const { + return edge.first->vertex(Rt_2::ccw(edge.second)); + } + + Vertex_handle target_vertex(const Edge& edge) const { + return edge.first->vertex(Rt_2::cw(edge.second)); + } + + Segment get_segment(const Edge& edge) const { + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + return Segment(ps, pt); + } + + FT get_length(const Edge& edge) const { + Segment segment = get_segment(edge); + return std::sqrt(segment.squared_length()); + } + + + + FT get_edge_relevance(const Edge& edge) const { + FT M = get_mass(edge); + if (M == 0.0) + return 0.0; + + FT L = get_length(edge); + FT cost = get_cost(edge).finalize(); + return M * L * L / cost; + } + + bool is_ghost(const Edge& edge) const { + return edge.first->ghost(edge.second); + } + +public: + + inline Output_Vertex_Iterator vertices_start() const { + return vertices.begin(); + } + + inline Output_Vertex_Iterator vertices_beyond() const { + return vertices.end(); + } + + inline Output_Edge_Iterator edges_start() const { + return edges.begin(); + } + + inline Output_Edge_Iterator edges_beyond() const { + return edges.end(); + } + + + void clear() { + vertices.clear(); + edges.clear(); + } + + void store_marked_vertices(Tds_2 dt) { + + for (Vertex_iterator vi = dt.vertices_begin(); + vi != dt.vertices_end(); ++vi) + { + bool incident_edges_have_sample = false; + typename Tds_2::Edge_circulator start = dt.incident_edges(vi); + + typename Tds_2::Edge_circulator cur = start; + do { + if (!is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) + vertices.push_back(*vi); + } + } + } + + void store_marked_edges(Tds_2 dt, int nb_ignore) { + MultiIndex mindex; + for (Edge_iterator ei = dt.edges_begin(); + ei != dt.edges_end(); ++ei) //TODO: IV removed finite! + { + Edge edge = *ei; + if (is_ghost(edge)) continue; + FT value = get_edge_relevance(edge); // >= 0 + mindex.insert(Reconstruction_edge_2(edge, value)); + } + + + int nb_remove = (std::min)(nb_ignore, int(mindex.size())); + + for (int i = 0; i < nb_remove; ++i) + { + Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); + (mindex.template get<0>()).erase(pedge); + } + + while (!mindex.empty()) + { + Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); + (mindex.template get<0>()).erase(pedge); + edges.push_back(pedge.edge()); + + } + std::cout << "edges.size() " << edges.size() << std::endl; + + } + + void store_marked_elements(Tds_2 tds, int nb_ignore) { + store_marked_vertices(tds); + store_marked_edges(tds, nb_ignore); + } +}; + + +} //namespace CGAL + +#endif /* LIST_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7265ab95ca0..bae85fb9233 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -274,90 +274,25 @@ protected: } - //Returns the solid edges present after the reconstruction process. - //TODO: determine suitable way of storing them - void extract_solid_eges() { + /*! - std::cout << "---------extracted_solid_eges------------" << std::endl; + Returns the solid edges present after the reconstruction process. + + \details Instantiates a new Reconstruction_simplification_2 object + for a given collection of point-mass pairs. + + \tparam OutputModule Concept for accessing the output + + \param output An OutputModule in which the solid edges and vertics are + stored. + */ + template + void extract_solid_eges(OutputModule& output) { + output.store_marked_elements(m_dt.tds(), m_ignore); - MultiIndex mindex; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - FT value = m_dt.get_edge_relevance(edge); // >= 0 - mindex.insert(Reconstruction_edge_2(edge, value)); - } - - //TODO: IV find nicer way to handle m_ignore - int nb_remove = (std::min)(m_ignore, int(mindex.size())); - - for (int i = 0; i < nb_remove; ++i) - { - Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); - (mindex.template get<0>()).erase(pedge); - } - - while (!mindex.empty()) - { - Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); - (mindex.template get<0>()).erase(pedge); - - int i = (pedge.edge()).second; - Face_handle face = (pedge.edge()).first; - Point a = face->vertex((i+1)%3)->point(); - Point b = face->vertex((i+2)%3)->point(); - std::cout << "( " << a << " , " << b << " )" << std::endl; - } - - std::cout << "---------------------------------------------------" << std::endl; } - //Returns the solid edges present after the reconstruction process. - //TODO: determine suitable way of storing them - void extract_solid_eges(std::vector& solid_edges) { - - std::cout << "---------extracted_solid_eges------------" << std::endl; - - - MultiIndex mindex; - - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - FT value = m_dt.get_edge_relevance(edge); // >= 0 - mindex.insert(Reconstruction_edge_2(edge, value)); - } - - //TODO: IV find nicer way to handle m_ignore - int nb_remove = (std::min)(m_ignore, int(mindex.size())); - - for (int i = 0; i < nb_remove; ++i) - { - Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); - (mindex.template get<0>()).erase(pedge); - } - - while (!mindex.empty()) - { - Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); - (mindex.template get<0>()).erase(pedge); - - solid_edges.push_back(pedge); - - int i = (pedge.edge()).second; - Face_handle face = (pedge.edge()).first; - Point a = face->vertex((i+1)%3)->point(); - Point b = face->vertex((i+2)%3)->point(); - std::cout << "( " << a << " , " << b << " )" << std::endl; - } - - std::cout << "---------------------------------------------------" << std::endl; - } /// \cond SKIP_IN_MANUAL void normalize_points() diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index b4d7bed2ca1..08169d43589 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -33,7 +33,6 @@ #include #include #include -#include // local #include @@ -60,7 +59,7 @@ namespace CGAL { /// The Reconstruction_triangulation_2 class /// provides the reconstruction simplex as well as the transportation plan. /// - Each vertex stores a normal vector. -/// - A vertex a Sample which got assinged to it by the transportation plan, +/// - A vertex a Sample which got assigned to it by the transportation plan, /// well as the corresponding relocated Point (of type Kernel::Point_2). /// - In order to solve a linear system over the triangulation, a vertex may be constrained /// or not (i.e. may contribute to the right or left member of the linear system), diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index d4de2e01591..2630a279ab1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -23,11 +23,10 @@ #include #include -/// The Reconstruction_vertex_base_2 class (corresponding to -/// Reconstruction_vertex_base_2 in prototype) is the default +/// The Reconstruction_vertex_base_2 class is the default /// vertex class of the Reconstruction_triangulation_2 class. /// -/// - Each vertex stores a CSample as well as the corresponding relocated point +/// - Each vertex stores a Sample as well as the corresponding relocated point. /// namespace CGAL { /// @param Kernel Geometric traits class @@ -99,6 +98,8 @@ public: const Point& relocated() const { return m_relocated; } Point& relocated() { return m_relocated; } + + bool has_sample_assigned() const { return get_sample() != NULL; } }; //---------------STRUCT LESS VERTEX_HANDLE--------------------- template diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index b91624d27e5..99590d17625 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_basic.cpp" ) + create_single_source_cgal_program( "test_list_output.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 963e89b933c..ea2a67182a9 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -83,17 +83,17 @@ PointMassList* simple_point_set() { PointMassList* load_xy_file(const std::string& fileName) { PointMassList *points = new PointMassList(); - std::ifstream ifs(fileName); - std::cerr << "read xy..."; - Point point; - unsigned int nb = 0; - while (ifs >> point) - { - points->push_back(std::make_pair(point, 1)); - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); + std::ifstream ifs(fileName); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points->push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); - return points; + return points; } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp new file mode 100644 index 00000000000..d8fffce7473 --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -0,0 +1,138 @@ +// test_list_output.cpp + +//---------------------------------------------------------- +// Test the cgal environment for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include +#include + + +#include + +#include +#include +#include +#include // std::pair + + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; +typedef PointMassList::const_iterator InputIterator; +typedef CGAL::value_type_traits::type MassPoint; +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::Reconstruction_simplification_2 ::Reconstruction_edge_2 R_edge_2; + +typedef CGAL::Reconstruction_simplification_2 ::Vertex Vertex; + +typedef CGAL::List_output::Output_Vertex_Iterator Output_Vertex_Iterator; +typedef CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; + + + +PointMassList* load_xy_file(const std::string& fileName); +PointMassList* simple_point_set(); + + +void print_vertex(Vertex vertex) { + std::cout <<"vertex " << vertex << std::endl; +} + + +void print_edge(R_edge_2 edge) { + int i = ((edge).edge()).second; + Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); + Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); + std::cout <<"( " << (edge).priority() << ") ( " << a + << " , " << b << " )" << std::endl; +} + + + +int main () +{ + + //use the stair example for testing + PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + + PointPMap point_pmap; + MassPMap mass_pmap; + + MassPoint mp; + + CGAL::Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.initialize(); + + rs2.reconstruct(100); //100 steps + + rs2.print_stats_debug(); + + CGAL::List_output list_output; + + rs2.extract_solid_eges(list_output); + + for (Output_Vertex_Iterator it = list_output.vertices_start(); + it != list_output.vertices_beyond(); it++) { + print_vertex(*it); + } + + for (Output_Edge_Iterator it = list_output.edges_start(); + it != list_output.edges_beyond(); it++) { + print_edge(*it); + } +} + + + +PointMassList* simple_point_set() { + + PointMassList *points = new PointMassList(); + + points->push_back(std::make_pair(Point(0.1,0.1), 1)); + points->push_back(std::make_pair(Point(0.4,0.1), 1)); + points->push_back(std::make_pair(Point(0.6,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.4), 1)); + points->push_back(std::make_pair(Point(0.9,0.6), 1)); + points->push_back(std::make_pair(Point(0.9,0.9), 1)); + points->push_back(std::make_pair(Point(0.6,0.9), 1)); + points->push_back(std::make_pair(Point(0.4,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.6), 1)); + points->push_back(std::make_pair(Point(0.1,0.4), 1)); + + return points; + +} + + +PointMassList* load_xy_file(const std::string& fileName) +{ + PointMassList *points = new PointMassList(); + std::ifstream ifs(fileName); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points->push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + + return points; + +} From ade1402af62e48b317039d00464fc885d9691c6c Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 9 Jul 2014 15:08:48 +0200 Subject: [PATCH 023/201] Output model documentation --- .../Concepts/Output.h | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h new file mode 100644 index 00000000000..cd7c3322436 --- /dev/null +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h @@ -0,0 +1,81 @@ + +/*! +\ingroup PkgReconstructionSimplification2Concepts +\cgalConcept + +The OutputModel refinement process involved in the +function template `CGAL::make_surface_mesh()` +is guided by a set of refinement criteria. +The concept `SurfaceMeshFacetsCriteria_3` describes the type which +handles those criteria. +It corresponds to the requirements for the template parameter +`FacetsCriteria` of the surface mesher function +`CGAL::make_surface_mesh()`. + +Typically the meshing criteria are a set +of elementary criteria, each of which +has to be met by the facets of the final mesh. +The meshing algorithm eliminates in turn bad facets, i.e., +facets that do not meet all the criteria. + +The size and quality of the final mesh +depends on the order according to which bad facets +are handled. Therefore, the meshing algorithm +needs to be able to quantify the facet qualities and to compare +the qualities of different faces. +The type `SurfaceMeshFacetsCriteria_3::Quality` measures +the quality of a mesh facet. +Typically this quality +is a multicomponent variable. Each component corresponds to +one criterion and measures how much the facet deviates from +meeting this criterion. Then, the comparison operator on qualities +is just a lexicographical comparison. The meshing algorithm handles facets +with lowest quality first. The qualities are computed by a function +`is_bad(const Facet& f, const Quality& q)`. + +\cgalHasModel `CGAL::Surface_mesh_default_criteria_3` + +\sa `CGAL::make_surface_mesh()` + +*/ + +class OutputModel { +public: + +/// \name Types +/// @{ + +/*! +The type of facets. This type has to match +the `Facet` type in the triangulation type used by +the mesher function. (This triangulation type +is the type `SurfaceMeshC2T3::Triangulation` +provided by the model of +`SurfaceMeshComplex_2InTriangulation_3` plugged +as first template parameter of +`CGAL::make_surface_mesh()`). +*/ +typedef unspecified_type Facet; + +/*! +Default constructible, copy constructible, +assignable, and less-than comparable type. +*/ +typedef unspecified_type Quality; + +/// @} + +/// \name Operations +/// @{ + +/*! +Assigns the quality +of the facet `f` to `q`, and returns `true` is `f` does +not meet the criteria. +*/ +bool is_bad (const Facet& f, const Quality& q); + +/// @} + +}; /* end SurfaceMeshFacetsCriteria_3 */ + From 1f84cb15143ae6adb5d4ee21cbb7cc180a46a1cb Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 9 Jul 2014 16:25:56 +0200 Subject: [PATCH 024/201] Output model documentation --- .../Concepts/Output.h | 76 ++++++------------- 1 file changed, 24 insertions(+), 52 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h index cd7c3322436..644b161fff2 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h @@ -3,39 +3,9 @@ \ingroup PkgReconstructionSimplification2Concepts \cgalConcept -The OutputModel refinement process involved in the -function template `CGAL::make_surface_mesh()` -is guided by a set of refinement criteria. -The concept `SurfaceMeshFacetsCriteria_3` describes the type which -handles those criteria. -It corresponds to the requirements for the template parameter -`FacetsCriteria` of the surface mesher function -`CGAL::make_surface_mesh()`. +The OutputModel +\cgalHasModel `CGAL::List_output` -Typically the meshing criteria are a set -of elementary criteria, each of which -has to be met by the facets of the final mesh. -The meshing algorithm eliminates in turn bad facets, i.e., -facets that do not meet all the criteria. - -The size and quality of the final mesh -depends on the order according to which bad facets -are handled. Therefore, the meshing algorithm -needs to be able to quantify the facet qualities and to compare -the qualities of different faces. -The type `SurfaceMeshFacetsCriteria_3::Quality` measures -the quality of a mesh facet. -Typically this quality -is a multicomponent variable. Each component corresponds to -one criterion and measures how much the facet deviates from -meeting this criterion. Then, the comparison operator on qualities -is just a lexicographical comparison. The meshing algorithm handles facets -with lowest quality first. The qualities are computed by a function -`is_bad(const Facet& f, const Quality& q)`. - -\cgalHasModel `CGAL::Surface_mesh_default_criteria_3` - -\sa `CGAL::make_surface_mesh()` */ @@ -45,23 +15,11 @@ public: /// \name Types /// @{ -/*! -The type of facets. This type has to match -the `Facet` type in the triangulation type used by -the mesher function. (This triangulation type -is the type `SurfaceMeshC2T3::Triangulation` -provided by the model of -`SurfaceMeshComplex_2InTriangulation_3` plugged -as first template parameter of -`CGAL::make_surface_mesh()`). -*/ -typedef unspecified_type Facet; -/*! -Default constructible, copy constructible, -assignable, and less-than comparable type. */ -typedef unspecified_type Quality; +typedef unspecified_type Output_Vertex_Iterator; + +typedef unspecified_type Output_Edge_Iterator; /// @} @@ -69,13 +27,27 @@ typedef unspecified_type Quality; /// @{ /*! -Assigns the quality -of the facet `f` to `q`, and returns `true` is `f` does -not meet the criteria. +Returns an Output_Vertex_Iterator pointing to the first vertex. */ -bool is_bad (const Facet& f, const Quality& q); +Output_Vertex_Iterator vertices_start(); + +/*! +Returns an Output_Vertex_Iterator pointing beyond the last vertex. +*/ +Output_Vertex_Iterator vertices_beyond(); + +/*! +Returns an Output_Edge_Iterator pointing to the first edge. +*/ +Output_Edge_Iterator edges_start(); + +/*! +Returns an Output_Edge_Iterator pointing beyond the last edge. +*/ +Output_Edge_Iterator edges_beyond(); + /// @} -}; /* end SurfaceMeshFacetsCriteria_3 */ +}; /* end OutputModel */ From 59705f61959fae42df1aa54633efb7dd2d5e2167 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 10 Jul 2014 19:44:52 +0200 Subject: [PATCH 025/201] OFF and TDS output modules implemented --- .../Reconstruction_simplification_2/scene.h | 2 +- .../include/CGAL/List_output.h | 15 ++- .../include/CGAL/Off_output.h | 100 ++++++++++++++++++ .../CGAL/Reconstruction_simplification_2.h | 4 +- .../include/CGAL/Tds_output.h | 63 +++++++++++ .../test_basic.cpp | 1 - .../test_list_output.cpp | 23 +++- 7 files changed, 197 insertions(+), 11 deletions(-) create mode 100644 Reconstruction_simplification_2/include/CGAL/Off_output.h create mode 100644 Reconstruction_simplification_2/include/CGAL/Tds_output.h diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 7681b56f6c3..967ef594ee4 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -405,7 +405,7 @@ public: CGAL::List_output list_output; - m_pwsrec->extract_solid_eges(list_output); + m_pwsrec->extract_solid_elements(list_output); for (Output_Vertex_Iterator it = list_output.vertices_start(); it != list_output.vertices_beyond(); it++) { diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index bf9ec117187..15957803e0e 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -38,6 +38,19 @@ namespace CGAL { +/*! +\ingroup PkgReconstructionSimplification2Models + + +\brief The class `List_output` is a model for the Output concept. + +\details It returns Output-iterators which allow iterating over both the +isolated vertices and the edges of the reconstructed shape + + +\tparam Kernel is the geometric kernel, used for the reconstruction and + simplification task. + */ template class List_output { public: @@ -189,8 +202,6 @@ public: edges.push_back(pedge.edge()); } - std::cout << "edges.size() " << edges.size() << std::endl; - } void store_marked_elements(Tds_2 tds, int nb_ignore) { diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h new file mode 100644 index 00000000000..188b2d7b286 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -0,0 +1,100 @@ +/* + * Off_output.h + * + * Created on: Jul 10, 2014 + * Author: ivovigan + */ + +#ifndef OFF_OUTPUT_H_ +#define OFF_OUTPUT_H_ + + +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// + +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Ivo Vigan + +//CGAL +#include + +//local +#include +#include + +#include + +namespace CGAL { + +/*! +\ingroup PkgReconstructionSimplification2Models + + +\brief The class `Off_output` is a model for the Output concept. + +\details It allows accessing the isolated vertices and the edges +of the reconstructed shape via an ostream object. + + +\tparam Kernel is the geometric kernel, used for the reconstruction and + simplification task. + */ +template +class Off_output { +public: + typedef Reconstruction_triangulation_2 Rt_2; + typedef typename Rt_2::Triangulation_data_structure Tds_2; + typedef typename Rt_2::Edge Edge; + typedef typename Kernel::Point_2 Point; + + typedef typename Rt_2::Face_handle Face_handle; + + + typedef typename CGAL::List_output::Output_Edge_Iterator + Output_Edge_Iterator; +private: + List_output list_output; + + + void save_one_edge(std::ostream& os, const Edge& edge) + { + int i = edge.second; + Face_handle face = edge.first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + os << a << " " << b << std::endl; + } + + +public: + void store_marked_elements(Tds_2 tds, int nb_ignore) { + list_output.store_marked_elements(tds, nb_ignore); + } + + + void get_os_output(std::ostream& os) { + for (Output_Edge_Iterator it = list_output.edges_start(); + it != list_output.edges_beyond(); it++) { + + save_one_edge(os, *it); + } + } +}; +} + + +#endif /* OFF_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index bae85fb9233..4690f382ef7 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -287,10 +287,8 @@ protected: stored. */ template - void extract_solid_eges(OutputModule& output) { + void extract_solid_elements(OutputModule& output) { output.store_marked_elements(m_dt.tds(), m_ignore); - - } diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h new file mode 100644 index 00000000000..6bfe5cfb916 --- /dev/null +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -0,0 +1,63 @@ +/* + * Tds_output.h + * + * Created on: Jul 10, 2014 + * Author: ivovigan + */ + +#ifndef TDS_OUTPUT_H_ +#define TDS_OUTPUT_H_ + +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// All rights reserved. +// + +// This file is part of CGAL (www.cgal.org). +// You can redistribute it and/or modify it under the terms of the GNU +// General Public License as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Ivo Vigan + +//CGAL +#include + +//local +#include + + +namespace CGAL { + +template +class Tds_output { +public: + typedef Reconstruction_triangulation_2 Rt_2; + typedef typename Rt_2::Triangulation_data_structure Tds_2; + +private: + Tds_2 reconstruction_tds; + +public: + void store_marked_elements(Tds_2 tds, int nb_ignore) { + reconstruction_tds = tds; + } + + Tds_2 get_reconstruction_tds() { + return reconstruction_tds; + } + +}; +} + + + +#endif /* TDS_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index ea2a67182a9..c860f478309 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -53,7 +53,6 @@ int main () rs2.print_stats_debug(); - rs2.extract_solid_eges(); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index d8fffce7473..1a608a7a588 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -7,10 +7,9 @@ #include #include #include +#include - -#include - +#include #include #include #include @@ -82,7 +81,7 @@ int main () CGAL::List_output list_output; - rs2.extract_solid_eges(list_output); + rs2.extract_solid_elements(list_output); for (Output_Vertex_Iterator it = list_output.vertices_start(); it != list_output.vertices_beyond(); it++) { @@ -93,6 +92,22 @@ int main () it != list_output.edges_beyond(); it++) { print_edge(*it); } + + + + //------- + std::cout <<"(------------------------ )" << std::endl; + + + + CGAL::Off_output off_output; + + rs2.extract_solid_elements(off_output); + + off_output.get_os_output(std::cout); + + + } From 9cfb932765ff8c2e25c0167c4cd1ae7bbbc2b02a Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 11 Jul 2014 18:35:20 +0200 Subject: [PATCH 026/201] Documentation Extended --- .../Concepts/Output.h | 18 +- .../PackageDescription.txt | 8 +- .../Reconstruction_Simplification_2.txt | 15 +- .../include/CGAL/List_output.h | 10 +- .../include/CGAL/Off_output.h | 13 +- .../CGAL/Reconstruction_simplification_2.h | 167 ++++++++++-------- .../include/CGAL/Tds_output.h | 12 ++ 7 files changed, 155 insertions(+), 88 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h index 644b161fff2..3a0cd28eda5 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h @@ -3,22 +3,33 @@ \ingroup PkgReconstructionSimplification2Concepts \cgalConcept -The OutputModel +The OutputModule provides a Concept which allows the user to access the simplified +shape in a versatile way. + + + \cgalHasModel `CGAL::List_output` +\cgalHasModel `CGAL::Off_output` +\cgalHasModel `CGAL::Tds_output` */ -class OutputModel { +class OutputModule { public: /// \name Types /// @{ +/*! +Output_Iterator for accessing the isolated vertices. */ typedef unspecified_type Output_Vertex_Iterator; +/*! +Output_Iterator for accessing the reconstructed edges. +*/ typedef unspecified_type Output_Edge_Iterator; /// @} @@ -47,7 +58,6 @@ Returns an Output_Edge_Iterator pointing beyond the last edge. Output_Edge_Iterator edges_beyond(); -/// @} -}; /* end OutputModel */ +}; /* end OutputModule */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 651a5549af9..1653206720c 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -30,17 +30,17 @@ \cgalClassifedRefPages ## Concepts ## -- `OutputModel` -- `PointPMap` -- `MassPMap` +- `OutputModule` ## Models ## - `CGAL::List_output` +- `CGAL::Off_output` +- `CGAL::Tds_output` ## Classes ## -- `CGAL::Reconstruction_simplification_2` +- `CGAL::Reconstruction_simplification_2` */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b72ef48e525..3d9bf363c08 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -81,7 +81,20 @@ Reconstruction_simplification_2 rs2.reconstruct(100); - rs2.extract_solid_eges(); + CGAL::List_output list_output; + + rs2.extract_solid_elements(list_output); + + for (Output_Vertex_Iterator it = list_output.vertices_start(); + it != list_output.vertices_beyond(); it++) { + ... + } + + for (Output_Edge_Iterator it = list_output.edges_start(); + it != list_output.edges_beyond(); it++) { + ... + } + \endcode diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 15957803e0e..81cb78ecc7c 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -42,7 +42,7 @@ namespace CGAL { \ingroup PkgReconstructionSimplification2Models -\brief The class `List_output` is a model for the Output concept. +\brief The class `List_output` is a model for the `OutputModule` concept. \details It returns Output-iterators which allow iterating over both the isolated vertices and the edges of the reconstructed shape @@ -151,6 +151,14 @@ public: edges.clear(); } + int vertex_count() { + return vertices.size(); + } + + int edge_count() { + return edges.size(); + } + void store_marked_vertices(Tds_2 dt) { for (Vertex_iterator vi = dt.vertices_begin(); diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 188b2d7b286..3668f39ee35 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -44,10 +44,10 @@ namespace CGAL { \ingroup PkgReconstructionSimplification2Models -\brief The class `Off_output` is a model for the Output concept. +\brief The class `Off_output` is a model for the `OutputModule` concept. \details It allows accessing the isolated vertices and the edges -of the reconstructed shape via an ostream object. +of the reconstructed shape via an std::ostream object. \tparam Kernel is the geometric kernel, used for the reconstruction and @@ -86,7 +86,16 @@ public: } + /*! + Writes the edges and vertices of the output simplex into an `std::ostream` + in the OFF format. + + \param os The `std::ostream` where the OFF data will be written to. + */ void get_os_output(std::ostream& os) { + os << "[%d][%d][0] OFF " << list_output.vertex_count() << + list_output.edge_count() << std::endl; + for (Output_Edge_Iterator it = list_output.edges_start(); it != list_output.edges_beyond(); it++) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 4690f382ef7..c534717005c 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -49,29 +49,27 @@ namespace CGAL { -\brief The class `Reconstruction_simplification_2` is the base class -designed to execute the reconstruction and simplification tasks. - -\details This class takes as input a collection of point-mass pairs, where both -the points and their masses are accessed using PropertyMaps. +\brief The class `Reconstruction_simplification_2` is the main class +for executing the reconstruction and simplification tasks. +It takes an InputIterator which can be used to traverse a collection +of point-mass pairs, where the points and their masses are accessed +via the PointPMap and MassPMap `PropertyMap`s respectively. -\tparam Kernel is the geometric kernel, used for the reconstruction and +\tparam Kernel is the geometric kernel, used throughout the reconstruction and simplification task. \tparam InputIterator is the iterator type of the algorithm input. -\tparam PointPMap is a model of ReadablePropertyMap with a value_type = Point_2 +\tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = `Point_2` -\tparam MassPMap is a model of ReadablePropertyMap with a value_type = FT +\tparam MassPMap is a model of `ReadablePropertyMap` with a value_type = `FT` */ template class Reconstruction_simplification_2 { public: - /// \name Types - /// @{ /*! Number type. @@ -92,8 +90,7 @@ public: */ typedef Reconstruction_triangulation_2 Triangulation; - /// @} - + /// \cond SKIP_IN_MANUAL typedef typename Triangulation::Vertex Vertex; typedef typename Triangulation::Vertex_handle Vertex_handle; typedef typename Triangulation::Vertex_iterator Vertex_iterator; @@ -137,8 +134,6 @@ public: typedef typename Triangulation::MultiIndex MultiIndex; - - protected: Triangulation m_dt; MultiIndex m_mindex; @@ -162,6 +157,7 @@ protected: PointPMap point_pmap; MassPMap mass_pmap; + /// \endcond // Public methods public: @@ -179,9 +175,9 @@ protected: pair in a collection. \param beyond_itr An InputIterator pointing beyond the last point-mass pair in a collection. - \param in_point_pmap A PropertyMap used to access the input points + \param in_point_pmap A `ReadablePropertyMap` used to access the input points - \param in_mass_pmap A PropertyMap used to access the input points' mass. + \param in_mass_pmap A `ReadablePropertyMap` used to access the input points' mass. */ Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, @@ -198,7 +194,11 @@ protected: initialize_parameters(); } - /// \cond SKIP_IN_MANUAL + /// @} + + + /// \cond SKIP_IN_MANUAL + Reconstruction_simplification_2() { initialize_parameters(); } @@ -208,9 +208,6 @@ protected: clear(); } - /// @} - - void initialize_parameters() { @@ -246,6 +243,8 @@ protected: initialize(); } + /// \endcond + /*! First function to be called after instantiating a new @@ -292,8 +291,9 @@ protected: } - /// \cond SKIP_IN_MANUAL - void normalize_points() + /// \cond SKIP_IN_MANUAL + + void normalize_points() { //noise(1e-5); TODO IV, killed that noise compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); @@ -311,8 +311,8 @@ protected: m_bbox_size = 1.0; } - /// \cond SKIP_IN_MANUAL - void compute_bbox(double &x, double &y, double &scale) + + void compute_bbox(double &x, double &y, double &scale) { FT x_min, x_max, y_min, y_max; @@ -353,49 +353,60 @@ protected: m_verbose = verbose; } + void set_alpha(const double alpha) { m_alpha = alpha; } + void set_use_flip(const bool use_flip) { m_use_flip = use_flip; } + void set_norm_tol(const double norm_tol) { m_norm_tol = norm_tol; } + double get_norm_tol() const { return m_norm_tol; } + void set_tang_tol(const double tang_tol) { m_tang_tol = tang_tol; } + double get_tang_tol() const { return m_tang_tol; } + void set_relocation(const unsigned relocation) { m_relocation = relocation; } + unsigned get_relocation() const { return m_relocation; } + void set_ghost(const double g) { m_ghost = g; m_dt.ghost_factor() = m_ghost; } + double get_ghost() { return m_ghost; } // INIT // + void insert_loose_bbox(const double x, const double y, const double size) { double timer = clock(); std::cerr << yellow << "insert loose bbox" << white << "..."; @@ -472,58 +483,6 @@ protected: update_cost(hull.begin(), hull.end()); } - // RECONSTRUCTION // - - /*! - This function must be called after initialization(). - It computes a shape consisting of nv vertices, reconstructing the input - points. - - \param nv The number of vertices which will be present in the output. - */ - void reconstruct_until(const unsigned nv) { - double timer = clock(); - std::cerr << yellow << "reconstruct until " << white << nv << " V"; - - unsigned N = nv + 4; - unsigned performed = 0; - while (m_dt.number_of_vertices() > N) { - bool ok = decimate(); - if (!ok) - break; - performed++; - } - - std::cerr << yellow << " done" << white << " (" << performed - << " iters, " << m_dt.number_of_vertices() - 4 << " V " - << yellow << time_duration(timer) << white << " s)" - << std::endl; - } - - /*! - This function must be called after initialization(). - It computes a shape, reconstructing the input, by performing steps many - edge contractions on the output simplex. - - \param steps The number of edge contractions performed by the algorithm. - */ - void reconstruct(const unsigned steps) { - double timer = clock(); - std::cerr << yellow << "reconstruct " << steps << white; - - unsigned performed = 0; - for (unsigned i = 0; i < steps; ++i) { - bool ok = decimate(); - if (!ok) - break; - performed++; - } - - std::cerr << yellow << " done" << white << " (" << performed << "/" - << steps << " iters, " << m_dt.number_of_vertices() - 4 - << " V, " << yellow << time_duration(timer) << white << " s)" - << std::endl; - } bool decimate() { bool ok; @@ -1371,6 +1330,62 @@ protected: std::cerr << "# ghost: " << nb_ghost << std::endl; } + /// \endcond + + // RECONSTRUCTION // + + /*! + This function must be called after initialization(). + It computes a shape consisting of nv vertices, reconstructing the input + points. + + \param nv The number of vertices which will be present in the output. + */ + void reconstruct_until(const unsigned nv) { + double timer = clock(); + std::cerr << yellow << "reconstruct until " << white << nv << " V"; + + unsigned N = nv + 4; + unsigned performed = 0; + while (m_dt.number_of_vertices() > N) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } + + std::cerr << yellow << " done" << white << " (" << performed + << " iters, " << m_dt.number_of_vertices() - 4 << " V " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + /*! + This function must be called after initialization(). + It computes a shape, reconstructing the input, by performing steps many + edge contractions on the output simplex. + + \param steps The number of edge contractions performed by the algorithm. + */ + void reconstruct(const unsigned steps) { + double timer = clock(); + std::cerr << yellow << "reconstruct " << steps << white; + + unsigned performed = 0; + for (unsigned i = 0; i < steps; ++i) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } + + std::cerr << yellow << " done" << white << " (" << performed << "/" + << steps << " iters, " << m_dt.number_of_vertices() - 4 + << " V, " << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + }; } diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 6bfe5cfb916..65ac9fdf782 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -37,6 +37,18 @@ namespace CGAL { +/*! +\ingroup PkgReconstructionSimplification2Models + + +\brief The class `Tds_output` is a model for the `OutputModule` concept. + +\details It provides access to the whole `Tds_2` of the reconstruction simplex. + + +\tparam Kernel is the geometric kernel, used for the reconstruction and + simplification task. + */ template class Tds_output { public: From 72f0020bb625a12d60491190fc61138362eac6cd Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 14 Jul 2014 13:13:46 +0200 Subject: [PATCH 027/201] Relocate all vertices added and documentation extended --- .../Reconstruction_Simplification_2.txt | 29 +++++++++++++++++-- .../CGAL/Reconstruction_simplification_2.h | 12 ++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 3d9bf363c08..8bc3245a71d 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -22,7 +22,12 @@ The algorithm (\cgalCite{degoes:hal-00758019}) presented here performs the recon The algorithm can be summarized as: "Considering S as a measure mu consisting of Dirac masses, find a coarse simplicial complex T such that mu is well approximated by a linear combination of uniform measures on the edges and vertices of T." -It performs a course to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan T \ e. +It performs a course to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan $T \ e$. + +\cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} +Illustration of an edge contraction - indicated by an arrow. The resulting reassignment of the input points to vertices and edges is depicted in green, red respectively. +\cgalFigureEnd + The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. @@ -51,10 +56,22 @@ Assuming that the algorithm is given an output simplex $T$, and a point-to-si the total transportation cost is then computed using the following rules. For a point to vertex assignment, the cost is simply the sum of the weighted $L_2$-distances of all the points assigned to the given vertex. -For an edge of the simplex, the optimal plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. TODO: CONTINUE +For an edge of the simplex, the optimal plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is a bit more involved. In order to compute it, we decompose an edge $e$ into bins. This decomposition is done by sorting the projected points on $e$ and choosing the length of the $i$-th bin as $(m_i/M_e)|e|$. Each projected point $q_i$ on $e$ is then spread over the $i$-th bin. such that we get a uniform measure on $e$, which is then used to define an optimal transport from the input points to $e$. + +\cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} +Illustration of the bins of a simplicial-edge used for computing the tangential transportation plan. +\cgalFigureEnd +\section Reconstruction_simplification_2VertexRelocation Vertex Relocation + +Since noise and missing data result may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of the weighted $L_2$ distance. The vertices then get relocated only if the resulting triangulation is still embeddable. + + +\cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} +A noisy skyline (left), after vertex relocation (right). +\cgalFigureEnd \section Reconstruction_simplification_2API API @@ -100,13 +117,19 @@ Reconstruction_simplification_2 \subsection Reconstruction_simplification_2Examples Examples + +\cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} +Example of a reconstructed image where the user specified that the output should consist of $20$ vertices. +\cgalFigureEnd + \subsection Reconstruction_simplification_2ExampleSimple Simple reconstruction Example The following example illustrates the simplest of the cases. It uses an ordinary polyhedron and only one of the optional parameters. The unspecified cost strategy defaults to Lindstrom-Turk. \cgalExample{Surface_mesh_simplification/edge_collapse_polyhedron.cpp} - +Illustration of a call to the reconstruction function where the user specified to leave $20$ vertices. +\cgalFigureEnd */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index c534717005c..344b01bf4b1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1088,7 +1088,18 @@ protected: } } } + /// \endcond + + /*! + Since noise and missing data result may prevent the reconstructed shape to + have sharp corners, the algorithm offers the possibility to automatically + relocate vertices after each edge contraction. The new location of the + vertices is chosen such that the fitting of the output triangulation to the + input points is improved. This is achieved by minimizing the normal component + of the weighted $L_2$ distance. The vertices then get relocated only if the + resulting triangulation is still embeddable. + */ void relocate_all_vertices() { double timer = clock(); std::cerr << yellow << "relocate all" << white << "..."; @@ -1130,6 +1141,7 @@ protected: << time_duration(timer) << white << " s)" << std::endl; } + /// \cond SKIP_IN_MANUAL Vector compute_gradient(Vertex_handle vertex) { Vector grad(0.0, 0.0); Edge_circulator ecirc = m_dt.incident_edges(vertex); From c3343828e6bce49282b3b744b482b71016b1563b Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 16 Jul 2014 11:29:55 +0200 Subject: [PATCH 028/201] TDS and OFF output --- .../include/CGAL/Off_output.h | 20 ++++++++++++++----- .../CGAL/Reconstruction_simplification_2.h | 1 - .../CGAL/Reconstruction_vertex_base_2.h | 5 +++++ .../include/CGAL/Tds_output.h | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 3668f39ee35..ead3bd84c82 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -59,10 +59,13 @@ public: typedef Reconstruction_triangulation_2 Rt_2; typedef typename Rt_2::Triangulation_data_structure Tds_2; typedef typename Rt_2::Edge Edge; + typedef typename Rt_2::Vertex Vertex; typedef typename Kernel::Point_2 Point; typedef typename Rt_2::Face_handle Face_handle; + typedef typename CGAL::List_output::Output_Vertex_Iterator + Output_Vertex_Iterator; typedef typename CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; @@ -70,8 +73,11 @@ private: List_output list_output; - void save_one_edge(std::ostream& os, const Edge& edge) - { + void save_one_vertex(std::ostream& os, const Vertex& v) { + os << v << std::endl; + } + + void save_one_edge(std::ostream& os, const Edge& edge) { int i = edge.second; Face_handle face = edge.first; Point a = face->vertex((i+1)%3)->point(); @@ -79,7 +85,6 @@ private: os << a << " " << b << std::endl; } - public: void store_marked_elements(Tds_2 tds, int nb_ignore) { list_output.store_marked_elements(tds, nb_ignore); @@ -93,8 +98,13 @@ public: \param os The `std::ostream` where the OFF data will be written to. */ void get_os_output(std::ostream& os) { - os << "[%d][%d][0] OFF " << list_output.vertex_count() << - list_output.edge_count() << std::endl; + os << "[" << list_output.vertex_count() << "][" << + list_output.edge_count() << "][0] OFF " << std::endl; + + for (Output_Vertex_Iterator it = list_output.vertices_start(); + it != list_output.vertices_beyond(); it++) { + save_one_vertex(os, *it); + } for (Output_Edge_Iterator it = list_output.edges_start(); it != list_output.edges_beyond(); it++) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 344b01bf4b1..b91da14a546 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -758,7 +758,6 @@ protected: return true; } - //TODO: IV Rename void populate_pqueue() { Finite_edges_iterator ei; for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 2630a279ab1..f4bbdbe87ac 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -36,6 +36,7 @@ class Reconstruction_vertex_base_2 : public Vb { public: typedef Vb Base; + typedef Kernel::FT FT; typedef Sample Sample; typedef typename Kernel::Point_2 Point; typedef typename Base::Face_handle Face_handle; @@ -51,6 +52,7 @@ private: bool m_pinned; Sample* m_sample; Point m_relocated; + FT m_relevance; public: Reconstruction_vertex_base_2() @@ -93,6 +95,9 @@ public: bool pinned() const { return m_pinned; } bool& pinned() { return m_pinned; } + FT get_relevance() const { return m_relevance; } + void set_relevance(FT relevance) { m_relevance = relevance; } + Sample* get_sample() const { return m_sample; } void set_sample(Sample* sample) { m_sample = sample; } diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 65ac9fdf782..7960d7ace38 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -43,7 +43,7 @@ namespace CGAL { \brief The class `Tds_output` is a model for the `OutputModule` concept. -\details It provides access to the whole `Tds_2` of the reconstruction simplex. +\details It provides access to the `Tds_2` of the reconstruction simplex. \tparam Kernel is the geometric kernel, used for the reconstruction and From 48b4ab3a3742bbf30efdbcaed87b51555462d107 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 16 Jul 2014 14:07:53 +0200 Subject: [PATCH 029/201] TDS and OFF output --- .../include/CGAL/Reconstruction_vertex_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index f4bbdbe87ac..bb70f257621 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -36,7 +36,7 @@ class Reconstruction_vertex_base_2 : public Vb { public: typedef Vb Base; - typedef Kernel::FT FT; + typedef typename Kernel::FT FT; typedef Sample Sample; typedef typename Kernel::Point_2 Point; typedef typename Base::Face_handle Face_handle; From 447e6ef40dfa9efedbe12af367b73f4a6fdfe656 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 17 Jul 2014 11:57:05 +0200 Subject: [PATCH 030/201] OFF format corrected --- .../include/CGAL/List_output.h | 3 -- .../include/CGAL/Off_output.h | 49 ++++++++++++++++--- 2 files changed, 43 insertions(+), 9 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 81cb78ecc7c..22c3b53b11e 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -111,8 +111,6 @@ private: return std::sqrt(segment.squared_length()); } - - FT get_edge_relevance(const Edge& edge) const { FT M = get_mass(edge); if (M == 0.0) @@ -128,7 +126,6 @@ private: } public: - inline Output_Vertex_Iterator vertices_start() const { return vertices.begin(); } diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index ead3bd84c82..f5d0721dd33 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -77,14 +77,38 @@ private: os << v << std::endl; } - void save_one_edge(std::ostream& os, const Edge& edge) { + void save_one_edge(std::ostream& os, const Edge& edge, std::set& edge_vertices) { int i = edge.second; Face_handle face = edge.first; Point a = face->vertex((i+1)%3)->point(); Point b = face->vertex((i+2)%3)->point(); - os << a << " " << b << std::endl; + + typename std::set::iterator it_a = edge_vertices.find(a); + typename std::set::iterator it_b = edge_vertices.find(b); + + int pos_a = std::distance(edge_vertices.begin(), it_a); + int pos_b = std::distance(edge_vertices.begin(), it_b); + + os << "2 " << pos_a + list_output.vertex_count() << " " + << pos_b + list_output.vertex_count() << std::endl; } + void vertices_of_edges(std::set& edge_vertices) { + + for (Output_Edge_Iterator it = list_output.edges_start(); + it != list_output.edges_beyond(); it++) { + + int i = (*it).second; + Face_handle face = (*it).first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + + edge_vertices.insert(a); + edge_vertices.insert(b); + } + } + + public: void store_marked_elements(Tds_2 tds, int nb_ignore) { list_output.store_marked_elements(tds, nb_ignore); @@ -98,18 +122,31 @@ public: \param os The `std::ostream` where the OFF data will be written to. */ void get_os_output(std::ostream& os) { - os << "[" << list_output.vertex_count() << "][" << - list_output.edge_count() << "][0] OFF " << std::endl; + os << "OFF [" << list_output.vertex_count() << "][0][" << + list_output.edge_count() << "]" << std::endl; for (Output_Vertex_Iterator it = list_output.vertices_start(); it != list_output.vertices_beyond(); it++) { save_one_vertex(os, *it); - } + } + + std::set edge_vertices; + vertices_of_edges(edge_vertices); + + for (typename std::set::iterator it = edge_vertices.begin(); + it != edge_vertices.end(); it++) { + + os << *it << std::endl; + } + + for (int i = 0; i < list_output.vertex_count(); i++) { + os << "1 " << i << std::endl; + } for (Output_Edge_Iterator it = list_output.edges_start(); it != list_output.edges_beyond(); it++) { - save_one_edge(os, *it); + save_one_edge(os, *it,edge_vertices); } } }; From c93a474b318cc8dce98f4dc06dd5c21b55155d83 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 17 Jul 2014 13:00:20 +0200 Subject: [PATCH 031/201] Changed TDS to Triangulation in OutputModule --- .../include/CGAL/List_output.h | 34 ++++++++++--------- .../include/CGAL/Off_output.h | 4 +-- .../CGAL/Reconstruction_simplification_2.h | 2 +- .../include/CGAL/Tds_output.h | 8 ++--- .../test_list_output.cpp | 5 ++- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 22c3b53b11e..bf89e9a8a65 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -61,10 +61,9 @@ public: typedef typename Kernel::Point_2 Point; typedef typename Rt_2::Vertex_handle Vertex_handle; - typedef typename Rt_2::Triangulation_data_structure Tds_2; - typedef typename Tds_2::Edge_iterator Edge_iterator; - typedef typename Tds_2::Vertex_iterator Vertex_iterator; + typedef typename Rt_2::Edge_iterator Edge_iterator; + typedef typename Rt_2::Vertex_iterator Vertex_iterator; typedef typename Rt_2::Vertex Vertex; typedef typename Rt_2::Edge Edge; @@ -77,6 +76,8 @@ public: typedef typename Rt_2::Reconstruction_edge_2 Reconstruction_edge_2; typedef typename Rt_2::MultiIndex MultiIndex; + typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; + private: @@ -156,17 +157,19 @@ public: return edges.size(); } - void store_marked_vertices(Tds_2 dt) { + void store_marked_vertices(Rt_2& rt2) { - for (Vertex_iterator vi = dt.vertices_begin(); - vi != dt.vertices_end(); ++vi) + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) { bool incident_edges_have_sample = false; - typename Tds_2::Edge_circulator start = dt.incident_edges(vi); + typename Rt_2::Edge_circulator start = rt2.incident_edges(vi); + + typename Rt_2::Edge_circulator cur = start; - typename Tds_2::Edge_circulator cur = start; do { if (!is_ghost(*cur)) { + incident_edges_have_sample = true; break; } @@ -180,16 +183,15 @@ public: } } - void store_marked_edges(Tds_2 dt, int nb_ignore) { + void store_marked_edges(Rt_2& rt2, int nb_ignore) { MultiIndex mindex; - for (Edge_iterator ei = dt.edges_begin(); - ei != dt.edges_end(); ++ei) //TODO: IV removed finite! - { + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) + { Edge edge = *ei; if (is_ghost(edge)) continue; FT value = get_edge_relevance(edge); // >= 0 mindex.insert(Reconstruction_edge_2(edge, value)); - } + } int nb_remove = (std::min)(nb_ignore, int(mindex.size())); @@ -209,9 +211,9 @@ public: } } - void store_marked_elements(Tds_2 tds, int nb_ignore) { - store_marked_vertices(tds); - store_marked_edges(tds, nb_ignore); + void store_marked_elements(Rt_2& rt2, int nb_ignore) { + store_marked_vertices(rt2); + store_marked_edges(rt2, nb_ignore); } }; diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index f5d0721dd33..51db4c3eec6 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -110,8 +110,8 @@ private: public: - void store_marked_elements(Tds_2 tds, int nb_ignore) { - list_output.store_marked_elements(tds, nb_ignore); + void store_marked_elements(Rt_2& rt2, int nb_ignore) { + list_output.store_marked_elements(rt2, nb_ignore); } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index b91da14a546..7e3a79c2a88 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -287,7 +287,7 @@ protected: */ template void extract_solid_elements(OutputModule& output) { - output.store_marked_elements(m_dt.tds(), m_ignore); + output.store_marked_elements(m_dt, m_ignore); } diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 7960d7ace38..927acef9207 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -56,15 +56,15 @@ public: typedef typename Rt_2::Triangulation_data_structure Tds_2; private: - Tds_2 reconstruction_tds; + Rt_2 m_rt2; public: - void store_marked_elements(Tds_2 tds, int nb_ignore) { - reconstruction_tds = tds; + void store_marked_elements(Rt_2& rt2, int nb_ignore) { + rt2 = rt2; } Tds_2 get_reconstruction_tds() { - return reconstruction_tds; + return rt2; } }; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index 1a608a7a588..e6da5ae0c66 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -83,6 +83,9 @@ int main () rs2.extract_solid_elements(list_output); + std::cout <<"(-------------List OUTPUT---------- )" << std::endl; + + for (Output_Vertex_Iterator it = list_output.vertices_start(); it != list_output.vertices_beyond(); it++) { print_vertex(*it); @@ -96,7 +99,7 @@ int main () //------- - std::cout <<"(------------------------ )" << std::endl; + std::cout <<"(-------------OFF OUTPUT----------- )" << std::endl; From 167f93f956c72f9b866c908ff8943834a372fb63 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 17 Jul 2014 13:11:53 +0200 Subject: [PATCH 032/201] Changed TDS to Triangulation in OutputModule --- Reconstruction_simplification_2/include/CGAL/Off_output.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 51db4c3eec6..fd3ee6752be 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -122,7 +122,10 @@ public: \param os The `std::ostream` where the OFF data will be written to. */ void get_os_output(std::ostream& os) { - os << "OFF [" << list_output.vertex_count() << "][0][" << + std::set edge_vertices; + vertices_of_edges(edge_vertices); + + os << "OFF [" << list_output.vertex_count() + edge_vertices.size() << "][0][" << list_output.edge_count() << "]" << std::endl; for (Output_Vertex_Iterator it = list_output.vertices_start(); @@ -130,8 +133,6 @@ public: save_one_vertex(os, *it); } - std::set edge_vertices; - vertices_of_edges(edge_vertices); for (typename std::set::iterator it = edge_vertices.begin(); it != edge_vertices.end(); it++) { From 6b69cbf2d962eee11fe5064a01cc6c2b773bf37f Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 17 Jul 2014 13:30:16 +0200 Subject: [PATCH 033/201] TDS_ouptut added to test --- .../include/CGAL/Tds_output.h | 8 +++----- .../test_list_output.cpp | 13 +++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 927acef9207..564743a0cc0 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -60,16 +60,14 @@ private: public: void store_marked_elements(Rt_2& rt2, int nb_ignore) { - rt2 = rt2; + m_rt2 = rt2; } - Tds_2 get_reconstruction_tds() { - return rt2; + void extract_reconstruction_tds(Rt_2& rt2) { + rt2 = m_rt2; } - }; } - #endif /* TDS_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index e6da5ae0c66..7fb793594ab 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,8 @@ typedef CGAL::Reconstruction_simplification_2 ::Vertex Vertex; +typedef CGAL::Reconstruction_triangulation_2 Rt_2; + typedef CGAL::List_output::Output_Vertex_Iterator Output_Vertex_Iterator; typedef CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; @@ -101,8 +104,6 @@ int main () //------- std::cout <<"(-------------OFF OUTPUT----------- )" << std::endl; - - CGAL::Off_output off_output; rs2.extract_solid_elements(off_output); @@ -110,6 +111,14 @@ int main () off_output.get_os_output(std::cout); + //------- + std::cout <<"(-------------TRI OUTPUT----------- )" << std::endl; + + CGAL::Tds_output tds_output; + Rt_2 rt2; + tds_output.extract_reconstruction_tds(rt2); + + } From 2581626c2b9fba29a2e2f8206acee979200dbea1 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 17 Jul 2014 13:42:07 +0200 Subject: [PATCH 034/201] code clean --- .../include/CGAL/List_output.h | 57 ++----------------- 1 file changed, 4 insertions(+), 53 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index bf89e9a8a65..9af6b372614 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -26,7 +26,6 @@ //local #include -#include // boost @@ -55,18 +54,11 @@ template class List_output { public: typedef typename Kernel::FT FT; - typedef Cost Cost; typedef Reconstruction_triangulation_2 Rt_2; - typedef typename Kernel::Segment_2 Segment; - typedef typename Kernel::Point_2 Point; - - typedef typename Rt_2::Vertex_handle Vertex_handle; - - typedef typename Rt_2::Edge_iterator Edge_iterator; - typedef typename Rt_2::Vertex_iterator Vertex_iterator; typedef typename Rt_2::Vertex Vertex; typedef typename Rt_2::Edge Edge; + typedef typename Rt_2::Vertex_iterator Vertex_iterator; typedef std::list Vertices; typedef std::list Edges; @@ -85,47 +77,6 @@ private: Vertices vertices; Edges edges; - FT get_mass(const Edge& edge) const { - return edge.first->mass(edge.second); - } - - const Cost& get_cost(const Edge& edge) const { - return edge.first->cost(edge.second); - } - - Vertex_handle source_vertex(const Edge& edge) const { - return edge.first->vertex(Rt_2::ccw(edge.second)); - } - - Vertex_handle target_vertex(const Edge& edge) const { - return edge.first->vertex(Rt_2::cw(edge.second)); - } - - Segment get_segment(const Edge& edge) const { - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - return Segment(ps, pt); - } - - FT get_length(const Edge& edge) const { - Segment segment = get_segment(edge); - return std::sqrt(segment.squared_length()); - } - - FT get_edge_relevance(const Edge& edge) const { - FT M = get_mass(edge); - if (M == 0.0) - return 0.0; - - FT L = get_length(edge); - FT cost = get_cost(edge).finalize(); - return M * L * L / cost; - } - - bool is_ghost(const Edge& edge) const { - return edge.first->ghost(edge.second); - } - public: inline Output_Vertex_Iterator vertices_start() const { return vertices.begin(); @@ -168,7 +119,7 @@ public: typename Rt_2::Edge_circulator cur = start; do { - if (!is_ghost(*cur)) { + if (!rt2.is_ghost(*cur)) { incident_edges_have_sample = true; break; @@ -188,8 +139,8 @@ public: for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { Edge edge = *ei; - if (is_ghost(edge)) continue; - FT value = get_edge_relevance(edge); // >= 0 + if (rt2.is_ghost(edge)) continue; + FT value = rt2.get_edge_relevance(edge); // >= 0 mindex.insert(Reconstruction_edge_2(edge, value)); } From ef884451a68dc5365d3d19173106dc48a6792047 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 18 Jul 2014 14:41:36 +0200 Subject: [PATCH 035/201] Fix typedefs (they were somehow recursive) --- .../CGAL/Reconstruction_triangulation_2.h | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 08169d43589..c1b40f839f5 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -78,7 +78,7 @@ class Reconstruction_triangulation_2: public Delaunay_triangulation_2 { public: - typedef Reconstruction_triangulation_2 Rt_2; + typedef Delaunay_triangulation_2 Base; typedef typename Kernel::FT FT; typedef typename Kernel::Point_2 Point; @@ -88,22 +88,22 @@ public: typedef typename Kernel::Segment_2 Segment; typedef typename Kernel::Triangle_2 Triangle; - typedef typename Rt_2::Vertex Vertex; - typedef typename Rt_2::Vertex_handle Vertex_handle; - typedef typename Rt_2::Vertex_iterator Vertex_iterator; - typedef typename Rt_2::Vertex_circulator Vertex_circulator; - typedef typename Rt_2::Finite_vertices_iterator Finite_vertices_iterator; + typedef typename Base::Vertex Vertex; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Vertex_iterator Vertex_iterator; + typedef typename Base::Vertex_circulator Vertex_circulator; + typedef typename Base::Finite_vertices_iterator Finite_vertices_iterator; - typedef typename Rt_2::Edge Edge; - typedef typename Rt_2::Edge_iterator Edge_iterator; - typedef typename Rt_2::Edge_circulator Edge_circulator; - typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; + typedef typename Base::Edge Edge; + typedef typename Base::Edge_iterator Edge_iterator; + typedef typename Base::Edge_circulator Edge_circulator; + typedef typename Base::Finite_edges_iterator Finite_edges_iterator; - typedef typename Rt_2::Face Face; - typedef typename Rt_2::Face_handle Face_handle; - typedef typename Rt_2::Face_iterator Face_iterator; - typedef typename Rt_2::Face_circulator Face_circulator; - typedef typename Rt_2::Finite_faces_iterator Finite_faces_iterator; + typedef typename Base::Face Face; + typedef typename Base::Face_handle Face_handle; + typedef typename Base::Face_iterator Face_iterator; + typedef typename Base::Face_circulator Face_circulator; + typedef typename Base::Finite_faces_iterator Finite_faces_iterator; typedef std::map > Vertex_handle_map; @@ -164,9 +164,9 @@ public: } Edge random_finite_edge() { - int nbf = Rt_2::number_of_faces(); + int nbf = Base::number_of_faces(); int offset = random_int(0, nbf - 1); - Finite_faces_iterator fi = Rt_2::finite_faces_begin(); + Finite_faces_iterator fi = Base::finite_faces_begin(); for (int i = 0; i < offset; i++) fi++; Face_handle face = fi; @@ -177,11 +177,11 @@ public: // ACCESS // Vertex_handle source_vertex(const Edge& edge) const { - return edge.first->vertex(Rt_2::ccw(edge.second)); + return edge.first->vertex(Base::ccw(edge.second)); } Vertex_handle target_vertex(const Edge& edge) const { - return edge.first->vertex(Rt_2::cw(edge.second)); + return edge.first->vertex(Base::cw(edge.second)); } Vertex_handle opposite_vertex(const Edge& edge) const { @@ -199,18 +199,18 @@ public: Face_handle f = edge.first; Vertex_handle v = source_vertex(edge); Face_handle nf = f->neighbor(edge.second); - return Edge(nf, Rt_2::ccw(nf->index(v))); + return Edge(nf, Base::ccw(nf->index(v))); } Edge next_edge(const Edge& edge) const { Face_handle f = edge.first; - int index = Rt_2::ccw(edge.second); + int index = Base::ccw(edge.second); return Edge(f, index); } Edge prev_edge(const Edge& edge) const { Face_handle f = edge.first; - int index = Rt_2::cw(edge.second); + int index = Base::cw(edge.second); return Edge(f, index); } @@ -242,7 +242,7 @@ public: void get_vertices_from_vertex_link(Vertex_handle vertex, Vertex_handle_set& vertices) const { - Vertex_circulator vcirc = Rt_2::incident_vertices(vertex); + Vertex_circulator vcirc = Base::incident_vertices(vertex); Vertex_circulator vend = vcirc; CGAL_For_all(vcirc, vend) { @@ -255,7 +255,7 @@ public: // 'outward' chooses the orientation of the boundary void get_edges_from_star_minus_link(Vertex_handle vertex, Edge_list& hull, bool outward = false) const { - Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fcirc = Base::incident_faces(vertex); Face_circulator fend = fcirc; CGAL_For_all(fcirc, fend) { @@ -345,7 +345,7 @@ public: void collect_samples_from_vertex(Vertex_handle vertex, Sample_list& samples, bool cleanup) { - Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fcirc = Base::incident_faces(vertex); Face_circulator fend = fcirc; CGAL_For_all(fcirc, fend) { @@ -372,15 +372,15 @@ public: } void collect_all_samples(Sample_list& samples) { - for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); - ei != Rt_2::finite_edges_end(); ++ei) { + for (Finite_edges_iterator ei = Base::finite_edges_begin(); + ei != Base::finite_edges_end(); ++ei) { Edge edge = *ei; Edge twin = twin_edge(edge); collect_samples_from_edge(edge, samples); collect_samples_from_edge(twin, samples); } - for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); - vi != Rt_2::finite_vertices_end(); ++vi) { + for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); + vi != Base::finite_vertices_end(); ++vi) { Vertex_handle v = vi; Sample* sample = v->get_sample(); if (sample) @@ -389,12 +389,12 @@ public: } void cleanup_assignments() { - for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); - fi != Rt_2::finite_faces_end(); ++fi) { + for (Finite_faces_iterator fi = Base::finite_faces_begin(); + fi != Base::finite_faces_end(); ++fi) { fi->clean_all_samples(); } - for (Finite_vertices_iterator vi = Rt_2::finite_vertices_begin(); - vi != Rt_2::finite_vertices_end(); ++vi) { + for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); + vi != Base::finite_vertices_end(); ++vi) { vi->set_sample(NULL); } } @@ -403,8 +403,8 @@ public: Cost compute_total_cost() const { Cost sum; - for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); - ei != Rt_2::finite_edges_end(); ++ei) { + for (Finite_edges_iterator ei = Base::finite_edges_begin(); + ei != Base::finite_edges_end(); ++ei) { Edge edge = *ei; const Cost& cost = get_cost(edge); sum.update_max(cost); @@ -416,7 +416,7 @@ public: Cost compute_cost_around_vertex(Vertex_handle vertex) const { Cost inner; Cost outer; - Face_circulator fcirc = Rt_2::incident_faces(vertex); + Face_circulator fcirc = Base::incident_faces(vertex); Face_circulator fend = fcirc; CGAL_For_all(fcirc, fend) { @@ -424,17 +424,17 @@ public: int index = face->index(vertex); Edge edge(face, index); - Cost cost = Rt_2::get_cost(edge); + Cost cost = get_cost(edge); outer.update_max(cost); outer.add(cost); - edge = Rt_2::next_edge(edge); - cost = Rt_2::get_cost(edge); + edge = next_edge(edge); + cost = get_cost(edge); inner.update_max(cost); inner.add(cost); - edge = Rt_2::next_edge(edge); - cost = Rt_2::get_cost(edge); + edge = next_edge(edge); + cost = get_cost(edge); inner.update_max(cost); inner.add(cost); } @@ -449,8 +449,8 @@ public: } void reset_all_costs() { - for (Finite_edges_iterator ei = Rt_2::finite_edges_begin(); - ei != Rt_2::finite_edges_end(); ++ei) { + for (Finite_edges_iterator ei = Base::finite_edges_begin(); + ei != Base::finite_edges_end(); ++ei) { Edge edge = *ei; update_cost(edge); } @@ -607,9 +607,9 @@ public: bool assign_sample(Sample* sample) { const Point& point = sample->point(); - Face_handle face = Rt_2::locate(point); + Face_handle face = Base::locate(point); - if (face == Face_handle() || Rt_2::is_infinite(face)) { + if (face == Face_handle() || Base::is_infinite(face)) { std::cout << "free bird" << std::endl; return false; } @@ -628,8 +628,8 @@ public: bool assign_sample_brute_force(Sample* sample) { const Point& point = sample->point(); Face_handle nearest_face = Face_handle(); - for (Finite_faces_iterator fi = Rt_2::finite_faces_begin(); - fi != Rt_2::finite_faces_end(); ++fi) { + for (Finite_faces_iterator fi = Base::finite_faces_begin(); + fi != Base::finite_faces_end(); ++fi) { Face_handle face = fi; if (face_has_point(face, point)) { nearest_face = face; @@ -829,9 +829,9 @@ public: bool is_flippable(const Edge& edge) const { Edge twin = twin_edge(edge); - if (Rt_2::is_infinite(twin.first)) + if (Base::is_infinite(twin.first)) return false; - if (Rt_2::is_infinite(edge.first)) + if (Base::is_infinite(edge.first)) return false; Vertex_handle vs = source_vertex(edge); @@ -921,7 +921,7 @@ public: Vertex_handle t = target_vertex(st); Edge sc = twin_edge(prev_edge(sb)); - Rt_2::tds().flip(sb.first, sb.second); + Base::tds().flip(sb.first, sb.second); Edge ac = prev_edge(twin_edge(sc)); Vertex_handle a = source_vertex(ac); @@ -938,7 +938,7 @@ public: } Edge twin = twin_edge(edge); - Rt_2::tds().join_vertices(twin); + Base::tds().join_vertices(twin); } // (a,b,c) + (c,b,a) + (a,c,i) + (c,a,j) -> From 8ee326b842d744abe1d456ca863f9a9ed7e3d564 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 18 Jul 2014 15:50:28 +0200 Subject: [PATCH 036/201] Tds_output implemented --- .../include/CGAL/List_output.h | 4 -- .../include/CGAL/Off_output.h | 5 +- .../include/CGAL/Reconstruction_face_base_2.h | 15 ++++++ .../CGAL/Reconstruction_vertex_base_2.h | 5 ++ .../include/CGAL/Tds_output.h | 52 +++++++++++++++++-- .../test_list_output.cpp | 33 +++++++++--- 6 files changed, 96 insertions(+), 18 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 9af6b372614..8675cb9dbe0 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -70,10 +70,7 @@ public: typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; - - private: - Vertices vertices; Edges edges; @@ -94,7 +91,6 @@ public: return edges.end(); } - void clear() { vertices.clear(); edges.clear(); diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index fd3ee6752be..b896ec2e877 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -114,7 +114,6 @@ public: list_output.store_marked_elements(rt2, nb_ignore); } - /*! Writes the edges and vertices of the output simplex into an `std::ostream` in the OFF format. @@ -125,8 +124,8 @@ public: std::set edge_vertices; vertices_of_edges(edge_vertices); - os << "OFF [" << list_output.vertex_count() + edge_vertices.size() << "][0][" << - list_output.edge_count() << "]" << std::endl; + os << "OFF " << list_output.vertex_count() + edge_vertices.size() << + " 0 " << list_output.edge_count() << std::endl; for (Output_Vertex_Iterator it = list_output.vertices_start(); it != list_output.vertices_beyond(); it++) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index f9a4ac2267d..0bd6e50bea0 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -64,6 +64,8 @@ private: Cost m_cost1[3]; int m_plan[3]; + FT m_relevance[3]; + public: Reconstruction_face_base_2() : Base() @@ -112,6 +114,10 @@ public: m_plan[0] = f->plan(0); m_plan[1] = f->plan(1); m_plan[2] = f->plan(2); + + m_relevance[0] = f->relevance(0); + m_relevance[1] = f->relevance(1); + m_relevance[2] = f->relevance(2); } virtual ~Reconstruction_face_base_2() @@ -136,6 +142,11 @@ public: m_plan[0] = 0; m_plan[1] = 0; m_plan[2] = 0; + + m_relevance[0] = 0; + m_relevance[1] = 0; + m_relevance[2] = 0; + } const int plan(int edge) const { return m_plan[edge]; } @@ -150,6 +161,10 @@ public: const Cost& edge_cost(int edge) const { return m_cost1[edge]; } Cost& edge_cost(int edge) { return m_cost1[edge]; } + const FT& relevance(int edge) const { return m_relevance[edge]; } + FT& relevance(int edge) { return m_relevance[edge]; } + + const Cost& cost(int edge) const { if (plan(edge) == 0) return vertex_cost(edge); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index bb70f257621..627bb8de12c 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -54,6 +54,7 @@ private: Point m_relocated; FT m_relevance; + public: Reconstruction_vertex_base_2() : Base() @@ -61,6 +62,7 @@ public: m_id = -1; m_pinned = false; m_sample = NULL; + m_relevance = 0; } Reconstruction_vertex_base_2(const Point & p) @@ -69,6 +71,7 @@ public: m_id = -1; m_pinned = false; m_sample = NULL; + m_relevance = 0; } Reconstruction_vertex_base_2(Face_handle f) @@ -77,6 +80,7 @@ public: m_id = -1; m_pinned = false; m_sample = NULL; + m_relevance = 0; } Reconstruction_vertex_base_2(const Point & p, Face_handle f) @@ -85,6 +89,7 @@ public: m_id = -1; m_pinned = false; m_sample = NULL; + m_relevance = 0; } virtual ~Reconstruction_vertex_base_2() { } diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 564743a0cc0..9e3f96eb5da 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -37,6 +37,7 @@ namespace CGAL { + /*! \ingroup PkgReconstructionSimplification2Models @@ -53,14 +54,59 @@ template class Tds_output { public: typedef Reconstruction_triangulation_2 Rt_2; - typedef typename Rt_2::Triangulation_data_structure Tds_2; + typedef typename Kernel::FT FT; + + typedef typename Rt_2::Vertex Vertex; + typedef typename Rt_2::Edge Edge; + typedef typename Rt_2::Vertex_iterator Vertex_iterator; + typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; + private: Rt_2 m_rt2; + void mark_vertices() { + for (Vertex_iterator vi = m_rt2.vertices_begin(); + vi != m_rt2.vertices_end(); ++vi) + { + + bool incident_edges_have_sample = false; + typename Rt_2::Edge_circulator start = m_rt2.incident_edges(vi); + typename Rt_2::Edge_circulator cur = start; + + do { + if (!m_rt2.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) + (*vi).set_relevance(1); + } + } + } + + void mark_edges() { + + for (Finite_edges_iterator ei = m_rt2.finite_edges_begin(); ei != m_rt2.finite_edges_end(); ++ei) + { + Edge edge = *ei; + FT relevance = 0; + if (!m_rt2.is_ghost(edge)) { + relevance = m_rt2.get_edge_relevance(edge); // >= 0 + } + edge.first->relevance(edge.second) = relevance; + } + } + public: - void store_marked_elements(Rt_2& rt2, int nb_ignore) { - m_rt2 = rt2; + void store_marked_elements(Rt_2& rt2, int nb_ignore) { + m_rt2 = rt2; + mark_vertices(); + mark_edges(); } void extract_reconstruction_tds(Rt_2& rt2) { diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index 7fb793594ab..1ad1dee8e2e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -41,6 +41,9 @@ typedef CGAL::Reconstruction_triangulation_2 Rt_2; typedef CGAL::List_output::Output_Vertex_Iterator Output_Vertex_Iterator; typedef CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; +typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; +typedef typename Rt_2::Vertex_iterator Vertex_iterator; + PointMassList* load_xy_file(const std::string& fileName); @@ -56,8 +59,8 @@ void print_edge(R_edge_2 edge) { int i = ((edge).edge()).second; Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); - std::cout <<"( " << (edge).priority() << ") ( " << a - << " , " << b << " )" << std::endl; + std::cout << "( " << a << " , " << b << " )" << std::endl; + //"( " << (edge).priority() << ") } @@ -99,15 +102,11 @@ int main () print_edge(*it); } - - //------- std::cout <<"(-------------OFF OUTPUT----------- )" << std::endl; CGAL::Off_output off_output; - rs2.extract_solid_elements(off_output); - off_output.get_os_output(std::cout); @@ -115,15 +114,33 @@ int main () std::cout <<"(-------------TRI OUTPUT----------- )" << std::endl; CGAL::Tds_output tds_output; + rs2.extract_solid_elements(tds_output); Rt_2 rt2; tds_output.extract_reconstruction_tds(rt2); + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) { + FT relevance = (*vi).get_relevance(); + if (relevance <= 0) + continue; + + print_vertex(*vi); + + } + + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { + FT relevance = (*ei).first->relevance((*ei).second); + if (relevance <= 0) + continue; + + std::cout << relevance; + print_edge(*ei); + (*ei).first->relevance((*ei).second); + } } - - PointMassList* simple_point_set() { PointMassList *points = new PointMassList(); From 0f1786530121d5bc8249e3b0a397f298e9fac438 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 18 Jul 2014 17:56:42 +0200 Subject: [PATCH 037/201] Dataype changed in List__output --- .../include/CGAL/List_output.h | 13 ++++++---- .../CGAL/Reconstruction_simplification_2.h | 4 ---- .../CGAL/Reconstruction_triangulation_2.h | 2 +- .../test_list_output.cpp | 24 ++++++++++--------- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 8675cb9dbe0..be3ee626a5a 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -54,14 +54,17 @@ template class List_output { public: typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; + typedef typename Kernel::Segment_2 Segment; + typedef Reconstruction_triangulation_2 Rt_2; typedef typename Rt_2::Vertex Vertex; typedef typename Rt_2::Edge Edge; typedef typename Rt_2::Vertex_iterator Vertex_iterator; - typedef std::list Vertices; - typedef std::list Edges; + typedef std::list Vertices; + typedef std::list Edges; typedef typename Vertices::const_iterator Output_Vertex_Iterator; typedef typename Edges::const_iterator Output_Edge_Iterator; @@ -116,7 +119,6 @@ public: do { if (!rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; break; } @@ -125,7 +127,7 @@ public: if (!incident_edges_have_sample) { if ((*vi).has_sample_assigned()) - vertices.push_back(*vi); + vertices.push_back((*vi).point()); } } } @@ -153,7 +155,8 @@ public: { Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); (mindex.template get<0>()).erase(pedge); - edges.push_back(pedge.edge()); + Segment s(pedge.source()->point(), pedge.target()->point()); + edges.push_back(s); } } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7e3a79c2a88..43c275a6564 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -20,7 +20,6 @@ #ifndef RECONSTRUCTION_SIMPLIFICATION_2_H_ #define RECONSTRUCTION_SIMPLIFICATION_2_H_ - #include #include #include @@ -29,7 +28,6 @@ #include - #include #include #include @@ -40,10 +38,8 @@ #include #include - namespace CGAL { - /*! \ingroup PkgReconstructionSimplification2Classes diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index c1b40f839f5..19c2bdcb40a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -78,7 +78,7 @@ class Reconstruction_triangulation_2: public Delaunay_triangulation_2 { public: - typedef Delaunay_triangulation_2 Base; + typedef Delaunay_triangulation_2 Base; typedef typename Kernel::FT FT; typedef typename Kernel::Point_2 Point; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index 1ad1dee8e2e..6ff2bf03e4f 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -21,7 +21,9 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; + typedef K::FT FT; typedef std::pair PointMassPair; @@ -50,21 +52,22 @@ PointMassList* load_xy_file(const std::string& fileName); PointMassList* simple_point_set(); -void print_vertex(Vertex vertex) { - std::cout <<"vertex " << vertex << std::endl; +void print_vertex(Point vertex) { + std::cout << vertex << std::endl; } -void print_edge(R_edge_2 edge) { - int i = ((edge).edge()).second; +void print_edge(Segment edge) { + /*int i = ((edge).edge()).second; Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); - std::cout << "( " << a << " , " << b << " )" << std::endl; + std::cout << "( " << a << " , " << b << " )" << std::endl;*/ //"( " << (edge).priority() << ") + + + std::cout << edge << std::endl; } - - int main () { @@ -100,7 +103,7 @@ int main () for (Output_Edge_Iterator it = list_output.edges_start(); it != list_output.edges_beyond(); it++) { print_edge(*it); - } + }/* //------- std::cout <<"(-------------OFF OUTPUT----------- )" << std::endl; @@ -127,7 +130,6 @@ int main () continue; print_vertex(*vi); - } for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { @@ -138,7 +140,7 @@ int main () std::cout << relevance; print_edge(*ei); (*ei).first->relevance((*ei).second); - } + }*/ } PointMassList* simple_point_set() { From d75a897cb8e69873b084cc69df58a565b8b6c820 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 21 Jul 2014 15:23:15 +0200 Subject: [PATCH 038/201] Listoutput implemented with OutputIterator --- .../CGAL/regular_neighbor_coordinates_2.h | 2 +- .../internal/triangulation_helpers_3.h | 1 + .../include/CGAL/List_output.h | 48 ++++---------- .../include/CGAL/Off_output.h | 65 +++++++++---------- .../test_list_output.cpp | 54 +++++++-------- 5 files changed, 71 insertions(+), 99 deletions(-) diff --git a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h index 2f206dfc346..95754b8a8f1 100644 --- a/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h +++ b/Interpolation/include/CGAL/regular_neighbor_coordinates_2.h @@ -47,7 +47,7 @@ template Triple< OutputIterator, typename Rt::Geom_traits::FT, bool > regular_neighbor_coordinates_vertex_2(const Rt& rt, const typename Rt::Weighted_point& p, - OutputIterator out) + OutputIterator F) { return regular_neighbor_coordinates_vertex_2(rt, p, out, typename Rt::Face_handle()); diff --git a/Kinetic_data_structures/include/CGAL/Kinetic/internal/triangulation_helpers_3.h b/Kinetic_data_structures/include/CGAL/Kinetic/internal/triangulation_helpers_3.h index 07b3064af8a..2902eea1671 100644 --- a/Kinetic_data_structures/include/CGAL/Kinetic/internal/triangulation_helpers_3.h +++ b/Kinetic_data_structures/include/CGAL/Kinetic/internal/triangulation_helpers_3.h @@ -239,6 +239,7 @@ CGAL_postcondition_code(do {) CGAL_postcondition_code(++cc); CGAL_postcondition_code(} while (cc != ce)); return ret;*/ + } diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index be3ee626a5a..552b2f4603e 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -50,7 +50,7 @@ isolated vertices and the edges of the reconstructed shape \tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. */ -template +template class List_output { public: typedef typename Kernel::FT FT; @@ -65,8 +65,6 @@ public: typedef std::list Vertices; typedef std::list Edges; - typedef typename Vertices::const_iterator Output_Vertex_Iterator; - typedef typename Edges::const_iterator Output_Edge_Iterator; typedef typename Rt_2::Reconstruction_edge_2 Reconstruction_edge_2; typedef typename Rt_2::MultiIndex MultiIndex; @@ -74,38 +72,13 @@ public: typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; private: - Vertices vertices; - Edges edges; - + Output_Vertex_Iterator m_v_it; + Output_Edge_Iterator m_e_it; public: - inline Output_Vertex_Iterator vertices_start() const { - return vertices.begin(); - } - inline Output_Vertex_Iterator vertices_beyond() const { - return vertices.end(); - } + List_output(Output_Vertex_Iterator v_it, Output_Edge_Iterator e_it) : + m_v_it(v_it), m_e_it(e_it) { } - inline Output_Edge_Iterator edges_start() const { - return edges.begin(); - } - - inline Output_Edge_Iterator edges_beyond() const { - return edges.end(); - } - - void clear() { - vertices.clear(); - edges.clear(); - } - - int vertex_count() { - return vertices.size(); - } - - int edge_count() { - return edges.size(); - } void store_marked_vertices(Rt_2& rt2) { @@ -126,8 +99,11 @@ public: } while (cur != start); if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) - vertices.push_back((*vi).point()); + if ((*vi).has_sample_assigned()) { + Point p = (*vi).point(); + *m_v_it = p; + m_v_it++; + } } } } @@ -156,7 +132,9 @@ public: Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); (mindex.template get<0>()).erase(pedge); Segment s(pedge.source()->point(), pedge.target()->point()); - edges.push_back(s); + //edges.push_back(s); + *m_e_it = s; + m_e_it++; } } diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index b896ec2e877..84d23d1fbe5 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -58,30 +58,23 @@ class Off_output { public: typedef Reconstruction_triangulation_2 Rt_2; typedef typename Rt_2::Triangulation_data_structure Tds_2; - typedef typename Rt_2::Edge Edge; - typedef typename Rt_2::Vertex Vertex; typedef typename Kernel::Point_2 Point; - + typedef typename Kernel::Segment_2 Segment; typedef typename Rt_2::Face_handle Face_handle; - typedef typename CGAL::List_output::Output_Vertex_Iterator - Output_Vertex_Iterator; - - typedef typename CGAL::List_output::Output_Edge_Iterator - Output_Edge_Iterator; private: - List_output list_output; + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; + + std::vector isolated_points; + std::vector edges; + + CGAL::List_output list_output; - void save_one_vertex(std::ostream& os, const Vertex& v) { - os << v << std::endl; - } - - void save_one_edge(std::ostream& os, const Edge& edge, std::set& edge_vertices) { - int i = edge.second; - Face_handle face = edge.first; - Point a = face->vertex((i+1)%3)->point(); - Point b = face->vertex((i+2)%3)->point(); + void save_one_edge(std::ostream& os, const Segment& edge, std::set& edge_vertices) { + Point a = edge.source(); + Point b = edge.target(); typename std::set::iterator it_a = edge_vertices.find(a); typename std::set::iterator it_b = edge_vertices.find(b); @@ -89,19 +82,17 @@ private: int pos_a = std::distance(edge_vertices.begin(), it_a); int pos_b = std::distance(edge_vertices.begin(), it_b); - os << "2 " << pos_a + list_output.vertex_count() << " " - << pos_b + list_output.vertex_count() << std::endl; + os << "2 " << pos_a + isolated_points.size() << " " + << pos_b + isolated_points.size() << std::endl; } void vertices_of_edges(std::set& edge_vertices) { - for (Output_Edge_Iterator it = list_output.edges_start(); - it != list_output.edges_beyond(); it++) { + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { - int i = (*it).second; - Face_handle face = (*it).first; - Point a = face->vertex((i+1)%3)->point(); - Point b = face->vertex((i+2)%3)->point(); + Point a = (*it).source(); + Point b = (*it).target(); edge_vertices.insert(a); edge_vertices.insert(b); @@ -110,6 +101,9 @@ private: public: + + Off_output() : list_output(Point_it(isolated_points), Edge_it(edges)) { } + void store_marked_elements(Rt_2& rt2, int nb_ignore) { list_output.store_marked_elements(rt2, nb_ignore); } @@ -124,29 +118,28 @@ public: std::set edge_vertices; vertices_of_edges(edge_vertices); - os << "OFF " << list_output.vertex_count() + edge_vertices.size() << - " 0 " << list_output.edge_count() << std::endl; + os << "OFF " << isolated_points.size() + edge_vertices.size() << + " 0 " << edges.size() << std::endl; - for (Output_Vertex_Iterator it = list_output.vertices_start(); - it != list_output.vertices_beyond(); it++) { - save_one_vertex(os, *it); + for (typename std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + os << *it << std::endl; } - for (typename std::set::iterator it = edge_vertices.begin(); it != edge_vertices.end(); it++) { os << *it << std::endl; } - for (int i = 0; i < list_output.vertex_count(); i++) { + for (int i = 0; i < isolated_points.size(); i++) { os << "1 " << i << std::endl; } - for (Output_Edge_Iterator it = list_output.edges_start(); - it != list_output.edges_beyond(); it++) { + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { - save_one_edge(os, *it,edge_vertices); + save_one_edge(os, *it,edge_vertices); } } }; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index 6ff2bf03e4f..cb966b50e8a 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -40,32 +40,22 @@ typedef CGAL::Reconstruction_simplification_2 Rt_2; -typedef CGAL::List_output::Output_Vertex_Iterator Output_Vertex_Iterator; -typedef CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; - typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; typedef typename Rt_2::Vertex_iterator Vertex_iterator; - +typedef typename Rt_2::Edge Edge; PointMassList* load_xy_file(const std::string& fileName); PointMassList* simple_point_set(); -void print_vertex(Point vertex) { - std::cout << vertex << std::endl; -} +void print_edge(Edge edge) { + int i = edge.second; + Point a = edge.first->vertex((i+1)%3)->point(); + Point b = edge.first->vertex((i+2)%3)->point(); + std::cout << "( " << a << " , " << b << " )" << std::endl; -void print_edge(Segment edge) { - /*int i = ((edge).edge()).second; - Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); - Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); - std::cout << "( " << a << " , " << b << " )" << std::endl;*/ - //"( " << (edge).priority() << ") - - - std::cout << edge << std::endl; } int main () @@ -88,22 +78,31 @@ int main () rs2.print_stats_debug(); - CGAL::List_output list_output; + std::vector isolated_points; + std::vector edges; + + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; + + Point_it point_it(isolated_points); + Edge_it edge_it(edges); + + CGAL::List_output list_output(point_it, edge_it); rs2.extract_solid_elements(list_output); std::cout <<"(-------------List OUTPUT---------- )" << std::endl; - - for (Output_Vertex_Iterator it = list_output.vertices_start(); - it != list_output.vertices_beyond(); it++) { - print_vertex(*it); + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + std::cout << *it << std::endl; } - for (Output_Edge_Iterator it = list_output.edges_start(); - it != list_output.edges_beyond(); it++) { - print_edge(*it); - }/* + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + } + //------- std::cout <<"(-------------OFF OUTPUT----------- )" << std::endl; @@ -129,7 +128,8 @@ int main () if (relevance <= 0) continue; - print_vertex(*vi); + std::cout << *vi << std::endl; + } for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { @@ -140,7 +140,7 @@ int main () std::cout << relevance; print_edge(*ei); (*ei).first->relevance((*ei).second); - }*/ + } } PointMassList* simple_point_set() { From 6bd72f76c3b5e7fc8147363e4d7f9c469baf50ef Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 21 Jul 2014 15:34:12 +0200 Subject: [PATCH 039/201] Listoutput implemented with OutputIterator --- .../test_list_output.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp index cb966b50e8a..c8666f5f149 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp @@ -54,7 +54,7 @@ void print_edge(Edge edge) { int i = edge.second; Point a = edge.first->vertex((i+1)%3)->point(); Point b = edge.first->vertex((i+2)%3)->point(); - std::cout << "( " << a << " , " << b << " )" << std::endl; + std::cout << a << " " << b << std::endl; } @@ -125,21 +125,15 @@ int main () vi != rt2.vertices_end(); ++vi) { FT relevance = (*vi).get_relevance(); - if (relevance <= 0) - continue; - - std::cout << *vi << std::endl; + if (relevance > 0) + std::cout << *vi << std::endl; } for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { FT relevance = (*ei).first->relevance((*ei).second); - if (relevance <= 0) - continue; - - std::cout << relevance; - print_edge(*ei); - (*ei).first->relevance((*ei).second); + if (relevance > 0) + print_edge(*ei); } } From ecc59ea166b2735b7774e6460e66525ea7cd598f Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 22 Jul 2014 17:35:14 +0200 Subject: [PATCH 040/201] 3 Tests for output modules implemented --- .../CGAL/Reconstruction_simplification_2.h | 42 +++-- .../CMakeLists.txt | 2 +- .../test_basic.cpp | 31 ---- ...ist_output.cpp => test_output_modules.cpp} | 157 +++++++++++------- 4 files changed, 123 insertions(+), 109 deletions(-) rename Reconstruction_simplification_2/test/Reconstruction_simplification_2/{test_list_output.cpp => test_output_modules.cpp} (56%) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 43c275a6564..fca4c7eb11f 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -252,6 +252,9 @@ protected: void initialize() { clear(); + + normalize_points(); + insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); init(start, beyond); @@ -263,12 +266,9 @@ protected: Sample* s = new Sample(point, mass); m_samples.push_back(s); } - assign_samples(m_samples.begin(), m_samples.end()); - } - /*! Returns the solid edges present after the reconstruction process. @@ -286,22 +286,38 @@ protected: output.store_marked_elements(m_dt, m_ignore); } - /// \cond SKIP_IN_MANUAL + template + Vector random_vec(const double scale) + { + double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + return Vector(dx, dy); + } + + void noise(const FT scale) + { + std::cerr << "noise by " << scale << "..."; + for (InputIterator it = start; it != beyond; it++) + { + Point point = get(point_pmap, *it); + point = point + random_vec(scale); + } + std::cerr << "done" << std::endl; + } void normalize_points() { - //noise(1e-5); TODO IV, killed that noise + noise(1e-5); compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); if (m_bbox_size == 0.0) return; Point center(m_bbox_x, m_bbox_y); - InputIterator it; - for (it = start; it != beyond; ++it) + for (InputIterator it = start; it != beyond; ++it) { - Sample& sample = *it; - Vector vec = (sample.point() - center) / m_bbox_size; - sample.point() = CGAL::ORIGIN + vec; + Point point = get(point_pmap, *it); + Vector vec = (point - center) / m_bbox_size; + point = CGAL::ORIGIN + vec; } m_bbox_x = m_bbox_y = 0.0; m_bbox_size = 1.0; @@ -309,17 +325,17 @@ protected: void compute_bbox(double &x, double &y, double &scale) - { + { FT x_min, x_max, y_min, y_max; InputIterator it = start; - Point p = it->point(); + Point p = get(point_pmap, *it); x_min = x_max = p.x(); y_min = y_max = p.y(); ++it; for ( ; it != beyond; ++it) { - p = it->point(); + p = get(point_pmap, *it); x_min = (std::min)(x_min, p.x()); x_max = (std::max)(x_max, p.x()); y_min = (std::min)(y_min, p.y()); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 99590d17625..8d15fb4780e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_list_output.cpp" ) + create_single_source_cgal_program( "test_output_modules.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index c860f478309..7de606744fd 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -28,22 +28,16 @@ typedef CGAL::value_type_traits::type MassPoint; typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; - PointMassList* load_xy_file(const std::string& fileName); -PointMassList* simple_point_set(); - int main () { - //use the stair example for testing PointMassList points = *(load_xy_file("data/stair-noise00.xy")); PointPMap point_pmap; MassPMap mass_pmap; - MassPoint mp; - CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); @@ -52,30 +46,6 @@ int main () rs2.reconstruct(100); //100 steps rs2.print_stats_debug(); - -} - - - -PointMassList* simple_point_set() { - - PointMassList *points = new PointMassList(); - - points->push_back(std::make_pair(Point(0.1,0.1), 1)); - points->push_back(std::make_pair(Point(0.4,0.1), 1)); - points->push_back(std::make_pair(Point(0.6,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.4), 1)); - points->push_back(std::make_pair(Point(0.9,0.6), 1)); - points->push_back(std::make_pair(Point(0.9,0.9), 1)); - points->push_back(std::make_pair(Point(0.6,0.9), 1)); - points->push_back(std::make_pair(Point(0.4,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.6), 1)); - points->push_back(std::make_pair(Point(0.1,0.4), 1)); - - return points; - } @@ -94,5 +64,4 @@ PointMassList* load_xy_file(const std::string& fileName) ifs.close(); return points; - } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp similarity index 56% rename from Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp rename to Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index c8666f5f149..b2ca26dca51 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_list_output.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -1,4 +1,4 @@ -// test_list_output.cpp +// test_output_modules.cpp //---------------------------------------------------------- // Test the cgal environment for Reconstruction_simplification_2 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include // std::pair @@ -45,16 +46,21 @@ typedef typename Rt_2::Vertex_iterator Vertex_iterator; typedef typename Rt_2::Edge Edge; +typedef typename CGAL::Reconstruction_simplification_2 Rs_2; + PointMassList* load_xy_file(const std::string& fileName); PointMassList* simple_point_set(); +void test_list_output(Rs_2& rs2); +void test_tds_output(Rs_2& rs2); +void test_off_output(Rs_2& rs2); void print_edge(Edge edge) { int i = edge.second; Point a = edge.first->vertex((i+1)%3)->point(); Point b = edge.first->vertex((i+2)%3)->point(); - std::cout << a << " " << b << std::endl; + std::cout << a << " , " << b << " )" << std::endl; } @@ -64,21 +70,23 @@ int main () //use the stair example for testing PointMassList points = *(load_xy_file("data/stair-noise00.xy")); - PointPMap point_pmap; - MassPMap mass_pmap; + PointPMap point_pmap; + MassPMap mass_pmap; - MassPoint mp; + Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); + rs2.initialize(); + rs2.reconstruct(100); //100 steps - CGAL::Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + test_list_output(rs2); + test_tds_output(rs2); + test_off_output(rs2); +} - rs2.initialize(); +void test_list_output(Rs_2& rs2) { - rs2.reconstruct(100); //100 steps + std::cout <<"(-------------List OUTPUT---------- )" << std::endl; - rs2.print_stats_debug(); - - std::vector isolated_points; + std::vector isolated_points; std::vector edges; typedef std::back_insert_iterator > Point_it; @@ -91,71 +99,92 @@ int main () rs2.extract_solid_elements(list_output); - std::cout <<"(-------------List OUTPUT---------- )" << std::endl; - - for (std::vector::iterator it = isolated_points.begin(); + int vertex_count = 0; + for (std::vector::iterator it = isolated_points.begin(); it != isolated_points.end(); it++) { + vertex_count++; std::cout << *it << std::endl; - } + } + assert(vertex_count == 18); - for (std::vector::iterator it = edges.begin(); + int edge_count = 0; + for (std::vector::iterator it = edges.begin(); it != edges.end(); it++) { std::cout << *it << std::endl; + edge_count++; } - - //------- - std::cout <<"(-------------OFF OUTPUT----------- )" << std::endl; - - CGAL::Off_output off_output; - rs2.extract_solid_elements(off_output); - off_output.get_os_output(std::cout); - - - //------- - std::cout <<"(-------------TRI OUTPUT----------- )" << std::endl; - - CGAL::Tds_output tds_output; - rs2.extract_solid_elements(tds_output); - Rt_2 rt2; - tds_output.extract_reconstruction_tds(rt2); - - - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) { - - FT relevance = (*vi).get_relevance(); - if (relevance > 0) - std::cout << *vi << std::endl; - - } - - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { - FT relevance = (*ei).first->relevance((*ei).second); - if (relevance > 0) - print_edge(*ei); - } } -PointMassList* simple_point_set() { +void test_tds_output(Rs_2& rs2) { - PointMassList *points = new PointMassList(); + std::cout <<"(-------------Tds OUTPUT---------- )" << std::endl; - points->push_back(std::make_pair(Point(0.1,0.1), 1)); - points->push_back(std::make_pair(Point(0.4,0.1), 1)); - points->push_back(std::make_pair(Point(0.6,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.4), 1)); - points->push_back(std::make_pair(Point(0.9,0.6), 1)); - points->push_back(std::make_pair(Point(0.9,0.9), 1)); - points->push_back(std::make_pair(Point(0.6,0.9), 1)); - points->push_back(std::make_pair(Point(0.4,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.6), 1)); - points->push_back(std::make_pair(Point(0.1,0.4), 1)); + CGAL::Tds_output tds_output; + rs2.extract_solid_elements(tds_output); + Rt_2 rt2; + tds_output.extract_reconstruction_tds(rt2); - return points; + int vertex_count = 0; + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) { + FT relevance = (*vi).get_relevance(); + if (relevance > 0) { + std::cout << *vi << std::endl; + vertex_count++; + } + } + assert(vertex_count == 18); + + int edge_count = 0; + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { + FT relevance = (*ei).first->relevance((*ei).second); + if (relevance > 0) { + print_edge(*ei); + edge_count++; + } + } + std::cout <<"edge_count " << edge_count << std::endl; + assert(edge_count == 31); + +} +void test_off_output(Rs_2& rs2) { + + std::cout <<"(-------------Off OUTPUT---------- )" << std::endl; + + CGAL::Off_output off_output; + + rs2.extract_solid_elements(off_output); + + //print + off_output.get_os_output(std::cout); + + //test cardinalities + std::ostringstream buffer; + off_output.get_os_output(buffer); + + std::stringstream stream(buffer.str()); + std::vector res; + while (1){ + std::string line; + std::getline(stream,line); + if (!stream.good()) + break; + res.push_back(line); + } + + assert(res.size() == 110); + + assert(res.front() == "OFF 60 0 31"); + + for (int i = 61; i < 79; i++) { + assert(res[i].substr(0,2) == "1 "); + } + + for (int i = 79; i < 110; i++) { + assert(res[i].substr(0,2) == "2 "); + } } From 98909c7f223942516be4f425e7cbdf0525c94e45 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 22 Jul 2014 17:41:24 +0200 Subject: [PATCH 041/201] removed normalization and perturabtion from init --- .../include/CGAL/Reconstruction_simplification_2.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index fca4c7eb11f..5b8e7456389 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -253,8 +253,6 @@ protected: clear(); - normalize_points(); - insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); init(start, beyond); @@ -294,8 +292,12 @@ protected: double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; return Vector(dx, dy); } + /// \endcond - void noise(const FT scale) + /*! + TODO COMMENT and change to perturb + */ + void noise(const FT scale) { std::cerr << "noise by " << scale << "..."; for (InputIterator it = start; it != beyond; it++) @@ -306,6 +308,9 @@ protected: std::cerr << "done" << std::endl; } + /*! + TODO COMMENT + */ void normalize_points() { noise(1e-5); @@ -323,7 +328,7 @@ protected: m_bbox_size = 1.0; } - + /// \cond SKIP_IN_MANUAL void compute_bbox(double &x, double &y, double &scale) { From 383e3645e7d6e714d80c280373551eff1bcf32b5 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 23 Jul 2014 18:12:50 +0200 Subject: [PATCH 042/201] edge contraction and priority queue tests implemented --- .../CGAL/Reconstruction_simplification_2.h | 42 ++-- .../CMakeLists.txt | 2 +- .../test_output_modules.cpp | 8 +- .../test_vertex_edge.cpp | 185 ++++++++++++++++++ 4 files changed, 211 insertions(+), 26 deletions(-) create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 5b8e7456389..24cd59dda34 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -295,9 +295,11 @@ protected: /// \endcond /*! - TODO COMMENT and change to perturb + Randomly perturbs theÊinput points. + + \param scale Coordinate-wise upper bound for the perturbation. */ - void noise(const FT scale) + void perturbe_points(const FT scale = 1e-5) { std::cerr << "noise by " << scale << "..."; for (InputIterator it = start; it != beyond; it++) @@ -309,11 +311,12 @@ protected: } /*! - TODO COMMENT + Normalizes the coordinates of the input points, i.e., + the input points get recentered. */ void normalize_points() { - noise(1e-5); + //perturbe_points(1e-5); compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); if (m_bbox_size == 0.0) return; @@ -331,7 +334,6 @@ protected: /// \cond SKIP_IN_MANUAL void compute_bbox(double &x, double &y, double &scale) { - FT x_min, x_max, y_min, y_max; InputIterator it = start; Point p = get(point_pmap, *it); @@ -422,8 +424,6 @@ protected: } // INIT // - - void insert_loose_bbox(const double x, const double y, const double size) { double timer = clock(); std::cerr << yellow << "insert loose bbox" << white << "..."; @@ -501,19 +501,6 @@ protected: } - bool decimate() { - bool ok; - Reconstruction_edge_2 pedge; - ok = pick_edge(m_mchoice, pedge); - if (!ok) - return false; - - ok = do_collapse(pedge.edge()); - if (!ok) - return false; - return true; - } - bool do_collapse(Edge edge) { bool ok; Vertex_handle s = m_dt.source_vertex(edge); @@ -635,7 +622,20 @@ protected: // PEDGE // - bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { + bool decimate() { + bool ok; + Reconstruction_edge_2 pedge; + ok = pick_edge(m_mchoice, pedge); + if (!ok) + return false; + + ok = do_collapse(pedge.edge()); + if (!ok) + return false; + return true; + } + +bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { Cost after_cost; bool ok = simulate_collapse(edge, after_cost); if (!ok) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 8d15fb4780e..1af8348672b 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_output_modules.cpp" ) + create_single_source_cgal_program( "test_vertex_edge.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index b2ca26dca51..ed947dcd02f 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -41,12 +41,12 @@ typedef CGAL::Reconstruction_simplification_2 Rt_2; -typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; -typedef typename Rt_2::Vertex_iterator Vertex_iterator; +typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; +typedef Rt_2::Vertex_iterator Vertex_iterator; -typedef typename Rt_2::Edge Edge; +typedef Rt_2::Edge Edge; -typedef typename CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; PointMassList* load_xy_file(const std::string& fileName); PointMassList* simple_point_set(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp new file mode 100644 index 00000000000..dde5712e881 --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -0,0 +1,185 @@ +// test_vertex_edge.cpp + +//---------------------------------------------------------- +// Test the cgal environment for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include // std::pair + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; +typedef PointMassList::const_iterator InputIterator; +typedef CGAL::value_type_traits::type MassPoint; +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + +typedef CGAL::Reconstruction_triangulation_2 Rt_2; +typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; + +typedef Rt_2::Edge Edge; +typedef Rt_2::Reconstruction_edge_2 R_edge_2; + +PointMassList* load_xy_file(const std::string& fileName); +PointMassList* simple_point_set(); +void test_num_of_vertices_in_triangulation(); +void test_edge_collapse(); + +int main () +{ + test_num_of_vertices_in_triangulation(); + test_edge_collapse(); +} + +void print_edge(R_edge_2 pedge) { + Edge edge = pedge.edge(); + + int i = edge.second; + Point a = edge.first->vertex((i+1)%3)->point(); + Point b = edge.first->vertex((i+2)%3)->point(); + std::cout << a << " , " << b << " : " << pedge.priority() << std::endl; + +} + + +void test_edge_collapse() { + std::cerr << "test_edge_collapse" << std::endl; + //use the stair example for testing + PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + + PointPMap point_pmap; + MassPMap mass_pmap; + + CGAL::Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.initialize(); + + + CGAL::Tds_output tds_output; + rs2.extract_solid_elements(tds_output); + + Rt_2 rt2; + tds_output.extract_reconstruction_tds(rt2); + + FT min_priority = 1000; + R_edge_2 contract_edge; + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); + ei != rt2.finite_edges_end(); ++ei) { + + R_edge_2 cur_r_edge; + if(!rs2.create_pedge(*ei, cur_r_edge)) + continue; + + print_edge(cur_r_edge); + + if (cur_r_edge.priority() < min_priority && cur_r_edge.priority() > 0) { + min_priority = cur_r_edge.priority(); + contract_edge = cur_r_edge; + } + } + + R_edge_2 pedge; + rs2.pick_edge(0, pedge); + + std::cout << "--------" << std::endl; + print_edge(contract_edge); + + print_edge(pedge); + + std::cout << "--------" << std::endl; + + //test that the right edge was picked for collapsing + assert(pedge == contract_edge); + rs2.do_collapse(contract_edge.edge()); + + bool found = false; + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); + ei != rt2.finite_edges_end(); ++ei) { + if (*ei == contract_edge.edge()) { + found = true; + break; + } + } + + //test that the edge was collapsed + assert(!found); +} + + +void test_num_of_vertices_in_triangulation() { + std::cerr << "test_num_of_vertices_in_triangulation" << std::endl; + + PointMassList points = *(simple_point_set()); + + CGAL::Reconstruction_simplification_2 rs2; + int nb = 0; + for (PointMassList::iterator it = points.begin(); it != points.end(); it++) { + PointMassPair pmp = *it; + Point point = pmp.first; + rs2.insert_point(point, false, nb++); + } + + CGAL::Tds_output tds_output; + rs2.extract_solid_elements(tds_output); + Rt_2 rt2; + tds_output.extract_reconstruction_tds(rt2); + + //test if vertices are indeed added to the Reconstruction_triangulation_2 + assert(points.size() == rt2.number_of_vertices()); +} + +PointMassList* simple_point_set() { + + PointMassList *points = new PointMassList(); + + points->push_back(std::make_pair(Point(0.1,0.1), 1)); + points->push_back(std::make_pair(Point(0.4,0.1), 1)); + points->push_back(std::make_pair(Point(0.6,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.4), 1)); + points->push_back(std::make_pair(Point(0.9,0.6), 1)); + points->push_back(std::make_pair(Point(0.9,0.9), 1)); + points->push_back(std::make_pair(Point(0.6,0.9), 1)); + points->push_back(std::make_pair(Point(0.4,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.6), 1)); + points->push_back(std::make_pair(Point(0.1,0.4), 1)); + + return points; +} + +PointMassList* load_xy_file(const std::string& fileName) +{ + PointMassList *points = new PointMassList(); + std::ifstream ifs(fileName); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points->push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + + return points; + +} From fa8fe58fa32eb0a77a61128071db609fd8975549 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 24 Jul 2014 12:59:50 +0200 Subject: [PATCH 043/201] reconstruction until test implemented --- .../CMakeLists.txt | 2 +- .../test_reconstruction_until.cpp | 115 ++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 1af8348672b..00e5d56f4c4 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_vertex_edge.cpp" ) + create_single_source_cgal_program( "test_reconstruction_until.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp new file mode 100644 index 00000000000..a20a693647e --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -0,0 +1,115 @@ +// test_reconstruction_until.cpp + +//---------------------------------------------------------- +// Test the cgal environment for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include +#include + +#include + +#include +#include +#include +#include // std::pair +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; +typedef K::Segment_2 Segment; + + +typedef std::pair PointMassPair; +typedef std::list PointMassList; +typedef PointMassList::const_iterator InputIterator; +typedef CGAL::value_type_traits::type MassPoint; +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + + +PointMassList* load_xy_file(const std::string& fileName); +PointMassList* simple_point_set(); + +int main () +{ + + //use the stair example for testing + PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + + PointPMap point_pmap; + MassPMap mass_pmap; + + MassPoint mp; + + CGAL::Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.initialize(); + + rs2.reconstruct_until(9); + + rs2.print_stats_debug(); + + std::vector isolated_points; + std::vector edges; + + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; + + Point_it point_it(isolated_points); + Edge_it edge_it(edges); + + CGAL::List_output list_output(point_it, edge_it); + rs2.extract_solid_elements(list_output); + + + std::cout << "isolated_points " << isolated_points.size() << std::endl; + std::cout << "edges " << edges.size() << std::endl; + + assert(isolated_points.size() == 0); + assert(edges.size() == 8); +} + + +PointMassList* simple_point_set() { + + PointMassList *points = new PointMassList(); + + points->push_back(std::make_pair(Point(0.0001, 0.00012), 1)); + points->push_back(std::make_pair(Point(1.00013, 0.00031), 1)); + points->push_back(std::make_pair(Point(0.50001, 0.500001), 1)); + points->push_back(std::make_pair(Point(0.5000011, 1.000012), 1)); + points->push_back(std::make_pair(Point(0.000012, 2.000001), 1)); + points->push_back(std::make_pair(Point(1.0000123, 2.0000012), 1)); + points->push_back(std::make_pair(Point(-0.50000182, 0.50000162), 1)); + points->push_back(std::make_pair(Point(-0.500001002, 1.000006012), 1)); + points->push_back(std::make_pair(Point(-1.0000331, 2.00001), 1)); + points->push_back(std::make_pair(Point(-1.000012, 0.000200012), 1)); + + return points; +} + + +PointMassList* load_xy_file(const std::string& fileName) +{ + PointMassList *points = new PointMassList(); + std::ifstream ifs(fileName); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points->push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + + return points; + +} From 545bfcb95c49b7cd5f1108379003e68bb5cb6aba Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 24 Jul 2014 13:02:53 +0200 Subject: [PATCH 044/201] removed normalization and perturbation functions --- .../CGAL/Reconstruction_simplification_2.h | 62 ------------------- 1 file changed, 62 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 24cd59dda34..acdbed3469b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -292,68 +292,6 @@ protected: double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; return Vector(dx, dy); } - /// \endcond - - /*! - Randomly perturbs theÊinput points. - - \param scale Coordinate-wise upper bound for the perturbation. - */ - void perturbe_points(const FT scale = 1e-5) - { - std::cerr << "noise by " << scale << "..."; - for (InputIterator it = start; it != beyond; it++) - { - Point point = get(point_pmap, *it); - point = point + random_vec(scale); - } - std::cerr << "done" << std::endl; - } - - /*! - Normalizes the coordinates of the input points, i.e., - the input points get recentered. - */ - void normalize_points() - { - //perturbe_points(1e-5); - compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); - if (m_bbox_size == 0.0) return; - - Point center(m_bbox_x, m_bbox_y); - for (InputIterator it = start; it != beyond; ++it) - { - Point point = get(point_pmap, *it); - Vector vec = (point - center) / m_bbox_size; - point = CGAL::ORIGIN + vec; - } - m_bbox_x = m_bbox_y = 0.0; - m_bbox_size = 1.0; - } - - /// \cond SKIP_IN_MANUAL - void compute_bbox(double &x, double &y, double &scale) - { - FT x_min, x_max, y_min, y_max; - InputIterator it = start; - Point p = get(point_pmap, *it); - x_min = x_max = p.x(); - y_min = y_max = p.y(); - ++it; - for ( ; it != beyond; ++it) - { - p = get(point_pmap, *it); - x_min = (std::min)(x_min, p.x()); - x_max = (std::max)(x_max, p.x()); - y_min = (std::min)(y_min, p.y()); - y_max = (std::max)(y_max, p.y()); - } - - x = 0.5 * (x_min + x_max); - y = 0.5 * (y_min + y_max); - scale = (std::max)(x_max - x_min, y_max - y_min); - if (scale == 0.0) scale = 1.0; - } void clear() { m_dt.clear(); From 29248c48596b075313f2c4fe10a1a21dae4238e7 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 24 Jul 2014 17:05:05 +0200 Subject: [PATCH 045/201] file loading refactored --- .../Reconstruction_simplification_2/scene.h | 40 +++++++++++----- .../CMakeLists.txt | 2 +- .../test_basic.cpp | 28 ++--------- .../test_output_modules.cpp | 33 +++---------- .../test_reconstruction_until.cpp | 48 ++----------------- .../test_vertex_edge.cpp | 24 +++------- .../testing_tools.h | 17 +++++++ 7 files changed, 68 insertions(+), 124 deletions(-) create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 967ef594ee4..711ef14828a 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -35,6 +35,9 @@ public: typedef CGAL::Reconstruction_simplification_2 R_s_2; + + typedef K::Segment_2 Segment; + typedef R_s_2::FT FT; typedef R_s_2::Point Point; typedef R_s_2::Vector Vector; @@ -77,8 +80,6 @@ public: typedef R_s_2::Reconstruction_edge_2 PEdge; - typedef CGAL::List_output::Output_Vertex_Iterator Output_Vertex_Iterator; - typedef CGAL::List_output::Output_Edge_Iterator Output_Edge_Iterator; private: // data @@ -403,19 +404,34 @@ public: void debug_print() { - CGAL::List_output list_output; - m_pwsrec->extract_solid_elements(list_output); + std::vector isolated_points; + std::vector edges; - for (Output_Vertex_Iterator it = list_output.vertices_start(); - it != list_output.vertices_beyond(); it++) { - print_vertex(*it); - } + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; - for (Output_Edge_Iterator it = list_output.edges_start(); - it != list_output.edges_beyond(); it++) { - print_edge(*it); - } + Point_it point_it(isolated_points); + Edge_it edge_it(edges); + + CGAL::List_output list_output(point_it, edge_it); + + m_pwsrec->extract_solid_elements(list_output); + + int vertex_count = 0; + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + vertex_count++; + std::cout << *it << std::endl; + } + assert(vertex_count == 18); + + int edge_count = 0; + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + edge_count++; + } } void save(const QString& filename) { diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 00e5d56f4c4..1af8348672b 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_reconstruction_until.cpp" ) + create_single_source_cgal_program( "test_vertex_edge.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 7de606744fd..cbf6697627a 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -6,8 +6,7 @@ #include #include - -#include +#include "testing_tools.h" #include #include @@ -23,17 +22,18 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; + typedef PointMassList::const_iterator InputIterator; -typedef CGAL::value_type_traits::type MassPoint; + typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; -PointMassList* load_xy_file(const std::string& fileName); int main () { + PointMassList points; //use the stair example for testing - PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + load_xy_file("data/stair-noise00.xy", points); PointPMap point_pmap; MassPMap mass_pmap; @@ -47,21 +47,3 @@ int main () rs2.print_stats_debug(); } - - -PointMassList* load_xy_file(const std::string& fileName) -{ - PointMassList *points = new PointMassList(); - std::ifstream ifs(fileName); - std::cerr << "read xy..."; - Point point; - unsigned int nb = 0; - while (ifs >> point) - { - points->push_back(std::make_pair(point, 1)); - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - - return points; -} diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index ed947dcd02f..c9871bc66de 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -21,6 +21,8 @@ #include #include +#include "testing_tools.h" + typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef K::Segment_2 Segment; @@ -30,7 +32,7 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; typedef PointMassList::const_iterator InputIterator; -typedef CGAL::value_type_traits::type MassPoint; + typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; typedef CGAL::Reconstruction_simplification_2 Rs_2; -PointMassList* load_xy_file(const std::string& fileName); -PointMassList* simple_point_set(); - void test_list_output(Rs_2& rs2); void test_tds_output(Rs_2& rs2); void test_off_output(Rs_2& rs2); @@ -67,8 +66,9 @@ void print_edge(Edge edge) { int main () { + PointMassList points; //use the stair example for testing - PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + load_xy_file("data/stair-noise00.xy", points); PointPMap point_pmap; MassPMap mass_pmap; @@ -84,9 +84,9 @@ int main () void test_list_output(Rs_2& rs2) { - std::cout <<"(-------------List OUTPUT---------- )" << std::endl; + std::cout <<"(-------------List OUTPUT---------- )" << std::endl; - std::vector isolated_points; + std::vector isolated_points; std::vector edges; typedef std::back_insert_iterator > Point_it; @@ -186,22 +186,3 @@ void test_off_output(Rs_2& rs2) { assert(res[i].substr(0,2) == "2 "); } } - - -PointMassList* load_xy_file(const std::string& fileName) -{ - PointMassList *points = new PointMassList(); - std::ifstream ifs(fileName); - std::cerr << "read xy..."; - Point point; - unsigned int nb = 0; - while (ifs >> point) - { - points->push_back(std::make_pair(point, 1)); - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - - return points; - -} diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index a20a693647e..7d304adf03e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -18,6 +18,7 @@ #include #include +#include "testing_tools.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; @@ -28,19 +29,16 @@ typedef K::Segment_2 Segment; typedef std::pair PointMassPair; typedef std::list PointMassList; typedef PointMassList::const_iterator InputIterator; -typedef CGAL::value_type_traits::type MassPoint; + typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; - -PointMassList* load_xy_file(const std::string& fileName); -PointMassList* simple_point_set(); - int main () { + PointMassList points; //use the stair example for testing - PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + load_xy_file("data/stair-noise00.xy", points); PointPMap point_pmap; MassPMap mass_pmap; @@ -75,41 +73,3 @@ int main () assert(isolated_points.size() == 0); assert(edges.size() == 8); } - - -PointMassList* simple_point_set() { - - PointMassList *points = new PointMassList(); - - points->push_back(std::make_pair(Point(0.0001, 0.00012), 1)); - points->push_back(std::make_pair(Point(1.00013, 0.00031), 1)); - points->push_back(std::make_pair(Point(0.50001, 0.500001), 1)); - points->push_back(std::make_pair(Point(0.5000011, 1.000012), 1)); - points->push_back(std::make_pair(Point(0.000012, 2.000001), 1)); - points->push_back(std::make_pair(Point(1.0000123, 2.0000012), 1)); - points->push_back(std::make_pair(Point(-0.50000182, 0.50000162), 1)); - points->push_back(std::make_pair(Point(-0.500001002, 1.000006012), 1)); - points->push_back(std::make_pair(Point(-1.0000331, 2.00001), 1)); - points->push_back(std::make_pair(Point(-1.000012, 0.000200012), 1)); - - return points; -} - - -PointMassList* load_xy_file(const std::string& fileName) -{ - PointMassList *points = new PointMassList(); - std::ifstream ifs(fileName); - std::cerr << "read xy..."; - Point point; - unsigned int nb = 0; - while (ifs >> point) - { - points->push_back(std::make_pair(point, 1)); - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - - return points; - -} diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index dde5712e881..ef6691cd110 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -9,6 +9,8 @@ #include #include +#include "testing_tools.h" + #include #include @@ -27,7 +29,7 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; typedef PointMassList::const_iterator InputIterator; -typedef CGAL::value_type_traits::type MassPoint; + typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; @@ -61,8 +63,10 @@ void print_edge(R_edge_2 pedge) { void test_edge_collapse() { std::cerr << "test_edge_collapse" << std::endl; + + PointMassList points; //use the stair example for testing - PointMassList points = *(load_xy_file("data/stair-noise00.xy")); + load_xy_file("data/stair-noise00.xy", points); PointPMap point_pmap; MassPMap mass_pmap; @@ -166,20 +170,4 @@ PointMassList* simple_point_set() { return points; } -PointMassList* load_xy_file(const std::string& fileName) -{ - PointMassList *points = new PointMassList(); - std::ifstream ifs(fileName); - std::cerr << "read xy..."; - Point point; - unsigned int nb = 0; - while (ifs >> point) - { - points->push_back(std::make_pair(point, 1)); - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - return points; - -} diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h new file mode 100644 index 00000000000..960fa09c5f7 --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h @@ -0,0 +1,17 @@ +#include + + +template +void load_xy_file(const std::string& fileName, PointMassList& points) +{ + std::ifstream ifs(fileName); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points.push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); +} From d93b68294d3839e0db8d1d7e08480cd915d46a8c Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 28 Jul 2014 13:03:10 +0200 Subject: [PATCH 046/201] Simple example implemented --- .../CMakeLists.txt | 31 +++++ ...econstruction_simplification_2_example.cpp | 111 ++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt create mode 100644 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt new file mode 100644 index 00000000000..961ad900c93 --- /dev/null +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt @@ -0,0 +1,31 @@ +project( Reconstruction_simplification_2_example ) + +cmake_minimum_required(VERSION 2.6.2) +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6) + if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) + cmake_policy(VERSION 2.8.4) + else() + cmake_policy(VERSION 2.6) + endif() +endif() + +find_package(CGAL QUIET COMPONENTS Core ) + +if ( CGAL_FOUND ) + + include( ${CGAL_USE_FILE} ) + + include( CGAL_CreateSingleSourceCGALProgram ) + + include_directories (BEFORE "../../include") + + include_directories (BEFORE "include") + + create_single_source_cgal_program( "reconstruction_simplification_2_example.cpp" ) + +else() + + message(STATUS "This program requires the CGAL library, and will not be compiled.") + +endif() + diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp new file mode 100644 index 00000000000..8aff1d11a40 --- /dev/null +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -0,0 +1,111 @@ +// reconstruction_simplification_2_example.cpp + + +//---------------------------------------------------------- +// Simple example for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include +#include + + +#include +#include +#include +#include +#include +#include // std::pair + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; + +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; +typedef PointMassList::const_iterator InputIterator; + +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::Reconstruction_simplification_2 ::Reconstruction_edge_2 R_edge_2; + +typedef CGAL::Reconstruction_simplification_2 ::Vertex Vertex; + +typedef CGAL::Reconstruction_triangulation_2 Rt_2; + +typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; +typedef Rt_2::Vertex_iterator Vertex_iterator; + +typedef Rt_2::Edge Edge; + +typedef CGAL::Reconstruction_simplification_2 Rs_2; + + +void load_xy_file(const std::string& fileName, PointMassList& points) +{ + std::ifstream ifs(fileName); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points.push_back(std::make_pair(point, 1)); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); +} + + + +int main () +{ + + PointMassList points; + //use the stair example for testing + load_xy_file("data/stair-noise00.xy", points); + + PointPMap point_pmap; + MassPMap mass_pmap; + + Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); + rs2.initialize(); + rs2.reconstruct(100); //100 steps + + std::vector isolated_points; + std::vector edges; + + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; + + Point_it point_it(isolated_points); + Edge_it edge_it(edges); + + CGAL::List_output list_output(point_it, edge_it); + + rs2.extract_solid_elements(list_output); + + std::cerr << "Isolated Vertices" << std::endl; + int vertex_count = 0; + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + vertex_count++; + std::cout << *it << std::endl; + } + assert(vertex_count == 18); + + std::cerr << "Edges" << std::endl; + int edge_count = 0; + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + edge_count++; + } + +} From 56b312c96a8acad175f0dcd1ea82a20ae79bac82 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 28 Jul 2014 14:15:09 +0200 Subject: [PATCH 047/201] Simple example documented --- .../Reconstruction_Simplification_2.txt | 35 ++++++++----------- ...econstruction_simplification_2_example.cpp | 14 ++------ .../CMakeLists.txt | 2 +- .../test_output_modules.cpp | 2 ++ 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 8bc3245a71d..9a92c830025 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -37,8 +37,6 @@ After that, edges which carry little mass can be filtered out. - - \section Reconstruction_simplification_2Overview Overview of the Reconstruction Process The task addressed is to reconstruct a shape from noisy data $S$ in $R^2$, i.e. give a (noisy) set of points, find a shape which best approximates the non-noise subset of $S$. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. While previous works address these two issues sequentially, they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set M of n sources and a set $F$ of n targets (both can for example be point sets in $R^2$). Given a cost function $c : R^2 x R^2 -> R^+$, the goal is to find a bijection between M and F such that the sum of the costs c gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. Given this theoretical background the algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached. @@ -96,21 +94,8 @@ Reconstruction_simplification_2 rs2.initialize(); - rs2.reconstruct(100); + rs2.reconstruct(100); //perform 100 contraction steps - CGAL::List_output list_output; - - rs2.extract_solid_elements(list_output); - - for (Output_Vertex_Iterator it = list_output.vertices_start(); - it != list_output.vertices_beyond(); it++) { - ... - } - - for (Output_Edge_Iterator it = list_output.edges_start(); - it != list_output.edges_beyond(); it++) { - ... - } \endcode @@ -118,15 +103,25 @@ Reconstruction_simplification_2 \subsection Reconstruction_simplification_2Examples Examples +\subsection Reconstruction_simplification_2ExampleSimple Simple Reconstruction Example + + +The following example shows a simple use case of the Reconstruction_simplification_2 package. +It works by first reading a collection of input points from an xy-file. Using two property maps +the points and their optional initial mass are passed to the Reconstruction_simplification_2 object rs2. +After initializing rs2, the 100 iterations of the reconstruction process are performed. Lastly, the isolated +points and the edges of the reconstructed shape are extracted and printed to the console using the List_output model. + + + +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} + + \cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} Example of a reconstructed image where the user specified that the output should consist of $20$ vertices. \cgalFigureEnd -\subsection Reconstruction_simplification_2ExampleSimple Simple reconstruction Example -The following example illustrates the simplest of the cases. It uses -an ordinary polyhedron and only one of the optional parameters. -The unspecified cost strategy defaults to Lindstrom-Turk. \cgalExample{Surface_mesh_simplification/edge_collapse_polyhedron.cpp} Illustration of a call to the reconstruction function where the user specified to leave $20$ vertices. \cgalFigureEnd diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 8aff1d11a40..ec6b203cda7 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include // std::pair @@ -51,14 +50,12 @@ typedef CGAL::Reconstruction_simplification_2> point) { points.push_back(std::make_pair(point, 1)); } - std::cerr << "done (" << nb << " points)" << std::endl; ifs.close(); } @@ -92,20 +89,15 @@ int main () rs2.extract_solid_elements(list_output); std::cerr << "Isolated Vertices" << std::endl; - int vertex_count = 0; - for (std::vector::iterator it = isolated_points.begin(); + for (std::vector::iterator it = isolated_points.begin(); it != isolated_points.end(); it++) { - vertex_count++; - std::cout << *it << std::endl; + std::cout << *it << std::endl; } - assert(vertex_count == 18); std::cerr << "Edges" << std::endl; - int edge_count = 0; for (std::vector::iterator it = edges.begin(); it != edges.end(); it++) { std::cout << *it << std::endl; - edge_count++; - } + } } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 1af8348672b..8d15fb4780e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_vertex_edge.cpp" ) + create_single_source_cgal_program( "test_output_modules.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index c9871bc66de..61530ab21f4 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -113,6 +113,8 @@ void test_list_output(Rs_2& rs2) { std::cout << *it << std::endl; edge_count++; } + assert(edge_count == 31); + } From 5a696fd4793cea544e62136f091bc6bca4a4635e Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 29 Jul 2014 10:24:19 +0200 Subject: [PATCH 048/201] Switch to UTF8 + add my name --- .../Reconstruction_Simplification_2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 9a92c830025..b4b3afaf01c 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -5,7 +5,7 @@ namespace CGAL { \anchor Chapter_2D_Reconstruction_Simplification \cgalAutoToc -\authors Fernando de Goes, Pierre Alliez, Ivo Vigan +\authors Fernando de Goes, Pierre Alliez, Ivo Vigan and Clément Jamin From de4c91bc0260da293be20a6ea833ca4e50c32466 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 30 Jul 2014 11:28:02 +0200 Subject: [PATCH 049/201] Fix typos --- .../Reconstruction_Simplification_2.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b4b3afaf01c..164ec586f31 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -16,22 +16,22 @@ namespace CGAL { From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. \cgalFigureEnd -The task addressed here is to reconstruct a shape from a noisy point set S in $R^2$, i.e. give a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. +The task addressed here is to reconstruct a shape from a noisy point set S in $R^2$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. -The algorithm (\cgalCite{degoes:hal-00758019}) presented here performs the reconstruction and simplification task jointly using a unifies ed framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm \cgalCite{degoes:hal-00758019} presented here performs the reconstruction and simplification task jointly using a unified framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. The algorithm can be summarized as: "Considering S as a measure mu consisting of Dirac masses, find a coarse simplicial complex T such that mu is well approximated by a linear combination of uniform measures on the edges and vertices of T." -It performs a course to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan $T \ e$. +It performs a coarse to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan $T \ e$. \cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} Illustration of an edge contraction - indicated by an arrow. The resulting reassignment of the input points to vertices and edges is depicted in green, red respectively. \cgalFigureEnd -The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. +The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheapest of the two vertices. -This sequence of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users has been reached. +This sequence of edge contractions and transportation plan updates is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out. From 01ef3c11a00a932565725ed8d895eebc8e784427 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 30 Jul 2014 14:26:57 +0200 Subject: [PATCH 050/201] user manual improved --- .../Reconstruction_Simplification_2.txt | 68 ++++++++++--------- ...econstruction_simplification_2_example.cpp | 2 +- .../CGAL/Reconstruction_simplification_2.h | 2 +- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 164ec586f31..6e4b0017549 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -16,55 +16,50 @@ namespace CGAL { From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. \cgalFigureEnd -The task addressed here is to reconstruct a shape from a noisy point set S in $R^2$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of S. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. +The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of \f$ S \f$. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. -The algorithm \cgalCite{degoes:hal-00758019} presented here performs the reconstruction and simplification task jointly using a unified framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm of \cgalCite{degoes:hal-00758019} presented here performs the reconstruction and simplification task jointly, using a unified framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. -The algorithm can be summarized as: "Considering S as a measure mu consisting of Dirac masses, find a coarse simplicial complex T such that mu is well approximated by a linear combination of uniform measures on the edges and vertices of T." +The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a linear combination of uniform measures on the edges and vertices of \f$ T \f$. -It performs a coarse to fine simplification of the output simplex. It starts by putting a bounding box around the input points S and computes the Delaunay Triangulation T_0 on S. T_0 is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge e for contraction is chosen according to the overall cost of the transportation plan $T \ e$. +It performs a coarse to fine simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan \f$ T \setminus e \f$. \cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} -Illustration of an edge contraction - indicated by an arrow. The resulting reassignment of the input points to vertices and edges is depicted in green, red respectively. +Illustration of an edge contraction - indicated by the blue arrow. The resulting reassignment of the input points to vertices and edges is depicted in green and red respectively. \cgalFigureEnd -The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. The input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheapest of the two vertices. - -This sequence of edge contractions and transportation plan updates is repeated until the desired number of vertices, specified by the users, has been reached. - -After that, edges which carry little mass can be filtered out. +The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. An input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. This sequence of edge contractions and transportation plan updates is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out. \section Reconstruction_simplification_2Overview Overview of the Reconstruction Process - -The task addressed is to reconstruct a shape from noisy data $S$ in $R^2$, i.e. give a (noisy) set of points, find a shape which best approximates the non-noise subset of $S$. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. While previous works address these two issues sequentially, they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set M of n sources and a set $F$ of n targets (both can for example be point sets in $R^2$). Given a cost function $c : R^2 x R^2 -> R^+$, the goal is to find a bijection between M and F such that the sum of the costs c gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. Given this theoretical background the algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached. +While previous works address the reconstruction and simplification tasks sequentially, they are performed jointly using the unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can for example be point sets in \f$ \mathbb{R}^2 \f$). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a bijection between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached. \section Reconstruction_simplification_2Trans Optimal Transport Formulation -The quality of an output simplex is measured as the total transportation cost of the input to the assigned simplex vertices and edges. +The quality of an output simplex is measured as the total transportation cost of the input points to the assigned simplex vertices and edges. For the transportation cost, the 2-Wasserstein metric is chosen which is also known the Earth Mover Distance, and intuitively -corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, where the cost is measures as the $L_2$ distances. +corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, where the cost is measured using the \f$L_2 \f$ distances. \subsection Reconstruction_simplification_2TransCost Transportation Plan & Cost from Points to Simplices -Assuming that the algorithm is given an output simplex $T$, and a point-to-simplex assignment which maps every input point to either an edge or a vertex of $T$, -the total transportation cost is then computed using the following rules. For a point to vertex assignment, the cost is simply the sum of the weighted $L_2$-distances of all the points +Assuming that the algorithm is given an output simplex \f$T \f$, and a point-to-simplex assignment which maps every input point to either an edge or a vertex of \f$T \f$, +the total transportation cost is then computed using the following rules. For a point to vertex assignment, the cost is simply the sum of the weighted \f$L_2 \f$-distances of all the points assigned to the given vertex. -For an edge of the simplex, the optimal plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is a bit more involved. In order to compute it, we decompose an edge $e$ into bins. This decomposition is done by sorting the projected points on $e$ and choosing the length of the $i$-th bin as $(m_i/M_e)|e|$. Each projected point $q_i$ on $e$ is then spread over the $i$-th bin. such that we get a uniform measure on $e$, which is then used to define an optimal transport from the input points to $e$. +For an edge of the simplex, the optimal plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is a bit more involved. In order to compute it, we decompose an edge \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$\f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$ with \f$ m_i \f$ denoting the mass of point \f$q_i \f$, \f$M_e \f$ the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ the length of \f$ e \f$. \cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} -Illustration of the bins of a simplicial-edge used for computing the tangential transportation plan. +Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. \cgalFigureEnd \section Reconstruction_simplification_2VertexRelocation Vertex Relocation -Since noise and missing data result may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of the weighted $L_2$ distance. The vertices then get relocated only if the resulting triangulation is still embeddable. +Since noise and missing data may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of the current weighted \f$L_2 \f$ distance. The vertices then get relocated only if the resulting triangulation is still embeddable. \cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} @@ -84,8 +79,8 @@ exposed to the user is the Reconstruction_simplification_2 class. /* K : Kernel is the geometric kernel, used for the reconstruction and simplification task. InputIterator : InputIterator is the iterator type of the algorithm input. -PointPMap : is a PropertyMap for accessing the input points. -MassPMap : MassPMap is a PropertyMap for accessing the input points' +PointPMap : is a PropertyMap for accessing the input points. +MassPMap : MassPMap is a PropertyMap for accessing the input points' */ @@ -100,16 +95,32 @@ Reconstruction_simplification_2 \endcode -\subsection Reconstruction_simplification_2Examples Examples +Alternatively to calling the reconstruction module using +\code{.cpp} + rs2.reconstruct(100); //perform 100 contraction steps +\endcode + +one can use the reconstruct_until function + +\code{.cpp} + rs2.reconstruct_until(20); //perform edge contractions until only 20 vertices are left. +\endcode + + and specify the number of output vertices one wants to keep as illustrated in the following picture. + +\cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} +Example of a reconstructed image where the user specified that the output should consist of \f$20 \f$ vertices. +\cgalFigureEnd -\subsection Reconstruction_simplification_2ExampleSimple Simple Reconstruction Example +\subsection Reconstruction_simplification_2Examples Example + The following example shows a simple use case of the Reconstruction_simplification_2 package. It works by first reading a collection of input points from an xy-file. Using two property maps the points and their optional initial mass are passed to the Reconstruction_simplification_2 object rs2. -After initializing rs2, the 100 iterations of the reconstruction process are performed. Lastly, the isolated +After initializing rs2, 100 iterations of the reconstruction process are performed. Lastly, the isolated points and the edges of the reconstructed shape are extracted and printed to the console using the List_output model. @@ -117,15 +128,6 @@ points and the edges of the reconstructed shape are extracted and printed to the \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} -\cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} -Example of a reconstructed image where the user specified that the output should consist of $20$ vertices. -\cgalFigureEnd - - -\cgalExample{Surface_mesh_simplification/edge_collapse_polyhedron.cpp} -Illustration of a call to the reconstruction function where the user specified to leave $20$ vertices. -\cgalFigureEnd - */ } /* namespace CGAL */ diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index ec6b203cda7..5a74a14f286 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -65,7 +65,7 @@ int main () { PointMassList points; - //use the stair example for testing + load_xy_file("data/stair-noise00.xy", points); PointPMap point_pmap; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index acdbed3469b..813350413f1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -162,7 +162,7 @@ protected: /// @{ /*! - \Instantiates a new Reconstruction_simplification_2. + Instantiates a new Reconstruction_simplification_2. \details Instantiates a new Reconstruction_simplification_2 object for a given collection of point-mass pairs. From 3103565a04b5863e2a99ddf32b08ff0a775c7b68 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 30 Jul 2014 15:53:56 +0200 Subject: [PATCH 051/201] Output concept and model documentation improved --- .../Concepts/Output.h | 49 ++------ .../include/CGAL/List_output.h | 110 +++++++++++------- .../include/CGAL/Off_output.h | 21 ++-- .../CGAL/Reconstruction_triangulation_2.h | 1 - .../include/CGAL/Tds_output.h | 28 +++-- 5 files changed, 113 insertions(+), 96 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h index 3a0cd28eda5..10d0dc6d766 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h @@ -8,9 +8,9 @@ shape in a versatile way. -\cgalHasModel `CGAL::List_output` -\cgalHasModel `CGAL::Off_output` -\cgalHasModel `CGAL::Tds_output` +\cgalHasModel `CGAL::List_output` +\cgalHasModel `CGAL::Off_output` +\cgalHasModel `CGAL::Tds_output` */ @@ -18,45 +18,14 @@ shape in a versatile way. class OutputModule { public: -/// \name Types -/// @{ - - /*! -Output_Iterator for accessing the isolated vertices. +Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. + +\param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. +\param nb_ignore The number of verticess to be ignored in the output. + */ -typedef unspecified_type Output_Vertex_Iterator; - -/*! -Output_Iterator for accessing the reconstructed edges. -*/ -typedef unspecified_type Output_Edge_Iterator; - -/// @} - -/// \name Operations -/// @{ - -/*! -Returns an Output_Vertex_Iterator pointing to the first vertex. -*/ -Output_Vertex_Iterator vertices_start(); - -/*! -Returns an Output_Vertex_Iterator pointing beyond the last vertex. -*/ -Output_Vertex_Iterator vertices_beyond(); - -/*! -Returns an Output_Edge_Iterator pointing to the first edge. -*/ -Output_Edge_Iterator edges_start(); - -/*! -Returns an Output_Edge_Iterator pointing beyond the last edge. -*/ -Output_Edge_Iterator edges_beyond(); - +void store_marked_elements(Rt_2& rt2, int nb_ignore); }; /* end OutputModule */ diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 552b2f4603e..a10e0f792cf 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -43,16 +43,24 @@ namespace CGAL { \brief The class `List_output` is a model for the `OutputModule` concept. -\details It returns Output-iterators which allow iterating over both the -isolated vertices and the edges of the reconstructed shape +\details It takes two `Output-Iterators`, one for storing the +isolated points and one for storing the edges of the reconstructed shape. \tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. + +\tparam Output_Vertex_Iterator The `Output-Iterator` type for storing the points + +\tparam Output_Edge_Iterator The `Output-Iterator` type for storing the + edges (as Segments). */ template class List_output { public: + + /// \cond SKIP_IN_MANUAL + typedef typename Kernel::FT FT; typedef typename Kernel::Point_2 Point; typedef typename Kernel::Segment_2 Segment; @@ -74,49 +82,44 @@ public: private: Output_Vertex_Iterator m_v_it; Output_Edge_Iterator m_e_it; -public: - List_output(Output_Vertex_Iterator v_it, Output_Edge_Iterator e_it) : - m_v_it(v_it), m_e_it(e_it) { } + void store_marked_vertices(Rt_2& rt2) { + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) + { + bool incident_edges_have_sample = false; + typename Rt_2::Edge_circulator start = rt2.incident_edges(vi); - void store_marked_vertices(Rt_2& rt2) { + typename Rt_2::Edge_circulator cur = start; - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) - { - bool incident_edges_have_sample = false; - typename Rt_2::Edge_circulator start = rt2.incident_edges(vi); + do { + if (!rt2.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); - typename Rt_2::Edge_circulator cur = start; + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) { + Point p = (*vi).point(); + *m_v_it = p; + m_v_it++; + } + } + } + } - do { - if (!rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) { - Point p = (*vi).point(); - *m_v_it = p; - m_v_it++; - } - } - } - } - - void store_marked_edges(Rt_2& rt2, int nb_ignore) { - MultiIndex mindex; - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) - { + void store_marked_edges(Rt_2& rt2, int nb_ignore) { + MultiIndex mindex; + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) + { Edge edge = *ei; if (rt2.is_ghost(edge)) continue; FT value = rt2.get_edge_relevance(edge); // >= 0 mindex.insert(Reconstruction_edge_2(edge, value)); - } + } int nb_remove = (std::min)(nb_ignore, int(mindex.size())); @@ -133,15 +136,42 @@ public: (mindex.template get<0>()).erase(pedge); Segment s(pedge.source()->point(), pedge.target()->point()); //edges.push_back(s); - *m_e_it = s; + *m_e_it = s; m_e_it++; } - } + } - void store_marked_elements(Rt_2& rt2, int nb_ignore) { - store_marked_vertices(rt2); - store_marked_edges(rt2, nb_ignore); + /// \endcond +public: + + /// \name Creation + /// @{ + + /*! + Instantiates a new List_output object + for two given Output_Iterators. + + \param v_it An Output_Vertex_Iterator for storing the points. + + \param e_it An Output_Edge_Iterator for storing the edges (as Segments). + */ + List_output(Output_Vertex_Iterator v_it, Output_Edge_Iterator e_it) : + m_v_it(v_it), m_e_it(e_it) { } + /// @} + + + + /*! + Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. + + \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. + \param nb_ignore The number of verticess to be ignored in the output. + + */ + void store_marked_elements(Rt_2& rt2, int nb_ignore) { + store_marked_vertices(rt2); + store_marked_edges(rt2, nb_ignore); } }; diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 84d23d1fbe5..c5b2a0a8868 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -1,10 +1,3 @@ -/* - * Off_output.h - * - * Created on: Jul 10, 2014 - * Author: ivovigan - */ - #ifndef OFF_OUTPUT_H_ #define OFF_OUTPUT_H_ @@ -55,6 +48,10 @@ of the reconstructed shape via an std::ostream object. */ template class Off_output { + + + /// \cond SKIP_IN_MANUAL + public: typedef Reconstruction_triangulation_2 Rt_2; typedef typename Rt_2::Triangulation_data_structure Tds_2; @@ -100,10 +97,20 @@ private: } + /// \endcond public: Off_output() : list_output(Point_it(isolated_points), Edge_it(edges)) { } + + + /*! + Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. + + \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. + \param nb_ignore The number of verticess to be ignored in the output. + + */ void store_marked_elements(Rt_2& rt2, int nb_ignore) { list_output.store_marked_elements(rt2, nb_ignore); } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 19c2bdcb40a..0b6a3247a6a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -49,7 +49,6 @@ #include #include - #define EPS 1e-15 namespace CGAL { diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 9e3f96eb5da..288d89175d4 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -1,10 +1,3 @@ -/* - * Tds_output.h - * - * Created on: Jul 10, 2014 - * Author: ivovigan - */ - #ifndef TDS_OUTPUT_H_ #define TDS_OUTPUT_H_ @@ -52,6 +45,10 @@ namespace CGAL { */ template class Tds_output { + + /// \cond SKIP_IN_MANUAL + + public: typedef Reconstruction_triangulation_2 Rt_2; typedef typename Kernel::FT FT; @@ -102,13 +99,28 @@ private: } } + /// \endcond public: - void store_marked_elements(Rt_2& rt2, int nb_ignore) { + + /*! + Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. + + \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. + \param nb_ignore The number of verticess to be ignored in the output. + + */ + void store_marked_elements(Rt_2& rt2, int nb_ignore) { m_rt2 = rt2; mark_vertices(); mark_edges(); } + + /*! + Allows accessing the `Reconstruction_triangulation_2` of the `Reconstruction_simplification_2` module. + + \param rt2 The `Reconstruction_triangulation_2`. + */ void extract_reconstruction_tds(Rt_2& rt2) { rt2 = m_rt2; } From 143a648f2869eb1a70da31a398103615c16be13b Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 30 Jul 2014 20:16:22 +0200 Subject: [PATCH 052/201] Refactoring w.r.t. InputIterator --- ...Reconstruction_simplification_kerneled_2.h | 2 +- .../Reconstruction_simplification_2/scene.h | 2 +- ...econstruction_simplification_2_example.cpp | 14 +++--- .../CGAL/Reconstruction_simplification_2.h | 43 ++++++++----------- .../test_basic.cpp | 6 +-- .../test_output_modules.cpp | 14 +++--- .../test_reconstruction_until.cpp | 7 +-- .../test_vertex_edge.cpp | 7 +-- 8 files changed, 39 insertions(+), 56 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h index 14bf4bcd50b..31156462372 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -27,7 +27,7 @@ typedef CGAL::value_type_traits::type MassPoint; typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; -typedef CGAL::Reconstruction_simplification_2 Reconstruction_simplification_2; class Reconstruction_simplification_kerneled_2: diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 711ef14828a..d771de6dd38 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -33,7 +33,7 @@ public: typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; - typedef CGAL::Reconstruction_simplification_2 R_s_2; typedef K::Segment_2 Segment; diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 5a74a14f286..2a13d9a879c 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -27,15 +27,16 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef PointMassList::const_iterator InputIterator; typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; -typedef CGAL::Reconstruction_simplification_2 ::Reconstruction_edge_2 R_edge_2; -typedef CGAL::Reconstruction_simplification_2 ::Vertex Vertex; + +typedef CGAL::Reconstruction_simplification_2 Rs_2; + +typedef Rs_2::Reconstruction_edge_2 R_edge_2; + +typedef Rs_2::Vertex Vertex; typedef CGAL::Reconstruction_triangulation_2 Rt_2; @@ -44,7 +45,6 @@ typedef Rt_2::Vertex_iterator Vertex_iterator; typedef Rt_2::Edge Edge; -typedef CGAL::Reconstruction_simplification_2 Rs_2; void load_xy_file(const std::string& fileName, PointMassList& points) @@ -72,7 +72,7 @@ int main () MassPMap mass_pmap; Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.initialize(); + rs2.reconstruct(100); //100 steps std::vector isolated_points; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 813350413f1..c0dc53f53c4 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -55,14 +55,12 @@ via the PointPMap and MassPMap `PropertyMap`s respectively. \tparam Kernel is the geometric kernel, used throughout the reconstruction and simplification task. -\tparam InputIterator is the iterator type of the algorithm input. - \tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = `Point_2` \tparam MassPMap is a model of `ReadablePropertyMap` with a value_type = `FT` */ -template +template class Reconstruction_simplification_2 { public: @@ -148,9 +146,7 @@ protected: double m_bbox_y; double m_bbox_size; - InputIterator start; - InputIterator beyond; - PointPMap point_pmap; + PointPMap point_pmap; MassPMap mass_pmap; /// \endcond @@ -163,10 +159,15 @@ protected: /*! Instantiates a new Reconstruction_simplification_2. + It computes an bounding box around the input points and creates a first + (fine) output simplex as well as an initial transportation plan. This + first output simplex \details Instantiates a new Reconstruction_simplification_2 object for a given collection of point-mass pairs. + \tparam InputIterator is the iterator type of the algorithm input. + \param start_itr An InputIterator pointing the the first point-mass pair in a collection. \param beyond_itr An InputIterator pointing beyond the last point-mass @@ -175,19 +176,19 @@ protected: \param in_mass_pmap A `ReadablePropertyMap` used to access the input points' mass. */ + template Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, PointPMap in_point_pmap, MassPMap in_mass_pmap) { - start = start_itr; - beyond = beyond_itr; - point_pmap = in_point_pmap; mass_pmap = in_mass_pmap; initialize_parameters(); + + initialize(start_itr, beyond_itr); } /// @} @@ -225,31 +226,22 @@ protected: //Function if one wants to create a Reconstruction_simplification_2 //without specifying the input yet in the constructor + template void initialize(InputIterator start_itr, InputIterator beyond_itr, PointPMap in_point_pmap, MassPMap in_mass_pmap) { - start = start_itr; - beyond = beyond_itr; - point_pmap = in_point_pmap; mass_pmap = in_mass_pmap; - initialize(); + initialize(start_itr, beyond_itr); } - /// \endcond - /*! - First function to be called after instantiating a new - Reconstruction_simplification_2 object. - It computes an bounding box around the input points and creates a first - (fine) output simplex as well as an initial transportation plan. This - first output simplex - */ - void initialize() { + template + void initialize(InputIterator start, InputIterator beyond) { clear(); @@ -267,6 +259,9 @@ protected: assign_samples(m_samples.begin(), m_samples.end()); } + /// \endcond + + /*! Returns the solid edges present after the reconstruction process. @@ -378,13 +373,13 @@ protected: } template // value_type = Point* - void init(Iterator begin, Iterator end) { + void init(Iterator begin, Iterator beyond) { double timer = clock(); std::cerr << yellow << "init" << white << "..."; int nb = m_dt.number_of_vertices(); m_dt.infinite_vertex()->pinned() = true; - for (Iterator it = begin; it != end; it++) { + for (Iterator it = begin; it != beyond; it++) { Point point = get(point_pmap, *it); Vertex_handle vertex = insert_point(point, false, nb++); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index cbf6697627a..1e2d1444349 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -23,8 +23,6 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef PointMassList::const_iterator InputIterator; - typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; @@ -38,11 +36,9 @@ int main () PointPMap point_pmap; MassPMap mass_pmap; - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.initialize(); - rs2.reconstruct(100); //100 steps rs2.print_stats_debug(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 61530ab21f4..b6846914762 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -31,15 +31,16 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef PointMassList::const_iterator InputIterator; typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; -typedef CGAL::Reconstruction_simplification_2 ::Reconstruction_edge_2 R_edge_2; -typedef CGAL::Reconstruction_simplification_2 ::Vertex Vertex; + +typedef CGAL::Reconstruction_simplification_2 Rs_2; + +typedef Rs_2::Vertex Vertex; + +typedef Rs_2::Reconstruction_edge_2 R_edge_2; typedef CGAL::Reconstruction_triangulation_2 Rt_2; @@ -48,7 +49,6 @@ typedef Rt_2::Vertex_iterator Vertex_iterator; typedef Rt_2::Edge Edge; -typedef CGAL::Reconstruction_simplification_2 Rs_2; void test_list_output(Rs_2& rs2); void test_tds_output(Rs_2& rs2); @@ -74,7 +74,7 @@ int main () MassPMap mass_pmap; Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.initialize(); + rs2.reconstruct(100); //100 steps test_list_output(rs2); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index 7d304adf03e..c235127230c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -28,7 +28,6 @@ typedef K::Segment_2 Segment; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef PointMassList::const_iterator InputIterator; typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; @@ -43,13 +42,9 @@ int main () PointPMap point_pmap; MassPMap mass_pmap; - MassPoint mp; - - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.initialize(); - rs2.reconstruct_until(9); rs2.print_stats_debug(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index ef6691cd110..fb06a05b82d 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -28,7 +28,6 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef PointMassList::const_iterator InputIterator; typedef CGAL::First_of_pair_property_map PointPMap; typedef CGAL::Second_of_pair_property_map MassPMap; @@ -71,11 +70,9 @@ void test_edge_collapse() { PointPMap point_pmap; MassPMap mass_pmap; - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.initialize(); - CGAL::Tds_output tds_output; rs2.extract_solid_elements(tds_output); @@ -133,7 +130,7 @@ void test_num_of_vertices_in_triangulation() { PointMassList points = *(simple_point_set()); - CGAL::Reconstruction_simplification_2 rs2; + CGAL::Reconstruction_simplification_2 rs2; int nb = 0; for (PointMassList::iterator it = points.begin(); it != points.end(); it++) { PointMassPair pmp = *it; From be488648e45d7626f6437cd41b98ce3243743156 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 30 Jul 2014 20:38:40 +0200 Subject: [PATCH 053/201] Docu Updated5 --- Documentation/BaseDoxyfile.in | 2 +- .../Reconstruction_simplification_2/PackageDescription.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/BaseDoxyfile.in b/Documentation/BaseDoxyfile.in index 665e24e6af2..698d549a896 100644 --- a/Documentation/BaseDoxyfile.in +++ b/Documentation/BaseDoxyfile.in @@ -1396,7 +1396,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. -GENERATE_LATEX = NO +GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 1653206720c..e3f92ce3f7e 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -34,13 +34,13 @@ ## Models ## -- `CGAL::List_output` +- `CGAL::List_output` - `CGAL::Off_output` - `CGAL::Tds_output` ## Classes ## -- `CGAL::Reconstruction_simplification_2` +- `CGAL::Reconstruction_simplification_2` */ From 10c5a65aa09154303da6cea313436649f5d0172a Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 31 Jul 2014 10:42:36 +0200 Subject: [PATCH 054/201] Documentation Updated --- .../Concepts/Output.h | 3 +- .../Reconstruction_Simplification_2.txt | 42 +++++++++---------- .../include/CGAL/List_output.h | 6 +-- .../include/CGAL/Off_output.h | 7 ++-- .../include/CGAL/Reconstruction_face_base_2.h | 7 ++++ .../CGAL/Reconstruction_simplification_2.h | 20 ++++----- .../CGAL/Reconstruction_vertex_base_2.h | 6 +++ .../include/CGAL/Tds_output.h | 4 +- 8 files changed, 49 insertions(+), 46 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h index 10d0dc6d766..fc9d0ddcb3f 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h @@ -22,10 +22,9 @@ public: Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. -\param nb_ignore The number of verticess to be ignored in the output. */ -void store_marked_elements(Rt_2& rt2, int nb_ignore); +void store_marked_elements(Rt_2& rt2); }; /* end OutputModule */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 6e4b0017549..b9156810777 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -22,35 +22,34 @@ The algorithm of \cgalCite{degoes:hal-00758019} presented here performs the reco The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a linear combination of uniform measures on the edges and vertices of \f$ T \f$. -It performs a coarse to fine simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan \f$ T \setminus e \f$. +It performs a coarse to fine simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. \cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} -Illustration of an edge contraction - indicated by the blue arrow. The resulting reassignment of the input points to vertices and edges is depicted in green and red respectively. +Illustration of an edge contraction, indicated by the blue arrow. The resulting reassignment of the input points to vertices and edges is depicted in green and red respectively. \cgalFigureEnd -The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. An input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. This sequence of edge contractions and transportation plan updates is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out. +The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. An input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. \section Reconstruction_simplification_2Overview Overview of the Reconstruction Process -While previous works address the reconstruction and simplification tasks sequentially, they are performed jointly using the unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can for example be point sets in \f$ \mathbb{R}^2 \f$). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a bijection between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and the paper views reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached. +While previous works address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be point sets in \f$ \mathbb{R}^2 \f$). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a bijection between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. \section Reconstruction_simplification_2Trans Optimal Transport Formulation -The quality of an output simplex is measured as the total transportation cost of the input points to the assigned simplex vertices and edges. -For the transportation cost, the 2-Wasserstein metric is chosen which is also known the Earth Mover Distance, and intuitively +The quality of the output simplex is measured as the total transportation cost of the input points to their assigned simplex vertices and edges. +For the transportation cost, the 2-Wasserstein metric is chosen, also known the Earth Mover Distance, it intuitively corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, where the cost is measured using the \f$L_2 \f$ distances. \subsection Reconstruction_simplification_2TransCost Transportation Plan & Cost from Points to Simplices -Assuming that the algorithm is given an output simplex \f$T \f$, and a point-to-simplex assignment which maps every input point to either an edge or a vertex of \f$T \f$, -the total transportation cost is then computed using the following rules. For a point to vertex assignment, the cost is simply the sum of the weighted \f$L_2 \f$-distances of all the points +Assuming that the algorithm is given an output simplex \f$T \f$ and a point-to-simplex assignment which maps every input point to either an edge or a vertex of \f$T \f$, +the total transportation cost is computed using the following assignment rules: For a point to vertex assignment, the transportation cost is simply the sum of the weighted \f$L_2 \f$-distances of all the points assigned to the given vertex. -For an edge of the simplex, the optimal plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is a bit more involved. In order to compute it, we decompose an edge \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$\f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$ with \f$ m_i \f$ denoting the mass of point \f$q_i \f$, \f$M_e \f$ the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ the length of \f$ e \f$. - +For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, we decompose \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. \cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. \cgalFigureEnd @@ -59,11 +58,11 @@ Illustration of the bins of a simplicial-edge induced by the input points assign \section Reconstruction_simplification_2VertexRelocation Vertex Relocation -Since noise and missing data may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of the current weighted \f$L_2 \f$ distance. The vertices then get relocated only if the resulting triangulation is still embeddable. +Since noise and missing data may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. \cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} -A noisy skyline (left), after vertex relocation (right). +A noisy skyline on the left, and the relocated vertices on the right. \cgalFigureEnd @@ -77,18 +76,17 @@ exposed to the user is the Reconstruction_simplification_2 class. \code{.cpp} /* -K : Kernel is the geometric kernel, used for the reconstruction and simplification task. -InputIterator : InputIterator is the iterator type of the algorithm input. -PointPMap : is a PropertyMap for accessing the input points. -MassPMap : MassPMap is a PropertyMap for accessing the input points' +K : a geometric kernel, used for the reconstruction and simplification task. + +input. +PointPMap : a PropertyMap for accessing the input points. +MassPMap : a PropertyMap for accessing the input points' */ -Reconstruction_simplification_2 +Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.initialize(); - rs2.reconstruct(100); //perform 100 contraction steps @@ -118,9 +116,9 @@ Example of a reconstructed image where the user specified that the output should The following example shows a simple use case of the Reconstruction_simplification_2 package. -It works by first reading a collection of input points from an xy-file. Using two property maps -the points and their optional initial mass are passed to the Reconstruction_simplification_2 object rs2. -After initializing rs2, 100 iterations of the reconstruction process are performed. Lastly, the isolated +It works by first reading a collection of input points from an xy-file. Using two property maps, +the points and their optional initial mass are passed to the Reconstruction_simplification_2 object. +After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the isolated points and the edges of the reconstructed shape are extracted and printed to the console using the List_output model. diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index a10e0f792cf..adfc3268d73 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -166,12 +166,10 @@ public: Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - \param nb_ignore The number of verticess to be ignored in the output. - */ - void store_marked_elements(Rt_2& rt2, int nb_ignore) { + void store_marked_elements(Rt_2& rt2) { store_marked_vertices(rt2); - store_marked_edges(rt2, nb_ignore); + store_marked_edges(rt2, 0); //TODO: IV do we want the nb_ignore parameter } }; diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index c5b2a0a8868..0f9959976ec 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -40,7 +40,7 @@ namespace CGAL { \brief The class `Off_output` is a model for the `OutputModule` concept. \details It allows accessing the isolated vertices and the edges -of the reconstructed shape via an std::ostream object. +of the reconstructed shape in the OFF format via an std::ostream object. \tparam Kernel is the geometric kernel, used for the reconstruction and @@ -108,11 +108,10 @@ public: Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - \param nb_ignore The number of verticess to be ignored in the output. */ - void store_marked_elements(Rt_2& rt2, int nb_ignore) { - list_output.store_marked_elements(rt2, nb_ignore); + void store_marked_elements(Rt_2& rt2) { + list_output.store_marked_elements(rt2, 0); } /*! diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 0bd6e50bea0..22a4d5f7515 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -41,6 +41,9 @@ template < class Kernel, class Fb = Triangulation_face_base_2 > class Reconstruction_face_base_2 : public Fb { public: + + /// \cond SKIP_IN_MANUAL + typedef Fb Base; typedef typename Base::Vertex_handle Vertex_handle; typedef typename Base::Face_handle Face_handle; @@ -253,6 +256,10 @@ struct less_Edge if (a1 < b1) return true; return false; } + + + /// \endcond + }; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index c0dc53f53c4..f59286fbccd 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -45,19 +45,19 @@ namespace CGAL { -\brief The class `Reconstruction_simplification_2` is the main class +\brief `Reconstruction_simplification_2` is the main class for executing the reconstruction and simplification tasks. -It takes an InputIterator which can be used to traverse a collection +Its constructor takes an InputIterator, used to traverse a collection of point-mass pairs, where the points and their masses are accessed via the PointPMap and MassPMap `PropertyMap`s respectively. -\tparam Kernel is the geometric kernel, used throughout the reconstruction and +\tparam Kernel a geometric kernel, used throughout the reconstruction and simplification task. -\tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = `Point_2` +\tparam PointPMap a model of `ReadablePropertyMap` with a value_type = `Point_2` -\tparam MassPMap is a model of `ReadablePropertyMap` with a value_type = `FT` +\tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `FT` */ template @@ -161,7 +161,7 @@ protected: Instantiates a new Reconstruction_simplification_2. It computes an bounding box around the input points and creates a first (fine) output simplex as well as an initial transportation plan. This - first output simplex + first output simplex is then made coarser during subsequent iterations. \details Instantiates a new Reconstruction_simplification_2 object for a given collection of point-mass pairs. @@ -225,7 +225,7 @@ protected: } //Function if one wants to create a Reconstruction_simplification_2 - //without specifying the input yet in the constructor + //without specifying the input yet in the constructor. template void initialize(InputIterator start_itr, InputIterator beyond_itr, @@ -276,7 +276,7 @@ protected: */ template void extract_solid_elements(OutputModule& output) { - output.store_marked_elements(m_dt, m_ignore); + output.store_marked_elements(m_dt); } /// \cond SKIP_IN_MANUAL @@ -1041,7 +1041,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! - Since noise and missing data result may prevent the reconstructed shape to + Since noise and missing data may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the @@ -1296,7 +1296,6 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { // RECONSTRUCTION // /*! - This function must be called after initialization(). It computes a shape consisting of nv vertices, reconstructing the input points. @@ -1322,7 +1321,6 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } /*! - This function must be called after initialization(). It computes a shape, reconstructing the input, by performing steps many edge contractions on the output simplex. diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 627bb8de12c..2526ee5edb8 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -34,6 +34,9 @@ namespace CGAL { template < class Kernel, class Vb = Triangulation_vertex_base_2 > class Reconstruction_vertex_base_2 : public Vb { + + /// \cond SKIP_IN_MANUAL + public: typedef Vb Base; typedef typename Kernel::FT FT; @@ -121,6 +124,9 @@ struct less_Vertex_handle } }; + +/// \endcond + } //end namespace #endif /* RECONSTRUCTION_VERTEX_BASE_2_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 288d89175d4..d99ed6b226a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -106,10 +106,8 @@ public: Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - \param nb_ignore The number of verticess to be ignored in the output. - */ - void store_marked_elements(Rt_2& rt2, int nb_ignore) { + void store_marked_elements(Rt_2& rt2) { m_rt2 = rt2; mark_vertices(); mark_edges(); From 84b594f1abf49741762166cd08915017a8a571ea Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 31 Jul 2014 13:32:44 +0200 Subject: [PATCH 055/201] Example Added --- .../Reconstruction_Simplification_2.txt | 10 ++ .../CMakeLists.txt | 2 +- ...uction_simplification_2_output_example.cpp | 160 ++++++++++++++++++ .../include/CGAL/Off_output.h | 2 +- 4 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b9156810777..e3c3c3ffe04 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -126,6 +126,16 @@ points and the edges of the reconstructed shape are extracted and printed to the \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} +\subsubsection Reconstruction_simplification_2Output Output-Example + +To access the reconstructed vertices and edges, models which implement the OutputModule Concept can be used. The package offers three such models, CGAL::List_output, CGAL::Off_output, CGAL::Tds_output + + +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} + + + + */ } /* namespace CGAL */ diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt index 961ad900c93..49a8ad00477 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "reconstruction_simplification_2_example.cpp" ) + create_single_source_cgal_program( "reconstruction_simplification_2_output_example.cpp" ) else() diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp new file mode 100644 index 00000000000..c4247cd0664 --- /dev/null +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -0,0 +1,160 @@ +// reconstruction_simplification_2_output_example.cpp + + +//---------------------------------------------------------- +// Simple output example for Reconstruction_simplification_2 +//---------------------------------------------------------- + + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include // std::pair + + +#include +#include + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; + +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; + +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + + +typedef CGAL::Reconstruction_simplification_2 Rs_2; + +typedef Rs_2::Vertex Vertex; + +typedef Rs_2::Reconstruction_edge_2 R_edge_2; + +typedef CGAL::Reconstruction_triangulation_2 Rt_2; + +typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; +typedef Rt_2::Vertex_iterator Vertex_iterator; + +typedef Rt_2::Edge Edge; + + +void list_output(Rs_2& rs2); +void tds_output(Rs_2& rs2); +void off_output(Rs_2& rs2); + + +void print_edge(Edge edge) { + int i = edge.second; + Point a = edge.first->vertex((i+1)%3)->point(); + Point b = edge.first->vertex((i+2)%3)->point(); + std::cout << a << " , " << b << std::endl; + +} + +void load_xy_file(const std::string& fileName, PointMassList& points) +{ + std::ifstream ifs(fileName); + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points.push_back(std::make_pair(point, 1)); + } + ifs.close(); +} + +int main () +{ + + PointMassList points; + load_xy_file("data/stair-noise00.xy", points); + + PointPMap point_pmap; + MassPMap mass_pmap; + + Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.reconstruct(100); //100 steps + + list_output(rs2); + tds_output(rs2); + off_output(rs2); +} + +void list_output(Rs_2& rs2) { + + std::cout << "(-------------List output---------- )" << std::endl; + + std::vector isolated_points; + std::vector edges; + + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; + + Point_it point_it(isolated_points); + Edge_it edge_it(edges); + + CGAL::List_output list_output(point_it, edge_it); + + rs2.extract_solid_elements(list_output); + + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + std::cout << *it << std::endl; + } + + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + } +} + +void tds_output(Rs_2& rs2) { + + std::cout << "(-------------Tds output---------- )" << std::endl; + + CGAL::Tds_output tds_output; + rs2.extract_solid_elements(tds_output); + Rt_2 rt2; + tds_output.extract_reconstruction_tds(rt2); + + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) { + + FT relevance = (*vi).get_relevance(); + if (relevance > 0) { + std::cout << *vi << std::endl; + } + } + + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { + FT relevance = (*ei).first->relevance((*ei).second); + if (relevance > 0) { + print_edge(*ei); + } + } +} + +void off_output(Rs_2& rs2) { + + std::cout << "(-------------Off output---------- )" << std::endl; + + CGAL::Off_output off_output; + + rs2.extract_solid_elements(off_output); + + off_output.get_os_output(std::cout); + +} diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 0f9959976ec..7c7f0b4f0d1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -111,7 +111,7 @@ public: */ void store_marked_elements(Rt_2& rt2) { - list_output.store_marked_elements(rt2, 0); + list_output.store_marked_elements(rt2); } /*! From f5c795f57e7b7de35a08e0f7f27719e9d8ad4931 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 1 Aug 2014 18:03:44 +0200 Subject: [PATCH 056/201] docu extended, setters included --- .../Reconstruction_Simplification_2.txt | 50 ++++++++++++++++++- .../include/CGAL/Off_output.h | 4 +- .../CGAL/Reconstruction_simplification_2.h | 44 ++++++++++++++-- 3 files changed, 91 insertions(+), 7 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index e3c3c3ffe04..4a4e5f3e860 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -128,12 +128,60 @@ points and the edges of the reconstructed shape are extracted and printed to the \subsubsection Reconstruction_simplification_2Output Output-Example -To access the reconstructed vertices and edges, models which implement the OutputModule Concept can be used. The package offers three such models, CGAL::List_output, CGAL::Off_output, CGAL::Tds_output +To access the reconstructed vertices and edges, models which implement the OutputModule Concept can be used. The package offers three such models, List_output, Off_output, Tds_output \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} +\section Reconstruction_simplification_2Performance Performance + + + + + + + + + + + + +

+
+ +Number of points + +reconstruction duration (in s) +

+
+60 + +15 +
+100 + +25 +
+250 + +96 +
+500 + +150 +
+1,000 + +249 +
+1,800 + +478 +

+
+ + diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 7c7f0b4f0d1..312406480fc 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -96,14 +96,12 @@ private: } } - /// \endcond + public: Off_output() : list_output(Point_it(isolated_points), Edge_it(edges)) { } - - /*! Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index f59286fbccd..82260238d5f 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -296,26 +296,48 @@ protected: double time_duration(const double init) { return (clock() - init) / CLOCKS_PER_SEC; } + /// \endcond + + /*! + Allows a speedup by not using the priority queue but using a random subset + of mchoice many samples. Based on those the next edge collapse step is determined. + By default mchoice is set to 0. + + \param mchoice The number of samples used for the multiple choice selection. + */ void set_mchoice(const int mchoice) { m_mchoice = mchoice; } + /*! + Determines how much console output the algorithm generates. + By default verbose is set to 0. + + \param verbose The verbosity level. + */ void set_verbose(const int verbose) { m_verbose = verbose; } + /// \cond SKIP_IN_MANUAL void set_alpha(const double alpha) { m_alpha = alpha; } + /// \endcond + /*! + The use_flip parameter determines whether the flipping procedure + is used for the half-edge collapse. By default use_flip is set to true. + */ void set_use_flip(const bool use_flip) { m_use_flip = use_flip; } + /// \cond SKIP_IN_MANUAL void set_norm_tol(const double norm_tol) { m_norm_tol = norm_tol; } @@ -334,24 +356,40 @@ protected: double get_tang_tol() const { return m_tang_tol; } + /// \endcond + /*! + The relocation parameter controls the number of relocations + that are performed between two edge collapses. + By default relocation is set to 0. + */ void set_relocation(const unsigned relocation) { m_relocation = relocation; } - + /// \cond SKIP_IN_MANUAL unsigned get_relocation() const { return m_relocation; } + /// \endcond - void set_ghost(const double g) { - m_ghost = g; + /*! + After the decimation is completed, irrelevant edges may exist in the + reconstructed simplex. Using a use-case related relevance score, + which favors long edges with large mass and low cost, the algorithm + discard the edges with low relevance. The default value of relevance is 1. + + \param relevance The relevance level. + */ + void set_ghost(const double relevance) { + m_ghost = relevance; m_dt.ghost_factor() = m_ghost; } + /// \cond SKIP_IN_MANUAL double get_ghost() { return m_ghost; } From 5922869c144b376910b5bfd53f1cac51e7cde5ee Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 6 Aug 2014 17:50:10 +0200 Subject: [PATCH 059/201] outputmodule changed --- .../Concepts/Output.h | 31 ------------------- .../PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt | 2 +- .../include/CGAL/List_output.h | 2 +- .../include/CGAL/Off_output.h | 2 +- .../include/CGAL/Tds_output.h | 2 +- 6 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h deleted file mode 100644 index fc9d0ddcb3f..00000000000 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Concepts/Output.h +++ /dev/null @@ -1,31 +0,0 @@ - -/*! -\ingroup PkgReconstructionSimplification2Concepts -\cgalConcept - -The OutputModule provides a Concept which allows the user to access the simplified -shape in a versatile way. - - - -\cgalHasModel `CGAL::List_output` -\cgalHasModel `CGAL::Off_output` -\cgalHasModel `CGAL::Tds_output` - - -*/ - -class OutputModule { -public: - -/*! -Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. - -\param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - -*/ -void store_marked_elements(Rt_2& rt2); - - -}; /* end OutputModule */ - diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index e3f92ce3f7e..b89c728489e 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -30,7 +30,7 @@ \cgalClassifedRefPages ## Concepts ## -- `OutputModule` +- `ReconstructionSimplificationOutput_2` ## Models ## diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 4a4e5f3e860..3c8de2057de 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -128,7 +128,7 @@ points and the edges of the reconstructed shape are extracted and printed to the \subsubsection Reconstruction_simplification_2Output Output-Example -To access the reconstructed vertices and edges, models which implement the OutputModule Concept can be used. The package offers three such models, List_output, Off_output, Tds_output +To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models, List_output, Off_output, Tds_output \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index adfc3268d73..727890dba68 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -41,7 +41,7 @@ namespace CGAL { \ingroup PkgReconstructionSimplification2Models -\brief The class `List_output` is a model for the `OutputModule` concept. +\brief The class `List_output` is a model for the `ReconstructionSimplificationOutput_2` concept. \details It takes two `Output-Iterators`, one for storing the isolated points and one for storing the edges of the reconstructed shape. diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 312406480fc..7490430eae1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -37,7 +37,7 @@ namespace CGAL { \ingroup PkgReconstructionSimplification2Models -\brief The class `Off_output` is a model for the `OutputModule` concept. +\brief The class `Off_output` is a model for the `ReconstructionSimplificationOutput_2` concept. \details It allows accessing the isolated vertices and the edges of the reconstructed shape in the OFF format via an std::ostream object. diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index d99ed6b226a..33bbee02b12 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -35,7 +35,7 @@ namespace CGAL { \ingroup PkgReconstructionSimplification2Models -\brief The class `Tds_output` is a model for the `OutputModule` concept. +\brief The class `Tds_output` is a model for the `ReconstructionSimplificationOutput_2` concept. \details It provides access to the `Tds_2` of the reconstruction simplex. From 72882c5a95cc8d95cd197f3303cbd6828f209d16 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 11 Aug 2014 19:12:37 +0200 Subject: [PATCH 060/201] Pierres comments incorporated till page 7 --- .../Reconstruction_Simplification_2.txt | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 3c8de2057de..0d0ac601073 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -16,40 +16,39 @@ namespace CGAL { From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. \cgalFigureEnd -The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the non-noise subset of \f$ S \f$. The related task of simplifying a shape finds an approximation of the original shape using simpler curves. +The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplex . -The algorithm of \cgalCite{degoes:hal-00758019} presented here performs the reconstruction and simplification task jointly, using a unified framework based on optimal transports of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm of \cgalCite{degoes:hal-00758019} presented here performs the reconstruction and simplification task jointly, using a unified framework based on optimal transportations of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. -The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a linear combination of uniform measures on the edges and vertices of \f$ T \f$. +The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. -It performs a coarse to fine simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is made courser in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. +It performs a fine to coarse simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. \cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} Illustration of an edge contraction, indicated by the blue arrow. The resulting reassignment of the input points to vertices and edges is depicted in green and red respectively. \cgalFigureEnd -The transportation plan is approximated by assigning each input point temporarily to a closest simplex edge. An input point is then permanently assigned to the edge if and only if the corresponding transportation cost is less than the transportation cost for each of the two vertices of the edge. Otherwise it is assigned to the cheaper of the two vertices. This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. +The transportation plan is approximated by assigning each input point temporarily to the closest simplex edge. After this partitioning of the input points w.r.t. the edges, all the points temporarily assigned to a given edge are being assigned to it permanently if and only if the corresponding transportation costs are less than the transportation cost for each of the two vertices of the edge. Otherwise each of the points iOS assigned to the cheaper of the two vertices. [TODO: add that edge flips also occur to make edges collapsible] This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. \section Reconstruction_simplification_2Overview Overview of the Reconstruction Process -While previous works address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be point sets in \f$ \mathbb{R}^2 \f$). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a bijection between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. +While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. \section Reconstruction_simplification_2Trans Optimal Transport Formulation The quality of the output simplex is measured as the total transportation cost of the input points to their assigned simplex vertices and edges. -For the transportation cost, the 2-Wasserstein metric is chosen, also known the Earth Mover Distance, it intuitively -corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, where the cost is measured using the \f$L_2 \f$ distances. +For the transportation cost, the 2-Wasserstein metric is chosen which intuitively +corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, when the cost is measured using the \f$L_2 \f$ distance. \subsection Reconstruction_simplification_2TransCost Transportation Plan & Cost from Points to Simplices Assuming that the algorithm is given an output simplex \f$T \f$ and a point-to-simplex assignment which maps every input point to either an edge or a vertex of \f$T \f$, -the total transportation cost is computed using the following assignment rules: For a point to vertex assignment, the transportation cost is simply the sum of the weighted \f$L_2 \f$-distances of all the points -assigned to the given vertex. +the total transportation cost is computed using the following assignment rules: For a point to vertex assignment, the transportation cost is simply the sum of the weighted \f$L_2 \f$-distance of all the points assigned to the given vertex. -For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, we decompose \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. +For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, we decompose \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. \cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. \cgalFigureEnd From 81cc599cb5f8ccd5812ee72ada65c789ed3d667a Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 12 Aug 2014 09:58:02 +0200 Subject: [PATCH 061/201] Pierres comments incorporated --- .../PackageDescription.txt | 4 +-- .../Reconstruction_Simplification_2.txt | 17 ++++++------ ...uction_simplification_2_output_example.cpp | 12 ++++----- .../include/CGAL/List_output.h | 10 +++---- .../include/CGAL/Off_output.h | 4 +-- .../CGAL/Reconstruction_simplification_2.h | 26 ++++++++++--------- .../include/CGAL/Tds_output.h | 2 +- .../testing_tools.h | 12 +++------ 8 files changed, 42 insertions(+), 45 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index b89c728489e..b511b8daf86 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -14,8 +14,8 @@ \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} \cgalPkgPicture{overview.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan} -\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine to coarse manner.} +\cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clement Jamin} +\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine-to-coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 0d0ac601073..1cb95f32c93 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -57,7 +57,7 @@ Illustration of the bins of a simplicial-edge induced by the input points assign \section Reconstruction_simplification_2VertexRelocation Vertex Relocation -Since noise and missing data may prevent the reconstructed shape to have sharp corners, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. +Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers the option to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. \cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} @@ -78,15 +78,15 @@ exposed to the user is the Reconstruction_simplification_2 class. K : a geometric kernel, used for the reconstruction and simplification task. input. -PointPMap : a PropertyMap for accessing the input points. -MassPMap : a PropertyMap for accessing the input points' +PointPMap : a PropertyMap for accessing the input points. +MassPMap : a PropertyMap for accessing the input points' measures. */ Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct(100); //perform 100 contraction steps + rs2.reconstruct(100); // perform 100 contraction steps @@ -94,19 +94,20 @@ Reconstruction_simplification_2 Alternatively to calling the reconstruction module using \code{.cpp} - rs2.reconstruct(100); //perform 100 contraction steps + rs2.reconstruct(100); // perform 100 contraction steps \endcode one can use the reconstruct_until function \code{.cpp} - rs2.reconstruct_until(20); //perform edge contractions until only 20 vertices are left. + rs2.reconstruct_until(20); // perform edge contractions until only 20 vertices are left. \endcode and specify the number of output vertices one wants to keep as illustrated in the following picture. \cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} -Example of a reconstructed image where the user specified that the output should consist of \f$20 \f$ vertices. +Examples of \f$20 \f$ vertex reconstructions from images consisting of \f$2000, 400 \f$ and \f$200 \f$ input points respectively. The example shows nicely +how the algorithm is sensitiv to the input density in that it gracefully degrades the reconstruction as the density decreases. \cgalFigureEnd @@ -127,7 +128,7 @@ points and the edges of the reconstructed shape are extracted and printed to the \subsubsection Reconstruction_simplification_2Output Output-Example -To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models, List_output, Off_output, Tds_output +To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models: List_output, Off_output, Tds_output. \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index c4247cd0664..9f481ce7f1a 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -57,21 +57,19 @@ void off_output(Rs_2& rs2); void print_edge(Edge edge) { int i = edge.second; - Point a = edge.first->vertex((i+1)%3)->point(); - Point b = edge.first->vertex((i+2)%3)->point(); + const Point& a = edge.first->vertex((i+1)%3)->point(); + const Point& b = edge.first->vertex((i+2)%3)->point(); std::cout << a << " , " << b << std::endl; } -void load_xy_file(const std::string& fileName, PointMassList& points) +void load_xy_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(fileName); + std::ifstream ifs(filename); Point point; - unsigned int nb = 0; while (ifs >> point) - { points.push_back(std::make_pair(point, 1)); - } + ifs.close(); } diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 727890dba68..357da3fec48 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -83,7 +83,7 @@ private: Output_Vertex_Iterator m_v_it; Output_Edge_Iterator m_e_it; - void store_marked_vertices(Rt_2& rt2) { + void store_solid_vertices(Rt_2& rt2) { for (Vertex_iterator vi = rt2.vertices_begin(); vi != rt2.vertices_end(); ++vi) @@ -111,7 +111,7 @@ private: } } - void store_marked_edges(Rt_2& rt2, int nb_ignore) { + void store_solid_edges(Rt_2& rt2, int nb_ignore) { MultiIndex mindex; for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { @@ -167,9 +167,9 @@ public: \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. */ - void store_marked_elements(Rt_2& rt2) { - store_marked_vertices(rt2); - store_marked_edges(rt2, 0); //TODO: IV do we want the nb_ignore parameter + void store_solid_elements(Rt_2& rt2) { + store_solid_vertices(rt2); + store_solid_edges(rt2, 0); //TODO: IV do we want the nb_ignore parameter } }; diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Off_output.h index 7490430eae1..3403f2a2a1d 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Off_output.h @@ -108,8 +108,8 @@ public: \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. */ - void store_marked_elements(Rt_2& rt2) { - list_output.store_marked_elements(rt2); + void store_solid_elements(Rt_2& rt2) { + list_output.store_solid_elements(rt2); } /*! diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 82260238d5f..2d91f546cc2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -49,7 +49,7 @@ namespace CGAL { for executing the reconstruction and simplification tasks. Its constructor takes an InputIterator, used to traverse a collection of point-mass pairs, where the points and their masses are accessed -via the PointPMap and MassPMap `PropertyMap`s respectively. +via the PointPMap and MassPMap `PropertyMaps` respectively. \tparam Kernel a geometric kernel, used throughout the reconstruction and @@ -57,7 +57,7 @@ via the PointPMap and MassPMap `PropertyMap`s respectively. \tparam PointPMap a model of `ReadablePropertyMap` with a value_type = `Point_2` -\tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `FT` +\tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` */ template @@ -159,8 +159,8 @@ protected: /*! Instantiates a new Reconstruction_simplification_2. - It computes an bounding box around the input points and creates a first - (fine) output simplex as well as an initial transportation plan. This + Computes a bounding box around the input points and creates a first + (dense) output simplex as well as an initial transportation plan. This first output simplex is then made coarser during subsequent iterations. \details Instantiates a new Reconstruction_simplification_2 object @@ -264,7 +264,8 @@ protected: /*! - Returns the solid edges present after the reconstruction process. + Returns the solid edges and vertics present after the reconstruction + process finished. \details Instantiates a new Reconstruction_simplification_2 object for a given collection of point-mass pairs. @@ -276,7 +277,7 @@ protected: */ template void extract_solid_elements(OutputModule& output) { - output.store_marked_elements(m_dt); + output.store_solid_elements(m_dt); } /// \cond SKIP_IN_MANUAL @@ -300,7 +301,7 @@ protected: /*! - Allows a speedup by not using the priority queue but using a random subset + Allows a speedup by not using the priority queue but instead using a random subset of mchoice many samples. Based on those the next edge collapse step is determined. By default mchoice is set to 0. @@ -312,7 +313,8 @@ protected: /*! Determines how much console output the algorithm generates. - By default verbose is set to 0. + By default verbose is set to 0. If set to a value larger than 0 + details about the reconstruction process are writen to std::err. \param verbose The verbosity level. */ @@ -1080,11 +1082,11 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Since noise and missing data may prevent the reconstructed shape to - have sharp corners, the algorithm offers the possibility to automatically + have sharp corners well located, the algorithm offers the possibility to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component - of the weighted $L_2$ distance. The vertices then get relocated only if the + of the weighted \f$L_2 \f$ distance. The vertices then get relocated only if the resulting triangulation is still embeddable. */ void relocate_all_vertices() { @@ -1334,7 +1336,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { // RECONSTRUCTION // /*! - It computes a shape consisting of nv vertices, reconstructing the input + Computes a shape consisting of nv vertices, reconstructing the input points. \param nv The number of vertices which will be present in the output. @@ -1359,7 +1361,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } /*! - It computes a shape, reconstructing the input, by performing steps many + Computes a shape, reconstructing the input, by performing steps many edge contractions on the output simplex. \param steps The number of edge contractions performed by the algorithm. diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index 33bbee02b12..dade4ec354f 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -107,7 +107,7 @@ public: \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. */ - void store_marked_elements(Rt_2& rt2) { + void store_solid_elements(Rt_2& rt2) { m_rt2 = rt2; mark_vertices(); mark_edges(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h index 960fa09c5f7..f8f41ecf899 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h @@ -2,16 +2,12 @@ template -void load_xy_file(const std::string& fileName, PointMassList& points) +void load_xy_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(fileName); - std::cerr << "read xy..."; + std::ifstream ifs(filename); Point point; - unsigned int nb = 0; while (ifs >> point) - { - points.push_back(std::make_pair(point, 1)); - } - std::cerr << "done (" << nb << " points)" << std::endl; + points.push_back(std::make_pair(point, 1)); + ifs.close(); } From 83ff5eb1a0bf39c9a65c2defd18e97a3aa36c862 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 12 Aug 2014 11:10:47 +0200 Subject: [PATCH 062/201] Pierres comments incorporated done --- .../PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index b511b8daf86..a95a776b057 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -14,7 +14,7 @@ \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} \cgalPkgPicture{overview.png} \cgalPkgSummaryBegin -\cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clement Jamin} +\cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clément Jamin} \cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine-to-coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 1cb95f32c93..574001c82a3 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -22,17 +22,22 @@ The algorithm of \cgalCite{degoes:hal-00758019} presented here performs the reco The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. -It performs a fine to coarse simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. +It performs a fine to coarse simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. Since disregarding edges which do not preserve the embedding of the triangulation can severely affect the performance of the greedy approach to optimal transport, the contraction operator is modified by adding a local flip procedure which makes every edge contractable. + +\cgalFigureBegin{2D_Reconstruction_Simplification_edgeflip,edgeflip.png} +Illustration of an edge flip. In the left image, the blue edge creates fold-overs because of blocking edges shown in black. After running the flipping procedure with the result shown in the middle image, the + blue edge is contractable, and the contraction results in the image shown on the right. +\cgalFigureEnd + + + +The transportation plan is approximated by assigning each input point temporarily to the closest simplex edge. After this partitioning of the input points w.r.t. the edges, all the points temporarily assigned to a given edge are being assigned to it permanently if and only if the corresponding transportation costs are less than the transportation cost for each of the two vertices of the edge. Otherwise each of the points is assigned to the cheaper of the two vertices. This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. \cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} Illustration of an edge contraction, indicated by the blue arrow. The resulting reassignment of the input points to vertices and edges is depicted in green and red respectively. \cgalFigureEnd -The transportation plan is approximated by assigning each input point temporarily to the closest simplex edge. After this partitioning of the input points w.r.t. the edges, all the points temporarily assigned to a given edge are being assigned to it permanently if and only if the corresponding transportation costs are less than the transportation cost for each of the two vertices of the edge. Otherwise each of the points iOS assigned to the cheaper of the two vertices. [TODO: add that edge flips also occur to make edges collapsible] This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. - - - \section Reconstruction_simplification_2Overview Overview of the Reconstruction Process While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. From 8ee08ce8e15cddda34777bc90c7135a916e4bbf0 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 12 Aug 2014 17:08:25 +0200 Subject: [PATCH 063/201] renamed off_output to index_output --- .../PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt | 2 +- ...ruction_simplification_2_output_example.cpp | 14 +++++++------- .../CGAL/{Off_output.h => Index_output.h} | 18 +++++++++--------- .../test_output_modules.cpp | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) rename Reconstruction_simplification_2/include/CGAL/{Off_output.h => Index_output.h} (88%) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index a95a776b057..268b562132f 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -35,7 +35,7 @@ ## Models ## - `CGAL::List_output` -- `CGAL::Off_output` +- `CGAL::Index_output` - `CGAL::Tds_output` diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 574001c82a3..046d1b189ac 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -133,7 +133,7 @@ points and the edges of the reconstructed shape are extracted and printed to the \subsubsection Reconstruction_simplification_2Output Output-Example -To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models: List_output, Off_output, Tds_output. +To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models: List_output, Index_output, Tds_output. \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 9f481ce7f1a..fa53585dd74 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ typedef Rt_2::Edge Edge; void list_output(Rs_2& rs2); void tds_output(Rs_2& rs2); -void off_output(Rs_2& rs2); +void index_output(Rs_2& rs2); void print_edge(Edge edge) { @@ -88,7 +88,7 @@ int main () list_output(rs2); tds_output(rs2); - off_output(rs2); + index_output(rs2); } void list_output(Rs_2& rs2) { @@ -145,14 +145,14 @@ void tds_output(Rs_2& rs2) { } } -void off_output(Rs_2& rs2) { +void index_output(Rs_2& rs2) { std::cout << "(-------------Off output---------- )" << std::endl; - CGAL::Off_output off_output; + CGAL::Index_output index_output; - rs2.extract_solid_elements(off_output); + rs2.extract_solid_elements(index_output); - off_output.get_os_output(std::cout); + index_output.get_os_output(std::cout); } diff --git a/Reconstruction_simplification_2/include/CGAL/Off_output.h b/Reconstruction_simplification_2/include/CGAL/Index_output.h similarity index 88% rename from Reconstruction_simplification_2/include/CGAL/Off_output.h rename to Reconstruction_simplification_2/include/CGAL/Index_output.h index 3403f2a2a1d..8136f85dea4 100644 --- a/Reconstruction_simplification_2/include/CGAL/Off_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Index_output.h @@ -1,5 +1,5 @@ -#ifndef OFF_OUTPUT_H_ -#define OFF_OUTPUT_H_ +#ifndef INDEX_OUTPUT_H_ +#define INDEX_OUTPUT_H_ // Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. @@ -37,17 +37,17 @@ namespace CGAL { \ingroup PkgReconstructionSimplification2Models -\brief The class `Off_output` is a model for the `ReconstructionSimplificationOutput_2` concept. +\brief The class `Index_output` is a model for the `ReconstructionSimplificationOutput_2` concept. \details It allows accessing the isolated vertices and the edges -of the reconstructed shape in the OFF format via an std::ostream object. +of the reconstructed shape in a format similar to the OFF format via an std::ostream object. \tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. */ template -class Off_output { +class Index_output { /// \cond SKIP_IN_MANUAL @@ -100,7 +100,7 @@ private: public: - Off_output() : list_output(Point_it(isolated_points), Edge_it(edges)) { } + Index_output() : list_output(Point_it(isolated_points), Edge_it(edges)) { } /*! Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. @@ -114,9 +114,9 @@ public: /*! Writes the edges and vertices of the output simplex into an `std::ostream` - in the OFF format. + in an indexed format. - \param os The `std::ostream` where the OFF data will be written to. + \param os The `std::ostream` where the indexed data will be written to. */ void get_os_output(std::ostream& os) { std::set edge_vertices; @@ -150,4 +150,4 @@ public: } -#endif /* OFF_OUTPUT_H_ */ +#endif /* INDEX_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index b6846914762..e685721286f 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include @@ -52,7 +52,7 @@ typedef Rt_2::Edge Edge; void test_list_output(Rs_2& rs2); void test_tds_output(Rs_2& rs2); -void test_off_output(Rs_2& rs2); +void test_index_output(Rs_2& rs2); void print_edge(Edge edge) { @@ -79,7 +79,7 @@ int main () test_list_output(rs2); test_tds_output(rs2); - test_off_output(rs2); + test_index_output(rs2); } void test_list_output(Rs_2& rs2) { @@ -151,20 +151,20 @@ void test_tds_output(Rs_2& rs2) { assert(edge_count == 31); } -void test_off_output(Rs_2& rs2) { +void test_index_output(Rs_2& rs2) { std::cout <<"(-------------Off OUTPUT---------- )" << std::endl; - CGAL::Off_output off_output; + CGAL::Index_output index_output; - rs2.extract_solid_elements(off_output); + rs2.extract_solid_elements(index_output); //print - off_output.get_os_output(std::cout); + index_output.get_os_output(std::cout); //test cardinalities std::ostringstream buffer; - off_output.get_os_output(buffer); + index_output.get_os_output(buffer); std::stringstream stream(buffer.str()); std::vector res; From 961a1207610b5010d919547d158fef2427b2a041 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 13 Aug 2014 11:44:48 +0200 Subject: [PATCH 064/201] added mass, length and cost accessors in Tds_output --- .../include/CGAL/List_output.h | 50 ++++++------------- .../include/CGAL/Tds_output.h | 34 +++++++++++++ .../test_output_modules.cpp | 11 ++-- 3 files changed, 57 insertions(+), 38 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h index 357da3fec48..f804ad3ff84 100644 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ b/Reconstruction_simplification_2/include/CGAL/List_output.h @@ -24,17 +24,13 @@ //CGAL #include +//std +#include + + //local #include - -// boost -#include -#include -#include -#include -#include - namespace CGAL { /*! @@ -67,16 +63,17 @@ public: typedef Reconstruction_triangulation_2 Rt_2; + typedef Reconstruction_vertex_base_2 Reconstruction_vertex_base_2; + typedef typename Rt_2::Vertex Vertex; typedef typename Rt_2::Edge Edge; typedef typename Rt_2::Vertex_iterator Vertex_iterator; + typedef typename Rt_2::Vertex_handle Vertex_handle; + typedef typename Rt_2::Face_handle Face_handle; typedef std::list Vertices; typedef std::list Edges; - typedef typename Rt_2::Reconstruction_edge_2 Reconstruction_edge_2; - typedef typename Rt_2::MultiIndex MultiIndex; - typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; private: @@ -90,8 +87,7 @@ private: { bool incident_edges_have_sample = false; typename Rt_2::Edge_circulator start = rt2.incident_edges(vi); - - typename Rt_2::Edge_circulator cur = start; + typename Rt_2::Edge_circulator cur = start; do { if (!rt2.is_ghost(*cur)) { @@ -111,34 +107,19 @@ private: } } - void store_solid_edges(Rt_2& rt2, int nb_ignore) { - MultiIndex mindex; + void store_solid_edges(Rt_2& rt2) { for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { Edge edge = *ei; if (rt2.is_ghost(edge)) continue; - FT value = rt2.get_edge_relevance(edge); // >= 0 - mindex.insert(Reconstruction_edge_2(edge, value)); - } + int index = edge.second; + Vertex_handle source = edge.first->vertex( (index+1)%3 ); + Vertex_handle target = edge.first->vertex( (index+2)%3 ); - int nb_remove = (std::min)(nb_ignore, int(mindex.size())); - - for (int i = 0; i < nb_remove; ++i) - { - Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); - (mindex.template get<0>()).erase(pedge); - } - - while (!mindex.empty()) - { - Reconstruction_edge_2 pedge = *(mindex.template get<1>()).begin(); - (mindex.template get<0>()).erase(pedge); - Segment s(pedge.source()->point(), pedge.target()->point()); - //edges.push_back(s); + Segment s(source->point(), target->point()); *m_e_it = s; m_e_it++; - } } @@ -169,11 +150,10 @@ public: */ void store_solid_elements(Rt_2& rt2) { store_solid_vertices(rt2); - store_solid_edges(rt2, 0); //TODO: IV do we want the nb_ignore parameter + store_solid_edges(rt2); } }; - } //namespace CGAL #endif /* LIST_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h index dade4ec354f..6a2a2b65ab2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ b/Reconstruction_simplification_2/include/CGAL/Tds_output.h @@ -122,6 +122,40 @@ public: void extract_reconstruction_tds(Rt_2& rt2) { rt2 = m_rt2; } + + /*! + Returns the mass of a given edge. + This can be used to introduce a problem specific relevance function which + can determine a threshold for ignoring reconstructed edges. + + \param edge The `Edge` of which the mass is returned. + */ + FT get_mass(Edge& edge) { + return m_rt2.get_mass(edge); + } + + /*! + Returns the length of a given edge. + This can be used to introduce a problem specific relevance function which + can determine a threshold for ignoring reconstructed edges. + + \param edge The `Edge` of which the length is returned. + */ + FT get_length(Edge& edge) { + return m_rt2.get_length(edge); + } + + /*! + Returns the cost of a given edge. + This can be used to introduce a problem specific relevance function which + can determine a threshold for ignoring reconstructed edges. + + \param edge The `Edge` of which the cost is returned. + */ + FT get_cost(Edge& edge) { + return m_rt2.get_cost(edge).finalize(); + } + }; } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index e685721286f..b668acee4cd 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -51,16 +51,15 @@ typedef Rt_2::Edge Edge; void test_list_output(Rs_2& rs2); -void test_tds_output(Rs_2& rs2); void test_index_output(Rs_2& rs2); +void test_tds_output(Rs_2& rs2); void print_edge(Edge edge) { int i = edge.second; Point a = edge.first->vertex((i+1)%3)->point(); Point b = edge.first->vertex((i+2)%3)->point(); - std::cout << a << " , " << b << " )" << std::endl; - + std::cout << a << " , " << b << std::endl; } int main () @@ -137,6 +136,7 @@ void test_tds_output(Rs_2& rs2) { vertex_count++; } } + std::cout <<"vertex_count " << vertex_count << std::endl; assert(vertex_count == 18); int edge_count = 0; @@ -144,6 +144,11 @@ void test_tds_output(Rs_2& rs2) { FT relevance = (*ei).first->relevance((*ei).second); if (relevance > 0) { print_edge(*ei); + + std::cout << "mass " << tds_output.get_mass(*ei) << std::endl; + std::cout << "cost " << tds_output.get_cost(*ei) << std::endl; + std::cout << "length " << tds_output.get_length(*ei) << std::endl; + edge_count++; } } From 300ff021e001e71878e497567cfaca2ec63216f6 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 13 Aug 2014 14:33:42 +0200 Subject: [PATCH 065/201] test_quality added to test suite --- .../CGAL/Reconstruction_simplification_2.h | 40 ++++++++++++++ .../CMakeLists.txt | 2 +- .../test_quality.cpp | 55 +++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 2d91f546cc2..b969bbd8cfe 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1331,8 +1331,48 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { std::cerr << "# ghost: " << nb_ghost << std::endl; } + /// \endcond + /*! + Returns the number of vertices present in the reconstructed triangulation. + */ + int get_vertex_count() { + return m_dt.number_of_vertices()-4 ; + + } + + /*! + Returns the number of (solid) edges present in the reconstructed triangulation. + */ + int get_edge_count() { + int nb_solid = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + nb_solid++; + } + return nb_solid; + } + + + /*! + Returns the cost of the (solid) edges present in the reconstructed triangulation. + */ + FT get_total_edge_cost() { + FT total_cost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + + total_cost += m_dt.get_cost(edge).finalize(); + } + return total_cost; + } + // RECONSTRUCTION // /*! diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 8d15fb4780e..bc844073166 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_output_modules.cpp" ) + create_single_source_cgal_program( "test_quality.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp new file mode 100644 index 00000000000..eb163d2643c --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -0,0 +1,55 @@ +// test_quality.cpp + +//---------------------------------------------------------- +// Tests the quality of the Reconstruction_simplification_2 process +//---------------------------------------------------------- + +#include +#include +#include "testing_tools.h" + +#include +#include +#include +#include // std::pair +#include + +#include +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; + +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + + +int main () +{ + PointMassList points; + //use the stair example for testing + load_xy_file("data/stair-noise00.xy", points); + + PointPMap point_pmap; + MassPMap mass_pmap; + + CGAL::Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.reconstruct_until(9); + + + + std::cout << " total_edge_cost "<< rs2.get_total_edge_cost() << std::endl; + + + assert(rs2.get_total_edge_cost() < 0.3); + assert(0 < rs2.get_total_edge_cost()); + + + rs2.print_stats_debug(); +} From 47c13675dafa850846cbf7819ae4adce281655bf Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 15 Aug 2014 12:51:47 +0200 Subject: [PATCH 066/201] doc --- .../Reconstruction_Simplification_2.txt | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 046d1b189ac..bea0f1564ae 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -139,52 +139,6 @@ To access the reconstructed vertices and edges, models which implement the Recon \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} -\section Reconstruction_simplification_2Performance Performance - - - - - - - - - - - - -

-
- -Number of points - -reconstruction duration (in s) -

-
-60 - -15 -
-100 - -25 -
-250 - -96 -
-500 - -150 -
-1,000 - -249 -
-1,800 - -478 -

-
From 2c66cc2f166dcd0badb2b7141a43656f21bfe38e Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Fri, 15 Aug 2014 12:53:35 +0200 Subject: [PATCH 067/201] flip procedure test added --- .../test_flip_procedure.cpp | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp new file mode 100644 index 00000000000..45e6177b896 --- /dev/null +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -0,0 +1,58 @@ + +// test_flip_procedure.cpp + +//---------------------------------------------------------- +// Test the cgal environment for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include +#include "testing_tools.h" + +#include +#include +#include +#include // std::pair +#include + +#include +#include + + + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::FT FT; + +typedef std::pair PointMassPair; +typedef std::list PointMassList; + +typedef CGAL::First_of_pair_property_map PointPMap; +typedef CGAL::Second_of_pair_property_map MassPMap; + + +int main () +{ + PointMassList points; + //use the stair example for testing + load_xy_file("data/stair-noise00.xy", points); + + PointPMap point_pmap; + MassPMap mass_pmap; + + + for (int i = 1; i <= points.size();) { + + CGAL::Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + + rs2.reconstruct_until(i); + + rs2.print_stats_debug(); + + assert(rs2.get_vertex_count() == i); + + i = i + 20; + + } +} From ab98bff5aadd453e70781d0d28c84fa68f727a34 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Sun, 12 Oct 2014 21:03:55 -0400 Subject: [PATCH 068/201] Output Modules Removed --- .../Reconstruction_simplification_2/scene.h | 6 +- ...uction_simplification_2_output_example.cpp | 18 +- ...econstruction_simplification_2_example.cpp | 5 +- .../include/CGAL/Index_output.h | 153 --------------- .../include/CGAL/List_output.h | 159 --------------- .../CGAL/Reconstruction_simplification_2.h | 183 ++++++++++++++++-- .../include/CGAL/Tds_output.h | 163 ---------------- .../CMakeLists.txt | 2 +- .../test_output_modules.cpp | 93 ++++----- .../test_reconstruction_until.cpp | 5 +- .../test_vertex_edge.cpp | 10 +- 11 files changed, 224 insertions(+), 573 deletions(-) delete mode 100644 Reconstruction_simplification_2/include/CGAL/Index_output.h delete mode 100644 Reconstruction_simplification_2/include/CGAL/List_output.h delete mode 100644 Reconstruction_simplification_2/include/CGAL/Tds_output.h diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index d771de6dd38..104a4cbd0a0 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -11,7 +11,7 @@ #include #include "Reconstruction_simplification_kerneled_2.h" #include "../../include/CGAL/Reconstruction_simplification_2.h" -#include "../../include/CGAL/List_output.h" + #include "third/CImg.h" @@ -414,9 +414,7 @@ public: Point_it point_it(isolated_points); Edge_it edge_it(edges); - CGAL::List_output list_output(point_it, edge_it); - - m_pwsrec->extract_solid_elements(list_output); + m_pwsrec->extract_list_output(point_it, edge_it); int vertex_count = 0; for (std::vector::iterator it = isolated_points.begin(); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index fa53585dd74..2278c3cfb4e 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -8,9 +8,6 @@ #include #include -#include -#include -#include #include #include @@ -104,9 +101,7 @@ void list_output(Rs_2& rs2) { Point_it point_it(isolated_points); Edge_it edge_it(edges); - CGAL::List_output list_output(point_it, edge_it); - - rs2.extract_solid_elements(list_output); + rs2.extract_list_output(point_it, edge_it); for (std::vector::iterator it = isolated_points.begin(); it != isolated_points.end(); it++) { @@ -123,10 +118,8 @@ void tds_output(Rs_2& rs2) { std::cout << "(-------------Tds output---------- )" << std::endl; - CGAL::Tds_output tds_output; - rs2.extract_solid_elements(tds_output); Rt_2 rt2; - tds_output.extract_reconstruction_tds(rt2); + rs2.extract_tds_output(rt2); for (Vertex_iterator vi = rt2.vertices_begin(); vi != rt2.vertices_end(); ++vi) { @@ -149,10 +142,5 @@ void index_output(Rs_2& rs2) { std::cout << "(-------------Off output---------- )" << std::endl; - CGAL::Index_output index_output; - - rs2.extract_solid_elements(index_output); - - index_output.get_os_output(std::cout); - + rs2.extract_index_output(std::cout); } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 2a13d9a879c..d614849478c 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -7,7 +7,6 @@ #include #include -#include #include @@ -84,9 +83,7 @@ int main () Point_it point_it(isolated_points); Edge_it edge_it(edges); - CGAL::List_output list_output(point_it, edge_it); - - rs2.extract_solid_elements(list_output); + rs2.extract_list_output(point_it, edge_it); std::cerr << "Isolated Vertices" << std::endl; for (std::vector::iterator it = isolated_points.begin(); diff --git a/Reconstruction_simplification_2/include/CGAL/Index_output.h b/Reconstruction_simplification_2/include/CGAL/Index_output.h deleted file mode 100644 index 8136f85dea4..00000000000 --- a/Reconstruction_simplification_2/include/CGAL/Index_output.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef INDEX_OUTPUT_H_ -#define INDEX_OUTPUT_H_ - - -// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. -// All rights reserved. -// - -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Ivo Vigan - -//CGAL -#include - -//local -#include -#include - -#include - -namespace CGAL { - -/*! -\ingroup PkgReconstructionSimplification2Models - - -\brief The class `Index_output` is a model for the `ReconstructionSimplificationOutput_2` concept. - -\details It allows accessing the isolated vertices and the edges -of the reconstructed shape in a format similar to the OFF format via an std::ostream object. - - -\tparam Kernel is the geometric kernel, used for the reconstruction and - simplification task. - */ -template -class Index_output { - - - /// \cond SKIP_IN_MANUAL - -public: - typedef Reconstruction_triangulation_2 Rt_2; - typedef typename Rt_2::Triangulation_data_structure Tds_2; - typedef typename Kernel::Point_2 Point; - typedef typename Kernel::Segment_2 Segment; - typedef typename Rt_2::Face_handle Face_handle; - -private: - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; - - std::vector isolated_points; - std::vector edges; - - CGAL::List_output list_output; - - - void save_one_edge(std::ostream& os, const Segment& edge, std::set& edge_vertices) { - Point a = edge.source(); - Point b = edge.target(); - - typename std::set::iterator it_a = edge_vertices.find(a); - typename std::set::iterator it_b = edge_vertices.find(b); - - int pos_a = std::distance(edge_vertices.begin(), it_a); - int pos_b = std::distance(edge_vertices.begin(), it_b); - - os << "2 " << pos_a + isolated_points.size() << " " - << pos_b + isolated_points.size() << std::endl; - } - - void vertices_of_edges(std::set& edge_vertices) { - - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - - Point a = (*it).source(); - Point b = (*it).target(); - - edge_vertices.insert(a); - edge_vertices.insert(b); - } - } - - /// \endcond - -public: - - Index_output() : list_output(Point_it(isolated_points), Edge_it(edges)) { } - - /*! - Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. - - \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - - */ - void store_solid_elements(Rt_2& rt2) { - list_output.store_solid_elements(rt2); - } - - /*! - Writes the edges and vertices of the output simplex into an `std::ostream` - in an indexed format. - - \param os The `std::ostream` where the indexed data will be written to. - */ - void get_os_output(std::ostream& os) { - std::set edge_vertices; - vertices_of_edges(edge_vertices); - - os << "OFF " << isolated_points.size() + edge_vertices.size() << - " 0 " << edges.size() << std::endl; - - for (typename std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - os << *it << std::endl; - } - - for (typename std::set::iterator it = edge_vertices.begin(); - it != edge_vertices.end(); it++) { - - os << *it << std::endl; - } - - for (int i = 0; i < isolated_points.size(); i++) { - os << "1 " << i << std::endl; - } - - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - - save_one_edge(os, *it,edge_vertices); - } - } -}; -} - - -#endif /* INDEX_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/List_output.h b/Reconstruction_simplification_2/include/CGAL/List_output.h deleted file mode 100644 index f804ad3ff84..00000000000 --- a/Reconstruction_simplification_2/include/CGAL/List_output.h +++ /dev/null @@ -1,159 +0,0 @@ -#ifndef LIST_OUTPUT_H_ -#define LIST_OUTPUT_H_ - -// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. -// All rights reserved. -// - -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Ivo Vigan - -//CGAL -#include - -//std -#include - - -//local -#include - -namespace CGAL { - -/*! -\ingroup PkgReconstructionSimplification2Models - - -\brief The class `List_output` is a model for the `ReconstructionSimplificationOutput_2` concept. - -\details It takes two `Output-Iterators`, one for storing the -isolated points and one for storing the edges of the reconstructed shape. - - -\tparam Kernel is the geometric kernel, used for the reconstruction and - simplification task. - -\tparam Output_Vertex_Iterator The `Output-Iterator` type for storing the points - -\tparam Output_Edge_Iterator The `Output-Iterator` type for storing the - edges (as Segments). - */ -template -class List_output { -public: - - /// \cond SKIP_IN_MANUAL - - typedef typename Kernel::FT FT; - typedef typename Kernel::Point_2 Point; - typedef typename Kernel::Segment_2 Segment; - - typedef Reconstruction_triangulation_2 Rt_2; - - typedef Reconstruction_vertex_base_2 Reconstruction_vertex_base_2; - - typedef typename Rt_2::Vertex Vertex; - typedef typename Rt_2::Edge Edge; - typedef typename Rt_2::Vertex_iterator Vertex_iterator; - typedef typename Rt_2::Vertex_handle Vertex_handle; - typedef typename Rt_2::Face_handle Face_handle; - - typedef std::list Vertices; - typedef std::list Edges; - - typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; - -private: - Output_Vertex_Iterator m_v_it; - Output_Edge_Iterator m_e_it; - - void store_solid_vertices(Rt_2& rt2) { - - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) - { - bool incident_edges_have_sample = false; - typename Rt_2::Edge_circulator start = rt2.incident_edges(vi); - typename Rt_2::Edge_circulator cur = start; - - do { - if (!rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) { - Point p = (*vi).point(); - *m_v_it = p; - m_v_it++; - } - } - } - } - - void store_solid_edges(Rt_2& rt2) { - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (rt2.is_ghost(edge)) continue; - - int index = edge.second; - Vertex_handle source = edge.first->vertex( (index+1)%3 ); - Vertex_handle target = edge.first->vertex( (index+2)%3 ); - - Segment s(source->point(), target->point()); - *m_e_it = s; - m_e_it++; - } - } - - /// \endcond -public: - - /// \name Creation - /// @{ - - /*! - Instantiates a new List_output object - for two given Output_Iterators. - - \param v_it An Output_Vertex_Iterator for storing the points. - - \param e_it An Output_Edge_Iterator for storing the edges (as Segments). - */ - List_output(Output_Vertex_Iterator v_it, Output_Edge_Iterator e_it) : - m_v_it(v_it), m_e_it(e_it) { } - /// @} - - - - /*! - Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. - - \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - */ - void store_solid_elements(Rt_2& rt2) { - store_solid_vertices(rt2); - store_solid_edges(rt2); - } -}; - -} //namespace CGAL - -#endif /* LIST_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index b969bbd8cfe..43d659b21a2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -262,25 +262,186 @@ protected: /// \endcond + /*! + Returns the solid edges and vertics present after the reconstruction + process finished. - Returns the solid edges and vertics present after the reconstruction - process finished. + \details It takes two `Output-Iterators`, one for storing the + isolated points and one for storing the edges of the reconstructed shape. - \details Instantiates a new Reconstruction_simplification_2 object - for a given collection of point-mass pairs. - \tparam OutputModule Concept for accessing the output + \tparam Kernel is the geometric kernel, used for the reconstruction and + simplification task. + + \tparam Output_Vertex_Iterator The `Output-Iterator` type for storing the points + + \tparam Output_Edge_Iterator The `Output-Iterator` type for storing the + edges (as Segments). + */ + template + void extract_list_output(Output_Vertex_Iterator v_it, Output_Edge_Iterator e_it) { + + for (Vertex_iterator vi = m_dt.vertices_begin(); + vi != m_dt.vertices_end(); ++vi) + { + + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; + + do { + if (!m_dt.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) { + Point p = (*vi).point(); + *v_it = p; + v_it++; + } + } + } + + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) + continue; + + int index = edge.second; + Vertex_handle source = edge.first->vertex( (index+1)%3 ); + Vertex_handle target = edge.first->vertex( (index+2)%3 ); + + typename Kernel::Segment_2 s(source->point(), target->point()); + *e_it = s; + e_it++; + } + - \param output An OutputModule in which the solid edges and vertics are - stored. - */ - template - void extract_solid_elements(OutputModule& output) { - output.store_solid_elements(m_dt); } + + /*! + + + Returns the solid edges and vertics present after the reconstruction + process finished. + + Writes the edges and vertices of the output simplex into an `std::ostream` + in an indexed format. + + \param os The `std::ostream` where the indexed data will be written to. + */ + void extract_index_output(std::ostream& os) { + + typedef typename Kernel::Segment_2 Segment; + typedef std::back_insert_iterator > Point_it; + typedef std::back_insert_iterator > Edge_it; + + std::vector isolated_points; + std::vector edges; + + extract_list_output(Point_it(isolated_points), Edge_it(edges)); + + //vertices_of_edges + std::set edge_vertices; + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + + Point a = (*it).source(); + Point b = (*it).target(); + + edge_vertices.insert(a); + edge_vertices.insert(b); + } + + os << "OFF " << isolated_points.size() + edge_vertices.size() << + " 0 " << edges.size() << std::endl; + + for (typename std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + os << *it << std::endl; + } + + for (typename std::set::iterator it = edge_vertices.begin(); + it != edge_vertices.end(); it++) { + + os << *it << std::endl; + } + + for (int i = 0; i < isolated_points.size(); i++) { + os << "1 " << i << std::endl; + } + + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + + //save_one_edge(os, *it,edge_vertices); + + Point a = (*it).source(); + Point b = (*it).target(); + + typename std::set::iterator it_a = edge_vertices.find(a); + typename std::set::iterator it_b = edge_vertices.find(b); + + int pos_a = std::distance(edge_vertices.begin(), it_a); + int pos_b = std::distance(edge_vertices.begin(), it_b); + + os << "2 " << pos_a + isolated_points.size() << " " + << pos_b + isolated_points.size() << std::endl; + + + + } + } + + /// \cond SKIP_IN_MANUAL + void extract_tds_output(Triangulation& rt2) { + rt2 = m_dt; + //mark vertices + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) + { + + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; + + do { + if (!rt2.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) + (*vi).set_relevance(1); + } + } + + + //mark edges + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) + { + Edge edge = *ei; + FT relevance = 0; + if (!rt2.is_ghost(edge)) { + relevance = rt2.get_edge_relevance(edge); // >= 0 + } + edge.first->relevance(edge.second) = relevance; + } + } + + + template Vector random_vec(const double scale) { diff --git a/Reconstruction_simplification_2/include/CGAL/Tds_output.h b/Reconstruction_simplification_2/include/CGAL/Tds_output.h deleted file mode 100644 index 6a2a2b65ab2..00000000000 --- a/Reconstruction_simplification_2/include/CGAL/Tds_output.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef TDS_OUTPUT_H_ -#define TDS_OUTPUT_H_ - -// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. -// All rights reserved. -// - -// This file is part of CGAL (www.cgal.org). -// You can redistribute it and/or modify it under the terms of the GNU -// General Public License as published by the Free Software Foundation, -// either version 3 of the License, or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Ivo Vigan - -//CGAL -#include - -//local -#include - - -namespace CGAL { - - -/*! -\ingroup PkgReconstructionSimplification2Models - - -\brief The class `Tds_output` is a model for the `ReconstructionSimplificationOutput_2` concept. - -\details It provides access to the `Tds_2` of the reconstruction simplex. - - -\tparam Kernel is the geometric kernel, used for the reconstruction and - simplification task. - */ -template -class Tds_output { - - /// \cond SKIP_IN_MANUAL - - -public: - typedef Reconstruction_triangulation_2 Rt_2; - typedef typename Kernel::FT FT; - - typedef typename Rt_2::Vertex Vertex; - typedef typename Rt_2::Edge Edge; - typedef typename Rt_2::Vertex_iterator Vertex_iterator; - typedef typename Rt_2::Finite_edges_iterator Finite_edges_iterator; - - -private: - Rt_2 m_rt2; - - void mark_vertices() { - for (Vertex_iterator vi = m_rt2.vertices_begin(); - vi != m_rt2.vertices_end(); ++vi) - { - - bool incident_edges_have_sample = false; - typename Rt_2::Edge_circulator start = m_rt2.incident_edges(vi); - typename Rt_2::Edge_circulator cur = start; - - do { - if (!m_rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) - (*vi).set_relevance(1); - } - } - } - - void mark_edges() { - - for (Finite_edges_iterator ei = m_rt2.finite_edges_begin(); ei != m_rt2.finite_edges_end(); ++ei) - { - Edge edge = *ei; - FT relevance = 0; - if (!m_rt2.is_ghost(edge)) { - relevance = m_rt2.get_edge_relevance(edge); // >= 0 - } - edge.first->relevance(edge.second) = relevance; - } - } - - /// \endcond -public: - - /*! - Extracts the solid edges and vertices from the `Reconstruction_simplification_2` module. - - \param rt2 The `Reconstruction_triangulation_2` from which the solid edges and vertices are extracted. - */ - void store_solid_elements(Rt_2& rt2) { - m_rt2 = rt2; - mark_vertices(); - mark_edges(); - } - - - /*! - Allows accessing the `Reconstruction_triangulation_2` of the `Reconstruction_simplification_2` module. - - \param rt2 The `Reconstruction_triangulation_2`. - */ - void extract_reconstruction_tds(Rt_2& rt2) { - rt2 = m_rt2; - } - - /*! - Returns the mass of a given edge. - This can be used to introduce a problem specific relevance function which - can determine a threshold for ignoring reconstructed edges. - - \param edge The `Edge` of which the mass is returned. - */ - FT get_mass(Edge& edge) { - return m_rt2.get_mass(edge); - } - - /*! - Returns the length of a given edge. - This can be used to introduce a problem specific relevance function which - can determine a threshold for ignoring reconstructed edges. - - \param edge The `Edge` of which the length is returned. - */ - FT get_length(Edge& edge) { - return m_rt2.get_length(edge); - } - - /*! - Returns the cost of a given edge. - This can be used to introduce a problem specific relevance function which - can determine a threshold for ignoring reconstructed edges. - - \param edge The `Edge` of which the cost is returned. - */ - FT get_cost(Edge& edge) { - return m_rt2.get_cost(edge).finalize(); - } - -}; -} - - -#endif /* TDS_OUTPUT_H_ */ diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index bc844073166..1af8348672b 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,7 +21,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "test_quality.cpp" ) + create_single_source_cgal_program( "test_vertex_edge.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index b668acee4cd..669418f8c03 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -6,9 +6,6 @@ #include #include -#include -#include -#include #include #include @@ -50,11 +47,13 @@ typedef Rt_2::Vertex_iterator Vertex_iterator; typedef Rt_2::Edge Edge; + void test_list_output(Rs_2& rs2); void test_index_output(Rs_2& rs2); void test_tds_output(Rs_2& rs2); + void print_edge(Edge edge) { int i = edge.second; Point a = edge.first->vertex((i+1)%3)->point(); @@ -77,8 +76,45 @@ int main () rs2.reconstruct(100); //100 steps test_list_output(rs2); - test_tds_output(rs2); test_index_output(rs2); + test_tds_output(rs2); + +} + + +void test_index_output(Rs_2& rs2) { + + std::cout <<"(-------------Off OUTPUT---------- )" << std::endl; + + rs2.extract_index_output(std::cout); + + //print + + //test cardinalities + std::ostringstream buffer; + rs2.extract_index_output(buffer); + + std::stringstream stream(buffer.str()); + std::vector res; + while (1){ + std::string line; + std::getline(stream,line); + if (!stream.good()) + break; + res.push_back(line); + } + + assert(res.size() == 110); + + assert(res.front() == "OFF 60 0 31"); + + for (int i = 61; i < 79; i++) { + assert(res[i].substr(0,2) == "1 "); + } + + for (int i = 79; i < 110; i++) { + assert(res[i].substr(0,2) == "2 "); + } } void test_list_output(Rs_2& rs2) { @@ -94,9 +130,7 @@ void test_list_output(Rs_2& rs2) { Point_it point_it(isolated_points); Edge_it edge_it(edges); - CGAL::List_output list_output(point_it, edge_it); - - rs2.extract_solid_elements(list_output); + rs2.extract_list_output(point_it, edge_it); int vertex_count = 0; for (std::vector::iterator it = isolated_points.begin(); @@ -121,10 +155,8 @@ void test_tds_output(Rs_2& rs2) { std::cout <<"(-------------Tds OUTPUT---------- )" << std::endl; - CGAL::Tds_output tds_output; - rs2.extract_solid_elements(tds_output); Rt_2 rt2; - tds_output.extract_reconstruction_tds(rt2); + rs2.extract_tds_output(rt2); int vertex_count = 0; for (Vertex_iterator vi = rt2.vertices_begin(); @@ -145,10 +177,6 @@ void test_tds_output(Rs_2& rs2) { if (relevance > 0) { print_edge(*ei); - std::cout << "mass " << tds_output.get_mass(*ei) << std::endl; - std::cout << "cost " << tds_output.get_cost(*ei) << std::endl; - std::cout << "length " << tds_output.get_length(*ei) << std::endl; - edge_count++; } } @@ -156,40 +184,3 @@ void test_tds_output(Rs_2& rs2) { assert(edge_count == 31); } -void test_index_output(Rs_2& rs2) { - - std::cout <<"(-------------Off OUTPUT---------- )" << std::endl; - - CGAL::Index_output index_output; - - rs2.extract_solid_elements(index_output); - - //print - index_output.get_os_output(std::cout); - - //test cardinalities - std::ostringstream buffer; - index_output.get_os_output(buffer); - - std::stringstream stream(buffer.str()); - std::vector res; - while (1){ - std::string line; - std::getline(stream,line); - if (!stream.good()) - break; - res.push_back(line); - } - - assert(res.size() == 110); - - assert(res.front() == "OFF 60 0 31"); - - for (int i = 61; i < 79; i++) { - assert(res[i].substr(0,2) == "1 "); - } - - for (int i = 79; i < 110; i++) { - assert(res[i].substr(0,2) == "2 "); - } -} diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index c235127230c..21d45f48831 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -6,7 +6,6 @@ #include #include -#include #include @@ -58,9 +57,7 @@ int main () Point_it point_it(isolated_points); Edge_it edge_it(edges); - CGAL::List_output list_output(point_it, edge_it); - rs2.extract_solid_elements(list_output); - + rs2.extract_list_output(point_it, edge_it); std::cout << "isolated_points " << isolated_points.size() << std::endl; std::cout << "edges " << edges.size() << std::endl; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index fb06a05b82d..f697750e243 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include "testing_tools.h" @@ -74,11 +73,8 @@ void test_edge_collapse() { rs2(points.begin(), points.end(), point_pmap, mass_pmap); - CGAL::Tds_output tds_output; - rs2.extract_solid_elements(tds_output); - Rt_2 rt2; - tds_output.extract_reconstruction_tds(rt2); + rs2.extract_tds_output(rt2); FT min_priority = 1000; R_edge_2 contract_edge; @@ -138,10 +134,8 @@ void test_num_of_vertices_in_triangulation() { rs2.insert_point(point, false, nb++); } - CGAL::Tds_output tds_output; - rs2.extract_solid_elements(tds_output); Rt_2 rt2; - tds_output.extract_reconstruction_tds(rt2); + rs2.extract_tds_output(rt2); //test if vertices are indeed added to the Reconstruction_triangulation_2 assert(points.size() == rt2.number_of_vertices()); From 2dbe25e09cad9f2dc05844354bf39209b292676f Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 2 Apr 2015 13:00:05 -0400 Subject: [PATCH 069/201] initial test commit --- .../Reconstruction_Simplification_2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index bea0f1564ae..b3aaaea6bee 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -7,7 +7,7 @@ namespace CGAL { \authors Fernando de Goes, Pierre Alliez, Ivo Vigan and Clément Jamin - +%test \section Reconstruction_simplification_2Introduction Introduction From 5772b84a57c12d92cf944218add26b39c2cb590b Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Tue, 7 Apr 2015 18:43:56 +0200 Subject: [PATCH 070/201] replaced back_insert_iterator with back_inserter --- .../demo/Reconstruction_simplification_2/scene.h | 6 +----- .../Reconstruction_simplification_2_output_example.cpp | 8 +------- .../reconstruction_simplification_2_example.cpp | 7 +------ .../include/CGAL/Reconstruction_simplification_2.h | 8 +++----- .../test_output_modules.cpp | 8 +------- .../test_reconstruction_until.cpp | 8 +------- 6 files changed, 8 insertions(+), 37 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 104a4cbd0a0..3872124aacd 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -408,13 +408,9 @@ public: std::vector isolated_points; std::vector edges; - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; + m_pwsrec->extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); - Point_it point_it(isolated_points); - Edge_it edge_it(edges); - m_pwsrec->extract_list_output(point_it, edge_it); int vertex_count = 0; for (std::vector::iterator it = isolated_points.begin(); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 2278c3cfb4e..45adbd13c35 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -95,13 +95,7 @@ void list_output(Rs_2& rs2) { std::vector isolated_points; std::vector edges; - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; - - Point_it point_it(isolated_points); - Edge_it edge_it(edges); - - rs2.extract_list_output(point_it, edge_it); + rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); for (std::vector::iterator it = isolated_points.begin(); it != isolated_points.end(); it++) { diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index d614849478c..7c4878631a7 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -77,13 +77,8 @@ int main () std::vector isolated_points; std::vector edges; - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; - Point_it point_it(isolated_points); - Edge_it edge_it(edges); - - rs2.extract_list_output(point_it, edge_it); + rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); std::cerr << "Isolated Vertices" << std::endl; for (std::vector::iterator it = isolated_points.begin(); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 43d659b21a2..7dc1f6fc9b2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -340,13 +340,11 @@ protected: void extract_index_output(std::ostream& os) { typedef typename Kernel::Segment_2 Segment; - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; - - std::vector isolated_points; + std::vector isolated_points; std::vector edges; - extract_list_output(Point_it(isolated_points), Edge_it(edges)); + extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + //vertices_of_edges std::set edge_vertices; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 669418f8c03..cfb63e5e97b 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -124,13 +124,7 @@ void test_list_output(Rs_2& rs2) { std::vector isolated_points; std::vector edges; - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; - - Point_it point_it(isolated_points); - Edge_it edge_it(edges); - - rs2.extract_list_output(point_it, edge_it); + rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); int vertex_count = 0; for (std::vector::iterator it = isolated_points.begin(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index 21d45f48831..a3b69ab6d4e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -51,13 +51,7 @@ int main () std::vector isolated_points; std::vector edges; - typedef std::back_insert_iterator > Point_it; - typedef std::back_insert_iterator > Edge_it; - - Point_it point_it(isolated_points); - Edge_it edge_it(edges); - - rs2.extract_list_output(point_it, edge_it); + rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); std::cout << "isolated_points " << isolated_points.size() << std::endl; std::cout << "edges " << edges.size() << std::endl; From 74c43a00d2d4859dba6309468d4f4688b5c65ec3 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 12:13:48 +0200 Subject: [PATCH 071/201] renamed template parameters --- .../Reconstruction_simplification_2/PackageDescription.txt | 2 +- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 268b562132f..9aba55a860f 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -34,7 +34,7 @@ ## Models ## -- `CGAL::List_output` +- `CGAL::List_output` - `CGAL::Index_output` - `CGAL::Tds_output` diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7dc1f6fc9b2..3acc9f05f16 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -279,8 +279,8 @@ protected: \tparam Output_Edge_Iterator The `Output-Iterator` type for storing the edges (as Segments). */ - template - void extract_list_output(Output_Vertex_Iterator v_it, Output_Edge_Iterator e_it) { + template + void extract_list_output(OutputVertexIterator v_it, OutputEdgeIterator e_it) { for (Vertex_iterator vi = m_dt.vertices_begin(); vi != m_dt.vertices_end(); ++vi) From 0a7031d0990e3afd394f676114011df16c4d6988 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 12:21:57 +0200 Subject: [PATCH 072/201] renamed template parameters --- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 3acc9f05f16..7977922cb84 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -274,9 +274,9 @@ protected: \tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. - \tparam Output_Vertex_Iterator The `Output-Iterator` type for storing the points + \tparam OutputVertexIterator The `Output-Iterator` type for storing the points - \tparam Output_Edge_Iterator The `Output-Iterator` type for storing the + \tparam OutputEdgeIterator The `Output-Iterator` type for storing the edges (as Segments). */ template From 346ff855cf0addeba328335cde41cde496388202 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 12:33:35 +0200 Subject: [PATCH 073/201] cmake files changed --- .../examples/Reconstruction_simplification_2/CMakeLists.txt | 1 + .../test/Reconstruction_simplification_2/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt index 49a8ad00477..a921005634d 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt @@ -22,6 +22,7 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") create_single_source_cgal_program( "reconstruction_simplification_2_output_example.cpp" ) + create_single_source_cgal_program( "reconstruction_simplification_2_example.cpp" ) else() diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt index 1af8348672b..26623036e79 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/CMakeLists.txt @@ -21,6 +21,11 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") + create_single_source_cgal_program( "test_basic.cpp" ) + create_single_source_cgal_program( "test_flip_procedure.cpp" ) + create_single_source_cgal_program( "test_output_modules.cpp" ) + create_single_source_cgal_program( "test_quality.cpp" ) + create_single_source_cgal_program( "test_reconstruction_until.cpp" ) create_single_source_cgal_program( "test_vertex_edge.cpp" ) else() From c35b73fd367278d6e8dfdec04841d5ca6b445c17 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 16:24:17 +0200 Subject: [PATCH 074/201] removed unused includes --- .../Reconstruction_Simplification_2.txt | 8 +------- .../Reconstruction_simplification_2_output_example.cpp | 1 - .../reconstruction_simplification_2_example.cpp | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b3aaaea6bee..aa755f96745 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -78,7 +78,6 @@ exposed to the user is the Reconstruction_simplification_2 class. \subsection Reconstruction_simplification_2Sample Sample Call \code{.cpp} - /* K : a geometric kernel, used for the reconstruction and simplification task. @@ -92,9 +91,6 @@ Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); rs2.reconstruct(100); // perform 100 contraction steps - - - \endcode Alternatively to calling the reconstruction module using @@ -103,12 +99,10 @@ Alternatively to calling the reconstruction module using \endcode one can use the reconstruct_until function - \code{.cpp} rs2.reconstruct_until(20); // perform edge contractions until only 20 vertices are left. \endcode - - and specify the number of output vertices one wants to keep as illustrated in the following picture. +and specify the number of output vertices one wants to keep as illustrated in the following picture. \cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} Examples of \f$20 \f$ vertex reconstructions from images consisting of \f$2000, 400 \f$ and \f$200 \f$ input points respectively. The example shows nicely diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 45adbd13c35..c464c0e5c78 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -17,7 +17,6 @@ #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 7c4878631a7..b43f574a39b 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -16,7 +16,6 @@ #include // std::pair #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; From 37443dcb4666425a6d3b876347d178b3b2c1b69b Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 16:45:35 +0200 Subject: [PATCH 075/201] removed unused includes --- .../test/Reconstruction_simplification_2/test_basic.cpp | 1 - .../Reconstruction_simplification_2/test_flip_procedure.cpp | 1 - .../Reconstruction_simplification_2/test_output_modules.cpp | 2 -- .../test/Reconstruction_simplification_2/test_quality.cpp | 1 - .../test_reconstruction_until.cpp | 1 - .../test/Reconstruction_simplification_2/test_vertex_edge.cpp | 1 - 6 files changed, 7 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 1e2d1444349..eb3027a18f6 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -14,7 +14,6 @@ #include // std::pair #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index 45e6177b896..28979547dee 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -16,7 +16,6 @@ #include #include -#include diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index cfb63e5e97b..b1d75170c6c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -16,8 +16,6 @@ #include -#include - #include "testing_tools.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index eb163d2643c..e810c008de0 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -15,7 +15,6 @@ #include #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index a3b69ab6d4e..0ed8dcfcef5 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -16,7 +16,6 @@ #include #include -#include #include "testing_tools.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index f697750e243..8d4aef95e2c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -19,7 +19,6 @@ #include // std::pair #include -#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; From 792b1d8a24b6d1398216a875218634d55899b0e2 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 17:18:08 +0200 Subject: [PATCH 076/201] removed Triangle output example --- .../Reconstruction_Simplification_2.txt | 8 ++--- ...uction_simplification_2_output_example.cpp | 25 -------------- .../include/CGAL/Reconstruction_face_base_2.h | 3 +- .../test_output_modules.cpp | 34 ------------------- 4 files changed, 5 insertions(+), 65 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index aa755f96745..fc1832fc0a4 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -18,7 +18,7 @@ From left to right: input point set; Delaunay triangulation of input; after simp The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplex . -The algorithm of \cgalCite{degoes:hal-00758019} presented here performs the reconstruction and simplification task jointly, using a unified framework based on optimal transportations of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a unified framework based on optimal transportations of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. @@ -38,8 +38,8 @@ Illustration of an edge contraction, indicated by the blue arrow. The resulting \cgalFigureEnd -\section Reconstruction_simplification_2Overview Overview of the Reconstruction Process -While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This new method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. +\section Reconstruction_simplification_2Overview Theory of the Reconstruction Process +While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. \section Reconstruction_simplification_2Trans Optimal Transport Formulation @@ -53,7 +53,7 @@ corresponds to the minimum cost of turning a (unit) pile of sand into a given sh Assuming that the algorithm is given an output simplex \f$T \f$ and a point-to-simplex assignment which maps every input point to either an edge or a vertex of \f$T \f$, the total transportation cost is computed using the following assignment rules: For a point to vertex assignment, the transportation cost is simply the sum of the weighted \f$L_2 \f$-distance of all the points assigned to the given vertex. -For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, we decompose \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. +For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, the algorithm decomposes \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. \cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. \cgalFigureEnd diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index c464c0e5c78..94194c39059 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -47,7 +47,6 @@ typedef Rt_2::Edge Edge; void list_output(Rs_2& rs2); -void tds_output(Rs_2& rs2); void index_output(Rs_2& rs2); @@ -83,7 +82,6 @@ int main () rs2.reconstruct(100); //100 steps list_output(rs2); - tds_output(rs2); index_output(rs2); } @@ -107,29 +105,6 @@ void list_output(Rs_2& rs2) { } } -void tds_output(Rs_2& rs2) { - - std::cout << "(-------------Tds output---------- )" << std::endl; - - Rt_2 rt2; - rs2.extract_tds_output(rt2); - - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) { - - FT relevance = (*vi).get_relevance(); - if (relevance > 0) { - std::cout << *vi << std::endl; - } - } - - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { - FT relevance = (*ei).first->relevance((*ei).second); - if (relevance > 0) { - print_edge(*ei); - } - } -} void index_output(Rs_2& rs2) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 22a4d5f7515..f04c9622710 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -28,8 +28,7 @@ #include -/// The Reconstruction_face_base_2 class (corresponding to -//Reconstruction_face_base_2 in prototype) is the default +/// The Reconstruction_face_base_2 class is the default /// vertex class of the Reconstruction_face_base_2 class. /// /// - Each vertex stores a CSample as well as the corresponding relocated point diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index b1d75170c6c..96492a00086 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -142,37 +142,3 @@ void test_list_output(Rs_2& rs2) { } - -void test_tds_output(Rs_2& rs2) { - - std::cout <<"(-------------Tds OUTPUT---------- )" << std::endl; - - Rt_2 rt2; - rs2.extract_tds_output(rt2); - - int vertex_count = 0; - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) { - - FT relevance = (*vi).get_relevance(); - if (relevance > 0) { - std::cout << *vi << std::endl; - vertex_count++; - } - } - std::cout <<"vertex_count " << vertex_count << std::endl; - assert(vertex_count == 18); - - int edge_count = 0; - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { - FT relevance = (*ei).first->relevance((*ei).second); - if (relevance > 0) { - print_edge(*ei); - - edge_count++; - } - } - std::cout <<"edge_count " << edge_count << std::endl; - assert(edge_count == 31); - -} From ec326f4d5525401fc05bcd2fdefec9adce65bc37 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 17:46:04 +0200 Subject: [PATCH 077/201] renamed property maps --- ...Reconstruction_simplification_kerneled_2.h | 10 +++++----- .../Reconstruction_simplification_2/scene.h | 12 +++++------ .../PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt | 6 +++--- ...uction_simplification_2_output_example.cpp | 10 +++++----- ...econstruction_simplification_2_example.cpp | 10 +++++----- .../CGAL/Reconstruction_simplification_2.h | 20 +++++++++---------- .../test_basic.cpp | 10 +++++----- .../test_flip_procedure.cpp | 10 +++++----- .../test_output_modules.cpp | 10 +++++----- .../test_quality.cpp | 10 +++++----- .../test_reconstruction_until.cpp | 10 +++++----- .../test_vertex_edge.cpp | 12 +++++------ 13 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h index 31156462372..294933bfa81 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -24,11 +24,11 @@ typedef PointMassList::const_iterator InputIterator; typedef CGAL::value_type_traits::type MassPoint; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; -typedef CGAL::Reconstruction_simplification_2 Reconstruction_simplification_2; +typedef CGAL::Reconstruction_simplification_2 Reconstruction_simplification_2; class Reconstruction_simplification_kerneled_2: public Reconstruction_simplification_2 { @@ -36,7 +36,7 @@ class Reconstruction_simplification_kerneled_2: public: Reconstruction_simplification_kerneled_2(InputIterator start, - InputIterator beyond, PointPMap point_pmap, MassPMap mass_pmap) : + InputIterator beyond, Point_property_map point_pmap, Mass_property_map mass_pmap) : Reconstruction_simplification_2(start, beyond, point_pmap, mass_pmap) { } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 3872124aacd..ca0af15fb1b 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -30,11 +30,11 @@ public: typedef CGAL::value_type_traits::type MassPoint; - typedef CGAL::First_of_pair_property_map PointPMap; - typedef CGAL::Second_of_pair_property_map MassPMap; + typedef CGAL::First_of_pair_property_map Point_property_map; + typedef CGAL::Second_of_pair_property_map Mass_property_map; - typedef CGAL::Reconstruction_simplification_2 R_s_2; + typedef CGAL::Reconstruction_simplification_2 R_s_2; typedef K::Segment_2 Segment; @@ -580,8 +580,8 @@ public: std::make_pair((*it)->point(), (*it)->mass())); } - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; MassPoint mp; m_pwsrec->initialize(point_mass_list.begin(), point_mass_list.end(), diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 9aba55a860f..a8121cf35ae 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -40,7 +40,7 @@ ## Classes ## -- `CGAL::Reconstruction_simplification_2` +- `CGAL::Reconstruction_simplification_2` */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index fc1832fc0a4..b4d62b77970 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -82,12 +82,12 @@ exposed to the user is the Reconstruction_simplification_2 class. K : a geometric kernel, used for the reconstruction and simplification task. input. -PointPMap : a PropertyMap for accessing the input points. -MassPMap : a PropertyMap for accessing the input points' measures. +Point_property_map : a PropertyMap for accessing the input points. +Mass_property_map : a PropertyMap for accessing the input points' measures. */ -Reconstruction_simplification_2 +Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); rs2.reconstruct(100); // perform 100 contraction steps diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 94194c39059..43b37b29ec1 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -28,11 +28,11 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; typedef Rs_2::Vertex Vertex; @@ -74,8 +74,8 @@ int main () PointMassList points; load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index b43f574a39b..b6ba89dd9c1 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -26,11 +26,11 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; typedef Rs_2::Reconstruction_edge_2 R_edge_2; @@ -66,8 +66,8 @@ int main () load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7977922cb84..9f5f02a2799 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -49,18 +49,18 @@ namespace CGAL { for executing the reconstruction and simplification tasks. Its constructor takes an InputIterator, used to traverse a collection of point-mass pairs, where the points and their masses are accessed -via the PointPMap and MassPMap `PropertyMaps` respectively. +via the Point_property_map and Mass_property_map `PropertyMaps` respectively. \tparam Kernel a geometric kernel, used throughout the reconstruction and simplification task. -\tparam PointPMap a model of `ReadablePropertyMap` with a value_type = `Point_2` +\tparam Point_property_map a model of `ReadablePropertyMap` with a value_type = `Point_2` -\tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` +\tparam Mass_property_map a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` */ -template +template class Reconstruction_simplification_2 { public: @@ -146,8 +146,8 @@ protected: double m_bbox_y; double m_bbox_size; - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; /// \endcond @@ -179,8 +179,8 @@ protected: template Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, - PointPMap in_point_pmap, - MassPMap in_mass_pmap) { + Point_property_map in_point_pmap, + Mass_property_map in_mass_pmap) { point_pmap = in_point_pmap; @@ -229,8 +229,8 @@ protected: template void initialize(InputIterator start_itr, InputIterator beyond_itr, - PointPMap in_point_pmap, - MassPMap in_mass_pmap) { + Point_property_map in_point_pmap, + Mass_property_map in_mass_pmap) { point_pmap = in_point_pmap; mass_pmap = in_mass_pmap; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index eb3027a18f6..cf37357f3fa 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -22,8 +22,8 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; int main () @@ -32,10 +32,10 @@ int main () //use the stair example for testing load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); rs2.reconstruct(100); //100 steps diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index 28979547dee..173376377a5 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -26,8 +26,8 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; int main () @@ -36,13 +36,13 @@ int main () //use the stair example for testing load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; for (int i = 1; i <= points.size();) { - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); rs2.reconstruct_until(i); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 96492a00086..0abbe323cd4 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -27,11 +27,11 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; typedef Rs_2::Vertex Vertex; @@ -66,8 +66,8 @@ int main () //use the stair example for testing load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index e810c008de0..504371826c1 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -23,8 +23,8 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; int main () @@ -33,10 +33,10 @@ int main () //use the stair example for testing load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); rs2.reconstruct_until(9); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index 0ed8dcfcef5..0ff6b2b1972 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -27,8 +27,8 @@ typedef K::Segment_2 Segment; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; int main () { @@ -37,10 +37,10 @@ int main () //use the stair example for testing load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); rs2.reconstruct_until(9); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index 8d4aef95e2c..f11f6a6ca85 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -27,8 +27,8 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map PointPMap; -typedef CGAL::Second_of_pair_property_map MassPMap; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; typedef CGAL::Reconstruction_triangulation_2 Rt_2; typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; @@ -65,10 +65,10 @@ void test_edge_collapse() { //use the stair example for testing load_xy_file("data/stair-noise00.xy", points); - PointPMap point_pmap; - MassPMap mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; - CGAL::Reconstruction_simplification_2 + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); @@ -125,7 +125,7 @@ void test_num_of_vertices_in_triangulation() { PointMassList points = *(simple_point_set()); - CGAL::Reconstruction_simplification_2 rs2; + CGAL::Reconstruction_simplification_2 rs2; int nb = 0; for (PointMassList::iterator it = points.begin(); it != points.end(); it++) { PointMassPair pmp = *it; From e074c91a3ad86a94cf7250acc9fdb47571210e10 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 18:08:56 +0200 Subject: [PATCH 078/201] typedefs removed --- ...ruction_simplification_2_output_example.cpp | 18 ------------------ ...reconstruction_simplification_2_example.cpp | 11 ----------- .../test_output_modules.cpp | 2 -- 3 files changed, 31 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 43b37b29ec1..44f8bdd0449 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -34,29 +34,11 @@ typedef CGAL::Second_of_pair_property_map Mass_property_map; typedef CGAL::Reconstruction_simplification_2 Rs_2; -typedef Rs_2::Vertex Vertex; - -typedef Rs_2::Reconstruction_edge_2 R_edge_2; - -typedef CGAL::Reconstruction_triangulation_2 Rt_2; - -typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; -typedef Rt_2::Vertex_iterator Vertex_iterator; - -typedef Rt_2::Edge Edge; - void list_output(Rs_2& rs2); void index_output(Rs_2& rs2); -void print_edge(Edge edge) { - int i = edge.second; - const Point& a = edge.first->vertex((i+1)%3)->point(); - const Point& b = edge.first->vertex((i+2)%3)->point(); - std::cout << a << " , " << b << std::endl; - -} void load_xy_file(const std::string& filename, PointMassList& points) { diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index b6ba89dd9c1..c4d9977b2a2 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -29,19 +29,8 @@ typedef std::list PointMassList; typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; - typedef CGAL::Reconstruction_simplification_2 Rs_2; -typedef Rs_2::Reconstruction_edge_2 R_edge_2; - -typedef Rs_2::Vertex Vertex; - -typedef CGAL::Reconstruction_triangulation_2 Rt_2; - -typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; -typedef Rt_2::Vertex_iterator Vertex_iterator; - -typedef Rt_2::Edge Edge; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 0abbe323cd4..9a4b5955e33 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -48,7 +48,6 @@ typedef Rt_2::Edge Edge; void test_list_output(Rs_2& rs2); void test_index_output(Rs_2& rs2); -void test_tds_output(Rs_2& rs2); @@ -75,7 +74,6 @@ int main () test_list_output(rs2); test_index_output(rs2); - test_tds_output(rs2); } From 70f6285d44e0319d62078f2fac526e04a30bf2aa Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 18:14:00 +0200 Subject: [PATCH 079/201] typedefs removed --- .../test_output_modules.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 9a4b5955e33..d6bbe6c7b1c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -37,27 +37,10 @@ typedef Rs_2::Vertex Vertex; typedef Rs_2::Reconstruction_edge_2 R_edge_2; -typedef CGAL::Reconstruction_triangulation_2 Rt_2; - -typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; -typedef Rt_2::Vertex_iterator Vertex_iterator; - -typedef Rt_2::Edge Edge; - - - void test_list_output(Rs_2& rs2); void test_index_output(Rs_2& rs2); - -void print_edge(Edge edge) { - int i = edge.second; - Point a = edge.first->vertex((i+1)%3)->point(); - Point b = edge.first->vertex((i+2)%3)->point(); - std::cout << a << " , " << b << std::endl; -} - int main () { From 70d40fcc952482e7018cd057d98567581e9e49d3 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 8 Apr 2015 18:31:28 +0200 Subject: [PATCH 080/201] docu changed --- .../Reconstruction_Simplification_2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b4d62b77970..65c39443392 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -55,7 +55,7 @@ the total transportation cost is computed using the following assignment rules: For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, the algorithm decomposes \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. \cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} -Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. +Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. Note that since the points are all assumed to be of equal weight, all the bins have the same width. \cgalFigureEnd From a0136d53b5ed982da78932a027bd7f70add1c613 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 13 Apr 2015 13:09:07 +0200 Subject: [PATCH 081/201] removed Reconstruction_face_base from doc --- .../PackageDescription.txt | 16 +--------------- .../include/CGAL/Reconstruction_face_base_2.h | 6 ++++-- .../CGAL/Reconstruction_simplification_2.h | 4 ++-- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index a8121cf35ae..3e77885a667 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -3,11 +3,6 @@ /// \defgroup PkgReconstructionSimplification2Classes Classes /// \ingroup PkgReconstructionSimplification2 -/// \defgroup PkgReconstructionSimplification2Concepts Concepts -/// \ingroup PkgReconstructionSimplification2 - -/// \defgroup PkgReconstructionSimplification2Models Models -/// \ingroup PkgReconstructionSimplification2 /*! \addtogroup PkgReconstructionSimplification2 @@ -29,18 +24,9 @@ \cgalClassifedRefPages -## Concepts ## -- `ReconstructionSimplificationOutput_2` - - -## Models ## -- `CGAL::List_output` -- `CGAL::Index_output` -- `CGAL::Tds_output` - ## Classes ## -- `CGAL::Reconstruction_simplification_2` +- `CGAL::Reconstruction_simplification_2` */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index f04c9622710..34f4a1f9cf6 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -1,4 +1,4 @@ -// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. + // Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. // All rights reserved. // @@ -27,6 +27,9 @@ #include +/// \cond SKIP_IN_MANUAL + + /// The Reconstruction_face_base_2 class is the default /// vertex class of the Reconstruction_face_base_2 class. @@ -41,7 +44,6 @@ class Reconstruction_face_base_2 : public Fb { public: - /// \cond SKIP_IN_MANUAL typedef Fb Base; typedef typename Base::Vertex_handle Vertex_handle; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 9f5f02a2799..d6bb919c413 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -55,9 +55,9 @@ via the Point_property_map and Mass_property_map `PropertyMaps` respectively. \tparam Kernel a geometric kernel, used throughout the reconstruction and simplification task. -\tparam Point_property_map a model of `ReadablePropertyMap` with a value_type = `Point_2` +\tparam PointPMap a model of `ReadablePropertyMap` with a value_type = `Point_2` -\tparam Mass_property_map a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` +\tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` */ template From 082aa59c6c4bb0898d3eaa8e7a3902bb4bf400db Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 13 Apr 2015 14:23:43 +0200 Subject: [PATCH 082/201] changed documentation --- .../Reconstruction_Simplification_2.txt | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 65c39443392..d681f23096c 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -7,18 +7,29 @@ namespace CGAL { \authors Fernando de Goes, Pierre Alliez, Ivo Vigan and Clément Jamin -%test - \section Reconstruction_simplification_2Introduction Introduction +This package implements methods to reconstruct and simplify 2D point sets. The input is a noisy 2D point set and the output is an arrangement of line segments and points which approximate the original shape, where the input points were sampled from as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. + + +\cgalFigureBegin{2D_Reconstruction_Simplification_overview,summary.png} +Left: A noisy set of input points. Right: The corresponding reconstructed shape consisting of line segments. +\cgalFigureEnd + + + + +\section Reconstruction_simplification_2Overview Theory of the Reconstruction Process + + +More formally, the task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplex . + \cgalFigureBegin{2D_Reconstruction_Simplification_process,process.png} From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. \cgalFigureEnd -The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplex . - -The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a unified framework based on optimal transportations of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a framework based on optimal transportations of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. @@ -33,13 +44,9 @@ Illustration of an edge flip. In the left image, the blue edge creates fold-over The transportation plan is approximated by assigning each input point temporarily to the closest simplex edge. After this partitioning of the input points w.r.t. the edges, all the points temporarily assigned to a given edge are being assigned to it permanently if and only if the corresponding transportation costs are less than the transportation cost for each of the two vertices of the edge. Otherwise each of the points is assigned to the cheaper of the two vertices. This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. -\cgalFigureBegin{2D_Reconstruction_Simplification_edgecontraction,edgecontraction.png} -Illustration of an edge contraction, indicated by the blue arrow. The resulting reassignment of the input points to vertices and edges is depicted in green and red respectively. -\cgalFigureEnd -\section Reconstruction_simplification_2Overview Theory of the Reconstruction Process -While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a unified framework based on optimal transport of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. +While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a framework based on optimal transport of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. \section Reconstruction_simplification_2Trans Optimal Transport Formulation From 47f76c1301843df270ad962ddb8332fb6cdd06fe Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Wed, 15 Apr 2015 11:42:40 +0200 Subject: [PATCH 083/201] reconstruct renamed to run --- .../demo/Reconstruction_simplification_2/scene.h | 4 ++-- .../Reconstruction_Simplification_2.txt | 8 ++++---- .../Reconstruction_simplification_2_output_example.cpp | 2 +- .../reconstruction_simplification_2_example.cpp | 2 +- .../include/CGAL/Reconstruction_simplification_2.h | 5 ++--- .../test/Reconstruction_simplification_2/test_basic.cpp | 2 +- .../test_flip_procedure.cpp | 2 +- .../test_output_modules.cpp | 2 +- .../test/Reconstruction_simplification_2/test_quality.cpp | 2 +- .../test_reconstruction_until.cpp | 2 +- 10 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index ca0af15fb1b..894f0a014a7 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -641,12 +641,12 @@ public: void reconstruct_until(const unsigned nv) { std::cout << "reconstruct_until" << std::endl; - m_pwsrec->reconstruct_until(nv); + m_pwsrec->run_until(nv); } void reconstruct(const unsigned steps) { std::cout << "reconstruct" << std::endl; - m_pwsrec->reconstruct(steps); + m_pwsrec->run(steps); } void relocate_all_vertices() { diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index d681f23096c..ddc55070916 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -97,17 +97,17 @@ Mass_property_map : a PropertyMap for accessing the input points' measures. Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct(100); // perform 100 contraction steps + rs2.run(100); // perform 100 contraction steps \endcode Alternatively to calling the reconstruction module using \code{.cpp} - rs2.reconstruct(100); // perform 100 contraction steps + rs2.run(100); // perform 100 contraction steps \endcode -one can use the reconstruct_until function +one can use the run_until function \code{.cpp} - rs2.reconstruct_until(20); // perform edge contractions until only 20 vertices are left. + rs2.run_until(20); // perform edge contractions until only 20 vertices are left. \endcode and specify the number of output vertices one wants to keep as illustrated in the following picture. diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 44f8bdd0449..bd81cffc53d 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -61,7 +61,7 @@ int main () Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct(100); //100 steps + rs2.run(100); //100 steps list_output(rs2); index_output(rs2); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index c4d9977b2a2..2dd9a05abf2 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -60,7 +60,7 @@ int main () Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct(100); //100 steps + rs2.run(100); //100 steps std::vector isolated_points; std::vector edges; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index d6bb919c413..14c6c05625e 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1540,7 +1540,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { \param nv The number of vertices which will be present in the output. */ - void reconstruct_until(const unsigned nv) { + void run_until(const unsigned nv) { double timer = clock(); std::cerr << yellow << "reconstruct until " << white << nv << " V"; @@ -1565,7 +1565,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { \param steps The number of edge contractions performed by the algorithm. */ - void reconstruct(const unsigned steps) { + void run(const unsigned steps) { double timer = clock(); std::cerr << yellow << "reconstruct " << steps << white; @@ -1583,7 +1583,6 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { << std::endl; } - }; } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index cf37357f3fa..ada1bcc1578 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -38,7 +38,7 @@ int main () CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct(100); //100 steps + rs2.run(100); //100 steps rs2.print_stats_debug(); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index 173376377a5..b4fc51b5bf0 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -45,7 +45,7 @@ int main () CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct_until(i); + rs2.run_until(i); rs2.print_stats_debug(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index d6bbe6c7b1c..d106adcf7f7 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -53,7 +53,7 @@ int main () Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct(100); //100 steps + rs2.run(100); //100 steps test_list_output(rs2); test_index_output(rs2); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index 504371826c1..f267d06f27f 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -39,7 +39,7 @@ int main () CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct_until(9); + rs2.run_until(9); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index 0ff6b2b1972..b0b00ff883d 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -43,7 +43,7 @@ int main () CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.reconstruct_until(9); + rs2.run_until(9); rs2.print_stats_debug(); From 26dd1e4e55d03a600da03ec0fb16d722fafa61b9 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 16 Apr 2015 20:04:03 +0200 Subject: [PATCH 084/201] Added new Constructor --- .../CMakeLists.txt | 1 + ...econstruction_simplification_2_example.cpp | 1 + .../CGAL/Reconstruction_simplification_2.h | 68 ++++++++++++++++--- 3 files changed, 60 insertions(+), 10 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt index a921005634d..7307d6f192a 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt @@ -23,6 +23,7 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "reconstruction_simplification_2_output_example.cpp" ) create_single_source_cgal_program( "reconstruction_simplification_2_example.cpp" ) + create_single_source_cgal_program( "reconstruction_simplification_2_no_mass_example.cpp" ) else() diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 2dd9a05abf2..89d52450656 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -26,6 +26,7 @@ typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; + typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 14c6c05625e..1d02c3be90e 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -32,6 +32,7 @@ #include #include #include +#include // std::pair #include #include @@ -40,6 +41,7 @@ namespace CGAL { + /*! \ingroup PkgReconstructionSimplification2Classes @@ -60,25 +62,30 @@ via the Point_property_map and Mass_property_map `PropertyMaps` respectively. \tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` */ -template +template >, + class Mass_property_map = Second_of_pair_property_map > > class Reconstruction_simplification_2 { public: + /*! + Number type. + */ + typedef typename Kernel::FT FT; - /*! - Number type. - */ - typedef typename Kernel::FT FT; + /*! + Point type. + */ + typedef typename Kernel::Point_2 Point; - /*! - Point type. - */ - typedef typename Kernel::Point_2 Point; /*! Vector type. */ typedef typename Kernel::Vector_2 Vector; + typedef typename std::pair PointMassPair; + typedef typename std::list PointMassList; + /*! The Output simplex. */ @@ -128,6 +135,7 @@ public: typedef typename Triangulation::MultiIndex MultiIndex; + protected: Triangulation m_dt; MultiIndex m_mindex; @@ -191,6 +199,46 @@ protected: initialize(start_itr, beyond_itr); } + + /*! + Instantiates a new Reconstruction_simplification_2. + Computes a bounding box around the input points and creates a first + (dense) output simplex as well as an initial transportation plan. This + first output simplex is then made coarser during subsequent iterations. + + \details Instantiates a new Reconstruction_simplification_2 object + for a given collection of points. + + \tparam InputIterator is the iterator type of the algorithm input. + + \param start_itr An InputIterator pointing the the first point + in a collection. + \param beyond_itr An InputIterator pointing beyond the last point + in a collection. + */ + template + Reconstruction_simplification_2(InputIterator start_point_itr, + InputIterator beyond_point_itr) { + + + PointMassList point_mass_list; + for (InputIterator it = start_point_itr; it != beyond_point_itr; it++) { + point_mass_list.push_back(std::make_pair(*it, 1)); + } + + Point_property_map in_point_pmap; + Mass_property_map in_mass_pmap; + + point_pmap = in_point_pmap; + mass_pmap = in_mass_pmap; + + initialize_parameters(); + + initialize(point_mass_list.begin(), point_mass_list.end()); + } + + + /// @} @@ -225,7 +273,7 @@ protected: } //Function if one wants to create a Reconstruction_simplification_2 - //without specifying the input yet in the constructor. + //without yet specifying the input in the constructor. template void initialize(InputIterator start_itr, InputIterator beyond_itr, From a7a9528a6fd05334edc782fa27c2817e93f4b573 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Thu, 16 Apr 2015 20:04:51 +0200 Subject: [PATCH 085/201] Added new Constructor and example --- ...ction_simplification_2_no_mass_example.cpp | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp new file mode 100644 index 00000000000..f6aa61948e6 --- /dev/null +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -0,0 +1,74 @@ +// reconstruction_simplification_2_example.cpp + + +//---------------------------------------------------------- +// Simple example for Reconstruction_simplification_2 +//---------------------------------------------------------- + +#include +#include + + +#include +#include +#include +#include +#include // std::pair + +#include + +typedef CGAL::Exact_predicates_inexact_constructions_kernel K; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; + +typedef K::FT FT; + +typedef CGAL::Reconstruction_simplification_2 Rs_2; + + + + +void load_xy_file(const std::string& fileName, std::list& points) +{ + std::ifstream ifs(fileName); + Point point; + unsigned int nb = 0; + while (ifs >> point) + { + points.push_back(point); + } + ifs.close(); +} + + + +int main () +{ + + std::list points; + + load_xy_file("data/stair-noise00.xy", points); + + Rs_2 rs2(points.begin(), points.end()); + + rs2.run(100); //100 steps + + std::vector isolated_points; + std::vector edges; + + + rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + + std::cerr << "Isolated Vertices" << std::endl; + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + std::cout << *it << std::endl; + } + + std::cerr << "Edges" << std::endl; + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + } + +} From e0e33774656720fcee804b10916a2a536401d9fb Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 20 Apr 2015 11:53:11 +0200 Subject: [PATCH 086/201] Updated tests and examples for default mass --- ...uction_simplification_2_output_example.cpp | 31 ++++++------------- ...econstruction_simplification_2_example.cpp | 1 + ...ction_simplification_2_no_mass_example.cpp | 5 +-- .../test_basic.cpp | 22 +++---------- .../test_flip_procedure.cpp | 21 +++---------- .../test_output_modules.cpp | 25 ++++----------- .../test_reconstruction_until.cpp | 23 ++++---------- .../testing_tools.h | 12 +++++++ 8 files changed, 44 insertions(+), 96 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index bd81cffc53d..550cf0982cf 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -13,10 +13,7 @@ #include #include #include -#include // std::pair - - -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -25,14 +22,7 @@ typedef K::Segment_2 Segment; typedef K::FT FT; -typedef std::pair PointMassPair; -typedef std::list PointMassList; - -typedef CGAL::First_of_pair_property_map Point_property_map; -typedef CGAL::Second_of_pair_property_map Mass_property_map; - - -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; void list_output(Rs_2& rs2); @@ -40,28 +30,27 @@ void index_output(Rs_2& rs2); -void load_xy_file(const std::string& filename, PointMassList& points) +void load_xy_file(const std::string& filename, std::list& points) { std::ifstream ifs(filename); Point point; while (ifs >> point) - points.push_back(std::make_pair(point, 1)); - + { + points.push_back(point); + } ifs.close(); } int main () { - PointMassList points; - load_xy_file("data/stair-noise00.xy", points); + std::list points; - Point_property_map point_pmap; - Mass_property_map mass_pmap; + load_xy_file("data/stair-noise00.xy", points); - Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); + Rs_2 rs2(points.begin(), points.end()); - rs2.run(100); //100 steps + rs2.run(100); //100 steps list_output(rs2); index_output(rs2); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 89d52450656..158d2f07c0b 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -14,6 +14,7 @@ #include #include #include // std::pair +#include #include diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp index f6aa61948e6..b91c585cfe5 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -13,9 +13,7 @@ #include #include #include -#include // std::pair - -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; @@ -32,7 +30,6 @@ void load_xy_file(const std::string& fileName, std::list& points) { std::ifstream ifs(fileName); Point point; - unsigned int nb = 0; while (ifs >> point) { points.push_back(point); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index ada1bcc1578..615271601b8 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -8,35 +8,21 @@ #include #include "testing_tools.h" -#include -#include -#include -#include // std::pair - -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef K::FT FT; -typedef std::pair PointMassPair; -typedef std::list PointMassList; - -typedef CGAL::First_of_pair_property_map Point_property_map; -typedef CGAL::Second_of_pair_property_map Mass_property_map; int main () { - PointMassList points; + std::list points; //use the stair example for testing - load_xy_file("data/stair-noise00.xy", points); + load_xy_file_points("data/stair-noise00.xy", points); - Point_property_map point_pmap; - Mass_property_map mass_pmap; - - CGAL::Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end()); rs2.run(100); //100 steps diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index b4fc51b5bf0..c277570034e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -9,41 +9,28 @@ #include #include "testing_tools.h" -#include +#include #include #include #include // std::pair #include -#include - - typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef K::FT FT; -typedef std::pair PointMassPair; -typedef std::list PointMassList; - -typedef CGAL::First_of_pair_property_map Point_property_map; -typedef CGAL::Second_of_pair_property_map Mass_property_map; - int main () { - PointMassList points; + std::list points; //use the stair example for testing - load_xy_file("data/stair-noise00.xy", points); - - Point_property_map point_pmap; - Mass_property_map mass_pmap; + load_xy_file_points("data/stair-noise00.xy", points); for (int i = 1; i <= points.size();) { - CGAL::Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end()); rs2.run_until(i); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index d106adcf7f7..ce4be7fdcfb 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -7,15 +7,12 @@ #include #include -#include + #include -#include #include #include -#include // std::pair +#include - -#include #include "testing_tools.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -24,14 +21,7 @@ typedef K::Segment_2 Segment; typedef K::FT FT; -typedef std::pair PointMassPair; -typedef std::list PointMassList; - -typedef CGAL::First_of_pair_property_map Point_property_map; -typedef CGAL::Second_of_pair_property_map Mass_property_map; - - -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; typedef Rs_2::Vertex Vertex; @@ -44,14 +34,11 @@ void test_index_output(Rs_2& rs2); int main () { - PointMassList points; + std::list points; //use the stair example for testing - load_xy_file("data/stair-noise00.xy", points); + load_xy_file_points("data/stair-noise00.xy", points); - Point_property_map point_pmap; - Mass_property_map mass_pmap; - - Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); + Rs_2 rs2(points.begin(), points.end()); rs2.run(100); //100 steps diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index b0b00ff883d..311eacc3207 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -9,13 +9,11 @@ #include -#include -#include +#include #include -#include // std::pair +#include #include -#include #include "testing_tools.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; @@ -24,24 +22,15 @@ typedef K::FT FT; typedef K::Segment_2 Segment; -typedef std::pair PointMassPair; -typedef std::list PointMassList; - -typedef CGAL::First_of_pair_property_map Point_property_map; -typedef CGAL::Second_of_pair_property_map Mass_property_map; - int main () { - PointMassList points; - //use the stair example for testing - load_xy_file("data/stair-noise00.xy", points); + std::list points; - Point_property_map point_pmap; - Mass_property_map mass_pmap; + //use the stair example for testing + load_xy_file_points("data/stair-noise00.xy", points); - CGAL::Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end()); rs2.run_until(9); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h index f8f41ecf899..3d0ee4b8af7 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h @@ -11,3 +11,15 @@ void load_xy_file(const std::string& filename, PointMassList& points) ifs.close(); } + +template +void load_xy_file_points(const std::string& fileName, std::list& points) +{ + std::ifstream ifs(fileName); + Point point; + while (ifs >> point) + { + points.push_back(point); + } + ifs.close(); +} From b6322bd0af478070451c66dca0e5952551eec336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 29 Apr 2015 16:10:38 +0200 Subject: [PATCH 087/201] fix warnings in the doc --- .../Reconstruction_Simplification_2.txt | 2 +- .../doc/Reconstruction_simplification_2/dependencies | 3 ++- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index ddc55070916..77a58983b2d 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -137,7 +137,7 @@ points and the edges of the reconstructed shape are extracted and printed to the To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models: List_output, Index_output, Tds_output. -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} +\cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/dependencies b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/dependencies index 3b9c6bbe266..8ee9839e7bd 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/dependencies +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/dependencies @@ -1,3 +1,4 @@ Manual Kernel_23 -STL_Extension \ No newline at end of file +STL_Extension +Triangulation_2 diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 1d02c3be90e..d67e9a95243 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -211,9 +211,9 @@ protected: \tparam InputIterator is the iterator type of the algorithm input. - \param start_itr An InputIterator pointing the the first point + \param start_point_itr An InputIterator pointing the the first point in a collection. - \param beyond_itr An InputIterator pointing beyond the last point + \param beyond_point_itr An InputIterator pointing beyond the last point in a collection. */ template From 767812d48a2d779776808bda3260514f09a97dfc Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 17:54:30 +0200 Subject: [PATCH 088/201] fix bibtex --- .../Reconstruction_simplification_2/PackageDescription.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 3e77885a667..c857c172979 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -8,7 +8,7 @@ \addtogroup PkgReconstructionSimplification2 \cgalPkgDescriptionBegin{2D Reconstruction Simplification, PkgReconstructionSimplification2Summary} \cgalPkgPicture{overview.png} -\cgalPkgSummaryBegin +\cgalPkgSummaryBegin \cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clément Jamin} \cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine-to-coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} @@ -16,7 +16,7 @@ \cgalPkgShortInfoBegin \cgalPkgSince{4.x} \cgalPkgDependsOn{\ref PkgTriangulation2} -\cgalPkgBib{cgal:rec-simp2-14x} +\cgalPkgBib{cgal:gavj-rs} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd \cgalPkgDescriptionEnd From e58fd070c63db00fd84f8bf385c4f23617b2cba3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 17:55:09 +0200 Subject: [PATCH 089/201] no math mode --- .../Reconstruction_Simplification_2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 77a58983b2d..72766154eea 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -112,7 +112,7 @@ one can use the run_until function and specify the number of output vertices one wants to keep as illustrated in the following picture. \cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} -Examples of \f$20 \f$ vertex reconstructions from images consisting of \f$2000, 400 \f$ and \f$200 \f$ input points respectively. The example shows nicely +Examples of 20 vertex reconstructions from images consisting of 2000, 400 and 200 input points respectively. The example shows nicely how the algorithm is sensitiv to the input density in that it gracefully degrades the reconstruction as the density decreases. \cgalFigureEnd From 11547d7be3bcfc2c71fd37c031293eaffb665e1f Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 17:55:31 +0200 Subject: [PATCH 090/201] rename functions and template parameter --- .../CGAL/Reconstruction_simplification_2.h | 24 +++++++++---------- .../test_flip_procedure.cpp | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index d67e9a95243..b1f90135ed4 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -63,8 +63,8 @@ via the Point_property_map and Mass_property_map `PropertyMaps` respectively. */ template >, - class Mass_property_map = Second_of_pair_property_map > > + class PointMap = First_of_pair_property_map >, + class MassMap = Second_of_pair_property_map > > class Reconstruction_simplification_2 { public: @@ -154,8 +154,8 @@ protected: double m_bbox_y; double m_bbox_size; - Point_property_map point_pmap; - Mass_property_map mass_pmap; + PointMap point_pmap; + MassMap mass_pmap; /// \endcond @@ -187,8 +187,8 @@ protected: template Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, - Point_property_map in_point_pmap, - Mass_property_map in_mass_pmap) { + PointMap in_point_pmap, + MassMap in_mass_pmap) { point_pmap = in_point_pmap; @@ -226,8 +226,8 @@ protected: point_mass_list.push_back(std::make_pair(*it, 1)); } - Point_property_map in_point_pmap; - Mass_property_map in_mass_pmap; + PointMap in_point_pmap; + MassMap in_mass_pmap; point_pmap = in_point_pmap; mass_pmap = in_mass_pmap; @@ -277,8 +277,8 @@ protected: template void initialize(InputIterator start_itr, InputIterator beyond_itr, - Point_property_map in_point_pmap, - Mass_property_map in_mass_pmap) { + PointMap in_point_pmap, + MassMap in_mass_pmap) { point_pmap = in_point_pmap; mass_pmap = in_mass_pmap; @@ -1544,7 +1544,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Returns the number of vertices present in the reconstructed triangulation. */ - int get_vertex_count() { + int number_of_vertices() { return m_dt.number_of_vertices()-4 ; } @@ -1552,7 +1552,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Returns the number of (solid) edges present in the reconstructed triangulation. */ - int get_edge_count() { + int number_of_edges() { int nb_solid = 0; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index c277570034e..a386b6c444d 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -36,7 +36,7 @@ int main () rs2.print_stats_debug(); - assert(rs2.get_vertex_count() == i); + assert(rs2.number_of_vertices() == i); i = i + 20; From 566f9f8588b4a98af5dc0970c84e910cc6286e34 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 18:14:42 +0200 Subject: [PATCH 091/201] add examples.txt --- .../doc/Reconstruction_simplification_2/examples.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt new file mode 100644 index 00000000000..489cedcf541 --- /dev/null +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt @@ -0,0 +1,5 @@ +/*! +\example Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +\example Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +\example Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +*/ From b44d68c431662cb98f2b233b8151aa11a2958828 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 18:21:27 +0200 Subject: [PATCH 092/201] rename pmaps --- .../CGAL/Reconstruction_simplification_2.h | 44 ++++++++++--------- .../test_quality.cpp | 6 +-- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index b1f90135ed4..7fc9aa8f257 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -51,15 +51,15 @@ namespace CGAL { for executing the reconstruction and simplification tasks. Its constructor takes an InputIterator, used to traverse a collection of point-mass pairs, where the points and their masses are accessed -via the Point_property_map and Mass_property_map `PropertyMaps` respectively. +via the property maps `PointMap` and `MassMap` respectively. \tparam Kernel a geometric kernel, used throughout the reconstruction and simplification task. -\tparam PointPMap a model of `ReadablePropertyMap` with a value_type = `Point_2` +\tparam PointMap a model of `ReadablePropertyMap` with value type `Point_2` -\tparam MassPMap a model of `ReadablePropertyMap` with a value_type = `Kernel::FT` +\tparam MassMap a model of `ReadablePropertyMap` with value type `Kernel::FT` */ template PointMassPair; typedef typename std::list PointMassList; + /*! The Output simplex. */ typedef Reconstruction_triangulation_2 Triangulation; - +#endif /// \cond SKIP_IN_MANUAL typedef typename Triangulation::Vertex Vertex; typedef typename Triangulation::Vertex_handle Vertex_handle; @@ -180,19 +182,19 @@ protected: pair in a collection. \param beyond_itr An InputIterator pointing beyond the last point-mass pair in a collection. - \param in_point_pmap A `ReadablePropertyMap` used to access the input points + \param point_map A `ReadablePropertyMap` used to access the input points - \param in_mass_pmap A `ReadablePropertyMap` used to access the input points' mass. + \param mass_map A `ReadablePropertyMap` used to access the input points' mass. */ template Reconstruction_simplification_2(InputIterator start_itr, InputIterator beyond_itr, - PointMap in_point_pmap, - MassMap in_mass_pmap) { + PointMap point_map, + MassMap mass_map) { - point_pmap = in_point_pmap; - mass_pmap = in_mass_pmap; + point_pmap = point_map; + mass_pmap = mass_map; initialize_parameters(); @@ -226,11 +228,11 @@ protected: point_mass_list.push_back(std::make_pair(*it, 1)); } - PointMap in_point_pmap; - MassMap in_mass_pmap; + PointMap point_map; + MassMap mass_map; - point_pmap = in_point_pmap; - mass_pmap = in_mass_pmap; + point_pmap = point_map; + mass_pmap = mass_map; initialize_parameters(); @@ -277,11 +279,11 @@ protected: template void initialize(InputIterator start_itr, InputIterator beyond_itr, - PointMap in_point_pmap, - MassMap in_mass_pmap) { + PointMap point_map, + MassMap mass_map) { - point_pmap = in_point_pmap; - mass_pmap = in_mass_pmap; + point_pmap = point_map; + mass_pmap = mass_map; initialize(start_itr, beyond_itr); @@ -312,7 +314,7 @@ protected: /*! - Returns the solid edges and vertics present after the reconstruction + Returns the solid edges and vertices present after the reconstruction process finished. \details It takes two `Output-Iterators`, one for storing the @@ -377,7 +379,7 @@ protected: /*! - Returns the solid edges and vertics present after the reconstruction + Returns the solid edges and vertices present after the reconstruction process finished. Writes the edges and vertices of the output simplex into an `std::ostream` @@ -1568,7 +1570,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Returns the cost of the (solid) edges present in the reconstructed triangulation. */ - FT get_total_edge_cost() { + FT total_edge_cost() { FT total_cost = 0; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index f267d06f27f..66a173a4601 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -43,11 +43,11 @@ int main () - std::cout << " total_edge_cost "<< rs2.get_total_edge_cost() << std::endl; + std::cout << " total_edge_cost "<< rs2.total_edge_cost() << std::endl; - assert(rs2.get_total_edge_cost() < 0.3); - assert(0 < rs2.get_total_edge_cost()); + assert(rs2.total_edge_cost() < 0.3); + assert(0 < rs2.total_edge_cost()); rs2.print_stats_debug(); From 819b4d6398e1d4f1f6f1a461a59bffb8348a2c96 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Wed, 29 Apr 2015 18:41:40 +0200 Subject: [PATCH 093/201] rename isolated points -> vertices --- ...uction_simplification_2_output_example.cpp | 20 ++++++------- ...econstruction_simplification_2_example.cpp | 25 +++++++--------- ...ction_simplification_2_no_mass_example.cpp | 29 ++++++++----------- 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 550cf0982cf..d483b10f183 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -1,6 +1,5 @@ // reconstruction_simplification_2_output_example.cpp - //---------------------------------------------------------- // Simple output example for Reconstruction_simplification_2 //---------------------------------------------------------- @@ -15,7 +14,6 @@ #include #include - typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; typedef K::Segment_2 Segment; @@ -50,7 +48,7 @@ int main () Rs_2 rs2(points.begin(), points.end()); - rs2.run(100); //100 steps + rs2.run(100); // 100 steps list_output(rs2); index_output(rs2); @@ -60,19 +58,19 @@ void list_output(Rs_2& rs2) { std::cout << "(-------------List output---------- )" << std::endl; - std::vector isolated_points; + std::vector isolated_vertices; std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - for (std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - std::cout << *it << std::endl; + for (std::vector::iterator vit = isolated_vertices.begin(); + vit != isolated_vertices.end(); vit++) { + std::cout << *vit << std::endl; } - for (std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - std::cout << *it << std::endl; + for (std::vector::iterator eit = edges.begin(); + eit != edges.end(); eit++) { + std::cout << *eit << std::endl; } } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 158d2f07c0b..6c7bf427c21 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -1,6 +1,5 @@ // reconstruction_simplification_2_example.cpp - //---------------------------------------------------------- // Simple example for Reconstruction_simplification_2 //---------------------------------------------------------- @@ -48,11 +47,8 @@ void load_xy_file(const std::string& fileName, PointMassList& points) ifs.close(); } - - int main () { - PointMassList points; load_xy_file("data/stair-noise00.xy", points); @@ -62,24 +58,23 @@ int main () Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.run(100); //100 steps + rs2.run(100); // 100 steps - std::vector isolated_points; + std::vector isolated_vertices; std::vector edges; + rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); - - std::cerr << "Isolated Vertices" << std::endl; - for (std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - std::cout << *it << std::endl; + std::cerr << "Isolated vertices" << std::endl; + for (std::vector::iterator vit = isolated_vertices.begin(); + vit != isolated_vertices.end(); vit++) { + std::cout << *vit << std::endl; } std::cerr << "Edges" << std::endl; - for (std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - std::cout << *it << std::endl; + for (std::vector::iterator eit = edges.begin(); + eit != edges.end(); eit++) { + std::cout << *eit << std::endl; } } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp index b91c585cfe5..d069030e8f0 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -1,8 +1,8 @@ // reconstruction_simplification_2_example.cpp - //---------------------------------------------------------- -// Simple example for Reconstruction_simplification_2 +// Example for Reconstruction_simplification_2, with no mass +// attributes for the input points //---------------------------------------------------------- #include @@ -41,31 +41,26 @@ void load_xy_file(const std::string& fileName, std::list& points) int main () { - std::list points; - load_xy_file("data/stair-noise00.xy", points); Rs_2 rs2(points.begin(), points.end()); - rs2.run(100); //100 steps + rs2.run(100); // 100 steps - std::vector isolated_points; + std::vector isolated_vertices; std::vector edges; + rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - - rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); - - std::cerr << "Isolated Vertices" << std::endl; - for (std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - std::cout << *it << std::endl; + std::cerr << "Isolated vertices" << std::endl; + for (std::vector::iterator vit = isolated_vertices.begin(); + vit != isolated_vertices.end(); vit++) { + std::cout << *vit << std::endl; } std::cerr << "Edges" << std::endl; - for (std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - std::cout << *it << std::endl; + for (std::vector::iterator eit = edges.begin(); + eit != edges.end(); eit++) { + std::cout << *eit << std::endl; } - } From 920eebc252c1921237030632c6eef026001870db Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Wed, 29 Apr 2015 18:47:00 +0200 Subject: [PATCH 094/201] description updated --- .../doc/Reconstruction_simplification_2/PackageDescription.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index c857c172979..529715a1cd2 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -10,7 +10,7 @@ \cgalPkgPicture{overview.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clément Jamin} -\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape form a noisy point set in the plane. It iteratively builds a simplified output simplex which approximates the input points in a fine-to-coarse manner.} +\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape from a point set in the plane, possibly hampered by noise and outliers. It generates as output a simplicial complex, made up of vertices and edges, which approximates the input point set in a fine-to-coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin From e875898f5c8cf19be56a7d595bf91d1d9752a407 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Wed, 29 Apr 2015 18:51:51 +0200 Subject: [PATCH 095/201] start re-massaging the user manual --- .../Reconstruction_Simplification_2.txt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 72766154eea..bdaffb65a6d 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -10,26 +10,25 @@ namespace CGAL { \section Reconstruction_simplification_2Introduction Introduction -This package implements methods to reconstruct and simplify 2D point sets. The input is a noisy 2D point set and the output is an arrangement of line segments and points which approximate the original shape, where the input points were sampled from as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. +This package implements methods to reconstruct and simplify 2D point sets. The input is a noisy 2D point set and the output is a set of line segments and points which approximate the input shape, where the input points were sampled from as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. \cgalFigureBegin{2D_Reconstruction_Simplification_overview,summary.png} -Left: A noisy set of input points. Right: The corresponding reconstructed shape consisting of line segments. +Left: input point set hampered by noise. Right: The corresponding reconstructed shape consisting of line segments. \cgalFigureEnd -\section Reconstruction_simplification_2Overview Theory of the Reconstruction Process +\section Reconstruction_simplification_2Overview Reconstruction Process - -More formally, the task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e. given a set of points in the plane, find a 0-1 simplex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplex . +More formally, the task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a 0-1 simplicial complex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplicial complex . \cgalFigureBegin{2D_Reconstruction_Simplification_process,process.png} -From left to right: input point set; Delaunay triangulation of input; after simplification, with ghost edges in grey, relevant solid edges in green, discarded solid edges in red; final reconstruction. +From left to right: input point set; Delaunay triangulation of input point set; After simplification, with ghost edges in grey, relevant solid edges in green, and discarded solid edges in red; Final reconstruction. \cgalFigureEnd -The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a framework based on optimal transportations of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplex such that the 2-Wasserstein distance is minimized. +The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a framework based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2-Wasserstein distance is minimized. The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. @@ -141,10 +140,6 @@ To access the reconstructed vertices and edges, models which implement the Recon - - - - */ } /* namespace CGAL */ From d27855c19d799fec4437d6c1b72afa55314d7afe Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 20:31:06 +0200 Subject: [PATCH 096/201] rename the output iterators --- .../CGAL/Reconstruction_simplification_2.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7fc9aa8f257..ef9c2e5bd55 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -78,12 +78,13 @@ public: */ typedef typename Kernel::Point_2 Point; + /// \cond SKIP_IN_MANUAL /*! Vector type. */ typedef typename Kernel::Vector_2 Vector; -#ifndef DOXYGEN_RUNNING + typedef typename std::pair PointMassPair; typedef typename std::list PointMassList; @@ -92,8 +93,8 @@ public: The Output simplex. */ typedef Reconstruction_triangulation_2 Triangulation; -#endif - /// \cond SKIP_IN_MANUAL + + typedef typename Triangulation::Vertex Vertex; typedef typename Triangulation::Vertex_handle Vertex_handle; typedef typename Triangulation::Vertex_iterator Vertex_iterator; @@ -317,20 +318,19 @@ protected: Returns the solid edges and vertices present after the reconstruction process finished. - \details It takes two `Output-Iterators`, one for storing the + \details It takes two output iterators, one for storing the isolated points and one for storing the edges of the reconstructed shape. \tparam Kernel is the geometric kernel, used for the reconstruction and simplification task. - \tparam OutputVertexIterator The `Output-Iterator` type for storing the points + \tparam PointOutputIterator The output iterator type for storing the points - \tparam OutputEdgeIterator The `Output-Iterator` type for storing the - edges (as Segments). + \tparam SegmentOutputIterator The output iterator type for storing the edges (as segments). */ - template - void extract_list_output(OutputVertexIterator v_it, OutputEdgeIterator e_it) { + template + void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { for (Vertex_iterator vi = m_dt.vertices_begin(); vi != m_dt.vertices_end(); ++vi) @@ -523,7 +523,7 @@ protected: /*! Determines how much console output the algorithm generates. By default verbose is set to 0. If set to a value larger than 0 - details about the reconstruction process are writen to std::err. + details about the reconstruction process are writen to `std::err`. \param verbose The verbosity level. */ @@ -541,7 +541,7 @@ protected: /*! The use_flip parameter determines whether the flipping procedure - is used for the half-edge collapse. By default use_flip is set to true. + is used for the half-edge collapse. By default use_flip is set to `true`. */ void set_use_flip(const bool use_flip) { m_use_flip = use_flip; From 737b17fec582e4e856a84a484cd0ce35167aa015 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 20:34:50 +0200 Subject: [PATCH 097/201] Kernel is not a template parameter --- .../include/CGAL/Reconstruction_simplification_2.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ef9c2e5bd55..9e75b3bbdcd 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -322,9 +322,6 @@ protected: isolated points and one for storing the edges of the reconstructed shape. - \tparam Kernel is the geometric kernel, used for the reconstruction and - simplification task. - \tparam PointOutputIterator The output iterator type for storing the points \tparam SegmentOutputIterator The output iterator type for storing the edges (as segments). From 488ca1cbaa89466ad63ef1afbdce1fa9de9fd804 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Apr 2015 21:35:39 +0200 Subject: [PATCH 098/201] use ranges; pass over the examples --- ...uction_simplification_2_output_example.cpp | 107 ++++++++---------- ...econstruction_simplification_2_example.cpp | 77 ++++++------- ...ction_simplification_2_no_mass_example.cpp | 70 +++++------- .../CGAL/Reconstruction_simplification_2.h | 48 ++++---- 4 files changed, 133 insertions(+), 169 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index d483b10f183..28d768408d9 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -1,10 +1,3 @@ -// reconstruction_simplification_2_output_example.cpp - -//---------------------------------------------------------- -// Simple output example for Reconstruction_simplification_2 -//---------------------------------------------------------- - - #include #include @@ -15,69 +8,65 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point; -typedef K::Segment_2 Segment; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; -typedef K::FT FT; +typedef K::FT FT; typedef CGAL::Reconstruction_simplification_2 Rs_2; -void list_output(Rs_2& rs2); -void index_output(Rs_2& rs2); - - - void load_xy_file(const std::string& filename, std::list& points) { - std::ifstream ifs(filename); - Point point; - while (ifs >> point) - { - points.push_back(point); - } - ifs.close(); + std::ifstream ifs(filename); + Point point; + while (ifs >> point){ + points.push_back(point); + } + ifs.close(); +} + + +void list_output(Rs_2& rs2) +{ + std::cout << "(-------------List output---------- )" << std::endl; + + std::vector isolated_vertices; + std::vector edges; + + rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); + + for (std::vector::iterator vit = isolated_vertices.begin(); + vit != isolated_vertices.end(); vit++) { + std::cout << *vit << std::endl; + } + + for (std::vector::iterator eit = edges.begin(); + eit != edges.end(); eit++) { + std::cout << *eit << std::endl; + } +} + + +void index_output(Rs_2& rs2) +{ + std::cout << "(-------------Off output---------- )" << std::endl; + + rs2.extract_index_output(std::cout); } int main () { + + std::list points; + + load_xy_file("data/stair-noise00.xy", points); + + Rs_2 rs2(points); - std::list points; + rs2.run(100); // 100 steps - load_xy_file("data/stair-noise00.xy", points); - - Rs_2 rs2(points.begin(), points.end()); - - rs2.run(100); // 100 steps - - list_output(rs2); - index_output(rs2); -} - -void list_output(Rs_2& rs2) { - - std::cout << "(-------------List output---------- )" << std::endl; - - std::vector isolated_vertices; - std::vector edges; - - rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - - for (std::vector::iterator vit = isolated_vertices.begin(); - vit != isolated_vertices.end(); vit++) { - std::cout << *vit << std::endl; - } - - for (std::vector::iterator eit = edges.begin(); - eit != edges.end(); eit++) { - std::cout << *eit << std::endl; - } -} - - -void index_output(Rs_2& rs2) { - - std::cout << "(-------------Off output---------- )" << std::endl; - - rs2.extract_index_output(std::cout); + list_output(rs2); + index_output(rs2); + return 0; } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 6c7bf427c21..ea42292f9a5 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -1,13 +1,6 @@ -// reconstruction_simplification_2_example.cpp - -//---------------------------------------------------------- -// Simple example for Reconstruction_simplification_2 -//---------------------------------------------------------- - #include #include - #include #include #include @@ -18,63 +11,59 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point; -typedef K::Segment_2 Segment; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; -typedef K::FT FT; +typedef K::FT FT; typedef std::pair PointMassPair; typedef std::list PointMassList; - typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; typedef CGAL::Reconstruction_simplification_2 Rs_2; - - void load_xy_file(const std::string& fileName, PointMassList& points) { std::ifstream ifs(fileName); Point point; unsigned int nb = 0; - while (ifs >> point) - { - points.push_back(std::make_pair(point, 1)); + while (ifs >> point){ + points.push_back(std::make_pair(point, 1)); } ifs.close(); } int main () { - PointMassList points; - - load_xy_file("data/stair-noise00.xy", points); - - Point_property_map point_pmap; - Mass_property_map mass_pmap; - - Rs_2 rs2(points.begin(), points.end(), point_pmap, mass_pmap); - - rs2.run(100); // 100 steps - - std::vector isolated_vertices; - std::vector edges; - - rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - - std::cerr << "Isolated vertices" << std::endl; - for (std::vector::iterator vit = isolated_vertices.begin(); - vit != isolated_vertices.end(); vit++) { - std::cout << *vit << std::endl; - } - - std::cerr << "Edges" << std::endl; - for (std::vector::iterator eit = edges.begin(); - eit != edges.end(); eit++) { - std::cout << *eit << std::endl; - } - + PointMassList points; + + load_xy_file("data/stair-noise00.xy", points); + + Point_property_map point_pmap; + Mass_property_map mass_pmap; + + Rs_2 rs2(points, point_pmap, mass_pmap); + + rs2.run(100); // 100 steps + + std::vector isolated_vertices; + std::vector edges; + + rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); + + std::cerr << "Isolated vertices" << std::endl; + for (std::vector::iterator vit = isolated_vertices.begin(); + vit != isolated_vertices.end(); vit++) { + std::cout << *vit << std::endl; + } + + std::cerr << "Edges" << std::endl; + for (std::vector::iterator eit = edges.begin(); + eit != edges.end(); eit++) { + std::cout << *eit << std::endl; + } + return 0; } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp index d069030e8f0..86a4a64d172 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -1,14 +1,9 @@ -// reconstruction_simplification_2_example.cpp - -//---------------------------------------------------------- // Example for Reconstruction_simplification_2, with no mass // attributes for the input points -//---------------------------------------------------------- #include #include - #include #include #include @@ -16,51 +11,48 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point; -typedef K::Segment_2 Segment; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; -typedef K::FT FT; +typedef K::FT FT; typedef CGAL::Reconstruction_simplification_2 Rs_2; - - void load_xy_file(const std::string& fileName, std::list& points) { - std::ifstream ifs(fileName); - Point point; - while (ifs >> point) - { - points.push_back(point); - } - ifs.close(); + std::ifstream ifs(fileName); + Point point; + while (ifs >> point){ + points.push_back(point); + } + ifs.close(); } - int main () { - std::list points; - load_xy_file("data/stair-noise00.xy", points); + std::list points; + load_xy_file("data/stair-noise00.xy", points); + + Rs_2 rs2(points); - Rs_2 rs2(points.begin(), points.end()); - - rs2.run(100); // 100 steps - - std::vector isolated_vertices; - std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - - std::cerr << "Isolated vertices" << std::endl; - for (std::vector::iterator vit = isolated_vertices.begin(); - vit != isolated_vertices.end(); vit++) { - std::cout << *vit << std::endl; - } - - std::cerr << "Edges" << std::endl; - for (std::vector::iterator eit = edges.begin(); - eit != edges.end(); eit++) { - std::cout << *eit << std::endl; - } + rs2.run(100); // 100 steps + + std::vector isolated_vertices; + std::vector edges; + rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); + + std::cerr << "Isolated vertices" << std::endl; + for (std::vector::iterator vit = isolated_vertices.begin(); + vit != isolated_vertices.end(); vit++) { + std::cout << *vit << std::endl; + } + + std::cerr << "Edges" << std::endl; + for (std::vector::iterator eit = edges.begin(); + eit != edges.end(); eit++) { + std::cout << *eit << std::endl; + } + return 0; } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 9e75b3bbdcd..d3652b2991f 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -49,7 +49,7 @@ namespace CGAL { \brief `Reconstruction_simplification_2` is the main class for executing the reconstruction and simplification tasks. -Its constructor takes an InputIterator, used to traverse a collection +Its constructor takes an `InputRange`, used to traverse a collection of point-mass pairs, where the points and their masses are accessed via the property maps `PointMap` and `MassMap` respectively. @@ -175,23 +175,20 @@ protected: first output simplex is then made coarser during subsequent iterations. \details Instantiates a new Reconstruction_simplification_2 object - for a given collection of point-mass pairs. + for a givenrange of point-mass pairs. - \tparam InputIterator is the iterator type of the algorithm input. + \tparam InputRange is a model of `Range` with forward iterators, + providing input points and point mass through the following two property maps. - \param start_itr An InputIterator pointing the the first point-mass - pair in a collection. - \param beyond_itr An InputIterator pointing beyond the last point-mass - pair in a collection. + \param input_range range of input data. \param point_map A `ReadablePropertyMap` used to access the input points \param mass_map A `ReadablePropertyMap` used to access the input points' mass. */ - template - Reconstruction_simplification_2(InputIterator start_itr, - InputIterator beyond_itr, - PointMap point_map, - MassMap mass_map) { + template + Reconstruction_simplification_2(const InputRange& input_range, + PointMap point_map, + MassMap mass_map) { point_pmap = point_map; @@ -199,7 +196,7 @@ protected: initialize_parameters(); - initialize(start_itr, beyond_itr); + initialize(input_range.begin(), input_range.end()); } @@ -210,23 +207,20 @@ protected: first output simplex is then made coarser during subsequent iterations. \details Instantiates a new Reconstruction_simplification_2 object - for a given collection of points. + for a given range of points. - \tparam InputIterator is the iterator type of the algorithm input. + \tparam InputRange is a model of `Range` with forward iterators, + providing input points and point mass through... - \param start_point_itr An InputIterator pointing the the first point - in a collection. - \param beyond_point_itr An InputIterator pointing beyond the last point - in a collection. + \param input_range range of input data. */ - template - Reconstruction_simplification_2(InputIterator start_point_itr, - InputIterator beyond_point_itr) { + template + Reconstruction_simplification_2(const InputRange& input_range) { PointMassList point_mass_list; - for (InputIterator it = start_point_itr; it != beyond_point_itr; it++) { - point_mass_list.push_back(std::make_pair(*it, 1)); + BOOST_FOREACH(Point_2 p , input_range) { + point_mass_list.push_back(std::make_pair(p, 1)); } PointMap point_map; @@ -322,9 +316,9 @@ protected: isolated points and one for storing the edges of the reconstructed shape. - \tparam PointOutputIterator The output iterator type for storing the points + \tparam PointOutputIterator The output iterator type for storing the isolated points - \tparam SegmentOutputIterator The output iterator type for storing the edges (as segments). + \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. */ template void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { @@ -1607,7 +1601,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } /*! - Computes a shape, reconstructing the input, by performing steps many + Computes a shape, reconstructing the input, by performing `steps` many edge contractions on the output simplex. \param steps The number of edge contractions performed by the algorithm. From 16570acb45dff2b490e3a0e4260aaa33d1297cf6 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Apr 2015 10:23:21 +0200 Subject: [PATCH 100/201] fix section on output --- .../Reconstruction_Simplification_2.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index bdaffb65a6d..8f4a9334b21 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -131,10 +131,10 @@ points and the edges of the reconstructed shape are extracted and printed to the \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} -\subsubsection Reconstruction_simplification_2Output Output-Example - -To access the reconstructed vertices and edges, models which implement the ReconstructionSimplificationOutput_2 concept can be used. The package offers three such models: List_output, Index_output, Tds_output. +\subsubsection Reconstruction_simplification_2Output Output Example +The result of the reconstuction can be obtained in two ways. Either as sequence of isolated points and segments. +Or as a sequence of points and pairs of indices for describing the segments. \cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} From 8605d274916bd876a18612650640d2f96d5bbb4d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Apr 2015 21:50:02 +0200 Subject: [PATCH 101/201] changes after the discussion with Pierre --- .../PackageDescription.txt | 4 +- .../CGAL/Reconstruction_simplification_2.h | 123 ++++++++++-------- 2 files changed, 69 insertions(+), 58 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 529715a1cd2..084f4d28afe 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -10,12 +10,12 @@ \cgalPkgPicture{overview.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clément Jamin} -\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape from a point set in the plane, possibly hampered by noise and outliers. It generates as output a simplicial complex, made up of vertices and edges, which approximates the input point set in a fine-to-coarse manner.} +\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape from a point set in the plane, possibly hampered by noise and outliers. It generates as output a simplicial complex, made up of points and segments, which approximates the input point set in a fine-to-coarse manner.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin \cgalPkgSince{4.x} -\cgalPkgDependsOn{\ref PkgTriangulation2} +\cgalPkgDependsOn{\ref PkgTriangulation2Summary} \cgalPkgBib{cgal:gavj-rs} \cgalPkgLicense{\ref licensesGPL "GPL"} \cgalPkgShortInfoEnd diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index d3652b2991f..e5423176daf 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -53,36 +53,36 @@ Its constructor takes an `InputRange`, used to traverse a collection of point-mass pairs, where the points and their masses are accessed via the property maps `PointMap` and `MassMap` respectively. +\todo `Gt` must at least be a model of `DelaunayTriangulationTraits_2`. @@Pierre: If more functionalty is needed we should introduce a `ReconstructionSimplificationTraits_2`. -\tparam Kernel a geometric kernel, used throughout the reconstruction and - simplification task. +\tparam Gt a model of the concept `Kernel`. -\tparam PointMap a model of `ReadablePropertyMap` with value type `Point_2` +\tparam PointMap a model of `ReadablePropertyMap` with value type `Gt::Point_2` -\tparam MassMap a model of `ReadablePropertyMap` with value type `Kernel::FT` +\tparam MassMap a model of `ReadablePropertyMap` with value type `Gt::FT` */ -template >, - class MassMap = Second_of_pair_property_map > > +template >, + class MassMap = Second_of_pair_property_map > > class Reconstruction_simplification_2 { public: /*! Number type. */ - typedef typename Kernel::FT FT; + typedef typename Gt::FT FT; /*! Point type. */ - typedef typename Kernel::Point_2 Point; + typedef typename Gt::Point_2 Point; /// \cond SKIP_IN_MANUAL /*! Vector type. */ - typedef typename Kernel::Vector_2 Vector; + typedef typename Gt::Vector_2 Vector; typedef typename std::pair PointMassPair; @@ -92,7 +92,7 @@ public: /*! The Output simplex. */ - typedef Reconstruction_triangulation_2 Triangulation; + typedef Reconstruction_triangulation_2 Triangulation; typedef typename Triangulation::Vertex Vertex; @@ -175,20 +175,30 @@ protected: first output simplex is then made coarser during subsequent iterations. \details Instantiates a new Reconstruction_simplification_2 object - for a givenrange of point-mass pairs. + for a given range of point-mass pairs. \tparam InputRange is a model of `Range` with forward iterators, providing input points and point mass through the following two property maps. \param input_range range of input data. - \param point_map A `ReadablePropertyMap` used to access the input points + \param point_map A `ReadablePropertyMap` used to access the input points. \param mass_map A `ReadablePropertyMap` used to access the input points' mass. + \param sample_size If != 0, the size of the random sample that replaces a priority queue. + \param use_flip If `true` the flipping procedure is used for the halfedge collapse. + \param relocation The number of point relocations that are performed between two edge collapses. + \param verbose controls how much console output is produced by the algorithm. The values are 0,1, or >1. + */ template Reconstruction_simplification_2(const InputRange& input_range, PointMap point_map, - MassMap mass_map) { + MassMap mass_map, + std::size_t sample_size = 0, + bool use_flip = true, + std::size_t relocation = 0, + std::size_t verbose = 0 + ) { point_pmap = point_map; @@ -304,7 +314,7 @@ protected: assign_samples(m_samples.begin(), m_samples.end()); } - /// \endcond + @@ -358,29 +368,33 @@ protected: Vertex_handle source = edge.first->vertex( (index+1)%3 ); Vertex_handle target = edge.first->vertex( (index+2)%3 ); - typename Kernel::Segment_2 s(source->point(), target->point()); + typename Gt::Segment_2 s(source->point(), target->point()); *e_it = s; e_it++; } } - + /// \endcond /*! + Writes the points and segments of the output simplex in an indexed format into output iterators. + \tparam PointOutputIterator An output iterator with value type `Point`. + \tparam IndexOutputIterator An output iterator with value type `std::size_t` + \tparam IndexPairOutputIterator An output iterator with value type `std::pair` - - Returns the solid edges and vertices present after the reconstruction - process finished. - - Writes the edges and vertices of the output simplex into an `std::ostream` - in an indexed format. - - \param os The `std::ostream` where the indexed data will be written to. + \param points the output iterator for all points + \param isolated_points the output iterator for the indices of isolated points + \param segments the output iterator for the pairs of indices of segments */ - void extract_index_output(std::ostream& os) { + template + void indexed_output(PointOutputIterator points, + IndexOutputIterator isolated_points, + IndexPairOutputIterator segments) { - typedef typename Kernel::Segment_2 Segment; + typedef typename Gt::Segment_2 Segment; std::vector isolated_points; std::vector edges; @@ -502,23 +516,22 @@ protected: /*! Allows a speedup by not using the priority queue but instead using a random subset - of mchoice many samples. Based on those the next edge collapse step is determined. - By default mchoice is set to 0. - - \param mchoice The number of samples used for the multiple choice selection. + of size `sample_size`. Based on those the next edge collapse step is determined. + \todo @@Pierre: Tell what is a good value. + \param sample_size The size of the random sample that replaces a priority queue. */ - void set_mchoice(const int mchoice) { + void set_random_sample_size(std::size_t sample_size) { m_mchoice = mchoice; } /*! Determines how much console output the algorithm generates. - By default verbose is set to 0. If set to a value larger than 0 - details about the reconstruction process are writen to `std::err`. + If set to a value larger than 0 + details about the reconstruction process are written to `std::err`. \param verbose The verbosity level. */ - void set_verbose(const int verbose) { + void set_verbose(std::size_t verbose) { m_verbose = verbose; } @@ -532,7 +545,7 @@ protected: /*! The use_flip parameter determines whether the flipping procedure - is used for the half-edge collapse. By default use_flip is set to `true`. + is used for the half-edge collapse. */ void set_use_flip(const bool use_flip) { m_use_flip = use_flip; @@ -562,11 +575,10 @@ protected: /*! - The relocation parameter controls the number of relocations + Sets the number of point relocations that are performed between two edge collapses. - By default relocation is set to 0. */ - void set_relocation(const unsigned relocation) { + void set_relocation(std::size_t relocation) { m_relocation = relocation; } @@ -578,14 +590,11 @@ protected: /*! - After the decimation is completed, irrelevant edges may exist in the - reconstructed simplex. Using a use-case related relevance score, - which favors long edges with large mass and low cost, the algorithm - discard the edges with low relevance. The default value of relevance is 1. + \todo @@Pierre: explain what relevance means \param relevance The relevance level. */ - void set_ghost(const double relevance) { + void set_relevance(const double relevance) { m_ghost = relevance; m_dt.ghost_factor() = m_ghost; } @@ -1277,19 +1286,19 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } } } - /// \endcond + /// \endcond /*! Since noise and missing data may prevent the reconstructed shape to have sharp corners well located, the algorithm offers the possibility to automatically - relocate vertices after each edge contraction. The new location of the - vertices is chosen such that the fitting of the output triangulation to the + relocate points after each edge contraction. The new location of the + points is chosen such that the fitting of the output segments to the input points is improved. This is achieved by minimizing the normal component - of the weighted \f$L_2 \f$ distance. The vertices then get relocated only if the - resulting triangulation is still embeddable. + of the weighted \f$L_2 \f$ distance. The points then get relocated only if the + underlying triangulation is still embeddable. */ - void relocate_all_vertices() { + void relocate_all_points() { double timer = clock(); std::cerr << yellow << "relocate all" << white << "..."; @@ -1330,6 +1339,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { << time_duration(timer) << white << " s)" << std::endl; } + /// \cond SKIP_IN_MANUAL Vector compute_gradient(Vertex_handle vertex) { Vector grad(0.0, 0.0); @@ -1532,7 +1542,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } - /// \endcond + /*! Returns the number of vertices present in the reconstructed triangulation. @@ -1573,19 +1583,20 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { return total_cost; } + /// \endcond // RECONSTRUCTION // /*! - Computes a shape consisting of nv vertices, reconstructing the input + Computes a shape consisting of `np points, reconstructing the input points. - \param nv The number of vertices which will be present in the output. + \param np The number of points which will be present in the output. */ - void run_until(const unsigned nv) { + void run_until(std::size_t np) { double timer = clock(); - std::cerr << yellow << "reconstruct until " << white << nv << " V"; + std::cerr << yellow << "reconstruct until " << white << np << " V"; - unsigned N = nv + 4; + unsigned N = np + 4; unsigned performed = 0; while (m_dt.number_of_vertices() > N) { bool ok = decimate(); From 5a025abd48636623adb649d322d654595535934d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 30 Apr 2015 23:00:00 +0200 Subject: [PATCH 102/201] last published version --- .../CGAL/Reconstruction_simplification_2.h | 733 +++++++++--------- 1 file changed, 357 insertions(+), 376 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index e5423176daf..7535c194867 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -38,6 +38,7 @@ #include #include #include +#include namespace CGAL { @@ -45,13 +46,14 @@ namespace CGAL { /*! \ingroup PkgReconstructionSimplification2Classes +This class enables to reconstruct a 1-dimensional shape from a range of points with masses. +The algorithm computes a triangulation, .... and performs a simplification of the triangulation +by performing edge contractions. The edges are either processed in the order imposed by +a priority queue, or in an order based on random sampling. As the priority queue guarantees +a higher quality it is the default. The user can switch to the other method, for example +for an initial simplification round, by calling `set_random_sample_size()`. - -\brief `Reconstruction_simplification_2` is the main class -for executing the reconstruction and simplification tasks. -Its constructor takes an `InputRange`, used to traverse a collection -of point-mass pairs, where the points and their masses are accessed -via the property maps `PointMap` and `MassMap` respectively. +\todo @@Pierre: In the same way discuss the other parameters and run functions. \todo `Gt` must at least be a model of `DelaunayTriangulationTraits_2`. @@Pierre: If more functionalty is needed we should introduce a `ReconstructionSimplificationTraits_2`. @@ -64,10 +66,12 @@ via the property maps `PointMap` and `MassMap` respectively. */ template >, - class MassMap = Second_of_pair_property_map > > + class MassMap = boost::static_property_map > class Reconstruction_simplification_2 { public: + /// \name Types + /// @{ /*! Number type. */ @@ -138,6 +142,7 @@ public: typedef typename Triangulation::MultiIndex MultiIndex; + /// @} protected: Triangulation m_dt; @@ -162,20 +167,15 @@ protected: /// \endcond - // Public methods public: - /// \name Creation + /// \name Initialization /// @{ /*! - Instantiates a new Reconstruction_simplification_2. - Computes a bounding box around the input points and creates a first - (dense) output simplex as well as an initial transportation plan. This - first output simplex is then made coarser during subsequent iterations. - - \details Instantiates a new Reconstruction_simplification_2 object - for a given range of point-mass pairs. + The constructor of the reconstruction simplification class + for a given range of point-mass pairs. + which already builds an initial simplex. \tparam InputRange is a model of `Range` with forward iterators, providing input points and point mass through the following two property maps. @@ -184,7 +184,7 @@ protected: \param point_map A `ReadablePropertyMap` used to access the input points. \param mass_map A `ReadablePropertyMap` used to access the input points' mass. - \param sample_size If != 0, the size of the random sample that replaces a priority queue. + \param sample_size If `sample_size != 0`, the size of the random sample that replaces a priority queue. \param use_flip If `true` the flipping procedure is used for the halfedge collapse. \param relocation The number of point relocations that are performed between two edge collapses. \param verbose controls how much console output is produced by the algorithm. The values are 0,1, or >1. @@ -192,8 +192,8 @@ protected: */ template Reconstruction_simplification_2(const InputRange& input_range, - PointMap point_map, - MassMap mass_map, + PointMap point_map = PointMap(), + MassMap mass_map = MassMap(1), std::size_t sample_size = 0, bool use_flip = true, std::size_t relocation = 0, @@ -210,315 +210,15 @@ protected: } - /*! - Instantiates a new Reconstruction_simplification_2. - Computes a bounding box around the input points and creates a first - (dense) output simplex as well as an initial transportation plan. This - first output simplex is then made coarser during subsequent iterations. - - \details Instantiates a new Reconstruction_simplification_2 object - for a given range of points. - - \tparam InputRange is a model of `Range` with forward iterators, - providing input points and point mass through... - - \param input_range range of input data. - */ - template - Reconstruction_simplification_2(const InputRange& input_range) { - - - PointMassList point_mass_list; - BOOST_FOREACH(Point_2 p , input_range) { - point_mass_list.push_back(std::make_pair(p, 1)); - } - - PointMap point_map; - MassMap mass_map; - - point_pmap = point_map; - mass_pmap = mass_map; - - initialize_parameters(); - - initialize(point_mass_list.begin(), point_mass_list.end()); - } - - /// @} - - /// \cond SKIP_IN_MANUAL - - Reconstruction_simplification_2() { - initialize_parameters(); - } - - - ~Reconstruction_simplification_2() { - clear(); - } - - void initialize_parameters() { - - - m_verbose = 0; - m_mchoice = 0; - m_use_flip = true; - m_alpha = 0.5; - m_norm_tol = 1.0; - m_tang_tol = 1.0; - m_ghost = 1.0; - m_relocation = 0; - - m_bbox_x = 0.0; - m_bbox_y = 0.0; - m_bbox_size = 1.0; - - m_ignore = 0; - } - - //Function if one wants to create a Reconstruction_simplification_2 - //without yet specifying the input in the constructor. - template - void initialize(InputIterator start_itr, - InputIterator beyond_itr, - PointMap point_map, - MassMap mass_map) { - - point_pmap = point_map; - mass_pmap = mass_map; - - initialize(start_itr, beyond_itr); - - } - - - template - void initialize(InputIterator start, InputIterator beyond) { - - clear(); - - insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); - - init(start, beyond); - - std::list m_samples; - for (InputIterator it = start; it != beyond; it++) { - Point point = get(point_pmap, *it); - FT mass = get( mass_pmap, *it); - Sample* s = new Sample(point, mass); - m_samples.push_back(s); - } - assign_samples(m_samples.begin(), m_samples.end()); - } - - - - - + /// \name Settting Parameters + /// @{ /*! - Returns the solid edges and vertices present after the reconstruction - process finished. - - \details It takes two output iterators, one for storing the - isolated points and one for storing the edges of the reconstructed shape. - - - \tparam PointOutputIterator The output iterator type for storing the isolated points - - \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. - */ - template - void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { - - for (Vertex_iterator vi = m_dt.vertices_begin(); - vi != m_dt.vertices_end(); ++vi) - { - - bool incident_edges_have_sample = false; - typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); - typename Triangulation::Edge_circulator cur = start; - - do { - if (!m_dt.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) { - Point p = (*vi).point(); - *v_it = p; - v_it++; - } - } - } - - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) - continue; - - int index = edge.second; - Vertex_handle source = edge.first->vertex( (index+1)%3 ); - Vertex_handle target = edge.first->vertex( (index+2)%3 ); - - typename Gt::Segment_2 s(source->point(), target->point()); - *e_it = s; - e_it++; - } - - - } - /// \endcond - - /*! - Writes the points and segments of the output simplex in an indexed format into output iterators. - \tparam PointOutputIterator An output iterator with value type `Point`. - \tparam IndexOutputIterator An output iterator with value type `std::size_t` - \tparam IndexPairOutputIterator An output iterator with value type `std::pair` - - \param points the output iterator for all points - \param isolated_points the output iterator for the indices of isolated points - \param segments the output iterator for the pairs of indices of segments - */ - template - void indexed_output(PointOutputIterator points, - IndexOutputIterator isolated_points, - IndexPairOutputIterator segments) { - - typedef typename Gt::Segment_2 Segment; - std::vector isolated_points; - std::vector edges; - - extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); - - - //vertices_of_edges - std::set edge_vertices; - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - - Point a = (*it).source(); - Point b = (*it).target(); - - edge_vertices.insert(a); - edge_vertices.insert(b); - } - - os << "OFF " << isolated_points.size() + edge_vertices.size() << - " 0 " << edges.size() << std::endl; - - for (typename std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - os << *it << std::endl; - } - - for (typename std::set::iterator it = edge_vertices.begin(); - it != edge_vertices.end(); it++) { - - os << *it << std::endl; - } - - for (int i = 0; i < isolated_points.size(); i++) { - os << "1 " << i << std::endl; - } - - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - - //save_one_edge(os, *it,edge_vertices); - - Point a = (*it).source(); - Point b = (*it).target(); - - typename std::set::iterator it_a = edge_vertices.find(a); - typename std::set::iterator it_b = edge_vertices.find(b); - - int pos_a = std::distance(edge_vertices.begin(), it_a); - int pos_b = std::distance(edge_vertices.begin(), it_b); - - os << "2 " << pos_a + isolated_points.size() << " " - << pos_b + isolated_points.size() << std::endl; - - - - } - } - - - /// \cond SKIP_IN_MANUAL - void extract_tds_output(Triangulation& rt2) { - rt2 = m_dt; - //mark vertices - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) - { - - bool incident_edges_have_sample = false; - typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); - typename Triangulation::Edge_circulator cur = start; - - do { - if (!rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) - (*vi).set_relevance(1); - } - } - - - //mark edges - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) - { - Edge edge = *ei; - FT relevance = 0; - if (!rt2.is_ghost(edge)) { - relevance = rt2.get_edge_relevance(edge); // >= 0 - } - edge.first->relevance(edge.second) = relevance; - } - } - - - - template - Vector random_vec(const double scale) - { - double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; - double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; - return Vector(dx, dy); - } - - void clear() { - m_dt.clear(); - m_mindex.clear(); - } - - double time_duration(const double init) { - return (clock() - init) / CLOCKS_PER_SEC; - } - /// \endcond - - - /*! - Allows a speedup by not using the priority queue but instead using a random subset - of size `sample_size`. Based on those the next edge collapse step is determined. - \todo @@Pierre: Tell what is a good value. - \param sample_size The size of the random sample that replaces a priority queue. + If `sample_size == 0`, the edge collapse is done using a priority queue. + \todo @@Pierre: Tell what is a good value. + \param sample_size If `sample_size != 0`, the size of the random sample that replaces the priority queue. */ void set_random_sample_size(std::size_t sample_size) { m_mchoice = mchoice; @@ -605,6 +305,96 @@ protected: return m_ghost; } + /// @} + + /// \cond SKIP_IN_MANUAL + + Reconstruction_simplification_2() { + initialize_parameters(); + } + + + ~Reconstruction_simplification_2() { + clear(); + } + + void initialize_parameters() { + + + m_verbose = 0; + m_mchoice = 0; + m_use_flip = true; + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; + m_relocation = 0; + + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; + + m_ignore = 0; + } + + //Function if one wants to create a Reconstruction_simplification_2 + //without yet specifying the input in the constructor. + template + void initialize(InputIterator start_itr, + InputIterator beyond_itr, + PointMap point_map, + MassMap mass_map) { + + point_pmap = point_map; + mass_pmap = mass_map; + + initialize(start_itr, beyond_itr); + + } + + + template + void initialize(InputIterator start, InputIterator beyond) { + + clear(); + + insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); + + init(start, beyond); + + std::list m_samples; + for (InputIterator it = start; it != beyond; it++) { + Point point = get(point_pmap, *it); + FT mass = get( mass_pmap, *it); + Sample* s = new Sample(point, mass); + m_samples.push_back(s); + } + assign_samples(m_samples.begin(), m_samples.end()); + } + + + + + + template + Vector random_vec(const double scale) + { + double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + return Vector(dx, dy); + } + + void clear() { + m_dt.clear(); + m_mindex.clear(); + } + + double time_duration(const double init) { + return (clock() - init) / CLOCKS_PER_SEC; + } + + + // INIT // void insert_loose_bbox(const double x, const double y, const double size) { double timer = clock(); @@ -1289,56 +1079,6 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /// \endcond - /*! - Since noise and missing data may prevent the reconstructed shape to - have sharp corners well located, the algorithm offers the possibility to automatically - relocate points after each edge contraction. The new location of the - points is chosen such that the fitting of the output segments to the - input points is improved. This is achieved by minimizing the normal component - of the weighted \f$L_2 \f$ distance. The points then get relocated only if the - underlying triangulation is still embeddable. - */ - void relocate_all_points() { - double timer = clock(); - std::cerr << yellow << "relocate all" << white << "..."; - - m_mindex.clear(); // pqueue must be recomputed - - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); - v != m_dt.finite_vertices_end(); ++v) { - if (v->pinned()) - continue; - v->relocated() = compute_relocation(v); - } - - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); - v != m_dt.finite_vertices_end(); ++v) { - if (v->pinned()) - continue; - if (v->point() == v->relocated()) - continue; - - Edge_list hull; - m_dt.get_edges_from_star_minus_link(v, hull, false); - bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), - hull.end()); - - if (ok) { - // do relocation - FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); - relocate_one_vertex(v); - FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); - - // undo relocation - if (norm_bef < norm_aft) - relocate_one_vertex(v); - } - } - - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; - } - /// \cond SKIP_IN_MANUAL Vector compute_gradient(Vertex_handle vertex) { @@ -1584,10 +1324,13 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } /// \endcond - // RECONSTRUCTION // + + /// \name Simplification + /// You can freely mix calls of the following functions. + /// @{ /*! - Computes a shape consisting of `np points, reconstructing the input + Computes a shape consisting of `np` points, reconstructing the input points. \param np The number of points which will be present in the output. @@ -1635,6 +1378,244 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { << std::endl; } + + /*! + Since noise and missing data may prevent the reconstructed shape to + have sharp corners well located, the algorithm offers the possibility to automatically + relocate points after each edge contraction. The new location of the + points is chosen such that the fitting of the output segments to the + input points is improved. This is achieved by minimizing the normal component + of the weighted \f$L_2 \f$ distance. The points then get relocated only if the + underlying triangulation is still embeddable. + */ + void relocate_all_points() { + double timer = clock(); + std::cerr << yellow << "relocate all" << white << "..."; + + m_mindex.clear(); // pqueue must be recomputed + + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); + } + + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; + + Edge_list hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); + + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + + // undo relocation + if (norm_bef < norm_aft) + relocate_one_vertex(v); + } + } + + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } + + /// @} + + /// \name Output + /// @{ + + /*! + Writes the points and segments of the output simplex in an indexed format into output iterators. + \tparam PointOutputIterator An output iterator with value type `Point`. + \tparam IndexOutputIterator An output iterator with value type `std::size_t` + \tparam IndexPairOutputIterator An output iterator with value type `std::pair` + + \param points the output iterator for all points + \param isolated_points the output iterator for the indices of isolated points + \param segments the output iterator for the pairs of indices of segments + */ + template + void indexed_output(PointOutputIterator points, + IndexOutputIterator isolated_points, + IndexPairOutputIterator segments) { + + typedef typename Gt::Segment_2 Segment; + std::vector isolated_points; + std::vector edges; + + extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + + + //vertices_of_edges + std::set edge_vertices; + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + + Point a = (*it).source(); + Point b = (*it).target(); + + edge_vertices.insert(a); + edge_vertices.insert(b); + } + + os << "OFF " << isolated_points.size() + edge_vertices.size() << + " 0 " << edges.size() << std::endl; + + for (typename std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + os << *it << std::endl; + } + + for (typename std::set::iterator it = edge_vertices.begin(); + it != edge_vertices.end(); it++) { + + os << *it << std::endl; + } + + for (int i = 0; i < isolated_points.size(); i++) { + os << "1 " << i << std::endl; + } + + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + + //save_one_edge(os, *it,edge_vertices); + + Point a = (*it).source(); + Point b = (*it).target(); + + typename std::set::iterator it_a = edge_vertices.find(a); + typename std::set::iterator it_b = edge_vertices.find(b); + + int pos_a = std::distance(edge_vertices.begin(), it_a); + int pos_b = std::distance(edge_vertices.begin(), it_b); + + os << "2 " << pos_a + isolated_points.size() << " " + << pos_b + isolated_points.size() << std::endl; + + + + } + } + + /// \cond SKIP_IN_MANUAL + + /*! + Returns the solid edges and vertices present after the reconstruction + process finished. + + \details It takes two output iterators, one for storing the + isolated points and one for storing the edges of the reconstructed shape. + + + \tparam PointOutputIterator The output iterator type for storing the isolated points + + \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. + */ + template + void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { + + for (Vertex_iterator vi = m_dt.vertices_begin(); + vi != m_dt.vertices_end(); ++vi) + { + + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; + + do { + if (!m_dt.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) { + Point p = (*vi).point(); + *v_it = p; + v_it++; + } + } + } + + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) + continue; + + int index = edge.second; + Vertex_handle source = edge.first->vertex( (index+1)%3 ); + Vertex_handle target = edge.first->vertex( (index+2)%3 ); + + typename Gt::Segment_2 s(source->point(), target->point()); + *e_it = s; + e_it++; + } + + + } + /// \endcond + + + + /// \cond SKIP_IN_MANUAL + void extract_tds_output(Triangulation& rt2) { + rt2 = m_dt; + //mark vertices + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) + { + + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; + + do { + if (!rt2.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) + (*vi).set_relevance(1); + } + } + + + //mark edges + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) + { + Edge edge = *ei; + FT relevance = 0; + if (!rt2.is_ghost(edge)) { + relevance = rt2.get_edge_relevance(edge); // >= 0 + } + edge.first->relevance(edge.second) = relevance; + } + } + + + /// \endcond + /// @} + }; } From fb21f1eee37ad46b354723b52b06b450c9f768e2 Mon Sep 17 00:00:00 2001 From: pierre alliez Date: Tue, 5 May 2015 08:44:04 +0200 Subject: [PATCH 103/201] More details on reconstruction class. --- .../CGAL/Reconstruction_simplification_2.h | 42 +++++++++++++------ 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 7535c194867..df6ff910dda 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -46,16 +46,32 @@ namespace CGAL { /*! \ingroup PkgReconstructionSimplification2Classes -This class enables to reconstruct a 1-dimensional shape from a range of points with masses. -The algorithm computes a triangulation, .... and performs a simplification of the triangulation -by performing edge contractions. The edges are either processed in the order imposed by -a priority queue, or in an order based on random sampling. As the priority queue guarantees -a higher quality it is the default. The user can switch to the other method, for example -for an initial simplification round, by calling `set_random_sample_size()`. +This class provides a means to reconstruct a 1-dimensional shape from a set of 2D points with masses. +The algorithm computes an initial 2D Delaunay triangulation from the input points, +and performs a simplification of the triangulation by performing half edge collapses, edge flips +and vertex relocations. -\todo @@Pierre: In the same way discuss the other parameters and run functions. +The edges are either processed in the order imposed by an priority queue, or in an order based +on random selection of edge collapse operators. +As the exhaustive priority queue guarantees a higher quality it is the default. +The user can switch to the other method, for example for an initial simplification round, +by calling `set_random_sample_size()`. -\todo `Gt` must at least be a model of `DelaunayTriangulationTraits_2`. @@Pierre: If more functionalty is needed we should introduce a `ReconstructionSimplificationTraits_2`. +By default edge flip operators are applied to ensure that every edge of the triangulation are +candidate to be collapsed, while preserving a valid embedding of the triangulation. +This option can be disabled by calling `set_use_flip(false)` to reduce the running times. + +By default the vertices are relocated after each half edge collapse. +This option can be changed by setting the number of vertex relocations performed between +two edge contraction operators. + +The simplification is performed by calling either `run_until(n)` or `run(steps)`. +The former simplifies the triangulation until n points remain, while the latter +stops after `steps` edge collapse operators have been performed. +Furthermore, we can relocate the vertices by calling `relocate_points()`. + +\todo `Gt` must at least be a model of `DelaunayTriangulationTraits_2`. +@@Pierre: If more functionalty is needed we should introduce a `ReconstructionSimplificationTraits_2`. \tparam Gt a model of the concept `Kernel`. @@ -244,7 +260,7 @@ protected: /*! - The use_flip parameter determines whether the flipping procedure + The use_flip parameter determines whether the edge flipping procedure is used for the half-edge collapse. */ void set_use_flip(const bool use_flip) { @@ -275,7 +291,7 @@ protected: /*! - Sets the number of point relocations + Sets the number of vertex relocations that are performed between two edge collapses. */ void set_relocation(std::size_t relocation) { @@ -292,7 +308,7 @@ protected: /*! \todo @@Pierre: explain what relevance means - \param relevance The relevance level. + \param relevance The relevance threshold. */ void set_relevance(const double relevance) { m_ghost = relevance; @@ -1356,9 +1372,9 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Computes a shape, reconstructing the input, by performing `steps` many - edge contractions on the output simplex. + edge collapse operators on the output simplex. - \param steps The number of edge contractions performed by the algorithm. + \param steps The number of edge collapse operators performed by the algorithm. */ void run(const unsigned steps) { double timer = clock(); From 2ab750a83b9994d44e5eca0db55600bf4464b76f Mon Sep 17 00:00:00 2001 From: pierre alliez Date: Tue, 5 May 2015 08:50:46 +0200 Subject: [PATCH 104/201] more details on documentation of functions --- .../CGAL/Reconstruction_simplification_2.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index df6ff910dda..08b76669210 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -200,10 +200,10 @@ protected: \param point_map A `ReadablePropertyMap` used to access the input points. \param mass_map A `ReadablePropertyMap` used to access the input points' mass. - \param sample_size If `sample_size != 0`, the size of the random sample that replaces a priority queue. - \param use_flip If `true` the flipping procedure is used for the halfedge collapse. + \param sample_size If `sample_size != 0`, the size of the random sample replaces the exhaustive priority queue. + \param use_flip If `true` the edge flipping procedure is used to ensure that every edge can be made collapsible. \param relocation The number of point relocations that are performed between two edge collapses. - \param verbose controls how much console output is produced by the algorithm. The values are 0,1, or >1. + \param verbose controls how much console output is produced by the algorithm. The values are 0, 1, or > 1. */ template @@ -232,9 +232,12 @@ protected: /// \name Settting Parameters /// @{ /*! - If `sample_size == 0`, the edge collapse is done using a priority queue. - \todo @@Pierre: Tell what is a good value. - \param sample_size If `sample_size != 0`, the size of the random sample that replaces the priority queue. + If `sample_size == 0`, the simplification is performed using an exhaustive priority queue. + If `sample_size` is stricly positive the simplification is performed using a + multiple choice approach, ie, a best-choice selection in a random sample of + edge collapse operators, of size `sample_size`. A typical value for the sample + size is 15, but this value must be enlarged when targeting a very coarse simplification. + \param sample_size If `sample_size != 0`, the size of the random sample replaces the priority queue. */ void set_random_sample_size(std::size_t sample_size) { m_mchoice = mchoice; From fe80f2b816bd87834d1e2151888aab1ddf246364 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 6 May 2015 15:48:57 +0200 Subject: [PATCH 105/201] Fix tests: the constructor now takes a range as input --- .../test/Reconstruction_simplification_2/test_basic.cpp | 2 +- .../Reconstruction_simplification_2/test_flip_procedure.cpp | 2 +- .../Reconstruction_simplification_2/test_output_modules.cpp | 2 +- .../test/Reconstruction_simplification_2/test_quality.cpp | 2 +- .../test_reconstruction_until.cpp | 2 +- .../test/Reconstruction_simplification_2/test_vertex_edge.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 615271601b8..99df9de2702 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -22,7 +22,7 @@ int main () //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); - CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end()); + CGAL::Reconstruction_simplification_2 rs2(points); rs2.run(100); //100 steps diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index a386b6c444d..42b31720915 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -30,7 +30,7 @@ int main () for (int i = 1; i <= points.size();) { - CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end()); + CGAL::Reconstruction_simplification_2 rs2(points); rs2.run_until(i); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index ce4be7fdcfb..b3b9fef7afd 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -38,7 +38,7 @@ int main () //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); - Rs_2 rs2(points.begin(), points.end()); + Rs_2 rs2(points); rs2.run(100); //100 steps diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index 66a173a4601..4a36aa13833 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -37,7 +37,7 @@ int main () Mass_property_map mass_pmap; CGAL::Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + rs2(points, point_pmap, mass_pmap); rs2.run_until(9); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index 311eacc3207..9df1c0ff794 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -30,7 +30,7 @@ int main () //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); - CGAL::Reconstruction_simplification_2 rs2(points.begin(), points.end()); + CGAL::Reconstruction_simplification_2 rs2(points); rs2.run_until(9); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index f11f6a6ca85..0d0c3b237de 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -69,7 +69,7 @@ void test_edge_collapse() { Mass_property_map mass_pmap; CGAL::Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + rs2(points, point_pmap, mass_pmap); Rt_2 rt2; From dd8463814c376dca290105ea712ff6e1087d2f4d Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 6 May 2015 15:57:54 +0200 Subject: [PATCH 106/201] Added a return value to indexed_output + fixed the pmaps --- .../CGAL/Reconstruction_simplification_2.h | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 08b76669210..6e7cbcfb69b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -81,8 +81,8 @@ Furthermore, we can relocate the vertices by calling `relocate_points()`. */ template >, - class MassMap = boost::static_property_map > + class PointMap = Identity_property_map , + class MassMap = boost::static_property_map > class Reconstruction_simplification_2 { public: @@ -208,20 +208,15 @@ protected: */ template Reconstruction_simplification_2(const InputRange& input_range, - PointMap point_map = PointMap(), - MassMap mass_map = MassMap(1), - std::size_t sample_size = 0, - bool use_flip = true, - std::size_t relocation = 0, - std::size_t verbose = 0 - ) { - - - point_pmap = point_map; - mass_pmap = mass_map; - + PointMap point_map = PointMap(), + MassMap mass_map = MassMap(1), + std::size_t sample_size = 0, + bool use_flip = true, + std::size_t relocation = 0, + std::size_t verbose = 0) + : point_pmap(point_map), mass_pmap(mass_map) + { initialize_parameters(); - initialize(input_range.begin(), input_range.end()); } @@ -1466,9 +1461,12 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { template - void indexed_output(PointOutputIterator points, - IndexOutputIterator isolated_points, - IndexPairOutputIterator segments) { + CGAL::cpp11::tuple + indexed_output(PointOutputIterator points, + IndexOutputIterator isolated_points, + IndexPairOutputIterator segments) { typedef typename Gt::Segment_2 Segment; std::vector isolated_points; @@ -1527,6 +1525,8 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } + + return CGAL::cpp11::make_tuple(points, isolated_points, segments); } /// \cond SKIP_IN_MANUAL From d85af5d301cb0034596ae95e2681e4cd21476984 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Wed, 6 May 2015 18:41:07 +0200 Subject: [PATCH 107/201] details on relevance --- .../CGAL/Reconstruction_simplification_2.h | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 6e7cbcfb69b..384ecb52d53 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -304,9 +304,20 @@ protected: /*! - \todo @@Pierre: explain what relevance means - - \param relevance The relevance threshold. + \param relevance The relevance threshold used for filtering the edges. + An edge is relevant from the approximation point of view + if it is long, covers a large mass (or equivalently the + number of points when all masses are equal), and has a + small transport cost. This notion is defined as + m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, + |e| denotes its length and cost(e) its transport cost. + As the cost is defined by mass time squared distance the + relevance is unitless. + + The default value is 0, so that all edges receiving some mass + are considered relevant. + Setting a large relevance value is used to get robustness to a + large amount of outliers. */ void set_relevance(const double relevance) { m_ghost = relevance; @@ -1450,13 +1461,13 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Writes the points and segments of the output simplex in an indexed format into output iterators. - \tparam PointOutputIterator An output iterator with value type `Point`. + \tparam PointOutputIterator An output iterator with value type `Point`. \tparam IndexOutputIterator An output iterator with value type `std::size_t` \tparam IndexPairOutputIterator An output iterator with value type `std::pair` - \param points the output iterator for all points - \param isolated_points the output iterator for the indices of isolated points - \param segments the output iterator for the pairs of indices of segments + \param points The output iterator for all points + \param isolated_points The output iterator for the indices of isolated points + \param segments The output iterator for the pairs of segment indices */ template edge_vertices; for (typename std::vector::iterator it = edges.begin(); it != edges.end(); it++) { @@ -1521,12 +1532,9 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { os << "2 " << pos_a + isolated_points.size() << " " << pos_b + isolated_points.size() << std::endl; - - - } - return CGAL::cpp11::make_tuple(points, isolated_points, segments); + return CGAL::cpp11::make_tuple(points, isolated_points, segments); } /// \cond SKIP_IN_MANUAL From 02c197027cf1d8c648f65f1896c61b6d5696cc64 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 16:33:57 +0200 Subject: [PATCH 108/201] Updated indexed_output so that it works with the new parameters + fix warnings --- .../CGAL/Reconstruction_simplification_2.h | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 384ecb52d53..e187cbe3f15 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -425,7 +425,7 @@ protected: double timer = clock(); std::cerr << yellow << "insert loose bbox" << white << "..."; - int nb = m_dt.number_of_vertices(); + int nb = static_cast(m_dt.number_of_vertices()); insert_point(Point(x - size, y - size), true, nb++); insert_point(Point(x - size, y + size), true, nb++); insert_point(Point(x + size, y + size), true, nb++); @@ -441,7 +441,7 @@ protected: double timer = clock(); std::cerr << yellow << "init" << white << "..."; - int nb = m_dt.number_of_vertices(); + int nb = static_cast(m_dt.number_of_vertices()); m_dt.infinite_vertex()->pinned() = true; for (Iterator it = begin; it != beyond; it++) { Point point = get(point_pmap, *it); @@ -1480,11 +1480,11 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { IndexPairOutputIterator segments) { typedef typename Gt::Segment_2 Segment; - std::vector isolated_points; + std::vector isolated_points_; std::vector edges; - extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); - + extract_list_output( + std::back_inserter(isolated_points_), std::back_inserter(edges)); // vertices_of_edges std::set edge_vertices; @@ -1498,40 +1498,35 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { edge_vertices.insert(b); } - os << "OFF " << isolated_points.size() + edge_vertices.size() << - " 0 " << edges.size() << std::endl; - - for (typename std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - os << *it << std::endl; - } - + std::size_t count_points = 0; for (typename std::set::iterator it = edge_vertices.begin(); it != edge_vertices.end(); it++) { - os << *it << std::endl; + *points++ = *it; + ++count_points; } - for (int i = 0; i < isolated_points.size(); i++) { - os << "1 " << i << std::endl; + for (typename std::vector::iterator it = isolated_points_.begin(); + it != isolated_points_.end(); it++) { + + *isolated_points++ = count_points; + *points++ = *it; + ++count_points; } for (typename std::vector::iterator it = edges.begin(); it != edges.end(); it++) { - //save_one_edge(os, *it,edge_vertices); - - Point a = (*it).source(); - Point b = (*it).target(); + Point const& a = it->source(); + Point const& b = it->target(); typename std::set::iterator it_a = edge_vertices.find(a); typename std::set::iterator it_b = edge_vertices.find(b); - int pos_a = std::distance(edge_vertices.begin(), it_a); - int pos_b = std::distance(edge_vertices.begin(), it_b); + std::size_t pos_a = std::distance(edge_vertices.begin(), it_a); + std::size_t pos_b = std::distance(edge_vertices.begin(), it_b); - os << "2 " << pos_a + isolated_points.size() << " " - << pos_b + isolated_points.size() << std::endl; + *segments++ = std::make_pair(pos_a, pos_b); } return CGAL::cpp11::make_tuple(points, isolated_points, segments); From b2c22486ad7b45e021db4bf67fefa785d058d808 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 16:34:17 +0200 Subject: [PATCH 109/201] Use CGAL::Random --- .../include/CGAL/Reconstruction_triangulation_2.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 0b6a3247a6a..b44c4f09442 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -31,6 +31,7 @@ // CGAL #include +#include #include #include @@ -163,13 +164,14 @@ public: } Edge random_finite_edge() { - int nbf = Base::number_of_faces(); - int offset = random_int(0, nbf - 1); + static CGAL::Random rng; + std::size_t nbf = Base::number_of_faces(); + int offset = rng.get_int(0, static_cast(nbf - 1)); Finite_faces_iterator fi = Base::finite_faces_begin(); for (int i = 0; i < offset; i++) fi++; Face_handle face = fi; - int index = random_int(0, 40) % 3; + int index = rng.get_int(0, 40) % 3; return Edge(face, index); } @@ -1078,12 +1080,6 @@ public: return true; } - - int random_int(const int min, const int max) { - int range = max - min; - return min + int((double(rand()) / double(RAND_MAX)) * range); - } - }; } //namespace CGAL From a18fd08cbdff23be2ac80106a185c3cc5eb6b5e1 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 16:34:39 +0200 Subject: [PATCH 110/201] Rewrite test_index_output() --- .../test_output_modules.cpp | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index b3b9fef7afd..3970f46c5d8 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -50,35 +50,54 @@ int main () void test_index_output(Rs_2& rs2) { - std::cout <<"(-------------Off OUTPUT---------- )" << std::endl; + std::cout <<"(-------------OFF OUTPUT---------- )" << std::endl; + + std::vector points; + std::vector isolated_points; + std::vector > edges; + rs2.indexed_output( + std::back_inserter(points), + std::back_inserter(isolated_points), + std::back_inserter(edges)); + + std::stringstream sstr; - rs2.extract_index_output(std::cout); + sstr << "OFF " << points.size() << + " 0 " << edges.size() << std::endl; + + for (std::vector::iterator it = points.begin(); + it != points.end(); it++) { + + sstr << *it << std::endl; + } + + for (std::vector >::iterator it + = edges.begin(); + it != edges.end(); it++) { + + sstr << "2 " << it->first << " " << it->second << std::endl; + } + + std::cout << sstr.str() << std::endl; //print //test cardinalities - std::ostringstream buffer; - rs2.extract_index_output(buffer); - std::stringstream stream(buffer.str()); std::vector res; while (1){ std::string line; - std::getline(stream,line); - if (!stream.good()) + std::getline(sstr, line); + if (!sstr.good()) break; res.push_back(line); } - assert(res.size() == 110); + assert(res.size() == 92); assert(res.front() == "OFF 60 0 31"); - for (int i = 61; i < 79; i++) { - assert(res[i].substr(0,2) == "1 "); - } - - for (int i = 79; i < 110; i++) { + for (int i = 61; i < 92; i++) { assert(res[i].substr(0,2) == "2 "); } } From b573c0be4b414ee5501879ac5ae86919c0472094 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 16:40:26 +0200 Subject: [PATCH 111/201] Fix warnings --- .../include/CGAL/Reconstruction_simplification_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index e187cbe3f15..69051761b65 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1312,8 +1312,8 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { /*! Returns the number of vertices present in the reconstructed triangulation. */ - int number_of_vertices() { - return m_dt.number_of_vertices()-4 ; + std::size_t number_of_vertices() { + return m_dt.number_of_vertices() - 4; } @@ -1364,8 +1364,8 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { double timer = clock(); std::cerr << yellow << "reconstruct until " << white << np << " V"; - unsigned N = np + 4; - unsigned performed = 0; + std::size_t N = np + 4; + std::size_t performed = 0; while (m_dt.number_of_vertices() > N) { bool ok = decimate(); if (!ok) From 42717f90f6676d5148bef0dc62e255ce462d1ecd Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 17:27:22 +0200 Subject: [PATCH 112/201] Fix demo --- .../Reconstruction_simplification_2/CMakeLists.txt | 4 ++++ .../Reconstruction_simplification_kerneled_2.h | 9 +++++---- .../Reconstruction_simplification_2/dialog_options.h | 4 ++-- .../demo/Reconstruction_simplification_2/render.cpp | 2 +- .../demo/Reconstruction_simplification_2/scene.h | 10 +++++----- .../demo/Reconstruction_simplification_2/window.cpp | 6 +++--- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt index 2a508cabf9c..92d3286d89b 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt @@ -8,6 +8,10 @@ cmake_policy(VERSION 2.4.5) set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + ############ # Packages # ############ diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h index 294933bfa81..257105e7ca8 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -34,10 +34,11 @@ class Reconstruction_simplification_kerneled_2: public Reconstruction_simplification_2 { public: - - Reconstruction_simplification_kerneled_2(InputIterator start, - InputIterator beyond, Point_property_map point_pmap, Mass_property_map mass_pmap) : - Reconstruction_simplification_2(start, beyond, point_pmap, + + template + Reconstruction_simplification_kerneled_2(const InputRange& input_range, + Point_property_map point_pmap, Mass_property_map mass_pmap) : + Reconstruction_simplification_2(input_range, point_pmap, mass_pmap) { } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h index e0640378d2e..aad065c680a 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h @@ -29,7 +29,7 @@ public: void set_verbose(int verbose) { verbose_spinbox->setValue(verbose); } int get_mchoice() const { return mchoice_spinbox->value(); } - void set_mchoice(const int mchoice) { mchoice_spinbox->setValue(mchoice); } + void set_random_sample_size(const int mchoice) { mchoice_spinbox->setValue(mchoice); } double get_percent() const { return percent_spinbox->value(); } void set_percent(const double percent) { percent_spinbox->setValue(percent); } @@ -49,7 +49,7 @@ public: } double get_ghost() const { return ghost_spinbox->value(); } - void set_ghost(double ghost) { ghost_spinbox->setValue(ghost); } + void set_relevance(double ghost) { ghost_spinbox->setValue(ghost); } bool get_use_flip() const { return use_flip_checkbox->isChecked(); } void set_use_flip(const bool flip) { diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 45c92b3c1a8..3cc58be3788 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -243,7 +243,7 @@ void R_s_k_2::draw_pedges(const float line_width) } if (min_value == max_value) max_value += 1.0; - unsigned N = values.size(); + std::size_t N = values.size(); for (unsigned i = 0; i < N; ++i) draw_one_pedge(edges[i], values[i], min_value, max_value, line_width); diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 894f0a014a7..fcecb5717b3 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -551,13 +551,13 @@ public: const double ghost) { m_pwsrec->set_verbose(verbose); - m_pwsrec->set_mchoice(mchoice); + m_pwsrec->set_random_sample_size(mchoice); m_pwsrec->set_use_flip(use_flip); m_pwsrec->set_alpha(alpha); m_pwsrec->set_tang_tol(tang_tol * m_bbox_size); m_pwsrec->set_norm_tol(norm_tol * m_bbox_size); m_pwsrec->set_relocation(relocation); - m_pwsrec->set_ghost(ghost); + m_pwsrec->set_relevance(ghost); } bool init_reconstruction(const double percentage) { @@ -649,9 +649,9 @@ public: m_pwsrec->run(steps); } - void relocate_all_vertices() { - std::cout << "relocate_all_vertices" << std::endl; - m_pwsrec->relocate_all_vertices(); + void relocate_all_points() { + std::cout << "relocate_all_points" << std::endl; + m_pwsrec->relocate_all_points(); } void print_stats() { diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp index 5c4fd392797..3d253bc40f4 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp @@ -583,7 +583,7 @@ void MainWindow::on_actionReconstruction_until_triggered() void MainWindow::on_actionRelocate_vertices_triggered() { QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->relocate_all_vertices(); + m_scene->relocate_all_points(); QApplication::restoreOverrideCursor(); update(); } @@ -686,13 +686,13 @@ void MainWindow::on_actionSet_parameters_triggered() Dialog_options dlg; dlg.set_all_ranges(); dlg.set_verbose(m_verbose); - dlg.set_mchoice(m_mchoice); + dlg.set_random_sample_size(m_mchoice); dlg.set_percent(m_percent); dlg.set_norm_tol(m_norm_tol); dlg.set_tang_tol(m_tang_tol); dlg.set_alpha(m_alpha); dlg.set_relocation(m_relocation); - dlg.set_ghost(m_ghost); + dlg.set_relevance(m_ghost); dlg.set_use_flip(m_use_flip); dlg.set_line_thickness(viewer->line_thickness()); dlg.set_point_size(viewer->point_size()); From 79ef0fee13d4c86fd83ddbe7f4d9c3e98b882276 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 17:27:51 +0200 Subject: [PATCH 113/201] Fix example --- ...uction_simplification_2_output_example.cpp | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 28d768408d9..c2c23768b1b 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -34,7 +34,8 @@ void list_output(Rs_2& rs2) std::vector isolated_vertices; std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); + rs2.extract_list_output( + std::back_inserter(isolated_vertices), std::back_inserter(edges)); for (std::vector::iterator vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) { @@ -52,7 +53,28 @@ void index_output(Rs_2& rs2) { std::cout << "(-------------Off output---------- )" << std::endl; - rs2.extract_index_output(std::cout); + std::vector points; + std::vector isolated_points; + std::vector > edges; + + rs2.indexed_output( + std::back_inserter(points), + std::back_inserter(isolated_points), + std::back_inserter(edges)); + + std::cout << "OFF " << points.size() << + " 0 " << edges.size() << std::endl; + + for (std::vector::iterator it = points.begin(); + it != points.end(); it++) { + std::cout << *it << std::endl; + } + + for (std::vector >::iterator it + = edges.begin(); + it != edges.end(); it++) { + std::cout << "2 " << it->first << " " << it->second << std::endl; + } } int main () From 83f67d2a68fd6ad29e11ac054d5f454017c6805d Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 20 May 2015 17:28:25 +0200 Subject: [PATCH 114/201] Forgot to change variable name --- .../include/CGAL/Reconstruction_simplification_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 69051761b65..f38a3213def 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -235,7 +235,7 @@ protected: \param sample_size If `sample_size != 0`, the size of the random sample replaces the priority queue. */ void set_random_sample_size(std::size_t sample_size) { - m_mchoice = mchoice; + m_mchoice = sample_size; } /*! From 767c5f7a0f5c65aef8f172c28eb03045a3756ace Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 3 Jun 2015 09:28:10 +0200 Subject: [PATCH 115/201] Fix tabs --- ...nstruction_simplification_2_output_example.cpp | 6 +++--- .../reconstruction_simplification_2_example.cpp | 15 ++++++++------- ...struction_simplification_2_no_mass_example.cpp | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index c2c23768b1b..3a93a51e2fc 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -1,8 +1,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -13,7 +13,7 @@ typedef K::Segment_2 Segment; typedef K::FT FT; -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; void load_xy_file(const std::string& filename, std::list& points) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index ea42292f9a5..1f0e1a15dda 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -1,8 +1,8 @@ #include #include -#include -#include +#include +#include #include #include #include // std::pair @@ -16,13 +16,14 @@ typedef K::Segment_2 Segment; typedef K::FT FT; -typedef std::pair PointMassPair; -typedef std::list PointMassList; +typedef std::pair PointMassPair; +typedef std::list PointMassList; -typedef CGAL::First_of_pair_property_map Point_property_map; -typedef CGAL::Second_of_pair_property_map Mass_property_map; +typedef CGAL::First_of_pair_property_map Point_property_map; +typedef CGAL::Second_of_pair_property_map Mass_property_map; -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2< + K, Point_property_map, Mass_property_map> Rs_2; void load_xy_file(const std::string& fileName, PointMassList& points) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp index 86a4a64d172..3df1390b2d1 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -4,8 +4,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -16,7 +16,7 @@ typedef K::Segment_2 Segment; typedef K::FT FT; -typedef CGAL::Reconstruction_simplification_2 Rs_2; +typedef CGAL::Reconstruction_simplification_2 Rs_2; void load_xy_file(const std::string& fileName, std::list& points) From 11427bbd06235cbdb0e92e94314f5682fb5c84c1 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 3 Jun 2015 10:15:34 +0200 Subject: [PATCH 116/201] Remove repetitive sentence + tabs --- .../Reconstruction_Simplification_2.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 8f4a9334b21..e6b0d41690d 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -45,7 +45,7 @@ The transportation plan is approximated by assigning each input point temporaril -While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a framework based on optimal transport of measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. +While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a framework based on optimal transport of measures. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. \section Reconstruction_simplification_2Trans Optimal Transport Formulation @@ -85,18 +85,16 @@ exposed to the user is the Reconstruction_simplification_2 class. \code{.cpp} /* -K : a geometric kernel, used for the reconstruction and simplification task. - -input. -Point_property_map : a PropertyMap for accessing the input points. -Mass_property_map : a PropertyMap for accessing the input points' measures. +K : a geometric kernel, used for the reconstruction and simplification task. +Point_property_map : a PropertyMap for accessing the input points. +Mass_property_map : a PropertyMap for accessing the input points' measures. */ Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); + rs2(points.begin(), points.end(), point_pmap, mass_pmap); - rs2.run(100); // perform 100 contraction steps +rs2.run(100); // perform 100 contraction steps \endcode Alternatively to calling the reconstruction module using From 840456a49cae6dbc5c75f59c8ea258d7c1f32507 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 3 Jun 2015 11:09:20 +0200 Subject: [PATCH 118/201] Load from image: do not add 0-mass points pour white pixels --- .../demo/Reconstruction_simplification_2/scene.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index fcecb5717b3..bab583d69cf 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -358,7 +358,8 @@ public: float mass = 1.0f - grayscale.atXY(i, j); double x = double(i) / grayscale.width(); double y = 1.0 - double(j) / grayscale.height(); - add_sample(Point(x, y), mass); + if (mass > 0.f) + add_sample(Point(x, y), mass); } } std::cerr << "done (" << m_samples.size() << ")" << std::endl; @@ -574,8 +575,6 @@ public: PointMassList point_mass_list; Sample_list_const_iterator it; for (it = vertices.begin(); it != vertices.end(); it++) { - std::cout << "Sample in Scene " << (*it)->point() << " : " - << (*it)->mass() << std::endl; point_mass_list.push_back( std::make_pair((*it)->point(), (*it)->mass())); } From b69d4a3b2401eab86e61789cc0a34ba202c1fae4 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Wed, 3 Jun 2015 11:32:04 +0200 Subject: [PATCH 119/201] comment removed --- .../demo/Reconstruction_simplification_2/render.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 3cc58be3788..93f90d538f9 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -72,8 +72,7 @@ void R_s_k_2::draw_face(Face_handle face) ::glEnd(); } -void R_s_k_2:: - draw_edge_with_arrow(const Point& s, const Point& t) +void R_s_k_2::draw_edge_with_arrow(const Point& s, const Point& t) { Vector vec = t - s; Vector vec90(-vec.y(),vec.x()); @@ -92,8 +91,7 @@ void R_s_k_2:: ::glEnd(); } -void R_s_k_2:: - draw_vertices(const float point_size, +void R_s_k_2::draw_vertices(const float point_size, const float red, const float green, const float blue) @@ -135,8 +133,7 @@ void R_s_k_2::draw_edges(const float line_width, } } -void R_s_k_2:: -draw_footpoints(const float line_width, +void R_s_k_2::draw_footpoints(const float line_width, const float red, const float green, const float blue) @@ -541,7 +538,6 @@ void R_s_k_2::draw_mesh_one_ring(const float point_size, ::glLineWidth(2.0f*line_width); ::glColor3f(0., 0., 1.); - //draw_edge(edge); draw_edge_with_arrow(s->point(), t->point()); ::glPointSize(0.5*point_size); @@ -941,6 +937,5 @@ void R_s_k_2::save_one_edge(std::ofstream& ofs, const Edge& edge) Face_handle face = edge.first; Point a = face->vertex((i+1)%3)->point(); Point b = face->vertex((i+2)%3)->point(); - //TODO: IV COMMNT IN AGAIN -// ofs << a << " " << b << std::endl; + ofs << a << " " << b << std::endl; } From d09347297e3c37d7453fb73320bf47c336a73813 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Sun, 7 Jun 2015 16:52:59 +0200 Subject: [PATCH 121/201] formatting --- ...uction_simplification_2_output_example.cpp | 34 ++++++++----------- ...econstruction_simplification_2_example.cpp | 23 ++++++------- ...ction_simplification_2_no_mass_example.cpp | 18 +++++----- 3 files changed, 34 insertions(+), 41 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index 3a93a51e2fc..cde33685c2c 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -20,9 +20,9 @@ void load_xy_file(const std::string& filename, std::list& points) { std::ifstream ifs(filename); Point point; - while (ifs >> point){ + while (ifs >> point) points.push_back(point); - } + ifs.close(); } @@ -37,15 +37,13 @@ void list_output(Rs_2& rs2) rs2.extract_list_output( std::back_inserter(isolated_vertices), std::back_inserter(edges)); - for (std::vector::iterator vit = isolated_vertices.begin(); - vit != isolated_vertices.end(); vit++) { + std::vector::iterator vit; + for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) std::cout << *vit << std::endl; - } - for (std::vector::iterator eit = edges.begin(); - eit != edges.end(); eit++) { + std::vector::iterator eit; + for (eit = edges.begin(); eit != edges.end(); eit++) std::cout << *eit << std::endl; - } } @@ -62,24 +60,19 @@ void index_output(Rs_2& rs2) std::back_inserter(isolated_points), std::back_inserter(edges)); - std::cout << "OFF " << points.size() << - " 0 " << edges.size() << std::endl; + std::cout << "OFF " << points.size() << " 0 " << edges.size() << std::endl; - for (std::vector::iterator it = points.begin(); - it != points.end(); it++) { - std::cout << *it << std::endl; - } + std::vector::iterator pit; + for (pit = points.begin(); pit != points.end(); pit++) + std::cout << *pit << std::endl; - for (std::vector >::iterator it - = edges.begin(); - it != edges.end(); it++) { - std::cout << "2 " << it->first << " " << it->second << std::endl; - } + std::vector >::iterator eit; + for (eit = edges.begin(); eit != edges.end(); eit++) + std::cout << "2 " << eit->first << " " << eit->second << std::endl; } int main () { - std::list points; load_xy_file("data/stair-noise00.xy", points); @@ -90,5 +83,6 @@ int main () list_output(rs2); index_output(rs2); + return 0; } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 1f0e1a15dda..19b2eedb27d 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -30,10 +30,10 @@ void load_xy_file(const std::string& fileName, PointMassList& points) { std::ifstream ifs(fileName); Point point; - unsigned int nb = 0; - while (ifs >> point){ - points.push_back(std::make_pair(point, 1)); - } + + while (ifs >> point) + points.push_back(std::make_pair(point, 1)); + ifs.close(); } @@ -56,15 +56,14 @@ int main () rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); std::cerr << "Isolated vertices" << std::endl; - for (std::vector::iterator vit = isolated_vertices.begin(); - vit != isolated_vertices.end(); vit++) { - std::cout << *vit << std::endl; - } + std::vector::iterator vit; + for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) + std::cout << *vit << std::endl; std::cerr << "Edges" << std::endl; - for (std::vector::iterator eit = edges.begin(); - eit != edges.end(); eit++) { - std::cout << *eit << std::endl; - } + std::vector::iterator eit; + for (eit = edges.begin(); eit != edges.end(); eit++) + std::cout << *eit << std::endl; + return 0; } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp index 3df1390b2d1..b306776ee45 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -22,10 +22,11 @@ typedef CGAL::Reconstruction_simplification_2 Rs_2; void load_xy_file(const std::string& fileName, std::list& points) { std::ifstream ifs(fileName); + Point point; - while (ifs >> point){ + while (ifs >> point) points.push_back(point); - } + ifs.close(); } @@ -44,15 +45,14 @@ int main () rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); std::cerr << "Isolated vertices" << std::endl; - for (std::vector::iterator vit = isolated_vertices.begin(); - vit != isolated_vertices.end(); vit++) { - std::cout << *vit << std::endl; - } + std::vector::iterator vit; + for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) + std::cout << *vit << std::endl; std::cerr << "Edges" << std::endl; - for (std::vector::iterator eit = edges.begin(); - eit != edges.end(); eit++) { + std::vector::iterator eit; + for (eit = edges.begin(); eit != edges.end(); eit++) std::cout << *eit << std::endl; - } + return 0; } From a376c2a275a6f54b28d889acdee312ec32196ca1 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Sun, 7 Jun 2015 16:54:27 +0200 Subject: [PATCH 122/201] comment removed --- Reconstruction_simplification_2/include/CGAL/Sample.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Sample.h b/Reconstruction_simplification_2/include/CGAL/Sample.h index 8dff82a774b..b0612c2eca1 100644 --- a/Reconstruction_simplification_2/include/CGAL/Sample.h +++ b/Reconstruction_simplification_2/include/CGAL/Sample.h @@ -131,7 +131,6 @@ public: }; -//TODO: IV: What is the correct place for this struct? template struct greater_priority { From 5f1194c0f906222114fad8e2efc848100915cd9f Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Sun, 7 Jun 2015 17:12:59 +0200 Subject: [PATCH 123/201] use terms vertices/edges for indexed output --- ...uction_simplification_2_output_example.cpp | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp index cde33685c2c..6731f403c48 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp @@ -31,19 +31,19 @@ void list_output(Rs_2& rs2) { std::cout << "(-------------List output---------- )" << std::endl; - std::vector isolated_vertices; - std::vector edges; + std::vector isolated_points; + std::vector segments; rs2.extract_list_output( - std::back_inserter(isolated_vertices), std::back_inserter(edges)); + std::back_inserter(isolated_points), std::back_inserter(segments)); - std::vector::iterator vit; - for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) - std::cout << *vit << std::endl; + std::vector::iterator pit; + for (pit = isolated_points.begin(); pit != isolated_points.end(); pit++) + std::cout << *pit << std::endl; - std::vector::iterator eit; - for (eit = edges.begin(); eit != edges.end(); eit++) - std::cout << *eit << std::endl; + std::vector::iterator sit; + for (sit = segments.begin(); sit != segments.end(); sit++) + std::cout << *sit << std::endl; } @@ -52,20 +52,27 @@ void index_output(Rs_2& rs2) std::cout << "(-------------Off output---------- )" << std::endl; std::vector points; - std::vector isolated_points; + std::vector isolated_vertices; std::vector > edges; rs2.indexed_output( std::back_inserter(points), - std::back_inserter(isolated_points), + std::back_inserter(isolated_vertices), std::back_inserter(edges)); std::cout << "OFF " << points.size() << " 0 " << edges.size() << std::endl; + // points std::vector::iterator pit; for (pit = points.begin(); pit != points.end(); pit++) std::cout << *pit << std::endl; + // isolated vertices + std::vector::iterator vit; + for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) + std::cout << "1 " << *vit << std::endl; + + // edges std::vector >::iterator eit; for (eit = edges.begin(); eit != edges.end(); eit++) std::cout << "2 " << eit->first << " " << eit->second << std::endl; From 9ff9e417dc24ae98aabb9daebee4452a1449dbc1 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Sun, 7 Jun 2015 17:16:58 +0200 Subject: [PATCH 124/201] output format --- .../Reconstruction_simplification_2/PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 084f4d28afe..3084ae11df6 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -10,7 +10,7 @@ \cgalPkgPicture{overview.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clément Jamin} -\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape from a point set in the plane, possibly hampered by noise and outliers. It generates as output a simplicial complex, made up of points and segments, which approximates the input point set in a fine-to-coarse manner.} +\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape from a point set in the plane, possibly hampered by noise and outliers. It generates as output a set of line segments and isolated points, which approximate the input point set.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index e6b0d41690d..f4acb441626 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -9,8 +9,7 @@ namespace CGAL { \section Reconstruction_simplification_2Introduction Introduction - -This package implements methods to reconstruct and simplify 2D point sets. The input is a noisy 2D point set and the output is a set of line segments and points which approximate the input shape, where the input points were sampled from as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. +This package implements methods to reconstruct and simplify 2D point sets. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. \cgalFigureBegin{2D_Reconstruction_Simplification_overview,summary.png} @@ -131,8 +130,7 @@ points and the edges of the reconstructed shape are extracted and printed to the \subsubsection Reconstruction_simplification_2Output Output Example -The result of the reconstuction can be obtained in two ways. Either as sequence of isolated points and segments. -Or as a sequence of points and pairs of indices for describing the segments. +The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of segments is encoded. The indexed format records a list of points, then pairs of point indices in the list for the edges, and point indices for isolated vertices. \cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} From 75ba51537ab5eddce001792cf1a241f9631e1917 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Sun, 7 Jun 2015 18:06:59 +0200 Subject: [PATCH 125/201] three examples --- .../Reconstruction_Simplification_2.txt | 45 +++-- .../data/stair.xy | 160 ++++++++++++++++++ .../data/stair.xym | 160 ++++++++++++++++++ ...econstruction_simplification_2_example.cpp | 14 +- ...ction_simplification_2_no_mass_example.cpp | 17 +- 5 files changed, 350 insertions(+), 46 deletions(-) create mode 100755 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy create mode 100644 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xym diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index f4acb441626..870bba35153 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -11,11 +11,27 @@ namespace CGAL { This package implements methods to reconstruct and simplify 2D point sets. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. - \cgalFigureBegin{2D_Reconstruction_Simplification_overview,summary.png} Left: input point set hampered by noise. Right: The corresponding reconstructed shape consisting of line segments. \cgalFigureEnd +\subsection Reconstruction_simplification_2Examples Simplest Example +The following example first reads a set of input points from an ASCII file. The points, with no mass attribute, are passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp} + +\subsubsection Reconstruction_simplification_2Output Output Example +The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of segments is encoded. The indexed format records a list of points, then pairs of point indices in the list for the edges, and point indices for isolated vertices. +\cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} + +\subsection Reconstruction_simplification_2Examples Example with mass attributes +The following example first reads a set of input points and masses from an ASCII file. Using two property maps, +the points and their initial mass are passed to the Reconstruction_simplification_2 object. +After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the segments and isolated points of the reconstructed shape are extracted and printed to the console. +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} + + + + @@ -77,8 +93,7 @@ A noisy skyline on the left, and the relocated vertices on the right. \section Reconstruction_simplification_2API API -The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class -exposed to the user is the Reconstruction_simplification_2 class. +The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. \subsection Reconstruction_simplification_2Sample Sample Call @@ -86,7 +101,7 @@ exposed to the user is the Reconstruction_simplification_2 class. /* K : a geometric kernel, used for the reconstruction and simplification task. Point_property_map : a PropertyMap for accessing the input points. -Mass_property_map : a PropertyMap for accessing the input points' measures. +Mass_property_map : a PropertyMap for accessing the input points' masses. */ @@ -108,33 +123,13 @@ one can use the run_until function and specify the number of output vertices one wants to keep as illustrated in the following picture. \cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} -Examples of 20 vertex reconstructions from images consisting of 2000, 400 and 200 input points respectively. The example shows nicely -how the algorithm is sensitiv to the input density in that it gracefully degrades the reconstruction as the density decreases. +Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and 200 input points respectively. The examples illustrates the behavior of the algorithm when the input point density decreases. \cgalFigureEnd -\subsection Reconstruction_simplification_2Examples Example -The following example shows a simple use case of the Reconstruction_simplification_2 package. -It works by first reading a collection of input points from an xy-file. Using two property maps, -the points and their optional initial mass are passed to the Reconstruction_simplification_2 object. -After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the isolated -points and the edges of the reconstructed shape are extracted and printed to the console using the List_output model. - - - -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} - - -\subsubsection Reconstruction_simplification_2Output Output Example - -The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of segments is encoded. The indexed format records a list of points, then pairs of point indices in the list for the edges, and point indices for isolated vertices. - -\cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} - - */ } /* namespace CGAL */ diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy new file mode 100755 index 00000000000..3d6f2434d85 --- /dev/null +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy @@ -0,0 +1,160 @@ +0.00605396 0.00360027 +0.0117095 0.00496933 +0.00292489 -0.0056444 +0.018654 -0.00345866 +0.0208731 -0.00712699 +0.0349622 0.00520127 +0.0226514 0.00273598 +0.0443469 0.00641652 +0.0320264 -0.00785089 +0.0536853 -0.00492172 +0.0477706 0.00445479 +0.0639807 0.00509629 +0.0673864 -0.000544755 +0.068878 0.00636891 +0.0786834 -0.00880306 +0.0838299 0.00977294 +0.087326 -0.0021897 +0.079062 0.000772423 +0.0984893 0.00905454 +0.0994487 -0.00770074 +0.100736 0.00717826 +0.0994229 0.00250389 +0.100252 0.0167278 +0.0960604 0.00802011 +0.103545 0.0289233 +0.108446 0.0183656 +0.106763 0.0262313 +0.106452 0.0420934 +0.0997256 0.0427598 +0.107064 0.0403298 +0.0928101 0.0560955 +0.10136 0.0583232 +0.104819 0.0562105 +0.0902899 0.0706163 +0.10994 0.0770702 +0.0923621 0.0704878 +0.0919434 0.0865538 +0.0963674 0.0842679 +0.103725 0.0803259 +0.102273 0.101166 +0.100319 0.0952791 +0.108403 0.0942299 +0.113529 0.0981625 +0.108027 0.103066 +0.126272 0.0950435 +0.133506 0.0939314 +0.124776 0.107205 +0.131076 0.107853 +0.136759 0.109119 +0.15444 0.102357 +0.143707 0.104111 +0.160272 0.0974776 +0.165379 0.103348 +0.173751 0.0916309 +0.174657 0.0937715 +0.167267 0.0980068 +0.170889 0.0905988 +0.185414 0.102092 +0.189813 0.10002 +0.199397 0.0909473 +0.198222 0.107717 +0.198974 0.099872 +0.201479 0.108827 +0.205074 0.107075 +0.202 0.124977 +0.191185 0.121976 +0.206848 0.134009 +0.196679 0.137767 +0.19255 0.148035 +0.190151 0.143856 +0.195263 0.155428 +0.20595 0.148822 +0.204421 0.152387 +0.191967 0.169495 +0.197981 0.169699 +0.191872 0.176798 +0.207398 0.170317 +0.194859 0.178978 +0.190444 0.183389 +0.196073 0.192833 +0.200019 0.190352 +0.205824 0.198579 +0.217043 0.198723 +0.210708 0.208976 +0.225591 0.209213 +0.224774 0.208331 +0.228376 0.201784 +0.233852 0.192014 +0.230703 0.196273 +0.241172 0.192107 +0.241027 0.203219 +0.257393 0.199803 +0.266244 0.190504 +0.263176 0.1902 +0.279822 0.191442 +0.267419 0.200092 +0.270919 0.209937 +0.294279 0.199399 +0.292596 0.208336 +0.302111 0.206854 +0.297261 0.193606 +0.302447 0.195568 +0.307461 0.217454 +0.302133 0.219113 +0.300152 0.216012 +0.296763 0.223723 +0.302571 0.234727 +0.298522 0.237272 +0.307834 0.234066 +0.296568 0.250613 +0.298385 0.251664 +0.29308 0.261943 +0.295426 0.266549 +0.293096 0.259791 +0.292439 0.271056 +0.291263 0.275271 +0.300944 0.286063 +0.308624 0.284206 +0.306603 0.285177 +0.302574 0.289769 +0.303807 0.303483 +0.308102 0.301263 +0.316854 0.306492 +0.313448 0.299638 +0.325862 0.304911 +0.328301 0.305416 +0.335535 0.300855 +0.327652 0.299601 +0.334895 0.301131 +0.339451 0.303238 +0.356128 0.293215 +0.359167 0.306227 +0.350648 0.309557 +0.359385 0.291005 +0.360515 0.305818 +0.377582 0.301763 +0.373333 0.308693 +0.375172 0.299768 +0.398744 0.298911 +0.390985 0.295462 +0.39465 0.305079 +0.397266 0.302934 +0.391293 0.303944 +0.401355 0.307406 +0.391301 0.312749 +0.401141 0.331346 +0.403843 0.339273 +0.397447 0.32984 +0.401007 0.345187 +0.401435 0.350856 +0.404534 0.358367 +0.40019 0.350997 +0.401021 0.359769 +0.398586 0.362409 +0.403735 0.370503 +0.400571 0.381428 +0.409145 0.374727 +0.402981 0.379619 +0.406312 0.38398 +0.405032 0.387826 diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xym b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xym new file mode 100644 index 00000000000..f78a3acdf6b --- /dev/null +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xym @@ -0,0 +1,160 @@ +0.00605396 0.00360027 1.0 +0.0117095 0.00496933 1.0 +0.00292489 -0.0056444 1.0 +0.018654 -0.00345866 1.0 +0.0208731 -0.00712699 1.0 +0.0349622 0.00520127 1.0 +0.0226514 0.00273598 1.0 +0.0443469 0.00641652 1.0 +0.0320264 -0.00785089 1.0 +0.0536853 -0.00492172 1.0 +0.0477706 0.00445479 1.0 +0.0639807 0.00509629 1.0 +0.0673864 -0.000544755 1.0 +0.068878 0.00636891 1.0 +0.0786834 -0.00880306 1.0 +0.0838299 0.00977294 1.0 +0.087326 -0.0021897 1.0 +0.079062 0.000772423 1.0 +0.0984893 0.00905454 1.0 +0.0994487 -0.00770074 1.0 +0.100736 0.00717826 1.0 +0.0994229 0.00250389 1.0 +0.100252 0.0167278 1.0 +0.0960604 0.00802011 1.0 +0.103545 0.0289233 1.0 +0.108446 0.0183656 1.0 +0.106763 0.0262313 1.0 +0.106452 0.0420934 1.0 +0.0997256 0.0427598 1.0 +0.107064 0.0403298 1.0 +0.0928101 0.0560955 1.0 +0.10136 0.0583232 1.0 +0.104819 0.0562105 1.0 +0.0902899 0.0706163 1.0 +0.10994 0.0770702 1.0 +0.0923621 0.0704878 1.0 +0.0919434 0.0865538 1.0 +0.0963674 0.0842679 1.0 +0.103725 0.0803259 1.0 +0.102273 0.101166 1.0 +0.100319 0.0952791 1.0 +0.108403 0.0942299 1.0 +0.113529 0.0981625 1.0 +0.108027 0.103066 1.0 +0.126272 0.0950435 1.0 +0.133506 0.0939314 1.0 +0.124776 0.107205 1.0 +0.131076 0.107853 1.0 +0.136759 0.109119 1.0 +0.15444 0.102357 1.0 +0.143707 0.104111 1.0 +0.160272 0.0974776 1.0 +0.165379 0.103348 1.0 +0.173751 0.0916309 1.0 +0.174657 0.0937715 1.0 +0.167267 0.0980068 1.0 +0.170889 0.0905988 1.0 +0.185414 0.102092 1.0 +0.189813 0.10002 1.0 +0.199397 0.0909473 1.0 +0.198222 0.107717 1.0 +0.198974 0.099872 1.0 +0.201479 0.108827 1.0 +0.205074 0.107075 1.0 +0.202 0.124977 1.0 +0.191185 0.121976 1.0 +0.206848 0.134009 1.0 +0.196679 0.137767 1.0 +0.19255 0.148035 1.0 +0.190151 0.143856 1.0 +0.195263 0.155428 1.0 +0.20595 0.148822 1.0 +0.204421 0.152387 1.0 +0.191967 0.169495 1.0 +0.197981 0.169699 1.0 +0.191872 0.176798 1.0 +0.207398 0.170317 1.0 +0.194859 0.178978 1.0 +0.190444 0.183389 1.0 +0.196073 0.192833 1.0 +0.200019 0.190352 1.0 +0.205824 0.198579 1.0 +0.217043 0.198723 1.0 +0.210708 0.208976 1.0 +0.225591 0.209213 1.0 +0.224774 0.208331 1.0 +0.228376 0.201784 1.0 +0.233852 0.192014 1.0 +0.230703 0.196273 1.0 +0.241172 0.192107 1.0 +0.241027 0.203219 1.0 +0.257393 0.199803 1.0 +0.266244 0.190504 1.0 +0.263176 0.1902 1.0 +0.279822 0.191442 1.0 +0.267419 0.200092 1.0 +0.270919 0.209937 1.0 +0.294279 0.199399 1.0 +0.292596 0.208336 1.0 +0.302111 0.206854 1.0 +0.297261 0.193606 1.0 +0.302447 0.195568 1.0 +0.307461 0.217454 1.0 +0.302133 0.219113 1.0 +0.300152 0.216012 1.0 +0.296763 0.223723 1.0 +0.302571 0.234727 1.0 +0.298522 0.237272 1.0 +0.307834 0.234066 1.0 +0.296568 0.250613 1.0 +0.298385 0.251664 1.0 +0.29308 0.261943 1.0 +0.295426 0.266549 1.0 +0.293096 0.259791 1.0 +0.292439 0.271056 1.0 +0.291263 0.275271 1.0 +0.300944 0.286063 1.0 +0.308624 0.284206 1.0 +0.306603 0.285177 1.0 +0.302574 0.289769 1.0 +0.303807 0.303483 1.0 +0.308102 0.301263 1.0 +0.316854 0.306492 1.0 +0.313448 0.299638 1.0 +0.325862 0.304911 1.0 +0.328301 0.305416 1.0 +0.335535 0.300855 1.0 +0.327652 0.299601 1.0 +0.334895 0.301131 1.0 +0.339451 0.303238 1.0 +0.356128 0.293215 1.0 +0.359167 0.306227 1.0 +0.350648 0.309557 1.0 +0.359385 0.291005 1.0 +0.360515 0.305818 1.0 +0.377582 0.301763 1.0 +0.373333 0.308693 1.0 +0.375172 0.299768 1.0 +0.398744 0.298911 1.0 +0.390985 0.295462 1.0 +0.39465 0.305079 1.0 +0.397266 0.302934 1.0 +0.391293 0.303944 1.0 +0.401355 0.307406 1.0 +0.391301 0.312749 1.0 +0.401141 0.331346 1.0 +0.403843 0.339273 1.0 +0.397447 0.32984 1.0 +0.401007 0.345187 1.0 +0.401435 0.350856 1.0 +0.404534 0.358367 1.0 +0.40019 0.350997 1.0 +0.401021 0.359769 1.0 +0.398586 0.362409 1.0 +0.403735 0.370503 1.0 +0.400571 0.381428 1.0 +0.409145 0.374727 1.0 +0.402981 0.379619 1.0 +0.406312 0.38398 1.0 +0.405032 0.387826 1.0 diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp index 19b2eedb27d..7a5ea5b1487 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp @@ -2,6 +2,8 @@ #include #include +// Example for Reconstruction_simplification_2 + #include #include #include @@ -26,13 +28,15 @@ typedef CGAL::Reconstruction_simplification_2< K, Point_property_map, Mass_property_map> Rs_2; -void load_xy_file(const std::string& fileName, PointMassList& points) +void load_xym_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(fileName); + std::ifstream ifs(filename); + Point point; + FT mass; - while (ifs >> point) - points.push_back(std::make_pair(point, 1)); + while (ifs >> point && ifs >> mass) + points.push_back(std::make_pair(point, mass)); ifs.close(); } @@ -41,7 +45,7 @@ int main () { PointMassList points; - load_xy_file("data/stair-noise00.xy", points); + load_xym_file("data/stair.xym", points); Point_property_map point_pmap; Mass_property_map mass_pmap; diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp index b306776ee45..e712118a419 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp @@ -30,29 +30,14 @@ void load_xy_file(const std::string& fileName, std::list& points) ifs.close(); } - int main () { std::list points; - load_xy_file("data/stair-noise00.xy", points); + load_xy_file("data/stair.xy", points); Rs_2 rs2(points); rs2.run(100); // 100 steps - std::vector isolated_vertices; - std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); - - std::cerr << "Isolated vertices" << std::endl; - std::vector::iterator vit; - for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) - std::cout << *vit << std::endl; - - std::cerr << "Edges" << std::endl; - std::vector::iterator eit; - for (eit = edges.begin(); eit != edges.end(); eit++) - std::cout << *eit << std::endl; - return 0; } From 64204cf5e8aa455774f05882bd6db17d2761a539 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 8 Jun 2015 10:36:37 +0200 Subject: [PATCH 126/201] restructuring the user man. --- .../Reconstruction_Simplification_2.txt | 95 ++++++++++--------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 870bba35153..e47300f5218 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -9,7 +9,7 @@ namespace CGAL { \section Reconstruction_simplification_2Introduction Introduction -This package implements methods to reconstruct and simplify 2D point sets. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. +This package implements a method to reconstruct and simplify 2D point sets The algorithm of \cgalCite{degoes:hal-00758019}. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. \cgalFigureBegin{2D_Reconstruction_Simplification_overview,summary.png} Left: input point set hampered by noise. Right: The corresponding reconstructed shape consisting of line segments. @@ -32,10 +32,57 @@ After initializing it, 100 iterations of the reconstruction process are performe +\section Reconstruction_simplification_2API API +The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. + +\subsection Reconstruction_simplification_2Sample Sample Call + +\code{.cpp} +/* +K : a geometric kernel. +Point_property_map : a PropertyMap for accessing the input points. +Mass_property_map : a PropertyMap for accessing the mass attributes of the input points. +*/ + +Reconstruction_simplification_2 + rs2(points.begin(), points.end(), point_pmap, mass_pmap); + +rs2.run(100); // perform 100 contraction steps +\endcode + +Alternatively to calling the reconstruction module using +\code{.cpp} + rs2.run(100); // perform 100 contraction steps +\endcode + +one can use the run_until function +\code{.cpp} + rs2.run_until(20); // perform edge contractions until only 20 vertices are left. +\endcode +and specify the number of output vertices one wants to keep as illustrated next. + +\cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} +Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and 200 input points respectively. The examples illustrates the behavior of the algorithm when the input point density decreases. +\cgalFigureEnd -\section Reconstruction_simplification_2Overview Reconstruction Process +\section Reconstruction_simplification_2VertexRelocation Vertex Relocation + +Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers the option to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. + + +\cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} +A noisy skyline on the left, and the relocated vertices on the right. +\cgalFigureEnd + + + + + + + +\section Reconstruction_simplification_2Overview Methodology (advanced) More formally, the task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a 0-1 simplicial complex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplicial complex . @@ -81,50 +128,6 @@ Illustration of the bins of a simplicial-edge induced by the input points assign -\section Reconstruction_simplification_2VertexRelocation Vertex Relocation - -Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers the option to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. - - -\cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} -A noisy skyline on the left, and the relocated vertices on the right. -\cgalFigureEnd - - -\section Reconstruction_simplification_2API API - -The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. - -\subsection Reconstruction_simplification_2Sample Sample Call - -\code{.cpp} -/* -K : a geometric kernel, used for the reconstruction and simplification task. -Point_property_map : a PropertyMap for accessing the input points. -Mass_property_map : a PropertyMap for accessing the input points' masses. -*/ - - -Reconstruction_simplification_2 - rs2(points.begin(), points.end(), point_pmap, mass_pmap); - -rs2.run(100); // perform 100 contraction steps -\endcode - -Alternatively to calling the reconstruction module using -\code{.cpp} - rs2.run(100); // perform 100 contraction steps -\endcode - -one can use the run_until function -\code{.cpp} - rs2.run_until(20); // perform edge contractions until only 20 vertices are left. -\endcode -and specify the number of output vertices one wants to keep as illustrated in the following picture. - -\cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} -Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and 200 input points respectively. The examples illustrates the behavior of the algorithm when the input point density decreases. -\cgalFigureEnd From a78c1da1ce79b1c3472936637d2ec2aae9ce2c9d Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 8 Jun 2015 11:46:28 +0200 Subject: [PATCH 127/201] massaging user manual --- .../PackageDescription.txt | 2 +- .../Reconstruction_Simplification_2.txt | 48 +++++++++---------- .../examples.txt | 4 +- ...ruction_simplification_2_mass_example.cpp} | 0 ...ion_simplification_2_simplest_example.cpp} | 0 5 files changed, 27 insertions(+), 27 deletions(-) rename Reconstruction_simplification_2/examples/Reconstruction_simplification_2/{reconstruction_simplification_2_example.cpp => reconstruction_simplification_2_mass_example.cpp} (100%) rename Reconstruction_simplification_2/examples/Reconstruction_simplification_2/{reconstruction_simplification_2_no_mass_example.cpp => reconstruction_simplification_2_simplest_example.cpp} (100%) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt index 3084ae11df6..5ab496c14b1 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/PackageDescription.txt @@ -10,7 +10,7 @@ \cgalPkgPicture{overview.png} \cgalPkgSummaryBegin \cgalPkgAuthor{Fernando de Goes, Pierre Alliez, Ivo Vigan, Clément Jamin} -\cgalPkgDesc{This package provides an algorithm to simplify and reconstruct a shape from a point set in the plane, possibly hampered by noise and outliers. It generates as output a set of line segments and isolated points, which approximate the input point set.} +\cgalPkgDesc{This package provides an algorithm to reconstruct and simplify a shape from a point set in the plane, possibly hampered with noise and outliers. It generates as output a set of line segments and isolated points, which approximate the input point set.} \cgalPkgManuals{Chapter_2D_Reconstruction_Simplification, PkgReconstructionSimplification2} \cgalPkgSummaryEnd \cgalPkgShortInfoBegin diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index e47300f5218..aafc25a8b21 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -9,31 +9,35 @@ namespace CGAL { \section Reconstruction_simplification_2Introduction Introduction -This package implements a method to reconstruct and simplify 2D point sets The algorithm of \cgalCite{degoes:hal-00758019}. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_overview}. +This package implements a method to reconstruct and simplify 2D point sets The algorithm of \cgalCite{degoes:hal-00758019}. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_summary}. -\cgalFigureBegin{2D_Reconstruction_Simplification_overview,summary.png} +\cgalFigureBegin{2D_Reconstruction_Simplification_summary,summary.png} Left: input point set hampered by noise. Right: The corresponding reconstructed shape consisting of line segments. \cgalFigureEnd -\subsection Reconstruction_simplification_2Examples Simplest Example -The following example first reads a set of input points from an ASCII file. The points, with no mass attribute, are passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp} -\subsubsection Reconstruction_simplification_2Output Output Example -The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of segments is encoded. The indexed format records a list of points, then pairs of point indices in the list for the edges, and point indices for isolated vertices. +Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. The output of the reconstruction algorithm is a subset of edges and vertices of the triangulation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_algorithm} depicts an example where the output is composed of green edges and one isolated vertex. The green edges are considered relevant as are approximating well many of the input points. The edges depicted in grey, referred to as ghost edges and discarded, are approximating none of the input points. The edges depicted in red, referred to as irrelevant and also discarded, are approximating some of the input points but not enough to be considered relevant. + +\cgalFigureBegin{2D_Reconstruction_Simplification_algorithm,algorithm.png} +From left to right: input point set; Delaunay triangulation of the input points; After simplification, with ghost edges in grey, relevant edges in green, and irrelevant edges in red; Final reconstruction made up of edges and one isolated vertex. +\cgalFigureEnd + + +\subsection Reconstruction_simplification_2Simplest_example Simplest Example +The following example first reads a set of input points from an ASCII file. The points, with no mass attribute, are then passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp} + +\subsubsection Reconstruction_simplification_2Output_example Output Example +The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of the segments is encoded, hence the terms vertices and edges. The indexed format records a list of points, then pairs of point indices in the said list for the edges, and point indices for isolated vertices. \cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} -\subsection Reconstruction_simplification_2Examples Example with mass attributes -The following example first reads a set of input points and masses from an ASCII file. Using two property maps, -the points and their initial mass are passed to the Reconstruction_simplification_2 object. -After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the segments and isolated points of the reconstructed shape are extracted and printed to the console. +\subsection Reconstruction_simplification_2Mass_example Example with mass attributes +The following example first reads a set of input points and masses from an ASCII file. Using two property maps, the points and their initial mass are passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the segments and isolated points of the reconstructed shape are extracted and printed to the console. \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} - - \section Reconstruction_simplification_2API API -The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. +The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. \subsection Reconstruction_simplification_2Sample Sample Call @@ -66,8 +70,11 @@ Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and \cgalFigureEnd +\section Reconstruction_simplification_2Parameters Parameters -\section Reconstruction_simplification_2VertexRelocation Vertex Relocation + + +\subsection Reconstruction_simplification_2VertexRelocation Vertex Relocation Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers the option to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. @@ -82,13 +89,10 @@ A noisy skyline on the left, and the relocated vertices on the right. -\section Reconstruction_simplification_2Overview Methodology (advanced) +\section Reconstruction_simplification_2Advanced Advanced More formally, the task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a 0-1 simplicial complex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplicial complex . -\cgalFigureBegin{2D_Reconstruction_Simplification_process,process.png} -From left to right: input point set; Delaunay triangulation of input point set; After simplification, with ghost edges in grey, relevant solid edges in green, and discarded solid edges in red; Final reconstruction. -\cgalFigureEnd The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a framework based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2-Wasserstein distance is minimized. @@ -122,6 +126,7 @@ Assuming that the algorithm is given an output simplex \f$T \f$ and a point- the total transportation cost is computed using the following assignment rules: For a point to vertex assignment, the transportation cost is simply the sum of the weighted \f$L_2 \f$-distance of all the points assigned to the given vertex. For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, the algorithm decomposes \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. + \cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. Note that since the points are all assumed to be of equal weight, all the bins have the same width. \cgalFigureEnd @@ -129,11 +134,6 @@ Illustration of the bins of a simplicial-edge induced by the input points assign - - - - - */ } /* namespace CGAL */ diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt index 489cedcf541..c3a3dc3a58a 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt @@ -1,5 +1,5 @@ /*! +\example Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp \example Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp -\example Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp -\example Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp +\example Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp */ diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp similarity index 100% rename from Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp rename to Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp similarity index 100% rename from Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_no_mass_example.cpp rename to Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp From 24d6ba41d99dbb637342bef7deb96580160e09b7 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 8 Jun 2015 13:42:21 +0200 Subject: [PATCH 128/201] more on user man --- .../Reconstruction_Simplification_2.txt | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index aafc25a8b21..b6a2bc4331f 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -16,10 +16,12 @@ Left: input point set hampered by noise. Right: The corresponding reconstructed \cgalFigureEnd -Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. The output of the reconstruction algorithm is a subset of edges and vertices of the triangulation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_algorithm} depicts an example where the output is composed of green edges and one isolated vertex. The green edges are considered relevant as are approximating well many of the input points. The edges depicted in grey, referred to as ghost edges and discarded, are approximating none of the input points. The edges depicted in red, referred to as irrelevant and also discarded, are approximating some of the input points but not enough to be considered relevant. +Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. Approximate herein refers to a robust distance based on optimal transportation (see advanced section below for more details). + +The output of the reconstruction algorithm is a subset of edges and vertices of the triangulation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_algorithm} depicts an example where the output is composed of green edges and one isolated vertex. The green edges are considered relevant as they approximate well many of the input points. The edges depicted in grey, referred to as ghost edges and discarded, are they approximate none of the input points. The edges depicted in red, referred to as irrelevant and also discarded, approximate some of the input points but not enough to be considered relevant. \cgalFigureBegin{2D_Reconstruction_Simplification_algorithm,algorithm.png} -From left to right: input point set; Delaunay triangulation of the input points; After simplification, with ghost edges in grey, relevant edges in green, and irrelevant edges in red; Final reconstruction made up of edges and one isolated vertex. +From left to right: input point set; Delaunay triangulation of the input points; After simplification, with ghost edges in grey, relevant edges in green, and irrelevant edges in red; Final reconstruction made up of several edges and one isolated vertex. \cgalFigureEnd @@ -65,25 +67,30 @@ one can use the run_until function \endcode and specify the number of output vertices one wants to keep as illustrated next. -\cgalFigureBegin{2D_Reconstruction_Simplification_20vertices,20vertices.png} +\cgalFigureBegin{2D_Reconstruction_Simplification_twenty_vertices,twenty_vertices.png} Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and 200 input points respectively. The examples illustrates the behavior of the algorithm when the input point density decreases. \cgalFigureEnd -\section Reconstruction_simplification_2Parameters Parameters +\subsection Reconstruction_simplification_2Relocation Point Relocation +Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers a function to relocate all points: +\code{.cpp} + rs2.relocate_all_points(); +\endcode +The new locations is chosen such that the approximation of the output segments and isolated points to the input points is improved. An optional parameter in the constructor of the Reconstruction_simplification_2 class provides a means to relocate the vertices after a specific number of atomic simplification operators. - -\subsection Reconstruction_simplification_2VertexRelocation Vertex Relocation - -Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers the option to automatically relocate vertices after each edge contraction. The new location of the vertices is chosen such that the fitting of the output triangulation to the input points is improved. This is achieved by minimizing the normal component of their weighted \f$L_2 \f$ distance. The vertices get relocated only if the resulting triangulation is still embeddable. - - -\cgalFigureBegin{2D_Reconstruction_Simplification_vertexrelocation,vertexrelocation.png} -A noisy skyline on the left, and the relocated vertices on the right. +\cgalFigureBegin{2D_Reconstruction_Simplification_relocation,relocation.png} +Left: before point relocation. Right: after point relocation. \cgalFigureEnd +\section Reconstruction_simplification_2Parameters User parameters + + + + + @@ -127,13 +134,11 @@ the total transportation cost is computed using the following assignment rules: For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, the algorithm decomposes \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. -\cgalFigureBegin{2D_Reconstruction_Simplification_tangentialplan,tangentialplan.png} +\cgalFigureBegin{2D_Reconstruction_Simplification_plan,plan.png} Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. Note that since the points are all assumed to be of equal weight, all the bins have the same width. \cgalFigureEnd - - */ } /* namespace CGAL */ From c0ef5147685118ef623d809ff37af123d49c9560 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 8 Jun 2015 14:00:42 +0200 Subject: [PATCH 129/201] parameters --- .../Reconstruction_Simplification_2.txt | 15 +++++++++++++-- .../CMakeLists.txt | 4 ++-- ...struction_simplification_2_output_example.cpp} | 0 3 files changed, 15 insertions(+), 4 deletions(-) rename Reconstruction_simplification_2/examples/Reconstruction_simplification_2/{Reconstruction_simplification_2_output_example.cpp => reconstruction_simplification_2_output_example.cpp} (100%) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b6a2bc4331f..062baf545b0 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -31,11 +31,11 @@ The following example first reads a set of input points from an ASCII file. The \subsubsection Reconstruction_simplification_2Output_example Output Example The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of the segments is encoded, hence the terms vertices and edges. The indexed format records a list of points, then pairs of point indices in the said list for the edges, and point indices for isolated vertices. -\cgalExample{Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp} +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} \subsection Reconstruction_simplification_2Mass_example Example with mass attributes The following example first reads a set of input points and masses from an ASCII file. Using two property maps, the points and their initial mass are passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the segments and isolated points of the reconstructed shape are extracted and printed to the console. -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_example.cpp} +\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp} \section Reconstruction_simplification_2API API @@ -87,11 +87,22 @@ Left: before point relocation. Right: after point relocation. \section Reconstruction_simplification_2Parameters User parameters +\subsection Reconstruction_simplification_2Relevance Edge relevance + +An edge is relevant from the approximation point of view if it is long, approximates a large number of points (or equivalently the number of points when all masses are equal), and has a small approximation error. This notion is defined as m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, |e| denotes its length and cost(e) its approximation error. As the error is defined by mass time squared distance the relevance is unitless. + +The default value is 0, so that all edges approximating some input points are considered relevant. +A larger relevance value provides a means to increase resilience to outliers. +\subsection Reconstruction_simplification_2Random Random Sample Size +By default the simplification relies upon an exhaustive priority queue of edge collapse operators during decimation. For improved efficiency a parameter sample size strictly greater than 0 switches to a multiple choice approach, ie, a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value may be enlarged when targeting a very coarse simplification. +\subsection Reconstruction_simplification_2Verbose Verbose Output +The verbose parameter determines how much console output the algorithm generates. +A value larger than 0 generates output to the standard output std::cout. diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt index 7307d6f192a..d5d4875d349 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt @@ -22,8 +22,8 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") create_single_source_cgal_program( "reconstruction_simplification_2_output_example.cpp" ) - create_single_source_cgal_program( "reconstruction_simplification_2_example.cpp" ) - create_single_source_cgal_program( "reconstruction_simplification_2_no_mass_example.cpp" ) + create_single_source_cgal_program( "reconstruction_simplification_2_mass_example.cpp" ) + create_single_source_cgal_program( "reconstruction_simplification_2_simplest_example.cpp" ) else() diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp similarity index 100% rename from Reconstruction_simplification_2/examples/Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp rename to Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp From e52628f5d93f24f17acce9b5d207409080877433 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 8 Jun 2015 22:33:31 +0200 Subject: [PATCH 130/201] more on user manual --- .../Reconstruction_Simplification_2.txt | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 062baf545b0..6ba8407479b 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -9,14 +9,14 @@ namespace CGAL { \section Reconstruction_simplification_2Introduction Introduction -This package implements a method to reconstruct and simplify 2D point sets The algorithm of \cgalCite{degoes:hal-00758019}. The input is a 2D point set, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_summary}. +This package implements a method to reconstruct and simplify 2D point sets \cgalCite{degoes:hal-00758019}. The input is a set of 2D points with mass attributes, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_summary}. Intuitively, the mass attribute relates to the weight given to each point from the approximation point of view. \cgalFigureBegin{2D_Reconstruction_Simplification_summary,summary.png} Left: input point set hampered by noise. Right: The corresponding reconstructed shape consisting of line segments. \cgalFigureEnd -Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. Approximate herein refers to a robust distance based on optimal transportation (see advanced section below for more details). +Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. Approximate herein refers to a robust distance based on optimal transportation (see advanced section below for more details). The triangulation is simplified using a combination of half edge operators and edge flips. The triangulation remains valid during simplification. The output of the reconstruction algorithm is a subset of edges and vertices of the triangulation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_algorithm} depicts an example where the output is composed of green edges and one isolated vertex. The green edges are considered relevant as they approximate well many of the input points. The edges depicted in grey, referred to as ghost edges and discarded, are they approximate none of the input points. The edges depicted in red, referred to as irrelevant and also discarded, approximate some of the input points but not enough to be considered relevant. @@ -33,7 +33,7 @@ The following example first reads a set of input points from an ASCII file. The The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of the segments is encoded, hence the terms vertices and edges. The indexed format records a list of points, then pairs of point indices in the said list for the edges, and point indices for isolated vertices. \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} -\subsection Reconstruction_simplification_2Mass_example Example with mass attributes +\subsection Reconstruction_simplification_2Mass_example Example with Mass Attributes The following example first reads a set of input points and masses from an ASCII file. Using two property maps, the points and their initial mass are passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the segments and isolated points of the reconstructed shape are extracted and printed to the console. \cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp} @@ -78,7 +78,7 @@ Since noise and missing data may prevent the reconstructed shape to have sharp c \code{.cpp} rs2.relocate_all_points(); \endcode -The new locations is chosen such that the approximation of the output segments and isolated points to the input points is improved. An optional parameter in the constructor of the Reconstruction_simplification_2 class provides a means to relocate the vertices after a specific number of atomic simplification operators. +The new point locations are chosen such that the approximation of the output segments and isolated points to the input points is improved. An optional parameter of the constructor of the Reconstruction_simplification_2 class provides a means to relocate the points after a specified number of atomic simplification operators. \cgalFigureBegin{2D_Reconstruction_Simplification_relocation,relocation.png} Left: before point relocation. Right: after point relocation. @@ -87,32 +87,42 @@ Left: before point relocation. Right: after point relocation. \section Reconstruction_simplification_2Parameters User parameters -\subsection Reconstruction_simplification_2Relevance Edge relevance +The behavior of the algorithm is parameterized via five parameters: -An edge is relevant from the approximation point of view if it is long, approximates a large number of points (or equivalently the number of points when all masses are equal), and has a small approximation error. This notion is defined as m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, |e| denotes its length and cost(e) its approximation error. As the error is defined by mass time squared distance the relevance is unitless. +\subsection Reconstruction_simplification_2Flip Edge Flipping +During simplification of the internal triangulation some recursive edge flip operators are required to guarantee that the triangulation remain valid when applying a half edge collapse operator. Calling set_use_flip(false) prevents the algorithm from using edge flips, yielding shorter computational times at the price of suboptimal results as not all edges can be candidate to be collapsed. + +FIGURE WITH AND WITHOUT + +\subsection Reconstruction_simplification_2Relevance Edge Relevance + +An edge is relevant from the approximation point of view if (1) it is long, (2) approximates a large number of points (or equivalently the number of points when all masses are equal), and (3) has a small approximation error. This notion is defined as m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, |e| denotes its length and cost(e) its approximation error. As the error is defined by mass time squared distance the relevance is unitless. The default value is 0, so that all edges approximating some input points are considered relevant. A larger relevance value provides a means to increase resilience to outliers. +FIGURE WITH VARIOUS RELEVANCE VALUES \subsection Reconstruction_simplification_2Random Random Sample Size -By default the simplification relies upon an exhaustive priority queue of edge collapse operators during decimation. For improved efficiency a parameter sample size strictly greater than 0 switches to a multiple choice approach, ie, a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value may be enlarged when targeting a very coarse simplification. +By default the simplification relies upon an exhaustive priority queue of edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value may be larger when targeting a very coarse simplification. \subsection Reconstruction_simplification_2Verbose Verbose Output -The verbose parameter determines how much console output the algorithm generates. -A value larger than 0 generates output to the standard output std::cout. - +The verbose parameter , between 0 and 2, determines how much console output the algorithm generates. +A 0 value generates no output to the standard output. +A value greater than 0 generates output to the standard output std::cout. + \section Reconstruction_simplification_2Advanced Advanced -More formally, the task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a 0-1 simplicial complex which best approximates the original shape where the points were sampled from. The related task of simplifying a shape finds an approximation of the original shape using a 0-1 simplicial complex . +The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a 0-1 simplicial complex which best approximates the original shape where the points were sampled from. -The algorithm of \cgalCite{degoes:hal-00758019} which is implemented here, performs the reconstruction and simplification task jointly, using a framework based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2-Wasserstein distance is minimized. + +based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2-Wasserstein distance is minimized. The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. From f7fd1c017eaa55fbc586f947bd04effa0f060548 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Tue, 9 Jun 2015 09:38:04 +0200 Subject: [PATCH 131/201] more on advanced --- .../Reconstruction_Simplification_2.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 6ba8407479b..f6d54f60c45 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -97,7 +97,7 @@ FIGURE WITH AND WITHOUT \subsection Reconstruction_simplification_2Relevance Edge Relevance -An edge is relevant from the approximation point of view if (1) it is long, (2) approximates a large number of points (or equivalently the number of points when all masses are equal), and (3) has a small approximation error. This notion is defined as m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, |e| denotes its length and cost(e) its approximation error. As the error is defined by mass time squared distance the relevance is unitless. +An edge is relevant from the approximation point of view if (1) it is long, (2) approximates a large number of points (or a large amount of mass when points have mass attributes), and (3) has a small approximation error. The notion of relevance is defined as m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the points approximated by the edge, |e| denotes the edge length and cost(e) its approximation error. As the error is defined by mass time squared distance the relevance is unitless. The default value is 0, so that all edges approximating some input points are considered relevant. A larger relevance value provides a means to increase resilience to outliers. @@ -105,7 +105,7 @@ FIGURE WITH VARIOUS RELEVANCE VALUES \subsection Reconstruction_simplification_2Random Random Sample Size -By default the simplification relies upon an exhaustive priority queue of edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value may be larger when targeting a very coarse simplification. +By default the simplification relies upon an exhaustive priority queue of edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value must be enlarged when targeting a very coarse simplification. \subsection Reconstruction_simplification_2Verbose Verbose Output @@ -118,11 +118,14 @@ A value greater than 0 generates output to the standard output std::cout. \section Reconstruction_simplification_2Advanced Advanced -The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a 0-1 simplicial complex which best approximates the original shape where the points were sampled from. +The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a set of points and segments (more formally, a 0-1 simplicial complex ) which best approximates \f$ S \f$. + +The approximation error is derived from the theory of optimal transportation between geometric measures. More specifically, the input point set is seen as a discrete measure, ie, a set of pointwise masses. The goal is to find a 0-1 simplicial complex where the edges are the support of a piecewise uniform measure and the vertices are the support of a discrete measure. Approximating the input point set in our context translates into approximating the input discrete measure by another measure composed of line segments and points. + +Intuitively, the input point set S may be seen as grains of sand with total mass M. Approximating S with a given set of line segments and points, in sense of optimal transportation, amounts to finding the line and point densities and associated transport plan that minimizes the Wasserstein-2 distance. The latter - -based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2-Wasserstein distance is minimized. +based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2- distance is minimized. The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. From 8e3fbf60cafa04e419a202138e3af18a1de17880 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Tue, 9 Jun 2015 21:44:21 +0200 Subject: [PATCH 132/201] user manual --- .../Reconstruction_Simplification_2.txt | 70 +++++-------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index f6d54f60c45..ba3b247608a 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -9,16 +9,15 @@ namespace CGAL { \section Reconstruction_simplification_2Introduction Introduction -This package implements a method to reconstruct and simplify 2D point sets \cgalCite{degoes:hal-00758019}. The input is a set of 2D points with mass attributes, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input shape, where the input points were sampled from, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_summary}. Intuitively, the mass attribute relates to the weight given to each point from the approximation point of view. +This package implements a method to reconstruct and simplify 2D point sets \cgalCite{degoes:hal-00758019}. The input is a set of 2D points with mass attributes, possibly hampered by noise and outliers. The output is a set of line segments and isolated points which approximate the input points, as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_summary}. The mass attribute relates to the importance given to each point for approximation. \cgalFigureBegin{2D_Reconstruction_Simplification_summary,summary.png} Left: input point set hampered by noise. Right: The corresponding reconstructed shape consisting of line segments. \cgalFigureEnd +Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. Approximate herein refers to a robust distance based on optimal transportation (see advanced section for more details). The triangulation is simplified using a combination of half edge collapse operators and edge flips. The triangulation remains valid during simplification, i.e., with neither overlaps nor fold-overs. -Internally, the algorithm constructs an initial 2D Delaunay triangulation from all the input points, then simplifies the triangulation so that a subset of the edges and vertices of the triangulation approximate well the input points. Approximate herein refers to a robust distance based on optimal transportation (see advanced section below for more details). The triangulation is simplified using a combination of half edge operators and edge flips. The triangulation remains valid during simplification. - -The output of the reconstruction algorithm is a subset of edges and vertices of the triangulation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_algorithm} depicts an example where the output is composed of green edges and one isolated vertex. The green edges are considered relevant as they approximate well many of the input points. The edges depicted in grey, referred to as ghost edges and discarded, are they approximate none of the input points. The edges depicted in red, referred to as irrelevant and also discarded, approximate some of the input points but not enough to be considered relevant. +The output of the reconstruction algorithm is a subset of edges and vertices of the triangulation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_algorithm} depicts an example where the output is composed of green edges and one isolated vertex. The green edges are considered relevant as they approximate well many of the input points. The edges depicted in grey, referred to as ghost edges and discarded, approximate none of the input points. The edges depicted in red, referred to as irrelevant and also discarded, approximate some of the input points but not enough to be considered relevant. \cgalFigureBegin{2D_Reconstruction_Simplification_algorithm,algorithm.png} From left to right: input point set; Delaunay triangulation of the input points; After simplification, with ghost edges in grey, relevant edges in green, and irrelevant edges in red; Final reconstruction made up of several edges and one isolated vertex. @@ -78,7 +77,7 @@ Since noise and missing data may prevent the reconstructed shape to have sharp c \code{.cpp} rs2.relocate_all_points(); \endcode -The new point locations are chosen such that the approximation of the output segments and isolated points to the input points is improved. An optional parameter of the constructor of the Reconstruction_simplification_2 class provides a means to relocate the points after a specified number of atomic simplification operators. +The new point locations are chosen such that the approximation of the output segments and isolated points to the input points is improved. Note also that an optional parameter of the constructor of the Reconstruction_simplification_2 class provides a means to relocate the points after a specified number of atomic simplification operators. \cgalFigureBegin{2D_Reconstruction_Simplification_relocation,relocation.png} Left: before point relocation. Right: after point relocation. @@ -87,13 +86,15 @@ Left: before point relocation. Right: after point relocation. \section Reconstruction_simplification_2Parameters User parameters -The behavior of the algorithm is parameterized via five parameters: +The behavior of the algorithm is parameterized via five parameters. \subsection Reconstruction_simplification_2Flip Edge Flipping -During simplification of the internal triangulation some recursive edge flip operators are required to guarantee that the triangulation remain valid when applying a half edge collapse operator. Calling set_use_flip(false) prevents the algorithm from using edge flips, yielding shorter computational times at the price of suboptimal results as not all edges can be candidate to be collapsed. +During simplification of the internal triangulation some recursive edge flip operators are required to guarantee that the triangulation remain valid when applying a half edge collapse operator (see Figure \cgalFigureRef{2D_Reconstruction_Simplification_edgeflip}). Calling set_use_flip(false) prevents the algorithm from using edge flips, yielding shorter computational times at the price of suboptimal results as not all edges can be considered for being collapsible. -FIGURE WITH AND WITHOUT +\cgalFigureBegin{2D_Reconstruction_Simplification_edgeflip,edgeflip.png} +Edge flipping. Left: the blue edge creates fold-overs because of blocking edges shown in black. Middle: after running the recursive edge flipping procedure the blue edge is collapsible. Right: triangulation after collapse. +\cgalFigureEnd \subsection Reconstruction_simplification_2Relevance Edge Relevance @@ -101,68 +102,33 @@ An edge is relevant from the approximation point of view if (1) it is long, (2) The default value is 0, so that all edges approximating some input points are considered relevant. A larger relevance value provides a means to increase resilience to outliers. -FIGURE WITH VARIOUS RELEVANCE VALUES +/* FIGURE WITH VARIOUS RELEVANCE VALUES */ \subsection Reconstruction_simplification_2Random Random Sample Size -By default the simplification relies upon an exhaustive priority queue of edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value must be enlarged when targeting a very coarse simplification. +By default the simplification relies upon an exhaustive priority queue of half edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value must be enlarged when targeting a very coarse simplification. \subsection Reconstruction_simplification_2Verbose Verbose Output -The verbose parameter , between 0 and 2, determines how much console output the algorithm generates. -A 0 value generates no output to the standard output. -A value greater than 0 generates output to the standard output std::cout. +The verbose parameter, between 0 and 2, determines how much console output the algorithm generates. A 0 value generates no output to the standard output. A value greater than 0 generates output to the standard output std::cerr. + + +\section Reconstruction_simplification_2Variable_mass Variable_mass + - \section Reconstruction_simplification_2Advanced Advanced The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a set of points and segments (more formally, a 0-1 simplicial complex ) which best approximates \f$ S \f$. -The approximation error is derived from the theory of optimal transportation between geometric measures. More specifically, the input point set is seen as a discrete measure, ie, a set of pointwise masses. The goal is to find a 0-1 simplicial complex where the edges are the support of a piecewise uniform measure and the vertices are the support of a discrete measure. Approximating the input point set in our context translates into approximating the input discrete measure by another measure composed of line segments and points. - -Intuitively, the input point set S may be seen as grains of sand with total mass M. Approximating S with a given set of line segments and points, in sense of optimal transportation, amounts to finding the line and point densities and associated transport plan that minimizes the Wasserstein-2 distance. The latter - - -based on optimal transportation of discrete measures. This method provides benefits such as robustness to noise, preservation of sharp features and boundaries. An optimal transportation plan is an assignment of the input-points to vertices and edges of an output simplicial complex such that the 2- distance is minimized. - -The algorithm can be summarized as: Considering \f$S\f$ as a measure \f$ \mu \f$ consisting of Dirac masses, find a coarse simplicial complex \f$T\f$ such that \f$ \mu \f$ is well approximated by a piecewise combination of uniform measure on the edges and vertices of \f$ T \f$. - -It performs a fine to coarse simplification of the output simplex. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge contractions. To chose the next edge, a contraction is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for contraction is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. Since disregarding edges which do not preserve the embedding of the triangulation can severely affect the performance of the greedy approach to optimal transport, the contraction operator is modified by adding a local flip procedure which makes every edge contractable. - -\cgalFigureBegin{2D_Reconstruction_Simplification_edgeflip,edgeflip.png} -Illustration of an edge flip. In the left image, the blue edge creates fold-overs because of blocking edges shown in black. After running the flipping procedure with the result shown in the middle image, the - blue edge is contractable, and the contraction results in the image shown on the right. -\cgalFigureEnd +The approximation error is derived from the theory of optimal transportation between geometric measures. More specifically, the input point set is seen as a discrete measure, ie, a set of pointwise masses. The goal is to find a 0-1 simplicial complex where the edges are the support of a piecewise uniform measure (line density of masses) and the vertices are the support of a discrete measure. Approximating the input point set in our context translates into approximating the input discrete measure by another measure composed of line segments and points. +The algorithm performs a fine to coarse simplification of a triangulation. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge collapses. To chose the next edge, a collapse operator is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for collapse is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. Since disregarding edges which do not preserve the embedding of the triangulation can severely affect the performance of the greedy approach to optimal transport, the collapse operator is modified by adding a local flip procedure which makes every edge collapsible. The transportation plan is approximated by assigning each input point temporarily to the closest simplex edge. After this partitioning of the input points w.r.t. the edges, all the points temporarily assigned to a given edge are being assigned to it permanently if and only if the corresponding transportation costs are less than the transportation cost for each of the two vertices of the edge. Otherwise each of the points is assigned to the cheaper of the two vertices. This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. - - -While previous work address the reconstruction and simplification tasks sequentially, here they are performed jointly using a framework based on optimal transport of measures. It furthermore guarantees that the output is a simplicial complex. Transportation theory studies optimal transportations between a set \f$M\f$ of \f$n\f$ sources and a set \f$F \f$ of \f$n\f$ targets (both can be primitives in various dimensions.). Given a cost function \f$c : \mathbb{R}^2 \times \mathbb{R}^2 \rightarrow \mathbb{R}^+ \f$, the goal is to find a mapping between \f$M\f$ and \f$F\f$ such that the sum of the costs \f$c\f$ gets minimized. The optimal transport problem can also be defined between measures, and here we view the reconstruction and simplification tasks as such a transportation problem, where the input points are Dirac measure and the reconstructed simplicial complex is the support of a piecewise uniform measure. The algorithm then performs edge contractions in a greedy fashion w.r.t. the transportation cost, until the desired number of vertices are reached or a predefined iteration threshold has been exceeded. - - -\section Reconstruction_simplification_2Trans Optimal Transport Formulation - -The quality of the output simplex is measured as the total transportation cost of the input points to their assigned simplex vertices and edges. -For the transportation cost, the 2-Wasserstein metric is chosen which intuitively -corresponds to the minimum cost of turning a (unit) pile of sand into a given shape, when the cost is measured using the \f$L_2 \f$ distance. - -\subsection Reconstruction_simplification_2TransCost Transportation Plan & Cost from Points to Simplices - -Assuming that the algorithm is given an output simplex \f$T \f$ and a point-to-simplex assignment which maps every input point to either an edge or a vertex of \f$T \f$, -the total transportation cost is computed using the following assignment rules: For a point to vertex assignment, the transportation cost is simply the sum of the weighted \f$L_2 \f$-distance of all the points assigned to the given vertex. - -For an edge \f$e \f$ of the simplex, the optimal transportation plan and its cost is computed indirectly, by decomposing the transportation plan into a tangential and normal component. While the normal plan is simply an orthogonal projection, the tangential plan is slightly more involved. In order to compute it, the algorithm decomposes \f$e \f$ into bins. This decomposition is done by sorting the projected points on \f$e \f$ and choosing the length of the \f$i \f$-th bin as \f$(m_i / M_e)|e| \f$, with \f$ m_i \f$ denoting the mass of point of the corresponding projected point \f$q_i \f$, while \f$M_e \f$ denotes the sum of the mass of all points assigned to \f$ e \f$ and \f$ |e| \f$ denotes the length of \f$ e \f$. Each projected point \f$q_i \f$ on \f$e \f$ is then spread over the \f$i \f$-th bin. such that we get a uniform measure on \f$e \f$, which is then used to define an optimal transport from the input points to \f$e\f$. Because the transport cost is based on the \f$L_2 \f$-distance the decomposition of the transportation plan into a tangential and normal component, the above procedure yields a closed formula for the cost. - -\cgalFigureBegin{2D_Reconstruction_Simplification_plan,plan.png} -Illustration of the bins of a simplicial-edge induced by the input points assigned to the edge. These bins are used for computing the tangential transportation cost from the input points to this edge. Note that since the points are all assumed to be of equal weight, all the bins have the same width. -\cgalFigureEnd - - */ } /* namespace CGAL */ From aacfea54bfa9fb67c55b2e4bfe10191407039157 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Tue, 9 Jun 2015 22:26:39 +0200 Subject: [PATCH 133/201] adding figs to user man. --- .../Reconstruction_Simplification_2.txt | 25 ++++++++++++++++--- .../CGAL/Reconstruction_simplification_2.h | 12 ++++----- .../CGAL/Reconstruction_triangulation_2.h | 2 -- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index ba3b247608a..5d013ce1d91 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -102,7 +102,7 @@ An edge is relevant from the approximation point of view if (1) it is long, (2) The default value is 0, so that all edges approximating some input points are considered relevant. A larger relevance value provides a means to increase resilience to outliers. -/* FIGURE WITH VARIOUS RELEVANCE VALUES */ +% FIGURE WITH VARIOUS RELEVANCE VALUES \subsection Reconstruction_simplification_2Random Random Sample Size @@ -113,9 +113,29 @@ By default the simplification relies upon an exhaustive priority queue of half e The verbose parameter, between 0 and 2, determines how much console output the algorithm generates. A 0 value generates no output to the standard output. A value greater than 0 generates output to the standard output std::cerr. +\section Reconstruction_simplification_2Robustness Robustness +A virtue of the algorithm is its robustness to noise and outliers, see Figure \cgalFigureRef{2D_Reconstruction_Simplification_robustness} . +\cgalFigureBegin{2D_Reconstruction_Simplification_robustness,robustness.png} +Robustness to noise and outliers. Left: noise-free point set. Middle: noisy point set. Right: point set hampered by noise and outliers. +\cgalFigureEnd + +\section Reconstruction_simplification_2Density Variable Density +Figure \cgalFigureRef{2D_Reconstruction_Simplification_density} illustrates the behavior of the algorithm on a point set with uniform mass attributes, and variable density. As the algorithm gives more importance to densely sampled areas, this translates into smaller edges on densely sampled areas. On sparsely sampled areas the algorithm initially approximates each point by one isolated vertex, then progressively approximates with edges. +\cgalFigureBegin{2D_Reconstruction_Simplification_density,density.png} +Variable density. Left: input point set. Middle left: the output is composed of isolated vertices on sparse areas and of edges with adapted length elsewhere. +\cgalFigureEnd + + +\section Reconstruction_simplification_2Mixed Mixed Dimension +Figure \cgalFigureRef{2D_Reconstruction_Simplification_mixed} depicts an input point set sampling a set of line segments and a solid area. Depending on the targeted complexity, the solid area is approximated by a set of evenly sampled isolated vertices. + +\cgalFigureBegin{2D_Reconstruction_Simplification_mixed,mixed.png} +Mixed dimension. Left: input point set. Middle: Isolated vertices in blue, relevant edges in green and irrelevant edges in red. Right: final output. +\cgalFigureEnd + \section Reconstruction_simplification_2Variable_mass Variable_mass - +% FIGURE VARIABLE MASS \section Reconstruction_simplification_2Advanced Advanced @@ -126,7 +146,6 @@ The approximation error is derived from the theory of optimal transportation bet The algorithm performs a fine to coarse simplification of a triangulation. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge collapses. To chose the next edge, a collapse operator is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for collapse is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. Since disregarding edges which do not preserve the embedding of the triangulation can severely affect the performance of the greedy approach to optimal transport, the collapse operator is modified by adding a local flip procedure which makes every edge collapsible. - The transportation plan is approximated by assigning each input point temporarily to the closest simplex edge. After this partitioning of the input points w.r.t. the edges, all the points temporarily assigned to a given edge are being assigned to it permanently if and only if the corresponding transportation costs are less than the transportation cost for each of the two vertices of the edge. Otherwise each of the points is assigned to the cheaper of the two vertices. This process of edge contraction and transportation plan update is repeated until the desired number of vertices, specified by the users, has been reached. After that, edges which carry little mass can be filtered out and the remaining edges are reported as reconstructing the input shape. */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index f38a3213def..5b766261c76 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -191,10 +191,10 @@ protected: /*! The constructor of the reconstruction simplification class for a given range of point-mass pairs. - which already builds an initial simplex. + which already builds an initial simplicial complex. \tparam InputRange is a model of `Range` with forward iterators, - providing input points and point mass through the following two property maps. + providing input points and point masses through the following two property maps. \param input_range range of input data. \param point_map A `ReadablePropertyMap` used to access the input points. @@ -1409,13 +1409,11 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { have sharp corners well located, the algorithm offers the possibility to automatically relocate points after each edge contraction. The new location of the points is chosen such that the fitting of the output segments to the - input points is improved. This is achieved by minimizing the normal component - of the weighted \f$L_2 \f$ distance. The points then get relocated only if the - underlying triangulation is still embeddable. + input points is improved. */ void relocate_all_points() { double timer = clock(); - std::cerr << yellow << "relocate all" << white << "..."; + std::cerr << yellow << "relocate all points" << white << "..."; m_mindex.clear(); // pqueue must be recomputed @@ -1622,7 +1620,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { } - //mark edges + // mark edges for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) { Edge edge = *ei; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index b44c4f09442..40dd37a87cc 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -696,12 +696,10 @@ public: } void assign_sample_to_vertex(Sample* sample, Vertex_handle vertex) { - // DEBUG if (vertex->get_sample()) { std::cout << "assign to vertex: vertex already has sample" << std::endl; } - // sample->distance2() = 0.0; sample->coordinate() = 0.0; From 29c7bf9f6d0931e34eb445447cc098a399baafdf Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 11:08:38 +0200 Subject: [PATCH 134/201] Typo and warning --- Triangulation_2/include/CGAL/Triangulation_data_structure_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h index 63ea3e99578..66b7d40f359 100644 --- a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h @@ -1481,7 +1481,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) return join_vertices(f->neighbor(i), mirror_index(f,i), v); } - int deg2 = degree(v2); + std::size_t deg2 = degree(v2); CGAL_triangulation_precondition( deg2 >= 3 ); @@ -1491,7 +1491,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) } /* - // The following drawing corrsponds to the variables + // The following drawing corresponds to the variables // used in this part... // The vertex v1 is returned... // From efd834de0e592f1b8c5a8fa5e4acd54634522ef4 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 11:18:10 +0200 Subject: [PATCH 135/201] Renamed demo project --- .../demo/Reconstruction_simplification_2/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt index 92d3286d89b..85a57b0099b 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt @@ -1,7 +1,7 @@ # CMake # Fernando de Goes (fdegoes@caltech.edu) # Copyright @ 2011 -project(pwsrec2D) +project(Reconstruction_simplification_2_demo) cmake_minimum_required(VERSION 2.4.5) cmake_policy(VERSION 2.4.5) From 48bff17c388d996fb4d00f011f2db49791bff961 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 11:46:46 +0200 Subject: [PATCH 136/201] Missing include + warnings --- .../render.cpp | 36 ++++++++++--------- .../Reconstruction_simplification_2/scene.h | 14 ++++---- .../window.cpp | 16 ++++----- .../Reconstruction_simplification_2/window.h | 2 +- .../CGAL/Reconstruction_simplification_2.h | 20 +++++------ 5 files changed, 45 insertions(+), 43 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 93f90d538f9..d61b89255db 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -1,3 +1,5 @@ +#include + // Qt #include @@ -14,7 +16,7 @@ void R_s_k_2::print_stats() const int nb_solid = 0; int nb_ghost = 0; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) + ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; if (m_dt.is_ghost(edge)) nb_ghost++; @@ -46,10 +48,10 @@ void R_s_k_2::draw_point(const Point& point) void R_s_k_2::draw_segment(const Point& s, const Point& t) { - ::glBegin(GL_LINES); + ::glBegin(GL_LINES); ::glVertex2d(s.x(), s.y()); ::glVertex2d(t.x(), t.y()); - ::glEnd(); + ::glEnd(); } void R_s_k_2::draw_edge(const Edge& edge) @@ -96,8 +98,8 @@ void R_s_k_2::draw_vertices(const float point_size, const float green, const float blue) { - for (Finite_vertices_iterator vi = m_dt.finite_vertices_begin(); vi - != m_dt.finite_vertices_end(); vi++) + for (Finite_vertices_iterator vi = m_dt.finite_vertices_begin(); + vi != m_dt.finite_vertices_end(); vi++) { Vertex_handle vertex = vi; if (vertex->pinned()) @@ -121,7 +123,7 @@ void R_s_k_2::draw_edges(const float line_width, { ::glLineWidth(line_width); for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ei++) + ei != m_dt.finite_edges_end(); ei++) { Edge edge = *ei; Edge twin = m_dt.twin_edge(edge); @@ -205,7 +207,7 @@ void R_s_k_2::draw_pedges(const float line_width) for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; - for (unsigned i = 0; i < 2; ++i) + for (unsigned int i = 0; i < 2; ++i) { if (m_dt.is_pinned(edge)) { @@ -241,7 +243,7 @@ void R_s_k_2::draw_pedges(const float line_width) if (min_value == max_value) max_value += 1.0; std::size_t N = values.size(); - for (unsigned i = 0; i < N; ++i) + for (unsigned int i = 0; i < N; ++i) draw_one_pedge(edges[i], values[i], min_value, max_value, line_width); std::cout << "There are: " << N << " pedges" @@ -831,7 +833,7 @@ void R_s_k_2::draw_bg_edges(const Triangulation& mesh, for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) { Face_handle f = fi; - for (unsigned i = 0; i < 3; ++i) + for (unsigned int i = 0; i < 3; ++i) { Edge e(f, i); e = mesh.twin_edge(e); @@ -893,7 +895,7 @@ void R_s_k_2::draw_vertex_edges(Vertex_handle vertex, { Face_handle f = fcirc; int index = f->index(vertex); - for (unsigned i = 0; i < 3; ++i) + for (unsigned int i = 0; i < 3; ++i) { Edge e(f, i); if (mesh.is_infinite(e)) continue; @@ -918,15 +920,15 @@ void R_s_k_2::save_edges(std::ofstream& ofs, const int nb) int nb_remove = (std::min)(nb, int(mindex.size())); for (int i = 0; i < nb_remove; ++i) { - PEdge pedge = *(mindex.get<1>()).begin(); - (mindex.get<0>()).erase(pedge); + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); } while (!mindex.empty()) { - PEdge pedge = *(mindex.get<1>()).begin(); - (mindex.get<0>()).erase(pedge); + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); save_one_edge(ofs, pedge.edge()); } } @@ -935,7 +937,7 @@ void R_s_k_2::save_one_edge(std::ofstream& ofs, const Edge& edge) { int i = edge.second; Face_handle face = edge.first; - Point a = face->vertex((i+1)%3)->point(); - Point b = face->vertex((i+2)%3)->point(); - ofs << a << " " << b << std::endl; + Point const& a = face->vertex((i+1)%3)->point(); + Point const& b = face->vertex((i+2)%3)->point(); + ofs << a << " - " << b << std::endl; } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index bab583d69cf..bb748582419 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -315,7 +315,7 @@ public: Point point; unsigned nb, x, y, z; ifs >> nb >> x >> y >> z; - for (unsigned i = 0; i < nb; ++i) { + for (unsigned int i = 0; i < nb; ++i) { ifs >> x >> point; add_sample(point, 1.0); } @@ -535,7 +535,7 @@ public: void save_gtn(const QString& filename, const Sample_list& samples) { std::ofstream ofs(qPrintable(filename)); ofs << samples.size() << " 2 0 0" << std::endl; - unsigned i = 0; + unsigned int i = 0; for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it, ++i) { Sample* sample = *it; @@ -548,7 +548,7 @@ public: void set_parameters(const int verbose, const int mchoice, const bool use_flip, const double alpha, const double norm_tol, - const double tang_tol, const unsigned relocation, + const double tang_tol, const unsigned int relocation, const double ghost) { m_pwsrec->set_verbose(verbose); @@ -638,12 +638,12 @@ public: } } - void reconstruct_until(const unsigned nv) { + void reconstruct_until(const unsigned int nv) { std::cout << "reconstruct_until" << std::endl; m_pwsrec->run_until(nv); } - void reconstruct(const unsigned steps) { + void reconstruct(const unsigned int steps) { std::cout << "reconstruct" << std::endl; m_pwsrec->run(steps); } @@ -779,12 +779,12 @@ public: } void draw_one_circle(const Point& center) { - unsigned N = 10; + unsigned int N = 10; const double r = std::sqrt(m_pwsrec->get_norm_tol()); const double x = center.x(); const double y = center.y(); ::glBegin (GL_POLYGON); - for (unsigned i = 0; i < N; ++i) { + for (unsigned int i = 0; i < N; ++i) { double angle = 2.0 * M_PI * (double(i) / double(N)); double u = r * std::cos(angle) + x; double v = r * std::sin(angle) + y; diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp index 3d253bc40f4..af29f1d3c29 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp @@ -263,7 +263,7 @@ void MainWindow::on_actionCircle_triggered() void MainWindow::on_actionHalf_circle_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 150, 10, 10000, 1, &ok); if (!ok) return; @@ -291,7 +291,7 @@ void MainWindow::on_actionSpiral_triggered() void MainWindow::on_actionLine_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 50, 1, 10000, 1, &ok); if (!ok) return; @@ -329,7 +329,7 @@ void MainWindow::on_actionBox_triggered() void MainWindow::on_actionBoxes_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); if (!ok) return; @@ -360,7 +360,7 @@ void MainWindow::on_actionParallel_lines_triggered() void MainWindow::on_actionBox_with_boundaries_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); if (!ok) return; @@ -371,7 +371,7 @@ void MainWindow::on_actionBox_with_boundaries_triggered() void MainWindow::on_actionBox_with_missing_corners_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); if (!ok) return; @@ -398,7 +398,7 @@ void MainWindow::on_actionStar_triggered() void MainWindow::on_actionStair_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 30, 2, 10000, 1, &ok); if (!ok) return; @@ -410,7 +410,7 @@ void MainWindow::on_actionStair_triggered() void MainWindow::on_actionSkyline_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); if (!ok) return; @@ -422,7 +422,7 @@ void MainWindow::on_actionSkyline_triggered() void MainWindow::on_actionIncreasingly_sharp_angles_triggered() { bool ok; - unsigned density = QInputDialog::getInteger( + unsigned int density = QInputDialog::getInteger( this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); if (!ok) return; diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h index 34bb2912891..7badc653e47 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h @@ -28,7 +28,7 @@ private: double m_percent; double m_norm_tol; double m_tang_tol; - double m_relocation; + double m_relocation; unsigned int maxNumRecentFiles; QAction* recentFilesSeparator; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 5b766261c76..d44020ff239 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -165,13 +165,13 @@ protected: MultiIndex m_mindex; int m_ignore; int m_verbose; - int m_mchoice; // # Edges + std::size_t m_mchoice; // # Edges bool m_use_flip; double m_alpha; // [0, 1] double m_norm_tol; // [0,BBOX] double m_tang_tol; // [0,BBOX] double m_ghost; // ghost vs solid - unsigned m_relocation; // # relocations + unsigned int m_relocation; // # relocations // bbox double m_bbox_x; @@ -245,7 +245,7 @@ protected: \param verbose The verbosity level. */ - void set_verbose(std::size_t verbose) { + void set_verbose(int verbose) { m_verbose = verbose; } @@ -292,12 +292,12 @@ protected: Sets the number of vertex relocations that are performed between two edge collapses. */ - void set_relocation(std::size_t relocation) { + void set_relocation(unsigned int relocation) { m_relocation = relocation; } /// \cond SKIP_IN_MANUAL - unsigned get_relocation() const { + unsigned int get_relocation() const { return m_relocation; } /// \endcond @@ -539,7 +539,7 @@ protected: if (m_mchoice == 0) push_stencil_to_pqueue(hull.begin(), hull.end()); - for (unsigned i = 0; i < m_relocation; ++i) { + for (unsigned int i = 0; i < m_relocation; ++i) { relocate_one_ring(hull.begin(), hull.end()); } @@ -707,11 +707,11 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { // PQUEUE (MCHOICE or EXHAUSTIVE) // - bool pick_edge(int nb, Reconstruction_edge_2& best_pedge) { + bool pick_edge(std::size_t nb, Reconstruction_edge_2& best_pedge) { if (m_dt.number_of_faces() < 2) return false; - int ne = int(2 * m_dt.tds().number_of_edges()); + std::size_t ne = 2 * m_dt.tds().number_of_edges(); if (nb > ne) nb = ne; @@ -759,9 +759,9 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { return true; } - bool pick_edge_randomly(int nb, Reconstruction_edge_2& best_pedge) { + bool pick_edge_randomly(std::size_t nb, Reconstruction_edge_2& best_pedge) { MultiIndex mindex; - for (int i = 0; i < nb; ++i) { + for (std::size_t i = 0; i < nb; ++i) { Reconstruction_edge_2 pedge; if (random_pedge(pedge)) mindex.insert(pedge); From b70b6d801795542ceda3383e13069bef9dce37dc Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 12:06:21 +0200 Subject: [PATCH 137/201] Fix case --- .../include/CGAL/Reconstruction_vertex_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 2526ee5edb8..538f65eedda 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -21,7 +21,7 @@ #define RECONSTRUCTION_VERTEX_BASE_2_H_ #include -#include +#include /// The Reconstruction_vertex_base_2 class is the default /// vertex class of the Reconstruction_triangulation_2 class. From d83e5ef80ee037f56a7ef28b1c65197002908827 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 12:31:10 +0200 Subject: [PATCH 138/201] missing typename keywords --- .../include/CGAL/Reconstruction_face_base_2.h | 4 ++-- .../include/CGAL/Reconstruction_triangulation_2.h | 4 ++-- .../include/CGAL/Reconstruction_vertex_base_2.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 34f4a1f9cf6..78dd143aea3 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -56,8 +56,8 @@ public: }; typedef typename Kernel::FT FT; - typedef Cost Cost; - typedef Sample Sample; + typedef typename Cost Cost; + typedef typename Sample Sample; typedef std::list Sample_list; private: diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 40dd37a87cc..872c7d1117a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -119,7 +119,7 @@ public: typedef std::list Point_list; typedef typename Point_list::const_iterator Point_list_const_iterator; - typedef Cost Cost; + typedef typename Cost Cost; typedef Sample Sample; typedef std::list Sample_list; typedef typename Sample_list::const_iterator Sample_list_const_iterator; @@ -128,7 +128,7 @@ public: typedef std::priority_queue, greater_priority > SQueue; - typedef Reconstruction_edge_2 + typedef typename Reconstruction_edge_2 Reconstruction_edge_2; typedef boost::multi_index_container< diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 538f65eedda..5b763f70c82 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -40,7 +40,7 @@ class Reconstruction_vertex_base_2 : public Vb public: typedef Vb Base; typedef typename Kernel::FT FT; - typedef Sample Sample; + typedef typename Sample Sample; typedef typename Kernel::Point_2 Point; typedef typename Base::Face_handle Face_handle; From ca86701e8f5309f9a9783578d382d095dc7bf04d Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 15:01:19 +0200 Subject: [PATCH 139/201] Missing namespace --- Reconstruction_simplification_2/include/CGAL/Sample.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Reconstruction_simplification_2/include/CGAL/Sample.h b/Reconstruction_simplification_2/include/CGAL/Sample.h index b0612c2eca1..8bb3ab01f1b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Sample.h +++ b/Reconstruction_simplification_2/include/CGAL/Sample.h @@ -23,6 +23,7 @@ /// \cond SKIP_IN_MANUAL +namespace CGAL { template class Sample { @@ -140,4 +141,6 @@ struct greater_priority } }; +} //end namespace CGAL + #endif // SAMPLE_H From 2426e75f9727c0495f7a0fb96aa16b72363c780d Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 16:20:47 +0200 Subject: [PATCH 140/201] Add #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 --- .../include/CGAL/Reconstruction_simplification_2.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index d44020ff239..fd4c4c27c4a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -389,8 +389,13 @@ protected: std::list m_samples; for (InputIterator it = start; it != beyond; it++) { + #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 + Point point = get(point_pmap, it); + FT mass = get( mass_pmap, it); + #else Point point = get(point_pmap, *it); - FT mass = get( mass_pmap, *it); + FT mass = get( mass_pmap, *it); + #endif Sample* s = new Sample(point, mass); m_samples.push_back(s); } @@ -444,7 +449,11 @@ protected: int nb = static_cast(m_dt.number_of_vertices()); m_dt.infinite_vertex()->pinned() = true; for (Iterator it = begin; it != beyond; it++) { - Point point = get(point_pmap, *it); + #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 + Point point = get(point_pmap, it); + #else + Point point = get(point_pmap, *it); + #endif Vertex_handle vertex = insert_point(point, false, nb++); } From 6d1b27d4c1c97eade4acb63cdf74c2f5ef28d340 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 16:51:29 +0200 Subject: [PATCH 141/201] Fix compilation of tests with GCC --- .../render.cpp | 6 +- .../include/CGAL/Reconstruction_face_base_2.h | 34 ++--- .../CGAL/Reconstruction_simplification_2.h | 62 +++++----- .../CGAL/Reconstruction_triangulation_2.h | 116 +++++++++--------- .../CGAL/Reconstruction_vertex_base_2.h | 8 +- .../test_basic.cpp | 2 +- .../test_flip_procedure.cpp | 2 +- .../test_output_modules.cpp | 2 +- .../test_vertex_edge.cpp | 3 +- .../testing_tools.h | 4 +- 10 files changed, 119 insertions(+), 120 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index d61b89255db..4867641a0a3 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -201,7 +201,7 @@ void R_s_k_2::draw_pedges(const float line_width) int nb_cyclic = 0; int nb_discart = 0; FT min_value = (std::numeric_limits::max)(); - FT max_value = std::numeric_limits::lowest(); + FT max_value = -(std::numeric_limits::max)(); std::vector values; std::vector edges; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) @@ -282,7 +282,7 @@ void R_s_k_2::draw_one_pedge(const Edge& edge, void R_s_k_2::draw_costs(const float line_width, const bool view_ghost) { FT min_value = (std::numeric_limits::max)(); - FT max_value = std::numeric_limits::lowest(); + FT max_value = -(std::numeric_limits::max)(); for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { Edge edge = *ei; @@ -333,7 +333,7 @@ void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool in { MultiIndex mindex; FT min_value = (std::numeric_limits::max)(); - FT max_value = (std::numeric_limits::lowest)(); + FT max_value = -(std::numeric_limits::max)(); unsigned nb_initial = 0; for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 78dd143aea3..44461f85ff0 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -56,16 +56,16 @@ public: }; typedef typename Kernel::FT FT; - typedef typename Cost Cost; - typedef typename Sample Sample; - typedef std::list Sample_list; + typedef Cost Cost_; + typedef Sample Sample_; + typedef std::list Sample_list; private: Sample_list m_samples[3]; FT m_mass[3]; - Cost m_cost0[3]; - Cost m_cost1[3]; + Cost_ m_cost0[3]; + Cost_ m_cost1[3]; int m_plan[3]; FT m_relevance[3]; @@ -135,13 +135,13 @@ public: m_mass[1] = 0.0; m_mass[2] = 0.0; - m_cost0[0] = Cost(); - m_cost0[1] = Cost(); - m_cost0[2] = Cost(); + m_cost0[0] = Cost_(); + m_cost0[1] = Cost_(); + m_cost0[2] = Cost_(); - m_cost1[0] = Cost(); - m_cost1[1] = Cost(); - m_cost1[2] = Cost(); + m_cost1[0] = Cost_(); + m_cost1[1] = Cost_(); + m_cost1[2] = Cost_(); m_plan[0] = 0; m_plan[1] = 0; @@ -159,17 +159,17 @@ public: const FT& mass(int edge) const { return m_mass[edge]; } FT& mass(int edge) { return m_mass[edge]; } - const Cost& vertex_cost(int edge) const { return m_cost0[edge]; } - Cost& vertex_cost(int edge) { return m_cost0[edge]; } + const Cost_& vertex_cost(int edge) const { return m_cost0[edge]; } + Cost_& vertex_cost(int edge) { return m_cost0[edge]; } - const Cost& edge_cost(int edge) const { return m_cost1[edge]; } - Cost& edge_cost(int edge) { return m_cost1[edge]; } + const Cost_& edge_cost(int edge) const { return m_cost1[edge]; } + Cost_& edge_cost(int edge) { return m_cost1[edge]; } const FT& relevance(int edge) const { return m_relevance[edge]; } FT& relevance(int edge) { return m_relevance[edge]; } - const Cost& cost(int edge) const + const Cost_& cost(int edge) const { if (plan(edge) == 0) return vertex_cost(edge); return edge_cost(edge); @@ -185,7 +185,7 @@ public: const Sample_list& samples(int edge) const { return m_samples[edge]; } Sample_list& samples(int edge) { return m_samples[edge]; } - void add_sample(int edge, Sample* sample) + void add_sample(int edge, Sample_* sample) { m_samples[edge].push_back(sample); } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index fd4c4c27c4a..3839e0326fd 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -21,9 +21,7 @@ #define RECONSTRUCTION_SIMPLIFICATION_2_H_ #include -#include #include -#include #include #include @@ -81,7 +79,7 @@ Furthermore, we can relocate the vertices by calling `relocate_points()`. */ template, + class PointMap = boost::typed_identity_property_map , class MassMap = boost::static_property_map > class Reconstruction_simplification_2 { public: @@ -141,8 +139,8 @@ public: typedef typename Triangulation::Edge_list Edge_list; - typedef typename Triangulation::Cost Cost; - typedef typename Triangulation::Sample Sample; + typedef typename Triangulation::Cost_ Cost_; + typedef typename Triangulation::Sample_ Sample_; typedef typename Triangulation::Sample_list Sample_list; typedef typename Triangulation::Sample_list_const_iterator Sample_list_const_iterator; @@ -154,7 +152,7 @@ public: typedef typename Triangulation::PSample PSample; typedef typename Triangulation::SQueue SQueue; - typedef typename Triangulation::Reconstruction_edge_2 Reconstruction_edge_2; + typedef typename Triangulation::Rec_edge_2 Rec_edge_2; typedef typename Triangulation::MultiIndex MultiIndex; @@ -387,16 +385,16 @@ protected: init(start, beyond); - std::list m_samples; + std::list m_samples; for (InputIterator it = start; it != beyond; it++) { #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 - Point point = get(point_pmap, it); + Point point = get(point_pmap, it); FT mass = get( mass_pmap, it); #else Point point = get(point_pmap, *it); FT mass = get( mass_pmap, *it); #endif - Sample* s = new Sample(point, mass); + Sample_* s = new Sample_(point, mass); m_samples.push_back(s); } assign_samples(m_samples.begin(), m_samples.end()); @@ -476,7 +474,7 @@ protected: m_dt.cleanup_assignments(); } - template // value_type = Sample* + template // value_type = Sample_* void assign_samples(Iterator begin, Iterator end) { double timer = clock(); std::cerr << yellow << "assign samples" << white << "..."; @@ -559,7 +557,7 @@ protected: return true; } - bool simulate_collapse(const Edge& edge, Cost& cost) { + bool simulate_collapse(const Edge& edge, Cost_& cost) { bool ok; Vertex_handle s = m_dt.source_vertex(edge); Vertex_handle t = m_dt.target_vertex(edge); @@ -610,18 +608,18 @@ protected: return true; } - template // value_type = Sample* + template // value_type = Sample_* void backup_samples(Iterator begin, Iterator end) { for (Iterator it = begin; it != end; ++it) { - Sample* sample = *it; + Sample_* sample = *it; sample->backup(); } } - template // value_type = Sample* + template // value_type = Sample_* void restore_samples(Iterator begin, Iterator end) { for (Iterator it = begin; it != end; ++it) { - Sample* sample = *it; + Sample_* sample = *it; sample->restore(); } } @@ -630,7 +628,7 @@ protected: bool decimate() { bool ok; - Reconstruction_edge_2 pedge; + Rec_edge_2 pedge; ok = pick_edge(m_mchoice, pedge); if (!ok) return false; @@ -641,8 +639,8 @@ protected: return true; } -bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { - Cost after_cost; +bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { + Cost_ after_cost; bool ok = simulate_collapse(edge, after_cost); if (!ok) return false; @@ -652,15 +650,15 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { return false; Vertex_handle source = m_dt.source_vertex(edge); - Cost before_cost = m_dt.compute_cost_around_vertex(source); + Cost_ before_cost = m_dt.compute_cost_around_vertex(source); FT before = before_cost.finalize(m_alpha); FT after = after_cost.finalize(m_alpha); - pedge = Reconstruction_edge_2(edge, before, after); + pedge = Rec_edge_2(edge, before, after); return true; } - bool is_within_tol(const Cost& cost) const { + bool is_within_tol(const Cost_& cost) const { if (cost.max_norm() > m_norm_tol) return false; if (cost.max_tang() > m_tang_tol) @@ -716,7 +714,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { // PQUEUE (MCHOICE or EXHAUSTIVE) // - bool pick_edge(std::size_t nb, Reconstruction_edge_2& best_pedge) { + bool pick_edge(std::size_t nb, Rec_edge_2& best_pedge) { if (m_dt.number_of_faces() < 2) return false; @@ -740,7 +738,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { return ok; } - bool pick_edge_from_pqueue(Reconstruction_edge_2& best_pedge) { + bool pick_edge_from_pqueue(Rec_edge_2& best_pedge) { if (m_mindex.empty()) populate_pqueue(); if (m_mindex.empty()) @@ -750,7 +748,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { return true; } - bool pick_edge_brute_force(Reconstruction_edge_2& best_pedge) { + bool pick_edge_brute_force(Rec_edge_2& best_pedge) { MultiIndex mindex; Finite_edges_iterator ei; for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); @@ -768,10 +766,10 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { return true; } - bool pick_edge_randomly(std::size_t nb, Reconstruction_edge_2& best_pedge) { + bool pick_edge_randomly(std::size_t nb, Rec_edge_2& best_pedge) { MultiIndex mindex; for (std::size_t i = 0; i < nb; ++i) { - Reconstruction_edge_2 pedge; + Rec_edge_2 pedge; if (random_pedge(pedge)) mindex.insert(pedge); } @@ -800,7 +798,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { if (m_dt.is_target_cyclic(edge)) return false; - Reconstruction_edge_2 pedge; + Rec_edge_2 pedge; bool ok = create_pedge(edge, pedge); if (!ok) return false; @@ -810,7 +808,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { - bool random_pedge(Reconstruction_edge_2& pedge) { + bool random_pedge(Rec_edge_2& pedge) { for (unsigned i = 0; i < 10; ++i) { Edge edge = m_dt.random_finite_edge(); if (m_dt.is_pinned(edge)) @@ -835,7 +833,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { typename Edge_list::const_iterator ei; for (ei = edges.begin(); ei != edges.end(); ++ei) { Edge edge = *ei; - (m_mindex.template get<0>()).erase(Reconstruction_edge_2(edge)); + (m_mindex.template get<0>()).erase(Rec_edge_2(edge)); } } @@ -1159,7 +1157,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { void compute_relocation_for_vertex(Vertex_handle vertex, FT& coef, Vector& rhs) { - Sample* sample = vertex->get_sample(); + Sample_* sample = vertex->get_sample(); if (sample) { const FT m = sample->mass(); const Point& ps = sample->point(); @@ -1180,7 +1178,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { Vector grad(0.0, 0.0); Sample_list_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; const FT m = sample->mass(); const Point& ps = sample->point(); @@ -1203,7 +1201,7 @@ bool create_pedge(const Edge& edge, Reconstruction_edge_2& pedge) { Sample_list_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; const FT m = sample->mass(); const Point& ps = sample->point(); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 872c7d1117a..d86e3ed0482 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -119,28 +119,28 @@ public: typedef std::list Point_list; typedef typename Point_list::const_iterator Point_list_const_iterator; - typedef typename Cost Cost; - typedef Sample Sample; - typedef std::list Sample_list; + typedef Cost Cost_; + typedef Sample Sample_; + typedef std::list Sample_list; typedef typename Sample_list::const_iterator Sample_list_const_iterator; - typedef Sample_with_priority PSample; + typedef Sample_with_priority PSample; typedef std::priority_queue, greater_priority > SQueue; - typedef typename Reconstruction_edge_2 - Reconstruction_edge_2; + typedef Reconstruction_edge_2 + Rec_edge_2; typedef boost::multi_index_container< - Reconstruction_edge_2, + Rec_edge_2, boost::multi_index::indexed_by< - // sort by Reconstruction_edge_2::operator< + // sort by Rec_edge_2::operator< boost::multi_index::ordered_unique< boost::multi_index::identity< - Reconstruction_edge_2 > > , - // sort by Reconstruction_edge_2::priority() + Rec_edge_2 > > , + // sort by Rec_edge_2::priority() boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun< - Reconstruction_edge_2,const FT,&Reconstruction_edge_2::priority> > + Rec_edge_2,const FT,&Rec_edge_2::priority> > > > MultiIndex; @@ -291,21 +291,21 @@ public: edge.first->mass(edge.second) = mass; } - const Cost& get_cost(const Edge& edge) const { + const Cost_& get_cost(const Edge& edge) const { return edge.first->cost(edge.second); } - void set_vertex_cost(const Edge& edge, const Cost& cost) { + void set_vertex_cost(const Edge& edge, const Cost_& cost) { edge.first->vertex_cost(edge.second) = cost; } - void set_edge_cost(const Edge& edge, const Cost& cost) { + void set_edge_cost(const Edge& edge, const Cost_& cost) { edge.first->edge_cost(edge.second) = cost; } FT get_vertex_minus_edge_cost(const Edge& edge) const { - const Cost& vcost = edge.first->vertex_cost(edge.second); - const Cost& ecost = edge.first->edge_cost(edge.second); + const Cost_& vcost = edge.first->vertex_cost(edge.second); + const Cost_& ecost = edge.first->edge_cost(edge.second); return vcost.finalize() - m_factor * ecost.finalize(); } @@ -365,7 +365,7 @@ public: if (cleanup) face->clean_all_samples(); } - Sample* sample = vertex->get_sample(); + Sample_* sample = vertex->get_sample(); if (sample) samples.push_back(sample); if (cleanup) @@ -383,7 +383,7 @@ public: for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); vi != Base::finite_vertices_end(); ++vi) { Vertex_handle v = vi; - Sample* sample = v->get_sample(); + Sample_* sample = v->get_sample(); if (sample) samples.push_back(sample); } @@ -402,21 +402,21 @@ public: // COST // - Cost compute_total_cost() const { - Cost sum; + Cost_ compute_total_cost() const { + Cost_ sum; for (Finite_edges_iterator ei = Base::finite_edges_begin(); ei != Base::finite_edges_end(); ++ei) { Edge edge = *ei; - const Cost& cost = get_cost(edge); + const Cost_& cost = get_cost(edge); sum.update_max(cost); sum.add(cost); } return sum; } - Cost compute_cost_around_vertex(Vertex_handle vertex) const { - Cost inner; - Cost outer; + Cost_ compute_cost_around_vertex(Vertex_handle vertex) const { + Cost_ inner; + Cost_ outer; Face_circulator fcirc = Base::incident_faces(vertex); Face_circulator fend = fcirc; CGAL_For_all(fcirc, fend) @@ -425,7 +425,7 @@ public: int index = face->index(vertex); Edge edge(face, index); - Cost cost = get_cost(edge); + Cost_ cost = get_cost(edge); outer.update_max(cost); outer.add(cost); @@ -441,7 +441,7 @@ public: } inner.divide(2.0); - Cost sum; + Cost_ sum; sum.add(inner); sum.add(outer); sum.update_max(inner); @@ -470,14 +470,14 @@ public: typename Sample_list::const_iterator it; const Sample_list& samples0 = edge.first->samples(edge.second); for (it = samples0.begin(); it != samples0.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; mass += sample->mass(); } Edge twin = twin_edge(edge); const Sample_list& samples1 = twin.first->samples(twin.second); for (it = samples1.begin(); it != samples1.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; mass += sample->mass(); } @@ -505,7 +505,7 @@ public: FT M = get_mass(edge); FT L = get_length(edge); sort_samples_from_edge(edge, squeue); - Cost cost = compute_cost_from_squeue(squeue, M, L); + Cost_ cost = compute_cost_from_squeue(squeue, M, L); Edge twin = twin_edge(edge); set_edge_cost(edge, cost); @@ -516,25 +516,25 @@ public: typename Sample_list::const_iterator it; const Sample_list& samples0 = edge.first->samples(edge.second); for (it = samples0.begin(); it != samples0.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; squeue.push(PSample(sample, sample->coordinate())); } Edge twin = twin_edge(edge); const Sample_list& samples1 = twin.first->samples(twin.second); for (it = samples1.begin(); it != samples1.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; squeue.push(PSample(sample, 1.0 - sample->coordinate())); } } - Cost compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) { + Cost_ compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) { if (squeue.empty()) - return Cost(); + return Cost_(); if (M == 0.0) - return Cost(); + return Cost_(); - Cost sum; + Cost_ sum; FT start = 0.0; FT coef = L / M; while (!squeue.empty()) { @@ -550,7 +550,7 @@ public: FT norm2 = psample.sample()->distance2(); FT tang2 = bin * bin / 12 + pos * pos; - sum.add(Cost(norm2, tang2), mass); + sum.add(Cost_(norm2, tang2), mass); sum.compute_max(norm2, tang2); start += bin; @@ -567,10 +567,10 @@ public: collect_samples_from_edge(edge, samples); collect_samples_from_edge(twin, samples); - Cost sum; + Cost_ sum; for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; FT mass = sample->mass(); const Point& query = sample->point(); @@ -581,7 +581,7 @@ public: FT norm2 = sample->distance2(); FT tang2 = dist2 - norm2; - sum.add(Cost(norm2, tang2), mass); + sum.add(Cost_(norm2, tang2), mass); sum.compute_max(norm2, tang2); } set_vertex_cost(edge, sum); @@ -590,23 +590,23 @@ public: // SAMPLE // - template // value_type = Sample* + template // value_type = Sample_* void assign_samples(Iterator begin, Iterator end) { for (Iterator it = begin; it != end; ++it) { - Sample* sample = *it; + Sample_* sample = *it; assign_sample(sample); } } - template // value_type = Sample* + template // value_type = Sample_* void assign_samples_brute_force(Iterator begin, Iterator end) { for (Iterator it = begin; it != end; ++it) { - Sample* sample = *it; + Sample_* sample = *it; assign_sample_brute_force(sample); } } - bool assign_sample(Sample* sample) { + bool assign_sample(Sample_* sample) { const Point& point = sample->point(); Face_handle face = Base::locate(point); @@ -626,7 +626,7 @@ public: return true; } - bool assign_sample_brute_force(Sample* sample) { + bool assign_sample_brute_force(Sample_* sample) { const Point& point = sample->point(); Face_handle nearest_face = Face_handle(); for (Finite_faces_iterator fi = Base::finite_faces_begin(); @@ -695,7 +695,7 @@ public: return nearest; } - void assign_sample_to_vertex(Sample* sample, Vertex_handle vertex) { + void assign_sample_to_vertex(Sample_* sample, Vertex_handle vertex) { if (vertex->get_sample()) { std::cout << "assign to vertex: vertex already has sample" << std::endl; @@ -706,7 +706,7 @@ public: vertex->set_sample(sample); } - void assign_sample_to_edge(Sample* sample, const Edge& edge) { + void assign_sample_to_edge(Sample_* sample, const Edge& edge) { Segment segment = get_segment(edge); const Point& query = sample->point(); sample->distance2() = compute_distance2(query, segment); @@ -971,7 +971,7 @@ public: } //TODO IV remove -------- - void print_edge(Reconstruction_edge_2 edge) { + void print_edge(Rec_edge_2 edge) { int i = ((edge).edge()).second; Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); @@ -993,7 +993,7 @@ public: Vertex_handle b = target_vertex(ab); FT D = signed_distance_from_intersection(a, b, target, source); if (D < 0.0) { - multi_ind.insert(Reconstruction_edge_2(ab, D)); + multi_ind.insert(Rec_edge_2(ab, D)); } } @@ -1001,7 +1001,7 @@ public: int nb_flips = 0; while (!multi_ind.empty()) { - Reconstruction_edge_2 pedge = *(multi_ind.template get<1>()).begin(); + Rec_edge_2 pedge = *(multi_ind.template get<1>()).begin(); FT Dbc = pedge.priority(); Edge bc = pedge.edge(); (multi_ind.template get<0>()).erase(pedge); @@ -1016,16 +1016,16 @@ public: Vertex_handle c = target_vertex(bc); Vertex_handle d = target_vertex(cd); - FT Dac = std::numeric_limits::lowest(); + FT Dac = -std::numeric_limits::max(); if (a != c && is_triangle_ccw(a, b, c)) Dac = signed_distance_from_intersection(a, c, target, source); - FT Dbd = std::numeric_limits::lowest(); + FT Dbd = -std::numeric_limits::max(); if (b != d && is_triangle_ccw(b, c, d)) Dbd = signed_distance_from_intersection(b, d, target, source); - if (Dac == std::numeric_limits::lowest() && Dbd == - std::numeric_limits::lowest()) + if (Dac == -std::numeric_limits::max() && Dbd == + -std::numeric_limits::max()) { // TODO: IV comment in std::cerr << red << "--- //No flips available ---" << white << std::endl; @@ -1053,19 +1053,19 @@ public: if (Dac > Dbd) { - (multi_ind.template get<0>()).erase(Reconstruction_edge_2(ab)); + (multi_ind.template get<0>()).erase(Rec_edge_2(ab)); Edge ac = flip(sb, edge, verbose); if (Dac < 0.0) { - multi_ind.insert(Reconstruction_edge_2(ac, Dac)); + multi_ind.insert(Rec_edge_2(ac, Dac)); } } else { - (multi_ind.template get<0>()).erase(Reconstruction_edge_2(cd)); + (multi_ind.template get<0>()).erase(Rec_edge_2(cd)); Edge bd = flip(sc, edge, verbose); if (Dbd < 0.0) { - multi_ind.insert(Reconstruction_edge_2(bd, Dbd)); + multi_ind.insert(Rec_edge_2(bd, Dbd)); } } nb_flips++; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 5b763f70c82..6287e7e4b31 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -40,7 +40,7 @@ class Reconstruction_vertex_base_2 : public Vb public: typedef Vb Base; typedef typename Kernel::FT FT; - typedef typename Sample Sample; + typedef Sample Sample_; typedef typename Kernel::Point_2 Point; typedef typename Base::Face_handle Face_handle; @@ -53,7 +53,7 @@ public: private: int m_id; bool m_pinned; - Sample* m_sample; + Sample_* m_sample; Point m_relocated; FT m_relevance; @@ -106,8 +106,8 @@ public: FT get_relevance() const { return m_relevance; } void set_relevance(FT relevance) { m_relevance = relevance; } - Sample* get_sample() const { return m_sample; } - void set_sample(Sample* sample) { m_sample = sample; } + Sample_* get_sample() const { return m_sample; } + void set_sample(Sample_* sample) { m_sample = sample; } const Point& relocated() const { return m_relocated; } Point& relocated() { return m_relocated; } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 99df9de2702..59374743d4e 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -8,7 +8,7 @@ #include #include "testing_tools.h" -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index 42b31720915..ec46e879060 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -28,7 +28,7 @@ int main () load_xy_file_points("data/stair-noise00.xy", points); - for (int i = 1; i <= points.size();) { + for (std::size_t i = 1; i <= points.size();) { CGAL::Reconstruction_simplification_2 rs2(points); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 3970f46c5d8..7006955523b 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -25,7 +25,7 @@ typedef CGAL::Reconstruction_simplification_2 Rs_2; typedef Rs_2::Vertex Vertex; -typedef Rs_2::Reconstruction_edge_2 R_edge_2; +typedef Rs_2::Rec_edge_2 R_edge_2; void test_list_output(Rs_2& rs2); void test_index_output(Rs_2& rs2); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index 0d0c3b237de..f4ee01c7b6c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -34,7 +34,7 @@ typedef CGAL::Reconstruction_triangulation_2 Rt_2; typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; typedef Rt_2::Edge Edge; -typedef Rt_2::Reconstruction_edge_2 R_edge_2; +typedef Rt_2::Rec_edge_2 R_edge_2; PointMassList* load_xy_file(const std::string& fileName); PointMassList* simple_point_set(); @@ -117,6 +117,7 @@ void test_edge_collapse() { //test that the edge was collapsed assert(!found); + CGAL_USE(found); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h index 3d0ee4b8af7..3d08e8c595a 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h @@ -4,7 +4,7 @@ template void load_xy_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(filename); + std::ifstream ifs(filename.c_str()); Point point; while (ifs >> point) points.push_back(std::make_pair(point, 1)); @@ -15,7 +15,7 @@ void load_xy_file(const std::string& filename, PointMassList& points) template void load_xy_file_points(const std::string& fileName, std::list& points) { - std::ifstream ifs(fileName); + std::ifstream ifs(fileName.c_str()); Point point; while (ifs >> point) { From 5c06ca468dba813e41a9163c50b3bf9f1cd5eefd Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 22:33:38 +0200 Subject: [PATCH 142/201] Fix compilation of examples on Linux --- .../reconstruction_simplification_2_mass_example.cpp | 2 +- .../reconstruction_simplification_2_output_example.cpp | 2 +- .../reconstruction_simplification_2_simplest_example.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp index 7a5ea5b1487..d044c97fafd 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp @@ -30,7 +30,7 @@ typedef CGAL::Reconstruction_simplification_2< void load_xym_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(filename); + std::ifstream ifs(filename.c_str()); Point point; FT mass; diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp index 6731f403c48..5d2cfe3591f 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp @@ -18,7 +18,7 @@ typedef CGAL::Reconstruction_simplification_2 Rs_2; void load_xy_file(const std::string& filename, std::list& points) { - std::ifstream ifs(filename); + std::ifstream ifs(filename.c_str()); Point point; while (ifs >> point) points.push_back(point); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp index e712118a419..b78b879b19a 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp @@ -21,7 +21,7 @@ typedef CGAL::Reconstruction_simplification_2 Rs_2; void load_xy_file(const std::string& fileName, std::list& points) { - std::ifstream ifs(fileName); + std::ifstream ifs(fileName.c_str()); Point point; while (ifs >> point) From 4c80c24ffa7608593dc8a17c65f370abf9b23178 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 23:07:09 +0200 Subject: [PATCH 143/201] Fix compilation of demo with GCC --- ...Reconstruction_simplification_kerneled_2.h | 8 +- .../glviewer.h | 1 - .../render.cpp | 8 +- .../Reconstruction_simplification_2/scene.h | 73 +++++++++---------- 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h index 257105e7ca8..c22991a741a 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -28,22 +28,22 @@ typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; typedef CGAL::Reconstruction_simplification_2 Reconstruction_simplification_2; + Mass_property_map> Rs_2; class Reconstruction_simplification_kerneled_2: - public Reconstruction_simplification_2 { + public Rs_2 { public: template Reconstruction_simplification_kerneled_2(const InputRange& input_range, Point_property_map point_pmap, Mass_property_map mass_pmap) : - Reconstruction_simplification_2(input_range, point_pmap, + Rs_2(input_range, point_pmap, mass_pmap) { } Reconstruction_simplification_kerneled_2() : - Reconstruction_simplification_2() { + Rs_2() { } // RENDER // diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h index 795026735e1..b3286388107 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.h @@ -13,7 +13,6 @@ class GlViewer : public QGLWidget Q_OBJECT private: - typedef Scene::Point Point; Scene* m_scene; // toggles diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 4867641a0a3..06079948886 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -8,7 +8,7 @@ #include -typedef Reconstruction_simplification_kerneled_2::Reconstruction_edge_2 PEdge; +typedef Reconstruction_simplification_kerneled_2::Rec_edge_2 PEdge; typedef Reconstruction_simplification_kerneled_2 R_s_k_2; void R_s_k_2::print_stats() const @@ -171,7 +171,7 @@ void R_s_k_2::draw_edge_footpoints(const Triangulation& mesh, Sample_list::const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; Point p = sample->point(); FT m = 0.5*(1.0 - sample->mass()); @@ -403,7 +403,7 @@ void R_s_k_2::draw_bins_plan0(const Edge& edge) Sample_list_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; const Point& ps = sample->point(); Point q = pa; @@ -899,7 +899,7 @@ void R_s_k_2::draw_vertex_edges(Vertex_handle vertex, { Edge e(f, i); if (mesh.is_infinite(e)) continue; - if (i == index) ::glColor3f(ro, go, bo); + if (static_cast(i) == index) ::glColor3f(ro, go, bo); else ::glColor3f(ri, gi, bi); draw_edge(e); } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index bb748582419..ac52e2ac9b4 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -38,8 +38,6 @@ public: typedef K::Segment_2 Segment; - typedef R_s_2::FT FT; - typedef R_s_2::Point Point; typedef R_s_2::Vector Vector; typedef R_s_2::Vertex Vertex; @@ -67,8 +65,7 @@ public: typedef R_s_2::Edge_list Edge_list; - typedef R_s_2::Cost Cost; - typedef R_s_2::Sample Sample; + typedef R_s_2::Sample_ Sample_; typedef R_s_2::Sample_list Sample_list; typedef R_s_2::Sample_list_const_iterator Sample_list_const_iterator; @@ -78,12 +75,12 @@ public: typedef R_s_2::PSample PSample; typedef R_s_2::SQueue SQueue; - typedef R_s_2::Reconstruction_edge_2 PEdge; + typedef R_s_2::Rec_edge_2 PEdge; private: // data - std::list m_samples; + std::list m_samples; double m_min_mass; double m_max_mass; @@ -128,9 +125,9 @@ public: void invert_mass() { double new_max_mass = 0.0; - std::list::iterator it; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample& sample = *it; + Sample_& sample = *it; sample.mass() = m_max_mass - sample.mass(); new_max_mass = (std::max)(new_max_mass, sample.mass()); } @@ -138,10 +135,10 @@ public: } void clamp_mass() { - std::list new_samples; - std::list::iterator it; + std::list new_samples; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample& sample = *it; + Sample_& sample = *it; if (sample.mass() > m_min_mass) { sample.mass() = 1.0; new_samples.push_back(sample); @@ -155,22 +152,22 @@ public: if (m_samples.size() < 3) return; - std::list new_samples; - std::list::const_iterator it = m_samples.begin(); - std::list::const_iterator last = it++; + std::list new_samples; + std::list::const_iterator it = m_samples.begin(); + std::list::const_iterator last = it++; while (it != m_samples.end()) { Point p = CGAL::midpoint(last->point(), it->point()); FT m = 0.5 * (last->mass() + it->mass()); - new_samples.push_back(Sample(p, m)); + new_samples.push_back(Sample_(p, m)); last = it++; } it = m_samples.begin(); Point p = CGAL::midpoint(last->point(), it->point()); FT m = 0.5 * (last->mass() + it->mass()); - new_samples.push_back(Sample(p, m)); + new_samples.push_back(Sample_(p, m)); - std::list final_samples; - std::list::const_iterator it2 = new_samples.begin(); + std::list final_samples; + std::list::const_iterator it2 = new_samples.begin(); while (it != m_samples.end() && it2 != new_samples.end()) { final_samples.push_back(*it); final_samples.push_back(*it2); @@ -184,7 +181,7 @@ public: // SAMPLE // void add_sample(const Point& point, const FT mass = 1.0) { - m_samples.push_back(Sample(point, mass)); + m_samples.push_back(Sample_(point, mass)); m_max_mass = (std::max)(m_max_mass, mass); } @@ -199,9 +196,9 @@ public: void noise(const FT scale) { std::cerr << "noise by " << scale << "..."; - std::list::iterator it; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { - Sample& sample = *it; + Sample_& sample = *it; Point& point = sample.point(); point = point + random_vec(scale); } @@ -215,9 +212,9 @@ public: return; Point center(m_bbox_x, m_bbox_y); - std::list::iterator it; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample& sample = *it; + Sample_& sample = *it; Vector vec = (sample.point() - center) / m_bbox_size; sample.point() = CGAL::ORIGIN + vec; } @@ -233,7 +230,7 @@ public: } FT x_min, x_max, y_min, y_max; - std::list::const_iterator it = m_samples.begin(); + std::list::const_iterator it = m_samples.begin(); Point p = it->point(); x_min = x_max = p.x(); y_min = y_max = p.y(); @@ -441,9 +438,9 @@ public: } Sample_list samples; - for (std::list::iterator it = m_samples.begin(); + for (std::list::iterator it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample& s = *it; + Sample_& s = *it; if (s.mass() < m_min_mass) continue; samples.push_back(&s); @@ -477,7 +474,7 @@ public: std::list::const_iterator ni = normals.begin(); for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; ofs << sample->point() << " " << *ni << std::endl; ni++; } @@ -515,7 +512,7 @@ public: std::ofstream ofs(qPrintable(filename)); for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; ofs << sample->point() << std::endl; } ofs.close(); @@ -526,7 +523,7 @@ public: ofs << "POFF " << samples.size() << " 0 0" << std::endl; for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) { - Sample* sample = *it; + Sample_* sample = *it; ofs << sample->point() << std::endl; } ofs.close(); @@ -538,7 +535,7 @@ public: unsigned int i = 0; for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it, ++i) { - Sample* sample = *it; + Sample_* sample = *it; ofs << i << " " << sample->point() << std::endl; } ofs.close(); @@ -591,9 +588,9 @@ public: void decimate(const double percentage) { std::cout << "Decimate from " << m_samples.size() << " to..."; - std::list selected; + std::list selected; - std::list::iterator it; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { const double rd = random_double(0.0, 1.0); if (rd >= percentage) @@ -608,10 +605,10 @@ public: void keep_one_point_out_of(const int n) { std::cout << "Decimate from " << m_samples.size() << " to..."; - std::list selected; + std::list selected; int index = 0; - std::list::iterator it; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++, index++) { if (index % n == 0) selected.push_back(*it); @@ -625,9 +622,9 @@ public: void select_samples(const double percentage, Sample_list& vertices, Sample_list& samples) { - std::list::iterator it; + std::list::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample& s = *it; + Sample_& s = *it; if (s.mass() <= m_min_mass) continue; @@ -742,7 +739,7 @@ public: ::glPointSize(point_size); ::glBegin(GL_POINTS); - std::list::const_iterator it; + std::list::const_iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { double mass = it->mass(); if (mass <= m_min_mass) @@ -772,7 +769,7 @@ public: ::glColor4f(1.0f, 1.0f, 0.2f, 0.25f); for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); it++) { - Sample* sample = *it; + Sample_* sample = *it; draw_one_circle(sample->point()); } ::glDisable(GL_BLEND); From b9a8dd5e16f56a4f511532663b8cca296c813096 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 10 Jun 2015 23:18:11 +0200 Subject: [PATCH 144/201] Fix MSVC compilation now... --- .../include/CGAL/Reconstruction_triangulation_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index d86e3ed0482..733c09c16b7 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -1016,16 +1016,16 @@ public: Vertex_handle c = target_vertex(bc); Vertex_handle d = target_vertex(cd); - FT Dac = -std::numeric_limits::max(); + FT Dac = -(std::numeric_limits::max)(); if (a != c && is_triangle_ccw(a, b, c)) Dac = signed_distance_from_intersection(a, c, target, source); - FT Dbd = -std::numeric_limits::max(); + FT Dbd = -(std::numeric_limits::max)(); if (b != d && is_triangle_ccw(b, c, d)) Dbd = signed_distance_from_intersection(b, d, target, source); - if (Dac == -std::numeric_limits::max() && Dbd == - -std::numeric_limits::max()) + if (Dac == -(std::numeric_limits::max)() && Dbd == + -(std::numeric_limits::max)()) { // TODO: IV comment in std::cerr << red << "--- //No flips available ---" << white << std::endl; From 6e9c42efbda52fccdc2956f0ce5ab17b1c0c3b4e Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Thu, 11 Jun 2015 22:42:36 +0200 Subject: [PATCH 145/201] index_output => indexed_output --- .../reconstruction_simplification_2_output_example.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp index 5d2cfe3591f..647e638e34b 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp @@ -47,7 +47,7 @@ void list_output(Rs_2& rs2) } -void index_output(Rs_2& rs2) +void indexed_output(Rs_2& rs2) { std::cout << "(-------------Off output---------- )" << std::endl; @@ -89,7 +89,7 @@ int main () rs2.run(100); // 100 steps list_output(rs2); - index_output(rs2); + indexed_output(rs2); return 0; } From b83f07f3d6f76d79c7d31ab69a4cad40bf3ea481 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Thu, 11 Jun 2015 23:16:33 +0200 Subject: [PATCH 146/201] Minor improvements to the doc --- .../Reconstruction_Simplification_2.txt | 2 +- .../include/CGAL/Reconstruction_simplification_2.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index 5d013ce1d91..dd529809eac 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -64,7 +64,7 @@ one can use the run_until function \code{.cpp} rs2.run_until(20); // perform edge contractions until only 20 vertices are left. \endcode -and specify the number of output vertices one wants to keep as illustrated next. +and specify the number of output vertices one wants to keep as illustrated in Figure \cgalFigureRef{2D_Reconstruction_Simplification_twenty_vertices}. \cgalFigureBegin{2D_Reconstruction_Simplification_twenty_vertices,twenty_vertices.png} Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and 200 input points respectively. The examples illustrates the behavior of the algorithm when the input point density decreases. diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 3839e0326fd..d46fe7968ee 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -197,8 +197,8 @@ protected: \param input_range range of input data. \param point_map A `ReadablePropertyMap` used to access the input points. - \param mass_map A `ReadablePropertyMap` used to access the input points' mass. - \param sample_size If `sample_size != 0`, the size of the random sample replaces the exhaustive priority queue. + \param mass_map A `ReadablePropertyMap` used to access the input points' masses. + \param sample_size If `sample_size != 0`, the size of the random sample which replaces the exhaustive priority queue. \param use_flip If `true` the edge flipping procedure is used to ensure that every edge can be made collapsible. \param relocation The number of point relocations that are performed between two edge collapses. \param verbose controls how much console output is produced by the algorithm. The values are 0, 1, or > 1. @@ -1387,10 +1387,10 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { } /*! - Computes a shape, reconstructing the input, by performing `steps` many + Computes a shape, reconstructing the input, by performing `steps` edge collapse operators on the output simplex. - \param steps The number of edge collapse operators performed by the algorithm. + \param steps The number of edge collapse operators to be performed. */ void run(const unsigned steps) { double timer = clock(); From e9703eed88298faae3b4d7e084f2f2d9e8117fb3 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 14:52:14 +0200 Subject: [PATCH 147/201] Take params into account --- .../include/CGAL/Reconstruction_simplification_2.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index d46fe7968ee..aff2ed98149 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -212,7 +212,12 @@ protected: bool use_flip = true, std::size_t relocation = 0, std::size_t verbose = 0) - : point_pmap(point_map), mass_pmap(mass_map) + : point_pmap(point_map), + mass_pmap(mass_map), + m_mchoice(sample_size), + m_use_flip(use_flip), + m_relocation(relocation), + m_verbose(verbose) { initialize_parameters(); initialize(input_range.begin(), input_range.end()); From 51bbd88feed190cf6508ad14debcc08af276c742 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 15:01:00 +0200 Subject: [PATCH 148/201] Don't call initialize_parameters here --- .../CGAL/Reconstruction_simplification_2.h | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index aff2ed98149..4776b54edb4 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -212,14 +212,23 @@ protected: bool use_flip = true, std::size_t relocation = 0, std::size_t verbose = 0) - : point_pmap(point_map), - mass_pmap(mass_map), - m_mchoice(sample_size), - m_use_flip(use_flip), - m_relocation(relocation), - m_verbose(verbose) - { - initialize_parameters(); + : m_mchoice(sample_size), + m_use_flip(use_flip), + m_relocation(relocation), + m_verbose(verbose), + point_pmap(point_map), + mass_pmap(mass_map) + { + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; + + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; + + m_ignore = 0; initialize(input_range.begin(), input_range.end()); } From 2f937f9c35df1763b59a03f3e1b0e7399f6541e5 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 15:02:06 +0200 Subject: [PATCH 149/201] Untabify --- .../CGAL/Reconstruction_simplification_2.h | 2570 ++++++++--------- 1 file changed, 1285 insertions(+), 1285 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 4776b54edb4..ab532a12607 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -96,80 +96,80 @@ public: */ typedef typename Gt::Point_2 Point; - /// \cond SKIP_IN_MANUAL - /*! - Vector type. - */ - typedef typename Gt::Vector_2 Vector; + /// \cond SKIP_IN_MANUAL + /*! + Vector type. + */ + typedef typename Gt::Vector_2 Vector; - typedef typename std::pair PointMassPair; - typedef typename std::list PointMassList; + typedef typename std::pair PointMassPair; + typedef typename std::list PointMassList; - /*! - The Output simplex. - */ - typedef Reconstruction_triangulation_2 Triangulation; + /*! + The Output simplex. + */ + typedef Reconstruction_triangulation_2 Triangulation; - typedef typename Triangulation::Vertex Vertex; - typedef typename Triangulation::Vertex_handle Vertex_handle; - typedef typename Triangulation::Vertex_iterator Vertex_iterator; - typedef typename Triangulation::Vertex_circulator Vertex_circulator; - typedef typename Triangulation::Finite_vertices_iterator - Finite_vertices_iterator; + typedef typename Triangulation::Vertex Vertex; + typedef typename Triangulation::Vertex_handle Vertex_handle; + typedef typename Triangulation::Vertex_iterator Vertex_iterator; + typedef typename Triangulation::Vertex_circulator Vertex_circulator; + typedef typename Triangulation::Finite_vertices_iterator + Finite_vertices_iterator; - typedef typename Triangulation::Edge Edge; - typedef typename Triangulation::Edge_iterator Edge_iterator; - typedef typename Triangulation::Edge_circulator Edge_circulator; - typedef typename Triangulation::Finite_edges_iterator Finite_edges_iterator; + typedef typename Triangulation::Edge Edge; + typedef typename Triangulation::Edge_iterator Edge_iterator; + typedef typename Triangulation::Edge_circulator Edge_circulator; + typedef typename Triangulation::Finite_edges_iterator Finite_edges_iterator; - typedef typename Triangulation::Face Face; - typedef typename Triangulation::Face_handle Face_handle; - typedef typename Triangulation::Face_iterator Face_iterator; - typedef typename Triangulation::Face_circulator Face_circulator; - typedef typename Triangulation::Finite_faces_iterator Finite_faces_iterator; + typedef typename Triangulation::Face Face; + typedef typename Triangulation::Face_handle Face_handle; + typedef typename Triangulation::Face_iterator Face_iterator; + typedef typename Triangulation::Face_circulator Face_circulator; + typedef typename Triangulation::Finite_faces_iterator Finite_faces_iterator; - typedef typename Triangulation::Vertex_handle_map Vertex_handle_map; - typedef typename Triangulation::Face_handle_map Face_handle_map; + typedef typename Triangulation::Vertex_handle_map Vertex_handle_map; + typedef typename Triangulation::Face_handle_map Face_handle_map; - typedef typename Triangulation::Vertex_handle_set Vertex_handle_set; - typedef typename Triangulation::Edge_set Edge_set; + typedef typename Triangulation::Vertex_handle_set Vertex_handle_set; + typedef typename Triangulation::Edge_set Edge_set; - typedef typename Triangulation::Edge_list Edge_list; + typedef typename Triangulation::Edge_list Edge_list; - typedef typename Triangulation::Cost_ Cost_; - typedef typename Triangulation::Sample_ Sample_; - typedef typename Triangulation::Sample_list Sample_list; - typedef typename Triangulation::Sample_list_const_iterator - Sample_list_const_iterator; + typedef typename Triangulation::Cost_ Cost_; + typedef typename Triangulation::Sample_ Sample_; + typedef typename Triangulation::Sample_list Sample_list; + typedef typename Triangulation::Sample_list_const_iterator + Sample_list_const_iterator; - typedef typename Triangulation::Point_list Point_list; - typedef typename Triangulation::Point_list_const_iterator - Point_list_const_iterator; + typedef typename Triangulation::Point_list Point_list; + typedef typename Triangulation::Point_list_const_iterator + Point_list_const_iterator; - typedef typename Triangulation::PSample PSample; - typedef typename Triangulation::SQueue SQueue; + typedef typename Triangulation::PSample PSample; + typedef typename Triangulation::SQueue SQueue; - typedef typename Triangulation::Rec_edge_2 Rec_edge_2; + typedef typename Triangulation::Rec_edge_2 Rec_edge_2; - typedef typename Triangulation::MultiIndex MultiIndex; + typedef typename Triangulation::MultiIndex MultiIndex; /// @} protected: - Triangulation m_dt; - MultiIndex m_mindex; - int m_ignore; - int m_verbose; - std::size_t m_mchoice; // # Edges - bool m_use_flip; - double m_alpha; // [0, 1] - double m_norm_tol; // [0,BBOX] - double m_tang_tol; // [0,BBOX] - double m_ghost; // ghost vs solid - unsigned int m_relocation; // # relocations + Triangulation m_dt; + MultiIndex m_mindex; + int m_ignore; + int m_verbose; + std::size_t m_mchoice; // # Edges + bool m_use_flip; + double m_alpha; // [0, 1] + double m_norm_tol; // [0,BBOX] + double m_tang_tol; // [0,BBOX] + double m_ghost; // ghost vs solid + unsigned int m_relocation; // # relocations // bbox double m_bbox_x; @@ -177,35 +177,35 @@ protected: double m_bbox_size; PointMap point_pmap; - MassMap mass_pmap; + MassMap mass_pmap; - /// \endcond + /// \endcond - public: + public: - /// \name Initialization - /// @{ + /// \name Initialization + /// @{ - /*! + /*! The constructor of the reconstruction simplification class for a given range of point-mass pairs. which already builds an initial simplicial complex. - \tparam InputRange is a model of `Range` with forward iterators, + \tparam InputRange is a model of `Range` with forward iterators, providing input points and point masses through the following two property maps. - \param input_range range of input data. - \param point_map A `ReadablePropertyMap` used to access the input points. + \param input_range range of input data. + \param point_map A `ReadablePropertyMap` used to access the input points. - \param mass_map A `ReadablePropertyMap` used to access the input points' masses. + \param mass_map A `ReadablePropertyMap` used to access the input points' masses. \param sample_size If `sample_size != 0`, the size of the random sample which replaces the exhaustive priority queue. \param use_flip If `true` the edge flipping procedure is used to ensure that every edge can be made collapsible. \param relocation The number of point relocations that are performed between two edge collapses. \param verbose controls how much console output is produced by the algorithm. The values are 0, 1, or > 1. - */ - template - Reconstruction_simplification_2(const InputRange& input_range, + */ + template + Reconstruction_simplification_2(const InputRange& input_range, PointMap point_map = PointMap(), MassMap mass_map = MassMap(1), std::size_t sample_size = 0, @@ -219,1275 +219,1275 @@ protected: point_pmap(point_map), mass_pmap(mass_map) { - m_alpha = 0.5; - m_norm_tol = 1.0; - m_tang_tol = 1.0; - m_ghost = 1.0; + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; - m_bbox_x = 0.0; + m_bbox_x = 0.0; m_bbox_y = 0.0; m_bbox_size = 1.0; m_ignore = 0; - initialize(input_range.begin(), input_range.end()); - } + initialize(input_range.begin(), input_range.end()); + } - /// @} + /// @} /// \name Settting Parameters /// @{ - /*! + /*! If `sample_size == 0`, the simplification is performed using an exhaustive priority queue. If `sample_size` is stricly positive the simplification is performed using a - multiple choice approach, ie, a best-choice selection in a random sample of - edge collapse operators, of size `sample_size`. A typical value for the sample - size is 15, but this value must be enlarged when targeting a very coarse simplification. + multiple choice approach, ie, a best-choice selection in a random sample of + edge collapse operators, of size `sample_size`. A typical value for the sample + size is 15, but this value must be enlarged when targeting a very coarse simplification. \param sample_size If `sample_size != 0`, the size of the random sample replaces the priority queue. - */ + */ void set_random_sample_size(std::size_t sample_size) { - m_mchoice = sample_size; - } + m_mchoice = sample_size; + } - /*! - Determines how much console output the algorithm generates. - If set to a value larger than 0 - details about the reconstruction process are written to `std::err`. + /*! + Determines how much console output the algorithm generates. + If set to a value larger than 0 + details about the reconstruction process are written to `std::err`. - \param verbose The verbosity level. - */ + \param verbose The verbosity level. + */ void set_verbose(int verbose) { - m_verbose = verbose; - } + m_verbose = verbose; + } - /// \cond SKIP_IN_MANUAL - void set_alpha(const double alpha) { - m_alpha = alpha; - } - /// \endcond + /// \cond SKIP_IN_MANUAL + void set_alpha(const double alpha) { + m_alpha = alpha; + } + /// \endcond - /*! - The use_flip parameter determines whether the edge flipping procedure - is used for the half-edge collapse. - */ - void set_use_flip(const bool use_flip) { - m_use_flip = use_flip; - } + /*! + The use_flip parameter determines whether the edge flipping procedure + is used for the half-edge collapse. + */ + void set_use_flip(const bool use_flip) { + m_use_flip = use_flip; + } - /// \cond SKIP_IN_MANUAL - void set_norm_tol(const double norm_tol) { - m_norm_tol = norm_tol; - } + /// \cond SKIP_IN_MANUAL + void set_norm_tol(const double norm_tol) { + m_norm_tol = norm_tol; + } - double get_norm_tol() const { - return m_norm_tol; - } + double get_norm_tol() const { + return m_norm_tol; + } - void set_tang_tol(const double tang_tol) { - m_tang_tol = tang_tol; - } + void set_tang_tol(const double tang_tol) { + m_tang_tol = tang_tol; + } - double get_tang_tol() const { - return m_tang_tol; - } - /// \endcond + double get_tang_tol() const { + return m_tang_tol; + } + /// \endcond - /*! - Sets the number of vertex relocations - that are performed between two edge collapses. - */ + /*! + Sets the number of vertex relocations + that are performed between two edge collapses. + */ void set_relocation(unsigned int relocation) { - m_relocation = relocation; - } + m_relocation = relocation; + } - /// \cond SKIP_IN_MANUAL - unsigned int get_relocation() const { - return m_relocation; - } - /// \endcond + /// \cond SKIP_IN_MANUAL + unsigned int get_relocation() const { + return m_relocation; + } + /// \endcond - /*! - \param relevance The relevance threshold used for filtering the edges. - An edge is relevant from the approximation point of view - if it is long, covers a large mass (or equivalently the - number of points when all masses are equal), and has a - small transport cost. This notion is defined as - m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, - |e| denotes its length and cost(e) its transport cost. - As the cost is defined by mass time squared distance the - relevance is unitless. - - The default value is 0, so that all edges receiving some mass - are considered relevant. - Setting a large relevance value is used to get robustness to a - large amount of outliers. - */ - void set_relevance(const double relevance) { - m_ghost = relevance; - m_dt.ghost_factor() = m_ghost; - } + /*! + \param relevance The relevance threshold used for filtering the edges. + An edge is relevant from the approximation point of view + if it is long, covers a large mass (or equivalently the + number of points when all masses are equal), and has a + small transport cost. This notion is defined as + m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the edge, + |e| denotes its length and cost(e) its transport cost. + As the cost is defined by mass time squared distance the + relevance is unitless. + + The default value is 0, so that all edges receiving some mass + are considered relevant. + Setting a large relevance value is used to get robustness to a + large amount of outliers. + */ + void set_relevance(const double relevance) { + m_ghost = relevance; + m_dt.ghost_factor() = m_ghost; + } - /// \cond SKIP_IN_MANUAL - double get_ghost() { - return m_ghost; - } + /// \cond SKIP_IN_MANUAL + double get_ghost() { + return m_ghost; + } /// @} - /// \cond SKIP_IN_MANUAL + /// \cond SKIP_IN_MANUAL - Reconstruction_simplification_2() { - initialize_parameters(); - } + Reconstruction_simplification_2() { + initialize_parameters(); + } - ~Reconstruction_simplification_2() { - clear(); - } + ~Reconstruction_simplification_2() { + clear(); + } - void initialize_parameters() { + void initialize_parameters() { - m_verbose = 0; - m_mchoice = 0; - m_use_flip = true; - m_alpha = 0.5; - m_norm_tol = 1.0; - m_tang_tol = 1.0; - m_ghost = 1.0; - m_relocation = 0; + m_verbose = 0; + m_mchoice = 0; + m_use_flip = true; + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; + m_relocation = 0; - m_bbox_x = 0.0; + m_bbox_x = 0.0; m_bbox_y = 0.0; m_bbox_size = 1.0; m_ignore = 0; - } + } - //Function if one wants to create a Reconstruction_simplification_2 - //without yet specifying the input in the constructor. - template - void initialize(InputIterator start_itr, - InputIterator beyond_itr, - PointMap point_map, - MassMap mass_map) { + //Function if one wants to create a Reconstruction_simplification_2 + //without yet specifying the input in the constructor. + template + void initialize(InputIterator start_itr, + InputIterator beyond_itr, + PointMap point_map, + MassMap mass_map) { - point_pmap = point_map; - mass_pmap = mass_map; + point_pmap = point_map; + mass_pmap = mass_map; - initialize(start_itr, beyond_itr); + initialize(start_itr, beyond_itr); - } + } - template - void initialize(InputIterator start, InputIterator beyond) { + template + void initialize(InputIterator start, InputIterator beyond) { - clear(); + clear(); - insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); + insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); - init(start, beyond); + init(start, beyond); - std::list m_samples; - for (InputIterator it = start; it != beyond; it++) { + std::list m_samples; + for (InputIterator it = start; it != beyond; it++) { #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 Point point = get(point_pmap, it); - FT mass = get( mass_pmap, it); + FT mass = get( mass_pmap, it); #else - Point point = get(point_pmap, *it); - FT mass = get( mass_pmap, *it); + Point point = get(point_pmap, *it); + FT mass = get( mass_pmap, *it); #endif - Sample_* s = new Sample_(point, mass); - m_samples.push_back(s); - } - assign_samples(m_samples.begin(), m_samples.end()); - } + Sample_* s = new Sample_(point, mass); + m_samples.push_back(s); + } + assign_samples(m_samples.begin(), m_samples.end()); + } - template - Vector random_vec(const double scale) - { - double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; - double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; - return Vector(dx, dy); - } + template + Vector random_vec(const double scale) + { + double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + return Vector(dx, dy); + } - void clear() { - m_dt.clear(); - m_mindex.clear(); - } + void clear() { + m_dt.clear(); + m_mindex.clear(); + } - double time_duration(const double init) { - return (clock() - init) / CLOCKS_PER_SEC; - } + double time_duration(const double init) { + return (clock() - init) / CLOCKS_PER_SEC; + } - // INIT // - void insert_loose_bbox(const double x, const double y, const double size) { - double timer = clock(); - std::cerr << yellow << "insert loose bbox" << white << "..."; + // INIT // + void insert_loose_bbox(const double x, const double y, const double size) { + double timer = clock(); + std::cerr << yellow << "insert loose bbox" << white << "..."; - int nb = static_cast(m_dt.number_of_vertices()); - insert_point(Point(x - size, y - size), true, nb++); - insert_point(Point(x - size, y + size), true, nb++); - insert_point(Point(x + size, y + size), true, nb++); - insert_point(Point(x + size, y - size), true, nb++); + int nb = static_cast(m_dt.number_of_vertices()); + insert_point(Point(x - size, y - size), true, nb++); + insert_point(Point(x - size, y + size), true, nb++); + insert_point(Point(x + size, y + size), true, nb++); + insert_point(Point(x + size, y - size), true, nb++); - std::cerr << yellow << "done" << white << " (" << nb << " vertices, " - << yellow << time_duration(timer) << white << " s)" - << std::endl; - } + std::cerr << yellow << "done" << white << " (" << nb << " vertices, " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } - template // value_type = Point* - void init(Iterator begin, Iterator beyond) { - double timer = clock(); - std::cerr << yellow << "init" << white << "..."; + template // value_type = Point* + void init(Iterator begin, Iterator beyond) { + double timer = clock(); + std::cerr << yellow << "init" << white << "..."; int nb = static_cast(m_dt.number_of_vertices()); - m_dt.infinite_vertex()->pinned() = true; - for (Iterator it = begin; it != beyond; it++) { + m_dt.infinite_vertex()->pinned() = true; + for (Iterator it = begin; it != beyond; it++) { #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 Point point = get(point_pmap, it); #else Point point = get(point_pmap, *it); #endif - Vertex_handle vertex = insert_point(point, false, nb++); - } + Vertex_handle vertex = insert_point(point, false, nb++); + } - std::cerr << yellow << "done" << white << " (" << nb << " vertices, " - << yellow << time_duration(timer) << white << " s)" - << std::endl; - } + std::cerr << yellow << "done" << white << " (" << nb << " vertices, " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } - Vertex_handle insert_point(const Point& point, const bool pinned, - const int id) { - Vertex_handle v = m_dt.insert(point); - v->pinned() = pinned; - v->id() = id; - return v; - } + Vertex_handle insert_point(const Point& point, const bool pinned, + const int id) { + Vertex_handle v = m_dt.insert(point); + v->pinned() = pinned; + v->id() = id; + return v; + } - // ASSIGNMENT // + // ASSIGNMENT // - void cleanup_assignments() { - m_dt.cleanup_assignments(); - } + void cleanup_assignments() { + m_dt.cleanup_assignments(); + } - template // value_type = Sample_* - void assign_samples(Iterator begin, Iterator end) { - double timer = clock(); - std::cerr << yellow << "assign samples" << white << "..."; + template // value_type = Sample_* + void assign_samples(Iterator begin, Iterator end) { + double timer = clock(); + std::cerr << yellow << "assign samples" << white << "..."; - m_dt.assign_samples(begin, end); - m_dt.reset_all_costs(); + m_dt.assign_samples(begin, end); + m_dt.reset_all_costs(); - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; - } + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } - void reassign_samples() { - Sample_list samples; - m_dt.collect_all_samples(samples); - m_dt.cleanup_assignments(); - m_dt.assign_samples(samples.begin(), samples.end()); - m_dt.reset_all_costs(); - } + void reassign_samples() { + Sample_list samples; + m_dt.collect_all_samples(samples); + m_dt.cleanup_assignments(); + m_dt.assign_samples(samples.begin(), samples.end()); + m_dt.reset_all_costs(); + } - void reassign_samples_around_vertex(Vertex_handle vertex) { - Sample_list samples; - m_dt.collect_samples_from_vertex(vertex, samples, true); - m_dt.assign_samples(samples.begin(), samples.end()); + void reassign_samples_around_vertex(Vertex_handle vertex) { + Sample_list samples; + m_dt.collect_samples_from_vertex(vertex, samples, true); + m_dt.assign_samples(samples.begin(), samples.end()); - Edge_list hull; - m_dt.get_edges_from_star_minus_link(vertex, hull, true); - update_cost(hull.begin(), hull.end()); - } + Edge_list hull; + m_dt.get_edges_from_star_minus_link(vertex, hull, true); + update_cost(hull.begin(), hull.end()); + } - bool do_collapse(Edge edge) { - bool ok; - Vertex_handle s = m_dt.source_vertex(edge); - Vertex_handle t = m_dt.target_vertex(edge); + bool do_collapse(Edge edge) { + bool ok; + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle t = m_dt.target_vertex(edge); - if (m_verbose > 0) { - std::cerr << std::endl << green << "do collapse " << white << "(" - << s->id() << "->" << t->id() << ") ... " << std::endl; - } + if (m_verbose > 0) { + std::cerr << std::endl << green << "do collapse " << white << "(" + << s->id() << "->" << t->id() << ") ... " << std::endl; + } - Sample_list samples; - m_dt.collect_samples_from_vertex(s, samples, true); + Sample_list samples; + m_dt.collect_samples_from_vertex(s, samples, true); - Edge_list hull; - m_dt.get_edges_from_star_minus_link(s, hull, true); + Edge_list hull; + m_dt.get_edges_from_star_minus_link(s, hull, true); - if (m_mchoice == 0) - remove_stencil_from_pqueue(hull.begin(), hull.end()); + if (m_mchoice == 0) + remove_stencil_from_pqueue(hull.begin(), hull.end()); - if (m_use_flip) - ok = m_dt.make_collapsible(edge, hull.begin(), hull.end(), - m_verbose); + if (m_use_flip) + ok = m_dt.make_collapsible(edge, hull.begin(), hull.end(), + m_verbose); - // debug test - ok = m_dt.check_kernel_test(edge); - if (!ok) { - std::cerr << red << "do_collapse: kernel test failed: " << white - << std::endl; - return false; - } - // + // debug test + ok = m_dt.check_kernel_test(edge); + if (!ok) { + std::cerr << red << "do_collapse: kernel test failed: " << white + << std::endl; + return false; + } + // - m_dt.collapse(edge, m_verbose); + m_dt.collapse(edge, m_verbose); - m_dt.assign_samples(samples.begin(), samples.end()); + m_dt.assign_samples(samples.begin(), samples.end()); - update_cost(hull.begin(), hull.end()); + update_cost(hull.begin(), hull.end()); - if (m_mchoice == 0) - push_stencil_to_pqueue(hull.begin(), hull.end()); + if (m_mchoice == 0) + push_stencil_to_pqueue(hull.begin(), hull.end()); - for (unsigned int i = 0; i < m_relocation; ++i) { - relocate_one_ring(hull.begin(), hull.end()); - } + for (unsigned int i = 0; i < m_relocation; ++i) { + relocate_one_ring(hull.begin(), hull.end()); + } - if (m_verbose > 0) { - std::cerr << green << "done" << std::endl; - } + if (m_verbose > 0) { + std::cerr << green << "done" << std::endl; + } - return true; - } + return true; + } - bool simulate_collapse(const Edge& edge, Cost_& cost) { - bool ok; - Vertex_handle s = m_dt.source_vertex(edge); - Vertex_handle t = m_dt.target_vertex(edge); + bool simulate_collapse(const Edge& edge, Cost_& cost) { + bool ok; + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle t = m_dt.target_vertex(edge); - if (m_verbose > 1) { - std::cerr << green << "simulate collapse " << white << "(" - << s->id() << "->" << t->id() << ") ... " << std::endl; - } + if (m_verbose > 1) { + std::cerr << green << "simulate collapse " << white << "(" + << s->id() << "->" << t->id() << ") ... " << std::endl; + } - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - Vertex_handle copy_source = copy.source_vertex(copy_edge); + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_source = copy.source_vertex(copy_edge); - if (m_use_flip) { - Edge_list copy_hull; - copy.get_edges_from_star_minus_link(copy_source, copy_hull, true); - ok = copy.make_collapsible(copy_edge, copy_hull.begin(), - copy_hull.end(), m_verbose); - if (!ok) { - std::cerr << yellow << "simulation: failed (make collapsible)" - << white << std::endl; - return false; - } - } + if (m_use_flip) { + Edge_list copy_hull; + copy.get_edges_from_star_minus_link(copy_source, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), + copy_hull.end(), m_verbose); + if (!ok) { + std::cerr << yellow << "simulation: failed (make collapsible)" + << white << std::endl; + return false; + } + } - ok = copy.check_kernel_test(copy_edge); - if (!ok) { - std::cerr << yellow << "simulation: failed (kernel test)" << white - << std::endl; - return false; - } + ok = copy.check_kernel_test(copy_edge); + if (!ok) { + std::cerr << yellow << "simulation: failed (kernel test)" << white + << std::endl; + return false; + } - copy.collapse(copy_edge, m_verbose); + copy.collapse(copy_edge, m_verbose); - Sample_list samples; - m_dt.collect_samples_from_vertex(s, samples, false); + Sample_list samples; + m_dt.collect_samples_from_vertex(s, samples, false); - backup_samples(samples.begin(), samples.end()); - copy.assign_samples_brute_force(samples.begin(), samples.end()); - copy.reset_all_costs(); - cost = copy.compute_total_cost(); - restore_samples(samples.begin(), samples.end()); + backup_samples(samples.begin(), samples.end()); + copy.assign_samples_brute_force(samples.begin(), samples.end()); + copy.reset_all_costs(); + cost = copy.compute_total_cost(); + restore_samples(samples.begin(), samples.end()); - if (m_verbose > 1) { - std::cerr << green << "done" << white << std::endl; - } + if (m_verbose > 1) { + std::cerr << green << "done" << white << std::endl; + } - return true; - } + return true; + } - template // value_type = Sample_* - void backup_samples(Iterator begin, Iterator end) { - for (Iterator it = begin; it != end; ++it) { - Sample_* sample = *it; - sample->backup(); - } - } + template // value_type = Sample_* + void backup_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample_* sample = *it; + sample->backup(); + } + } - template // value_type = Sample_* - void restore_samples(Iterator begin, Iterator end) { - for (Iterator it = begin; it != end; ++it) { - Sample_* sample = *it; - sample->restore(); - } - } + template // value_type = Sample_* + void restore_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample_* sample = *it; + sample->restore(); + } + } - // PEDGE // + // PEDGE // - bool decimate() { - bool ok; - Rec_edge_2 pedge; - ok = pick_edge(m_mchoice, pedge); - if (!ok) - return false; + bool decimate() { + bool ok; + Rec_edge_2 pedge; + ok = pick_edge(m_mchoice, pedge); + if (!ok) + return false; - ok = do_collapse(pedge.edge()); - if (!ok) - return false; - return true; - } + ok = do_collapse(pedge.edge()); + if (!ok) + return false; + return true; + } bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { - Cost_ after_cost; - bool ok = simulate_collapse(edge, after_cost); - if (!ok) - return false; - - bool within_tol = is_within_tol(after_cost); - if (!within_tol) - return false; - - Vertex_handle source = m_dt.source_vertex(edge); - Cost_ before_cost = m_dt.compute_cost_around_vertex(source); - - FT before = before_cost.finalize(m_alpha); - FT after = after_cost.finalize(m_alpha); - pedge = Rec_edge_2(edge, before, after); - return true; - } - - bool is_within_tol(const Cost_& cost) const { - if (cost.max_norm() > m_norm_tol) - return false; - if (cost.max_tang() > m_tang_tol) - return false; - return true; - } - - // COST // - - void init_cost() { - m_dt.reset_all_costs(); - } - - template // value_type = Edge - void update_cost(Iterator begin, Iterator end) { - Edge_list edges; - collect_cost_stencil(m_dt, begin, end, edges); - - typename Edge_list::iterator ei; - for (ei = edges.begin(); ei != edges.end(); ++ei) { - Edge edge = *ei; - m_dt.update_cost(edge); - } - } - - template // value_type = Edge - void collect_cost_stencil(const Triangulation& mesh, Iterator begin, - Iterator end, Edge_list& edges) { - Edge_set done; - Edge_list fifo; - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - fifo.push_back(edge); - done.insert(edge); - } - - while (!fifo.empty()) { - Edge edge = fifo.front(); - fifo.pop_front(); - - edge = mesh.twin_edge(edge); - edges.push_back(edge); - - Edge next = mesh.next_edge(edge); - if (done.insert(next).second) - fifo.push_back(next); - - Edge prev = mesh.prev_edge(edge); - if (done.insert(prev).second) - fifo.push_back(prev); - } - } - - // PQUEUE (MCHOICE or EXHAUSTIVE) // - - bool pick_edge(std::size_t nb, Rec_edge_2& best_pedge) { - if (m_dt.number_of_faces() < 2) - return false; - - std::size_t ne = 2 * m_dt.tds().number_of_edges(); - if (nb > ne) - nb = ne; - - bool ok; - if (nb == 0) { - ok = pick_edge_from_pqueue(best_pedge); - return ok; - } - m_mindex.clear(); - - if (nb == ne) { - ok = pick_edge_brute_force(best_pedge); - return ok; - } - - ok = pick_edge_randomly(nb, best_pedge); - return ok; - } - - bool pick_edge_from_pqueue(Rec_edge_2& best_pedge) { - if (m_mindex.empty()) - populate_pqueue(); - if (m_mindex.empty()) - return false; - best_pedge = *(m_mindex.template get<1>()).begin(); - (m_mindex.template get<0>()).erase(best_pedge); - return true; - } - - bool pick_edge_brute_force(Rec_edge_2& best_pedge) { - MultiIndex mindex; - Finite_edges_iterator ei; - for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); - ++ei) { - Edge edge = *ei; - push_to_mindex(edge, mindex); - - - edge = m_dt.twin_edge(edge); - push_to_mindex(edge, mindex); - } - if (mindex.empty()) - return false; - best_pedge = *(mindex.template get<1>()).begin(); - return true; - } - - bool pick_edge_randomly(std::size_t nb, Rec_edge_2& best_pedge) { - MultiIndex mindex; - for (std::size_t i = 0; i < nb; ++i) { - Rec_edge_2 pedge; - if (random_pedge(pedge)) - mindex.insert(pedge); - } - if (mindex.empty()) - return false; - best_pedge = *(mindex.template get<1>()).begin(); - return true; - } - - void populate_pqueue() { - Finite_edges_iterator ei; - for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); - ++ei) { - Edge edge = *ei; - push_to_mindex(edge, m_mindex); - - edge = m_dt.twin_edge(edge); - push_to_mindex(edge, m_mindex); - } - } - - - bool push_to_mindex(const Edge& edge, MultiIndex& mindex) { - if (m_dt.is_pinned(edge)) - return false; - if (m_dt.is_target_cyclic(edge)) - return false; - - Rec_edge_2 pedge; - bool ok = create_pedge(edge, pedge); - if (!ok) - return false; - mindex.insert(pedge); - return true; - } - - - - bool random_pedge(Rec_edge_2& pedge) { - for (unsigned i = 0; i < 10; ++i) { - Edge edge = m_dt.random_finite_edge(); - if (m_dt.is_pinned(edge)) - continue; - if (m_dt.is_target_cyclic(edge)) - continue; - bool ok = create_pedge(edge, pedge); - if (ok) - return true; - } - return false; - } - - template // value_type = Edge - void remove_stencil_from_pqueue(Iterator begin, Iterator end) { - if (m_mindex.empty()) - return; - - Edge_list edges; - collect_pqueue_stencil(m_dt, begin, end, edges); - - typename Edge_list::const_iterator ei; - for (ei = edges.begin(); ei != edges.end(); ++ei) { - Edge edge = *ei; - (m_mindex.template get<0>()).erase(Rec_edge_2(edge)); - } - } - - template // value_type = Edge - void push_stencil_to_pqueue(Iterator begin, Iterator end) { - Edge_list edges; - collect_pqueue_stencil(m_dt, begin, end, edges); - - typename Edge_list::const_iterator ei; - for (ei = edges.begin(); ei != edges.end(); ++ei) { - Edge edge = *ei; - push_to_mindex(edge, m_mindex); - } - } - - template // value_type = Edge - void collect_pqueue_stencil(const Triangulation& mesh, Iterator begin, - Iterator end, Edge_list& edges) { - Vertex_handle_set vertex_set; - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - Edge twin = mesh.twin_edge(edge); - - Vertex_handle s = mesh.source_vertex(edge); - if (!s->pinned()) - vertex_set.insert(s); - - Vertex_handle t = mesh.target_vertex(edge); - if (!t->pinned()) - vertex_set.insert(t); - - Vertex_handle f = mesh.opposite_vertex(edge); - if (!f->pinned()) - vertex_set.insert(f); - - Vertex_handle b = mesh.opposite_vertex(twin); - if (!b->pinned()) - vertex_set.insert(b); - } - - typename Vertex_handle_set::const_iterator vi; - for (vi = vertex_set.begin(); vi != vertex_set.end(); ++vi) { - Vertex_handle v = *vi; - Edge_circulator ecirc = mesh.incident_edges(v); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (mesh.source_vertex(edge) != v) - edge = mesh.twin_edge(edge); - edges.push_back(edge); - } - } - } - - // COPY STAR // - - // edge must not be pinned or have cyclic target - Edge copy_star(const Edge& edge, Triangulation& copy) { - copy.tds().set_dimension(2); - copy.infinite_vertex()->pinned() = true; - - // copy vertices - Vertex_handle_map cvmap; - - Vertex_handle s = m_dt.source_vertex(edge); - Vertex_handle cs = copy.tds().create_vertex(); - cvmap[s] = copy_vertex(s, cs); - - Vertex_circulator vcirc = m_dt.incident_vertices(s); - Vertex_circulator vend = vcirc; - CGAL_For_all(vcirc, vend) - { - Vertex_handle v = vcirc; - if (cvmap.find(v) == cvmap.end()) { - Vertex_handle cv = copy.tds().create_vertex(); - cvmap[v] = copy_vertex(v, cv); - } - } - - // copy faces - Face_handle_map cfmap; - Face_circulator fcirc = m_dt.incident_faces(s); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle f = fcirc; - Face_handle cf = copy.tds().create_face(); - cfmap[f] = copy_face(f, cf, cvmap); - } - - // set neighbors - fcirc = m_dt.incident_faces(s); - fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle f = fcirc; - copy_neighbors(f, s, cvmap, cfmap); - } - - // make copy homeomorphic to S^2 - close_copy_mesh(cs, copy); - - // copy samples surrounding star - copy_samples(s, cs, cfmap, copy); - - // get copy of edge - Edge copy_edge = get_copy_edge(edge, cvmap, cfmap); - return copy_edge; - } - - Vertex_handle copy_vertex(Vertex_handle v0, Vertex_handle v1) { - v1->id() = v0->id(); - v1->set_point(v0->point()); - v1->pinned() = v0->pinned(); - v1->set_sample(v0->get_sample()); - return v1; - } - - Face_handle copy_face(Face_handle f0, Face_handle f1, - Vertex_handle_map& vmap) { - for (unsigned i = 0; i < 3; ++i) { - Vertex_handle v0i = f0->vertex(i); - Vertex_handle v1i = vmap[v0i]; - f1->set_vertex(i, v1i); - v1i->set_face(f1); - } - return f1; - } - - void copy_neighbors(Face_handle f, Vertex_handle v, Vertex_handle_map& vmap, - Face_handle_map& fmap) { - int i = f->index(v); - Face_handle cf = fmap[f]; - Vertex_handle cv = vmap[v]; - - if (fmap.find(f->neighbor(i)) != fmap.end()) { - Face_handle fi = f->neighbor(i); - Face_handle cfi = fmap[fi]; - cf->set_neighbor(i, cfi); - } - - for (unsigned j = 0; j < 2; ++j) { - i = (i + 1) % 3; - Face_handle fi = f->neighbor(i); - Face_handle cfi = fmap[fi]; - cf->set_neighbor(i, cfi); - } - } - - void close_copy_mesh(Vertex_handle vertex, Triangulation& copy) { - std::vector outer_faces; - - Face_circulator fcirc = copy.incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int i = face->index(vertex); - - if (face->neighbor(i) != Face_handle()) - continue; - - Vertex_handle v1 = face->vertex((i + 1) % 3); - Vertex_handle v2 = face->vertex((i + 2) % 3); - - Face_handle outer = copy.tds().create_face(); - outer->set_vertex(0, copy.infinite_vertex()); - outer->set_vertex(1, v2); - outer->set_vertex(2, v1); - - face->set_neighbor(i, outer); - outer->set_neighbor(0, face); - - outer_faces.push_back(outer); - } - - for (unsigned i = 0; i < outer_faces.size(); ++i) { - unsigned j = (i + 1) % outer_faces.size(); - outer_faces[i]->set_neighbor(2, outer_faces[j]); - outer_faces[j]->set_neighbor(1, outer_faces[i]); - } - - if (!outer_faces.empty()) - copy.infinite_vertex()->set_face(outer_faces[0]); - } - - void copy_samples(Vertex_handle vertex, Vertex_handle copy_vertex, - Face_handle_map& fmap, Triangulation& copy) { - Face_circulator fcirc = m_dt.incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - Edge twin = m_dt.twin_edge(Edge(face, index)); - - Face_handle copy_face = fmap[face]; - index = copy_face->index(copy_vertex); - Edge copy_twin = copy.twin_edge(Edge(copy_face, index)); - - Sample_list samples; - m_dt.collect_samples_from_edge(twin, samples); - copy_twin.first->samples(copy_twin.second) = samples; - } - copy_vertex->set_sample(NULL); - } - - Edge get_copy_edge(const Edge& edge, Vertex_handle_map& vmap, - Face_handle_map& fmap) { - Face_handle f = edge.first; - Vertex_handle v = f->vertex(edge.second); - - Face_handle cf = fmap[f]; - Vertex_handle cv = vmap[v]; - - return Edge(cf, cf->index(cv)); - } - - // RELOCATION // - - void relocate_one_vertex(Vertex_handle vertex) { - std::swap(vertex->point(), vertex->relocated()); - reassign_samples_around_vertex(vertex); - } - - template // value_type = Edge - void relocate_one_ring(Iterator begin, Iterator end) { - Vertex_handle_set vertices; - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - vertices.insert(m_dt.source_vertex(edge)); - vertices.insert(m_dt.target_vertex(edge)); - } - - typename Vertex_handle_set::const_iterator vi; - for (vi = vertices.begin(); vi != vertices.end(); ++vi) { - Vertex_handle v = *vi; - if (v->pinned()) - continue; - v->relocated() = compute_relocation(v); - } - - for (vi = vertices.begin(); vi != vertices.end(); ++vi) { - Vertex_handle v = *vi; - if (v->pinned()) - continue; - if (v->point() == v->relocated()) - continue; - - Edge_list hull; - m_dt.get_edges_from_star_minus_link(v, hull, false); - bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), - hull.end()); - - if (ok) { - // do relocation - FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); - relocate_one_vertex(v); - FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); - - if (norm_bef < norm_aft) { - // undo relocation - relocate_one_vertex(v); - } else if (m_mchoice == 0) { - // update queue - hull.clear(); - m_dt.get_edges_from_star_minus_link(v, hull, true); - remove_stencil_from_pqueue(hull.begin(), hull.end()); - push_stencil_to_pqueue(hull.begin(), hull.end()); - } - } - } - } - - /// \endcond - - - /// \cond SKIP_IN_MANUAL - Vector compute_gradient(Vertex_handle vertex) { - Vector grad(0.0, 0.0); - Edge_circulator ecirc = m_dt.incident_edges(vertex); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (m_dt.source_vertex(edge) != vertex) - edge = m_dt.twin_edge(edge); - - if (m_dt.get_plan(edge) == 0) - grad = grad + compute_gradient_for_plan0(edge); - else - grad = grad + compute_gradient_for_plan1(edge); - } - return grad; - } - - Point compute_relocation(Vertex_handle vertex) { - FT coef = 0.0; - Vector rhs(0.0, 0.0); - - Edge_circulator ecirc = m_dt.incident_edges(vertex); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (m_dt.source_vertex(edge) != vertex) - edge = m_dt.twin_edge(edge); - - if (m_dt.get_plan(edge) == 0) - compute_relocation_for_plan0(edge, coef, rhs); - else - compute_relocation_for_plan1(edge, coef, rhs); - } - compute_relocation_for_vertex(vertex, coef, rhs); - - if (coef == 0.0) - return vertex->point(); - return CGAL::ORIGIN + (rhs / coef); - } - - void compute_relocation_for_vertex(Vertex_handle vertex, FT& coef, - Vector& rhs) { - Sample_* sample = vertex->get_sample(); - if (sample) { - const FT m = sample->mass(); - const Point& ps = sample->point(); - rhs = rhs + m * (ps - CGAL::ORIGIN); - coef += m; - } - } - - Vector compute_gradient_for_plan0(const Edge& edge) { - Edge twin = m_dt.twin_edge(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); - - Sample_list samples; - m_dt.collect_samples_from_edge(edge, samples); - m_dt.collect_samples_from_edge(twin, samples); - - Vector grad(0.0, 0.0); - Sample_list_const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) { - Sample_* sample = *it; - const FT m = sample->mass(); - const Point& ps = sample->point(); - - FT Da = CGAL::squared_distance(ps, pa); - FT Db = CGAL::squared_distance(ps, pb); - if (Da < Db) - grad = grad + m * (pa - ps); - } - return grad; - } - - void compute_relocation_for_plan0(const Edge& edge, FT& coef, Vector& rhs) { - Edge twin = m_dt.twin_edge(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); - - Sample_list samples; - m_dt.collect_samples_from_edge(edge, samples); - m_dt.collect_samples_from_edge(twin, samples); - - Sample_list_const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) { - Sample_* sample = *it; - const FT m = sample->mass(); - const Point& ps = sample->point(); - - FT Da = CGAL::squared_distance(ps, pa); - FT Db = CGAL::squared_distance(ps, pb); - - if (Da < Db) { - rhs = rhs + m * (ps - CGAL::ORIGIN); - coef += m; - } - } - } - - Vector compute_gradient_for_plan1(const Edge& edge) { - FT M = m_dt.get_mass(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); - - SQueue queue; - m_dt.sort_samples_from_edge(edge, queue); - - //FT start = 0.0; - Vector grad(0.0, 0.0); - while (!queue.empty()) { - PSample psample = queue.top(); - queue.pop(); - - const FT m = psample.sample()->mass(); - const Point& ps = psample.sample()->point(); - - // normal + tangnetial - const FT coord = psample.priority(); - Point pf = CGAL::ORIGIN + (1.0 - coord) * (pa - CGAL::ORIGIN) - + coord * (pb - CGAL::ORIGIN); - grad = grad + m * (1.0 - coord) * (pf - ps); - - /* - // only normal - FT bin = m/M; - FT center = start + 0.5*bin; - Point pc = CGAL::ORIGIN + (1.0-center)*(pa - CGAL::ORIGIN) + center*(pb - CGAL::ORIGIN); - start += bin; - grad = grad + m*(bin*bin/12.0)*(pa - pb); - grad = grad + m*(1.0-center)*(pc - pf); - */ - } - return grad; - } - - void compute_relocation_for_plan1(const Edge& edge, FT& coef, Vector& rhs) { - FT M = m_dt.get_mass(edge); - const Point& pb = m_dt.target_vertex(edge)->point(); - - SQueue queue; - m_dt.sort_samples_from_edge(edge, queue); - - //FT start = 0.0; - while (!queue.empty()) { - PSample psample = queue.top(); - queue.pop(); - - const FT m = psample.sample()->mass(); - const Point& ps = psample.sample()->point(); - - const FT coord = psample.priority(); - const FT one_minus_coord = 1.0 - coord; - - // normal + tangential - coef += m * one_minus_coord * one_minus_coord; - rhs = - rhs - + m * one_minus_coord - * ((ps - CGAL::ORIGIN) - - coord * (pb - CGAL::ORIGIN)); - - /* - // only normal - FT bin = m/M; - FT center = start + 0.5*bin; - FT one_minus_center = 1.0 - center; - start += bin; - - coef += m*bin*bin/12.0; - rhs = rhs + m*(bin*bin/12.0)*(pb - CGAL::ORIGIN); - - coef += m*one_minus_center*(coord - center); - rhs = rhs + m*one_minus_center*(coord - center)*(pb - CGAL::ORIGIN); - */ - } - } - - void print_stats_debug() const - { - int nb_solid = 0; - int nb_ghost = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) nb_ghost++; - else nb_solid++; - } - - std::cerr << blue << "STATS" << white << std::endl; - std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; - std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; - std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; - std::cerr << "# solid: " << nb_solid << std::endl; - std::cerr << "# ghost: " << nb_ghost << std::endl; - } - - - - - /*! - Returns the number of vertices present in the reconstructed triangulation. - */ - std::size_t number_of_vertices() { - return m_dt.number_of_vertices() - 4; - - } - - /*! - Returns the number of (solid) edges present in the reconstructed triangulation. - */ - int number_of_edges() { - int nb_solid = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - nb_solid++; - } - return nb_solid; - } - - - /*! - Returns the cost of the (solid) edges present in the reconstructed triangulation. - */ - FT total_edge_cost() { - FT total_cost = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - - total_cost += m_dt.get_cost(edge).finalize(); - } - return total_cost; - } - - /// \endcond + Cost_ after_cost; + bool ok = simulate_collapse(edge, after_cost); + if (!ok) + return false; + + bool within_tol = is_within_tol(after_cost); + if (!within_tol) + return false; + + Vertex_handle source = m_dt.source_vertex(edge); + Cost_ before_cost = m_dt.compute_cost_around_vertex(source); + + FT before = before_cost.finalize(m_alpha); + FT after = after_cost.finalize(m_alpha); + pedge = Rec_edge_2(edge, before, after); + return true; + } + + bool is_within_tol(const Cost_& cost) const { + if (cost.max_norm() > m_norm_tol) + return false; + if (cost.max_tang() > m_tang_tol) + return false; + return true; + } + + // COST // + + void init_cost() { + m_dt.reset_all_costs(); + } + + template // value_type = Edge + void update_cost(Iterator begin, Iterator end) { + Edge_list edges; + collect_cost_stencil(m_dt, begin, end, edges); + + typename Edge_list::iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + m_dt.update_cost(edge); + } + } + + template // value_type = Edge + void collect_cost_stencil(const Triangulation& mesh, Iterator begin, + Iterator end, Edge_list& edges) { + Edge_set done; + Edge_list fifo; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + fifo.push_back(edge); + done.insert(edge); + } + + while (!fifo.empty()) { + Edge edge = fifo.front(); + fifo.pop_front(); + + edge = mesh.twin_edge(edge); + edges.push_back(edge); + + Edge next = mesh.next_edge(edge); + if (done.insert(next).second) + fifo.push_back(next); + + Edge prev = mesh.prev_edge(edge); + if (done.insert(prev).second) + fifo.push_back(prev); + } + } + + // PQUEUE (MCHOICE or EXHAUSTIVE) // + + bool pick_edge(std::size_t nb, Rec_edge_2& best_pedge) { + if (m_dt.number_of_faces() < 2) + return false; + + std::size_t ne = 2 * m_dt.tds().number_of_edges(); + if (nb > ne) + nb = ne; + + bool ok; + if (nb == 0) { + ok = pick_edge_from_pqueue(best_pedge); + return ok; + } + m_mindex.clear(); + + if (nb == ne) { + ok = pick_edge_brute_force(best_pedge); + return ok; + } + + ok = pick_edge_randomly(nb, best_pedge); + return ok; + } + + bool pick_edge_from_pqueue(Rec_edge_2& best_pedge) { + if (m_mindex.empty()) + populate_pqueue(); + if (m_mindex.empty()) + return false; + best_pedge = *(m_mindex.template get<1>()).begin(); + (m_mindex.template get<0>()).erase(best_pedge); + return true; + } + + bool pick_edge_brute_force(Rec_edge_2& best_pedge) { + MultiIndex mindex; + Finite_edges_iterator ei; + for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); + ++ei) { + Edge edge = *ei; + push_to_mindex(edge, mindex); + + + edge = m_dt.twin_edge(edge); + push_to_mindex(edge, mindex); + } + if (mindex.empty()) + return false; + best_pedge = *(mindex.template get<1>()).begin(); + return true; + } + + bool pick_edge_randomly(std::size_t nb, Rec_edge_2& best_pedge) { + MultiIndex mindex; + for (std::size_t i = 0; i < nb; ++i) { + Rec_edge_2 pedge; + if (random_pedge(pedge)) + mindex.insert(pedge); + } + if (mindex.empty()) + return false; + best_pedge = *(mindex.template get<1>()).begin(); + return true; + } + + void populate_pqueue() { + Finite_edges_iterator ei; + for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); + ++ei) { + Edge edge = *ei; + push_to_mindex(edge, m_mindex); + + edge = m_dt.twin_edge(edge); + push_to_mindex(edge, m_mindex); + } + } + + + bool push_to_mindex(const Edge& edge, MultiIndex& mindex) { + if (m_dt.is_pinned(edge)) + return false; + if (m_dt.is_target_cyclic(edge)) + return false; + + Rec_edge_2 pedge; + bool ok = create_pedge(edge, pedge); + if (!ok) + return false; + mindex.insert(pedge); + return true; + } + + + + bool random_pedge(Rec_edge_2& pedge) { + for (unsigned i = 0; i < 10; ++i) { + Edge edge = m_dt.random_finite_edge(); + if (m_dt.is_pinned(edge)) + continue; + if (m_dt.is_target_cyclic(edge)) + continue; + bool ok = create_pedge(edge, pedge); + if (ok) + return true; + } + return false; + } + + template // value_type = Edge + void remove_stencil_from_pqueue(Iterator begin, Iterator end) { + if (m_mindex.empty()) + return; + + Edge_list edges; + collect_pqueue_stencil(m_dt, begin, end, edges); + + typename Edge_list::const_iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + (m_mindex.template get<0>()).erase(Rec_edge_2(edge)); + } + } + + template // value_type = Edge + void push_stencil_to_pqueue(Iterator begin, Iterator end) { + Edge_list edges; + collect_pqueue_stencil(m_dt, begin, end, edges); + + typename Edge_list::const_iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + push_to_mindex(edge, m_mindex); + } + } + + template // value_type = Edge + void collect_pqueue_stencil(const Triangulation& mesh, Iterator begin, + Iterator end, Edge_list& edges) { + Vertex_handle_set vertex_set; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + Edge twin = mesh.twin_edge(edge); + + Vertex_handle s = mesh.source_vertex(edge); + if (!s->pinned()) + vertex_set.insert(s); + + Vertex_handle t = mesh.target_vertex(edge); + if (!t->pinned()) + vertex_set.insert(t); + + Vertex_handle f = mesh.opposite_vertex(edge); + if (!f->pinned()) + vertex_set.insert(f); + + Vertex_handle b = mesh.opposite_vertex(twin); + if (!b->pinned()) + vertex_set.insert(b); + } + + typename Vertex_handle_set::const_iterator vi; + for (vi = vertex_set.begin(); vi != vertex_set.end(); ++vi) { + Vertex_handle v = *vi; + Edge_circulator ecirc = mesh.incident_edges(v); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (mesh.source_vertex(edge) != v) + edge = mesh.twin_edge(edge); + edges.push_back(edge); + } + } + } + + // COPY STAR // + + // edge must not be pinned or have cyclic target + Edge copy_star(const Edge& edge, Triangulation& copy) { + copy.tds().set_dimension(2); + copy.infinite_vertex()->pinned() = true; + + // copy vertices + Vertex_handle_map cvmap; + + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle cs = copy.tds().create_vertex(); + cvmap[s] = copy_vertex(s, cs); + + Vertex_circulator vcirc = m_dt.incident_vertices(s); + Vertex_circulator vend = vcirc; + CGAL_For_all(vcirc, vend) + { + Vertex_handle v = vcirc; + if (cvmap.find(v) == cvmap.end()) { + Vertex_handle cv = copy.tds().create_vertex(); + cvmap[v] = copy_vertex(v, cv); + } + } + + // copy faces + Face_handle_map cfmap; + Face_circulator fcirc = m_dt.incident_faces(s); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + Face_handle cf = copy.tds().create_face(); + cfmap[f] = copy_face(f, cf, cvmap); + } + + // set neighbors + fcirc = m_dt.incident_faces(s); + fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + copy_neighbors(f, s, cvmap, cfmap); + } + + // make copy homeomorphic to S^2 + close_copy_mesh(cs, copy); + + // copy samples surrounding star + copy_samples(s, cs, cfmap, copy); + + // get copy of edge + Edge copy_edge = get_copy_edge(edge, cvmap, cfmap); + return copy_edge; + } + + Vertex_handle copy_vertex(Vertex_handle v0, Vertex_handle v1) { + v1->id() = v0->id(); + v1->set_point(v0->point()); + v1->pinned() = v0->pinned(); + v1->set_sample(v0->get_sample()); + return v1; + } + + Face_handle copy_face(Face_handle f0, Face_handle f1, + Vertex_handle_map& vmap) { + for (unsigned i = 0; i < 3; ++i) { + Vertex_handle v0i = f0->vertex(i); + Vertex_handle v1i = vmap[v0i]; + f1->set_vertex(i, v1i); + v1i->set_face(f1); + } + return f1; + } + + void copy_neighbors(Face_handle f, Vertex_handle v, Vertex_handle_map& vmap, + Face_handle_map& fmap) { + int i = f->index(v); + Face_handle cf = fmap[f]; + Vertex_handle cv = vmap[v]; + + if (fmap.find(f->neighbor(i)) != fmap.end()) { + Face_handle fi = f->neighbor(i); + Face_handle cfi = fmap[fi]; + cf->set_neighbor(i, cfi); + } + + for (unsigned j = 0; j < 2; ++j) { + i = (i + 1) % 3; + Face_handle fi = f->neighbor(i); + Face_handle cfi = fmap[fi]; + cf->set_neighbor(i, cfi); + } + } + + void close_copy_mesh(Vertex_handle vertex, Triangulation& copy) { + std::vector outer_faces; + + Face_circulator fcirc = copy.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int i = face->index(vertex); + + if (face->neighbor(i) != Face_handle()) + continue; + + Vertex_handle v1 = face->vertex((i + 1) % 3); + Vertex_handle v2 = face->vertex((i + 2) % 3); + + Face_handle outer = copy.tds().create_face(); + outer->set_vertex(0, copy.infinite_vertex()); + outer->set_vertex(1, v2); + outer->set_vertex(2, v1); + + face->set_neighbor(i, outer); + outer->set_neighbor(0, face); + + outer_faces.push_back(outer); + } + + for (unsigned i = 0; i < outer_faces.size(); ++i) { + unsigned j = (i + 1) % outer_faces.size(); + outer_faces[i]->set_neighbor(2, outer_faces[j]); + outer_faces[j]->set_neighbor(1, outer_faces[i]); + } + + if (!outer_faces.empty()) + copy.infinite_vertex()->set_face(outer_faces[0]); + } + + void copy_samples(Vertex_handle vertex, Vertex_handle copy_vertex, + Face_handle_map& fmap, Triangulation& copy) { + Face_circulator fcirc = m_dt.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + Edge twin = m_dt.twin_edge(Edge(face, index)); + + Face_handle copy_face = fmap[face]; + index = copy_face->index(copy_vertex); + Edge copy_twin = copy.twin_edge(Edge(copy_face, index)); + + Sample_list samples; + m_dt.collect_samples_from_edge(twin, samples); + copy_twin.first->samples(copy_twin.second) = samples; + } + copy_vertex->set_sample(NULL); + } + + Edge get_copy_edge(const Edge& edge, Vertex_handle_map& vmap, + Face_handle_map& fmap) { + Face_handle f = edge.first; + Vertex_handle v = f->vertex(edge.second); + + Face_handle cf = fmap[f]; + Vertex_handle cv = vmap[v]; + + return Edge(cf, cf->index(cv)); + } + + // RELOCATION // + + void relocate_one_vertex(Vertex_handle vertex) { + std::swap(vertex->point(), vertex->relocated()); + reassign_samples_around_vertex(vertex); + } + + template // value_type = Edge + void relocate_one_ring(Iterator begin, Iterator end) { + Vertex_handle_set vertices; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + vertices.insert(m_dt.source_vertex(edge)); + vertices.insert(m_dt.target_vertex(edge)); + } + + typename Vertex_handle_set::const_iterator vi; + for (vi = vertices.begin(); vi != vertices.end(); ++vi) { + Vertex_handle v = *vi; + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); + } + + for (vi = vertices.begin(); vi != vertices.end(); ++vi) { + Vertex_handle v = *vi; + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; + + Edge_list hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); + + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + + if (norm_bef < norm_aft) { + // undo relocation + relocate_one_vertex(v); + } else if (m_mchoice == 0) { + // update queue + hull.clear(); + m_dt.get_edges_from_star_minus_link(v, hull, true); + remove_stencil_from_pqueue(hull.begin(), hull.end()); + push_stencil_to_pqueue(hull.begin(), hull.end()); + } + } + } + } + + /// \endcond + + + /// \cond SKIP_IN_MANUAL + Vector compute_gradient(Vertex_handle vertex) { + Vector grad(0.0, 0.0); + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + if (m_dt.get_plan(edge) == 0) + grad = grad + compute_gradient_for_plan0(edge); + else + grad = grad + compute_gradient_for_plan1(edge); + } + return grad; + } + + Point compute_relocation(Vertex_handle vertex) { + FT coef = 0.0; + Vector rhs(0.0, 0.0); + + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + if (m_dt.get_plan(edge) == 0) + compute_relocation_for_plan0(edge, coef, rhs); + else + compute_relocation_for_plan1(edge, coef, rhs); + } + compute_relocation_for_vertex(vertex, coef, rhs); + + if (coef == 0.0) + return vertex->point(); + return CGAL::ORIGIN + (rhs / coef); + } + + void compute_relocation_for_vertex(Vertex_handle vertex, FT& coef, + Vector& rhs) { + Sample_* sample = vertex->get_sample(); + if (sample) { + const FT m = sample->mass(); + const Point& ps = sample->point(); + rhs = rhs + m * (ps - CGAL::ORIGIN); + coef += m; + } + } + + Vector compute_gradient_for_plan0(const Edge& edge) { + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + Sample_list samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + Vector grad(0.0, 0.0); + Sample_list_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) { + Sample_* sample = *it; + const FT m = sample->mass(); + const Point& ps = sample->point(); + + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + if (Da < Db) + grad = grad + m * (pa - ps); + } + return grad; + } + + void compute_relocation_for_plan0(const Edge& edge, FT& coef, Vector& rhs) { + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + Sample_list samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + Sample_list_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) { + Sample_* sample = *it; + const FT m = sample->mass(); + const Point& ps = sample->point(); + + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + + if (Da < Db) { + rhs = rhs + m * (ps - CGAL::ORIGIN); + coef += m; + } + } + } + + Vector compute_gradient_for_plan1(const Edge& edge) { + FT M = m_dt.get_mass(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + SQueue queue; + m_dt.sort_samples_from_edge(edge, queue); + + //FT start = 0.0; + Vector grad(0.0, 0.0); + while (!queue.empty()) { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + // normal + tangnetial + const FT coord = psample.priority(); + Point pf = CGAL::ORIGIN + (1.0 - coord) * (pa - CGAL::ORIGIN) + + coord * (pb - CGAL::ORIGIN); + grad = grad + m * (1.0 - coord) * (pf - ps); + + /* + // only normal + FT bin = m/M; + FT center = start + 0.5*bin; + Point pc = CGAL::ORIGIN + (1.0-center)*(pa - CGAL::ORIGIN) + center*(pb - CGAL::ORIGIN); + start += bin; + grad = grad + m*(bin*bin/12.0)*(pa - pb); + grad = grad + m*(1.0-center)*(pc - pf); + */ + } + return grad; + } + + void compute_relocation_for_plan1(const Edge& edge, FT& coef, Vector& rhs) { + FT M = m_dt.get_mass(edge); + const Point& pb = m_dt.target_vertex(edge)->point(); + + SQueue queue; + m_dt.sort_samples_from_edge(edge, queue); + + //FT start = 0.0; + while (!queue.empty()) { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + const FT coord = psample.priority(); + const FT one_minus_coord = 1.0 - coord; + + // normal + tangential + coef += m * one_minus_coord * one_minus_coord; + rhs = + rhs + + m * one_minus_coord + * ((ps - CGAL::ORIGIN) + - coord * (pb - CGAL::ORIGIN)); + + /* + // only normal + FT bin = m/M; + FT center = start + 0.5*bin; + FT one_minus_center = 1.0 - center; + start += bin; + + coef += m*bin*bin/12.0; + rhs = rhs + m*(bin*bin/12.0)*(pb - CGAL::ORIGIN); + + coef += m*one_minus_center*(coord - center); + rhs = rhs + m*one_minus_center*(coord - center)*(pb - CGAL::ORIGIN); + */ + } + } + + void print_stats_debug() const + { + int nb_solid = 0; + int nb_ghost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) nb_ghost++; + else nb_solid++; + } + + std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; + std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; + std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; + std::cerr << "# solid: " << nb_solid << std::endl; + std::cerr << "# ghost: " << nb_ghost << std::endl; + } + + + + + /*! + Returns the number of vertices present in the reconstructed triangulation. + */ + std::size_t number_of_vertices() { + return m_dt.number_of_vertices() - 4; + + } + + /*! + Returns the number of (solid) edges present in the reconstructed triangulation. + */ + int number_of_edges() { + int nb_solid = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + nb_solid++; + } + return nb_solid; + } + + + /*! + Returns the cost of the (solid) edges present in the reconstructed triangulation. + */ + FT total_edge_cost() { + FT total_cost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + + total_cost += m_dt.get_cost(edge).finalize(); + } + return total_cost; + } + + /// \endcond /// \name Simplification /// You can freely mix calls of the following functions. /// @{ - /*! - Computes a shape consisting of `np` points, reconstructing the input - points. + /*! + Computes a shape consisting of `np` points, reconstructing the input + points. - \param np The number of points which will be present in the output. - */ + \param np The number of points which will be present in the output. + */ void run_until(std::size_t np) { - double timer = clock(); - std::cerr << yellow << "reconstruct until " << white << np << " V"; + double timer = clock(); + std::cerr << yellow << "reconstruct until " << white << np << " V"; - std::size_t N = np + 4; - std::size_t performed = 0; - while (m_dt.number_of_vertices() > N) { - bool ok = decimate(); - if (!ok) - break; - performed++; - } + std::size_t N = np + 4; + std::size_t performed = 0; + while (m_dt.number_of_vertices() > N) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } - std::cerr << yellow << " done" << white << " (" << performed - << " iters, " << m_dt.number_of_vertices() - 4 << " V " - << yellow << time_duration(timer) << white << " s)" - << std::endl; - } + std::cerr << yellow << " done" << white << " (" << performed + << " iters, " << m_dt.number_of_vertices() - 4 << " V " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } - /*! - Computes a shape, reconstructing the input, by performing `steps` - edge collapse operators on the output simplex. + /*! + Computes a shape, reconstructing the input, by performing `steps` + edge collapse operators on the output simplex. - \param steps The number of edge collapse operators to be performed. - */ - void run(const unsigned steps) { - double timer = clock(); - std::cerr << yellow << "reconstruct " << steps << white; + \param steps The number of edge collapse operators to be performed. + */ + void run(const unsigned steps) { + double timer = clock(); + std::cerr << yellow << "reconstruct " << steps << white; - unsigned performed = 0; - for (unsigned i = 0; i < steps; ++i) { - bool ok = decimate(); - if (!ok) - break; - performed++; - } + unsigned performed = 0; + for (unsigned i = 0; i < steps; ++i) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } - std::cerr << yellow << " done" << white << " (" << performed << "/" - << steps << " iters, " << m_dt.number_of_vertices() - 4 - << " V, " << yellow << time_duration(timer) << white << " s)" - << std::endl; - } + std::cerr << yellow << " done" << white << " (" << performed << "/" + << steps << " iters, " << m_dt.number_of_vertices() - 4 + << " V, " << yellow << time_duration(timer) << white << " s)" + << std::endl; + } - /*! - Since noise and missing data may prevent the reconstructed shape to - have sharp corners well located, the algorithm offers the possibility to automatically - relocate points after each edge contraction. The new location of the - points is chosen such that the fitting of the output segments to the - input points is improved. - */ - void relocate_all_points() { - double timer = clock(); - std::cerr << yellow << "relocate all points" << white << "..."; + /*! + Since noise and missing data may prevent the reconstructed shape to + have sharp corners well located, the algorithm offers the possibility to automatically + relocate points after each edge contraction. The new location of the + points is chosen such that the fitting of the output segments to the + input points is improved. + */ + void relocate_all_points() { + double timer = clock(); + std::cerr << yellow << "relocate all points" << white << "..."; - m_mindex.clear(); // pqueue must be recomputed + m_mindex.clear(); // pqueue must be recomputed - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); - v != m_dt.finite_vertices_end(); ++v) { - if (v->pinned()) - continue; - v->relocated() = compute_relocation(v); - } + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); + } - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); - v != m_dt.finite_vertices_end(); ++v) { - if (v->pinned()) - continue; - if (v->point() == v->relocated()) - continue; + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; - Edge_list hull; - m_dt.get_edges_from_star_minus_link(v, hull, false); - bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), - hull.end()); + Edge_list hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); - if (ok) { - // do relocation - FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); - relocate_one_vertex(v); - FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); - // undo relocation - if (norm_bef < norm_aft) - relocate_one_vertex(v); - } - } + // undo relocation + if (norm_bef < norm_aft) + relocate_one_vertex(v); + } + } - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; - } + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } /// @} /// \name Output /// @{ - /*! - Writes the points and segments of the output simplex in an indexed format into output iterators. + /*! + Writes the points and segments of the output simplex in an indexed format into output iterators. \tparam PointOutputIterator An output iterator with value type `Point`. \tparam IndexOutputIterator An output iterator with value type `std::size_t` \tparam IndexPairOutputIterator An output iterator with value type `std::pair` - \param points The output iterator for all points + \param points The output iterator for all points \param isolated_points The output iterator for the indices of isolated points \param segments The output iterator for the pairs of segment indices - */ + */ template @@ -1498,160 +1498,160 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { IndexOutputIterator isolated_points, IndexPairOutputIterator segments) { - typedef typename Gt::Segment_2 Segment; - std::vector isolated_points_; - std::vector edges; + typedef typename Gt::Segment_2 Segment; + std::vector isolated_points_; + std::vector edges; - extract_list_output( + extract_list_output( std::back_inserter(isolated_points_), std::back_inserter(edges)); - // vertices_of_edges - std::set edge_vertices; - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { + // vertices_of_edges + std::set edge_vertices; + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { - Point a = (*it).source(); - Point b = (*it).target(); + Point a = (*it).source(); + Point b = (*it).target(); - edge_vertices.insert(a); - edge_vertices.insert(b); - } + edge_vertices.insert(a); + edge_vertices.insert(b); + } std::size_t count_points = 0; - for (typename std::set::iterator it = edge_vertices.begin(); - it != edge_vertices.end(); it++) { + for (typename std::set::iterator it = edge_vertices.begin(); + it != edge_vertices.end(); it++) { - *points++ = *it; + *points++ = *it; ++count_points; - } + } - for (typename std::vector::iterator it = isolated_points_.begin(); - it != isolated_points_.end(); it++) { + for (typename std::vector::iterator it = isolated_points_.begin(); + it != isolated_points_.end(); it++) { *isolated_points++ = count_points; - *points++ = *it; + *points++ = *it; ++count_points; - } + } - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { - Point const& a = it->source(); - Point const& b = it->target(); + Point const& a = it->source(); + Point const& b = it->target(); - typename std::set::iterator it_a = edge_vertices.find(a); - typename std::set::iterator it_b = edge_vertices.find(b); + typename std::set::iterator it_a = edge_vertices.find(a); + typename std::set::iterator it_b = edge_vertices.find(b); - std::size_t pos_a = std::distance(edge_vertices.begin(), it_a); - std::size_t pos_b = std::distance(edge_vertices.begin(), it_b); + std::size_t pos_a = std::distance(edge_vertices.begin(), it_a); + std::size_t pos_b = std::distance(edge_vertices.begin(), it_b); *segments++ = std::make_pair(pos_a, pos_b); - } + } - return CGAL::cpp11::make_tuple(points, isolated_points, segments); - } + return CGAL::cpp11::make_tuple(points, isolated_points, segments); + } - /// \cond SKIP_IN_MANUAL + /// \cond SKIP_IN_MANUAL - /*! - Returns the solid edges and vertices present after the reconstruction - process finished. + /*! + Returns the solid edges and vertices present after the reconstruction + process finished. - \details It takes two output iterators, one for storing the - isolated points and one for storing the edges of the reconstructed shape. + \details It takes two output iterators, one for storing the + isolated points and one for storing the edges of the reconstructed shape. - \tparam PointOutputIterator The output iterator type for storing the isolated points + \tparam PointOutputIterator The output iterator type for storing the isolated points - \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. - */ - template - void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { + \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. + */ + template + void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { - for (Vertex_iterator vi = m_dt.vertices_begin(); - vi != m_dt.vertices_end(); ++vi) - { + for (Vertex_iterator vi = m_dt.vertices_begin(); + vi != m_dt.vertices_end(); ++vi) + { - bool incident_edges_have_sample = false; - typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); - typename Triangulation::Edge_circulator cur = start; + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; - do { - if (!m_dt.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); + do { + if (!m_dt.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) { - Point p = (*vi).point(); - *v_it = p; - v_it++; - } - } - } + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) { + Point p = (*vi).point(); + *v_it = p; + v_it++; + } + } + } - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) - continue; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) + continue; - int index = edge.second; - Vertex_handle source = edge.first->vertex( (index+1)%3 ); - Vertex_handle target = edge.first->vertex( (index+2)%3 ); + int index = edge.second; + Vertex_handle source = edge.first->vertex( (index+1)%3 ); + Vertex_handle target = edge.first->vertex( (index+2)%3 ); - typename Gt::Segment_2 s(source->point(), target->point()); - *e_it = s; - e_it++; - } + typename Gt::Segment_2 s(source->point(), target->point()); + *e_it = s; + e_it++; + } - } - /// \endcond + } + /// \endcond - /// \cond SKIP_IN_MANUAL - void extract_tds_output(Triangulation& rt2) { - rt2 = m_dt; - //mark vertices - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) - { + /// \cond SKIP_IN_MANUAL + void extract_tds_output(Triangulation& rt2) { + rt2 = m_dt; + //mark vertices + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) + { - bool incident_edges_have_sample = false; - typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); - typename Triangulation::Edge_circulator cur = start; + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; - do { - if (!rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); + do { + if (!rt2.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) - (*vi).set_relevance(1); - } - } + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) + (*vi).set_relevance(1); + } + } - // mark edges - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) - { - Edge edge = *ei; - FT relevance = 0; - if (!rt2.is_ghost(edge)) { - relevance = rt2.get_edge_relevance(edge); // >= 0 - } - edge.first->relevance(edge.second) = relevance; - } - } + // mark edges + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) + { + Edge edge = *ei; + FT relevance = 0; + if (!rt2.is_ghost(edge)) { + relevance = rt2.get_edge_relevance(edge); // >= 0 + } + edge.first->relevance(edge.second) = relevance; + } + } /// \endcond From d932b54461921e07a6df1abdaa3894bdc4c03400 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 15:03:33 +0200 Subject: [PATCH 150/201] Fix init order --- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ab532a12607..c9d36a8ed78 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -212,10 +212,10 @@ protected: bool use_flip = true, std::size_t relocation = 0, std::size_t verbose = 0) - : m_mchoice(sample_size), + : m_verbose(verbose), + m_mchoice(sample_size), m_use_flip(use_flip), m_relocation(relocation), - m_verbose(verbose), point_pmap(point_map), mass_pmap(mass_map) { From faa9598f9fecf924259963bbc28cd326658d3594 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 15:09:28 +0200 Subject: [PATCH 151/201] Fix warnings --- .../include/CGAL/Reconstruction_face_base_2.h | 4 ++-- .../include/CGAL/Reconstruction_triangulation_2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 44461f85ff0..e4388ccb538 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -153,7 +153,7 @@ public: } - const int plan(int edge) const { return m_plan[edge]; } + int plan(int edge) const { return m_plan[edge]; } int& plan(int edge) { return m_plan[edge]; } const FT& mass(int edge) const { return m_mass[edge]; } @@ -175,7 +175,7 @@ public: return edge_cost(edge); } - const bool ghost(int edge) const + bool ghost(int edge) const { if (mass(edge) == 0.0) return true; if (plan(edge) == 0) return true; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 733c09c16b7..5d6483941b2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -916,7 +916,7 @@ public: // (s,a,b) + (s,b,c) -> (s,a,c) + (a,b,c) // st = (source,target) from 'make_collapsible' // return (a,c) - Edge flip(const Edge& sb, Edge& st, int verbose = 0) { + Edge flip(const Edge& sb, Edge& st, int /*verbose*/ = 0) { Vertex_handle t = target_vertex(st); Edge sc = twin_edge(prev_edge(sb)); @@ -930,7 +930,7 @@ public: return ac; } - void collapse(const Edge& edge, int verbose = 0) { + void collapse(const Edge& edge, int /*verbose*/ = 0) { if (is_edge_cyclic(edge)) { collapse_cyclic_edge(edge); return; From 3abda112f881467b6687972b2c918e9d152d75ef Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 15:17:40 +0200 Subject: [PATCH 152/201] Fix warnings --- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- Triangulation_2/include/CGAL/Triangulation_data_structure_2.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index c9d36a8ed78..03168b8f03e 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -210,8 +210,8 @@ protected: MassMap mass_map = MassMap(1), std::size_t sample_size = 0, bool use_flip = true, - std::size_t relocation = 0, - std::size_t verbose = 0) + unsigned int relocation = 0, + int verbose = 0) : m_verbose(verbose), m_mchoice(sample_size), m_use_flip(use_flip), diff --git a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h index 530085392bb..902c02178a1 100644 --- a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h @@ -1527,7 +1527,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) return join_vertices(f->neighbor(i), mirror_index(f,i), v); } - int deg2 = degree(v2); + std::size_t deg2 = degree(v2); CGAL_triangulation_precondition( deg2 >= 3 ); @@ -1605,7 +1605,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) ++fc; } while ( fc != fc_start ); - CGAL_triangulation_assertion( int(star_faces_of_v2.size()) == deg2 ); + CGAL_triangulation_assertion( star_faces_of_v2.size() == deg2 ); // from this point and on we modify the values From 8bf4d899c1e76157bf578975e2b8ef5a921f1036 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 15 Jun 2015 15:30:53 +0200 Subject: [PATCH 153/201] Clean-up gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index e3931ffc804..81287a07cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -.svn -.svn-base /*build* AABB_tree/demo/AABB_tree/AABB_demo AABB_tree/demo/AABB_tree/CMakeLists.txt From 558b42bdbac270c49bf1e3c4acf5eee9142ae567 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 16 Jun 2015 10:50:33 +0200 Subject: [PATCH 154/201] Shortened filenames --- .../Reconstruction_Simplification_2.txt | 6 +++--- .../doc/Reconstruction_simplification_2/examples.txt | 6 +++--- .../examples/Reconstruction_simplification_2/CMakeLists.txt | 6 +++--- ...mplification_2_mass_example.cpp => rs2_mass_example.cpp} | 0 ...fication_2_output_example.cpp => rs2_output_example.cpp} | 0 ...tion_2_simplest_example.cpp => rs2_simplest_example.cpp} | 0 6 files changed, 9 insertions(+), 9 deletions(-) rename Reconstruction_simplification_2/examples/Reconstruction_simplification_2/{reconstruction_simplification_2_mass_example.cpp => rs2_mass_example.cpp} (100%) rename Reconstruction_simplification_2/examples/Reconstruction_simplification_2/{reconstruction_simplification_2_output_example.cpp => rs2_output_example.cpp} (100%) rename Reconstruction_simplification_2/examples/Reconstruction_simplification_2/{reconstruction_simplification_2_simplest_example.cpp => rs2_simplest_example.cpp} (100%) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index dd529809eac..b4680e8b4b3 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -26,15 +26,15 @@ From left to right: input point set; Delaunay triangulation of the input points; \subsection Reconstruction_simplification_2Simplest_example Simplest Example The following example first reads a set of input points from an ASCII file. The points, with no mass attribute, are then passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp} +\cgalExample{Reconstruction_simplification_2/rs2_simplest_example.cpp} \subsubsection Reconstruction_simplification_2Output_example Output Example The output of the reconstruction can be obtained in two ways: either as a sequence of points and segments, or as an indexed format when the connectivity of the segments is encoded, hence the terms vertices and edges. The indexed format records a list of points, then pairs of point indices in the said list for the edges, and point indices for isolated vertices. -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp} +\cgalExample{Reconstruction_simplification_2/rs2_output_example.cpp} \subsection Reconstruction_simplification_2Mass_example Example with Mass Attributes The following example first reads a set of input points and masses from an ASCII file. Using two property maps, the points and their initial mass are passed to the Reconstruction_simplification_2 object. After initializing it, 100 iterations of the reconstruction process are performed. Lastly, the segments and isolated points of the reconstructed shape are extracted and printed to the console. -\cgalExample{Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp} +\cgalExample{Reconstruction_simplification_2/rs2_mass_example.cpp} \section Reconstruction_simplification_2API API diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt index c3a3dc3a58a..b4a315db0e1 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/examples.txt @@ -1,5 +1,5 @@ /*! -\example Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp -\example Reconstruction_simplification_2/Reconstruction_simplification_2_output_example.cpp -\example Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp +\example Reconstruction_simplification_2/rs2_simplest_example.cpp +\example Reconstruction_simplification_2/rs2_output_example.cpp +\example Reconstruction_simplification_2/rs2_mass_example.cpp */ diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt index d5d4875d349..47fe58cfdb0 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/CMakeLists.txt @@ -21,9 +21,9 @@ if ( CGAL_FOUND ) include_directories (BEFORE "include") - create_single_source_cgal_program( "reconstruction_simplification_2_output_example.cpp" ) - create_single_source_cgal_program( "reconstruction_simplification_2_mass_example.cpp" ) - create_single_source_cgal_program( "reconstruction_simplification_2_simplest_example.cpp" ) + create_single_source_cgal_program( "rs2_output_example.cpp" ) + create_single_source_cgal_program( "rs2_mass_example.cpp" ) + create_single_source_cgal_program( "rs2_simplest_example.cpp" ) else() diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp similarity index 100% rename from Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_mass_example.cpp rename to Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp similarity index 100% rename from Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_output_example.cpp rename to Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp similarity index 100% rename from Reconstruction_simplification_2/examples/Reconstruction_simplification_2/reconstruction_simplification_2_simplest_example.cpp rename to Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp From 7179a53fab2bfa0dc9794c5758406a9f9fe1f9e1 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 16 Jun 2015 10:54:48 +0200 Subject: [PATCH 155/201] Fix warnings --- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 03168b8f03e..e4234280b0e 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -466,7 +466,7 @@ protected: #else Point point = get(point_pmap, *it); #endif - Vertex_handle vertex = insert_point(point, false, nb++); + insert_point(point, false, nb++); } std::cerr << yellow << "done" << white << " (" << nb << " vertices, " @@ -1266,7 +1266,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { } void compute_relocation_for_plan1(const Edge& edge, FT& coef, Vector& rhs) { - FT M = m_dt.get_mass(edge); + //FT M = m_dt.get_mass(edge); const Point& pb = m_dt.target_vertex(edge)->point(); SQueue queue; From a4328cc4cb2c9dbf7d1a915f40c52187b2e23538 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 16 Jun 2015 10:59:53 +0200 Subject: [PATCH 156/201] Cut it some slack --- .../Reconstruction_simplification_2/test_output_modules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 7006955523b..50ce8bc28b8 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -125,7 +125,7 @@ void test_list_output(Rs_2& rs2) { std::cout << *it << std::endl; edge_count++; } - assert(edge_count == 31); + assert(edge_count >= 29 && edge_count <= 33); } From 2e6db170a5ebd865a67a195dd4a24acbfd6a9a97 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 16 Jun 2015 13:55:37 +0200 Subject: [PATCH 157/201] Use \x1b instead of \e --- .../include/CGAL/console_color.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/console_color.h b/Reconstruction_simplification_2/include/CGAL/console_color.h index 8b10ab8c566..0201b098242 100644 --- a/Reconstruction_simplification_2/include/CGAL/console_color.h +++ b/Reconstruction_simplification_2/include/CGAL/console_color.h @@ -14,7 +14,7 @@ inline std::ostream& blue(std::ostream &s) SetConsoleTextAttribute(hStdout, FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); #else - s << "\e[0;34m"; + s << "\x1b[0;34m"; #endif return s; } @@ -25,7 +25,7 @@ inline std::ostream& red(std::ostream &s) HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY); #else - s << "\e[0;31m"; + s << "\x1b[0;31m"; #endif return s; } @@ -36,7 +36,7 @@ inline std::ostream& green(std::ostream &s) HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY); #else - s << "\e[0;32m"; + s << "\x1b[0;32m"; #endif return s; } @@ -48,7 +48,7 @@ inline std::ostream& yellow(std::ostream &s) SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); #else - s << "\e[0;33m"; + s << "\x1b[0;33m"; #endif return s; } @@ -60,7 +60,7 @@ inline std::ostream& white(std::ostream &s) SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); #else - s << "\e[0;37m"; + s << "\x1b[0;37m"; #endif return s; } From 0d881dc09227791b337b4eab8d4babb4bdca9376 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 16 Jun 2015 14:14:52 +0200 Subject: [PATCH 158/201] extract_list_output => list_output --- .../demo/Reconstruction_simplification_2/scene.h | 2 +- .../Reconstruction_simplification_2/rs2_mass_example.cpp | 2 +- .../Reconstruction_simplification_2/rs2_output_example.cpp | 2 +- .../include/CGAL/Reconstruction_simplification_2.h | 4 ++-- .../Reconstruction_simplification_2/test_output_modules.cpp | 2 +- .../test_reconstruction_until.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index ac52e2ac9b4..784a2124697 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -406,7 +406,7 @@ public: std::vector isolated_points; std::vector edges; - m_pwsrec->extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + m_pwsrec->list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp index d044c97fafd..60de605d3be 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp @@ -57,7 +57,7 @@ int main () std::vector isolated_vertices; std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_vertices), std::back_inserter(edges)); + rs2.list_output (std::back_inserter(isolated_vertices), std::back_inserter(edges)); std::cerr << "Isolated vertices" << std::endl; std::vector::iterator vit; diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp index 647e638e34b..775c1a7d015 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp @@ -34,7 +34,7 @@ void list_output(Rs_2& rs2) std::vector isolated_points; std::vector segments; - rs2.extract_list_output( + rs2.list_output ( std::back_inserter(isolated_points), std::back_inserter(segments)); std::vector::iterator pit; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index e4234280b0e..5c3527eb29c 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1502,7 +1502,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { std::vector isolated_points_; std::vector edges; - extract_list_output( + list_output ( std::back_inserter(isolated_points_), std::back_inserter(edges)); // vertices_of_edges @@ -1566,7 +1566,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. */ template - void extract_list_output(PointOutputIterator v_it, SegmentOutputIterator e_it) { + void list_output (PointOutputIterator v_it, SegmentOutputIterator e_it) { for (Vertex_iterator vi = m_dt.vertices_begin(); vi != m_dt.vertices_end(); ++vi) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 50ce8bc28b8..0ba230056b7 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -109,7 +109,7 @@ void test_list_output(Rs_2& rs2) { std::vector isolated_points; std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + rs2.list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); int vertex_count = 0; for (std::vector::iterator it = isolated_points.begin(); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index 9df1c0ff794..f62831c510a 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -39,7 +39,7 @@ int main () std::vector isolated_points; std::vector edges; - rs2.extract_list_output(std::back_inserter(isolated_points), std::back_inserter(edges)); + rs2.list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); std::cout << "isolated_points " << isolated_points.size() << std::endl; std::cout << "edges " << edges.size() << std::endl; From b5fe230fcd4d7cc7a298e5e0c626a4a3ac68f6a5 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Sun, 21 Jun 2015 16:11:15 -0400 Subject: [PATCH 159/201] face_base changed --- .../include/CGAL/Reconstruction_face_base_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 34f4a1f9cf6..ac94457f034 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -1,4 +1,4 @@ - // Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +fdsa // Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. // All rights reserved. // From d2ff7436856aaa3eac86a5186f118f86f2bc25fe Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Sun, 21 Jun 2015 18:23:40 -0400 Subject: [PATCH 160/201] changd list to vector in tests and examples --- .../Reconstruction_simplification_2/rs2_mass_example.cpp | 4 ++-- .../Reconstruction_simplification_2/rs2_output_example.cpp | 6 +++--- .../rs2_simplest_example.cpp | 6 +++--- .../include/CGAL/Reconstruction_face_base_2.h | 2 +- .../test/Reconstruction_simplification_2/test_basic.cpp | 4 ++-- .../Reconstruction_simplification_2/test_flip_procedure.cpp | 4 ++-- .../Reconstruction_simplification_2/test_output_modules.cpp | 4 ++-- .../test/Reconstruction_simplification_2/test_quality.cpp | 2 +- .../test_reconstruction_until.cpp | 4 ++-- .../Reconstruction_simplification_2/test_vertex_edge.cpp | 4 ++-- .../test/Reconstruction_simplification_2/testing_tools.h | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp index 60de605d3be..240fc231757 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp @@ -8,7 +8,7 @@ #include #include #include // std::pair -#include +#include #include @@ -19,7 +19,7 @@ typedef K::Segment_2 Segment; typedef K::FT FT; typedef std::pair PointMassPair; -typedef std::list PointMassList; +typedef std::vector PointMassList; typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp index 775c1a7d015..537c28b4c96 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; @@ -16,7 +16,7 @@ typedef K::FT FT; typedef CGAL::Reconstruction_simplification_2 Rs_2; -void load_xy_file(const std::string& filename, std::list& points) +void load_xy_file(const std::string& filename, std::vector& points) { std::ifstream ifs(filename.c_str()); Point point; @@ -80,7 +80,7 @@ void indexed_output(Rs_2& rs2) int main () { - std::list points; + std::vector points; load_xy_file("data/stair-noise00.xy", points); diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp index b78b879b19a..6dc758cdb6a 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; @@ -19,7 +19,7 @@ typedef K::FT FT; typedef CGAL::Reconstruction_simplification_2 Rs_2; -void load_xy_file(const std::string& fileName, std::list& points) +void load_xy_file(const std::string& fileName, std::vector& points) { std::ifstream ifs(fileName.c_str()); @@ -32,7 +32,7 @@ void load_xy_file(const std::string& fileName, std::list& points) int main () { - std::list points; + std::vector points; load_xy_file("data/stair.xy", points); Rs_2 rs2(points); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index f8ca2a6847a..0a7f5c10a0d 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -1,4 +1,4 @@ -fdsa // Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. +// Copyright (c) 2014 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. // All rights reserved. // diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index 59374743d4e..e6c4f1f10f3 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -8,7 +8,7 @@ #include #include "testing_tools.h" -#include +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; @@ -18,7 +18,7 @@ typedef K::FT FT; int main () { - std::list points; + std::vector points; //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index ec46e879060..45eae036637 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -14,7 +14,7 @@ #include #include // std::pair #include - +#include typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_2 Point; @@ -23,7 +23,7 @@ typedef K::FT FT; int main () { - std::list points; + std::vector points; //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 0ba230056b7..c71e1364c8f 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "testing_tools.h" @@ -34,7 +34,7 @@ void test_index_output(Rs_2& rs2); int main () { - std::list points; + std::vector points; //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index 4a36aa13833..02d0d6537d8 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -21,7 +21,7 @@ typedef K::Point_2 Point; typedef K::FT FT; typedef std::pair PointMassPair; -typedef std::list PointMassList; +typedef std::vector PointMassList; typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index f62831c510a..e8cd0ff1535 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include "testing_tools.h" @@ -25,7 +25,7 @@ typedef K::Segment_2 Segment; int main () { - std::list points; + std::vector points; //use the stair example for testing load_xy_file_points("data/stair-noise00.xy", points); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index f4ee01c7b6c..19a68d370cc 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include // std::pair #include @@ -25,7 +26,7 @@ typedef K::Point_2 Point; typedef K::FT FT; typedef std::pair PointMassPair; -typedef std::list PointMassList; +typedef std::vector PointMassList; typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; @@ -71,7 +72,6 @@ void test_edge_collapse() { CGAL::Reconstruction_simplification_2 rs2(points, point_pmap, mass_pmap); - Rt_2 rt2; rs2.extract_tds_output(rt2); diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h index 3d08e8c595a..051d8a4b741 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h @@ -1,5 +1,5 @@ #include - +#include template void load_xy_file(const std::string& filename, PointMassList& points) @@ -13,7 +13,7 @@ void load_xy_file(const std::string& filename, PointMassList& points) } template -void load_xy_file_points(const std::string& fileName, std::list& points) +void load_xy_file_points(const std::string& fileName, std::vector& points) { std::ifstream ifs(fileName.c_str()); Point point; From 1d2690abcea8fc164ec7eb830916d0a57c50c327 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Sun, 21 Jun 2015 18:33:12 -0400 Subject: [PATCH 161/201] changd list to vector in demo --- .../Reconstruction_simplification_2/scene.h | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 784a2124697..eabdd34a2bf 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -17,6 +17,7 @@ #include "third/CImg.h" #include "random.h" #include // std::pair +#include #include #include @@ -25,7 +26,7 @@ class Scene { public: typedef std::pair PointMassPair; - typedef std::list PointMassList; + typedef std::vector PointMassList; typedef PointMassList::const_iterator InputIterator; typedef CGAL::value_type_traits::type MassPoint; @@ -80,7 +81,7 @@ public: private: // data - std::list m_samples; + std::vector m_samples; double m_min_mass; double m_max_mass; @@ -125,7 +126,7 @@ public: void invert_mass() { double new_max_mass = 0.0; - std::list::iterator it; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& sample = *it; sample.mass() = m_max_mass - sample.mass(); @@ -135,8 +136,8 @@ public: } void clamp_mass() { - std::list new_samples; - std::list::iterator it; + std::vector new_samples; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& sample = *it; if (sample.mass() > m_min_mass) { @@ -152,9 +153,9 @@ public: if (m_samples.size() < 3) return; - std::list new_samples; - std::list::const_iterator it = m_samples.begin(); - std::list::const_iterator last = it++; + std::vector new_samples; + std::vector::const_iterator it = m_samples.begin(); + std::vector::const_iterator last = it++; while (it != m_samples.end()) { Point p = CGAL::midpoint(last->point(), it->point()); FT m = 0.5 * (last->mass() + it->mass()); @@ -166,8 +167,8 @@ public: FT m = 0.5 * (last->mass() + it->mass()); new_samples.push_back(Sample_(p, m)); - std::list final_samples; - std::list::const_iterator it2 = new_samples.begin(); + std::vector final_samples; + std::vector::const_iterator it2 = new_samples.begin(); while (it != m_samples.end() && it2 != new_samples.end()) { final_samples.push_back(*it); final_samples.push_back(*it2); @@ -196,7 +197,7 @@ public: void noise(const FT scale) { std::cerr << "noise by " << scale << "..."; - std::list::iterator it; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { Sample_& sample = *it; Point& point = sample.point(); @@ -212,7 +213,7 @@ public: return; Point center(m_bbox_x, m_bbox_y); - std::list::iterator it; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& sample = *it; Vector vec = (sample.point() - center) / m_bbox_size; @@ -230,7 +231,7 @@ public: } FT x_min, x_max, y_min, y_max; - std::list::const_iterator it = m_samples.begin(); + std::vector::const_iterator it = m_samples.begin(); Point p = it->point(); x_min = x_max = p.x(); y_min = y_max = p.y(); @@ -438,7 +439,7 @@ public: } Sample_list samples; - for (std::list::iterator it = m_samples.begin(); + for (std::vector::iterator it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& s = *it; if (s.mass() < m_min_mass) @@ -468,10 +469,10 @@ public: } void save_pwn(const QString& filename, const Sample_list& samples) { - std::list normals; + std::vector normals; compute_normals(samples, normals); std::ofstream ofs(qPrintable(filename)); - std::list::const_iterator ni = normals.begin(); + std::vector::const_iterator ni = normals.begin(); for (Sample_list_const_iterator it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; @@ -482,7 +483,7 @@ public: } void compute_normals(const Sample_list& samples, - std::list& normals) { + std::vector& normals) { normals.clear(); Point last = samples.back()->point(); Sample_list_const_iterator si = samples.begin(); @@ -588,9 +589,9 @@ public: void decimate(const double percentage) { std::cout << "Decimate from " << m_samples.size() << " to..."; - std::list selected; + std::vector selected; - std::list::iterator it; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { const double rd = random_double(0.0, 1.0); if (rd >= percentage) @@ -605,10 +606,10 @@ public: void keep_one_point_out_of(const int n) { std::cout << "Decimate from " << m_samples.size() << " to..."; - std::list selected; + std::vector selected; int index = 0; - std::list::iterator it; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++, index++) { if (index % n == 0) selected.push_back(*it); @@ -622,7 +623,7 @@ public: void select_samples(const double percentage, Sample_list& vertices, Sample_list& samples) { - std::list::iterator it; + std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& s = *it; if (s.mass() <= m_min_mass) @@ -739,7 +740,7 @@ public: ::glPointSize(point_size); ::glBegin(GL_POINTS); - std::list::const_iterator it; + std::vector::const_iterator it; for (it = m_samples.begin(); it != m_samples.end(); it++) { double mass = it->mass(); if (mass <= m_min_mass) From 9dda73d6f33130cee443862d119094b9b541727f Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Sun, 21 Jun 2015 19:18:46 -0400 Subject: [PATCH 162/201] changd list to vector in RS2 --- ...Reconstruction_simplification_kerneled_2.h | 4 +- .../include/CGAL/Reconstruction_face_base_2.h | 10 +-- .../CGAL/Reconstruction_simplification_2.h | 64 ++++++++++--------- .../CGAL/Reconstruction_triangulation_2.h | 40 ++++++------ 4 files changed, 60 insertions(+), 58 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h index c22991a741a..bafa9eca723 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -9,7 +9,7 @@ #include #include // std::pair -#include +#include //Qt #include @@ -19,7 +19,7 @@ typedef K::Point_2 Point; typedef K::FT FT; typedef std::pair PointMassPair; -typedef std::list PointMassList; +typedef std::vector PointMassList; typedef PointMassList::const_iterator InputIterator; typedef CGAL::value_type_traits::type MassPoint; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index 0a7f5c10a0d..b7a30193a35 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -25,7 +25,7 @@ #include #include -#include +#include /// \cond SKIP_IN_MANUAL @@ -58,10 +58,10 @@ public: typedef typename Kernel::FT FT; typedef Cost Cost_; typedef Sample Sample_; - typedef std::list Sample_list; + typedef std::vector Sample_vector; private: - Sample_list m_samples[3]; + Sample_vector m_samples[3]; FT m_mass[3]; Cost_ m_cost0[3]; @@ -182,8 +182,8 @@ public: return false; } - const Sample_list& samples(int edge) const { return m_samples[edge]; } - Sample_list& samples(int edge) { return m_samples[edge]; } + const Sample_vector& samples(int edge) const { return m_samples[edge]; } + Sample_vector& samples(int edge) { return m_samples[edge]; } void add_sample(int edge, Sample_* sample) { diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 5c3527eb29c..e5cef01a519 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include // std::pair @@ -104,7 +105,7 @@ public: typedef typename std::pair PointMassPair; - typedef typename std::list PointMassList; + typedef typename std::vector PointMassList; /*! @@ -137,17 +138,18 @@ public: typedef typename Triangulation::Vertex_handle_set Vertex_handle_set; typedef typename Triangulation::Edge_set Edge_set; - typedef typename Triangulation::Edge_list Edge_list; + typedef typename Triangulation::Edge_vector Edge_vector; + typedef std::list Edge_list; typedef typename Triangulation::Cost_ Cost_; typedef typename Triangulation::Sample_ Sample_; - typedef typename Triangulation::Sample_list Sample_list; - typedef typename Triangulation::Sample_list_const_iterator - Sample_list_const_iterator; + typedef typename Triangulation::Sample_vector Sample_vector; + typedef typename Triangulation::Sample_vector_const_iterator + Sample_vector_const_iterator; - typedef typename Triangulation::Point_list Point_list; - typedef typename Triangulation::Point_list_const_iterator - Point_list_const_iterator; + typedef typename Triangulation::Point_vector Point_vector; + typedef typename Triangulation::Point_vector_const_iterator + Point_vector_const_iterator; typedef typename Triangulation::PSample PSample; typedef typename Triangulation::SQueue SQueue; @@ -399,7 +401,7 @@ protected: init(start, beyond); - std::list m_samples; + std::vector m_samples; for (InputIterator it = start; it != beyond; it++) { #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 Point point = get(point_pmap, it); @@ -501,7 +503,7 @@ protected: } void reassign_samples() { - Sample_list samples; + Sample_vector samples; m_dt.collect_all_samples(samples); m_dt.cleanup_assignments(); m_dt.assign_samples(samples.begin(), samples.end()); @@ -509,11 +511,11 @@ protected: } void reassign_samples_around_vertex(Vertex_handle vertex) { - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_vertex(vertex, samples, true); m_dt.assign_samples(samples.begin(), samples.end()); - Edge_list hull; + Edge_vector hull; m_dt.get_edges_from_star_minus_link(vertex, hull, true); update_cost(hull.begin(), hull.end()); } @@ -529,10 +531,10 @@ protected: << s->id() << "->" << t->id() << ") ... " << std::endl; } - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_vertex(s, samples, true); - Edge_list hull; + Edge_vector hull; m_dt.get_edges_from_star_minus_link(s, hull, true); if (m_mchoice == 0) @@ -586,7 +588,7 @@ protected: Vertex_handle copy_source = copy.source_vertex(copy_edge); if (m_use_flip) { - Edge_list copy_hull; + Edge_vector copy_hull; copy.get_edges_from_star_minus_link(copy_source, copy_hull, true); ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); @@ -606,7 +608,7 @@ protected: copy.collapse(copy_edge, m_verbose); - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_vertex(s, samples, false); backup_samples(samples.begin(), samples.end()); @@ -688,10 +690,10 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { template // value_type = Edge void update_cost(Iterator begin, Iterator end) { - Edge_list edges; + Edge_vector edges; collect_cost_stencil(m_dt, begin, end, edges); - typename Edge_list::iterator ei; + typename Edge_vector::iterator ei; for (ei = edges.begin(); ei != edges.end(); ++ei) { Edge edge = *ei; m_dt.update_cost(edge); @@ -700,7 +702,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { template // value_type = Edge void collect_cost_stencil(const Triangulation& mesh, Iterator begin, - Iterator end, Edge_list& edges) { + Iterator end, Edge_vector& edges) { Edge_set done; Edge_list fifo; for (Iterator it = begin; it != end; ++it) { @@ -841,10 +843,10 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { if (m_mindex.empty()) return; - Edge_list edges; + Edge_vector edges; collect_pqueue_stencil(m_dt, begin, end, edges); - typename Edge_list::const_iterator ei; + typename Edge_vector::const_iterator ei; for (ei = edges.begin(); ei != edges.end(); ++ei) { Edge edge = *ei; (m_mindex.template get<0>()).erase(Rec_edge_2(edge)); @@ -853,10 +855,10 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { template // value_type = Edge void push_stencil_to_pqueue(Iterator begin, Iterator end) { - Edge_list edges; + Edge_vector edges; collect_pqueue_stencil(m_dt, begin, end, edges); - typename Edge_list::const_iterator ei; + typename Edge_vector::const_iterator ei; for (ei = edges.begin(); ei != edges.end(); ++ei) { Edge edge = *ei; push_to_mindex(edge, m_mindex); @@ -865,7 +867,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { template // value_type = Edge void collect_pqueue_stencil(const Triangulation& mesh, Iterator begin, - Iterator end, Edge_list& edges) { + Iterator end, Edge_vector& edges) { Vertex_handle_set vertex_set; for (Iterator it = begin; it != end; ++it) { Edge edge = *it; @@ -1049,7 +1051,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { index = copy_face->index(copy_vertex); Edge copy_twin = copy.twin_edge(Edge(copy_face, index)); - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_edge(twin, samples); copy_twin.first->samples(copy_twin.second) = samples; } @@ -1098,7 +1100,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { if (v->point() == v->relocated()) continue; - Edge_list hull; + Edge_vector hull; m_dt.get_edges_from_star_minus_link(v, hull, false); bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), hull.end()); @@ -1185,12 +1187,12 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { const Point& pa = m_dt.source_vertex(edge)->point(); const Point& pb = m_dt.target_vertex(edge)->point(); - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_edge(edge, samples); m_dt.collect_samples_from_edge(twin, samples); Vector grad(0.0, 0.0); - Sample_list_const_iterator it; + Sample_vector_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; const FT m = sample->mass(); @@ -1209,11 +1211,11 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { const Point& pa = m_dt.source_vertex(edge)->point(); const Point& pb = m_dt.target_vertex(edge)->point(); - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_edge(edge, samples); m_dt.collect_samples_from_edge(twin, samples); - Sample_list_const_iterator it; + Sample_vector_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; const FT m = sample->mass(); @@ -1452,7 +1454,7 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { if (v->point() == v->relocated()) continue; - Edge_list hull; + Edge_vector hull; m_dt.get_edges_from_star_minus_link(v, hull, false); bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), hull.end()); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 5d6483941b2..f4cc842417a 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -24,7 +24,7 @@ // STL #include #include -#include +#include #include #include #include @@ -114,15 +114,15 @@ public: Vertex_handle_set; typedef std::set > Edge_set; - typedef std::list Edge_list; + typedef std::vector Edge_vector; - typedef std::list Point_list; - typedef typename Point_list::const_iterator Point_list_const_iterator; + typedef std::vector Point_vector; + typedef typename Point_vector::const_iterator Point_vector_const_iterator; typedef Cost Cost_; typedef Sample Sample_; - typedef std::list Sample_list; - typedef typename Sample_list::const_iterator Sample_list_const_iterator; + typedef std::vector Sample_vector; + typedef typename Sample_vector::const_iterator Sample_vector_const_iterator; typedef Sample_with_priority PSample; typedef std::priority_queue, @@ -254,7 +254,7 @@ public: // boundary of star(vertex) // 'outward' chooses the orientation of the boundary - void get_edges_from_star_minus_link(Vertex_handle vertex, Edge_list& hull, + void get_edges_from_star_minus_link(Vertex_handle vertex, Edge_vector& hull, bool outward = false) const { Face_circulator fcirc = Base::incident_faces(vertex); Face_circulator fend = fcirc; @@ -339,12 +339,12 @@ public: + twin.first->samples(twin.second).size(); } - void collect_samples_from_edge(const Edge& edge, Sample_list& samples) { - const Sample_list& edge_samples = edge.first->samples(edge.second); + void collect_samples_from_edge(const Edge& edge, Sample_vector& samples) { + const Sample_vector& edge_samples = edge.first->samples(edge.second); samples.insert(samples.end(), edge_samples.begin(), edge_samples.end()); } - void collect_samples_from_vertex(Vertex_handle vertex, Sample_list& samples, + void collect_samples_from_vertex(Vertex_handle vertex, Sample_vector& samples, bool cleanup) { Face_circulator fcirc = Base::incident_faces(vertex); Face_circulator fend = fcirc; @@ -372,7 +372,7 @@ public: vertex->set_sample(NULL); } - void collect_all_samples(Sample_list& samples) { + void collect_all_samples(Sample_vector& samples) { for (Finite_edges_iterator ei = Base::finite_edges_begin(); ei != Base::finite_edges_end(); ++ei) { Edge edge = *ei; @@ -467,15 +467,15 @@ public: void compute_mass(const Edge& edge) { FT mass = 0.0; - typename Sample_list::const_iterator it; - const Sample_list& samples0 = edge.first->samples(edge.second); + typename Sample_vector::const_iterator it; + const Sample_vector& samples0 = edge.first->samples(edge.second); for (it = samples0.begin(); it != samples0.end(); ++it) { Sample_* sample = *it; mass += sample->mass(); } Edge twin = twin_edge(edge); - const Sample_list& samples1 = twin.first->samples(twin.second); + const Sample_vector& samples1 = twin.first->samples(twin.second); for (it = samples1.begin(); it != samples1.end(); ++it) { Sample_* sample = *it; mass += sample->mass(); @@ -513,15 +513,15 @@ public: } void sort_samples_from_edge(const Edge& edge, SQueue& squeue) { - typename Sample_list::const_iterator it; - const Sample_list& samples0 = edge.first->samples(edge.second); + typename Sample_vector::const_iterator it; + const Sample_vector& samples0 = edge.first->samples(edge.second); for (it = samples0.begin(); it != samples0.end(); ++it) { Sample_* sample = *it; squeue.push(PSample(sample, sample->coordinate())); } Edge twin = twin_edge(edge); - const Sample_list& samples1 = twin.first->samples(twin.second); + const Sample_vector& samples1 = twin.first->samples(twin.second); for (it = samples1.begin(); it != samples1.end(); ++it) { Sample_* sample = *it; squeue.push(PSample(sample, 1.0 - sample->coordinate())); @@ -563,12 +563,12 @@ public: const Point& ps = source_vertex(edge)->point(); const Point& pt = target_vertex(edge)->point(); - Sample_list samples; + Sample_vector samples; collect_samples_from_edge(edge, samples); collect_samples_from_edge(twin, samples); Cost_ sum; - for (Sample_list_const_iterator it = samples.begin(); + for (Sample_vector_const_iterator it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; FT mass = sample->mass(); @@ -894,7 +894,7 @@ public: Vertex_handle s = source_vertex(edge); Vertex_handle t = target_vertex(edge); - Edge_list hull; + Edge_vector hull; get_edges_from_star_minus_link(s, hull); return is_in_kernel(t->point(), hull.begin(), hull.end()); } From 42f2973a890a4cd044c0e174016b37df3f4ea037 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 22 Jun 2015 17:51:46 +0200 Subject: [PATCH 163/201] More reliable assert, as two different edges can be picked up --- .../Reconstruction_simplification_2/test_vertex_edge.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index 19a68d370cc..3d199426c82 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -102,8 +102,11 @@ void test_edge_collapse() { std::cout << "--------" << std::endl; - //test that the right edge was picked for collapsing - assert(pedge == contract_edge); + //test that the right edge was picked for collapsing + // N.B.: it can be two different edges if several edges have the same + // priority value. + assert(CGAL::abs(pedge.priority() - contract_edge.priority()) + < pedge.priority()*1e-13); rs2.do_collapse(contract_edge.edge()); bool found = false; From 069dbf1529ad4fa2c5a00c582b9ac8a7005c1bf8 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 22 Jun 2015 19:08:09 +0200 Subject: [PATCH 164/201] Some types were not renamed --- .../render.cpp | 8 ++-- .../Reconstruction_simplification_2/scene.h | 42 +++++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 06079948886..9647ce3f515 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -166,9 +166,9 @@ void R_s_k_2::draw_edge_footpoints(const Triangulation& mesh, { const Point& a = mesh.source_vertex(edge)->point(); const Point& b = mesh.target_vertex(edge)->point(); - const Sample_list& samples = edge.first->samples(edge.second); + const Sample_vector& samples = edge.first->samples(edge.second); - Sample_list::const_iterator it; + Sample_vector::const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; @@ -395,12 +395,12 @@ void R_s_k_2::draw_bins_plan0(const Edge& edge) const Point& pa = m_dt.source_vertex(edge)->point(); const Point& pb = m_dt.target_vertex(edge)->point(); - Sample_list samples; + Sample_vector samples; m_dt.collect_samples_from_edge(edge, samples); m_dt.collect_samples_from_edge(twin, samples); ::glColor3f(0.0f, 1.0f, 0.0f); - Sample_list_const_iterator it; + Sample_vector_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index eabdd34a2bf..40088febd9c 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -67,11 +67,11 @@ public: typedef R_s_2::Edge_list Edge_list; typedef R_s_2::Sample_ Sample_; - typedef R_s_2::Sample_list Sample_list; - typedef R_s_2::Sample_list_const_iterator Sample_list_const_iterator; + typedef R_s_2::Sample_vector Sample_vector; + typedef R_s_2::Sample_vector_const_iterator Sample_vector_const_iterator; - typedef R_s_2::Point_list Point_list; - typedef R_s_2::Point_list_const_iterator Point_list_const_iterator; + typedef R_s_2::Point_vector Point_vector; + typedef R_s_2::Point_vector_const_iterator Point_vector_const_iterator; typedef R_s_2::PSample PSample; typedef R_s_2::SQueue SQueue; @@ -438,7 +438,7 @@ public: return; } - Sample_list samples; + Sample_vector samples; for (std::vector::iterator it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& s = *it; @@ -468,12 +468,12 @@ public: } } - void save_pwn(const QString& filename, const Sample_list& samples) { + void save_pwn(const QString& filename, const Sample_vector& samples) { std::vector normals; compute_normals(samples, normals); std::ofstream ofs(qPrintable(filename)); std::vector::const_iterator ni = normals.begin(); - for (Sample_list_const_iterator it = samples.begin(); + for (Sample_vector_const_iterator it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; ofs << sample->point() << " " << *ni << std::endl; @@ -482,11 +482,11 @@ public: ofs.close(); } - void compute_normals(const Sample_list& samples, + void compute_normals(const Sample_vector& samples, std::vector& normals) { normals.clear(); Point last = samples.back()->point(); - Sample_list_const_iterator si = samples.begin(); + Sample_vector_const_iterator si = samples.begin(); while (si != samples.end()) { Point p = (*si)->point(); si++; @@ -509,9 +509,9 @@ public: } } - void save_xy(const QString& filename, const Sample_list& samples) { + void save_xy(const QString& filename, const Sample_vector& samples) { std::ofstream ofs(qPrintable(filename)); - for (Sample_list_const_iterator it = samples.begin(); + for (Sample_vector_const_iterator it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; ofs << sample->point() << std::endl; @@ -519,10 +519,10 @@ public: ofs.close(); } - void save_poff(const QString& filename, const Sample_list& samples) { + void save_poff(const QString& filename, const Sample_vector& samples) { std::ofstream ofs(qPrintable(filename)); ofs << "POFF " << samples.size() << " 0 0" << std::endl; - for (Sample_list_const_iterator it = samples.begin(); + for (Sample_vector_const_iterator it = samples.begin(); it != samples.end(); ++it) { Sample_* sample = *it; ofs << sample->point() << std::endl; @@ -530,11 +530,11 @@ public: ofs.close(); } - void save_gtn(const QString& filename, const Sample_list& samples) { + void save_gtn(const QString& filename, const Sample_vector& samples) { std::ofstream ofs(qPrintable(filename)); ofs << samples.size() << " 2 0 0" << std::endl; unsigned int i = 0; - for (Sample_list_const_iterator it = samples.begin(); + for (Sample_vector_const_iterator it = samples.begin(); it != samples.end(); ++it, ++i) { Sample_* sample = *it; ofs << i << " " << sample->point() << std::endl; @@ -567,11 +567,11 @@ public: return false; } - Sample_list vertices, samples; + Sample_vector vertices, samples; select_samples(percentage, vertices, samples); PointMassList point_mass_list; - Sample_list_const_iterator it; + Sample_vector_const_iterator it; for (it = vertices.begin(); it != vertices.end(); it++) { point_mass_list.push_back( std::make_pair((*it)->point(), (*it)->mass())); @@ -621,8 +621,8 @@ public: std::cout << m_samples.size() << std::endl; } - void select_samples(const double percentage, Sample_list& vertices, - Sample_list& samples) { + void select_samples(const double percentage, Sample_vector& vertices, + Sample_vector& samples) { std::vector::iterator it; for (it = m_samples.begin(); it != m_samples.end(); ++it) { Sample_& s = *it; @@ -756,7 +756,7 @@ public: } void draw_circles() { - Sample_list vertices, samples; + Sample_vector vertices, samples; select_samples(1.0, vertices, samples); double percentage = 500.0 / double(vertices.size()); percentage = (std::min)(percentage, 1.0); @@ -768,7 +768,7 @@ public: ::glEnable(GL_BLEND); ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ::glColor4f(1.0f, 1.0f, 0.2f, 0.25f); - for (Sample_list_const_iterator it = samples.begin(); + for (Sample_vector_const_iterator it = samples.begin(); it != samples.end(); it++) { Sample_* sample = *it; draw_one_circle(sample->point()); From 4a113bcc3f69cd0042437154be68316038a18656 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 22 Jun 2015 19:08:24 +0200 Subject: [PATCH 165/201] Samples deallocation --- .../CGAL/Reconstruction_simplification_2.h | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index e5cef01a519..ab0b50b225b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -429,6 +429,27 @@ protected: } void clear() { + // Deallocate samples + for (Vertex_iterator vi = m_dt.vertices_begin(); + vi != m_dt.vertices_end(); ++vi) + { + Sample_ *s = vi->get_sample(); + if (s) + delete s; + } + + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge &edge = *ei; + const Sample_vector& samples = edge.first->samples(edge.second); + Sample_vector::const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) + { + delete *it; + } + } + m_dt.clear(); m_mindex.clear(); } From fd339f926eabef95d3fcb4be122886b8ce06acea Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 22 Jun 2015 20:01:45 +0200 Subject: [PATCH 166/201] Edge_list => Edge_vector --- .../render.cpp | 26 +++++++++---------- .../Reconstruction_simplification_2/scene.h | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 9647ce3f515..544e2e7be93 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -602,7 +602,7 @@ void R_s_k_2::draw_collapsible_edge(const float point_size, Vertex_handle copy_src = copy.source_vertex(copy_edge); Vertex_handle copy_dst = copy.target_vertex(copy_edge); - Edge_list copy_hull; + Edge_vector copy_hull; copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); @@ -625,7 +625,7 @@ void R_s_k_2::draw_simulation(const float point_size, Vertex_handle copy_src = copy.source_vertex(copy_edge); Vertex_handle copy_dst = copy.target_vertex(copy_edge); - Edge_list copy_hull; + Edge_vector copy_hull; copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); @@ -664,7 +664,7 @@ void R_s_k_2::draw_cost_stencil(const float point_size, Vertex_handle copy_src = copy.source_vertex(copy_edge); Vertex_handle copy_dst = copy.target_vertex(copy_edge); - Edge_list copy_hull; + Edge_vector copy_hull; copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); if (!ok) return; @@ -675,9 +675,9 @@ void R_s_k_2::draw_cost_stencil(const float point_size, ::glLineWidth(line_width); ::glPointSize(point_size); - Edge_list stencil; + Edge_vector stencil; collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), stencil); - for (Edge_list::const_iterator it = stencil.begin(); it != stencil.end(); ++it) + for (Edge_vector::const_iterator it = stencil.begin(); it != stencil.end(); ++it) { Edge e = *it; ::glColor3f(0.7f, 0.4f, 0.0f); @@ -696,9 +696,9 @@ void R_s_k_2::draw_remove_queue_stencil(const float point_size, bool ok = locate_edge(query, edge); if (!ok) return; - Edge_list hull; - Edge_list stencil; - Edge_list::const_iterator it; + Edge_vector hull; + Edge_vector stencil; + Edge_vector::const_iterator it; Vertex_handle src = m_dt.source_vertex(edge); m_dt.get_edges_from_star_minus_link(src, hull, true); collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); @@ -739,13 +739,13 @@ void R_s_k_2::draw_push_queue_stencil(const float point_size, bool ok = locate_edge(query, edge); if (!ok) return; - Edge_list hull; - Edge_list stencil; + Edge_vector hull; + Edge_vector stencil; Vertex_handle src = m_dt.source_vertex(edge); m_dt.get_edges_from_star_minus_link(src, hull, true); collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); - Edge_list::iterator it = stencil.begin(); + Edge_vector::iterator it = stencil.begin(); while (it != stencil.end()) { Edge edge = *it; @@ -758,8 +758,8 @@ void R_s_k_2::draw_push_queue_stencil(const float point_size, } Triangulation copy; - Edge_list copy_hull; - Edge_list copy_stencil; + Edge_vector copy_hull; + Edge_vector copy_stencil; Edge copy_edge = copy_star(edge, copy); Vertex_handle copy_src = copy.source_vertex(copy_edge); Vertex_handle copy_dst = copy.target_vertex(copy_edge); diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 40088febd9c..a7643af473d 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -64,7 +64,7 @@ public: typedef R_s_2::Vertex_handle_set Vertex_handle_set; typedef R_s_2::Edge_set Edge_set; - typedef R_s_2::Edge_list Edge_list; + typedef R_s_2::Edge_vector Edge_vector; typedef R_s_2::Sample_ Sample_; typedef R_s_2::Sample_vector Sample_vector; From a81dfa2b067709339b8c21b3895810a96e815133 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 22 Jun 2015 23:16:42 +0200 Subject: [PATCH 167/201] clarify local and global relocation added fig with variable mass --- .../Reconstruction_Simplification_2.txt | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index b4680e8b4b3..ee6d5bbf76d 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -71,13 +71,13 @@ Examples of 20-vertex reconstructions from datasets consisting of 2000, 400 and \cgalFigureEnd -\subsection Reconstruction_simplification_2Relocation Point Relocation +\subsection Reconstruction_simplification_2Global_relocation Global Point Relocation Since noise and missing data may prevent the reconstructed shape to have sharp corners at the correct places, the algorithm offers a function to relocate all points: \code{.cpp} rs2.relocate_all_points(); \endcode -The new point locations are chosen such that the approximation of the output segments and isolated points to the input points is improved. Note also that an optional parameter of the constructor of the Reconstruction_simplification_2 class provides a means to relocate the points after a specified number of atomic simplification operators. +The new point locations are chosen such that the approximation of the output segments and isolated points to the input points is improved. \cgalFigureBegin{2D_Reconstruction_Simplification_relocation,relocation.png} Left: before point relocation. Right: after point relocation. @@ -86,7 +86,7 @@ Left: before point relocation. Right: after point relocation. \section Reconstruction_simplification_2Parameters User parameters -The behavior of the algorithm is parameterized via five parameters. +The behavior of the algorithm is controlled via five parameters. \subsection Reconstruction_simplification_2Flip Edge Flipping @@ -99,15 +99,18 @@ Edge flipping. Left: the blue edge creates fold-overs because of blocking edges \subsection Reconstruction_simplification_2Relevance Edge Relevance An edge is relevant from the approximation point of view if (1) it is long, (2) approximates a large number of points (or a large amount of mass when points have mass attributes), and (3) has a small approximation error. The notion of relevance is defined as m(e) x |e|^2 / cost(e), where m(e) denotes the mass of the points approximated by the edge, |e| denotes the edge length and cost(e) its approximation error. As the error is defined by mass time squared distance the relevance is unitless. -The default value is 0, so that all edges approximating some input points are considered relevant. -A larger relevance value provides a means to increase resilience to outliers. +The default value is 0, so that all edges approximating some input points are considered relevant. A larger relevance value provides a means to increase resilience to outliers. + -% FIGURE WITH VARIOUS RELEVANCE VALUES \subsection Reconstruction_simplification_2Random Random Sample Size By default the simplification relies upon an exhaustive priority queue of half edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value must be enlarged when targeting a very coarse simplification. +\subsection Reconstruction_simplification_2Local_relocation Local Point Relocation + +In addition to the global relocation function an optional parameter of the constructor of the Reconstruction_simplification_2 class provides a means to relocate the points locally after a specified number of atomic simplification operators. The new local point locations are chosen such that the approximation of the output segments and isolated points to the input points is improved. + \subsection Reconstruction_simplification_2Verbose Verbose Output The verbose parameter, between 0 and 2, determines how much console output the algorithm generates. A 0 value generates no output to the standard output. A value greater than 0 generates output to the standard output std::cerr. @@ -133,10 +136,13 @@ Figure \cgalFigureRef{2D_Reconstruction_Simplification_mixed} depicts an input p Mixed dimension. Left: input point set. Middle: Isolated vertices in blue, relevant edges in green and irrelevant edges in red. Right: final output. \cgalFigureEnd -\section Reconstruction_simplification_2Variable_mass Variable_mass +\section Reconstruction_simplification_2Variable_mass Variable Mass -% FIGURE VARIABLE MASS +The mass attributes provides a means to adjust the importance given to each point for approximation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_variable} depicts a reconstruction from a gray level image after thresholding, where the gray level of the pixels are used as mass attribute. +\cgalFigureBegin{2D_Reconstruction_Simplification_variable,variable.png} +Variable mass. Left: input gray level image. Middle: image after thresholding to reduce the number of pixels with non-zero mass. Right: final reconstruction. +\cgalFigureEnd \section Reconstruction_simplification_2Advanced Advanced From e9fbd586255db807aac4d51ce64d80a1ad956142 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Mon, 22 Jun 2015 23:20:41 +0200 Subject: [PATCH 168/201] few fixes --- .../Reconstruction_Simplification_2.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt index ee6d5bbf76d..02dee2a10f0 100644 --- a/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt +++ b/Reconstruction_simplification_2/doc/Reconstruction_simplification_2/Reconstruction_Simplification_2.txt @@ -38,7 +38,8 @@ The following example first reads a set of input points and masses from an ASCII \section Reconstruction_simplification_2API API -The API design is chosen in such a way that most of the implementation details are hidden from the user, i.e., the only class exposed to the user is the Reconstruction_simplification_2 class. + +The only class exposed to the user is the Reconstruction_simplification_2 class. \subsection Reconstruction_simplification_2Sample Sample Call @@ -86,7 +87,7 @@ Left: before point relocation. Right: after point relocation. \section Reconstruction_simplification_2Parameters User parameters -The behavior of the algorithm is controlled via five parameters. +The behavior of the algorithm is controlled via the following parameters. \subsection Reconstruction_simplification_2Flip Edge Flipping @@ -102,7 +103,6 @@ An edge is relevant from the approximation point of view if (1) it is long, (2) The default value is 0, so that all edges approximating some input points are considered relevant. A larger relevance value provides a means to increase resilience to outliers. - \subsection Reconstruction_simplification_2Random Random Sample Size By default the simplification relies upon an exhaustive priority queue of half edge collapse operators during decimation. For improved efficiency, a parameter sample size strictly greater than 0 switches to a multiple choice approach, i.e., a best-choice selection in a random sample of edge collapse operators, of size sample_size. A typical value for the sample size is 15, but this value must be enlarged when targeting a very coarse simplification. @@ -123,12 +123,11 @@ Robustness to noise and outliers. Left: noise-free point set. Middle: noisy poin \cgalFigureEnd \section Reconstruction_simplification_2Density Variable Density -Figure \cgalFigureRef{2D_Reconstruction_Simplification_density} illustrates the behavior of the algorithm on a point set with uniform mass attributes, and variable density. As the algorithm gives more importance to densely sampled areas, this translates into smaller edges on densely sampled areas. On sparsely sampled areas the algorithm initially approximates each point by one isolated vertex, then progressively approximates with edges. +Figure \cgalFigureRef{2D_Reconstruction_Simplification_density} illustrates the behavior of the algorithm on a point set with uniform mass attributes, and variable density. As the algorithm gives more importance to densely sampled areas, this translates into smaller edges on densely sampled areas. On sparsely sampled areas the algorithm initially approximates each point by one isolated vertex, then progressively approximates the points with edges. \cgalFigureBegin{2D_Reconstruction_Simplification_density,density.png} Variable density. Left: input point set. Middle left: the output is composed of isolated vertices on sparse areas and of edges with adapted length elsewhere. \cgalFigureEnd - \section Reconstruction_simplification_2Mixed Mixed Dimension Figure \cgalFigureRef{2D_Reconstruction_Simplification_mixed} depicts an input point set sampling a set of line segments and a solid area. Depending on the targeted complexity, the solid area is approximated by a set of evenly sampled isolated vertices. @@ -141,14 +140,14 @@ Mixed dimension. Left: input point set. Middle: Isolated vertices in blue, relev The mass attributes provides a means to adjust the importance given to each point for approximation. Figure \cgalFigureRef{2D_Reconstruction_Simplification_variable} depicts a reconstruction from a gray level image after thresholding, where the gray level of the pixels are used as mass attribute. \cgalFigureBegin{2D_Reconstruction_Simplification_variable,variable.png} -Variable mass. Left: input gray level image. Middle: image after thresholding to reduce the number of pixels with non-zero mass. Right: final reconstruction. +Variable mass. Left: input gray level image. Middle: image after thresholding to reduce the number of pixels used as points with non-zero mass. Right: final reconstruction. \cgalFigureEnd \section Reconstruction_simplification_2Advanced Advanced The task addressed here is to reconstruct a shape from a noisy point set \f$ S \f$ in \f$ \mathbb{R}^2 \f$, i.e., given a set of points in the plane, find a set of points and segments (more formally, a 0-1 simplicial complex ) which best approximates \f$ S \f$. -The approximation error is derived from the theory of optimal transportation between geometric measures. More specifically, the input point set is seen as a discrete measure, ie, a set of pointwise masses. The goal is to find a 0-1 simplicial complex where the edges are the support of a piecewise uniform measure (line density of masses) and the vertices are the support of a discrete measure. Approximating the input point set in our context translates into approximating the input discrete measure by another measure composed of line segments and points. +The approximation error is derived from the theory of optimal transportation between geometric measures. More specifically, the input point set is seen as a discrete measure, i.e., a set of pointwise masses. The goal is to find a 0-1 simplicial complex where the edges are the support of a piecewise uniform measure (line density of masses) and the vertices are the support of a discrete measure. Approximating the input point set in our context translates into approximating the input discrete measure by another measure composed of line segments and points. The algorithm performs a fine to coarse simplification of a triangulation. It starts by putting a bounding box around the input points \f$S\f$ and computes the Delaunay Triangulation \f$ T_0 \f$ on a subset of \f$ S \f$. \f$ T_0 \f$ is the first output simplex, which is simplified in subsequent iterations by repeated edge collapses. To chose the next edge, a collapse operator is simulated for each feasible edge, i.e., edges which neither introduce overlaps nor fold-overs in the triangulation. The next edge \f$ e \f$ for collapse is chosen according to the overall cost of the transportation plan for \f$ T \setminus e \f$, where the cheapest overall cost is preferred. Since disregarding edges which do not preserve the embedding of the triangulation can severely affect the performance of the greedy approach to optimal transport, the collapse operator is modified by adding a local flip procedure which makes every edge collapsible. From d6cadbc66d46ba21400a491b731606cdf47693e2 Mon Sep 17 00:00:00 2001 From: Ivo Vigan Date: Mon, 22 Jun 2015 23:04:52 -0400 Subject: [PATCH 169/201] replaced tabs with spaces --- ...Reconstruction_simplification_kerneled_2.h | 156 +- .../glviewer.cpp | 272 +- .../Reconstruction_simplification_2/main.cpp | 12 +- .../moc_dialog_options.cxx | 60 +- .../moc_glviewer.cxx | 60 +- .../moc_window.cxx | 286 +- .../qrc_pwsrec.cxx | 3684 ++++++++--------- .../Reconstruction_simplification_2/random.h | 14 +- .../render.cpp | 1496 +++---- .../Reconstruction_simplification_2/scene.h | 2070 ++++----- .../ui_options.h | 462 +-- .../ui_pwsrec.h | 956 ++--- .../window.cpp | 802 ++-- .../Reconstruction_simplification_2/window.h | 252 +- .../rs2_mass_example.cpp | 40 +- .../rs2_output_example.cpp | 28 +- .../rs2_simplest_example.cpp | 6 +- .../include/CGAL/Cost.h | 140 +- .../include/CGAL/Reconstruction_edge_2.h | 170 +- .../include/CGAL/Reconstruction_face_base_2.h | 314 +- .../CGAL/Reconstruction_simplification_2.h | 2530 +++++------ .../CGAL/Reconstruction_triangulation_2.h | 1964 ++++----- .../CGAL/Reconstruction_vertex_base_2.h | 128 +- .../include/CGAL/Sample.h | 192 +- .../include/CGAL/console_color.h | 46 +- .../test_basic.cpp | 12 +- .../test_flip_procedure.cpp | 20 +- .../test_output_modules.cpp | 120 +- .../test_quality.cpp | 24 +- .../test_reconstruction_until.cpp | 26 +- .../test_vertex_edge.cpp | 160 +- .../testing_tools.h | 24 +- 32 files changed, 8264 insertions(+), 8262 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h index bafa9eca723..60e6785a956 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_kerneled_2.h @@ -28,130 +28,130 @@ typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; typedef CGAL::Reconstruction_simplification_2 Rs_2; + Mass_property_map> Rs_2; class Reconstruction_simplification_kerneled_2: - public Rs_2 { + public Rs_2 { public: - - template - Reconstruction_simplification_kerneled_2(const InputRange& input_range, + + template + Reconstruction_simplification_kerneled_2(const InputRange& input_range, Point_property_map point_pmap, Mass_property_map mass_pmap) : - Rs_2(input_range, point_pmap, - mass_pmap) { - } + Rs_2(input_range, point_pmap, + mass_pmap) { + } - Reconstruction_simplification_kerneled_2() : - Rs_2() { - } + Reconstruction_simplification_kerneled_2() : + Rs_2() { + } - // RENDER // - void print_stats() const; + // RENDER // + void print_stats() const; - QColor get_color(float value) const; + QColor get_color(float value) const; - void draw_point(const Point& point); + void draw_point(const Point& point); - void draw_segment(const Point& s, const Point& t); + void draw_segment(const Point& s, const Point& t); - void draw_edge(const Edge& edge); + void draw_edge(const Edge& edge); - void draw_face(Face_handle face); + void draw_face(Face_handle face); - void draw_edge_with_arrow(const Point& s, const Point& t); + void draw_edge_with_arrow(const Point& s, const Point& t); - void draw_vertices(const float point_size, const float red, - const float green, const float blue); + void draw_vertices(const float point_size, const float red, + const float green, const float blue); - void draw_edges(const float line_width, const float red, const float green, - const float blue); + void draw_edges(const float line_width, const float red, const float green, + const float blue); - void draw_footpoints(const float line_width, const float red, - const float green, const float blue); + void draw_footpoints(const float line_width, const float red, + const float green, const float blue); - void draw_mesh_footpoints(const Triangulation& mesh, const float line_width, - const float red, const float green, const float blue); + void draw_mesh_footpoints(const Triangulation& mesh, const float line_width, + const float red, const float green, const float blue); - void draw_edge_footpoints(const Triangulation& mesh, const Edge& edge, - const float red, const float green, const float blue); + void draw_edge_footpoints(const Triangulation& mesh, const Edge& edge, + const float red, const float green, const float blue); - void draw_pedges(const float line_width); + void draw_pedges(const float line_width); - void draw_one_pedge(const Edge& edge, const FT value, const FT min_value, - const FT max_value, const float line_width); + void draw_one_pedge(const Edge& edge, const FT value, const FT min_value, + const FT max_value, const float line_width); - void draw_costs(const float line_width, const bool view_ghost); + void draw_costs(const float line_width, const bool view_ghost); - void draw_one_cost(const Edge& edge, const FT min_value, const FT max_value, - const bool view_ghost); + void draw_one_cost(const Edge& edge, const FT min_value, const FT max_value, + const bool view_ghost); - void draw_relevance(const float line_width, const int nb, - const bool incolors); + void draw_relevance(const float line_width, const int nb, + const bool incolors); - void draw_bins(const float thickness); + void draw_bins(const float thickness); - void draw_bins_plan0(const Edge& edge); + void draw_bins_plan0(const Edge& edge); - void draw_bins_plan1(const Edge& edge); + void draw_bins_plan1(const Edge& edge); - void draw_relocation(); + void draw_relocation(); - void draw_bezier_curves(const unsigned int nb); + void draw_bezier_curves(const unsigned int nb); - void draw_one_bezier_curve(const Edge& edge, const unsigned int nb); + void draw_one_bezier_curve(const Edge& edge, const unsigned int nb); - bool locate_edge(const Point& query, Edge& edge); + bool locate_edge(const Point& query, Edge& edge); - void draw_one_ring(const float point_size, const float line_width, - const Point& query); + void draw_one_ring(const float point_size, const float line_width, + const Point& query); - void draw_mesh_one_ring(const float point_size, const float line_width, - const Triangulation& mesh, const Edge& edge); + void draw_mesh_one_ring(const float point_size, const float line_width, + const Triangulation& mesh, const Edge& edge); - void draw_blocking_edges(const float point_size, const float line_width, - const Point& query); + void draw_blocking_edges(const float point_size, const float line_width, + const Point& query); - void draw_mesh_blocking_edges(const float point_size, - const float line_width, const Triangulation& mesh, - const Edge& edge); + void draw_mesh_blocking_edges(const float point_size, + const float line_width, const Triangulation& mesh, + const Edge& edge); - void draw_collapsible_edge(const float point_size, const float line_width, - const Point& query); + void draw_collapsible_edge(const float point_size, const float line_width, + const Point& query); - void draw_simulation(const float point_size, const float line_width, - const Point& query); + void draw_simulation(const float point_size, const float line_width, + const Point& query); - void draw_cost_stencil(const float point_size, const float line_width, - const Point& query); + void draw_cost_stencil(const float point_size, const float line_width, + const Point& query); - void draw_remove_queue_stencil(const float point_size, - const float line_width, const Point& query); + void draw_remove_queue_stencil(const float point_size, + const float line_width, const Point& query); - void draw_push_queue_stencil(const float point_size, const float line_width, - const Point& query); + void draw_push_queue_stencil(const float point_size, const float line_width, + const Point& query); - void draw_bg_faces(const Triangulation& mesh, const float red, - const float green, const float blue, const float alpha); + void draw_bg_faces(const Triangulation& mesh, const float red, + const float green, const float blue, const float alpha); - void draw_bg_edges(const Triangulation& mesh, const float ri, - const float gi, const float bi, const float ro, const float go, - const float bo); + void draw_bg_edges(const Triangulation& mesh, const float ri, + const float gi, const float bi, const float ro, const float go, + const float bo); - void draw_bg_vertices(const Triangulation& mesh, const float red, - const float green, const float blue); + void draw_bg_vertices(const Triangulation& mesh, const float red, + const float green, const float blue); - void draw_vertex_faces(Vertex_handle vertex, const Triangulation& mesh, - const float red, const float green, const float blue, - const float alpha); + void draw_vertex_faces(Vertex_handle vertex, const Triangulation& mesh, + const float red, const float green, const float blue, + const float alpha); - void draw_vertex_edges(Vertex_handle vertex, const Triangulation& mesh, - const float ri, const float gi, const float bi, const float ro, - const float go, const float bo); + void draw_vertex_edges(Vertex_handle vertex, const Triangulation& mesh, + const float ri, const float gi, const float bi, const float ro, + const float go, const float bo); - void save_edges(std::ofstream& ofs, const int nb); + void save_edges(std::ofstream& ofs, const int nb); - void save_one_edge(std::ofstream& ofs, const Edge& edge); + void save_one_edge(std::ofstream& ofs, const Edge& edge); }; #endif diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp index 498667fa1eb..e4e6cb8b07c 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/glviewer.cpp @@ -7,183 +7,183 @@ GlViewer::GlViewer(QWidget *pParent) : QGLWidget(QGLFormat(QGL::SampleBuffers), pParent) { - m_scene = NULL; - - m_view_points = true; - m_view_vertices = true; - m_view_edges = false; - m_view_ghost_edges = false; - m_view_edge_cost = false; - m_view_edge_priority = false; - m_view_bins = false; - m_view_foot_points = false; - m_view_relocation = false; - m_view_tolerance = false; - m_view_incolors = false; - m_view_edge_relevance = true; - - m_insert_points = false; - m_activate_simulation = 0; - m_simulation_stage = 0; + m_scene = NULL; - m_line_thickness = 2.0; - m_point_size = 2.0; - m_vertex_size = 2.0; + m_view_points = true; + m_view_vertices = true; + m_view_edges = false; + m_view_ghost_edges = false; + m_view_edge_cost = false; + m_view_edge_priority = false; + m_view_bins = false; + m_view_foot_points = false; + m_view_relocation = false; + m_view_tolerance = false; + m_view_incolors = false; + m_view_edge_relevance = true; - m_scale = 1.0; - m_center_x = m_center_y = 0.5; - - setAutoFillBackground(false); + m_insert_points = false; + m_activate_simulation = 0; + m_simulation_stage = 0; + + m_line_thickness = 2.0; + m_point_size = 2.0; + m_vertex_size = 2.0; + + m_scale = 1.0; + m_center_x = m_center_y = 0.5; + + setAutoFillBackground(false); } void GlViewer::resizeGL(int width, int height) { - glViewport(0, 0, width, height); - double aspect_ratio = double(height) / double(width); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-1.0, 1.0, -aspect_ratio, aspect_ratio, -1.0, 1.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); + glViewport(0, 0, width, height); + double aspect_ratio = double(height) / double(width); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-1.0, 1.0, -aspect_ratio, aspect_ratio, -1.0, 1.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); } void GlViewer::initializeGL() { - glClearColor(1., 1., 1., 0.); - glDisable(GL_DEPTH_TEST); - glEnable(GL_SMOOTH); + glClearColor(1., 1., 1., 0.); + glDisable(GL_DEPTH_TEST); + glEnable(GL_SMOOTH); } void GlViewer::paintGL() { - glClear(GL_COLOR_BUFFER_BIT); - if (!m_scene) return; - - glPushMatrix(); - glScaled(m_scale, m_scale, m_scale); - glTranslated(-m_center_x, -m_center_y, 0.0); + glClear(GL_COLOR_BUFFER_BIT); + if (!m_scene) return; - m_scene->render(m_view_points, - m_view_vertices, - m_view_edges, - m_view_ghost_edges, - m_view_edge_cost, - m_view_edge_priority, - m_view_bins, - m_view_foot_points, - m_view_relocation, - m_view_tolerance, - m_view_incolors, - m_view_edge_relevance, - float(m_point_size), - float(m_vertex_size), - float(m_line_thickness)); - - if (m_activate_simulation == 2) - m_scene->render_simulation(m_mouse_pick, - m_simulation_stage, - float(2*m_vertex_size), - float(m_line_thickness)); - - glPopMatrix(); + glPushMatrix(); + glScaled(m_scale, m_scale, m_scale); + glTranslated(-m_center_x, -m_center_y, 0.0); + + m_scene->render(m_view_points, + m_view_vertices, + m_view_edges, + m_view_ghost_edges, + m_view_edge_cost, + m_view_edge_priority, + m_view_bins, + m_view_foot_points, + m_view_relocation, + m_view_tolerance, + m_view_incolors, + m_view_edge_relevance, + float(m_point_size), + float(m_vertex_size), + float(m_line_thickness)); + + if (m_activate_simulation == 2) + m_scene->render_simulation(m_mouse_pick, + m_simulation_stage, + float(2*m_vertex_size), + float(m_line_thickness)); + + glPopMatrix(); } void GlViewer::wheelEvent(QWheelEvent *event) { - if (!m_scene) return; - m_scale += 0.05 * (event->delta() / 120); - if (m_scale <= 0.0) m_scale = 0.0; - updateGL(); + if (!m_scene) return; + m_scale += 0.05 * (event->delta() / 120); + if (m_scale <= 0.0) m_scale = 0.0; + updateGL(); } void GlViewer::mousePressEvent(QMouseEvent *event) { - if (!m_scene) return; - m_mouse_click = event->pos(); - - if (event->button() == Qt::LeftButton) - { - if (m_activate_simulation != 0) m_activate_simulation = 1; - setCursor(QCursor(Qt::PointingHandCursor)); - sample_mouse_path(m_mouse_click); - } - else - { - setCursor(QCursor(Qt::ClosedHandCursor)); - } + if (!m_scene) return; + m_mouse_click = event->pos(); + + if (event->button() == Qt::LeftButton) + { + if (m_activate_simulation != 0) m_activate_simulation = 1; + setCursor(QCursor(Qt::PointingHandCursor)); + sample_mouse_path(m_mouse_click); + } + else + { + setCursor(QCursor(Qt::ClosedHandCursor)); + } } void GlViewer::mouseMoveEvent(QMouseEvent *event) { - if(!m_scene) return; - m_mouse_move = event->pos(); - - if (event->buttons() == Qt::LeftButton) - { - if (m_mouse_move != m_mouse_click) - sample_mouse_path(m_mouse_move); - } - else - { - move_camera(m_mouse_click, m_mouse_move); - } - - m_mouse_click = m_mouse_move; - updateGL(); + if(!m_scene) return; + m_mouse_move = event->pos(); + + if (event->buttons() == Qt::LeftButton) + { + if (m_mouse_move != m_mouse_click) + sample_mouse_path(m_mouse_move); + } + else + { + move_camera(m_mouse_click, m_mouse_move); + } + + m_mouse_click = m_mouse_move; + updateGL(); } void GlViewer::mouseReleaseEvent(QMouseEvent *event) { - if (!m_scene) return; - m_mouse_move = event->pos(); - - if (event->button() == Qt::LeftButton) - { - if (m_mouse_move != m_mouse_click) - sample_mouse_path(m_mouse_move); - } - else - { - move_camera(m_mouse_click, m_mouse_move); - } - - m_mouse_click = m_mouse_move; - setCursor(QCursor(Qt::ArrowCursor)); - updateGL(); + if (!m_scene) return; + m_mouse_move = event->pos(); + + if (event->button() == Qt::LeftButton) + { + if (m_mouse_move != m_mouse_click) + sample_mouse_path(m_mouse_move); + } + else + { + move_camera(m_mouse_click, m_mouse_move); + } + + m_mouse_click = m_mouse_move; + setCursor(QCursor(Qt::ArrowCursor)); + updateGL(); } void GlViewer::sample_mouse_path(const QPoint& point) { - double x, y; - convert_to_world_space(point, x, y); - - if (m_insert_points) - m_scene->add_sample(Point(x, y)); - - if (m_activate_simulation == 1) - { - m_activate_simulation = 2; - m_mouse_pick = Point(x, y); - } + double x, y; + convert_to_world_space(point, x, y); + + if (m_insert_points) + m_scene->add_sample(Point(x, y)); + + if (m_activate_simulation == 1) + { + m_activate_simulation = 2; + m_mouse_pick = Point(x, y); + } } void GlViewer::move_camera(const QPoint& p0, const QPoint& p1) { - m_center_x -= double(p1.x() - p0.x()) / double(width()); - m_center_y += double(p1.y() - p0.y()) / double(height()); + m_center_x -= double(p1.x() - p0.x()) / double(width()); + m_center_y += double(p1.y() - p0.y()) / double(height()); } void GlViewer::convert_to_world_space(const QPoint& point, double &x, double &y) { - double aspect_ratio = double(height()) / double(width()); - - x = double(point.x()) / double(width()); - x = (2.0*x - 1.0) / m_scale; - x += m_center_x; - - y = 1.0 - double(point.y()) / double(height()); - y = (2.0*y - 1.0) * aspect_ratio / m_scale; - y += m_center_y; + double aspect_ratio = double(height()) / double(width()); + + x = double(point.x()) / double(width()); + x = (2.0*x - 1.0) / m_scale; + x += m_center_x; + + y = 1.0 - double(point.y()) / double(height()); + y = (2.0*y - 1.0) * aspect_ratio / m_scale; + y += m_center_y; } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp index 370e19a48eb..4b5f439bf9e 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp @@ -3,10 +3,10 @@ int main(int argv, char **args) { - srand(1); - QApplication app(argv, args); - app.setApplicationName("Reconstruction_simplification_2 Demo"); - MainWindow window; - window.show(); - return app.exec(); + srand(1); + QApplication app(argv, args); + app.setApplicationName("Reconstruction_simplification_2 Demo"); + MainWindow window; + window.show(); + return app.exec(); } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx index ffe0301508d..09e81799f76 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_dialog_options.cxx @@ -1,10 +1,10 @@ /**************************************************************************** -** Meta object code from reading C++ file 'dialog_options.h' -** -** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ + ** Meta object code from reading C++ file 'dialog_options.h' + ** + ** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) + ** + ** WARNING! All changes made in this file will be lost! + *****************************************************************************/ #include "dialog_options.h" #if !defined(Q_MOC_OUTPUT_REVISION) @@ -18,18 +18,18 @@ QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_Dialog_options[] = { - // content: - 6, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount - 0 // eod + 0 // eod }; static const char qt_meta_stringdata_Dialog_options[] = { @@ -38,10 +38,10 @@ static const char qt_meta_stringdata_Dialog_options[] = { void Dialog_options::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { - Q_UNUSED(_o); - Q_UNUSED(_id); - Q_UNUSED(_c); - Q_UNUSED(_a); + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); } const QMetaObjectExtraData Dialog_options::staticMetaObjectExtraData = { @@ -50,7 +50,7 @@ const QMetaObjectExtraData Dialog_options::staticMetaObjectExtraData = { const QMetaObject Dialog_options::staticMetaObject = { { &QDialog::staticMetaObject, qt_meta_stringdata_Dialog_options, - qt_meta_data_Dialog_options, &staticMetaObjectExtraData } + qt_meta_data_Dialog_options, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION @@ -59,22 +59,22 @@ const QMetaObject &Dialog_options::getStaticMetaObject() { return staticMetaObje const QMetaObject *Dialog_options::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *Dialog_options::qt_metacast(const char *_clname) { - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_Dialog_options)) - return static_cast(const_cast< Dialog_options*>(this)); - return QDialog::qt_metacast(_clname); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_Dialog_options)) + return static_cast(const_cast< Dialog_options*>(this)); + return QDialog::qt_metacast(_clname); } int Dialog_options::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { - _id = QDialog::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; + _id = QDialog::qt_metacall(_c, _id, _a); + if (_id < 0) return _id; + return _id; } QT_END_MOC_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx index ba1e5ae5d78..502d4ef32fc 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_glviewer.cxx @@ -1,10 +1,10 @@ /**************************************************************************** -** Meta object code from reading C++ file 'glviewer.h' -** -** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ + ** Meta object code from reading C++ file 'glviewer.h' + ** + ** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) + ** + ** WARNING! All changes made in this file will be lost! + *****************************************************************************/ #include "glviewer.h" #if !defined(Q_MOC_OUTPUT_REVISION) @@ -18,18 +18,18 @@ QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_GlViewer[] = { - // content: - 6, // revision - 0, // classname - 0, 0, // classinfo - 0, 0, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 0, // signalCount + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount - 0 // eod + 0 // eod }; static const char qt_meta_stringdata_GlViewer[] = { @@ -38,10 +38,10 @@ static const char qt_meta_stringdata_GlViewer[] = { void GlViewer::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { - Q_UNUSED(_o); - Q_UNUSED(_id); - Q_UNUSED(_c); - Q_UNUSED(_a); + Q_UNUSED(_o); + Q_UNUSED(_id); + Q_UNUSED(_c); + Q_UNUSED(_a); } const QMetaObjectExtraData GlViewer::staticMetaObjectExtraData = { @@ -50,7 +50,7 @@ const QMetaObjectExtraData GlViewer::staticMetaObjectExtraData = { const QMetaObject GlViewer::staticMetaObject = { { &QGLWidget::staticMetaObject, qt_meta_stringdata_GlViewer, - qt_meta_data_GlViewer, &staticMetaObjectExtraData } + qt_meta_data_GlViewer, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION @@ -59,22 +59,22 @@ const QMetaObject &GlViewer::getStaticMetaObject() { return staticMetaObject; } const QMetaObject *GlViewer::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *GlViewer::qt_metacast(const char *_clname) { - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_GlViewer)) - return static_cast(const_cast< GlViewer*>(this)); - return QGLWidget::qt_metacast(_clname); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_GlViewer)) + return static_cast(const_cast< GlViewer*>(this)); + return QGLWidget::qt_metacast(_clname); } int GlViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { - _id = QGLWidget::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; + _id = QGLWidget::qt_metacall(_c, _id, _a); + if (_id < 0) return _id; + return _id; } QT_END_MOC_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx index 61baf5cf9d0..2384c28451d 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/moc_window.cxx @@ -1,10 +1,10 @@ /**************************************************************************** -** Meta object code from reading C++ file 'window.h' -** -** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ + ** Meta object code from reading C++ file 'window.h' + ** + ** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.6) + ** + ** WARNING! All changes made in this file will be lost! + *****************************************************************************/ #include "window.h" #if !defined(Q_MOC_OUTPUT_REVISION) @@ -18,55 +18,55 @@ QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_MainWindow[] = { - // content: - 6, // revision - 0, // classname - 0, 0, // classinfo - 64, 14, // methods - 0, 0, // properties - 0, 0, // enums/sets - 0, 0, // constructors - 0, // flags - 1, // signalCount + // content: + 6, // revision + 0, // classname + 0, 0, // classinfo + 64, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 1, // signalCount - // signals: signature, parameters, type, tag, flags - 21, 12, 11, 11, 0x05, + // signals: signature, parameters, type, tag, flags + 21, 12, 11, 11, 0x05, - // slots: signature, parameters, type, tag, flags - 51, 45, 11, 11, 0x09, - 74, 45, 11, 11, 0x09, - 99, 45, 11, 11, 0x09, - 132, 11, 11, 11, 0x09, - 153, 11, 11, 11, 0x09, - 188, 179, 11, 11, 0x09, - 232, 214, 11, 11, 0x09, - 269, 264, 11, 11, 0x29, - 297, 11, 292, 11, 0x09, - 327, 322, 11, 11, 0x09, - 341, 322, 11, 11, 0x09, - 355, 11, 11, 11, 0x0a, - 364, 11, 11, 11, 0x0a, - 394, 11, 11, 11, 0x0a, - 421, 11, 11, 11, 0x0a, - 453, 11, 11, 11, 0x0a, - 479, 11, 11, 11, 0x0a, - 510, 11, 11, 11, 0x0a, - 540, 11, 11, 11, 0x0a, - 573, 11, 11, 11, 0x0a, - 605, 11, 11, 11, 0x0a, - 636, 11, 11, 11, 0x0a, - 666, 11, 11, 11, 0x0a, - 711, 11, 11, 11, 0x0a, - 737, 11, 11, 11, 0x0a, - 762, 11, 11, 11, 0x0a, - 788, 11, 11, 11, 0x0a, - 815, 11, 11, 11, 0x0a, - 842, 11, 11, 11, 0x0a, - 869, 11, 11, 11, 0x0a, - 897, 11, 11, 11, 0x0a, - 925, 11, 11, 11, 0x0a, - 954, 11, 11, 11, 0x0a, - 987, 11, 11, 11, 0x0a, + // slots: signature, parameters, type, tag, flags + 51, 45, 11, 11, 0x09, + 74, 45, 11, 11, 0x09, + 99, 45, 11, 11, 0x09, + 132, 11, 11, 11, 0x09, + 153, 11, 11, 11, 0x09, + 188, 179, 11, 11, 0x09, + 232, 214, 11, 11, 0x09, + 269, 264, 11, 11, 0x29, + 297, 11, 292, 11, 0x09, + 327, 322, 11, 11, 0x09, + 341, 322, 11, 11, 0x09, + 355, 11, 11, 11, 0x0a, + 364, 11, 11, 11, 0x0a, + 394, 11, 11, 11, 0x0a, + 421, 11, 11, 11, 0x0a, + 453, 11, 11, 11, 0x0a, + 479, 11, 11, 11, 0x0a, + 510, 11, 11, 11, 0x0a, + 540, 11, 11, 11, 0x0a, + 573, 11, 11, 11, 0x0a, + 605, 11, 11, 11, 0x0a, + 636, 11, 11, 11, 0x0a, + 666, 11, 11, 11, 0x0a, + 711, 11, 11, 11, 0x0a, + 737, 11, 11, 11, 0x0a, + 762, 11, 11, 11, 0x0a, + 788, 11, 11, 11, 0x0a, + 815, 11, 11, 11, 0x0a, + 842, 11, 11, 11, 0x0a, + 869, 11, 11, 11, 0x0a, + 897, 11, 11, 11, 0x0a, + 925, 11, 11, 11, 0x0a, + 954, 11, 11, 11, 0x0a, + 987, 11, 11, 11, 0x0a, 1021, 11, 11, 11, 0x0a, 1057, 11, 11, 11, 0x0a, 1098, 11, 11, 11, 0x0a, @@ -97,7 +97,7 @@ static const uint qt_meta_data_MainWindow[] = { 2039, 11, 11, 11, 0x0a, 2078, 11, 11, 11, 0x0a, - 0 // eod + 0 // eod }; static const char qt_meta_stringdata_MainWindow[] = { @@ -166,78 +166,78 @@ static const char qt_meta_stringdata_MainWindow[] = { void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { - if (_c == QMetaObject::InvokeMetaMethod) { - Q_ASSERT(staticMetaObject.cast(_o)); - MainWindow *_t = static_cast(_o); - switch (_id) { - case 0: _t->openRecentFile((*reinterpret_cast< QString(*)>(_a[1]))); break; - case 1: _t->dropEvent((*reinterpret_cast< QDropEvent*(*)>(_a[1]))); break; - case 2: _t->closeEvent((*reinterpret_cast< QCloseEvent*(*)>(_a[1]))); break; - case 3: _t->dragEnterEvent((*reinterpret_cast< QDragEnterEvent*(*)>(_a[1]))); break; - case 4: _t->openRecentFile_aux(); break; - case 5: _t->updateRecentFileActions(); break; - case 6: _t->addToRecentFiles((*reinterpret_cast< QString(*)>(_a[1]))); break; - case 7: _t->addRecentFiles((*reinterpret_cast< QMenu*(*)>(_a[1])),(*reinterpret_cast< QAction*(*)>(_a[2]))); break; - case 8: _t->addRecentFiles((*reinterpret_cast< QMenu*(*)>(_a[1]))); break; - case 9: { uint _r = _t->maxNumberOfRecentFiles(); - if (_a[0]) *reinterpret_cast< uint*>(_a[0]) = _r; } break; - case 10: _t->open((*reinterpret_cast< const QString(*)>(_a[1]))); break; - case 11: _t->save((*reinterpret_cast< const QString(*)>(_a[1]))); break; - case 12: _t->update(); break; - case 13: _t->on_actionRecenter_triggered(); break; - case 14: _t->on_actionClear_triggered(); break; - case 15: _t->on_actionLoadPoints_triggered(); break; - case 16: _t->on_actionSave_triggered(); break; - case 17: _t->on_actionInsertPoint_toggled(); break; - case 18: _t->on_actionSnapshot_triggered(); break; - case 19: _t->on_actionInvert_mass_triggered(); break; - case 20: _t->on_actionClamp_mass_triggered(); break; - case 21: _t->on_actionSubdivide_triggered(); break; - case 22: _t->on_actionDecimate_triggered(); break; - case 23: _t->on_actionKeep_one_point_out_of_n_triggered(); break; - case 24: _t->on_actionStar_triggered(); break; - case 25: _t->on_actionBox_triggered(); break; - case 26: _t->on_actionLine_triggered(); break; - case 27: _t->on_actionStair_triggered(); break; - case 28: _t->on_actionBoxes_triggered(); break; - case 29: _t->on_actionNoise_triggered(); break; - case 30: _t->on_actionSpiral_triggered(); break; - case 31: _t->on_actionCircle_triggered(); break; - case 32: _t->on_actionSkyline_triggered(); break; - case 33: _t->on_actionHalf_circle_triggered(); break; - case 34: _t->on_actionAdd_outliers_triggered(); break; - case 35: _t->on_actionParallel_lines_triggered(); break; - case 36: _t->on_actionBox_with_boundaries_triggered(); break; - case 37: _t->on_actionBox_with_missing_corners_triggered(); break; - case 38: _t->on_actionIncreasingly_sharp_angles_triggered(); break; - case 39: _t->on_actionWidely_variable_sampling_triggered(); break; - case 40: _t->on_actionSet_MChoice_toggled(); break; - case 41: _t->on_actionSet_parameters_triggered(); break; - case 42: _t->on_actionReconstruction_init_triggered(); break; - case 43: _t->on_actionReconstruction_one_step_triggered(); break; - case 44: _t->on_actionReconstruction_10_steps_triggered(); break; - case 45: _t->on_actionReconstruction_100_steps_triggered(); break; - case 46: _t->on_actionReconstruction_1000_steps_triggered(); break; - case 47: _t->on_actionReconstruction_until_triggered(); break; - case 48: _t->on_actionRelocate_vertices_triggered(); break; - case 49: _t->on_actionPrint_Stats_triggered(); break; - case 50: _t->on_actionView_points_toggled(); break; - case 51: _t->on_actionView_vertices_toggled(); break; - case 52: _t->on_actionView_edges_toggled(); break; - case 53: _t->on_actionView_ghost_toggled(); break; - case 54: _t->on_actionView_edge_cost_toggled(); break; - case 55: _t->on_actionView_edge_priority_toggled(); break; - case 56: _t->on_actionView_incolors_toggled(); break; - case 57: _t->on_actionView_relevance_toggled(); break; - case 58: _t->on_actionView_bins_toggled(); break; - case 59: _t->on_actionView_foot_points_toggled(); break; - case 60: _t->on_actionView_relocation_toggled(); break; - case 61: _t->on_actionView_tolerance_toggled(); break; - case 62: _t->on_actionActivate_simulation_toggled(); break; - case 63: _t->on_actionView_simulation_triggered(); break; - default: ; - } + if (_c == QMetaObject::InvokeMetaMethod) { + Q_ASSERT(staticMetaObject.cast(_o)); + MainWindow *_t = static_cast(_o); + switch (_id) { + case 0: _t->openRecentFile((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 1: _t->dropEvent((*reinterpret_cast< QDropEvent*(*)>(_a[1]))); break; + case 2: _t->closeEvent((*reinterpret_cast< QCloseEvent*(*)>(_a[1]))); break; + case 3: _t->dragEnterEvent((*reinterpret_cast< QDragEnterEvent*(*)>(_a[1]))); break; + case 4: _t->openRecentFile_aux(); break; + case 5: _t->updateRecentFileActions(); break; + case 6: _t->addToRecentFiles((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 7: _t->addRecentFiles((*reinterpret_cast< QMenu*(*)>(_a[1])),(*reinterpret_cast< QAction*(*)>(_a[2]))); break; + case 8: _t->addRecentFiles((*reinterpret_cast< QMenu*(*)>(_a[1]))); break; + case 9: { uint _r = _t->maxNumberOfRecentFiles(); + if (_a[0]) *reinterpret_cast< uint*>(_a[0]) = _r; } break; + case 10: _t->open((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 11: _t->save((*reinterpret_cast< const QString(*)>(_a[1]))); break; + case 12: _t->update(); break; + case 13: _t->on_actionRecenter_triggered(); break; + case 14: _t->on_actionClear_triggered(); break; + case 15: _t->on_actionLoadPoints_triggered(); break; + case 16: _t->on_actionSave_triggered(); break; + case 17: _t->on_actionInsertPoint_toggled(); break; + case 18: _t->on_actionSnapshot_triggered(); break; + case 19: _t->on_actionInvert_mass_triggered(); break; + case 20: _t->on_actionClamp_mass_triggered(); break; + case 21: _t->on_actionSubdivide_triggered(); break; + case 22: _t->on_actionDecimate_triggered(); break; + case 23: _t->on_actionKeep_one_point_out_of_n_triggered(); break; + case 24: _t->on_actionStar_triggered(); break; + case 25: _t->on_actionBox_triggered(); break; + case 26: _t->on_actionLine_triggered(); break; + case 27: _t->on_actionStair_triggered(); break; + case 28: _t->on_actionBoxes_triggered(); break; + case 29: _t->on_actionNoise_triggered(); break; + case 30: _t->on_actionSpiral_triggered(); break; + case 31: _t->on_actionCircle_triggered(); break; + case 32: _t->on_actionSkyline_triggered(); break; + case 33: _t->on_actionHalf_circle_triggered(); break; + case 34: _t->on_actionAdd_outliers_triggered(); break; + case 35: _t->on_actionParallel_lines_triggered(); break; + case 36: _t->on_actionBox_with_boundaries_triggered(); break; + case 37: _t->on_actionBox_with_missing_corners_triggered(); break; + case 38: _t->on_actionIncreasingly_sharp_angles_triggered(); break; + case 39: _t->on_actionWidely_variable_sampling_triggered(); break; + case 40: _t->on_actionSet_MChoice_toggled(); break; + case 41: _t->on_actionSet_parameters_triggered(); break; + case 42: _t->on_actionReconstruction_init_triggered(); break; + case 43: _t->on_actionReconstruction_one_step_triggered(); break; + case 44: _t->on_actionReconstruction_10_steps_triggered(); break; + case 45: _t->on_actionReconstruction_100_steps_triggered(); break; + case 46: _t->on_actionReconstruction_1000_steps_triggered(); break; + case 47: _t->on_actionReconstruction_until_triggered(); break; + case 48: _t->on_actionRelocate_vertices_triggered(); break; + case 49: _t->on_actionPrint_Stats_triggered(); break; + case 50: _t->on_actionView_points_toggled(); break; + case 51: _t->on_actionView_vertices_toggled(); break; + case 52: _t->on_actionView_edges_toggled(); break; + case 53: _t->on_actionView_ghost_toggled(); break; + case 54: _t->on_actionView_edge_cost_toggled(); break; + case 55: _t->on_actionView_edge_priority_toggled(); break; + case 56: _t->on_actionView_incolors_toggled(); break; + case 57: _t->on_actionView_relevance_toggled(); break; + case 58: _t->on_actionView_bins_toggled(); break; + case 59: _t->on_actionView_foot_points_toggled(); break; + case 60: _t->on_actionView_relocation_toggled(); break; + case 61: _t->on_actionView_tolerance_toggled(); break; + case 62: _t->on_actionActivate_simulation_toggled(); break; + case 63: _t->on_actionView_simulation_triggered(); break; + default: ; } + } } const QMetaObjectExtraData MainWindow::staticMetaObjectExtraData = { @@ -246,7 +246,7 @@ const QMetaObjectExtraData MainWindow::staticMetaObjectExtraData = { const QMetaObject MainWindow::staticMetaObject = { { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, - qt_meta_data_MainWindow, &staticMetaObjectExtraData } + qt_meta_data_MainWindow, &staticMetaObjectExtraData } }; #ifdef Q_NO_DATA_RELOCATION @@ -255,36 +255,36 @@ const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; const QMetaObject *MainWindow::metaObject() const { - return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; + return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *MainWindow::qt_metacast(const char *_clname) { - if (!_clname) return 0; - if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) - return static_cast(const_cast< MainWindow*>(this)); - if (!strcmp(_clname, "Ui_MainWindow")) - return static_cast< Ui_MainWindow*>(const_cast< MainWindow*>(this)); - return QMainWindow::qt_metacast(_clname); + if (!_clname) return 0; + if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) + return static_cast(const_cast< MainWindow*>(this)); + if (!strcmp(_clname, "Ui_MainWindow")) + return static_cast< Ui_MainWindow*>(const_cast< MainWindow*>(this)); + return QMainWindow::qt_metacast(_clname); } int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { - _id = QMainWindow::qt_metacall(_c, _id, _a); - if (_id < 0) - return _id; - if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 64) - qt_static_metacall(this, _c, _id, _a); - _id -= 64; - } + _id = QMainWindow::qt_metacall(_c, _id, _a); + if (_id < 0) return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 64) + qt_static_metacall(this, _c, _id, _a); + _id -= 64; + } + return _id; } // SIGNAL 0 void MainWindow::openRecentFile(QString _t1) { - void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; - QMetaObject::activate(this, &staticMetaObject, 0, _a); + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); } QT_END_MOC_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx index 442a4f18233..9816ac3c576 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/qrc_pwsrec.cxx @@ -1,1895 +1,1895 @@ /**************************************************************************** -** Resource object code -** -** Created by: The Resource Compiler for Qt version 4.8.6 -** -** WARNING! All changes made in this file will be lost! -*****************************************************************************/ + ** Resource object code + ** + ** Created by: The Resource Compiler for Qt version 4.8.6 + ** + ** WARNING! All changes made in this file will be lost! + *****************************************************************************/ #include static const unsigned char qt_resource_data[] = { - // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fit-page-32.png - 0x0,0x0,0x5,0x32, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4, - 0x0,0x0,0x4,0xf9,0x49,0x44,0x41,0x54,0x78,0x5e,0xb5,0x57,0x59,0x68,0x5c,0x65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0x66,0xdd,0xd5,0x41,0x60,0xdd,0xb, - 0x86,0x61,0x50,0xaf,0x68,0xe4,0x5c,0x8,0x51,0x28,0x42,0xa6,0xc9,0x21,0xa1,0x31, - 0xa2,0x8e,0x25,0xc2,0x57,0xc3,0x3,0xa5,0x92,0x57,0xb1,0xc,0xd3,0x6f,0xd0,0xfd, - 0x52,0x71,0x93,0x1,0xd,0x62,0x6,0x94,0xd2,0x12,0xe3,0x6a,0xa5,0x38,0x44,0x1c, - 0xf6,0x73,0xe0,0x50,0x4f,0x1b,0x1e,0x13,0x31,0x78,0x3a,0xb5,0x19,0x1,0x60,0x13, - 0x17,0x2d,0x1,0x4e,0x13,0x70,0x8,0x1f,0x9f,0xfd,0x30,0x9,0x12,0x5a,0x37,0xd3, - 0xdc,0x5f,0xee,0x1f,0x53,0x3d,0x3c,0xfa,0x99,0xf2,0x7b,0x79,0x4f,0xf6,0xe1,0x8e, - 0x23,0x30,0x73,0x86,0xf2,0x0,0x6b,0xe4,0x4,0x38,0x2c,0xa4,0x2d,0xc6,0xb6,0xf0, - 0x9a,0xaf,0xb8,0x21,0xd8,0x15,0x5c,0x14,0x5c,0x10,0xfc,0xaf,0xe0,0xbc,0x94,0x92, - 0x79,0xbe,0x68,0x20,0x40,0xe2,0x42,0x53,0x0,0x58,0xba,0xd4,0xd8,0x54,0xe0,0xaa, - 0xc9,0x69,0x8a,0x94,0x84,0x22,0xa5,0x32,0x63,0xf,0x1a,0xfd,0x7,0xfa,0xd6,0x9e, - 0x29,0x1d,0x33,0x88,0x11,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, - 0x82, + // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fit-page-32.png + 0x0,0x0,0x5,0x32, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,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+ 0xc,0x1f,0x68,0xe2,0xbe,0x40,0xf5,0x2,0x89,0x54,0x96,0xef,0x23,0xe6,0xf,0x9a, + 0xba,0x4a,0xf1,0x47,0xe7,0x9e,0xf4,0x27,0xe4,0x66,0xdd,0xd5,0x41,0x60,0xdd,0xb, + 0x86,0x61,0x50,0xaf,0x68,0xe4,0x5c,0x8,0x51,0x28,0x42,0xa6,0xc9,0x21,0xa1,0x31, + 0xa2,0x8e,0x25,0xc2,0x57,0xc3,0x3,0xa5,0x92,0x57,0xb1,0xc,0xd3,0x6f,0xd0,0xfd, + 0x52,0x71,0x93,0x1,0xd,0x62,0x6,0x94,0xd2,0x12,0xe3,0x6a,0xa5,0x38,0x44,0x1c, + 0xf6,0x73,0xe0,0x50,0x4f,0x1b,0x1e,0x13,0x31,0x78,0x3a,0xb5,0x19,0x1,0x60,0x13, + 0x17,0x2d,0x1,0x4e,0x13,0x70,0x8,0x1f,0x9f,0xfd,0x30,0x9,0x12,0x5a,0x37,0xd3, + 0xdc,0x5f,0xee,0x1f,0x53,0x3d,0x3c,0xfa,0x99,0xf2,0x7b,0x79,0x4f,0xf6,0xe1,0x8e, + 0x23,0x30,0x73,0x86,0xf2,0x0,0x6b,0xe4,0x4,0x38,0x2c,0xa4,0x2d,0xc6,0xb6,0xf0, + 0x9a,0xaf,0xb8,0x21,0xd8,0x15,0x5c,0x14,0x5c,0x10,0xfc,0xaf,0xe0,0xbc,0x94,0x92, + 0x79,0xbe,0x68,0x20,0x40,0xe2,0x42,0x53,0x0,0x58,0xba,0xd4,0xd8,0x54,0xe0,0xaa, + 0xc9,0x69,0x8a,0x94,0x84,0x22,0xa5,0x32,0x63,0xf,0x1a,0xfd,0x7,0xfa,0xd6,0x9e, + 0x29,0x1d,0x33,0x88,0x11,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60, + 0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/inputPoint.png - 0x0,0x0,0x4,0x79, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x4b,0x0,0x0,0x0,0x4b,0x8,0x6,0x0,0x0,0x0,0x38,0x4e,0x7a,0xea, - 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x8,0xa7,0x0,0x0,0x8,0xa7, - 0x1,0x32,0xc6,0x2,0x3,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61, - 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x3,0xf6,0x49,0x44, - 0x41,0x54,0x78,0x9c,0xed,0x9a,0xbf,0x8b,0x15,0x49,0x10,0xc7,0x3f,0xbd,0xab,0xbb, - 0xab,0x6f,0x41,0x14,0xf,0x31,0x55,0x8c,0x4,0x4d,0x8c,0x8e,0x5,0xe1,0x60,0x91, - 0x33,0x30,0x3c,0x58,0xfc,0xf,0xfc,0x6b,0xee,0x4f,0x10,0x39,0x30,0x30,0x14,0x39, - 0xd8,0x44,0x3,0x31,0x30,0x38,0x4c,0x4c,0x4,0x8d,0xf,0x15,0xc5,0x60,0x6f,0x75, - 0x7d,0xf3,0xca,0xa0,0xbb,0x6e,0x7a,0xda,0xd9,0xd5,0x42,0xbb,0x7,0xb1,0xbe,0x50, - 0xbc,0x99,0xf7,0xa6,0x7b,0xba,0x3e,0xaf,0xfa,0xc7,0x54,0x4f,0x10,0x11,0x5c,0x5f, - 0xa7,0xa5,0xa9,0x1b,0xf0,0x23,0xc9,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39, - 0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3,0x32,0xc8,0x61,0x19, - 0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87, - 0x65,0x90,0xc3,0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83, - 0x1c,0x96,0x41,0x87,0xa6,0x6e,0x40,0x8,0x61,0x9,0x38,0xb,0x9c,0x7,0x4e,0x2, - 0xc7,0x80,0x75,0x60,0x7,0x78,0x7,0xbc,0x2,0x9e,0x2,0xcf,0x45,0x64,0x31,0x55, - 0x3b,0x1,0xc2,0x54,0xfb,0x86,0x21,0x84,0x35,0x60,0x13,0xd8,0x0,0x8e,0x13,0xff, - 0xb8,0x43,0xc4,0x68,0xf,0xe9,0x32,0x1,0x16,0xc0,0x9c,0x8,0xee,0x3e,0xb0,0x2d, - 0x22,0xef,0x9b,0x37,0x98,0x89,0x60,0x85,0x10,0x7e,0x5,0xae,0x11,0x23,0x69,0x15, - 0x58,0x1,0xe,0x73,0x30,0xac,0x8f,0xc0,0x1e,0xf0,0x1a,0xb8,0x23,0x22,0x8f,0x1a, - 0x37,0xbb,0x2d,0xac,0x10,0xc2,0x32,0xf0,0x7,0x70,0x19,0x38,0xa,0xac,0x25,0xcb, - 0x61,0x2d,0x33,0x84,0xd5,0x31,0x84,0xf5,0x3e,0xd9,0x36,0x70,0x5b,0x44,0xba,0x66, - 0xed,0x6f,0x5,0x2b,0x81,0xba,0x1,0x5c,0x20,0x82,0x3a,0xa,0x1c,0x21,0xc2,0x5a, - 0x25,0x42,0xca,0xa3,0x4a,0xa5,0xd1,0xd5,0x1,0x1f,0x88,0xa0,0x76,0x81,0xff,0x80, - 0x7f,0x80,0x3f,0x5b,0x1,0x6b,0x9,0x6b,0xb,0xf8,0x8d,0x38,0x78,0xcf,0xe8,0x61, - 0xad,0x10,0x21,0x29,0x28,0x35,0x88,0xa0,0xd4,0x16,0xc9,0xf6,0xe8,0x61,0xed,0x0, - 0x7f,0x8b,0xc8,0xad,0x16,0x3e,0x34,0x99,0xd,0xd3,0x18,0xa5,0x5d,0x6f,0x96,0x99, - 0x76,0xbb,0x25,0x86,0xc0,0x72,0xe5,0xa0,0x16,0xe9,0xf7,0xbc,0xab,0x5e,0x9,0x21, - 0xbc,0x10,0x91,0x87,0x95,0xdd,0xa8,0xbf,0xce,0x4a,0xb3,0xde,0x35,0xfa,0xae,0xa7, - 0xc0,0x74,0x8c,0x1a,0xb3,0xc3,0x5f,0xf1,0xfb,0x2c,0xab,0x6f,0x2b,0xdd,0xa7,0xaa, - 0x5a,0x2c,0x4a,0x37,0x89,0xb3,0xde,0x1a,0xb1,0xdb,0x1d,0xa1,0x8f,0x28,0xb5,0x1c, - 0xd0,0x7e,0x36,0x56,0x46,0xeb,0xfb,0x5,0xb8,0x5a,0xdb,0x91,0xaa,0xb0,0xd2,0x82, - 0x73,0x83,0x38,0x80,0xe7,0x33,0x5f,0xe9,0x74,0x19,0x35,0x63,0xc7,0x6a,0x79,0xd9, - 0x95,0xac,0xde,0xcd,0x74,0xbf,0x6a,0xaa,0x1d,0x59,0x67,0x89,0xb,0xce,0x95,0x64, - 0xab,0xc,0xc7,0xa7,0x83,0x80,0x1d,0x4,0x2a,0xaf,0x43,0xd7,0x69,0x27,0x80,0x73, - 0x35,0x9d,0xa9,0xd,0xeb,0x3c,0x43,0xe7,0x4b,0x47,0x97,0xf9,0x72,0x77,0x2c,0xa3, - 0x69,0xac,0xe,0xbd,0xf6,0x62,0x4d,0x67,0x6a,0xcf,0x86,0x27,0x19,0x46,0x86,0xce, - 0x76,0x4b,0x23,0xa6,0xb0,0x14,0x6,0xf4,0xb3,0x1f,0xc4,0x59,0xb1,0x2c,0xa3,0x75, - 0x69,0xfd,0xa7,0x6b,0x3a,0x53,0x1b,0xd6,0x31,0x86,0x30,0xc2,0x88,0x8d,0x75,0xc9, - 0x1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ed,0x48,0x75,0x58,0x69, - 0x73,0xe1,0xe,0x7d,0x86,0x73,0x97,0xcf,0x9d,0xce,0xa3,0x69,0x3f,0x1b,0x2b,0xa3, - 0xf5,0xfd,0x25,0x22,0xbb,0xb5,0x7d,0x69,0x92,0xfc,0x13,0x91,0x47,0x21,0x84,0x33, - 0xc0,0xef,0xf4,0x2b,0xf9,0x19,0xfd,0x6c,0x66,0x49,0xfe,0x29,0xa8,0x1d,0x62,0xb6, - 0xf4,0x9e,0x88,0x3c,0xa8,0xef,0x45,0xdb,0x7d,0xc3,0xdb,0xc0,0x29,0xe0,0x52,0x3a, - 0x17,0xbe,0x3d,0xad,0xfc,0x18,0xb8,0xd9,0xa4,0xf5,0x4c,0xb3,0xbb,0x73,0x1d,0xb8, - 0xc2,0xb7,0x6f,0x58,0xdc,0x3,0x6e,0x8a,0xc8,0x9c,0x46,0x9a,0x6a,0xdf,0x70,0x3, - 0xd8,0x22,0x66,0x38,0xad,0x5b,0x61,0x2f,0x89,0x63,0xd4,0x83,0xb6,0xad,0x9e,0x7e, - 0x47,0xfa,0x2a,0x31,0xed,0x7c,0x82,0x2f,0x6f,0xb2,0xbe,0x21,0xce,0xac,0x77,0x5b, - 0xc,0xe6,0x63,0x9a,0xc,0xd6,0xff,0xd,0x88,0xa9,0xe0,0x73,0xc4,0xc4,0xdd,0x69, - 0x62,0x9a,0x45,0xdf,0x75,0x78,0x4b,0x7c,0x84,0x79,0x2,0x3c,0xfb,0x69,0xdf,0x75, - 0xf8,0x11,0xe5,0xaf,0x1c,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c, - 0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3,0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc, - 0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3, - 0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41, - 0xe,0xcb,0xa0,0x4f,0xa2,0xac,0x82,0xb6,0x88,0x8c,0x1,0x8,0x0,0x0,0x0,0x0, - 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + 0x0,0x0,0x4,0x79, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x4b,0x0,0x0,0x0,0x4b,0x8,0x6,0x0,0x0,0x0,0x38,0x4e,0x7a,0xea, + 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x8,0xa7,0x0,0x0,0x8,0xa7, + 0x1,0x32,0xc6,0x2,0x3,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, + 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61, + 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x3,0xf6,0x49,0x44, + 0x41,0x54,0x78,0x9c,0xed,0x9a,0xbf,0x8b,0x15,0x49,0x10,0xc7,0x3f,0xbd,0xab,0xbb, + 0xab,0x6f,0x41,0x14,0xf,0x31,0x55,0x8c,0x4,0x4d,0x8c,0x8e,0x5,0xe1,0x60,0x91, + 0x33,0x30,0x3c,0x58,0xfc,0xf,0xfc,0x6b,0xee,0x4f,0x10,0x39,0x30,0x30,0x14,0x39, + 0xd8,0x44,0x3,0x31,0x30,0x38,0x4c,0x4c,0x4,0x8d,0xf,0x15,0xc5,0x60,0x6f,0x75, + 0x7d,0xf3,0xca,0xa0,0xbb,0x6e,0x7a,0xda,0xd9,0xd5,0x42,0xbb,0x7,0xb1,0xbe,0x50, + 0xbc,0x99,0xf7,0xa6,0x7b,0xba,0x3e,0xaf,0xfa,0xc7,0x54,0x4f,0x10,0x11,0x5c,0x5f, + 0xa7,0xa5,0xa9,0x1b,0xf0,0x23,0xc9,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39, + 0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3,0x32,0xc8,0x61,0x19, + 0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87, + 0x65,0x90,0xc3,0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83, + 0x1c,0x96,0x41,0x87,0xa6,0x6e,0x40,0x8,0x61,0x9,0x38,0xb,0x9c,0x7,0x4e,0x2, + 0xc7,0x80,0x75,0x60,0x7,0x78,0x7,0xbc,0x2,0x9e,0x2,0xcf,0x45,0x64,0x31,0x55, + 0x3b,0x1,0xc2,0x54,0xfb,0x86,0x21,0x84,0x35,0x60,0x13,0xd8,0x0,0x8e,0x13,0xff, + 0xb8,0x43,0xc4,0x68,0xf,0xe9,0x32,0x1,0x16,0xc0,0x9c,0x8,0xee,0x3e,0xb0,0x2d, + 0x22,0xef,0x9b,0x37,0x98,0x89,0x60,0x85,0x10,0x7e,0x5,0xae,0x11,0x23,0x69,0x15, + 0x58,0x1,0xe,0x73,0x30,0xac,0x8f,0xc0,0x1e,0xf0,0x1a,0xb8,0x23,0x22,0x8f,0x1a, + 0x37,0xbb,0x2d,0xac,0x10,0xc2,0x32,0xf0,0x7,0x70,0x19,0x38,0xa,0xac,0x25,0xcb, + 0x61,0x2d,0x33,0x84,0xd5,0x31,0x84,0xf5,0x3e,0xd9,0x36,0x70,0x5b,0x44,0xba,0x66, + 0xed,0x6f,0x5,0x2b,0x81,0xba,0x1,0x5c,0x20,0x82,0x3a,0xa,0x1c,0x21,0xc2,0x5a, + 0x25,0x42,0xca,0xa3,0x4a,0xa5,0xd1,0xd5,0x1,0x1f,0x88,0xa0,0x76,0x81,0xff,0x80, + 0x7f,0x80,0x3f,0x5b,0x1,0x6b,0x9,0x6b,0xb,0xf8,0x8d,0x38,0x78,0xcf,0xe8,0x61, + 0xad,0x10,0x21,0x29,0x28,0x35,0x88,0xa0,0xd4,0x16,0xc9,0xf6,0xe8,0x61,0xed,0x0, + 0x7f,0x8b,0xc8,0xad,0x16,0x3e,0x34,0x99,0xd,0xd3,0x18,0xa5,0x5d,0x6f,0x96,0x99, + 0x76,0xbb,0x25,0x86,0xc0,0x72,0xe5,0xa0,0x16,0xe9,0xf7,0xbc,0xab,0x5e,0x9,0x21, + 0xbc,0x10,0x91,0x87,0x95,0xdd,0xa8,0xbf,0xce,0x4a,0xb3,0xde,0x35,0xfa,0xae,0xa7, + 0xc0,0x74,0x8c,0x1a,0xb3,0xc3,0x5f,0xf1,0xfb,0x2c,0xab,0x6f,0x2b,0xdd,0xa7,0xaa, + 0x5a,0x2c,0x4a,0x37,0x89,0xb3,0xde,0x1a,0xb1,0xdb,0x1d,0xa1,0x8f,0x28,0xb5,0x1c, + 0xd0,0x7e,0x36,0x56,0x46,0xeb,0xfb,0x5,0xb8,0x5a,0xdb,0x91,0xaa,0xb0,0xd2,0x82, + 0x73,0x83,0x38,0x80,0xe7,0x33,0x5f,0xe9,0x74,0x19,0x35,0x63,0xc7,0x6a,0x79,0xd9, + 0x95,0xac,0xde,0xcd,0x74,0xbf,0x6a,0xaa,0x1d,0x59,0x67,0x89,0xb,0xce,0x95,0x64, + 0xab,0xc,0xc7,0xa7,0x83,0x80,0x1d,0x4,0x2a,0xaf,0x43,0xd7,0x69,0x27,0x80,0x73, + 0x35,0x9d,0xa9,0xd,0xeb,0x3c,0x43,0xe7,0x4b,0x47,0x97,0xf9,0x72,0x77,0x2c,0xa3, + 0x69,0xac,0xe,0xbd,0xf6,0x62,0x4d,0x67,0x6a,0xcf,0x86,0x27,0x19,0x46,0x86,0xce, + 0x76,0x4b,0x23,0xa6,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,0xda,0x39, + 0xfa,0x16,0xf,0xd2,0xdb,0xc4,0x54,0xb0,0x66,0x38,0xf7,0x18,0x46,0xc9,0x18,0xa8, + 0xb1,0xe3,0x12,0x58,0x47,0x9f,0x39,0x7d,0x9,0xdc,0xad,0xed,0x48,0x75,0x58,0x69, + 0x73,0xe1,0xe,0x7d,0x86,0x73,0x97,0xcf,0x9d,0xce,0xa3,0x69,0x3f,0x1b,0x2b,0xa3, + 0xf5,0xfd,0x25,0x22,0xbb,0xb5,0x7d,0x69,0x92,0xfc,0x13,0x91,0x47,0x21,0x84,0x33, + 0xc0,0xef,0xf4,0x2b,0xf9,0x19,0xfd,0x6c,0x66,0x49,0xfe,0x29,0xa8,0x1d,0x62,0xb6, + 0xf4,0x9e,0x88,0x3c,0xa8,0xef,0x45,0xdb,0x7d,0xc3,0xdb,0xc0,0x29,0xe0,0x52,0x3a, + 0x17,0xbe,0x3d,0xad,0xfc,0x18,0xb8,0xd9,0xa4,0xf5,0x4c,0xb3,0xbb,0x73,0x1d,0xb8, + 0xc2,0xb7,0x6f,0x58,0xdc,0x3,0x6e,0x8a,0xc8,0x9c,0x46,0x9a,0x6a,0xdf,0x70,0x3, + 0xd8,0x22,0x66,0x38,0xad,0x5b,0x61,0x2f,0x89,0x63,0xd4,0x83,0xb6,0xad,0x9e,0x7e, + 0x47,0xfa,0x2a,0x31,0xed,0x7c,0x82,0x2f,0x6f,0xb2,0xbe,0x21,0xce,0xac,0x77,0x5b, + 0xc,0xe6,0x63,0x9a,0xc,0xd6,0xff,0xd,0x88,0xa9,0xe0,0x73,0xc4,0xc4,0xdd,0x69, + 0x62,0x9a,0x45,0xdf,0x75,0x78,0x4b,0x7c,0x84,0x79,0x2,0x3c,0xfb,0x69,0xdf,0x75, + 0xf8,0x11,0xe5,0xaf,0x1c,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c, + 0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3,0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc, + 0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41,0xe,0xcb,0x20,0x87,0x65,0x90,0xc3, + 0x32,0xc8,0x61,0x19,0xe4,0xb0,0xc,0x72,0x58,0x6,0x39,0x2c,0x83,0x1c,0x96,0x41, + 0xe,0xcb,0xa0,0x4f,0xa2,0xac,0x82,0xb6,0x88,0x8c,0x1,0x8,0x0,0x0,0x0,0x0, + 0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/vertex.png - 0x0,0x0,0x1,0x68, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x4b,0x0,0x0,0x0,0x4b,0x8,0x6,0x0,0x0,0x0,0x38,0x4e,0x7a,0xea, - 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, - 0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0, - 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x8,0xa7,0x0,0x0,0x8,0xa7,0x1, - 0x32,0xc6,0x2,0x3,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xda,0x9,0x1e, - 0x17,0x1d,0x3,0xbd,0xab,0x5f,0x67,0x0,0x0,0x0,0xe8,0x49,0x44,0x41,0x54,0x78, - 0xda,0xed,0xdb,0xc1,0xd,0x83,0x30,0xc,0x5,0xd0,0x3a,0xea,0xbe,0xcc,0xd2,0x89, - 0xc3,0xa5,0x3,0x80,0x4a,0x6c,0xa7,0x7a,0xff,0x8e,0x42,0x5e,0x1c,0x22,0x61,0x88, - 0x39,0xe7,0x4b,0xae,0x65,0x20,0x80,0x5,0xb,0x16,0x2c,0x58,0xb0,0x10,0xc0,0x82, - 0x5,0xb,0x16,0x2c,0x58,0x8,0x60,0xc1,0x82,0x5,0xb,0x16,0x2c,0x4,0xb0,0x60, - 0xc1,0xda,0x28,0xef,0xea,0x1b,0xf8,0x44,0x5c,0xee,0xc5,0x1d,0x73,0x46,0xe5,0xbd, - 0x46,0x55,0xdf,0xf0,0xe,0x52,0x17,0xb4,0xb1,0x1b,0xd4,0x13,0xd7,0x6f,0x51,0x59, - 0x2b,0x26,0x99,0x59,0x65,0x63,0x67,0xa8,0xec,0x2a,0x73,0x1a,0x76,0xc3,0x5a,0xbd, - 0xfa,0x59,0xd5,0x35,0x76,0x87,0xca,0x1c,0xc7,0x36,0xec,0x82,0x95,0x7d,0xc4,0xaf, - 0x1e,0x4f,0x65,0xc1,0x82,0x5,0xb,0x16,0x2c,0x81,0x5,0xb,0x16,0x2c,0x58,0xdf, - 0x64,0xbf,0xfe,0x5d,0x3d,0x9e,0xca,0xea,0x84,0x95,0x55,0x5d,0x19,0xe3,0x8c,0x7f, - 0x98,0x48,0xd6,0x82,0xd8,0x86,0x1d,0xb1,0x56,0xad,0x7e,0xe6,0x21,0x52,0xd2,0x64, - 0x7d,0xe2,0x25,0x5d,0x45,0xa3,0xb5,0x64,0x1b,0xfe,0x3a,0xd1,0xaa,0x8e,0x74,0x54, - 0xff,0xf6,0xeb,0x5b,0x7,0xf,0x78,0x81,0x5,0xb,0x16,0x2c,0x58,0xb0,0x4,0x16, - 0x2c,0x58,0xb0,0x60,0xc1,0x12,0x58,0xb0,0x60,0xc1,0x82,0x5,0x4b,0x60,0xc1,0x82, - 0x55,0x9e,0x13,0xb9,0xae,0x4e,0x81,0x12,0x3e,0x89,0x36,0x0,0x0,0x0,0x0,0x49, - 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + 0x0,0x0,0x1,0x68, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x4b,0x0,0x0,0x0,0x4b,0x8,0x6,0x0,0x0,0x0,0x38,0x4e,0x7a,0xea, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x6,0x62,0x4b,0x47,0x44,0x0,0xff,0x0,0xff,0x0,0xff,0xa0,0xbd,0xa7,0x93,0x0, + 0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0x8,0xa7,0x0,0x0,0x8,0xa7,0x1, + 0x32,0xc6,0x2,0x3,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xda,0x9,0x1e, + 0x17,0x1d,0x3,0xbd,0xab,0x5f,0x67,0x0,0x0,0x0,0xe8,0x49,0x44,0x41,0x54,0x78, + 0xda,0xed,0xdb,0xc1,0xd,0x83,0x30,0xc,0x5,0xd0,0x3a,0xea,0xbe,0xcc,0xd2,0x89, + 0xc3,0xa5,0x3,0x80,0x4a,0x6c,0xa7,0x7a,0xff,0x8e,0x42,0x5e,0x1c,0x22,0x61,0x88, + 0x39,0xe7,0x4b,0xae,0x65,0x20,0x80,0x5,0xb,0x16,0x2c,0x58,0xb0,0x10,0xc0,0x82, + 0x5,0xb,0x16,0x2c,0x58,0x8,0x60,0xc1,0x82,0x5,0xb,0x16,0x2c,0x4,0xb0,0x60, + 0xc1,0xda,0x28,0xef,0xea,0x1b,0xf8,0x44,0x5c,0xee,0xc5,0x1d,0x73,0x46,0xe5,0xbd, + 0x46,0x55,0xdf,0xf0,0xe,0x52,0x17,0xb4,0xb1,0x1b,0xd4,0x13,0xd7,0x6f,0x51,0x59, + 0x2b,0x26,0x99,0x59,0x65,0x63,0x67,0xa8,0xec,0x2a,0x73,0x1a,0x76,0xc3,0x5a,0xbd, + 0xfa,0x59,0xd5,0x35,0x76,0x87,0xca,0x1c,0xc7,0x36,0xec,0x82,0x95,0x7d,0xc4,0xaf, + 0x1e,0x4f,0x65,0xc1,0x82,0x5,0xb,0x16,0x2c,0x81,0x5,0xb,0x16,0x2c,0x58,0xdf, + 0x64,0xbf,0xfe,0x5d,0x3d,0x9e,0xca,0xea,0x84,0x95,0x55,0x5d,0x19,0xe3,0x8c,0x7f, + 0x98,0x48,0xd6,0x82,0xd8,0x86,0x1d,0xb1,0x56,0xad,0x7e,0xe6,0x21,0x52,0xd2,0x64, + 0x7d,0xe2,0x25,0x5d,0x45,0xa3,0xb5,0x64,0x1b,0xfe,0x3a,0xd1,0xaa,0x8e,0x74,0x54, + 0xff,0xf6,0xeb,0x5b,0x7,0xf,0x78,0x81,0x5,0xb,0x16,0x2c,0x58,0xb0,0x4,0x16, + 0x2c,0x58,0xb0,0x60,0xc1,0x12,0x58,0xb0,0x60,0xc1,0x82,0x5,0x4b,0x60,0xc1,0x82, + 0x55,0x9e,0x13,0xb9,0xae,0x4e,0x81,0x12,0x3e,0x89,0x36,0x0,0x0,0x0,0x0,0x49, + 0x45,0x4e,0x44,0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/until.png - 0x0,0x0,0x5,0x64, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x2,0x0,0x0,0x0,0xfc,0x18,0xed,0xa3, - 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, - 0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x0, - 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc3,0x0,0x0,0xe,0xc3,0x1,0xc7,0x6f, - 0xa8,0x64,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61, - 0x72,0x65,0x0,0x50,0x61,0x69,0x6e,0x74,0x2e,0x4e,0x45,0x54,0x20,0x76,0x33,0x2e, - 0x35,0x2e,0x35,0x49,0x8a,0xfc,0xe0,0x0,0x0,0x4,0xd4,0x49,0x44,0x41,0x54,0x48, - 0x4b,0xb5,0x56,0xf9,0x4f,0xd3,0x67,0x1c,0xf6,0x2f,0xd9,0xdc,0x70,0x26,0xfe,0xb2, - 0x1f,0x96,0xec,0x87,0x4d,0x1d,0x23,0x9a,0x98,0xcd,0xc5,0xc4,0xb8,0x30,0x27,0x4e, - 0x11,0x75,0xa,0xc,0xc2,0xad,0x9c,0x4e,0x41,0x1c,0xe3,0x56,0x90,0x3a,0xa7,0x40, - 0xb9,0xa1,0x2d,0x14,0x68,0xa1,0x65,0x40,0x61,0x83,0x52,0xa0,0x7,0x57,0xa1,0x7, - 0x2d,0xbd,0xf,0x68,0x29,0xe5,0xee,0xc1,0xf6,0x60,0x43,0x47,0xe6,0x97,0x96,0x2e, - 0x5b,0xf3,0xe6,0x4d,0xd3,0xbe,0xef,0xe7,0xf9,0x9c,0xcf,0xf3,0x1e,0xf9,0xf3,0x7f, - 0xfe,0x1c,0xf1,0x61,0xdf,0xe1,0x70,0x19,0xcd,0xf6,0x39,0xb9,0x99,0x3f,0xad,0x1b, - 0xe6,0xab,0x87,0xf9,0x2a,0xec,0xfc,0x29,0x9d,0x58,0x66,0xd2,0x19,0x57,0xb6,0xb6, - 0x9d,0x87,0xf1,0x8d,0x18,0xc0,0x6c,0x59,0xab,0xa7,0x4f,0x24,0x66,0x33,0xc3,0x13, - 0x29,0x11,0x49,0xd4,0x3b,0x69,0x6d,0x91,0x19,0xf4,0xa8,0xc,0x7a,0x64,0x46,0x7b, - 0x64,0x1a,0x3d,0x22,0x99,0x76,0x2d,0x81,0x12,0xf7,0x90,0x51,0x4d,0x15,0x18,0x17, - 0x57,0x7d,0xc3,0x10,0x0,0x88,0xc4,0x86,0xcb,0x31,0x8d,0xf1,0x8f,0x18,0x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,0xed,0x13,0xdf,0x44,0x37,0x82,0xa3,0xfe,0x3d,0x17,0xed,0x35,0xc9, - 0xce,0xe4,0xac,0xe1,0x6e,0x1a,0x9d,0xc2,0x9c,0xee,0xe2,0x48,0xe1,0x3b,0xa3,0x4f, - 0xf2,0xdb,0x1f,0x72,0x24,0x6d,0x60,0x44,0xe9,0x3b,0x33,0x5e,0x6c,0x5f,0x11,0x78, - 0x3a,0x95,0x27,0xd4,0x20,0x57,0xd3,0x73,0xc6,0x97,0xd,0xa3,0x32,0xe5,0xd2,0x95, - 0xd8,0xa6,0x36,0xb6,0x18,0x7d,0x75,0x18,0xf7,0xfd,0xa4,0xc8,0x63,0x42,0x63,0x58, - 0x1,0x73,0x88,0xa5,0xa6,0x29,0x89,0x71,0x41,0x63,0xbd,0x70,0xb3,0x86,0x27,0xd2, - 0x1c,0xd2,0x7d,0xff,0x0,0xe0,0x6d,0x30,0x52,0x1e,0x69,0xc0,0xe1,0x74,0xaf,0xae, - 0x6d,0x39,0x9d,0xae,0x5f,0x1b,0xc6,0x40,0xd4,0x4a,0x8d,0xf5,0x3f,0x88,0x0,0x94, - 0x90,0x5b,0xc6,0x1,0xed,0xa0,0xda,0x5e,0x73,0xa0,0x8d,0x9c,0xa7,0x7d,0x20,0x73, - 0x8c,0xdb,0x61,0x30,0xe,0xac,0x81,0x7d,0x6d,0x2b,0x8f,0x34,0xf8,0x43,0x56,0x87, - 0xc6,0x60,0xfb,0x87,0x21,0x70,0x6a,0x56,0x51,0x6f,0x4a,0x6e,0xf7,0x92,0x75,0xdd, - 0x2f,0x6,0x31,0x80,0x65,0x79,0x23,0xaf,0x62,0x10,0xdd,0xa2,0xd6,0x2d,0x13,0x9a, - 0xc0,0xb4,0x23,0xb2,0x87,0x25,0xbd,0x7e,0x31,0x8,0x0,0x20,0xb6,0x2f,0x1b,0xc6, - 0xc2,0x13,0xa9,0xd3,0x52,0x93,0xd7,0x3a,0x58,0x8,0x33,0xb5,0x5f,0x58,0x14,0x6a, - 0x2b,0x78,0x82,0x54,0x37,0xea,0x5b,0x97,0x8,0x0,0xa6,0x25,0xa6,0x5b,0xf7,0x68, - 0x20,0x83,0xfd,0xad,0x32,0xaf,0xb2,0x90,0xea,0x78,0xf2,0x5,0xcb,0x3e,0xc8,0x5d, - 0x46,0xd9,0xf5,0x43,0xf2,0xb7,0x1f,0x6f,0x87,0x4b,0x0,0x0,0x43,0x4f,0x2b,0x87, - 0xbd,0xde,0xc2,0x41,0x4c,0x2f,0x4,0xee,0xc4,0x99,0x52,0x88,0xcf,0xd8,0x84,0x76, - 0x7d,0xc3,0xe1,0x35,0x54,0x5e,0xcd,0x2d,0xab,0xe6,0x6,0x46,0x76,0x19,0x5,0x3d, - 0xb4,0xee,0x19,0xdc,0x41,0x4,0xa,0x95,0x5,0x74,0x4,0x89,0x7e,0xff,0x74,0x21, - 0x28,0xf,0x7b,0xc8,0xe5,0x57,0xb9,0xe5,0x1c,0xf8,0xee,0x89,0x8f,0xd9,0x27,0x49, - 0xfb,0x99,0x1d,0x18,0x40,0x52,0xe,0x13,0x92,0x80,0x1e,0x85,0x20,0x9f,0xb9,0xf2, - 0xfa,0x78,0x48,0xc9,0xb1,0xe0,0xa2,0xf,0x3e,0x2f,0xf6,0x2c,0x50,0x1e,0xf6,0x4f, - 0x2e,0xbe,0xf8,0xa5,0x7e,0x14,0xcf,0x8b,0x1,0x9e,0x12,0x63,0x11,0x98,0x26,0x27, - 0x3c,0x62,0x80,0xf7,0x5f,0x35,0x8d,0x1f,0xf,0x29,0x7e,0xe7,0xd3,0x7c,0x38,0xe, - 0x80,0x63,0xc1,0xc5,0x7b,0xab,0x8,0xbf,0x1c,0x3d,0x59,0x0,0x66,0x2d,0x79,0x3d, - 0xd4,0xcf,0x55,0xc4,0x64,0xb5,0x7,0xaa,0xc9,0x2c,0x58,0x1f,0xe4,0x29,0xf1,0x1e, - 0xf9,0x2a,0x82,0xfc,0xf1,0x85,0x8a,0x13,0x67,0x4b,0x11,0x87,0x67,0xa1,0x12,0x10, - 0x6,0x10,0x5f,0x7c,0x36,0x13,0xc4,0x47,0xa6,0xa,0x92,0x73,0xbb,0x7c,0x30,0x7, - 0x41,0x91,0xfb,0x86,0xe7,0x43,0xa3,0x1b,0xaa,0x29,0x82,0x79,0xb5,0x15,0xcd,0x3, - 0xae,0x1e,0x15,0x69,0x91,0xb4,0x6e,0x8e,0x14,0x91,0xf1,0x84,0xea,0x19,0xa9,0x9, - 0xed,0x4,0xb6,0x0,0x6f,0x7f,0x1d,0x59,0x8f,0xf3,0x81,0xd5,0x0,0xfd,0xce,0x15, - 0xa8,0x31,0x47,0xdf,0xc6,0x34,0xa1,0xd3,0xa1,0x6b,0x10,0xaf,0x5a,0x9a,0xb0,0xb6, - 0x55,0x58,0x43,0x13,0x82,0x53,0x31,0xe1,0x9,0xd9,0xcc,0xb0,0xd8,0x26,0x64,0x7f, - 0x68,0x5c,0x85,0xf1,0x8,0xc,0xc0,0x73,0x1a,0x45,0x96,0x28,0x16,0xe1,0x32,0x4a, - 0x5d,0xd9,0xc2,0x27,0xd5,0xf2,0x9e,0xd7,0xf0,0x2a,0x6a,0x79,0x95,0xcd,0xe3,0x70, - 0xbc,0xab,0x5f,0x82,0x38,0xd6,0x37,0xfc,0xd3,0x91,0x1f,0x3d,0x78,0xd3,0xac,0xbb, - 0xaa,0x80,0xb0,0xf0,0x56,0xc4,0x8e,0xef,0x3e,0x1e,0x8a,0x6f,0x87,0xf2,0x17,0xaa, - 0xa4,0x9c,0x3,0x38,0x69,0x5c,0x58,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, - 0x42,0x60,0x82, + 0x0,0x0,0x5,0x64, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x2,0x0,0x0,0x0,0xfc,0x18,0xed,0xa3, + 0x0,0x0,0x0,0x1,0x73,0x52,0x47,0x42,0x0,0xae,0xce,0x1c,0xe9,0x0,0x0,0x0, + 0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x0, + 0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc3,0x0,0x0,0xe,0xc3,0x1,0xc7,0x6f, + 0xa8,0x64,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61, + 0x72,0x65,0x0,0x50,0x61,0x69,0x6e,0x74,0x2e,0x4e,0x45,0x54,0x20,0x76,0x33,0x2e, + 0x35,0x2e,0x35,0x49,0x8a,0xfc,0xe0,0x0,0x0,0x4,0xd4,0x49,0x44,0x41,0x54,0x48, + 0x4b,0xb5,0x56,0xf9,0x4f,0xd3,0x67,0x1c,0xf6,0x2f,0xd9,0xdc,0x70,0x26,0xfe,0xb2, + 0x1f,0x96,0xec,0x87,0x4d,0x1d,0x23,0x9a,0x98,0xcd,0xc5,0xc4,0xb8,0x30,0x27,0x4e, + 0x11,0x75,0xa,0xc,0xc2,0xad,0x9c,0x4e,0x41,0x1c,0xe3,0x56,0x90,0x3a,0xa7,0x40, + 0xb9,0xa1,0x2d,0x14,0x68,0xa1,0x65,0x40,0x61,0x83,0x52,0xa0,0x7,0x57,0xa1,0x7, + 0x2d,0xbd,0xf,0x68,0x29,0xe5,0xee,0xc1,0xf6,0x60,0x43,0x47,0xe6,0x97,0x96,0x2e, + 0x5b,0xf3,0xe6,0x4d,0xd3,0xbe,0xef,0xe7,0xf9,0x9c,0xcf,0xf3,0x1e,0xf9,0xf3,0x7f, + 0xfe,0x1c,0xf1,0x61,0xdf,0xe1,0x70,0x19,0xcd,0xf6,0x39,0xb9,0x99,0x3f,0xad,0x1b, + 0xe6,0xab,0x87,0xf9,0x2a,0xec,0xfc,0x29,0x9d,0x58,0x66,0xd2,0x19,0x57,0xb6,0xb6, + 0x9d,0x87,0xf1,0x8d,0x18,0xc0,0x6c,0x59,0xab,0xa7,0x4f,0x24,0x66,0x33,0xc3,0x13, + 0x29,0x11,0x49,0xd4,0x3b,0x69,0x6d,0x91,0x19,0xf4,0xa8,0xc,0x7a,0x64,0x46,0x7b, + 0x64,0x1a,0x3d,0x22,0x99,0x76,0x2d,0x81,0x12,0xf7,0x90,0x51,0x4d,0x15,0x18,0x17, + 0x57,0x7d,0xc3,0x10,0x0,0x88,0xc4,0x86,0xcb,0x31,0x8d,0xf1,0x8f,0x18,0xf4,0x1e, + 0xb1,0x52,0x6d,0xb5,0xd9,0x37,0x37,0x36,0x1d,0x9b,0x5b,0x4e,0xcf,0xc2,0xf7,0x95, + 0xd5,0x2d,0x8d,0xde,0xc6,0x1a,0x90,0xde,0xff,0x89,0x15,0x1a,0xd5,0x30,0x21,0x36, + 0xf8,0xc0,0x20,0x0,0x48,0x2f,0x60,0x7f,0x71,0xbd,0x9a,0x3f,0xa9,0xdd,0x76,0xb8, + 0x7c,0xdc,0x74,0xba,0xdc,0xd3,0x12,0xe3,0x97,0xe1,0xe4,0xd4,0x3c,0xd6,0xce,0xce, + 0x81,0x7,0x9,0x0,0x62,0x1f,0x74,0x5e,0x8d,0x6b,0xbe,0x93,0xda,0x96,0x59,0xd8, + 0xd3,0xd4,0x31,0x39,0x2a,0xd2,0xa8,0x74,0xcb,0xb6,0x95,0x4d,0xfb,0xea,0x16,0x76, + 0xad,0xc1,0x26,0x9c,0xd1,0xb7,0xb1,0xc4,0xd9,0xa5,0x7d,0x91,0xe9,0xf4,0x6b,0xf1, + 0x2d,0xc8,0x9b,0xdb,0x7d,0x20,0x2,0x1,0x40,0xf2,0x63,0x26,0xc2,0x5f,0xd0,0x2e, + 0xb7,0x30,0xa6,0xd2,0xf2,0x58,0xb7,0x52,0x68,0x57,0xe3,0x5a,0xb0,0xc2,0xde,0xec, + 0x58,0x37,0x92,0xa8,0x89,0x39,0x4c,0x32,0x55,0x28,0x55,0x2e,0xf5,0x73,0xe7,0x63, + 0x7f,0xec,0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x50,0x70,0xd1, + 0x7b,0xa7,0xa,0xcf,0x7d,0x57,0x35,0x22,0x50,0x37,0x77,0x4e,0x5d,0xba,0x5b,0x3f, + 0x3e,0xa9,0x73,0xb9,0xe,0xec,0x1f,0xf,0x9e,0x2f,0x2e,0xd2,0x1a,0x56,0x6e,0xa6, + 0xd0,0xca,0xc9,0x23,0xb3,0x72,0xf3,0xf9,0x1b,0xe4,0xa3,0xa7,0xa,0xcf,0x86,0x55, + 0xa2,0x30,0x8d,0xed,0x13,0xdf,0x44,0x37,0x82,0xa3,0xfe,0x3d,0x17,0xed,0x35,0xc9, + 0xce,0xe4,0xac,0xe1,0x6e,0x1a,0x9d,0xc2,0x9c,0xee,0xe2,0x48,0xe1,0x3b,0xa3,0x4f, + 0xf2,0xdb,0x1f,0x72,0x24,0x6d,0x60,0x44,0xe9,0x3b,0x33,0x5e,0x6c,0x5f,0x11,0x78, + 0x3a,0x95,0x27,0xd4,0x20,0x57,0xd3,0x73,0xc6,0x97,0xd,0xa3,0x32,0xe5,0xd2,0x95, + 0xd8,0xa6,0x36,0xb6,0x18,0x7d,0x75,0x18,0xf7,0xfd,0xa4,0xc8,0x63,0x42,0x63,0x58, + 0x1,0x73,0x88,0xa5,0xa6,0x29,0x89,0x71,0x41,0x63,0xbd,0x70,0xb3,0x86,0x27,0xd2, + 0x1c,0xd2,0x7d,0xff,0x0,0xe0,0x6d,0x30,0x52,0x1e,0x69,0xc0,0xe1,0x74,0xaf,0xae, + 0x6d,0x39,0x9d,0xae,0x5f,0x1b,0xc6,0x40,0xd4,0x4a,0x8d,0xf5,0x3f,0x88,0x0,0x94, + 0x90,0x5b,0xc6,0x1,0xed,0xa0,0xda,0x5e,0x73,0xa0,0x8d,0x9c,0xa7,0x7d,0x20,0x73, + 0x8c,0xdb,0x61,0x30,0xe,0xac,0x81,0x7d,0x6d,0x2b,0x8f,0x34,0xf8,0x43,0x56,0x87, + 0xc6,0x60,0xfb,0x87,0x21,0x70,0x6a,0x56,0x51,0x6f,0x4a,0x6e,0xf7,0x92,0x75,0xdd, + 0x2f,0x6,0x31,0x80,0x65,0x79,0x23,0xaf,0x62,0x10,0xdd,0xa2,0xd6,0x2d,0x13,0x9a, + 0xc0,0xb4,0x23,0xb2,0x87,0x25,0xbd,0x7e,0x31,0x8,0x0,0x20,0xb6,0x2f,0x1b,0xc6, + 0xc2,0x13,0xa9,0xd3,0x52,0x93,0xd7,0x3a,0x58,0x8,0x33,0xb5,0x5f,0x58,0x14,0x6a, + 0x2b,0x78,0x82,0x54,0x37,0xea,0x5b,0x97,0x8,0x0,0xa6,0x25,0xa6,0x5b,0xf7,0x68, + 0x20,0x83,0xfd,0xad,0x32,0xaf,0xb2,0x90,0xea,0x78,0xf2,0x5,0xcb,0x3e,0xc8,0x5d, + 0x46,0xd9,0xf5,0x43,0xf2,0xb7,0x1f,0x6f,0x87,0x4b,0x0,0x0,0x43,0x4f,0x2b,0x87, + 0xbd,0xde,0xc2,0x41,0x4c,0x2f,0x4,0xee,0xc4,0x99,0x52,0x88,0xcf,0xd8,0x84,0x76, + 0x7d,0xc3,0xe1,0x35,0x54,0x5e,0xcd,0x2d,0xab,0xe6,0x6,0x46,0x76,0x19,0x5,0x3d, + 0xb4,0xee,0x19,0xdc,0x41,0x4,0xa,0x95,0x5,0x74,0x4,0x89,0x7e,0xff,0x74,0x21, + 0x28,0xf,0x7b,0xc8,0xe5,0x57,0xb9,0xe5,0x1c,0xf8,0xee,0x89,0x8f,0xd9,0x27,0x49, + 0xfb,0x99,0x1d,0x18,0x40,0x52,0xe,0x13,0x92,0x80,0x1e,0x85,0x20,0x9f,0xb9,0xf2, + 0xfa,0x78,0x48,0xc9,0xb1,0xe0,0xa2,0xf,0x3e,0x2f,0xf6,0x2c,0x50,0x1e,0xf6,0x4f, + 0x2e,0xbe,0xf8,0xa5,0x7e,0x14,0xcf,0x8b,0x1,0x9e,0x12,0x63,0x11,0x98,0x26,0x27, + 0x3c,0x62,0x80,0xf7,0x5f,0x35,0x8d,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0x38,0x69,0x5c,0x58,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae, + 0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/triangulation.png - 0x0,0x0,0x1d,0x7b, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x8,0x6,0x0,0x0,0x0,0xc3,0x3e,0x61,0xcb, - 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xf,0xa0,0x0,0x0,0xf,0xa0, - 0x1,0xa0,0x6a,0x8c,0x77,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, - 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61, - 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x1c,0xf8,0x49,0x44, - 0x41,0x54,0x78,0x9c,0xed,0x9d,0x77,0xbc,0x1f,0x45,0xb5,0xc0,0xbf,0x73,0x6f,0x2e, - 0x21,0x10,0x12,0x4a,0x82,0x21,0x80,0x84,0x2a,0x10,0x7a,0x51,0x9a,0x2,0x8a,0x2, - 0xa2,0x80,0x20,0x1d,0x24,0x4,0x11,0x14,0x9f,0xa0,0x20,0xf0,0x88,0x28,0x1a,0xb, - 0xf0,0x94,0x27,0xe8,0xc3,0xf2,0x14,0x2,0x88,0x94,0x87,0x52,0x82,0x80,0x6,0x8, - 0x46,0x40,0x10,0x89,0x20,0x48,0x2f,0x41,0x4a,0x12,0x42,0x8,0xa4,0x97,0x9b,0x3b, - 0xef,0x8f,0x33,0xc3,0x9e,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,0xbc,0xa7,0x3e,0x31,0x79,0x1a,0x63,0x76,0x25,0xb2,0xf7,0x2f,0x7, - 0x8e,0xb1,0xd6,0x2e,0x52,0x55,0x46,0x10,0x59,0x3,0x5f,0x4d,0xb6,0xb7,0xd6,0x3e, - 0xe,0x5c,0xea,0xfe,0xe,0x2,0xc6,0xb7,0x88,0xd4,0x64,0xbf,0xaf,0x5b,0x6b,0xaf, - 0x0,0x7e,0x83,0x30,0x60,0x1a,0x74,0x91,0x42,0x73,0x8d,0x3e,0x97,0x23,0xd3,0x91, - 0x87,0xaf,0x34,0x85,0xdb,0x77,0xd0,0xee,0x2f,0x7f,0x65,0xe2,0x5a,0xb1,0x6f,0xa5, - 0xd4,0xf9,0x80,0xba,0x7e,0x59,0x6,0x9e,0xb5,0x80,0xf9,0x44,0x2,0xd8,0x56,0x6d, - 0xbc,0x87,0x2d,0x89,0x46,0xa8,0xb4,0xe3,0x95,0x26,0xe9,0x41,0xec,0x6,0x5e,0x38, - 0x5d,0xa,0x8c,0xfc,0x57,0x1e,0x1,0x7e,0x0,0x6c,0xe8,0xce,0xa7,0x92,0xfe,0xf5, - 0xae,0xad,0xce,0x53,0xbf,0x26,0x6b,0xed,0x74,0x87,0xb,0x64,0x29,0x79,0x7e,0x53, - 0x4,0x6,0x80,0x1e,0xa1,0x34,0x78,0xbf,0xc5,0x91,0xc0,0x3d,0xc6,0x98,0x46,0xfc, - 0x16,0xac,0xb5,0x73,0x81,0x5f,0xb8,0xbf,0x5d,0xc0,0x17,0x9b,0xc0,0xeb,0x91,0xb7, - 0xf3,0xeb,0xdf,0x97,0xe8,0x2b,0x59,0x44,0x86,0x56,0xcc,0xdd,0xa0,0xaf,0xf7,0x85, - 0x1c,0x7c,0x83,0x89,0x84,0x45,0x8b,0x5a,0x45,0xb4,0xf0,0x1e,0x56,0x22,0xbe,0x3a, - 0xd0,0xe7,0x9f,0x5,0x1e,0x53,0xff,0x97,0x1,0x27,0x36,0xd4,0xef,0x7a,0x44,0x72,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c4,0xbb,0x17,0xf1,0xf0,0xea,0xbc,0x63,0x3a,0xf5,0x3c,0x88,0xb4,0x4,0x9e, - 0x9a,0x2,0xae,0x85,0xd3,0xc1,0x40,0xe2,0xe,0x22,0x96,0x48,0xde,0x59,0x82,0xc4, - 0x4e,0x1e,0x4c,0xc2,0xbe,0x11,0x82,0xf8,0x62,0x85,0xf0,0x1f,0x49,0x4,0xd,0xde, - 0x80,0xf6,0x77,0xf,0xb2,0xc2,0x15,0xe0,0x1b,0x2,0xfc,0x3c,0xf1,0x40,0x16,0x13, - 0x77,0xf3,0xf2,0xf,0x67,0x8e,0xfa,0x3f,0x1f,0xd8,0xaf,0x62,0x9f,0x57,0x2a,0x3c, - 0x6d,0x8b,0x56,0x56,0xfd,0x1b,0xe0,0xdb,0x19,0xcc,0xed,0x99,0xe1,0x19,0x94,0x89, - 0xbb,0x8,0xe1,0x47,0x88,0x22,0x5b,0x96,0x12,0xe0,0xef,0x56,0x83,0x78,0xed,0x55, - 0x73,0x72,0x4d,0x5c,0xfb,0x12,0xf7,0x8,0xb2,0x88,0x93,0xea,0x66,0xc4,0xbd,0x68, - 0x26,0x23,0xc1,0x9e,0x6b,0x11,0x5f,0x81,0x74,0x3,0x9f,0xaf,0xd0,0xef,0x79,0xa, - 0x47,0x2f,0x75,0x6d,0x1b,0x19,0x61,0x2c,0xd9,0x2,0xef,0x32,0xc4,0xe4,0xbe,0x92, - 0xb5,0x29,0x42,0xa0,0x31,0x66,0x80,0x31,0x66,0x53,0x63,0xcc,0x48,0xe0,0x32,0xa2, - 0x79,0x73,0xbc,0x6d,0x6d,0xee,0xdd,0xda,0x6a,0x60,0x63,0xcc,0xaa,0xc6,0x98,0xcb, - 0x10,0xf3,0xe9,0x3a,0xae,0x78,0x31,0xe2,0x67,0xb8,0xab,0xb5,0xf6,0x9,0x22,0x41, - 0x16,0x60,0x92,0xb5,0x76,0xa1,0x95,0x50,0xf3,0xf,0x1,0xb7,0xb9,0xf2,0x4e,0xe0, - 0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8,0xfa,0xfd, - 0xf1,0x14,0x2d,0x48,0x52,0x98,0xb8,0x91,0xe0,0x80,0x50,0xc4,0x11,0xe5,0xda,0x4, - 0x8d,0xf3,0x81,0xff,0xc8,0xa3,0xd3,0x7d,0x21,0xbe,0x7e,0x61,0xd8,0x19,0x22,0x17, - 0xe8,0xc8,0xe6,0x99,0xe4,0x4c,0x4f,0xc8,0xfc,0xea,0xa5,0xed,0xbf,0xb5,0xf0,0x59, - 0x75,0x20,0xee,0xe4,0x57,0x93,0x3e,0x65,0x77,0x23,0xf2,0xcc,0xa3,0x29,0x1f,0xb3, - 0x5,0xce,0x78,0x1b,0x97,0x43,0x78,0x2e,0xc5,0x6a,0xd2,0xe9,0xc8,0xb2,0xaa,0xb1, - 0x84,0xca,0xea,0x86,0x74,0x40,0xe8,0x5f,0xb,0xea,0x1e,0x8a,0x18,0xa1,0x34,0x6d, - 0x77,0x15,0x7d,0x9d,0xae,0xed,0x58,0xd5,0x26,0x68,0x8e,0x46,0xf4,0xeb,0x3a,0xd, - 0xcc,0x2,0xe0,0x80,0x9c,0xfa,0xde,0x79,0x63,0x66,0xb,0x5e,0xfc,0x7a,0xee,0x5d, - 0x4d,0xcb,0x78,0x47,0xcf,0x20,0xa,0xbb,0xb5,0x5d,0xfd,0x81,0x8a,0x41,0x7a,0x10, - 0xa7,0x9d,0x58,0xe0,0x8a,0x47,0xfc,0xf1,0x82,0x97,0x9f,0x3c,0xe6,0x23,0xe9,0x4a, - 0x8e,0xa1,0x81,0x30,0x6c,0x2,0x2,0x42,0x91,0x1d,0x44,0x7e,0x93,0xa0,0x63,0x1e, - 0xf0,0x79,0x2,0x47,0x27,0x24,0xed,0xbc,0x6f,0xfb,0x89,0x12,0xf4,0xad,0x49,0x3c, - 0x45,0xed,0x72,0xe0,0x8b,0x19,0x75,0xbd,0xbd,0xa4,0x87,0x1a,0xb9,0x8c,0x15,0xbe, - 0x15,0x91,0x1c,0x3,0x93,0x48,0xcf,0x4c,0xb6,0x0,0x11,0xa0,0x77,0x4f,0x3e,0x7, - 0xe2,0x2e,0x76,0xa9,0x53,0x92,0xae,0x3c,0x89,0xde,0xa3,0x40,0x37,0xe2,0x28,0x79, - 0x37,0xf1,0x9c,0xf7,0xc9,0x3a,0x93,0x11,0xdb,0x40,0xb0,0x33,0x62,0x82,0xd0,0x3d, - 0x14,0xbe,0x9f,0xa4,0x5c,0x3f,0x8a,0xde,0x82,0xcd,0x24,0xa,0x32,0x8d,0xa4,0xe0, - 0xb9,0x4f,0xb5,0x2f,0x95,0x9,0x1c,0xd1,0x17,0xdc,0x98,0xa0,0xe1,0x7,0x29,0xf, - 0x5d,0xbb,0x75,0x97,0xa2,0x2f,0x81,0x67,0x3b,0xc7,0xb0,0x59,0x49,0x29,0xef,0x47, - 0xbc,0x7e,0x32,0x2d,0x98,0xee,0xe3,0xf0,0xf5,0xcf,0x2e,0x62,0x80,0xa1,0xc0,0x55, - 0x89,0x4e,0x66,0x0,0x5b,0xa8,0xeb,0x87,0x23,0xf3,0xce,0x9b,0x19,0x44,0x59,0x64, - 0xef,0x9b,0xf1,0x88,0xc2,0x25,0xf4,0xcb,0x4c,0xd,0x8,0x45,0x74,0xea,0x37,0x27, - 0xf0,0xbf,0x5,0x9c,0x50,0xe1,0x81,0x76,0x12,0x85,0xab,0x4f,0xaf,0xf8,0x52,0x3a, - 0x88,0x6b,0x46,0x2d,0x89,0xdc,0x3f,0x88,0x1f,0xbf,0xbf,0xb6,0x73,0x49,0xfc,0xab, - 0x23,0xde,0xc0,0xf,0x67,0x3c,0xdb,0x99,0x88,0x4d,0x23,0x74,0xcf,0x1,0xad,0x99, - 0xdc,0x23,0x97,0x1,0x54,0x23,0x1d,0x14,0xf9,0xf3,0xc,0xc4,0x5d,0x88,0x10,0xf2, - 0x63,0xe2,0xfb,0xdb,0x24,0x8f,0x97,0xdd,0x3,0xd9,0x9b,0x9c,0xf0,0x67,0x64,0x5e, - 0xf3,0x6d,0xc6,0xba,0xb2,0x31,0xc4,0x55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a,0xeb,0x7f,0x44,0x49,0x71,0x34,0x32,0x4f,0xce,0x4b,0xb9,0xe1,0xbc, - 0x63,0x1,0x92,0x44,0xba,0xf6,0x8b,0x72,0xb4,0xe8,0x28,0xda,0x4a,0xd3,0x48,0x6, - 0xde,0x8d,0x88,0xc7,0xe6,0xe9,0xa3,0xc7,0x1d,0x3f,0x47,0x76,0x12,0xc9,0x92,0x9d, - 0xee,0x43,0x72,0x5,0x54,0x4a,0xf2,0x90,0x41,0x97,0x66,0xc4,0x4c,0x2f,0xe5,0xac, - 0xc6,0xda,0xfd,0xb8,0x91,0x2d,0xd6,0x90,0x35,0xe9,0xbe,0x88,0xae,0x3d,0xa9,0xb3, - 0x4f,0x7b,0x70,0xbd,0x52,0xae,0xd5,0xe8,0xdb,0x20,0x53,0x90,0x5,0x66,0x35,0x85, - 0x57,0xe1,0x1f,0x46,0x3c,0xa8,0x34,0xe4,0x98,0x81,0xa4,0x79,0xa9,0x1c,0x4a,0x57, - 0x40,0x93,0x5e,0xf1,0x64,0x26,0xb7,0xc8,0xf2,0x8,0x9a,0xa6,0xce,0x47,0x65,0xd4, - 0x29,0x5,0xd6,0xda,0x25,0xd6,0xda,0xdb,0xac,0xb5,0x27,0x21,0x73,0xff,0x6d,0x44, - 0xc9,0x95,0x93,0xd0,0x83,0x2c,0x3f,0x9b,0x82,0x8d,0x91,0x8,0x66,0x10,0x95,0x69, - 0xa3,0x60,0xad,0x7d,0x9d,0xe8,0xa3,0xc9,0x83,0x6e,0x64,0x55,0x73,0x20,0xe2,0x82, - 0x7e,0x86,0xb5,0xf6,0xc9,0xa6,0xe9,0x31,0xc6,0xc,0x44,0xe4,0x32,0x80,0x57,0xac, - 0x4,0xc6,0xa4,0x42,0x16,0x3,0xbc,0xa8,0xce,0x47,0x35,0x44,0xd7,0xdb,0x60,0x85, - 0x45,0x6f,0xce,0xa9,0xd2,0x89,0x8,0x55,0x4d,0xc1,0x76,0xea,0xfc,0xa1,0x6,0xf1, - 0x6a,0x18,0x45,0x36,0x43,0x83,0xd8,0xe0,0xd7,0xb5,0xd6,0x1e,0x60,0xad,0xbd,0xc9, - 0xb6,0x76,0xdf,0xe2,0xed,0x91,0x11,0x17,0x64,0x24,0xc8,0x84,0x90,0x11,0x60,0xbd, - 0x6,0x8,0x4a,0x83,0x4b,0x11,0x59,0x23,0xb,0x4e,0x36,0xc6,0x8c,0x6e,0xa8,0x2f, - 0xcd,0x0,0x8d,0x8f,0x0,0xce,0xe9,0x72,0x7,0xb2,0x9d,0x4e,0x97,0x21,0x2b,0xaa, - 0x19,0x4d,0xf7,0x9d,0x1,0xbb,0xa8,0xf3,0xda,0xc,0x30,0xaa,0x26,0x31,0xa9,0x60, - 0xad,0x5d,0x8a,0xe8,0x11,0x62,0xc5,0x88,0xa0,0x4,0xa2,0xfa,0xbd,0xdb,0x18,0xb3, - 0x75,0x3,0xdd,0x69,0x27,0x90,0xc6,0x18,0xc0,0x18,0x33,0xc8,0x18,0x33,0x1e,0x31, - 0xba,0x6c,0x90,0x53,0xb5,0x3,0x71,0xd4,0x6c,0x17,0x4,0x33,0x40,0x96,0x0,0xd1, - 0x48,0xc6,0x8b,0x0,0x41,0x45,0xaf,0xf7,0x4f,0x44,0xd4,0xad,0x6b,0x10,0x17,0xa8, - 0x66,0x53,0xd3,0x15,0x8d,0x48,0x9d,0xda,0x48,0xec,0xbe,0xc3,0xf9,0x9,0x7a,0xef, - 0x2a,0xb6,0x88,0x74,0x81,0xaf,0xb1,0x48,0xe7,0x40,0xda,0xbc,0x89,0x7c,0x21,0x5, - 0xca,0xa3,0x2c,0x4,0x1d,0x44,0xba,0xff,0x27,0x5b,0x44,0xe4,0x7a,0x44,0x6b,0xe1, - 0x57,0x51,0x3e,0x0,0xc8,0xf2,0x51,0x3b,0x6e,0xcc,0xa1,0x82,0x97,0x90,0xc3,0xb5, - 0xbe,0xc2,0x53,0x7b,0xd7,0x2d,0x47,0x77,0xd2,0x26,0xd0,0x8d,0x68,0x3c,0xbd,0xbd, - 0xa2,0x7,0x71,0xa0,0xf5,0xd7,0x2f,0x6b,0xe3,0xcb,0xdf,0x40,0xf5,0xfb,0xc7,0xa2, - 0xfa,0xa9,0x53,0x80,0xb5,0xb6,0x7,0x71,0xaa,0x4,0x89,0x4,0x6e,0x5,0x1c,0x4b, - 0xe4,0x6f,0x78,0xa5,0x95,0xcd,0x91,0x7c,0xff,0x73,0x10,0x77,0xee,0xfb,0x5d,0xd1, - 0xaa,0xc0,0x24,0x63,0xcc,0x2e,0x94,0x87,0x46,0x4,0x40,0x63,0x4c,0x97,0x31,0xe6, - 0x2c,0xc4,0x71,0xe5,0x0,0x75,0xe9,0x7e,0x64,0xfe,0x7f,0x1e,0xd1,0xe5,0x83,0x58, - 0x2d,0x77,0x43,0x3c,0x8e,0x1,0xe,0x31,0xc6,0xac,0x42,0x7b,0x20,0x7c,0xf8,0x87, - 0xf4,0x11,0xc0,0x71,0x92,0x1e,0x9e,0x2b,0xef,0x7e,0x99,0x81,0xdb,0x10,0xcf,0x78, - 0xbd,0x59,0x46,0xbd,0x55,0x88,0xa7,0x81,0x9f,0x47,0xc9,0xa8,0x61,0xe0,0x3b,0xaa, - 0x7d,0xa5,0xb0,0x6d,0xc4,0x63,0xea,0x71,0xe2,0x5f,0xfd,0xeb,0xc8,0x16,0x31,0x6, - 0x31,0xd9,0xea,0x24,0xe,0xdb,0xb8,0x76,0x3a,0xf4,0xfc,0xb3,0x6d,0x1a,0x1,0xb4, - 0x31,0xaa,0x30,0x69,0x65,0x1e,0x22,0x9d,0xf8,0x29,0x28,0x71,0x61,0x9,0x22,0x77, - 0x57,0xb8,0x73,0x53,0x9b,0x21,0xce,0x22,0x93,0x55,0xfd,0x5,0x94,0x88,0xe1,0x43, - 0xb6,0x6f,0xf5,0x6d,0x37,0x29,0x49,0xe7,0x8,0x7a,0x5b,0x48,0x7b,0x90,0x10,0xed, - 0x35,0x54,0x3d,0x9d,0xa4,0xe9,0x16,0x55,0xfe,0x51,0x55,0x7e,0x5f,0x9b,0x18,0x40, - 0xdb,0x63,0x86,0xd5,0x61,0x0,0x9d,0xac,0xe1,0xb0,0x86,0x89,0x9c,0xa0,0x70,0x17, - 0x66,0xd6,0x44,0x84,0xc3,0x49,0xaa,0xcd,0x42,0xe0,0x63,0x81,0x7d,0x79,0xef,0xa1, - 0xb9,0x84,0x9b,0xa7,0x3b,0x11,0xf7,0xb2,0xa4,0xea,0xf6,0x61,0x12,0x26,0x5e,0xc4, - 0x32,0xaa,0xd,0x3a,0x3b,0xa9,0x6b,0x1d,0xc4,0xbd,0x77,0x52,0x47,0xba,0x6,0x9f, - 0xeb,0x2a,0x44,0x56,0xca,0xa7,0x82,0xda,0xe4,0x20,0xd3,0x69,0xd2,0xcf,0x68,0x82, - 0x40,0x87,0x77,0x30,0x51,0xe2,0xa3,0x45,0x4,0xe6,0xb2,0x71,0xc3,0xec,0x6d,0x8a, - 0xa6,0xc5,0x14,0x44,0xf0,0x10,0x5f,0xcd,0x14,0xa,0x44,0xae,0xcd,0x7,0xe8,0xed, - 0x60,0x39,0x17,0x71,0x78,0xe9,0xe5,0xac,0x8a,0xe8,0xf0,0x33,0x85,0x4c,0xe2,0xa6, - 0xee,0x96,0x3a,0xd7,0x22,0x72,0x53,0x29,0xc1,0x33,0xf,0x99,0x1e,0xa6,0x9b,0xdc, - 0xb,0xf7,0x38,0x85,0xb7,0xd4,0x66,0x7,0x88,0x76,0x4b,0xef,0x1b,0xbc,0x84,0x7c, - 0xff,0x3c,0x9d,0xc2,0x2e,0x77,0x29,0x86,0x8,0x70,0x3f,0xa3,0xb7,0x95,0xee,0x6a, - 0x32,0xec,0x21,0x6e,0xa4,0xd0,0x86,0xa0,0x3d,0x53,0xea,0x8c,0x52,0x38,0x67,0x50, - 0x31,0x87,0x62,0xe0,0xf3,0xd1,0xa3,0x76,0x90,0xd3,0x4c,0x1e,0xb2,0xf5,0x14,0xb2, - 0x5b,0x1b,0x24,0x52,0x5b,0xe5,0x82,0x86,0xf1,0x44,0xfb,0x2e,0xe2,0xd9,0xc9,0x96, - 0x92,0xe1,0x78,0x81,0xf8,0x28,0xf8,0x7a,0xa9,0xbb,0x73,0x20,0x42,0xdc,0x58,0xe2, - 0x66,0x5d,0x8b,0xb8,0x81,0x7f,0xa4,0x80,0x16,0xed,0xc9,0x74,0x6f,0x4e,0x3d,0x3d, - 0x7d,0x65,0x32,0x6c,0x3,0xcf,0x56,0xcb,0x3b,0xa3,0xeb,0x32,0x40,0x27,0x91,0xab, - 0xf8,0xe3,0xd,0x11,0xb8,0xa1,0xfa,0x1a,0x5e,0xa2,0xe2,0xb6,0x67,0x88,0xfb,0xb5, - 0x76,0xb,0xef,0x26,0x25,0xa9,0x54,0x62,0xb4,0xe8,0xe5,0x46,0x5,0x6c,0x45,0xef, - 0x1d,0x3c,0x16,0x22,0x5e,0x3d,0xb9,0x1b,0x38,0x38,0xc6,0xd1,0x6b,0xfd,0xcc,0x8c, - 0xe4,0x88,0x53,0xa7,0xaf,0x57,0x6a,0x17,0x94,0x12,0xcf,0xa4,0x83,0x48,0x66,0x99, - 0x43,0xa8,0xbc,0x53,0x80,0x74,0x9a,0x43,0xb8,0xa0,0x21,0x22,0xbf,0xa5,0x1e,0x44, - 0xad,0x8,0x60,0xc7,0xa0,0x3a,0x22,0xa8,0x1b,0xf8,0x4c,0xa2,0x8e,0x37,0x3b,0xcf, - 0xd7,0xcc,0x86,0x8,0x4b,0x17,0xd2,0xdb,0x19,0x65,0x22,0x81,0xdb,0xcc,0x10,0xf, - 0x3,0x9b,0x5a,0x50,0x77,0x45,0x22,0x6d,0xe4,0x32,0xa,0x76,0x15,0xa9,0xf8,0x3c, - 0xb6,0x50,0xf4,0xdc,0x16,0xdc,0xae,0x0,0xe9,0xdd,0xa,0x69,0xdd,0xfd,0xee,0xc, - 0xf1,0x94,0xe8,0xa5,0x96,0x64,0x19,0x38,0x3b,0x10,0xf,0x1a,0x8f,0x73,0x39,0x2e, - 0x2b,0x38,0x62,0x4b,0xe8,0x35,0x3c,0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,0xf0,0x16,0xcc,0x2c,0x98,0x82,0xe4,0xb,0xf8,0x75,0x8d,0x3e,0xc6,0xa9, - 0xf3,0xf3,0xac,0x32,0x62,0x5,0xc0,0x55,0x44,0x6,0xa2,0xc3,0x8c,0x31,0x2b,0xd7, - 0xa0,0x43,0x43,0x39,0x3,0x90,0x82,0x76,0x31,0xc0,0x18,0x75,0x7e,0x59,0xd,0x3c, - 0x45,0xb0,0x31,0xd9,0x99,0xc0,0xba,0x91,0xaf,0xa3,0x32,0xf3,0x19,0x63,0x76,0x46, - 0x46,0x0,0x90,0xa0,0x97,0x2b,0xca,0xb4,0xb7,0xd6,0xbe,0x81,0x98,0x92,0x41,0x34, - 0xa2,0x87,0x54,0xa5,0x25,0x1,0x2d,0x63,0x80,0x97,0x88,0xfc,0xdc,0xd6,0x2b,0x83, - 0xd8,0x83,0x73,0x97,0xf2,0x4,0xbe,0x88,0x18,0x76,0x5a,0x5,0x79,0xe9,0xe5,0x3a, - 0x11,0x8b,0x5e,0x1d,0xf8,0x9a,0x3a,0xbf,0xc0,0x8a,0x57,0x53,0x59,0xb8,0x54,0x9d, - 0x8f,0xad,0x49,0x8f,0x87,0xca,0xc,0x10,0x32,0xbf,0xf8,0x64,0x4b,0xf3,0x2a,0xce, - 0x4f,0x7a,0x83,0xc4,0x6f,0xb6,0x62,0xee,0x77,0xfd,0x7c,0x86,0xec,0x20,0x93,0xe5, - 0xc8,0x3a,0xbc,0xf2,0x52,0x96,0x78,0x26,0xee,0x19,0x54,0xdc,0x14,0x2,0xf9,0xe8, - 0xf4,0x72,0x78,0xe3,0xaa,0x34,0x39,0x7c,0x5d,0x44,0x9e,0x48,0xc1,0x9b,0x6d,0x87, - 0xca,0x0,0x10,0x79,0x8,0xf,0x36,0xc6,0xac,0x51,0x86,0xb9,0x8c,0x31,0x1d,0xee, - 0xc5,0xe0,0x8,0xbc,0xbc,0x4c,0xfb,0xd0,0x3e,0x8c,0x31,0xe7,0x39,0xdc,0x3e,0xd3, - 0xa7,0x7f,0xb8,0x1e,0x16,0x21,0xbe,0x0,0xb3,0x6a,0x74,0xa5,0xbf,0xfe,0xb,0xad, - 0xb5,0x8b,0xaa,0x20,0xb1,0xe2,0x6c,0x33,0x41,0x15,0xd5,0x1d,0x5,0xb6,0x43,0x14, - 0x4d,0x50,0xf6,0xeb,0x77,0x4,0x15,0x71,0x98,0x5e,0xbe,0x95,0xca,0x15,0x44,0x7c, - 0xd7,0xae,0xbb,0x5b,0xf0,0xd5,0xaf,0x4c,0x6f,0xf7,0xac,0x6b,0x10,0x27,0x50,0xbd, - 0x22,0xa8,0x95,0xb0,0x9,0x49,0x4,0xed,0x97,0x95,0xb3,0xa9,0x19,0xc1,0x43,0xdc, - 0x40,0xf4,0xa,0x35,0x12,0x70,0x21,0xb9,0x90,0xfc,0x7d,0x7e,0xa5,0x15,0x23,0xc0, - 0x34,0x75,0x5e,0x56,0xe,0x38,0x4e,0x9d,0x4f,0x28,0xd9,0x36,0x17,0x8c,0x31,0xeb, - 0x22,0x51,0xb9,0xde,0x3d,0xcb,0x22,0xdb,0xd5,0x1d,0x6e,0x65,0x97,0x8d,0x8b,0x55, - 0xf5,0xba,0x29,0xdb,0xce,0x26,0x12,0x2e,0x2f,0xb6,0xd6,0xce,0xab,0x83,0xcc,0x5a, - 0x3b,0xd,0x89,0xf,0x4,0x9,0x81,0xdf,0xa7,0x6,0xba,0xea,0xf3,0xbf,0x23,0xa6, - 0x88,0xc3,0x4e,0xa0,0x2,0x87,0x21,0x7e,0x7c,0x7e,0x6e,0x9a,0x7,0xac,0xdc,0xe0, - 0x97,0xbf,0x13,0xf1,0xe4,0x50,0xb,0x81,0x43,0x53,0xbe,0xb2,0xda,0xa3,0xf,0x12, - 0xfb,0xe7,0x8d,0x62,0x73,0xa9,0xb0,0x9f,0x50,0x6,0xde,0x23,0x15,0x7d,0x95,0xc3, - 0xe0,0x88,0xd4,0xda,0x8b,0x29,0xb9,0x3,0xb9,0xb5,0x5,0x8a,0x20,0xd7,0x81,0x76, - 0x6b,0xca,0x8c,0x32,0x4d,0x69,0xa7,0xb3,0x53,0x5c,0xd6,0xe0,0xcb,0x3f,0x92,0xb8, - 0xfb,0xf5,0xab,0xa4,0xa8,0xa9,0x11,0x61,0xcb,0xd7,0xab,0x94,0x10,0xc2,0xe1,0xd1, - 0x3b,0x74,0x9c,0xd7,0xe0,0x7d,0xac,0x48,0x94,0xff,0x60,0x29,0x15,0x4,0x54,0xe2, - 0x26,0xfb,0x4a,0xea,0xf5,0x32,0x42,0xa0,0xff,0xaa,0x42,0x61,0x8c,0x3a,0xaf,0xbd, - 0xf6,0x37,0x2,0xe3,0x11,0x65,0x8a,0x17,0x7a,0xa6,0x22,0x2f,0xbf,0xd7,0x4e,0x20, - 0x56,0x84,0x2d,0x9f,0x46,0x7d,0x84,0x31,0x66,0x68,0x85,0x3e,0xd7,0x25,0x12,0x62, - 0x17,0x11,0xdf,0x8d,0xa3,0x16,0x58,0x6b,0x17,0x23,0xc9,0x9d,0x41,0x24,0xf9,0x63, - 0x2a,0xa0,0xa9,0x37,0xfc,0x3b,0x42,0x8a,0xb8,0x6c,0x20,0x91,0xc0,0xf2,0x48,0x20, - 0x67,0xea,0xdd,0x33,0x9e,0xa3,0xfe,0x76,0x72,0x2b,0x21,0x7b,0xe3,0x68,0x61,0xef, - 0x7a,0x8a,0xb7,0x82,0xd5,0x1b,0x51,0x57,0xc9,0x3e,0xaa,0x2d,0x78,0xa5,0x77,0x42, - 0xf,0xc0,0xbf,0xbd,0xc2,0xff,0x58,0x85,0xf6,0x3f,0x52,0xed,0x2b,0xe5,0x3c,0x8, - 0xed,0xc8,0xef,0x8a,0xf9,0x56,0x60,0xfd,0xb,0x14,0x61,0xc1,0xa6,0xc9,0xc,0x5c, - 0x6b,0x23,0xfe,0xfc,0xfa,0xe5,0x8f,0xf,0x61,0x2a,0x57,0xcf,0xb7,0x29,0x95,0x6b, - 0x0,0xf1,0x8,0xf6,0x53,0xc8,0x12,0x4a,0x64,0x2f,0x2d,0xd9,0x8f,0xf6,0xe2,0x2d, - 0xc5,0xa4,0x89,0xe7,0xb2,0x66,0x95,0xfe,0x43,0x77,0xc,0xf1,0xd3,0xc0,0x10,0x63, - 0xcc,0x6a,0x79,0x15,0x8d,0x31,0x9d,0x44,0xc3,0x99,0xa5,0xa4,0xba,0x34,0x81,0x6b, - 0x47,0x24,0x42,0xc8,0x7,0x77,0x2c,0x46,0x76,0xc2,0x3a,0xc7,0xba,0x27,0x50,0x0, - 0x3a,0xf8,0x74,0xd3,0x92,0xdd,0x9f,0x46,0x34,0xd5,0x4c,0xb0,0xd6,0xb6,0x62,0x17, - 0x13,0xa8,0xa8,0x19,0x74,0x76,0x4,0x1f,0x37,0xf9,0x9c,0xb5,0xf6,0xb5,0x4a,0xbd, - 0x7,0x72,0x9a,0xe,0x70,0xd8,0xa6,0xa0,0xee,0x7e,0xaa,0xee,0x1d,0x35,0xbe,0x8c, - 0x43,0x89,0x2c,0x88,0x5e,0xfb,0xb6,0x53,0x49,0x1c,0x3a,0x35,0x7c,0xf0,0xa6,0xca, - 0x48,0x7c,0xa2,0xf7,0x5c,0x5e,0x46,0xc5,0xf4,0x77,0x25,0xfa,0xf2,0x29,0x79,0xde, - 0x22,0x50,0xc3,0x48,0x3c,0xbd,0xef,0x15,0x55,0xfb,0x2f,0x3b,0x2,0x40,0xb1,0x20, - 0x58,0x7b,0xed,0x6f,0x8c,0xf9,0x6,0xa2,0xd0,0xf1,0x16,0xc4,0x47,0x10,0x61,0xef, - 0xfe,0xec,0x56,0xa9,0xa0,0x47,0x80,0xf7,0x95,0x68,0x77,0x2a,0xa2,0x64,0x2,0xf1, - 0x5c,0x7e,0xbe,0x64,0xbf,0xc1,0x60,0xad,0x9d,0x8d,0xe4,0x16,0x4,0x31,0x9b,0x7f, - 0x3a,0xb0,0x69,0x7d,0x1,0xd0,0x11,0x10,0xc2,0x6d,0x7a,0x17,0xaa,0x53,0xb,0xb8, - 0xd9,0x6f,0xff,0xfe,0x16,0xe5,0x3d,0x6d,0x6,0x21,0x2f,0x5e,0xcf,0xf7,0x37,0x52, - 0x43,0x87,0x40,0x24,0xbf,0x2c,0x26,0xc0,0x9,0x15,0xc9,0x87,0xe8,0x9d,0x2b,0x97, - 0xd3,0xe2,0x60,0xe,0xd7,0xa7,0xd6,0x98,0x4e,0xe,0x6c,0xf3,0x3b,0xd5,0xa6,0xf2, - 0xee,0x24,0xa1,0x23,0xc0,0x34,0x75,0x3e,0x2a,0xa7,0xde,0x91,0xc8,0xa6,0x45,0x0, - 0xd7,0x59,0x6b,0x83,0xd3,0xbc,0x18,0x63,0xd6,0x42,0xdc,0xb8,0xe,0x53,0xc5,0xe7, - 0x3,0x7,0x59,0x6b,0x17,0xa4,0xb7,0xa,0x2,0x9f,0x82,0x65,0x20,0x61,0xcb,0xd8, - 0x93,0x11,0x26,0x0,0xf1,0x5d,0x78,0xa2,0x46,0xdf,0xa1,0x30,0x89,0x28,0x18,0x77, - 0x77,0x63,0x4c,0x5e,0xae,0x1,0xdc,0x26,0x16,0x3b,0xbb,0xbf,0x73,0x89,0xf6,0x15, - 0x2e,0xd,0x55,0xa6,0x80,0x3c,0x75,0xf0,0x18,0x75,0x1e,0xbc,0xf6,0x37,0xc6,0x6c, - 0x8b,0xe4,0xe2,0xdd,0xd1,0x15,0x2d,0x45,0x76,0x26,0x3b,0xcb,0xca,0x7a,0xbe,0xe, - 0x4,0x4f,0x3,0x4e,0xb0,0xd2,0x3b,0x6c,0x7d,0xa7,0x66,0xdf,0x41,0x60,0xe3,0x6, - 0x22,0x43,0x7c,0x1a,0x4d,0x83,0x4d,0x91,0x10,0x7a,0x80,0x7,0xea,0x3c,0xa3,0xc6, - 0x64,0x0,0x63,0xcc,0x56,0x44,0xd2,0xfa,0xd3,0xd6,0xda,0xa0,0x79,0xc9,0x18,0x73, - 0x10,0xe2,0x9b,0xef,0xb7,0x78,0x99,0x85,0x4,0x7f,0x56,0x5e,0x3d,0x24,0x40,0x27, - 0x61,0x2a,0x5a,0x9,0x9c,0x88,0x64,0xfc,0x2,0xc9,0x26,0xfa,0x70,0x43,0x34,0x84, - 0xc0,0x65,0x44,0x16,0xcc,0x31,0xce,0x92,0x9a,0x5,0xbb,0xaa,0xf3,0xea,0xf3,0x3f, - 0x81,0xc,0xe0,0x86,0x72,0x6f,0x4a,0x1d,0x95,0x51,0x6d,0x8c,0x3a,0x9f,0x10,0x82, - 0xd7,0x18,0x33,0xe,0xa7,0xd0,0x71,0x45,0x8f,0x21,0x6b,0xe1,0x7b,0x43,0xda,0x7, - 0x42,0xd0,0x8,0xe0,0x32,0x6b,0x9d,0xae,0x8a,0xbe,0xdd,0x20,0xd,0x85,0x60,0xad, - 0x7d,0x81,0xc8,0x59,0x66,0x1d,0xe0,0x63,0x39,0xd5,0x9b,0x11,0x0,0x5d,0xc7,0xa1, - 0x82,0x8a,0x4e,0x97,0x3e,0x34,0x71,0xad,0x8b,0x28,0xa,0x77,0x39,0x5,0xbb,0x70, - 0x23,0xf3,0x71,0x72,0x9b,0x97,0x5b,0x68,0x30,0x51,0xa2,0xea,0x4b,0x67,0x8,0xc9, - 0x14,0xb0,0x80,0x2f,0xa8,0x7a,0xb5,0x33,0x89,0x54,0xa4,0x55,0x87,0x9a,0x5d,0x97, - 0x53,0xef,0x49,0xf5,0xac,0x6b,0x39,0xd8,0x96,0x21,0x4e,0xab,0x55,0xb7,0x4a,0x5c, - 0x3b,0x40,0x5d,0xcb,0xcd,0x29,0x84,0x4,0x6c,0xfc,0x39,0xf1,0xf2,0xbf,0x4f,0xc5, - 0x30,0xb1,0x0,0xba,0xb,0x8d,0x42,0x8e,0x81,0xa7,0x29,0x7a,0x7a,0x5,0x79,0xb6, - 0x89,0x1,0xb4,0x81,0x68,0x9,0x29,0x9b,0x4f,0x22,0x2b,0x2d,0xaf,0x9a,0xff,0x7b, - 0xdd,0x3e,0xcb,0xec,0x1d,0x9c,0x27,0x7,0x4,0xad,0xfd,0x5d,0xc6,0xaf,0xbf,0x20, - 0xe6,0x5c,0x10,0x25,0xcb,0xf1,0xd6,0xda,0xd3,0x6d,0x7d,0x61,0x2f,0x15,0x6c,0x6f, - 0xa3,0xd0,0x90,0x94,0x6a,0x47,0x13,0x9,0xb7,0xf7,0x59,0x6b,0x27,0xa7,0xd4,0x69, - 0x39,0x58,0x31,0x10,0x5d,0xed,0xfe,0xae,0x80,0x8c,0x8,0x49,0xd8,0x99,0xc8,0x37, - 0xa1,0xde,0xf0,0x4f,0xb8,0x10,0x8,0x19,0x4b,0x41,0x63,0xcc,0x70,0x24,0x52,0x6, - 0x64,0xfd,0x7c,0x23,0x29,0x60,0x8c,0xd9,0x1f,0x11,0xf6,0x7c,0xce,0xa1,0xd9,0xc0, - 0x5e,0x56,0xf6,0xb8,0x6b,0x35,0x64,0xca,0x1,0x4e,0x75,0xfd,0x9f,0xaa,0xa8,0x2d, - 0x92,0x7f,0xe,0x14,0xa9,0x86,0xf5,0xfc,0x5f,0x5b,0x56,0x6a,0x62,0x4,0x38,0x1a, - 0x19,0x42,0x1,0xae,0x71,0x5c,0x1c,0x3,0x63,0xcc,0x19,0xc0,0xd,0x88,0x2b,0x34, - 0xc0,0x13,0x88,0xb0,0x37,0xa5,0x44,0xff,0x75,0x20,0x6f,0x25,0x70,0x28,0xe2,0x4e, - 0xe,0xe2,0x36,0x7e,0x6b,0x7b,0x48,0x4a,0x7,0x6b,0xed,0x5f,0x91,0x2c,0xe3,0x0, - 0x5b,0x1b,0x63,0xb6,0x4f,0x54,0x69,0x4e,0x0,0xa4,0xfa,0x8,0xa0,0x75,0x1,0x63, - 0xd4,0x79,0x6c,0xed,0x6f,0x8c,0x59,0xc1,0x18,0x33,0x1,0x51,0xe8,0xf8,0xbe,0x6e, - 0x47,0x74,0xfa,0x2d,0x53,0xaf,0xa6,0x40,0xea,0x8,0xe0,0x14,0x2a,0x67,0xab,0x6b, - 0x7d,0xfd,0xf5,0x7b,0x48,0x1d,0x5,0x8c,0x31,0x3,0x88,0x74,0x25,0xaf,0x59,0x6b, - 0x9f,0xab,0xdd,0x53,0x9,0x1,0x65,0x15,0x22,0x21,0xe9,0x21,0x57,0xa6,0x3,0x1e, - 0x1f,0x4f,0xd4,0x1f,0x4e,0x3c,0xc3,0x97,0x5,0x2e,0xa2,0xc5,0x3b,0x90,0x66,0xd0, - 0xbe,0xa3,0xa2,0xe1,0x7a,0x55,0xae,0x73,0xea,0x7,0x5,0x79,0xb6,0x89,0x5e,0xad, - 0x52,0x9f,0x83,0xdb,0x92,0x86,0xb8,0x71,0xeb,0x86,0x26,0xfa,0xa,0x1e,0x1,0xac, - 0x38,0x42,0xbe,0xe1,0xfe,0x8e,0x72,0xbf,0x63,0x54,0x95,0xb7,0xbf,0x7e,0x63,0xcc, - 0x16,0x88,0xb0,0xb7,0x9b,0x2b,0xea,0x46,0x92,0x41,0x9d,0x62,0xcb,0x85,0x52,0x35, - 0x5,0x59,0x32,0x80,0xe,0xf3,0xfa,0xae,0x75,0x4f,0xb9,0xaf,0xc1,0xc6,0xd,0x44, - 0xab,0x22,0x8c,0xa,0xd,0xf,0xff,0xbe,0xb3,0x32,0x9c,0xa9,0x1d,0x10,0xd6,0x40, - 0x72,0xe5,0x59,0xe4,0x5,0xaf,0xe5,0xea,0xec,0x47,0x94,0x9b,0xdf,0x22,0x4c,0x13, - 0x9c,0xd6,0xad,0x85,0x5f,0x55,0xcc,0x28,0x44,0x7c,0x6f,0xa4,0x52,0x41,0x9e,0x6d, - 0xa2,0x57,0xd3,0x37,0xc9,0x95,0x69,0x43,0xd9,0xae,0x8d,0xf4,0x53,0x92,0x28,0x9d, - 0x9b,0x47,0xfb,0xa3,0xdf,0xe2,0xae,0x27,0x37,0x53,0x7a,0x92,0x9a,0x91,0x2f,0xd, - 0x3e,0xd0,0xc9,0x8a,0xae,0xd,0x88,0xa7,0x86,0x69,0x4b,0x12,0xc7,0x92,0xf4,0x76, - 0x10,0x45,0x65,0xf5,0x20,0x72,0x97,0x4f,0x47,0xb7,0x84,0x86,0x36,0xef,0x2c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1,0x85,0x58,0xef,0xf,0x8c,0x46,0x94,0x42,0xb7,0x59,0x6b,0x5f, - 0xcc,0x6d,0xd4,0x8f,0xc0,0x18,0xd3,0x85,0x64,0x2c,0x9f,0x61,0xfb,0x97,0x92,0xaa, - 0x10,0x8c,0x31,0x23,0x11,0x46,0x7e,0xc1,0x96,0x79,0x69,0x45,0x78,0x1b,0xc4,0xf5, - 0x2e,0xfc,0xb,0xc2,0xff,0x3,0x27,0x66,0x5a,0x57,0xe3,0x95,0xc6,0xc3,0x0,0x0, - 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + 0x0,0x0,0x1d,0x7b, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x8,0x6,0x0,0x0,0x0,0xc3,0x3e,0x61,0xcb, + 0x0,0x0,0x0,0x4,0x73,0x42,0x49,0x54,0x8,0x8,0x8,0x8,0x7c,0x8,0x64,0x88, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xf,0xa0,0x0,0x0,0xf,0xa0, + 0x1,0xa0,0x6a,0x8c,0x77,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66, + 0x74,0x77,0x61,0x72,0x65,0x0,0x77,0x77,0x77,0x2e,0x69,0x6e,0x6b,0x73,0x63,0x61, + 0x70,0x65,0x2e,0x6f,0x72,0x67,0x9b,0xee,0x3c,0x1a,0x0,0x0,0x1c,0xf8,0x49,0x44, + 0x41,0x54,0x78,0x9c,0xed,0x9d,0x77,0xbc,0x1f,0x45,0xb5,0xc0,0xbf,0x73,0x6f,0x2e, + 0x21,0x10,0x12,0x4a,0x82,0x21,0x80,0x84,0x2a,0x10,0x7a,0x51,0x9a,0x2,0x8a,0x2, + 0xa2,0x80,0x20,0x1d,0x24,0x4,0x11,0x14,0x9f,0xa0,0x20,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4,0x8d,0x3d,0x95,0xf8,0xca, + 0xbb,0xdc,0x88,0x60,0x81,0xc7,0x52,0xda,0x6e,0x4e,0x24,0x20,0x2d,0x4,0xd6,0x69, + 0x13,0xcd,0x7e,0xaa,0x78,0xa3,0xe0,0xeb,0xff,0x59,0x83,0x7d,0x76,0x2,0xd3,0x14, + 0xfe,0x6d,0x9a,0xbc,0xa7,0x3e,0x31,0x79,0x1a,0x63,0x76,0x25,0xb2,0xf7,0x2f,0x7, + 0x8e,0xb1,0xd6,0x2e,0x52,0x55,0x46,0x10,0x59,0x3,0x5f,0x4d,0xb6,0xb7,0xd6,0x3e, + 0xe,0x5c,0xea,0xfe,0xe,0x2,0xc6,0xb7,0x88,0xd4,0x64,0xbf,0xaf,0x5b,0x6b,0xaf, + 0x0,0x7e,0x83,0x30,0x60,0x1a,0x74,0x91,0x42,0x73,0x8d,0x3e,0x97,0x23,0xd3,0x91, + 0x87,0xaf,0x34,0x85,0xdb,0x77,0xd0,0xee,0x2f,0x7f,0x65,0xe2,0x5a,0xb1,0x6f,0xa5, + 0xd4,0xf9,0x80,0xba,0x7e,0x59,0x6,0x9e,0xb5,0x80,0xf9,0x44,0x2,0xd8,0x56,0x6d, + 0xbc,0x87,0x2d,0x89,0x46,0xa8,0xb4,0xe3,0x95,0x26,0xe9,0x41,0xec,0x6,0x5e,0x38, + 0x5d,0xa,0x8c,0xfc,0x57,0x1e,0x1,0x7e,0x0,0x6c,0xe8,0xce,0xa7,0x92,0xfe,0xf5, + 0xae,0xad,0xce,0x53,0xbf,0x26,0x6b,0xed,0x74,0x87,0xb,0x64,0x29,0x79,0x7e,0x53, + 0x4,0x6,0x80,0x1e,0xa1,0x34,0x78,0xbf,0xc5,0x91,0xc0,0x3d,0xc6,0x98,0x46,0xfc, + 0x16,0xac,0xb5,0x73,0x81,0x5f,0xb8,0xbf,0x5d,0xc0,0x17,0x9b,0xc0,0xeb,0x91,0xb7, + 0xf3,0xeb,0xdf,0x97,0xe8,0x2b,0x59,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x41,0xb0,0xd6,0x3e,0x8b,0x24,0x9c, + 0xbc,0xc7,0x15,0xad,0x0,0xfc,0x2f,0xf0,0xf,0xf7,0xdf,0x20,0xb9,0xa,0x32,0x11, + 0x14,0xd,0x33,0x83,0x88,0xcf,0x29,0x8d,0x39,0x5b,0x26,0xfa,0xd1,0x5e,0xbd,0x13, + 0x1a,0xc4,0xbb,0x17,0xf1,0xf0,0xea,0xbc,0x63,0x3a,0xf5,0x3c,0x88,0xb4,0x4,0x9e, + 0x9a,0x2,0xae,0x85,0xd3,0xc1,0x40,0xe2,0xe,0x22,0x96,0x48,0xde,0x59,0x82,0xc4, + 0x4e,0x1e,0x4c,0xc2,0xbe,0x11,0x82,0xf8,0x62,0x85,0xf0,0x1f,0x49,0x4,0xd,0xde, + 0x80,0xf6,0x77,0xf,0xb2,0xc2,0x15,0xe0,0x1b,0x2,0xfc,0x3c,0xf1,0x40,0x16,0x13, + 0x77,0xf3,0xf2,0xf,0x67,0x8e,0xfa,0x3f,0x1f,0xd8,0xaf,0x62,0x9f,0x57,0x2a,0x3c, + 0x6d,0x8b,0x56,0x56,0xfd,0x1b,0xe0,0xdb,0x19,0xcc,0xed,0x99,0xe1,0x19,0x94,0x89, + 0xbb,0x8,0xe1,0x47,0x88,0x22,0x5b,0x96,0x12,0xe0,0xef,0x56,0x83,0x78,0xed,0x55, + 0x73,0x72,0x4d,0x5c,0xfb,0x12,0xf7,0x8,0xb2,0x88,0x93,0xea,0x66,0xc4,0xbd,0x68, + 0x26,0x23,0xc1,0x9e,0x6b,0x11,0x5f,0x81,0x74,0x3,0x9f,0xaf,0xd0,0xef,0x79,0xa, + 0x47,0x2f,0x75,0x6d,0x1b,0x19,0x61,0x2c,0xd9,0x2,0xef,0x32,0xc4,0xe4,0xbe,0x92, + 0xb5,0x29,0x42,0xa0,0x31,0x66,0x80,0x31,0x66,0x53,0x63,0xcc,0x48,0xe0,0x32,0xa2, + 0x79,0x73,0xbc,0x6d,0x6d,0xee,0xdd,0xda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,0xbb,0xd4,0x8,0xf7,0x52,0x1,0xee,0xc3,0x89,0x8f,0x86, + 0x4f,0x52,0xe0,0xb2,0xd,0xac,0xab,0xea,0xdf,0xd2,0xa6,0x97,0xbe,0x1a,0xe2,0x11, + 0x34,0x95,0xfc,0x97,0xae,0x8f,0x6e,0x60,0x33,0xcd,0x0,0x5f,0xcb,0xf8,0xfa,0xfd, + 0xf1,0x14,0x2d,0x48,0x52,0x98,0xb8,0x91,0xe0,0x80,0x50,0xc4,0x11,0xe5,0xda,0x4, + 0x8d,0xf3,0x81,0xff,0xc8,0xa3,0xd3,0x7d,0x21,0xbe,0x7e,0x61,0xd8,0x19,0x22,0x17, + 0xe8,0xc8,0xe6,0x99,0xe4,0x4c,0x4f,0xc8,0xfc,0xea,0xa5,0xed,0xbf,0xb5,0xf0,0x59, + 0x75,0x20,0xee,0xe4,0x57,0x93,0x3e,0x65,0x77,0x23,0xf2,0xcc,0xa3,0x29,0x1f,0xb3, + 0x5,0xce,0x78,0x1b,0x97,0x43,0x78,0x2e,0xc5,0x6a,0xd2,0xe9,0xc8,0xb2,0xaa,0xb1, + 0x84,0xca,0xea,0x86,0x74,0x40,0xe8,0x5f,0xb,0xea,0x1e,0x8a,0x18,0xa1,0x34,0x6d, + 0x77,0x15,0x7d,0x9d,0xae,0xed,0x58,0xd5,0x26,0x68,0x8e,0x46,0xf4,0xeb,0x3a,0xd, + 0xcc,0x2,0xe0,0x80,0x9c,0xfa,0xde,0x79,0x63,0x66,0xb,0x5e,0xfc,0x7a,0xee,0x5d, + 0x4d,0xcb,0x78,0x47,0xcf,0x20,0xa,0xbb,0xb5,0x5d,0xfd,0x81,0x8a,0x41,0x7a,0x10, + 0xa7,0x9d,0x58,0xe0,0x8a,0x47,0xfc,0xf1,0x82,0x97,0x9f,0x3c,0xe6,0x23,0xe9,0x4a, + 0x8e,0xa1,0x81,0x30,0x6c,0x2,0x2,0x42,0x91,0x1d,0x44,0x7e,0x93,0xa0,0x63,0x1e, + 0xf0,0x79,0x2,0x47,0x27,0x24,0xed,0xbc,0x6f,0xfb,0x89,0x12,0xf4,0xad,0x49,0x3c, + 0x45,0xed,0x72,0xe0,0x8b,0x19,0x75,0xbd,0xbd,0xa4,0x87,0x1a,0xb9,0x8c,0x15,0xbe, + 0x15,0x91,0x1c,0x3,0x93,0x48,0xcf,0x4c,0xb6,0x0,0x11,0xa0,0x77,0x4f,0x3e,0x7, + 0xe2,0x2e,0x76,0xa9,0x53,0x92,0xae,0x3c,0x89,0xde,0xa3,0x40,0x37,0xe2,0x28,0x79, + 0x37,0xf1,0x9c,0xf7,0xc9,0x3a,0x93,0x11,0xdb,0x40,0xb0,0x33,0x62,0x82,0xd0,0x3d, + 0x14,0xbe,0x9f,0xa4,0x5c,0x3f,0x8a,0xde,0x82,0xcd,0x24,0xa,0x32,0x8d,0xa4,0xe0, + 0xb9,0x4f,0xb5,0x2f,0x95,0x9,0x1c,0xd1,0x17,0xdc,0x98,0xa0,0xe1,0x7,0x29,0xf, + 0x5d,0xbb,0x75,0x97,0xa2,0x2f,0x81,0x67,0x3b,0xc7,0xb0,0x59,0x49,0x29,0xef,0x47, + 0xbc,0x7e,0x32,0x2d,0x98,0xee,0xe3,0xf0,0xf5,0xcf,0x2e,0x62,0x80,0xa1,0xc0,0x55, + 0x89,0x4e,0x66,0x0,0x5b,0xa8,0xeb,0x87,0x23,0xf3,0xce,0x9b,0x19,0x44,0x59,0x64, + 0xef,0x9b,0xf1,0x88,0xc2,0x25,0xf4,0xcb,0x4c,0xd,0x8,0x45,0x74,0xea,0x37,0x27, + 0xf0,0xbf,0x5,0x9c,0x50,0xe1,0x81,0x76,0x12,0x85,0xab,0x4f,0xaf,0xf8,0x52,0x3a, + 0x88,0x6b,0x46,0x2d,0x89,0xdc,0x3f,0x88,0x1f,0xbf,0xbf,0xb6,0x73,0x49,0xfc,0xab, + 0x23,0xde,0xc0,0xf,0x67,0x3c,0xdb,0x99,0x88,0x4d,0x23,0x74,0xcf,0x1,0xad,0x99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0x7a,0x8f,0x77,0x16,0xf1,0x0, + 0xd9,0xbf,0xa3,0x3c,0x72,0x10,0xcb,0xea,0x51,0xee,0xde,0xd3,0x4,0xba,0xf9,0x88, + 0xfa,0x7d,0xb7,0x6,0x68,0xd3,0x1,0xab,0x17,0x67,0xd6,0xcb,0x68,0xfc,0x94,0x6b, + 0xb8,0x98,0x1a,0xeb,0x7f,0x44,0x49,0x71,0x34,0x32,0x4f,0xce,0x4b,0xb9,0xe1,0xbc, + 0x63,0x1,0x92,0x44,0xba,0xf6,0x8b,0x72,0xb4,0xe8,0x28,0xda,0x4a,0xd3,0x48,0x6, + 0xde,0x8d,0x88,0xc7,0xe6,0xe9,0xa3,0xc7,0x1d,0x3f,0x47,0x76,0x12,0xc9,0x92,0x9d, + 0xee,0x43,0x72,0x5,0x54,0x4a,0xf2,0x90,0x41,0x97,0x66,0xc4,0x4c,0x2f,0xe5,0xac, + 0xc6,0xda,0xfd,0xb8,0x91,0x2d,0xd6,0x90,0x35,0xe9,0xbe,0x88,0xae,0x3d,0xa9,0xb3, + 0x4f,0x7b,0x70,0xbd,0x52,0xae,0xd5,0xe8,0xdb,0x20,0x53,0x90,0x5,0x66,0x35,0x85, + 0x57,0xe1,0x1f,0x46,0x3c,0xa8,0x34,0xe4,0x98,0x81,0xa4,0x79,0xa9,0x1c,0x4a,0x57, + 0x40,0x93,0x5e,0xf1,0x64,0x26,0xb7,0xc8,0xf2,0x8,0x9a,0xa6,0xce,0x47,0x65,0xd4, + 0x29,0x5,0xd6,0xda,0x25,0xd6,0xda,0xdb,0xac,0xb5,0x27,0x21,0x73,0xff,0x6d,0x44, + 0xc9,0x95,0x93,0xd0,0x83,0x2c,0x3f,0x9b,0x82,0x8d,0x91,0x8,0x66,0x10,0x95,0x69, + 0xa3,0x60,0xad,0x7d,0x9d,0xe8,0xa3,0xc9,0x83,0x6e,0x64,0x55,0x73,0x20,0xe2,0x82, + 0x7e,0x86,0xb5,0xf6,0xc9,0xa6,0xe9,0x31,0xc6,0xc,0x44,0xe4,0x32,0x80,0x57,0xac, + 0x4,0xc6,0xa4,0x42,0x16,0x3,0xbc,0xa8,0xce,0x47,0x35,0x44,0xd7,0xdb,0x60,0x85, + 0x45,0x6f,0xce,0xa9,0xd2,0x89,0x8,0x55,0x4d,0xc1,0x76,0xea,0xfc,0xa1,0x6,0xf1, + 0x6a,0x18,0x45,0x36,0x43,0x83,0xd8,0xe0,0xd7,0xb5,0xd6,0x1e,0x60,0xad,0xbd,0xc9, + 0xb6,0x76,0xdf,0xe2,0xed,0x91,0x11,0x17,0x64,0x24,0xc8,0x84,0x90,0x11,0x60,0xbd, + 0x6,0x8,0x4a,0x83,0x4b,0x11,0x59,0x23,0xb,0x4e,0x36,0xc6,0x8c,0x6e,0xa8,0x2f, + 0xcd,0x0,0x8d,0x8f,0x0,0xce,0xe9,0x72,0x7,0xb2,0x9d,0x4e,0x97,0x21,0x2b,0xaa, + 0x19,0x4d,0xf7,0x9d,0x1,0xbb,0xa8,0xf3,0xda,0xc,0x30,0xaa,0x26,0x31,0xa9,0x60, + 0xad,0x5d,0x8a,0xe8,0x11,0x62,0xc5,0x88,0xa0,0x4,0xa2,0xfa,0xbd,0xdb,0x18,0xb3, + 0x75,0x3,0xdd,0x69,0x27,0x90,0xc6,0x18,0xc0,0x18,0x33,0xc8,0x18,0x33,0x1e,0x31, + 0xba,0x6c,0x90,0x53,0xb5,0x3,0x71,0xd4,0x6c,0x17,0x4,0x33,0x40,0x96,0x0,0xd1, + 0x48,0xc6,0x8b,0x0,0x41,0x45,0xaf,0xf7,0x4f,0x44,0xd4,0xad,0x6b,0x10,0x17,0xa8, + 0x66,0x53,0xd3,0x15,0x8d,0x48,0x9d,0xda,0x48,0xec,0xbe,0xc3,0xf9,0x9,0x7a,0xef, + 0x2a,0xb6,0x88,0x74,0x81,0xaf,0xb1,0x48,0xe7,0x40,0xda,0xbc,0x89,0x7c,0x21,0x5, + 0xca,0xa3,0x2c,0x4,0x1d,0x44,0xba,0xff,0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53,0x9b,0x21,0xce,0x22,0x93,0x55,0xfd,0x5,0x94,0x88,0xe1,0x43, + 0xb6,0x6f,0xf5,0x6d,0x37,0x29,0x49,0xe7,0x8,0x7a,0x5b,0x48,0x7b,0x90,0x10,0xed, + 0x35,0x54,0x3d,0x9d,0xa4,0xe9,0x16,0x55,0xfe,0x51,0x55,0x7e,0x5f,0x9b,0x18,0x40, + 0xdb,0x63,0x86,0xd5,0x61,0x0,0x9d,0xac,0xe1,0xb0,0x86,0x89,0x9c,0xa0,0x70,0x17, + 0x66,0xd6,0x44,0x84,0xc3,0x49,0xaa,0xcd,0x42,0xe0,0x63,0x81,0x7d,0x79,0xef,0xa1, + 0xb9,0x84,0x9b,0xa7,0x3b,0x11,0xf7,0xb2,0xa4,0xea,0xf6,0x61,0x12,0x26,0x5e,0xc4, + 0x32,0xaa,0xd,0x3a,0x3b,0xa9,0x6b,0x1d,0xc4,0xbd,0x77,0x52,0x47,0xba,0x6,0x9f, + 0xeb,0x2a,0x44,0x56,0xca,0xa7,0x82,0xda,0xe4,0x20,0xd3,0x69,0xd2,0xcf,0x68,0x82, + 0x40,0x87,0x77,0x30,0x51,0xe2,0xa3,0x45,0x4,0xe6,0xb2,0x71,0xc3,0xec,0x6d,0x8a, + 0xa6,0xc5,0x14,0x44,0xf0,0x10,0x5f,0xcd,0x14,0xa,0x44,0xae,0xcd,0x7,0xe8,0xed, + 0x60,0x39,0x17,0x71,0x78,0xe9,0xe5,0xac,0x8a,0xe8,0xf0,0x33,0x85,0x4c,0xe2,0xa6, + 0xee,0x96,0x3a,0xd7,0x22,0x72,0x53,0x29,0xc1,0x33,0xf,0x99,0x1e,0xa6,0x9b,0xdc, + 0xb,0xf7,0x38,0x85,0xb7,0xd4,0x66,0x7,0x88,0x76,0x4b,0xef,0x1b,0xbc,0x84,0x7c, + 0xff,0x3c,0x9d,0xc2,0x2e,0x77,0x29,0x86,0x8,0x70,0x3f,0xa3,0xb7,0x95,0xee,0x6a, + 0x32,0xec,0x21,0x6e,0xa4,0xd0,0x86,0xa0,0x3d,0x53,0xea,0x8c,0x52,0x38,0x67,0x50, + 0x31,0x87,0x62,0xe0,0xf3,0xd1,0xa3,0x76,0x90,0xd3,0x4c,0x1e,0xb2,0xf5,0x14,0xb2, + 0x5b,0x1b,0x24,0x52,0x5b,0xe5,0x82,0x86,0xf1,0x44,0xfb,0x2e,0xe2,0xd9,0xc9,0x96, + 0x92,0xe1,0x78,0x81,0xf8,0x28,0xf8,0x7a,0xa9,0xbb,0x73,0x20,0x42,0xdc,0x58,0xe2, + 0x66,0x5d,0x8b,0xb8,0x81,0x7f,0xa4,0x80,0x16,0xed,0xc9,0x74,0x6f,0x4e,0x3d,0x3d, + 0x7d,0x65,0x32,0x6c,0x3,0xcf,0x56,0xcb,0x3b,0xa3,0xeb,0x32,0x40,0x27,0x91,0xab, + 0xf8,0xe3,0xd,0x11,0xb8,0xa1,0xfa,0x1a,0x5e,0xa2,0xe2,0xb6,0x67,0x88,0xfb,0xb5, + 0x76,0xb,0xef,0x26,0x25,0xa9,0x54,0x62,0xb4,0xe8,0xe5,0x46,0x5,0x6c,0x45,0xef, + 0x1d,0x3c,0x16,0x22,0x5e,0x3d,0xb9,0x1b,0x38,0x38,0xc6,0xd1,0x6b,0xfd,0xcc,0x8c, + 0xe4,0x88,0x53,0xa7,0xaf,0x57,0x6a,0x17,0x94,0x12,0xcf,0xa4,0x83,0x48,0x66,0x99, + 0x43,0xa8,0xbc,0x53,0x80,0x74,0x9a,0x43,0xb8,0xa0,0x21,0x22,0xbf,0xa5,0x1e,0x44, + 0xad,0x8,0x60,0xc7,0xa0,0x3a,0x22,0xa8,0x1b,0xf8,0x4c,0xa2,0x8e,0x37,0x3b,0xcf, + 0xd7,0xcc,0x86,0x8,0x4b,0x17,0xd2,0xdb,0x19,0x65,0x22,0x81,0xdb,0xcc,0x10,0xf, + 0x3,0x9b,0x5a,0x50,0x77,0x45,0x22,0x6d,0xe4,0x32,0xa,0x76,0x15,0xa9,0xf8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0x94,0x8,0x9b,0x47,0x94,0x4b,0xbe, + 0x6d,0xe9,0x84,0xd4,0x39,0x78,0x87,0x2b,0xbc,0xa5,0x62,0x12,0x8b,0x92,0x44,0x4d, + 0x53,0xe7,0xa3,0xa,0xea,0xe6,0xc1,0x61,0x88,0x47,0x2c,0x48,0x66,0xd1,0xa6,0x13, + 0x4c,0x79,0xf0,0x16,0xcc,0x2c,0x98,0x82,0xe4,0xb,0xf8,0x75,0x8d,0x3e,0xc6,0xa9, + 0xf3,0xf3,0xac,0x32,0x62,0x5,0xc0,0x55,0x44,0x6,0xa2,0xc3,0x8c,0x31,0x2b,0xd7, + 0xa0,0x43,0x43,0x39,0x3,0x90,0x82,0x76,0x31,0xc0,0x18,0x75,0x7e,0x59,0xd,0x3c, + 0x45,0xb0,0x31,0xd9,0x99,0xc0,0xba,0x91,0xaf,0xa3,0x32,0xf3,0x19,0x63,0x76,0x46, + 0x46,0x0,0x90,0xa0,0x97,0x2b,0xca,0xb4,0xb7,0xd6,0xbe,0x81,0x98,0x92,0x41,0x34, + 0xa2,0x87,0x54,0xa5,0x25,0x1,0x2d,0x63,0x80,0x97,0x88,0xfc,0xdc,0xd6,0x2b,0x83, + 0xd8,0x83,0x73,0x97,0xf2,0x4,0xbe,0x88,0x18,0x76,0x5a,0x5,0x79,0xe9,0xe5,0x3a, + 0x11,0x8b,0x5e,0x1d,0xf8,0x9a,0x3a,0xbf,0xc0,0x8a,0x57,0x53,0x59,0xb8,0x54,0x9d, + 0x8f,0xad,0x49,0x8f,0x87,0xca,0xc,0x10,0x32,0xbf,0xf8,0x64,0x4b,0xf3,0x2a,0xce, + 0x4f,0x7a,0x83,0xc4,0x6f,0xb6,0x62,0xee,0x77,0xfd,0x7c,0x86,0xec,0x20,0x93,0xe5, + 0xc8,0x3a,0xbc,0xf2,0x52,0x96,0x78,0x26,0xee,0x19,0x54,0xdc,0x14,0x2,0xf9,0xe8, + 0xf4,0x72,0x78,0xe3,0xaa,0x34,0x39,0x7c,0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,0x50,0xb,0x81,0x43,0x53,0xbe,0xb2,0xda,0xa3,0xf,0x12, + 0xfb,0xe7,0x8d,0x62,0x73,0xa9,0xb0,0x9f,0x50,0x6,0xde,0x23,0x15,0x7d,0x95,0xc3, + 0xe0,0x88,0xd4,0xda,0x8b,0x29,0xb9,0x3,0xb9,0xb5,0x5,0x8a,0x20,0xd7,0x81,0x76, + 0x6b,0xca,0x8c,0x32,0x4d,0x69,0xa7,0xb3,0x53,0x5c,0xd6,0xe0,0xcb,0x3f,0x92,0xb8, + 0xfb,0xf5,0xab,0xa4,0xa8,0xa9,0x11,0x61,0xcb,0xd7,0xab,0x94,0x10,0xc2,0xe1,0xd1, + 0x3b,0x74,0x9c,0xd7,0xe0,0x7d,0xac,0x48,0x94,0xff,0x60,0x29,0x15,0x4,0x54,0xe2, + 0x26,0xfb,0x4a,0xea,0xf5,0x32,0x42,0xa0,0xff,0xaa,0x42,0x61,0x8c,0x3a,0xaf,0xbd, + 0xf6,0x37,0x2,0xe3,0x11,0x65,0x8a,0x17,0x7a,0xa6,0x22,0x2f,0xbf,0xd7,0x4e,0x20, + 0x56,0x84,0x2d,0x9f,0x46,0x7d,0x84,0x31,0x66,0x68,0x85,0x3e,0xd7,0x25,0x12,0x62, + 0x17,0x11,0xdf,0x8d,0xa3,0x16,0x58,0x6b,0x17,0x23,0xc9,0x9d,0x41,0x24,0xf9,0x63, + 0x2a,0xa0,0xa9,0x37,0xfc,0x3b,0x42,0x8a,0xb8,0x6c,0x20,0x91,0xc0,0xf2,0x48,0x20, + 0x67,0xea,0xdd,0x33,0x9e,0xa3,0xfe,0x76,0x72,0x2b,0x21,0x7b,0xe3,0x68,0x61,0xef, + 0x7a,0x8a,0xb7,0x82,0xd5,0x1b,0x51,0x57,0xc9,0x3e,0xaa,0x2d,0x78,0xa5,0x77,0x42, + 0xf,0xc0,0xbf,0xbd,0xc2,0xff,0x58,0x85,0xf6,0x3f,0x52,0xed,0x2b,0xe5,0x3c,0x8, + 0xed,0xc8,0xef,0x8a,0xf9,0x56,0x60,0xfd,0xb,0x14,0x61,0xc1,0xa6,0xc9,0xc,0x5c, + 0x6b,0x23,0xfe,0xfc,0xfa,0xe5,0x8f,0xf,0x61,0x2a,0x57,0xcf,0xb7,0x29,0x95,0x6b, + 0x0,0xf1,0x8,0xf6,0x53,0xc8,0x12,0x4a,0x64,0x2f,0x2d,0xd9,0x8f,0xf6,0xe2,0x2d, + 0xc5,0xa4,0x89,0xe7,0xb2,0x66,0x95,0xfe,0x43,0x77,0xc,0xf1,0xd3,0xc0,0x10,0x63, + 0xcc,0x6a,0x79,0x15,0x8d,0x31,0x9d,0x44,0xc3,0x99,0xa5,0xa4,0xba,0x34,0x81,0x6b, + 0x47,0x24,0x42,0xc8,0x7,0x77,0x2c,0x46,0x76,0xc2,0x3a,0xc7,0xba,0x27,0x50,0x0, + 0x3a,0xf8,0x74,0xd3,0x92,0xdd,0x9f,0x46,0x34,0xd5,0x4c,0xb0,0xd6,0xb6,0x62,0x17, + 0x13,0xa8,0xa8,0x19,0x74,0x76,0x4,0x1f,0x37,0xf9,0x9c,0xb5,0xf6,0xb5,0x4a,0xbd, + 0x7,0x72,0x9a,0xe,0x70,0xd8,0xa6,0xa0,0xee,0x7e,0xaa,0xee,0x1d,0x35,0xbe,0x8c, + 0x43,0x89,0x2c,0x88,0x5e,0xfb,0xb6,0x53,0x49,0x1c,0x3a,0x35,0x7c,0xf0,0xa6,0xca, + 0x48,0x7c,0xa2,0xf7,0x5c,0x5e,0x46,0xc5,0xf4,0x77,0x25,0xfa,0xf2,0x29,0x79,0xde, + 0x22,0x50,0xc3,0x48,0x3c,0xbd,0xef,0x15,0x55,0xfb,0x2f,0x3b,0x2,0x40,0xb1,0x20, + 0x58,0x7b,0xed,0x6f,0x8c,0xf9,0x6,0xa2,0xd0,0xf1,0x16,0xc4,0x47,0x10,0x61,0xef, + 0xfe,0xec,0x56,0xa9,0xa0,0x47,0x80,0xf7,0x95,0x68,0x77,0x2a,0xa2,0x64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a,0x80,0x7,0xea,0x3c,0xa3,0xc6, + 0x64,0x0,0x63,0xcc,0x56,0x44,0xd2,0xfa,0xd3,0xd6,0xda,0xa0,0x79,0xc9,0x18,0x73, + 0x10,0xe2,0x9b,0xef,0xb7,0x78,0x99,0x85,0x4,0x7f,0x56,0x5e,0x3d,0x24,0x40,0x27, + 0x61,0x2a,0x5a,0x9,0x9c,0x88,0x64,0xfc,0x2,0xc9,0x26,0xfa,0x70,0x43,0x34,0x84, + 0xc0,0x65,0x44,0x16,0xcc,0x31,0xce,0x92,0x9a,0x5,0xbb,0xaa,0xf3,0xea,0xf3,0x3f, + 0x81,0xc,0xe0,0x86,0x72,0x6f,0x4a,0x1d,0x95,0x51,0x6d,0x8c,0x3a,0x9f,0x10,0x82, + 0xd7,0x18,0x33,0xe,0xa7,0xd0,0x71,0x45,0x8f,0x21,0x6b,0xe1,0x7b,0x43,0xda,0x7, + 0x42,0xd0,0x8,0xe0,0x32,0x6b,0x9d,0xae,0x8a,0xbe,0xdd,0x20,0xd,0x85,0x60,0xad, + 0x7d,0x81,0xc8,0x59,0x66,0x1d,0xe0,0x63,0x39,0xd5,0x9b,0x11,0x0,0x5d,0xc7,0xa1, + 0x82,0x8a,0x4e,0x97,0x3e,0x34,0x71,0xad,0x8b,0x28,0xa,0x77,0x39,0x5,0xbb,0x70, + 0x23,0xf3,0x71,0x72,0x9b,0x97,0x5b,0x68,0x30,0x51,0xa2,0xea,0x4b,0x67,0x8,0xc9, + 0x14,0xb0,0x80,0x2f,0xa8,0x7a,0xb5,0x33,0x89,0x54,0xa4,0x55,0x87,0x9a,0x5d,0x97, + 0x53,0xef,0x49,0xf5,0xac,0x6b,0x39,0xd8,0x96,0x21,0x4e,0xab,0x55,0xb7,0x4a,0x5c, + 0x3b,0x40,0x5d,0xcb,0xcd,0x29,0x84,0x4,0x6c,0xfc,0x39,0xf1,0xf2,0xbf,0x4f,0xc5, + 0x30,0xb1,0x0,0xba,0xb,0x8d,0x42,0x8e,0x81,0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x59,0xc1,0x18,0x33,0x1,0x51,0xe8,0xf8,0xbe,0x6e, + 0x47,0x74,0xfa,0x2d,0x53,0xaf,0xa6,0x40,0xea,0x8,0xe0,0x14,0x2a,0x67,0xab,0x6b, + 0x7d,0xfd,0xf5,0x7b,0x48,0x1d,0x5,0x8c,0x31,0x3,0x88,0x74,0x25,0xaf,0x59,0x6b, + 0x9f,0xab,0xdd,0x53,0x9,0x1,0x65,0x15,0x22,0x21,0xe9,0x21,0x57,0xa6,0x3,0x1e, + 0x1f,0x4f,0xd4,0x1f,0x4e,0x3c,0xc3,0x97,0x5,0x2e,0xa2,0xc5,0x3b,0x90,0x66,0xd0, + 0xbe,0xa3,0xa2,0xe1,0x7a,0x55,0xae,0x73,0xea,0x7,0x5,0x79,0xb6,0x89,0x5e,0xad, + 0x52,0x9f,0x83,0xdb,0x92,0x86,0xb8,0x71,0xeb,0x86,0x26,0xfa,0xa,0x1e,0x1,0xac, + 0x38,0x42,0xbe,0xe1,0xfe,0x8e,0x72,0xbf,0x63,0x54,0x95,0xb7,0xbf,0x7e,0x63,0xcc, + 0x16,0x88,0xb0,0xb7,0x9b,0x2b,0xea,0x46,0x92,0x41,0x9d,0x62,0xcb,0x85,0x52,0x35, + 0x5,0x59,0x32,0x80,0xe,0xf3,0xfa,0xae,0x75,0x4f,0xb9,0xaf,0xc1,0xc6,0xd,0x44, + 0xab,0x22,0x8c,0xa,0xd,0xf,0xff,0xbe,0xb3,0x32,0x9c,0xa9,0x1d,0x10,0xd6,0x40, + 0x72,0xe5,0x59,0xe4,0x5,0xaf,0xe5,0xea,0xec,0x47,0x94,0x9b,0xdf,0x22,0x4c,0x13, + 0x9c,0xd6,0xad,0x85,0x5f,0x55,0xcc,0x28,0x44,0x7c,0x6f,0xa4,0x52,0x41,0x9e,0x6d, + 0xa2,0x57,0xd3,0x37,0xc9,0x95,0x69,0x43,0xd9,0xae,0x8d,0xf4,0x53,0x92,0x28,0x9d, + 0x9b,0x47,0xfb,0xa3,0xdf,0xe2,0xae,0x27,0x37,0x53,0x7a,0x92,0x9a,0x91,0x2f,0xd, + 0x3e,0xd0,0xc9,0x8a,0xae,0xd,0x88,0xa7,0x86,0x69,0x4b,0x12,0xc7,0x92,0xf4,0x76, + 0x10,0x45,0x65,0xf5,0x20,0x72,0x97,0x4f,0x47,0xb7,0x84,0x86,0x36,0xef,0x2c,0x23, + 0x4,0x42,0x5c,0x10,0x3c,0x42,0x9d,0x5f,0x69,0x8c,0xf9,0x5,0xb2,0x8f,0x9e,0xc7, + 0x79,0x7,0x22,0xec,0x3d,0x43,0xff,0x0,0xbd,0x12,0x38,0x84,0x48,0x9f,0x5e,0x3a, + 0xc8,0xb3,0x1d,0x60,0x7b,0x1b,0x88,0x4e,0x41,0xf6,0x26,0x6,0x49,0x49,0xd3,0x6b, + 0xb5,0x55,0x5,0xea,0x30,0x80,0x5f,0x9e,0xcc,0x41,0xd4,0xa8,0xc7,0xab,0x6b,0x97, + 0x0,0xfb,0x5a,0x6b,0xdf,0xa4,0xff,0x80,0x96,0x3,0x4e,0x54,0xe7,0x55,0x83,0x3c, + 0xdb,0x1,0x31,0x3,0x91,0x2a,0x6f,0x66,0xfe,0xa7,0x3c,0x3,0x68,0x7f,0xc0,0xe, + 0xf5,0xfb,0x21,0x77,0xee,0xb7,0x54,0x3d,0xd9,0xb6,0x76,0x47,0x8c,0x52,0x60,0x8c, + 0x19,0x8c,0x38,0x5d,0x78,0x58,0xdf,0xfd,0xce,0x46,0xfc,0xfe,0xfb,0x25,0x58,0x59, + 0x2a,0x7b,0x5b,0xbf,0x7e,0xf6,0xc3,0xdd,0x12,0xb6,0x91,0x4e,0x42,0xe7,0xa4,0xb3, + 0x88,0x2f,0xe9,0x92,0xc7,0x1c,0xe0,0xa3,0x7d,0x3d,0x77,0x66,0xd0,0x7e,0x23,0x71, + 0xd9,0xc4,0x1f,0x8b,0x28,0x30,0x5c,0xf5,0x31,0xdd,0x7b,0x92,0xbe,0xbd,0x9c,0x5, + 0xce,0x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x3d,0x88,0x14,0x7d,0x7c, + 0x5f,0x3f,0xa8,0x0,0xda,0x57,0x44,0xe2,0x15,0x97,0xaa,0x7,0x39,0x5,0xd8,0xa8, + 0xaf,0x69,0xb,0xa0,0x7d,0x4f,0xe2,0xbb,0x93,0xbd,0x49,0x60,0x2a,0xf8,0x90,0x23, + 0x68,0x15,0xe0,0xc1,0x85,0x58,0xef,0xf,0x8c,0x46,0x94,0x42,0xb7,0x59,0x6b,0x5f, + 0xcc,0x6d,0xd4,0x8f,0xc0,0x18,0xd3,0x85,0x64,0x2c,0x9f,0x61,0xfb,0x97,0x92,0xaa, + 0x10,0x8c,0x31,0x23,0x11,0x46,0x7e,0xc1,0x96,0x79,0x69,0x45,0x78,0x1b,0xc4,0xf5, + 0x2e,0xfc,0xb,0xc2,0xff,0x3,0x27,0x66,0x5a,0x57,0xe3,0x95,0xc6,0xc3,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fileSave.png - 0x0,0x0,0x4,0xb5, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, - 0x0,0x0,0x4,0x7c,0x49,0x44,0x41,0x54,0x78,0x5e,0xb5,0x94,0xdd,0x6b,0x1c,0xd5, - 0x1f,0xc6,0x3f,0xe7,0x65,0x66,0x67,0x5f,0xf2,0x6e,0xd2,0xb4,0x69,0xc1,0x37,0xea, - 0xb,0xe2,0x4d,0xf4,0xce,0x4b,0xa1,0x88,0x82,0x48,0x41,0xe8,0x95,0x7a,0x21,0xbd, - 0xf4,0xc7,0xef,0xf,0xf0,0x46,0xf4,0x52,0xf0,0xd2,0x4b,0x11,0x5b,0x14,0x2d,0x8a, - 0x8a,0x42,0xac,0x28,0xc1,0x68,0x6d,0xda,0x9b,0x94,0x26,0x6d,0x9a,0xb6,0x49,0x37, - 0x4d,0x9a,0xee,0x6e,0x76,0x67,0x77,0x67,0x77,0x66,0x67,0xe6,0x38,0x3d,0x84,0xb0, - 0xa1,0x90,0x80,0xe0,0x3,0xcf,0xce,0x7e,0x99,0x99,0xe7,0xf3,0x3d,0xdf,0x39,0x33, - 0xc2,0x18,0xc3,0x7f,0x29,0xcd,0x8e,0xa6,0xa7,0x4f,0xbf,0x2,0xe6,0xd,0x30,0x47, - 0x8d,0x41,0xf2,0xef,0x24,0x8d,0x49,0x56,0xe2,0xb8,0xfb,0xcb,0x95,0x2b,0x67,0x7f, - 0x4,0x22,0xcd,0xae,0xcc,0x9b,0xef,0x7d,0xf4,0xbf,0x93,0x7a,0xf8,0x91,0xfc,0xc5, - 0xb9,0x59,0xb9,0xf0,0xd7,0x8c,0xe8,0x76,0x9a,0x42,0x22,0x11,0x2,0x84,0xfd,0x1, - 0x29,0x44,0xdf,0x7f,0x89,0x76,0x5d,0xa6,0x9e,0x78,0x96,0x27,0x5f,0x3c,0xc1,0xf8, - 0xe4,0x61,0xe6,0x67,0xe7,0x5e,0x9a,0xfb,0xec,0x8b,0xe3,0xc0,0x25,0xe0,0x5e,0x1f, - 0x80,0xe3,0xce,0xf0,0x98,0xf7,0x6b,0x59,0xe9,0xaf,0xbf,0x3c,0xc7,0x7,0xef,0xbe, - 0xca,0xe3,0x47,0x27,0x91,0x52,0x62,0x0,0x23,0x52,0x24,0xc2,0xd6,0x2,0x1,0x18, - 0xa4,0x52,0xd8,0xda,0x29,0x70,0xe6,0xd2,0x26,0xdf,0x2e,0x6b,0xf4,0x1f,0x3f,0x68, - 0xe0,0x8,0x30,0x5,0x34,0x76,0x1,0xc6,0x98,0x66,0xa5,0xea,0xa7,0x37,0x36,0xf3, - 0xd4,0xb7,0x7d,0x6,0x3d,0x45,0xc1,0x15,0xf4,0xe2,0x8,0x0,0x89,0x44,0x6b,0x9d, - 0x59,0xd9,0x15,0xf4,0x7a,0x11,0x69,0x9a,0x20,0x52,0x81,0xe7,0x2a,0xa2,0xc5,0x9f, - 0xf1,0x7,0x5e,0x63,0x20,0x8c,0x93,0x24,0xe9,0x45,0x40,0x1,0x50,0x9a,0x3e,0x49, - 0x9,0x45,0x47,0xda,0x80,0xd2,0xe0,0x10,0x85,0x62,0x91,0x38,0x8e,0xc9,0xee,0xb0, - 0xa1,0x4a,0xd9,0x70,0xeb,0x9d,0xee,0xf1,0x3c,0x8f,0x52,0x69,0x80,0xe9,0x97,0x4f, - 0x72,0xfd,0x5a,0x1e,0x29,0x15,0x20,0x0,0xc,0x40,0x3f,0xc0,0x86,0x68,0x47,0xa2, - 0xa4,0x60,0x28,0x3,0xc,0xf,0xf,0x13,0x86,0x21,0xbd,0x5e,0x6f,0x17,0xb2,0x23, - 0x5b,0x67,0xa6,0xdd,0x6e,0x13,0x85,0x21,0xc5,0xe1,0x49,0xf2,0xf9,0x88,0x68,0xf7, - 0x9a,0x87,0x1,0x68,0x21,0xc8,0x69,0x89,0x56,0x92,0x7a,0xbd,0xce,0x60,0xc1,0xf2, - 0x6d,0xe7,0xae,0xeb,0xda,0x11,0x29,0xdb,0xb9,0x5d,0xa5,0xad,0x9d,0xcc,0xf9,0x42, - 0x9e,0xdb,0xab,0xa,0xcf,0xa9,0xd3,0x13,0x86,0x7e,0xed,0x1d,0x91,0x10,0xb8,0x8e, - 0x44,0x1a,0xc3,0xc4,0xe4,0x4,0x47,0xa6,0xe,0x13,0xf7,0x7a,0x76,0x4c,0x3b,0xb2, - 0xe1,0x80,0x5d,0x55,0xa7,0xd3,0x21,0x30,0x86,0x7a,0x7d,0x9b,0x38,0x1c,0xa3,0xe0, - 0x28,0xda,0x42,0xec,0x3,0x90,0x90,0xd7,0x12,0xc7,0x73,0x9,0x3b,0x1d,0x3a,0x41, - 0x60,0x3b,0xf4,0xbc,0x1c,0x8e,0xe3,0xe2,0x68,0x85,0xd2,0x1a,0x21,0xec,0x18,0x11, - 0x52,0x61,0x57,0xe7,0x68,0x5a,0xb7,0x23,0xf2,0x2b,0x15,0x84,0xdc,0x7,0xa0,0xa5, - 0x24,0xa7,0x5,0x3,0x87,0x9f,0xe6,0xa9,0x67,0x9e,0xe3,0xd8,0xc4,0x10,0x8,0x30, - 0x69,0x4a,0x6a,0xc8,0x6c,0x48,0x52,0xe8,0x25,0x86,0x4e,0x2,0x61,0x4,0x51,0x22, - 0x41,0xc0,0x76,0xd7,0x90,0x77,0x25,0x12,0xf6,0x1,0x8,0x70,0x94,0xe1,0xd1,0x17, - 0x4e,0x30,0x73,0x4b,0xf0,0x58,0x60,0xb2,0x5a,0xd2,0x89,0x15,0x9d,0x28,0xa5,0x19, - 0x26,0x4,0x9d,0x88,0x7a,0xab,0x8b,0xdf,0x6c,0x53,0x6f,0x36,0x69,0x36,0x7c,0x8c, - 0x72,0xd0,0x3,0x87,0xc8,0xe5,0x73,0x28,0x79,0xc0,0x88,0x72,0xa,0x26,0x8e,0x4c, - 0xf1,0xe9,0xf7,0xf3,0xe4,0x13,0x1f,0x11,0xb5,0xe9,0x76,0x3,0xa2,0x4e,0x40,0x1a, - 0x77,0x51,0x26,0xc6,0x73,0x4,0x43,0xc5,0x1c,0x23,0x25,0x8f,0xb1,0x91,0x12,0x13, - 0x13,0x87,0xa8,0xb9,0x63,0x24,0xba,0x80,0x14,0xfb,0xac,0x40,0x9,0x41,0x21,0xe7, - 0xd2,0xb8,0x35,0xcf,0xf3,0x4e,0x8d,0x63,0x53,0xc3,0x94,0xbc,0x7c,0x16,0x36,0x42, - 0x31,0x27,0x19,0x1d,0x2c,0x32,0x92,0xb9,0x54,0x2c,0xe0,0xe5,0x5c,0x94,0x94,0x44, - 0x71,0x4c,0xd0,0x6a,0x72,0xd9,0x77,0xb9,0x19,0x68,0x84,0xdc,0x6f,0x44,0x4a,0x90, - 0x73,0x35,0x7e,0xf9,0x1a,0xa7,0xff,0xff,0x3a,0xbf,0xcd,0xfc,0xc4,0xd6,0x5a,0x85, - 0xbb,0x71,0xc2,0xa9,0x53,0xa7,0x30,0xc6,0x90,0xcb,0x39,0x28,0x25,0x31,0x40,0x62, - 0xc0,0xa4,0x86,0x14,0x41,0xc9,0x53,0x14,0x13,0xbd,0xff,0x33,0x10,0x2,0x3c,0x47, - 0xe2,0x3a,0x8e,0xdd,0x2d,0x8b,0x4b,0x4b,0xf6,0x65,0x1b,0x1f,0x1f,0x27,0x4d,0x53, - 0x80,0xec,0x68,0x76,0x2d,0xa5,0xc1,0x60,0x65,0x77,0x58,0xde,0xd3,0x64,0x70,0x91, - 0x69,0x97,0xb3,0x7,0xa8,0xa4,0xc8,0x0,0x1a,0x2f,0xe7,0xd0,0x9,0x7b,0x94,0x4a, - 0x25,0xc6,0xc6,0xc6,0x18,0x1d,0x1d,0xb5,0x80,0xfd,0x94,0x73,0x14,0x3d,0x7f,0x83, - 0x34,0xa,0x30,0x26,0x8d,0x1,0xf1,0x10,0x40,0x4b,0x81,0xa3,0x1e,0x58,0xee,0x7c, - 0x96,0xad,0x39,0x50,0x42,0xa2,0xe2,0x36,0xcb,0xb3,0xdf,0x98,0xca,0x7a,0x54,0xad, - 0xd7,0x6f,0xfd,0xe,0x74,0x81,0x64,0xf,0x40,0xa,0x70,0x1d,0x81,0x94,0x80,0x31, - 0x1c,0x20,0xb,0xd7,0x5a,0xd9,0xe7,0x12,0x6c,0x5d,0x63,0xe5,0xf2,0xed,0xee,0x8d, - 0xeb,0x17,0x3e,0x5f,0x5f,0xff,0xfb,0x3c,0xb0,0x5,0x74,0xf7,0xee,0x22,0xad,0x18, - 0x2a,0x91,0x8d,0x65,0x14,0x37,0xe7,0xda,0xf,0x5d,0x16,0x62,0xdf,0x64,0xa5,0x4, - 0xae,0xab,0xb3,0x30,0x3b,0x67,0x82,0x20,0x34,0xf5,0x7a,0xc0,0xfd,0xfb,0xd,0x6a, - 0xb5,0x16,0xeb,0xeb,0x95,0xf6,0xca,0xd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60,0x82, + 0x0,0x0,0x4,0xb5, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x4,0x7c,0x49,0x44,0x41,0x54,0x78,0x5e,0xb5,0x94,0xdd,0x6b,0x1c,0xd5, + 0x1f,0xc6,0x3f,0xe7,0x65,0x66,0x67,0x5f,0xf2,0x6e,0xd2,0xb4,0x69,0xc1,0x37,0xea, + 0xb,0xe2,0x4d,0xf4,0xce,0x4b,0xa1,0x88,0x82,0x48,0x41,0xe8,0x95,0x7a,0x21,0xbd, + 0xf4,0xc7,0xef,0xf,0xf0,0x46,0xf4,0x52,0xf0,0xd2,0x4b,0x11,0x5b,0x14,0x2d,0x8a, + 0x8a,0x42,0xac,0x28,0xc1,0x68,0x6d,0xda,0x9b,0x94,0x26,0x6d,0x9a,0xb6,0x49,0x37, + 0x4d,0x9a,0xee,0x6e,0x76,0x67,0x77,0x67,0x77,0x66,0x67,0xe6,0x38,0x3d,0x84,0xb0, + 0xa1,0x90,0x80,0xe0,0x3,0xcf,0xce,0x7e,0x99,0x99,0xe7,0xf3,0x3d,0xdf,0x39,0x33, + 0xc2,0x18,0xc3,0x7f,0x29,0xcd,0x8e,0xa6,0xa7,0x4f,0xbf,0x2,0xe6,0xd,0x30,0x47, + 0x8d,0x41,0xf2,0xef,0x24,0x8d,0x49,0x56,0xe2,0xb8,0xfb,0xcb,0x95,0x2b,0x67,0x7f, + 0x4,0x22,0xcd,0xae,0xcc,0x9b,0xef,0x7d,0xf4,0xbf,0x93,0x7a,0xf8,0x91,0xfc,0xc5, + 0xb9,0x59,0xb9,0xf0,0xd7,0x8c,0xe8,0x76,0x9a,0x42,0x22,0x11,0x2,0x84,0xfd,0x1, + 0x29,0x44,0xdf,0x7f,0x89,0x76,0x5d,0xa6,0x9e,0x78,0x96,0x27,0x5f,0x3c,0xc1,0xf8, + 0xe4,0x61,0xe6,0x67,0xe7,0x5e,0x9a,0xfb,0xec,0x8b,0xe3,0xc0,0x25,0xe0,0x5e,0x1f, + 0x80,0xe3,0xce,0xf0,0x98,0xf7,0x6b,0x59,0xe9,0xaf,0xbf,0x3c,0xc7,0x7,0xef,0xbe, + 0xca,0xe3,0x47,0x27,0x91,0x52,0x62,0x0,0x23,0x52,0x24,0xc2,0xd6,0x2,0x1,0x18, + 0xa4,0x52,0xd8,0xda,0x29,0x70,0xe6,0xd2,0x26,0xdf,0x2e,0x6b,0xf4,0x1f,0x3f,0x68, + 0xe0,0x8,0x30,0x5,0x34,0x76,0x1,0xc6,0x98,0x66,0xa5,0xea,0xa7,0x37,0x36,0xf3, + 0xd4,0xb7,0x7d,0x6,0x3d,0x45,0xc1,0x15,0xf4,0xe2,0x8,0x0,0x89,0x44,0x6b,0x9d, + 0x59,0xd9,0x15,0xf4,0x7a,0x11,0x69,0x9a,0x20,0x52,0x81,0xe7,0x2a,0xa2,0xc5,0x9f, + 0xf1,0x7,0x5e,0x63,0x20,0x8c,0x93,0x24,0xe9,0x45,0x40,0x1,0x50,0x9a,0x3e,0x49, + 0x9,0x45,0x47,0xda,0x80,0xd2,0xe0,0x10,0x85,0x62,0x91,0x38,0x8e,0xc9,0xee,0xb0, + 0xa1,0x4a,0xd9,0x70,0xeb,0x9d,0xee,0xf1,0x3c,0x8f,0x52,0x69,0x80,0xe9,0x97,0x4f, + 0x72,0xfd,0x5a,0x1e,0x29,0x15,0x20,0x0,0xc,0x40,0x3f,0xc0,0x86,0x68,0x47,0xa2, + 0xa4,0x60,0x28,0x3,0xc,0xf,0xf,0x13,0x86,0x21,0xbd,0x5e,0x6f,0x17,0xb2,0x23, + 0x5b,0x67,0xa6,0xdd,0x6e,0x13,0x85,0x21,0xc5,0xe1,0x49,0xf2,0xf9,0x88,0x68,0xf7, + 0x9a,0x87,0x1,0x68,0x21,0xc8,0x69,0x89,0x56,0x92,0x7a,0xbd,0xce,0x60,0xc1,0xf2, + 0x6d,0xe7,0xae,0xeb,0xda,0x11,0x29,0xdb,0xb9,0x5d,0xa5,0xad,0x9d,0xcc,0xf9,0x42, + 0x9e,0xdb,0xab,0xa,0xcf,0xa9,0xd3,0x13,0x86,0x7e,0xed,0x1d,0x91,0x10,0xb8,0x8e, + 0x44,0x1a,0xc3,0xc4,0xe4,0x4,0x47,0xa6,0xe,0x13,0xf7,0x7a,0x76,0x4c,0x3b,0xb2, + 0xe1,0x80,0x5d,0x55,0xa7,0xd3,0x21,0x30,0x86,0x7a,0x7d,0x9b,0x38,0x1c,0xa3,0xe0, + 0x28,0xda,0x42,0xec,0x3,0x90,0x90,0xd7,0x12,0xc7,0x73,0x9,0x3b,0x1d,0x3a,0x41, + 0x60,0x3b,0xf4,0xbc,0x1c,0x8e,0xe3,0xe2,0x68,0x85,0xd2,0x1a,0x21,0xec,0x18,0x11, + 0x52,0x61,0x57,0xe7,0x68,0x5a,0xb7,0x23,0xf2,0x2b,0x15,0x84,0xdc,0x7,0xa0,0xa5, + 0x24,0xa7,0x5,0x3,0x87,0x9f,0xe6,0xa9,0x67,0x9e,0xe3,0xd8,0xc4,0x10,0x8,0x30, + 0x69,0x4a,0x6a,0xc8,0x6c,0x48,0x52,0xe8,0x25,0x86,0x4e,0x2,0x61,0x4,0x51,0x22, + 0x41,0xc0,0x76,0xd7,0x90,0x77,0x25,0x12,0xf6,0x1,0x8,0x70,0x94,0xe1,0xd1,0x17, + 0x4e,0x30,0x73,0x4b,0xf0,0x58,0x60,0xb2,0x5a,0xd2,0x89,0x15,0x9d,0x28,0xa5,0x19, + 0x26,0x4,0x9d,0x88,0x7a,0xab,0x8b,0xdf,0x6c,0x53,0x6f,0x36,0x69,0x36,0x7c,0x8c, + 0x72,0xd0,0x3,0x87,0xc8,0xe5,0x73,0x28,0x79,0xc0,0x88,0x72,0xa,0x26,0x8e,0x4c, + 0xf1,0xe9,0xf7,0xf3,0xe4,0x13,0x1f,0x11,0xb5,0xe9,0x76,0x3,0xa2,0x4e,0x40,0x1a, + 0x77,0x51,0x26,0xc6,0x73,0x4,0x43,0xc5,0x1c,0x23,0x25,0x8f,0xb1,0x91,0x12,0x13, + 0x13,0x87,0xa8,0xb9,0x63,0x24,0xba,0x80,0x14,0xfb,0xac,0x40,0x9,0x41,0x21,0xe7, + 0xd2,0xb8,0x35,0xcf,0xf3,0x4e,0x8d,0x63,0x53,0xc3,0x94,0xbc,0x7c,0x16,0x36,0x42, + 0x31,0x27,0x19,0x1d,0x2c,0x32,0x92,0xb9,0x54,0x2c,0xe0,0xe5,0x5c,0x94,0x94,0x44, + 0x71,0x4c,0xd0,0x6a,0x72,0xd9,0x77,0xb9,0x19,0x68,0x84,0xdc,0x6f,0x44,0x4a,0x90, + 0x73,0x35,0x7e,0xf9,0x1a,0xa7,0xff,0xff,0x3a,0xbf,0xcd,0xfc,0xc4,0xd6,0x5a,0x85, + 0xbb,0x71,0xc2,0xa9,0x53,0xa7,0x30,0xc6,0x90,0xcb,0x39,0x28,0x25,0x31,0x40,0x62, + 0xc0,0xa4,0x86,0x14,0x41,0xc9,0x53,0x14,0x13,0xbd,0xff,0x33,0x10,0x2,0x3c,0x47, + 0xe2,0x3a,0x8e,0xdd,0x2d,0x8b,0x4b,0x4b,0xf6,0x65,0x1b,0x1f,0x1f,0x27,0x4d,0x53, + 0x80,0xec,0x68,0x76,0x2d,0xa5,0xc1,0x60,0x65,0x77,0x58,0xde,0xd3,0x64,0x70,0x91, + 0x69,0x97,0xb3,0x7,0xa8,0xa4,0xc8,0x0,0x1a,0x2f,0xe7,0xd0,0x9,0x7b,0x94,0x4a, + 0x25,0xc6,0xc6,0xc6,0x18,0x1d,0x1d,0xb5,0x80,0xfd,0x94,0x73,0x14,0x3d,0x7f,0x83, + 0x34,0xa,0x30,0x26,0x8d,0x1,0xf1,0x10,0x40,0x4b,0x81,0xa3,0x1e,0x58,0xee,0x7c, + 0x96,0xad,0x39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,0xef,0xd6, + 0x80,0x2e,0xd0,0x1,0x82,0x3e,0xb7,0x80,0x26,0x10,0x98,0x4c,0x7b,0xb6,0x69,0x1c, + 0x77,0xbe,0xfa,0xe4,0xfd,0x8f,0x37,0x21,0x74,0xc3,0xde,0x76,0x65,0xf9,0xea,0xec, + 0xc6,0xf6,0xf6,0xea,0x5d,0x63,0xd2,0x10,0xe8,0xf4,0x39,0xb0,0xb5,0x5,0xd0,0xeb, + 0x73,0x4c,0x66,0x1b,0xbc,0xab,0x3e,0xc0,0xc2,0xc2,0x99,0xef,0x80,0x3f,0x81,0x11, + 0x40,0x0,0x36,0x78,0xe7,0x18,0x1,0x71,0x7f,0x98,0xc9,0xc8,0x1c,0x2c,0xfe,0x1, + 0xd1,0x4f,0xf,0x88,0x96,0x78,0xff,0x51,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/Voronoi_diagram_2.png - 0x0,0x0,0xc,0x15, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x54,0x0,0x0,0x0,0x53,0x10,0x6,0x0,0x0,0x0,0x51,0xfe,0xfc,0x3a, - 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0xff,0xff,0xff,0xff,0xff,0xff,0x9,0x58, - 0xf7,0xdc,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc4,0x0,0x0, - 0xe,0xc4,0x1,0x95,0x2b,0xe,0x1b,0x0,0x0,0x0,0x9,0x76,0x70,0x41,0x67,0x0, - 0x0,0x0,0x54,0x0,0x0,0x0,0x53,0x0,0x13,0x5b,0xf9,0x7f,0x0,0x0,0xb,0xa0, - 0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x5d,0x5b,0x48,0x55,0x41,0x17,0x1e,0x6f,0x59, - 0xde,0xd2,0xb0,0x52,0xd4,0xd2,0xb4,0xc0,0x17,0xbb,0x79,0xeb,0xe6,0x83,0x22,0x15, - 0x69,0x11,0x14,0xa,0x52,0x9a,0x8a,0x68,0x11,0x51,0x20,0x6,0xda,0x83,0x17,0x7a, - 0x50,0x10,0x15,0x12,0x84,0xd4,0x4a,0x45,0x22,0x12,0x3,0xb1,0x32,0x43,0x14,0xb, - 0xd4,0x34,0xa3,0xe8,0x46,0xa9,0xa5,0x68,0xe6,0x15,0xf3,0x92,0x9a,0xae,0xff,0x61, - 0xfe,0xf5,0xf,0x9c,0xf3,0x1f,0xce,0xc5,0x7d,0xf6,0xec,0x73,0x9c,0xef,0xe5,0x63, - 0x9f,0xa3,0x67,0xd6,0xde,0xf3,0xed,0x35,0xb3,0x66,0xd6,0xcc,0x58,0x0,0x0,0x0, - 0x10,0x1,0x1,0x45,0xc2,0x92,0xb7,0x1,0x4a,0xc7,0xcc,0xcc,0xcc,0xcc,0xcc,0xc, - 0xc0,0xf8,0xf8,0xf8,0xf8,0xf8,0xb8,0x78,0x95,0xe5,0x86,0x10,0xa8,0x6,0x14,0x16, - 0x16,0x16,0x16,0x16,0x2,0x6c,0xde,0xbc,0x79,0xf3,0xe6,0xcd,0x84,0x14,0x14,0x14, - 0x14,0x14,0x14,0xf0,0xb6,0x6a,0xfd,0x41,0x8,0x54,0x3,0x7c,0x7c,0x7c,0x7c,0x7c, - 0x7c,0xd8,0x75,0x77,0x77,0x77,0x77,0x77,0x37,0x6f,0xab,0xd6,0x1f,0x2c,0x44,0x1f, - 0xf4,0xff,0xe3,0xe7,0xcf,0x9f,0x3f,0x7f,0xfe,0x4,0xd8,0xb9,0x73,0xe7,0xce,0x9d, - 0x3b,0x9,0x71,0x71,0x71,0x71,0x71,0x71,0x21,0x64,0x62,0x62,0x62,0x62,0x62,0x82, - 0x10,0x8b,0xff,0x82,0xb7,0x9d,0xe6,0xe,0xe1,0x41,0x35,0xc0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xcf,0x9f,0x67,0x82,0xa2,0x3,0xf3,0x0,0x5f,0xbe,0x7c,0xf9, - 0xf2,0xe5,0xb,0x80,0xbe,0xbf,0x2b,0x3c,0xab,0x61,0xcc,0xdd,0x0,0xa5,0x30,0x76, - 0x1d,0x92,0x92,0x92,0x92,0x92,0x92,0x98,0x70,0xe8,0xde,0x4c,0x0,0x74,0x54,0x0, - 0x60,0xad,0xe5,0x8,0xcf,0xaa,0x1f,0x73,0x37,0x80,0x37,0xa3,0x30,0x6f,0xdc,0xb8, - 0x71,0xe3,0xc6,0xd,0x26,0x14,0x3b,0x3b,0x3b,0x3b,0x3b,0x3b,0x80,0x57,0xaf,0x5e, - 0xbd,0x7a,0xf5,0xa,0xc0,0x58,0xe5,0x6b,0xf3,0xac,0x89,0x89,0x89,0x89,0x89,0x89, - 0xeb,0xd7,0xb3,0x72,0x37,0x80,0x37,0xe7,0xe6,0xe6,0xe6,0xe6,0xe6,0x32,0x41,0x6c, - 0xd8,0xb0,0x61,0xc3,0x86,0xd,0x0,0x4d,0x4d,0x4d,0x4d,0x4d,0x4d,0xf2,0x9,0x42, - 0x57,0xcf,0xfa,0xf4,0xe9,0xd3,0xa7,0x4f,0x9f,0xca,0x67,0x17,0x6f,0xe6,0x6e,0x0, - 0x2f,0x2e,0x29,0x29,0x29,0x29,0x29,0x61,0x2,0xa0,0x3,0xee,0x0,0x8f,0x1f,0x3f, - 0x7e,0xfc,0xf8,0x31,0x7f,0x1,0xe8,0xea,0x59,0x71,0xf8,0x8b,0xb7,0xbd,0xc6,0x62, - 0xee,0x6,0xc8,0xcd,0x98,0x81,0xae,0x5a,0xe1,0x95,0x95,0x95,0x95,0x95,0x95,0xca, - 0xab,0x68,0x6d,0x9e,0x95,0x2e,0x45,0x1,0x78,0xf6,0xec,0xd9,0xb3,0x67,0xcf,0x94, - 0x67,0xff,0x5a,0x99,0xbb,0x1,0x72,0x71,0x5d,0x5d,0x5d,0x5d,0x5d,0x1d,0xf3,0x94, - 0x58,0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,0x6b,0x11,0x12,0x14,0x14,0x14,0x14,0x14,0xb4, - 0x76,0xf,0x8a,0x8f,0x2e,0x25,0x25,0x25,0x25,0x25,0x85,0x90,0x87,0xf,0x1f,0x3e, - 0x7c,0xf8,0x90,0x25,0x2e,0x63,0x86,0x3d,0x2e,0x62,0xbb,0x73,0xe7,0xce,0x9d,0x3b, - 0x77,0xf8,0x2d,0x62,0xc3,0x96,0xb1,0xb8,0xb8,0xb8,0xb8,0xb8,0x18,0xd7,0x52,0x11, - 0xb2,0xb0,0xb0,0xb0,0xb0,0xb0,0xc0,0xb6,0xf2,0xa1,0xa3,0x1a,0x84,0x1c,0x39,0x72, - 0xe4,0xc8,0x91,0x23,0x84,0xd0,0x17,0x9d,0x10,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0xfd, - 0xaf,0xe9,0x73,0x90,0xe0,0xbe,0x79,0xbf,0xd1,0x52,0x31,0x6d,0x52,0x1,0xa2,0xa2, - 0xa2,0xa2,0xa2,0xa2,0xd4,0x83,0x96,0x96,0x96,0x96,0x96,0x96,0x16,0xe9,0x3d,0x99, - 0x52,0x17,0xb1,0xd1,0x25,0x31,0x9a,0xfb,0x9e,0x71,0x71,0x71,0x71,0x71,0x71,0x0, - 0xb8,0x42,0x80,0xb7,0xbd,0x9a,0x98,0xbb,0x1,0x52,0x33,0x36,0x11,0xb1,0xb1,0xb1, - 0xb1,0xb1,0xb1,0xac,0x42,0x36,0x6e,0xdc,0xb8,0x71,0xe3,0x46,0x0,0xba,0x46,0x49, - 0xb9,0x15,0x62,0x28,0x63,0xfe,0x6a,0x4e,0x4e,0x4e,0x4e,0x4e,0xe,0x0,0xf5,0x64, - 0xec,0xfe,0x71,0x2e,0xdf,0xd4,0xee,0x9f,0xbb,0x1,0xc6,0x62,0x8c,0xda,0x69,0x53, - 0xcc,0x2a,0xca,0xda,0xda,0xda,0xda,0xda,0x1a,0xa0,0xb6,0xb6,0xb6,0xb6,0xb6,0xd6, - 0x74,0x2a,0x4a,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6,0xd6,0xd6,0xd6,0xd6,0x56,0xe6,0x39,0xe9,0x8b,0x1,0x60,0xac,0xf2,0x78,0x8f, - 0x5e,0xf0,0x62,0x93,0xeb,0x83,0x2a,0x5,0x74,0x0,0x9f,0x5d,0x53,0x8f,0x6d,0xbc, - 0xf2,0x94,0x72,0xba,0x89,0xdc,0x10,0x2,0x35,0x10,0xb4,0xaf,0xc9,0xae,0xb1,0x6b, - 0x61,0x2c,0x28,0x65,0xf4,0x42,0x6e,0x8,0x81,0x1a,0x8,0xb9,0x3d,0xa8,0xd2,0x46, - 0x2f,0x64,0x3,0xef,0x3e,0x86,0xa9,0x31,0x2e,0xb9,0xc0,0xfc,0x4c,0xcc,0x23,0x35, - 0x76,0x26,0xbb,0xd2,0x46,0x2f,0xe4,0x62,0xee,0x6,0x98,0x1a,0x77,0x74,0x74,0x74, - 0x74,0x74,0xb0,0xe0,0x4,0x33,0xdb,0xe5,0xb6,0x43,0xa9,0xcb,0x9d,0xa5,0x66,0xeb, - 0x35,0xb9,0xdf,0x75,0x8,0xb9,0xfb,0x9e,0x9a,0x40,0xcf,0xad,0xb7,0xb0,0x50,0x3d, - 0xbf,0xde,0xdc,0x20,0xfa,0xa0,0x7a,0x42,0xee,0xbe,0xe7,0x7a,0x87,0x10,0xa8,0x9e, - 0x50,0x8a,0x7,0x5d,0x2f,0x30,0xf9,0x99,0x24,0xb9,0x80,0x3,0xe5,0x34,0x18,0xc1, - 0x9d,0x3c,0x58,0x92,0x88,0x8b,0x8b,0x8b,0x8b,0x8b,0x8b,0x19,0xcc,0xdc,0x28,0xc, - 0xc2,0x83,0xea,0x8,0x1c,0x57,0x44,0x61,0xfa,0xf8,0xf8,0xf8,0xf8,0xf8,0x8,0x61, - 0x1a,0x1b,0x42,0xa0,0x3a,0x42,0xb5,0xef,0x29,0x9a,0x76,0x79,0x20,0x4,0xaa,0x23, - 0x44,0x70,0xc4,0x7,0x42,0xa0,0x3a,0x42,0x4,0x47,0x7c,0x20,0x82,0x24,0x2d,0xc0, - 0x19,0x1c,0x4c,0xab,0xc3,0xa4,0x8c,0x91,0x91,0x91,0x91,0x91,0x11,0x42,0xe8,0x5a, - 0x24,0xd1,0x7,0x35,0x16,0x84,0x7,0xd5,0x82,0xef,0xdf,0xbf,0x7f,0xff,0xfe,0x9d, - 0x9,0x93,0x2e,0xf5,0x10,0xc2,0x94,0xb,0x42,0xa0,0x5a,0x20,0xfa,0x9e,0x7c,0x21, - 0x4,0xaa,0x5,0xa2,0xef,0xc9,0x17,0x42,0xa0,0x5a,0x20,0x3c,0x28,0x5f,0x8,0x81, - 0x6a,0x0,0xe6,0x5,0x9,0xf,0xca,0x17,0x22,0x9b,0x49,0x3,0xfe,0xfc,0xf9,0xf3, - 0xe7,0xcf,0x1f,0x42,0xe8,0x96,0xda,0x6c,0x51,0x1c,0x3d,0xd7,0x87,0xb7,0x75,0xeb, - 0x7,0x62,0x98,0x49,0x47,0xe0,0x70,0x93,0x64,0xe7,0xff,0x8,0xe8,0x84,0xff,0x0, - 0xb9,0x51,0x21,0x7f,0x86,0x16,0xa7,0xbb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, - 0xae,0x42,0x60,0x82, + 0x0,0x0,0xc,0x15, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x54,0x0,0x0,0x0,0x53,0x10,0x6,0x0,0x0,0x0,0x51,0xfe,0xfc,0x3a, + 0x0,0x0,0x0,0x6,0x62,0x4b,0x47,0x44,0xff,0xff,0xff,0xff,0xff,0xff,0x9,0x58, + 0xf7,0xdc,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xe,0xc4,0x0,0x0, + 0xe,0xc4,0x1,0x95,0x2b,0xe,0x1b,0x0,0x0,0x0,0x9,0x76,0x70,0x41,0x67,0x0, + 0x0,0x0,0x54,0x0,0x0,0x0,0x53,0x0,0x13,0x5b,0xf9,0x7f,0x0,0x0,0xb,0xa0, + 0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x5d,0x5b,0x48,0x55,0x41,0x17,0x1e,0x6f,0x59, + 0xde,0xd2,0xb0,0x52,0xd4,0xd2,0xb4,0xc0,0x17,0xbb,0x79,0xeb,0xe6,0x83,0x22,0x15, + 0x69,0x11,0x14,0xa,0x52,0x9a,0x8a,0x68,0x11,0x51,0x20,0x6,0xda,0x83,0x17,0x7a, + 0x50,0x10,0x15,0x12,0x84,0xd4,0x4a,0x45,0x22,0x12,0x3,0xb1,0x32,0x43,0x14,0xb, + 0xd4,0x34,0xa3,0xe8,0x46,0xa9,0xa5,0x68,0xe6,0x15,0xf3,0x92,0x9a,0xae,0xff,0x61, + 0xfe,0xf5,0xf,0x9c,0xf3,0x1f,0xce,0xc5,0x7d,0xf6,0xec,0x73,0x9c,0xef,0xe5,0x63, + 0x9f,0xa3,0x67,0xd6,0xde,0xf3,0xed,0x35,0xb3,0x66,0xd6,0xcc,0x58,0x0,0x0,0x0, + 0x10,0x1,0x1,0x45,0xc2,0x92,0xb7,0x1,0x4a,0xc7,0xcc,0xcc,0xcc,0xcc,0xcc,0xc, + 0xc0,0xf8,0xf8,0xf8,0xf8,0xf8,0xb8,0x78,0x95,0xe5,0x86,0x10,0xa8,0x6,0x14,0x16, + 0x16,0x16,0x16,0x16,0x2,0x6c,0xde,0xbc,0x79,0xf3,0xe6,0xcd,0x84,0x14,0x14,0x14, + 0x14,0x14,0x14,0xf0,0xb6,0x6a,0xfd,0x41,0x8,0x54,0x3,0x7c,0x7c,0x7c,0x7c,0x7c, + 0x7c,0xd8,0x75,0x77,0x77,0x77,0x77,0x77,0x37,0x6f,0xab,0xd6,0x1f,0x2c,0x44,0x1f, + 0xf4,0xff,0xe3,0xe7,0xcf,0x9f,0x3f,0x7f,0xfe,0x4,0xd8,0xb9,0x73,0xe7,0xce,0x9d, + 0x3b,0x9,0x71,0x71,0x71,0x71,0x71,0x71,0x21,0x64,0x62,0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35,0x35,0x35,0x35,0x35,0x6c,0xf1,0xda,0x96,0x2d, + 0x5b,0xb6,0x6c,0xd9,0x42,0x8,0xed,0x6b,0x11,0x12,0x14,0x14,0x14,0x14,0x14,0xb4, + 0x76,0xf,0x8a,0x8f,0x2e,0x25,0x25,0x25,0x25,0x25,0x85,0x90,0x87,0xf,0x1f,0x3e, + 0x7c,0xf8,0x90,0x25,0x2e,0x63,0x86,0x3d,0x2e,0x62,0xbb,0x73,0xe7,0xce,0x9d,0x3b, + 0x77,0xf8,0x2d,0x62,0xc3,0x96,0xb1,0xb8,0xb8,0xb8,0xb8,0xb8,0x18,0xd7,0x52,0x11, + 0xb2,0xb0,0xb0,0xb0,0xb0,0xb0,0xc0,0xb6,0xf2,0xa1,0xa3,0x1a,0x84,0x1c,0x39,0x72, + 0xe4,0xc8,0x91,0x23,0x84,0xd0,0x17,0x9d,0x10,0x1b,0x1b,0x1b,0x1b,0x1b,0x1b,0xfd, + 0xaf,0xe9,0x73,0x90,0xe0,0xbe,0x79,0xbf,0xd1,0x52,0x31,0x6d,0x52,0x1,0xa2,0xa2, + 0xa2,0xa2,0xa2,0xa2,0xd4,0x83,0x96,0x96,0x96,0x96,0x96,0x96,0x16,0xe9,0x3d,0x99, + 0x52,0x17,0xb1,0xd1,0x25,0x31,0x9a,0xfb,0x9e,0x71,0x71,0x71,0x71,0x71,0x71,0x0, + 0xb8,0x42,0x80,0xb7,0xbd,0x9a,0x98,0xbb,0x1,0x52,0x33,0x36,0x11,0xb1,0xb1,0xb1, + 0xb1,0xb1,0xb1,0xac,0x42,0x36,0x6e,0xdc,0xb8,0x71,0xe3,0x46,0x0,0xba,0x46,0x49, + 0xb9,0x15,0x62,0x28,0x63,0xfe,0x6a,0x4e,0x4e,0x4e,0x4e,0x4e,0xe,0x0,0xf5,0x64, + 0xec,0xfe,0x71,0x2e,0xdf,0xd4,0xee,0x9f,0xbb,0x1,0xc6,0x62,0x8c,0xda,0x69,0x53, + 0xcc,0x2a,0xca,0x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0x4,0xaa,0x23, + 0x44,0x70,0xc4,0x7,0x42,0xa0,0x3a,0x42,0x4,0x47,0x7c,0x20,0x82,0x24,0x2d,0xc0, + 0x19,0x1c,0x4c,0xab,0xc3,0xa4,0x8c,0x91,0x91,0x91,0x91,0x91,0x11,0x42,0xe8,0x5a, + 0x24,0xd1,0x7,0x35,0x16,0x84,0x7,0xd5,0x82,0xef,0xdf,0xbf,0x7f,0xff,0xfe,0x9d, + 0x9,0x93,0x2e,0xf5,0x10,0xc2,0x94,0xb,0x42,0xa0,0x5a,0x20,0xfa,0x9e,0x7c,0x21, + 0x4,0xaa,0x5,0xa2,0xef,0xc9,0x17,0x42,0xa0,0x5a,0x20,0x3c,0x28,0x5f,0x8,0x81, + 0x6a,0x0,0xe6,0x5,0x9,0xf,0xca,0x17,0x22,0x9b,0x49,0x3,0xfe,0xfc,0xf9,0xf3, + 0xe7,0xcf,0x1f,0x42,0xe8,0x96,0xda,0x6c,0x51,0x1c,0x3d,0xd7,0x87,0xb7,0x75,0xeb, + 0x7,0x62,0x98,0x49,0x47,0xe0,0x70,0x93,0x64,0xe7,0xff,0x8,0xe8,0x84,0xff,0x0, + 0xb9,0x51,0x21,0x7f,0x86,0x16,0xa7,0xbb,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44, + 0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fileNew.png - 0x0,0x0,0x3,0x0, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, - 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, - 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, - 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, - 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x92,0x49,0x44,0x41,0x54,0x48,0xc7,0xb5, - 0x96,0x4d,0x4b,0x54,0x51,0x1c,0xc6,0x7f,0xe7,0xde,0x99,0x3b,0xbe,0xc,0x86,0x12, - 0x96,0xa6,0x34,0x44,0x8a,0x94,0x42,0x90,0xd9,0x62,0x10,0xfb,0xe,0x6d,0x6c,0x97, - 0x50,0xab,0x56,0x2d,0xdc,0xf6,0x2d,0xa2,0x45,0x50,0x14,0xb8,0xa8,0x90,0x12,0x37, - 0x51,0x1b,0xb5,0x30,0x2b,0x2a,0xad,0xc1,0x34,0x4c,0x57,0xa1,0xf9,0x92,0xa2,0xce, - 0x78,0xe7,0xde,0x7b,0xee,0x69,0x31,0x67,0x5e,0x1a,0xbd,0xea,0x38,0x74,0xe0,0x70, - 0xf,0x33,0xdc,0xe7,0x77,0xfe,0xcf,0xff,0x65,0x46,0x28,0xa5,0xf8,0x9f,0x2b,0x14, - 0xf4,0xc5,0xdd,0x3e,0x61,0x6d,0x6e,0x12,0x4f,0xed,0xe0,0xd4,0xd4,0xd1,0xe9,0xd8, - 0x18,0x4a,0x21,0xab,0x22,0xc4,0x22,0x95,0x46,0x53,0xb5,0x25,0xe4,0xab,0x8f,0xf2, - 0xde,0xf0,0x67,0xc6,0x7c,0x20,0xa5,0xef,0x59,0x7c,0xe1,0x40,0x80,0x30,0xe9,0x6f, - 0xe9,0xec,0xbe,0xb1,0xb3,0xb5,0xb6,0xde,0xd4,0xd6,0x73,0xca,0xf3,0x95,0x81,0x74, - 0xbd,0xda,0x93,0xad,0xb5,0xc7,0xea,0xcf,0x44,0x2c,0x53,0xb2,0xb8,0xd6,0xdb,0x3c, - 0xf8,0x89,0xab,0x2,0x7e,0x7,0x86,0xa0,0x94,0xda,0x73,0x3f,0xb9,0x73,0x5e,0x5, - 0xad,0xb4,0x7e,0x2e,0xcd,0xbe,0x54,0xbd,0xed,0x3c,0x7,0xaa,0x82,0xf4,0x2,0x1, - 0x8f,0xfa,0x63,0xa9,0x20,0x40,0x62,0x3a,0xa1,0x1c,0x99,0x39,0x7f,0x7f,0xfb,0x50, - 0xdd,0xea,0xe1,0x41,0x10,0xc0,0x8,0x8a,0xcc,0xf7,0x3d,0x2f,0x73,0xf2,0x50,0xa4, - 0x80,0x24,0x60,0x3,0x2e,0xd2,0xdd,0xc6,0xd9,0x49,0x1,0xd0,0x16,0xbf,0x4e,0xbc, - 0xfb,0x5c,0x1f,0x10,0x87,0xdd,0x7a,0xa1,0x83,0xeb,0x20,0x8d,0xc0,0x3,0x14,0xe0, - 0x1,0x16,0xd1,0x68,0x5,0x43,0x43,0x4f,0x59,0x59,0xd9,0xe6,0xc2,0xe5,0x2b,0xac, - 0x27,0x7d,0x80,0x76,0x60,0x8e,0xa2,0x7c,0x18,0x7,0x3,0x5c,0x14,0x2e,0xe4,0xb6, - 0x4d,0xf3,0xe9,0x13,0xb4,0x9c,0x6d,0xa0,0xb5,0xb5,0x8e,0x8e,0x8e,0x18,0x21,0xec, - 0xec,0x65,0xcd,0x12,0x22,0x50,0x5,0x11,0x48,0x40,0xa1,0x10,0x8,0x14,0x61,0x33, - 0xc4,0xa5,0xae,0x8b,0x80,0x5,0x44,0x39,0x16,0xb5,0xd0,0x74,0x79,0x24,0x8b,0x14, - 0x3e,0xe2,0x1f,0xa8,0xb,0x8,0x20,0xd,0xd4,0x90,0xcd,0x56,0x49,0x8d,0x96,0x5f, - 0x36,0x2,0x85,0xd2,0x92,0x99,0x28,0xd0,0xd0,0xac,0xc3,0xf2,0x28,0x80,0xbc,0x45, - 0x0,0x42,0x23,0x44,0xb6,0x11,0xcb,0x1d,0x15,0xf9,0xfc,0xdb,0x45,0xd2,0x59,0xbc, - 0x2a,0xf8,0x44,0x94,0x63,0x51,0x5a,0x5b,0x91,0x95,0xcc,0x98,0x94,0x91,0xf4,0xcb, - 0x1,0x88,0x82,0x24,0xb,0x4,0x46,0xce,0x26,0x95,0xcb,0x84,0x2c,0xc7,0x22,0x0, - 0x47,0x77,0xaf,0x99,0xcb,0x42,0x7e,0x49,0x9d,0x27,0xb7,0x20,0x5f,0x25,0x27,0xd9, - 0xd5,0x10,0xb3,0x28,0x2a,0x89,0xc2,0xd0,0x1d,0xee,0x80,0x71,0x24,0x8b,0x8c,0x1c, - 0x40,0x10,0xce,0x95,0xa5,0x42,0xea,0x58,0xc,0x20,0xc,0x54,0x53,0x11,0xae,0xc8, - 0xbe,0x60,0x94,0x18,0x81,0xa3,0xab,0x48,0x22,0xf0,0x1,0x1f,0x41,0x15,0x10,0x3, - 0x8e,0xeb,0x1,0x38,0xc7,0xea,0xea,0x46,0xe9,0x0,0x21,0x30,0xd0,0x16,0x8,0x4c, - 0x2d,0xd8,0x6,0x78,0x6c,0x2d,0x8c,0x31,0xfb,0x61,0x82,0xd1,0x91,0xf7,0xfe,0xb3, - 0xc1,0xaf,0xf3,0x3f,0x37,0x99,0xd1,0x83,0x2e,0x79,0x68,0x40,0xc4,0xaa,0x8c,0x40, - 0xa3,0x1e,0x92,0xd,0xa4,0x96,0x12,0x8c,0xbf,0xb8,0xcd,0x9b,0xd1,0x71,0x7f,0xe8, - 0xf5,0xf2,0xb7,0xa9,0x35,0x26,0x81,0x19,0xe0,0xb,0xf0,0x3,0x58,0xd4,0x15,0x71, - 0x38,0x40,0x63,0x9d,0x50,0xb0,0xc4,0xc8,0xc0,0x63,0x86,0x7,0xee,0x3b,0xe3,0x93, - 0x72,0x61,0x62,0x91,0x77,0x5a,0x30,0x1,0x4c,0x3,0xcb,0x5,0xcd,0xb0,0xb7,0x13, - 0x41,0xff,0x2a,0xba,0x9a,0xc5,0xb5,0xe4,0x6,0x37,0xe7,0xb7,0xf9,0x63,0xc3,0x28, - 0x30,0x5,0xcc,0x3,0xbf,0xf6,0xab,0xcb,0x5d,0x7a,0x41,0x3f,0x99,0x3d,0x2d,0x0, - 0x44,0x81,0xfa,0xbd,0xe6,0xfc,0x7e,0x80,0xc2,0xfd,0x17,0xfb,0xc6,0x93,0x82,0x32, - 0x2c,0x7f,0xcc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + 0x0,0x0,0x3,0x0, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xd6,0xd8,0xd4,0x4f,0x58,0x32, + 0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x53,0x6f,0x66,0x74,0x77,0x61,0x72,0x65, + 0x0,0x41,0x64,0x6f,0x62,0x65,0x20,0x49,0x6d,0x61,0x67,0x65,0x52,0x65,0x61,0x64, + 0x79,0x71,0xc9,0x65,0x3c,0x0,0x0,0x2,0x92,0x49,0x44,0x41,0x54,0x48,0xc7,0xb5, + 0x96,0x4d,0x4b,0x54,0x51,0x1c,0xc6,0x7f,0xe7,0xde,0x99,0x3b,0xbe,0xc,0x86,0x12, + 0x96,0xa6,0x34,0x44,0x8a,0x94,0x42,0x90,0xd9,0x62,0x10,0xfb,0xe,0x6d,0x6c,0x97, + 0x50,0xab,0x56,0x2d,0xdc,0xf6,0x2d,0xa2,0x45,0x50,0x14,0xb8,0xa8,0x90,0x12,0x37, + 0x51,0x1b,0xb5,0x30,0x2b,0x2a,0xad,0xc1,0x34,0x4c,0x57,0xa1,0xf9,0x92,0xa2,0xce, + 0x78,0xe7,0xde,0x7b,0xee,0x69,0x31,0x67,0x5e,0x1a,0xbd,0xea,0x38,0x74,0xe0,0x70, + 0xf,0x33,0xdc,0xe7,0x77,0xfe,0xcf,0xff,0x65,0x46,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4,0x9c,0x6d,0xa0,0xb5,0xb5,0x8e,0x8e,0x8e,0x18,0x21,0xec, + 0xec,0x65,0xcd,0x12,0x22,0x50,0x5,0x11,0x48,0x40,0xa1,0x10,0x8,0x14,0x61,0x33, + 0xc4,0xa5,0xae,0x8b,0x80,0x5,0x44,0x39,0x16,0xb5,0xd0,0x74,0x79,0x24,0x8b,0x14, + 0x3e,0xe2,0x1f,0xa8,0xb,0x8,0x20,0xd,0xd4,0x90,0xcd,0x56,0x49,0x8d,0x96,0x5f, + 0x36,0x2,0x85,0xd2,0x92,0x99,0x28,0xd0,0xd0,0xac,0xc3,0xf2,0x28,0x80,0xbc,0x45, + 0x0,0x42,0x23,0x44,0xb6,0x11,0xcb,0x1d,0x15,0xf9,0xfc,0xdb,0x45,0xd2,0x59,0xbc, + 0x2a,0xf8,0x44,0x94,0x63,0x51,0x5a,0x5b,0x91,0x95,0xcc,0x98,0x94,0x91,0xf4,0xcb, + 0x1,0x88,0x82,0x24,0xb,0x4,0x46,0xce,0x26,0x95,0xcb,0x84,0x2c,0xc7,0x22,0x0, + 0x47,0x77,0xaf,0x99,0xcb,0x42,0x7e,0x49,0x9d,0x27,0xb7,0x20,0x5f,0x25,0x27,0xd9, + 0xd5,0x10,0xb3,0x28,0x2a,0x89,0xc2,0xd0,0x1d,0xee,0x80,0x71,0x24,0x8b,0x8c,0x1c, + 0x40,0x10,0xce,0x95,0xa5,0x42,0xea,0x58,0xc,0x20,0xc,0x54,0x53,0x11,0xae,0xc8, + 0xbe,0x60,0x94,0x18,0x81,0xa3,0xab,0x48,0x22,0xf0,0x1,0x1f,0x41,0x15,0x10,0x3, + 0x8e,0xeb,0x1,0x38,0xc7,0xea,0xea,0x46,0xe9,0x0,0x21,0x30,0xd0,0x16,0x8,0x4c, + 0x2d,0xd8,0x6,0x78,0x6c,0x2d,0x8c,0x31,0xfb,0x61,0x82,0xd1,0x91,0xf7,0xfe,0xb3, + 0xc1,0xaf,0xf3,0x3f,0x37,0x99,0xd1,0x83,0x2e,0x79,0x68,0x40,0xc4,0xaa,0x8c,0x40, + 0xa3,0x1e,0x92,0xd,0xa4,0x96,0x12,0x8c,0xbf,0xb8,0xcd,0x9b,0xd1,0x71,0x7f,0xe8, + 0xf5,0xf2,0xb7,0xa9,0x35,0x26,0x81,0x19,0xe0,0xb,0xf0,0x3,0x58,0xd4,0x15,0x71, + 0x38,0x40,0x63,0x9d,0x50,0xb0,0xc4,0xc8,0xc0,0x63,0x86,0x7,0xee,0x3b,0xe3,0x93, + 0x72,0x61,0x62,0x91,0x77,0x5a,0x30,0x1,0x4c,0x3,0xcb,0x5,0xcd,0xb0,0xb7,0x13, + 0x41,0xff,0x2a,0xba,0x9a,0xc5,0xb5,0xe4,0x6,0x37,0xe7,0xb7,0xf9,0x63,0xc3,0x28, + 0x30,0x5,0xcc,0x3,0xbf,0xf6,0xab,0xcb,0x5d,0x7a,0x41,0x3f,0x99,0x3d,0x2d,0x0, + 0x44,0x81,0xfa,0xbd,0xe6,0xfc,0x7e,0x80,0xc2,0xfd,0x17,0xfb,0xc6,0x93,0x82,0x32, + 0x2c,0x7f,0xcc,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/fileOpen.png - 0x0,0x0,0x6,0x7e, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, - 0x0,0x0,0x6,0x45,0x49,0x44,0x41,0x54,0x48,0x89,0x9d,0x95,0x7b,0x6c,0x95,0x77, - 0x19,0xc7,0x3f,0xbf,0x73,0xde,0x73,0xeb,0xe5,0x9c,0x5e,0xe0,0x40,0x69,0xbb,0xb2, - 0x5e,0x28,0xe5,0xe,0x45,0x1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0x17,0x5e,0x5b,0x51,0xf7,0xf4,0x9e, - 0x92,0x5,0xdb,0x23,0x41,0x6b,0x18,0x95,0xba,0x89,0x47,0xd3,0x20,0x10,0x45,0xd9, - 0x3a,0xfa,0xcc,0x0,0x77,0x46,0x52,0xc,0x66,0x4a,0x9,0x94,0x6d,0x66,0x79,0xfd, - 0x6,0x42,0xb9,0x21,0x5c,0xdb,0x42,0x4a,0x89,0xeb,0x7a,0x49,0x26,0x27,0x18,0xe9, - 0xda,0x8f,0xd1,0x7b,0x50,0x2e,0x5c,0xbf,0x43,0xcb,0x8f,0x56,0x88,0xb,0xef,0xec, - 0x8a,0x69,0x91,0xa2,0x92,0xd7,0xa3,0x8f,0x6e,0xae,0x7f,0x64,0xc1,0xb6,0xa0,0x1a, - 0x6f,0x45,0x39,0x3a,0x1e,0x6f,0x0,0x29,0x25,0xb6,0x11,0x63,0x62,0x32,0xc9,0xb5, - 0xd1,0x20,0x9e,0x39,0xdb,0xa8,0x7b,0x6c,0x33,0x25,0x25,0x51,0xa4,0x65,0x60,0x19, - 0x59,0xa4,0xed,0x60,0x18,0x16,0x77,0x7b,0x9a,0xe9,0xee,0x38,0x46,0x6d,0xc5,0x1c, - 0xd6,0xef,0xd8,0xeb,0xf3,0x5,0xe3,0xa4,0xa7,0x53,0x28,0x22,0xb3,0x34,0x8f,0xd7, - 0x57,0xe5,0xf7,0x79,0x82,0xe9,0xa1,0x76,0x42,0x9e,0x14,0xc2,0x9b,0x8b,0x61,0x5a, - 0x24,0xd2,0x3a,0xd7,0x6,0x1d,0xd2,0x39,0x8f,0x51,0xbd,0xfe,0x19,0xca,0xca,0x2b, - 0xf1,0xa,0x7,0x23,0x9b,0xc6,0x51,0x2,0xcb,0xb4,0x18,0x1d,0xe8,0xa2,0xe3,0xf4, - 0xef,0x40,0xf9,0xf8,0xcc,0xd3,0x5b,0xa9,0xae,0x8a,0x20,0x93,0xed,0x4c,0x8f,0x19, - 0xdc,0xbc,0xf0,0x11,0xbd,0x3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- 0x49,0x60,0x52,0xb3,0x6d,0x17,0x4b,0xda,0x24,0x93,0x26,0x7d,0xfd,0x53,0x64,0xc4, - 0x5c,0xf2,0xb,0xa2,0x98,0xa6,0xc4,0xb2,0x3d,0x4c,0xc,0x75,0xd1,0x79,0xb1,0x81, - 0xf8,0xf8,0x5d,0x56,0x3f,0xbe,0x99,0x35,0xf5,0x95,0x8,0xd9,0xc7,0x48,0x77,0x3, - 0x99,0xac,0xc4,0xb4,0x24,0x8e,0x23,0x9,0x86,0xcb,0x48,0xde,0x4b,0xd0,0xf0,0x97, - 0xb6,0x9e,0xbd,0x2d,0xfc,0x2,0x18,0x5,0x74,0x4d,0x3a,0xa,0xc3,0xb4,0x89,0xa7, - 0x4c,0x7a,0x6f,0xdf,0x43,0x9b,0xb3,0x84,0x70,0x64,0x16,0x89,0xf8,0x4,0x9d,0xe7, - 0xff,0x48,0xec,0xfa,0x39,0x1e,0xa9,0x78,0x84,0xcf,0x7f,0x7d,0x37,0x5,0xc1,0x61, - 0x12,0x3,0x87,0x89,0xc7,0x13,0x64,0x75,0x13,0xdb,0x96,0x64,0x32,0x29,0xfc,0xa1, - 0x42,0x84,0x98,0xcb,0xd0,0x95,0xb7,0xf5,0xbd,0x27,0xf5,0xdf,0x98,0x92,0xbb,0x40, - 0x52,0x29,0xa5,0x34,0x69,0x29,0xc,0x43,0x12,0x4f,0x1a,0xc4,0xee,0x19,0x2c,0x5d, - 0x54,0x81,0x50,0x16,0xef,0x1f,0xf8,0x31,0x1,0x9f,0x60,0xdb,0xf6,0x97,0x29,0x2d, - 0xcf,0x41,0x1f,0x6e,0x62,0x2c,0x36,0x42,0x3a,0x63,0x91,0x48,0x26,0x40,0xb9,0x68, - 0xbe,0x20,0xbe,0xdc,0x72,0x72,0x72,0x4b,0xe9,0x3f,0x77,0x82,0x33,0x57,0x63,0x47, - 0x93,0x3a,0xed,0xc0,0x94,0x52,0xca,0x6,0xd0,0x4c,0xe9,0x92,0xd1,0x25,0x93,0xd3,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98,0xa3,0x3,0x9c,0x69, - 0x69,0x48,0xfd,0xb6,0x39,0x75,0xea,0xd6,0x18,0x7f,0x2,0x7a,0xef,0x83,0x67,0x0, - 0x43,0x3d,0xa4,0x1e,0x35,0x47,0x81,0xab,0x4,0xca,0x4c,0x53,0x56,0x68,0xb1,0xac, - 0xae,0x80,0x90,0x88,0xe1,0xf,0x14,0x92,0x36,0x20,0xaf,0xa8,0xe,0x73,0x74,0x94, - 0xc1,0xae,0x46,0xf7,0x8d,0xc3,0xb7,0x3a,0x4e,0xdf,0xa4,0xc1,0x92,0x5c,0x4,0x86, - 0x80,0x29,0x40,0xff,0xcf,0xab,0xff,0x4d,0x10,0xf0,0x7b,0xc9,0xc9,0xd1,0x28,0xc, - 0x1a,0x2c,0x5d,0x59,0x8d,0x9b,0xee,0x21,0x2f,0x5a,0x8e,0xed,0x99,0x47,0x20,0x10, - 0x22,0x76,0xb6,0x85,0x23,0xcd,0x57,0x6,0xe,0x9c,0x75,0x8e,0xa6,0x4c,0x8e,0x3, - 0x31,0x60,0x1c,0x48,0x2b,0xa5,0xe4,0xff,0x2,0xff,0x4b,0x10,0x9f,0x9c,0xec,0x96, - 0xd9,0xee,0x95,0x75,0xab,0x9f,0x2f,0x34,0xac,0xeb,0x44,0x8a,0x4a,0x8,0xe6,0xd4, - 0x92,0x88,0xf5,0xd2,0x72,0xe2,0xd4,0xf4,0xbb,0xe7,0xb3,0xad,0xdd,0x3,0x1c,0x5, - 0xae,0xdd,0x8f,0x23,0x1,0x98,0xf,0x8b,0xe3,0xa1,0x82,0xb7,0x9a,0xdc,0x3f,0x57, - 0x17,0x8f,0x8b,0x9d,0x8b,0xed,0x8d,0x73,0x2b,0x37,0x10,0x4e,0xf,0xd2,0xd1,0x74, - 0xd0,0x7a,0xfd,0xc8,0xc0,0xb9,0xce,0x1,0x9a,0x4c,0xc9,0x59,0x60,0x4,0x98,0xbe, - 0x1f,0x87,0xfb,0x71,0xc0,0xf,0xce,0xfc,0xb9,0x45,0x3c,0xff,0xd6,0xf7,0xf2,0xae, - 0x37,0xfe,0x74,0x91,0xfa,0xd2,0xba,0x60,0x57,0xae,0x9f,0x3d,0xc0,0x46,0xa0,0x6, - 0x28,0x0,0x34,0xa5,0x14,0x9f,0x64,0xff,0x1,0x38,0xa4,0x6e,0x5f,0x55,0x49,0x82, - 0xf9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + 0x0,0x0,0x6,0x7e, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x18,0x0,0x0,0x0,0x18,0x8,0x6,0x0,0x0,0x0,0xe0,0x77,0x3d,0xf8, + 0x0,0x0,0x6,0x45,0x49,0x44,0x41,0x54,0x48,0x89,0x9d,0x95,0x7b,0x6c,0x95,0x77, + 0x19,0xc7,0x3f,0xbf,0x73,0xde,0x73,0xeb,0xe5,0x9c,0x5e,0xe0,0x40,0x69,0xbb,0xb2, + 0x5e,0x28,0xe5,0xe,0x45,0x1c,0x63,0x83,0x11,0xc9,0x14,0xc7,0x60,0x5b,0x34,0x38, + 0x63,0x66,0x22,0x53,0x11,0x63,0x44,0x37,0x35,0x26,0xc6,0x7f,0x66,0x48,0x34,0x26, + 0x6a,0x36,0x5d,0x30,0x64,0x71,0x19,0xc8,0x28,0xe,0xc4,0xae,0x60,0x69,0x59,0xa1, + 0xe1,0x3a,0x2a,0xd4,0xf5,0xc2,0xb5,0xd0,0xd3,0x3b,0xbd,0x9d,0x9e,0xeb,0x7b,0xf9, + 0xbd,0xef,0xfb,0xf3,0x1f,0x34,0xa8,0x98,0xcc,0x3d,0xc9,0xf3,0xef,0xe7,0xf3,0xe4, + 0xfb,0xc7,0xf3,0x15,0x4a,0x29,0x3e,0xc9,0xbc,0xfd,0x43,0x51,0x5c,0x51,0x1a,0xda, + 0x3e,0xbb,0x6c,0xc9,0xf7,0x95,0xeb,0xe8,0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xf9,0xb1,0xee,0xb5,0x12,0x9f,0x99,0xe4,0xc6,0x10,0xa4,0x73,0xd6,0x32,0x6f,0xc5, + 0xe7,0xa8,0x5e,0xb0,0x8,0x5c,0x89,0x2,0xe2,0x77,0xe,0xd9,0xad,0x97,0x9c,0xf, + 0x0,0x9,0x20,0x94,0x52,0x8,0x21,0xc4,0xb1,0xd7,0x58,0x38,0x2b,0x3a,0x7b,0x77, + 0xc5,0xb2,0x1d,0x2f,0xcd,0x9e,0xb7,0x3a,0x28,0xac,0x19,0xe2,0x89,0x61,0xdd,0x17, + 0x88,0x68,0x91,0x48,0x89,0x4f,0x4d,0x5f,0x65,0x66,0xa2,0x8f,0xc1,0x29,0x41,0x5f, + 0xba,0x8a,0xea,0x95,0x2f,0x50,0x5a,0xb5,0x84,0x70,0xae,0x1f,0x5d,0xd7,0x51,0xca, + 0x8b,0x2b,0xbc,0x74,0xbf,0xbb,0x66,0x7c,0xf8,0xef,0x9d,0x57,0xfd,0xc2,0x17,0xd0, + 0xa2,0xf2,0x7,0xa2,0xf5,0x97,0x62,0xa5,0xc7,0x17,0x5e,0x5b,0x51,0xf7,0xf4,0x9e, + 0x92,0x5,0xdb,0x23,0x41,0x6b,0x18,0x95,0xba,0x89,0x47,0xd3,0x20,0x10,0x45,0xd9, + 0x3a,0xfa,0xcc,0x0,0x77,0x46,0x52,0xc,0x66,0x4a,0x9,0x94,0x6d,0x66,0x79,0xfd, + 0x6,0x42,0xb9,0x21,0x5c,0xdb,0x42,0x4a,0x89,0xeb,0x7a,0x49,0x26,0x27,0x18,0xe9, + 0xda,0x8f,0xd1,0x7b,0x50,0x2e,0x5c,0xbf,0x43,0xcb,0x8f,0x56,0x88,0xb,0xef,0xec, + 0x8a,0x69,0x91,0xa2,0x92,0xd7,0xa3,0x8f,0x6e,0xae,0x7f,0x64,0xc1,0xb6,0xa0,0x1a, + 0x6f,0x45,0x39,0x3a,0x1e,0x6f,0x0,0x29,0x25,0xb6,0x11,0x63,0x62,0x32,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fa,0x39,0x1e,0xa9,0x78,0x84,0xcf,0x7f,0x7d,0x37,0x5,0xc1,0x61, + 0x12,0x3,0x87,0x89,0xc7,0x13,0x64,0x75,0x13,0xdb,0x96,0x64,0x32,0x29,0xfc,0xa1, + 0x42,0x84,0x98,0xcb,0xd0,0x95,0xb7,0xf5,0xbd,0x27,0xf5,0xdf,0x98,0x92,0xbb,0x40, + 0x52,0x29,0xa5,0x34,0x69,0x29,0xc,0x43,0x12,0x4f,0x1a,0xc4,0xee,0x19,0x2c,0x5d, + 0x54,0x81,0x50,0x16,0xef,0x1f,0xf8,0x31,0x1,0x9f,0x60,0xdb,0xf6,0x97,0x29,0x2d, + 0xcf,0x41,0x1f,0x6e,0x62,0x2c,0x36,0x42,0x3a,0x63,0x91,0x48,0x26,0x40,0xb9,0x68, + 0xbe,0x20,0xbe,0xdc,0x72,0x72,0x72,0x4b,0xe9,0x3f,0x77,0x82,0x33,0x57,0x63,0x47, + 0x93,0x3a,0xed,0xc0,0x94,0x52,0xca,0x6,0xd0,0x4c,0xe9,0x92,0xd1,0x25,0x93,0xd3, + 0x12,0x6f,0xa0,0x90,0x39,0xa5,0x35,0x9c,0x6a,0xda,0xc7,0x9d,0xbe,0x5e,0x76,0x7f, + 0xf7,0x1b,0x94,0xe4,0xf5,0x30,0xd4,0xd9,0x4d,0x36,0x9b,0x41,0x8,0xd,0xdb,0x96, + 0x58,0x86,0x81,0x37,0x27,0x4a,0x7e,0xfe,0xa3,0x88,0x89,0x31,0x9a,0xdf,0xfb,0x7d, + 0xe6,0x50,0xfb,0xf4,0xc9,0x8b,0xb7,0xf9,0x35,0x70,0xf,0x30,0xff,0xf9,0x7e,0x34, + 0xdd,0x52,0x8,0x5d,0x32,0x35,0x63,0x61,0x11,0xc6,0x36,0xa6,0xe9,0xb8,0xf4,0x1, + 0x9b,0x9e,0x5a,0xc5,0xe8,0xad,0x23,0x64,0xc3,0xf9,0x48,0xdb,0xc1,0x34,0x4d,0x5c, + 0x57,0xc7,0xa3,0xe5,0x90,0x17,0x5d,0x8e,0x13,0xcf,0xd2,0xd3,0xd6,0xe8,0xec,0x3f, + 0xd6,0xdb,0xfb,0xd7,0x1e,0xe,0x65,0x4d,0x5a,0x80,0x7e,0x20,0xa5,0x1e,0x28,0x19, + 0xcd,0x30,0x5c,0x54,0x56,0x92,0xd2,0x5d,0x24,0x7e,0xae,0x9c,0x6f,0x60,0x41,0x75, + 0x31,0xb3,0x82,0x23,0x44,0xc2,0x61,0x10,0x1e,0x92,0xc9,0x38,0xae,0xf2,0x10,0xc, + 0x97,0xe3,0x15,0x5,0x8c,0x76,0x7e,0xa8,0xda,0xda,0x2f,0x8d,0xbe,0xd9,0x6c,0x1d, + 0x9d,0xc9,0xd2,0xc,0xdc,0x6,0xc6,0xee,0xc3,0x9d,0x7,0x1f,0xa8,0x66,0x58,0xa, + 0xd7,0x90,0x38,0xca,0x4f,0x2a,0x99,0xa0,0xb6,0x6a,0x2e,0xb,0x2b,0x4,0x79,0x41, + 0x17,0xc7,0xb1,0x71,0x1c,0x45,0x30,0x52,0x8e,0x10,0x85,0x98,0xa3,0x3,0x9c,0x69, + 0x69,0x48,0xfd,0xb6,0x39,0x75,0xea,0xd6,0x18,0x7f,0x2,0x7a,0xef,0x83,0x67,0x0, + 0x43,0x3d,0xa4,0x1e,0x35,0x47,0x81,0xab,0x4,0xca,0x4c,0x53,0x56,0x68,0xb1,0xac, + 0xae,0x80,0x90,0x88,0xe1,0xf,0x14,0x92,0x36,0x20,0xaf,0xa8,0xe,0x73,0x74,0x94, + 0xc1,0xae,0x46,0xf7,0x8d,0xc3,0xb7,0x3a,0x4e,0xdf,0xa4,0xc1,0x92,0x5c,0x4,0x86, + 0x80,0x29,0x40,0xff,0xcf,0xab,0xff,0x4d,0x10,0xf0,0x7b,0xc9,0xc9,0xd1,0x28,0xc, + 0x1a,0x2c,0x5d,0x59,0x8d,0x9b,0xee,0x21,0x2f,0x5a,0x8e,0xed,0x99,0x47,0x20,0x10, + 0x22,0x76,0xb6,0x85,0x23,0xcd,0x57,0x6,0xe,0x9c,0x75,0x8e,0xa6,0x4c,0x8e,0x3, + 0x31,0x60,0x1c,0x48,0x2b,0xa5,0xe4,0xff,0x2,0xff,0x4b,0x10,0x9f,0x9c,0xec,0x96, + 0xd9,0xee,0x95,0x75,0xab,0x9f,0x2f,0x34,0xac,0xeb,0x44,0x8a,0x4a,0x8,0xe6,0xd4, + 0x92,0x88,0xf5,0xd2,0x72,0xe2,0xd4,0xf4,0xbb,0xe7,0xb3,0xad,0xdd,0x3,0x1c,0x5, + 0xae,0xdd,0x8f,0x23,0x1,0x98,0xf,0x8b,0xe3,0xa1,0x82,0xb7,0x9a,0xdc,0x3f,0x57, + 0x17,0x8f,0x8b,0x9d,0x8b,0xed,0x8d,0x73,0x2b,0x37,0x10,0x4e,0xf,0xd2,0xd1,0x74, + 0xd0,0x7a,0xfd,0xc8,0xc0,0xb9,0xce,0x1,0x9a,0x4c,0xc9,0x59,0x60,0x4,0x98,0xbe, + 0x1f,0x87,0xfb,0x71,0xc0,0xf,0xce,0xfc,0xb9,0x45,0x3c,0xff,0xd6,0xf7,0xf2,0xae, + 0x37,0xfe,0x74,0x91,0xfa,0xd2,0xba,0x60,0x57,0xae,0x9f,0x3d,0xc0,0x46,0xa0,0x6, + 0x28,0x0,0x34,0xa5,0x14,0x9f,0x64,0xff,0x1,0x38,0xa4,0x6e,0x5f,0x55,0x49,0x82, + 0xf9,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, // /Users/ivovigan/Documents/CGAL/2D reconstruction/newFernando/pwsrec2d/pwsrec2D_refactor/icons/snapshot.png - 0x0,0x0,0x23,0xdb, - 0x89, - 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, - 0x0,0x0,0x40,0x0,0x0,0x0,0x40,0x8,0x2,0x0,0x0,0x0,0x25,0xb,0xe6,0x89, - 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13, - 0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1, - 0x8e,0x7c,0xfb,0x51,0x93,0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a, - 0x25,0x0,0x0,0x80,0x83,0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75, - 0x30,0x0,0x0,0xea,0x60,0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5, - 0x46,0x0,0x0,0x23,0x51,0x49,0x44,0x41,0x54,0x78,0xda,0x14,0x8e,0xcb,0xe,0xc2, - 0x20,0x14,0x44,0xe1,0x42,0x81,0x36,0xb6,0x1a,0xa3,0x69,0x52,0xb7,0xfe,0xff,0x87, - 0xb8,0x77,0x6d,0x74,0x65,0x5a,0x83,0x11,0x2c,0x5,0xca,0x43,0x9c,0xc5,0xe4,0xac, - 0xce,0xc,0xbe,0x5c,0xef,0x94,0xfc,0x83,0x10,0x2,0x80,0x94,0x52,0x8,0x31,0xa3, - 0xcc,0x48,0x4e,0x31,0x86,0x10,0xac,0x77,0xa5,0x59,0x2d,0xb8,0xe0,0x31,0xe3,0x97, - 0xd4,0x26,0x24,0x9f,0xa1,0xb0,0x9e,0x35,0x8e,0xbe,0x6b,0x2a,0x5e,0x6f,0x1e,0xa3, - 0x92,0xb3,0x75,0xc0,0x99,0xe0,0x43,0xbf,0x3d,0xed,0x5b,0x25,0xc7,0x9b,0xb4,0x88, - 0x50,0xf5,0xd5,0xc5,0x99,0x50,0xb1,0x2,0xa6,0xf4,0x3c,0x1c,0xfa,0xae,0x36,0x3e, - 0x3f,0xa7,0x37,0x60,0x38,0xee,0xba,0xa8,0x3e,0x60,0xcc,0xa4,0xd5,0xca,0xca,0x6c, - 0x64,0x80,0x45,0x45,0xb6,0xd,0xab,0x29,0xe1,0x15,0x6d,0xd1,0x6a,0xcd,0xb2,0xd8, - 0xa5,0xdc,0xf0,0xde,0x5b,0x6b,0x8d,0x31,0xce,0x39,0xef,0x5c,0x81,0x9f,0x0,0x24, - 0x8f,0xd1,0xe,0x82,0x30,0xc,0x45,0xc7,0xba,0xb1,0x39,0x32,0xc1,0x98,0xc5,0xff, - 0xff,0x3a,0x1f,0x44,0x14,0x64,0xb0,0x1,0x6b,0xad,0x31,0xe9,0xcb,0x4d,0x93,0x7b, - 0xcf,0x51,0xb6,0xd6,0x12,0x98,0x5c,0xb2,0x0,0x21,0x16,0x2a,0x42,0x14,0xf8,0x47, - 0x22,0x50,0xe0,0x8d,0x47,0xc2,0x3,0x91,0x48,0xd8,0xda,0x84,0x60,0xc6,0x25,0xf3, - 0xcd,0x4b,0xea,0xbc,0xf,0xd7,0xee,0xdc,0xd8,0xbd,0x50,0x2c,0xf0,0x8c,0x77,0x64, - 0x48,0x51,0x8d,0x53,0x8c,0xaf,0x7e,0x1a,0x1e,0x9,0x8d,0x4,0x5d,0xb6,0xac,0x94, - 0xe2,0x4f,0xdb,0xfa,0x4a,0xc2,0xd4,0xf7,0x65,0x94,0x9b,0x80,0xb8,0x6e,0xbc,0x78, - 0x71,0xf6,0x16,0x42,0x7a,0xf,0xb9,0xa2,0x24,0x50,0xb,0xed,0xdd,0xa9,0x75,0xb6, - 0x31,0xa,0xf7,0xed,0xc8,0xeb,0x1c,0x3f,0x39,0x27,0x6,0x66,0x81,0x1f,0x12,0x80, - 0x73,0x4e,0x6b,0xcd,0xb6,0x5c,0xfb,0x15,0x80,0x23,0xb2,0xd9,0x41,0x18,0x86,0x61, - 0x70,0xd3,0xa6,0x74,0x6c,0x1c,0x10,0x9a,0x58,0xc5,0xfb,0x3f,0x18,0x3b,0x83,0x18, - 0x8c,0xee,0xa7,0xcb,0xda,0x90,0x62,0xf9,0x18,0xc9,0x5f,0x6c,0x4,0x60,0x50,0x42, - 0x58,0xa,0x2a,0xa0,0x14,0x5,0x55,0x23,0x5a,0xe7,0xe4,0xd,0x4a,0x49,0x36,0xd1, - 0xb6,0xe4,0x3,0x14,0xd7,0xae,0x2,0x63,0x8f,0xcd,0x79,0x18,0x3f,0x44,0x84,0xc2, - 0x97,0x98,0xf6,0x24,0x87,0xcc,0x39,0xd2,0x46,0x39,0x4f,0xdf,0xad,0xc2,0xdc,0x5e, - 0xba,0xd6,0xd4,0xbe,0xf3,0x7d,0x7f,0xf,0x21,0x58,0x34,0x27,0x6d,0x58,0xa9,0x79, - 0x5e,0x67,0xcd,0x24,0x19,0x68,0x65,0x98,0xf7,0xf0,0x3a,0xec,0x9b,0x49,0x74,0xf3, - 0xd7,0xac,0x41,0x86,0x6f,0x9c,0x53,0x99,0xc6,0xe7,0x23,0x2e,0x93,0xd5,0xa0,0xe2, - 0xba,0x93,0x80,0x14,0x1,0x0,0xfe,0x55,0x2a,0x17,0x74,0xe6,0x9f,0x0,0x2c,0x92, - 0xcd,0xe,0x82,0x30,0x10,0x84,0xbb,0xdb,0x1f,0x1b,0x4d,0x40,0x51,0x63,0x0,0xe3, - 0xc9,0xf7,0x7f,0x2b,0xe5,0xa4,0x98,0x94,0xd6,0xb6,0x50,0xea,0xa2,0xee,0x61,0x93, - 0xb9,0xcd,0xcc,0x37,0x2,0xf2,0xc,0x44,0x96,0x4,0xcb,0x1c,0x40,0x72,0x9e,0x91, - 0x52,0x22,0x19,0xe7,0x42,0x72,0x6,0x6f,0xef,0xf3,0x14,0x85,0xa2,0xcc,0x2,0x18, - 0xd2,0xc2,0x30,0x3,0x91,0xd5,0x4a,0x59,0x3b,0x98,0x1,0x75,0x55,0x2,0x2e,0xf9, - 0xea,0xba,0x71,0xdd,0xc3,0x86,0xb8,0xd6,0x4a,0x6c,0xb4,0x2e,0x76,0x68,0x23,0x75, - 0x70,0x69,0xce,0xa6,0x7f,0x9e,0xf6,0x55,0xf4,0xee,0xde,0xdd,0xae,0x6d,0x1b,0x11, - 0xc2,0x94,0xa4,0x5e,0x3d,0x5f,0xbd,0x1b,0x4c,0x88,0xfc,0x50,0x16,0xc7,0x6d,0x39, - 0x8d,0x71,0x81,0x3d,0x6,0x67,0x4d,0xe,0x5e,0xce,0x89,0x25,0x32,0x39,0x3,0xfe, - 0x8f,0x2a,0x23,0xfd,0xdb,0x52,0xfa,0xfe,0x8f,0x0,0x1c,0x92,0x3b,0xf,0xc2,0x30, - 0xc,0x84,0x93,0xb6,0xa1,0x49,0x85,0x98,0x78,0x95,0x81,0x81,0x81,0x81,0xff,0xff, - 0xa7,0x18,0x4a,0x1f,0x69,0x53,0x27,0xa6,0x16,0x17,0xa4,0xc8,0x3a,0x4b,0x8e,0x75, - 0xd6,0x7d,0xf9,0x80,0x42,0xe9,0x12,0x87,0x2a,0x3c,0x55,0x15,0x6,0x13,0x10,0x11, - 0x8c,0x4b,0xfe,0x69,0x76,0x26,0x32,0x2f,0x21,0xb8,0xc6,0x35,0x75,0x95,0x8,0x3b, - 0xd4,0xd4,0xf,0x7e,0x5d,0x61,0x1f,0x44,0x82,0xb6,0x61,0xf6,0x81,0x52,0x7b,0x7f, - 0xbc,0x7d,0x24,0x1e,0x45,0x15,0xfd,0x18,0x3e,0xdd,0x70,0xae,0x1d,0xb6,0xde,0xae, - 0xad,0xbb,0x9c,0x84,0xe9,0xb0,0xb7,0xc7,0xd7,0x73,0xa1,0xd4,0x4d,0x3e,0x81,0xe3, - 0x35,0x48,0x22,0x3,0x4,0xb4,0x58,0x67,0x4b,0xbd,0x6d,0x31,0x88,0x30,0x2,0xd5, - 0x44,0xa5,0x7c,0x61,0x83,0x11,0xe9,0x96,0x5,0x4c,0xf3,0x3f,0x7,0x98,0x86,0x40, - 0xcd,0x3d,0xf3,0x4f,0x0,0x12,0xca,0x65,0x7,0x81,0x10,0x8,0x82,0xc,0x8f,0x21, - 0xac,0x31,0xfe,0xff,0x7f,0x79,0xf0,0xa6,0x77,0x2f,0x26,0x2b,0x8c,0xc,0xa0,0x36, - 0x2c,0x5c,0x81,0x74,0x51,0xd,0x1e,0xb5,0x71,0xe4,0xa0,0x1f,0x7c,0x13,0x16,0xe9, - 0x17,0x81,0xb5,0x6e,0xcc,0xde,0xe3,0x19,0x84,0x68,0x6d,0xd5,0x56,0x55,0x27,0x1e, - 0xe1,0x6a,0xea,0x7b,0xdf,0xb1,0x6,0xc6,0x72,0x91,0x2c,0x70,0xac,0x32,0x46,0x79, - 0xdc,0xa5,0x14,0x54,0x65,0x6e,0x47,0x17,0xac,0x97,0xde,0x5e,0x25,0x3f,0x6f,0xd7, - 0x2d,0x6,0x76,0xe6,0x72,0x8a,0x89,0x43,0x4a,0x67,0xe,0xbc,0xc5,0x61,0xbc,0x61, - 0xa6,0xf6,0xf9,0x11,0xb2,0xe0,0xc,0x98,0xed,0x6a,0xbe,0x83,0xd1,0x54,0xef,0x3a, - 0x5c,0xf4,0x46,0x33,0x2,0x88,0xd6,0x5c,0xe3,0x0,0x0,0xcf,0xf1,0xc7,0xfc,0x5, - 0x20,0xa1,0xdc,0x76,0x10,0x6,0x81,0x20,0xda,0xe5,0x22,0xa0,0xb1,0xc6,0xf4,0xff, - 0x3f,0x11,0x41,0xd3,0xa6,0x85,0xb2,0xe0,0x40,0xdf,0xe0,0x8d,0x33,0x33,0x7,0x85, - 0x8c,0xa5,0xd6,0xd3,0x0,0x0,0xdf,0x34,0xf4,0x95,0x7d,0x52,0x12,0xe2,0xf6,0x56, - 0x30,0x5c,0x22,0x63,0x2c,0xa6,0x9b,0xf3,0xf,0x63,0x49,0x67,0x81,0x8e,0x0,0xa3, - 0x75,0x6b,0xfb,0xe9,0x3f,0x31,0x55,0x4e,0x8d,0xd7,0x10,0x20,0xa1,0x20,0x54,0x8c, - 0xea,0xc8,0x58,0x37,0xbf,0xee,0xf3,0xf3,0xf1,0x8d,0xc1,0x47,0xf,0x80,0x2d,0x89, - 0x65,0x79,0xb3,0xd0,0xc4,0xe4,0x9c,0x25,0x51,0x19,0x1,0x2a,0x84,0xaf,0xac,0x12, - 0x13,0x17,0x77,0x53,0x42,0x5a,0xc0,0xe4,0x56,0x70,0xaa,0x20,0xeb,0x72,0xf1,0xb1, - 0x1f,0xd7,0xa3,0xaf,0xaf,0x85,0xc6,0xfa,0x71,0x5,0xc1,0x5f,0x0,0x12,0xca,0x60, - 0x7,0x81,0x10,0x6,0xa2,0x60,0xb,0x15,0x56,0xe2,0xc9,0xff,0xff,0xc2,0x35,0x6a, - 0xe2,0xca,0xa2,0x14,0xa7,0x6c,0xcf,0x4d,0x9a,0xbe,0xcc,0x3c,0xf6,0x21,0xe8,0xac, - 0x27,0x78,0xb7,0xb9,0x61,0xed,0x70,0xe8,0x92,0x43,0x82,0x4c,0x2a,0x10,0xeb,0x50, - 0x16,0x9,0x58,0xc0,0xf7,0x43,0x2f,0x5,0x24,0x53,0x77,0x74,0xcb,0x4b,0xee,0xee, - 0x55,0xd,0x56,0x4e,0x71,0x5d,0xef,0xfa,0xd9,0x9,0xf4,0x15,0x55,0xb,0x91,0xfd, - 0xfb,0xbb,0x95,0x50,0xe4,0x5a,0x1e,0xdb,0xb3,0xda,0x39,0x45,0xa4,0xb4,0xee,0x69, - 0x50,0x8a,0xe2,0xb5,0x65,0x3e,0x9d,0x65,0x41,0xa3,0x98,0x62,0x1c,0x9d,0x70,0x6c, - 0xc0,0x6,0xea,0xc9,0xc8,0xc2,0xd,0x15,0x41,0xff,0xb5,0x83,0xfd,0x61,0x21,0x8b, - 0x9,0x6c,0x39,0xed,0x82,0xf9,0xb,0x40,0x52,0xb9,0x2b,0x21,0xc,0x2,0x51,0x14, - 0x36,0x40,0x40,0x13,0xfd,0xff,0x3f,0xb4,0x70,0x6c,0xc,0x23,0x12,0x82,0x39,0x8b, - 0xd,0x5,0xc5,0x32,0xdc,0xc7,0x59,0x57,0xf6,0x46,0x80,0x60,0x13,0x97,0x96,0x6, - 0xff,0x4c,0xd3,0x5a,0x6b,0xa1,0xed,0x64,0xcd,0x8,0x15,0x26,0x1,0xa9,0x84,0x68, - 0x97,0xc4,0x20,0x2a,0xae,0x43,0xe9,0x88,0x9f,0x8d,0xf,0xf3,0x72,0x8d,0xde,0xaf, - 0xf7,0x15,0xa4,0xe4,0xfc,0x0,0xed,0x29,0x46,0x1e,0x78,0xbf,0x9e,0x3d,0x48,0xd9, - 0x72,0xdd,0x2b,0xb6,0xb2,0x6d,0xac,0xb8,0xed,0x73,0x60,0x78,0xaf,0xdf,0x90,0xa6, - 0x25,0x85,0x5b,0x74,0x51,0x6,0x31,0x94,0xd3,0xbd,0x74,0x18,0xa6,0xb6,0x83,0xa8, - 0x43,0xf0,0xc9,0xaa,0xb8,0x54,0x74,0xac,0x29,0xce,0xff,0x1f,0xfa,0xc8,0x36,0x3a, - 0x37,0x91,0x53,0x0,0x8e,0xca,0x68,0x87,0x41,0x10,0x86,0xa2,0xa2,0x96,0x4a,0xb6, - 0x65,0xcf,0x26,0xfe,0xff,0xd7,0xc9,0x1c,0x93,0x31,0x5b,0x25,0xee,0x56,0x9e,0x9, - 0x6d,0xe9,0x39,0x6d,0xf,0x1e,0x8,0x37,0xc8,0x23,0x4b,0x3,0xcb,0xe,0x18,0x46, - 0x68,0x3c,0xe4,0xae,0xcd,0x60,0x23,0x16,0x2,0xd8,0xae,0xe8,0xda,0xb2,0x6d,0xd0, - 0x1,0xfd,0x40,0x1,0x29,0x41,0xc6,0x26,0xa3,0xbd,0xe5,0x17,0x3f,0x69,0x5d,0xde, - 0xcf,0xc7,0x6d,0x1a,0x47,0x26,0x86,0xf4,0xf3,0x1c,0xe3,0x37,0x83,0xdf,0x40,0x8c, - 0x2c,0xf0,0x81,0x22,0xc7,0xfe,0x5a,0xdd,0xfd,0xa4,0x43,0x99,0xcf,0xa1,0xe5,0xa, - 0x55,0x51,0x16,0x86,0x8d,0x56,0xd9,0x4b,0xe3,0x2a,0x91,0x57,0x4,0x13,0x45,0x11, - 0x3e,0x4,0xf2,0x43,0xd5,0x2c,0xd2,0x1b,0x49,0x20,0xdc,0xb4,0x36,0xac,0xcc,0xe9, - 0x4b,0x86,0xbf,0x0,0x24,0x95,0xcb,0xe,0xc2,0x20,0x10,0x45,0xc1,0x80,0x50,0x5b, - 0x8d,0x91,0x68,0x57,0xf5,0xff,0x3f,0xcd,0x74,0x61,0x34,0x94,0xd6,0x50,0x1a,0x3c, - 0x93,0xee,0x8,0x21,0xc3,0xcc,0x9d,0xfb,0x30,0xcd,0xa9,0x3,0x6b,0x29,0xc2,0xad, - 0x44,0xb0,0x9c,0x41,0x11,0xf5,0xf3,0x1a,0x68,0x30,0x1,0xfc,0x82,0xa9,0xac,0xb1, - 0xec,0x98,0x19,0x1c,0x34,0x2d,0x99,0xb0,0x7a,0xa7,0xf5,0xfb,0xdb,0xb2,0xf6,0x9f, - 0x28,0x59,0xd3,0x79,0xd7,0x3f,0x42,0x7f,0xf,0x64,0xa4,0x88,0x21,0xdc,0x8a,0xd2, - 0x24,0xc4,0xf0,0x1c,0xf8,0xfe,0x35,0x8e,0x31,0x26,0x8,0x1c,0xa7,0xd9,0xeb,0xe2, - 0x52,0xd5,0x79,0x52,0xad,0x3b,0xdb,0xe3,0xb5,0xbd,0xb0,0x9e,0xaa,0x6c,0xae,0xa, - 0xd3,0x59,0xf7,0x4e,0x11,0x46,0x3,0xb7,0xec,0x61,0xf3,0xcb,0x9c,0x88,0x5e,0xda, - 0xdd,0x69,0x23,0xf6,0x6f,0x44,0xb7,0x34,0xfe,0x17,0x80,0xc3,0x2a,0xc9,0x41,0x18, - 0x86,0x81,0x69,0x9c,0xb8,0xa2,0x2a,0x7,0xfe,0xff,0x39,0x6e,0x48,0x70,0x81,0xb6, - 0x4a,0x8a,0xe5,0x85,0x9,0x67,0xcb,0xab,0x66,0x71,0xa1,0xfe,0x19,0xcc,0xf8,0xf3, - 0x62,0xa1,0xe1,0xc9,0x31,0xbe,0x9,0x98,0xd9,0xfc,0x35,0xeb,0xe1,0x1d,0xe6,0x46, - 0x75,0xf2,0x54,0xf3,0x2c,0x41,0x5f,0x84,0x4c,0xcf,0x73,0xda,0x1b,0x6d,0x92,0x9b, - 0x53,0x77,0xd6,0x10,0x4a,0x2,0x5,0x78,0xbc,0x8f,0x57,0xbb,0xa3,0x3,0x44,0x68, - 0xf0,0x65,0x66,0x20,0xfa,0xd9,0x3a,0x50,0x8e,0x52,0x9a,0xd,0x78,0x51,0x2f,0x4d, - 0xb9,0x6f,0xb6,0x70,0x3e,0x3c,0x6e,0x97,0x74,0x7a,0x5b,0xb9,0x7a,0x62,0x24,0xa8, - 0xe1,0x70,0x35,0x65,0x35,0x81,0x3c,0x61,0x34,0x34,0xd6,0xb4,0x4e,0x4c,0x54,0xc4, - 0x81,0x5f,0x8d,0xab,0xca,0xd8,0xa2,0xc6,0x5e,0x4b,0xfc,0x4,0x60,0xa9,0xdc,0x96, - 0x18,0x4,0x61,0x20,0xa,0x99,0x34,0xea,0xff,0x7f,0xa8,0xad,0x62,0x34,0x54,0x86, - 0x1e,0xa6,0x3e,0xc0,0x23,0x97,0xcd,0x9e,0x5d,0xed,0x99,0xf0,0xe1,0xc5,0x95,0xdd, - 0x26,0x3,0xe7,0x7f,0xe2,0xc2,0x14,0xa4,0xa2,0x80,0x4,0x59,0x1f,0x62,0xb2,0x68, - 0xe2,0x2f,0x8e,0x18,0x5e,0x0,0x52,0x70,0x28,0xb5,0x5b,0xf9,0xfd,0x68,0xb8,0xae, - 0xdc,0x9d,0xd6,0xf7,0x46,0x6,0x70,0xe,0xed,0x71,0x9d,0x67,0x54,0x7,0x8c,0xb2, - 0xed,0x8f,0x2e,0x2d,0xc3,0x26,0x48,0xd,0x93,0xf6,0x8c,0xa9,0xea,0xd1,0x3c,0xbe, - 0x1f,0x50,0x1e,0x56,0x27,0x7b,0x15,0x9,0x59,0x13,0xd5,0xaf,0x73,0xf8,0x95,0xa4, - 0xe1,0x71,0x93,0xd7,0xac,0x8,0x50,0x82,0xa1,0xa5,0x4c,0x88,0xe0,0x93,0xdb,0x6e, - 0x86,0xf0,0x13,0x80,0xc4,0x72,0xc9,0x61,0x18,0x84,0xa1,0x20,0x94,0x4f,0x68,0xd8, - 0xf4,0xfe,0x7,0x4c,0x97,0x5d,0x34,0x84,0x10,0x20,0xee,0x58,0xdd,0x20,0x21,0x10, - 0x60,0x3f,0x33,0xcf,0xde,0x38,0x62,0x63,0x48,0xf6,0xdf,0x2a,0x20,0xdd,0x7d,0x7, - 0xe0,0xc6,0xcc,0x19,0xd,0xec,0x3c,0xd8,0x9e,0x16,0x90,0x6d,0x82,0x7f,0x78,0xbb, - 0x8c,0xc8,0x92,0x25,0xe1,0xf1,0xb3,0x9b,0x6f,0x2d,0xbd,0x49,0xcc,0x53,0xe2,0x1c, - 0x48,0xac,0x30,0x68,0x7b,0x6d,0x52,0x90,0xd3,0xa9,0xa7,0x2b,0x9,0xf8,0x9,0xc, - 0x38,0x21,0xa7,0x1e,0x54,0x82,0x82,0xce,0xe,0x45,0xe1,0x44,0xd1,0x2e,0x21,0x7b, - 0x75,0x24,0xb2,0xae,0x40,0xe7,0x22,0x7,0x56,0x69,0xe2,0x2e,0x4a,0xe5,0xa,0x29, - 0x5a,0x49,0xd2,0xb2,0x7b,0xae,0x2f,0xdf,0x6b,0xc1,0x13,0xb7,0xf7,0x86,0x5b,0xf3, - 0xda,0x9f,0x0,0x1c,0x96,0xb1,0xe,0xc2,0x30,0xc,0x44,0x51,0xea,0x88,0x22,0x28, - 0x2,0x46,0xfe,0xff,0x6b,0x98,0x99,0x98,0x90,0x48,0x5b,0xc1,0x0,0x3,0xad,0x50, - 0xdc,0x24,0xe5,0xb9,0xb3,0x93,0xe8,0xa4,0xf8,0xde,0x9d,0xc,0x31,0xf1,0xda,0xd2, - 0x2c,0x4c,0xbf,0xf1,0x60,0x59,0xb5,0xb5,0x33,0x90,0x32,0xd8,0x88,0xd4,0x54,0x83, - 0x79,0xd6,0x38,0x66,0xe,0x4f,0x89,0x9f,0xc0,0x73,0x5c,0x39,0x9f,0x76,0x87,0x63, - 0x73,0xf,0xe1,0xfd,0xfb,0x66,0x57,0x27,0x8d,0xb0,0x9c,0x5,0xdb,0x8a,0x47,0x41, - 0x65,0xad,0x84,0x34,0x47,0x7c,0x1,0x29,0xce,0x7b,0xa5,0x2a,0x25,0x62,0x0,0xc0, - 0x53,0x11,0x40,0x3,0x90,0x81,0x7b,0x24,0x70,0x99,0xcc,0x5c,0x2b,0x4b,0x6,0x1a, - 0x0,0x11,0xc8,0x98,0x12,0x81,0x1d,0x4b,0xa5,0x79,0x2f,0x4,0x82,0x39,0x32,0x77, - 0xaf,0xc7,0xed,0x7a,0xf9,0x3c,0xdb,0x3e,0x84,0x41,0xf1,0xbf,0xfb,0xb,0x40,0x62, - 0xd9,0xed,0x20,0x8,0x2,0x60,0x14,0x3,0x9b,0x81,0x33,0x67,0xef,0xff,0x34,0xdd, - 0xd4,0x45,0x5b,0x5b,0xef,0xa1,0xe9,0x54,0x50,0x11,0x3a,0xd8,0x13,0xf0,0x1,0xdf, - 0xcf,0x51,0x93,0xf3,0xc7,0xbb,0x23,0x9f,0xd3,0xf7,0x7f,0x5b,0x71,0xa3,0xc9,0x5a, - 0xec,0x63,0xca,0x2,0xf5,0x8b,0x63,0x6e,0xe7,0x71,0xe8,0x49,0x34,0x1a,0x30,0x0, - 0xa,0x5c,0xd8,0x73,0xbd,0xe8,0xaa,0x1,0x5d,0x84,0xdb,0xea,0x4a,0xd5,0xb7,0x86, - 0xcd,0x6,0x21,0xaf,0xda,0x90,0x76,0xbe,0x42,0xc8,0xd4,0xd7,0x6e,0xa3,0x3a,0x8b, - 0xf3,0xa5,0xec,0x86,0xb9,0xfb,0xf6,0x6b,0xa4,0xdd,0x81,0xe3,0xf5,0x98,0x99,0x53, - 0x4a,0x57,0x94,0x20,0x71,0x2e,0x82,0xe4,0x5e,0xec,0x71,0xc4,0x94,0xca,0x67,0x41, - 0x26,0xae,0x11,0x79,0xb6,0xe2,0x75,0xa3,0xb2,0xf7,0xe3,0xf9,0x79,0xdd,0xfd,0xd4, - 0xda,0xb1,0x5,0x83,0x2,0x79,0x8a,0xf2,0x27,0x0,0xc9,0xe5,0xb2,0x83,0x30,0x8, - 0x44,0x51,0x1e,0x1,0x94,0x6a,0x62,0x75,0x63,0x1a,0xe3,0xff,0x7f,0x8d,0x5f,0x60, - 0xa2,0x6b,0x75,0xd1,0x50,0xda,0xaa,0x3c,0xc6,0x3b,0x95,0x35,0x21,0xe1,0xce,0xcc, - 0xe1,0x80,0x12,0x19,0xb1,0x2c,0xb6,0x6,0x18,0xec,0x1f,0xb3,0x70,0xf,0x6d,0x31, - 0xd9,0x89,0x0,0x69,0x9c,0x8a,0x20,0xac,0xdb,0xee,0x28,0x97,0x15,0x53,0x5a,0x17, - 0x41,0x59,0x72,0x81,0xfa,0x10,0xf,0xed,0xfe,0xdc,0x35,0x50,0x5b,0xf4,0xf8,0x77, - 0x1a,0x61,0x15,0xf9,0x1d,0x70,0x4f,0xd6,0x44,0x3c,0x31,0x42,0x31,0x2e,0xdc,0xda, - 0xc8,0xd4,0x6d,0xfc,0xa9,0x3d,0xc6,0x38,0x8c,0x93,0x9a,0x93,0xfe,0x94,0xe5,0x97, - 0x40,0xd2,0x2,0x35,0x24,0x10,0x33,0x66,0x2,0x51,0xb2,0xc9,0xa4,0x19,0xd0,0x75, - 0xbe,0x41,0x57,0x3c,0x5f,0xf7,0xc7,0xd0,0xd7,0x12,0x6e,0xd7,0x4b,0xa5,0xa8,0x6c, - 0x35,0xde,0x61,0x37,0xaa,0xa9,0xb4,0xf8,0x9,0x40,0x71,0xb5,0xe4,0x20,0xc,0x2, - 0x51,0x6b,0x49,0x8,0x60,0xaa,0x77,0xa8,0xf7,0xbf,0x8d,0x5b,0xe3,0xc2,0xa5,0x92, - 0xda,0xb4,0x33,0x2d,0xcc,0x50,0xdf,0x2c,0xd9,0x3d,0x78,0x5f,0x5c,0x8c,0x81,0x99, - 0xd,0xb6,0xaa,0xf5,0x85,0x85,0xbe,0x59,0xc,0x4c,0x17,0xad,0x75,0x61,0x87,0xb3, - 0xd5,0x5e,0x81,0x28,0xe,0xed,0xce,0xb6,0x2e,0xfa,0xda,0x94,0x77,0x7c,0x9,0x48, - 0xb5,0x8e,0xf7,0xb1,0xc7,0x14,0x5a,0x26,0x22,0xe,0x52,0xf0,0x20,0x68,0x75,0x83, - 0x8d,0x7b,0xbb,0x43,0x20,0x49,0xd3,0xc3,0x2a,0x99,0x3b,0x1f,0xfd,0x70,0x4d,0x3b, - 0x7b,0xc1,0xf2,0x69,0x18,0x20,0x8c,0xcc,0x4,0x3,0xa7,0x4a,0x68,0x38,0x21,0xe3, - 0xb5,0xd9,0xa8,0x41,0x82,0xfd,0x72,0x7e,0xaf,0xf0,0xff,0xfc,0x7a,0x3e,0x88,0x67, - 0x9f,0x5c,0xb8,0xc4,0x6d,0xfb,0x42,0x2f,0xe9,0x36,0xe4,0xcf,0x4,0x7b,0x1,0xda, - 0x5f,0x0,0x96,0xcb,0x68,0x9,0x41,0x10,0x88,0xa2,0x22,0x86,0x85,0x54,0x63,0xff, - 0xff,0x75,0xf6,0x52,0x3d,0x95,0xe6,0x20,0x82,0xd0,0xd9,0xea,0x7,0x98,0x61,0xf7, - 0x5e,0xce,0xa1,0x21,0xeb,0xff,0xc1,0x1b,0xc0,0x2b,0xfa,0xf0,0x43,0x59,0xae,0x9b, - 0x4,0xab,0xa8,0x58,0x12,0xac,0xf8,0x8,0xd4,0xa9,0x1c,0x11,0x62,0xcb,0xd4,0xc, - 0xac,0xd6,0xa7,0xa3,0xdb,0x11,0x3c,0x1f,0xaa,0x30,0xef,0x4b,0x94,0x9a,0x93,0x4, - 0xad,0xb7,0xef,0x27,0xe,0x69,0xd8,0xb8,0xb6,0xac,0x40,0x19,0xf4,0xdb,0x3a,0x9e, - 0xf6,0x5c,0x16,0xb5,0x8e,0x65,0x9a,0x2a,0x71,0xc7,0xcc,0xd9,0x45,0xac,0x38,0x45, - 0x2f,0xca,0x7b,0x68,0x15,0x8a,0x7a,0x7b,0xdc,0x87,0xeb,0xf0,0x1c,0xa1,0xcb,0x6b, - 0xf6,0x73,0xdf,0x27,0x6b,0x2a,0xeb,0xce,0xcc,0x1e,0x71,0xb1,0xdd,0xc5,0x74,0xad, - 0x7e,0xa3,0x62,0x6a,0xd,0xcb,0x47,0x0,0x8a,0xcb,0x6d,0x5,0x61,0x18,0x8,0xa2, - 0x6d,0x36,0x95,0x46,0x85,0xa2,0x2f,0x7d,0xc8,0xff,0x7f,0x53,0x41,0xb0,0xcf,0x42, - 0x55,0x14,0xe9,0x25,0x49,0x97,0x78,0xf2,0x5,0xbb,0x2c,0x3b,0x33,0x67,0xec,0x7b, - 0x7a,0x78,0xef,0x61,0xbd,0x42,0xa1,0x25,0x23,0x8a,0x8e,0x38,0x99,0x15,0xcd,0xb8, - 0x93,0xf2,0xc5,0x4d,0xb4,0xf5,0x2f,0xe8,0xb2,0x69,0x30,0x2,0xe5,0x40,0xa0,0x84, - 0xf1,0x15,0x52,0x23,0x9a,0x95,0x28,0xde,0xe7,0xef,0x6b,0x1,0x83,0xd1,0x6b,0xa, - 0xa6,0x50,0x19,0x36,0x90,0xad,0xd0,0xc,0x69,0x1e,0x22,0x94,0xbe,0xb6,0x5,0xc2, - 0x95,0x1a,0x18,0x3,0xa2,0x66,0x7b,0x46,0x4,0x1c,0x32,0xc3,0x5f,0x69,0xb,0x2b, - 0xd3,0x31,0xcb,0xe1,0x36,0x8c,0xe3,0xfd,0xf9,0x99,0x10,0x76,0xcd,0xef,0x57,0xeb, - 0xa1,0x13,0xd7,0x9f,0x53,0x8e,0xf9,0x64,0x32,0xf1,0xe0,0xaa,0xee,0xe2,0x10,0xcc, - 0xb1,0x31,0xfb,0x9c,0xa0,0x85,0xbf,0x0,0x2c,0x97,0xcb,0xe,0xc2,0x20,0x10,0x45, - 0xb,0xb4,0x3c,0x4a,0x8c,0xfa,0xff,0xdf,0xe4,0xca,0xc6,0xc4,0xa5,0x26,0xae,0x7d, - 0x54,0xdb,0x6a,0x3b,0xe0,0xc1,0xb8,0x61,0xcd,0x30,0xf7,0x92,0x73,0xea,0xe3,0x61, - 0x8f,0x15,0xc2,0x39,0xc5,0xa5,0xfe,0x88,0x54,0xce,0xfc,0x66,0xc3,0xc4,0xbf,0x9a, - 0x79,0x73,0x66,0x51,0x95,0xd5,0xd2,0x38,0x5f,0xd9,0x40,0xa4,0x92,0xc,0x28,0xdf, - 0x86,0xf8,0x5d,0xfb,0xe5,0x39,0x0,0x33,0x74,0x8a,0xa0,0x8c,0x4b,0xc2,0x53,0xb9, - 0x6a,0xb1,0xf,0x86,0x1d,0xf9,0xe2,0x4a,0x9b,0xf3,0x8f,0x1f,0xc9,0x7c,0xe1,0x47, - 0xd6,0x64,0xcc,0x94,0x96,0x89,0xad,0xa6,0x22,0x28,0x74,0xa0,0xb5,0xee,0x7c,0x39, - 0xed,0xba,0xee,0xd1,0xdf,0x55,0x2d,0x3e,0x36,0x33,0x3d,0xc8,0x58,0xeb,0x5a,0x6f, - 0x57,0x4a,0x26,0x15,0x3,0x3a,0xaa,0xbd,0x9,0xd1,0xc9,0xeb,0xd3,0x5a,0x73,0x13, - 0x1,0xef,0xbf,0x2,0x70,0x5c,0xee,0x38,0x8,0xc3,0x40,0x10,0xb5,0x22,0x7f,0x62, - 0x82,0x28,0x88,0x84,0x72,0x4,0x72,0xff,0x33,0x40,0x41,0x4d,0x95,0x1b,0x50,0x20, - 0x10,0x8e,0x94,0x8f,0x63,0x9b,0xb7,0xb9,0xc1,0x68,0x77,0x34,0xf3,0x46,0x3f,0xee, - 0xb7,0x4b,0x7b,0xee,0xfb,0x2b,0xc8,0xba,0x77,0x8d,0x10,0x5,0xcd,0xa6,0xd2,0xa8, - 0xf6,0x20,0x2d,0x4b,0x82,0xa5,0xb1,0x6,0xc6,0xd9,0x74,0x59,0xf3,0xdc,0x78,0x6a, - 0xe5,0xe4,0x75,0x35,0x7d,0xdf,0x91,0x3d,0xbe,0x84,0xf,0x5d,0x5a,0x68,0x9a,0x14, - 0xb3,0x7c,0xb2,0x82,0x25,0xd1,0x9d,0x4,0xc,0x51,0xce,0x92,0x20,0x61,0x85,0xf, - 0x64,0x7b,0x8,0xe1,0xf3,0xc6,0x58,0xb0,0x7f,0xa4,0xd8,0x6c,0x6d,0xac,0xb5,0xe3, - 0x34,0x3d,0x87,0xe1,0x15,0x2,0x22,0xf,0x4d,0x5d,0x3c,0x41,0x48,0xf2,0xba,0x63, - 0xd7,0xae,0x32,0x1d,0x6c,0xf6,0x9a,0x13,0x33,0x23,0xac,0x63,0x55,0xff,0xd4,0x36, - 0x73,0x5c,0xe3,0xcc,0x5f,0x0,0x92,0xcb,0x65,0x7,0x41,0x18,0x88,0xa2,0x95,0xb6, - 0x54,0xa5,0x15,0x74,0x65,0xa2,0xff,0xff,0x3b,0x2e,0x58,0x98,0xb8,0x71,0xe5,0xc2, - 0xc4,0x98,0x0,0x3e,0x80,0x62,0xe3,0x19,0xfd,0x82,0xa6,0x93,0x3b,0x77,0xce,0x31, - 0xf5,0xa1,0x2e,0x7d,0xd8,0xef,0xb6,0x45,0x58,0xf6,0x6f,0x9,0x0,0x6f,0x72,0xa, - 0x71,0x56,0x91,0x1b,0xe6,0xe8,0xe8,0x76,0x48,0x5b,0x82,0x3a,0xc3,0x57,0xfa,0x81, - 0xde,0x96,0x3d,0x6b,0xa6,0xfe,0x85,0xc6,0x4c,0x2c,0x37,0x98,0xb4,0x4e,0x1a,0x23, - 0x19,0xa2,0x0,0x8a,0x95,0xab,0x4,0xff,0xd,0x3f,0x8f,0x85,0xea,0xf9,0x38,0x80, - 0xf5,0x17,0x57,0xa,0x8e,0xc9,0x3e,0x95,0xd4,0x8e,0xe1,0x2c,0xab,0x4f,0xcc,0x62, - 0xba,0x5d,0x2f,0xe7,0xd3,0x91,0xa6,0xb2,0xb9,0x72,0x79,0x32,0xd0,0x92,0x1d,0xcb, - 0x6a,0xee,0x2b,0x33,0x46,0x2,0xa8,0x8b,0xa0,0xda,0xc7,0xdd,0x6f,0x12,0x58,0xa3, - 0xb2,0x55,0xd7,0xe9,0xe4,0x9a,0x45,0xe5,0xbe,0x2,0x90,0x60,0x6,0x29,0xc,0xc2, - 0x40,0x14,0x9d,0x3a,0x41,0xa2,0x45,0xe8,0xc2,0x45,0xdd,0x88,0x7a,0xff,0x9b,0x58, - 0xe8,0x31,0x4a,0x71,0xd3,0x88,0x14,0xb,0x9,0xf6,0x4d,0xdc,0xcd,0x32,0x4c,0xfe, - 0xcc,0x7f,0x7f,0x90,0x86,0x22,0x41,0x5f,0xfb,0x71,0x1a,0x98,0xa3,0x9c,0x1c,0xe, - 0x44,0xfe,0xdd,0x41,0xc7,0xc8,0xf,0x58,0x56,0xc7,0x89,0xd8,0x78,0xc9,0x58,0xdd, - 0xc0,0xdc,0x14,0x26,0xbf,0x5c,0x24,0x46,0x15,0x87,0x39,0xc4,0xf4,0x47,0x59,0x80, - 0x3a,0xf1,0x44,0x40,0x4c,0x16,0xac,0x34,0xb6,0xc9,0x71,0x35,0xdf,0x2b,0xec,0x6e, - 0x20,0xf6,0x76,0x55,0xba,0x47,0x92,0x21,0x34,0xe8,0x25,0x6c,0x61,0x7e,0x3e,0x5e, - 0xcb,0x5b,0x54,0x9a,0x5b,0xc5,0xc2,0xa1,0xe3,0xe2,0x52,0xd7,0xdf,0x5d,0xe9,0xd6, - 0x10,0x44,0x23,0xd2,0x67,0xf0,0x48,0x2b,0xde,0x35,0x9f,0x65,0x63,0x4d,0x5c,0xdb, - 0x12,0x26,0xff,0xb,0xc0,0x81,0xb9,0xac,0x30,0x8,0x3,0x51,0x34,0xf1,0x11,0x5f, - 0x84,0xda,0x95,0x14,0x11,0xfc,0xff,0x2f,0x71,0xd1,0xaf,0x50,0xba,0x29,0xa5,0x5d, - 0x34,0x18,0xaa,0x43,0xed,0x99,0x6e,0x13,0x86,0xcc,0xc0,0xcc,0x9d,0x7b,0x92,0x16, - 0x5,0x3d,0xd,0x63,0x44,0x1a,0xb3,0xbb,0xf4,0xeb,0xca,0x9c,0xf1,0xbc,0x51,0x29, - 0x15,0x65,0x2b,0xfd,0x81,0x1,0xe7,0x38,0xdc,0xd4,0x27,0x7e,0x48,0xee,0x8b,0x71, - 0xa3,0xc9,0xac,0x45,0x9,0x32,0x87,0xda,0x8b,0x3d,0xb0,0xf2,0x38,0x46,0x8d,0x16, - 0x89,0xa8,0xc3,0xf6,0x77,0xbd,0x94,0x4c,0xf9,0x87,0x66,0xad,0x75,0x1a,0xa5,0x15, - 0xa4,0x58,0x8,0xc1,0x78,0x22,0xd3,0x46,0x42,0xc,0xd3,0x75,0x9a,0x6f,0xb,0x2b, - 0xc,0xb6,0x71,0x35,0x2e,0x14,0x1c,0xdc,0x4b,0xef,0x86,0xb1,0xe7,0x36,0xbc,0x5f, - 0xfe,0x54,0xf9,0xb6,0x61,0xc9,0x27,0x8c,0xb6,0xa4,0x8f,0xfb,0x13,0x42,0xad,0xce, - 0x79,0x59,0xe7,0x3f,0x1,0x48,0x2e,0x9b,0x16,0x4,0x42,0x20,0xc,0xeb,0x66,0x28, - 0x59,0x11,0x4,0xdd,0x82,0x2e,0x41,0x9d,0xfa,0xff,0xff,0x64,0xb,0xa,0x3a,0x6, - 0x19,0x4b,0x6d,0xae,0xa9,0x63,0xbd,0x63,0xf7,0x39,0x38,0x23,0xef,0xc7,0x83,0x8a, - 0x50,0xba,0xee,0x71,0x6c,0xdb,0x77,0x18,0x90,0x8d,0xbb,0xfd,0xc1,0xf5,0xaf,0x46, - 0x19,0x38,0x33,0xfc,0x81,0x81,0x2c,0xd7,0x57,0x20,0x95,0xe8,0x1b,0x1b,0xf2,0x22, - 0xb1,0x86,0xb1,0x46,0x8c,0xb2,0xd2,0x6,0xb6,0xc3,0x14,0x49,0x4a,0x21,0x94,0xf, - 0xf2,0x4d,0x22,0x37,0x4,0xf7,0x35,0xbe,0x37,0x31,0x88,0xe5,0x3f,0x1,0xf2,0xf9, - 0x99,0x8,0xc7,0xd5,0x88,0x31,0x9,0xbb,0xf7,0xe7,0xcb,0xc9,0xb9,0x5b,0xa5,0x23, - 0x65,0xe6,0xda,0x2e,0x74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8e,0x4d,0x99,0x90,0x7d,0x74,0xf3,0x19,0xe4,0x90,0x4b,0x3,0xa5,0xc9,0x9b,0xe7, - 0xed,0xfa,0xcb,0x35,0xad,0x5e,0x9,0xd1,0x5c,0xb0,0x1a,0xcf,0x57,0x75,0xbe,0xdc, - 0x8a,0xf2,0xa4,0xec,0x19,0x67,0xa3,0x24,0xee,0x71,0x61,0x6c,0x33,0xde,0x5d,0x44, - 0x45,0x18,0x73,0x72,0xfa,0x9a,0x0,0xa5,0x7b,0xba,0x9f,0xc4,0xc8,0x40,0x75,0xb1, - 0x8,0x43,0x88,0x40,0x74,0x74,0xc3,0x8e,0x1,0x80,0x97,0x81,0xe1,0x5e,0xb6,0x44, - 0x30,0x6e,0x16,0x17,0x24,0x86,0x6e,0x2,0x97,0x99,0xd0,0xdb,0xba,0xa9,0x2b,0x8e, - 0x62,0x4e,0xbc,0x4f,0xf3,0x32,0x9b,0x37,0xda,0x69,0x6b,0xdc,0x74,0x7f,0x5c,0xf, - 0x45,0xfa,0xf9,0x36,0xc7,0x3c,0xf3,0x7b,0x30,0x66,0x7,0xfc,0xea,0xb8,0xe8,0xea, - 0x91,0x7,0x9f,0x26,0x70,0xa,0xbc,0xfb,0x7b,0x77,0x7f,0x1,0x48,0x30,0x97,0x1c, - 0x84,0x61,0x18,0xa,0x26,0x21,0x5,0x52,0x24,0x76,0x2c,0x10,0x74,0x3,0x7,0xe2, - 0xd0,0x15,0xb7,0x80,0x23,0x54,0x6a,0x12,0xf2,0xc1,0x69,0x9,0xcf,0xed,0xde,0xb, - 0xcb,0x1a,0x3f,0x8d,0xad,0xeb,0x2a,0xe,0x44,0x71,0xf6,0x62,0x57,0xdc,0xfb,0xf5, - 0xec,0xfb,0xc7,0xe5,0x9a,0xb5,0x8,0x89,0x3c,0x65,0x24,0x4e,0x2e,0xc4,0x9f,0x9, - 0x34,0xd,0x73,0xa8,0x8c,0x4,0x20,0x62,0xeb,0x55,0xd,0x98,0xc4,0x94,0x59,0xaf, -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ae,0x67,0xdb,0xbe, - 0xae,0x2d,0x9c,0xdb,0xa5,0x9b,0x88,0x26,0xd3,0xbb,0xef,0x7d,0xe9,0x9a,0xfe,0x27, - 0x0,0x7,0xe6,0xb6,0x82,0x20,0x10,0x45,0xd1,0x1c,0xe7,0xd2,0x98,0x59,0x22,0x21, - 0x41,0x41,0xf8,0x14,0xf5,0x16,0xf4,0xff,0xff,0x23,0x6,0x5a,0x91,0x3a,0x23,0xd6, - 0x9a,0x7e,0xe0,0xc0,0xb9,0xec,0xbd,0xd7,0xc,0x92,0x37,0xe4,0xcb,0xd7,0x79,0xf9, - 0x27,0x52,0x4,0xfb,0x6a,0xdb,0x7e,0x1c,0xae,0xb7,0xbb,0xd4,0xe6,0x8d,0x2e,0x81, - 0x16,0x9a,0x8c,0x54,0xc0,0x7a,0x86,0x8c,0xc5,0xc7,0xe1,0x2b,0xf,0x7,0x84,0xec, - 0x11,0x87,0xb,0x57,0xef,0x43,0x49,0x26,0x2e,0x17,0x18,0x9f,0x4e,0x94,0x24,0xe7, - 0xb4,0x80,0x14,0x15,0xc1,0xaf,0x88,0xa4,0x48,0x1a,0x44,0x8,0x56,0x8,0x52,0x57, - 0xaf,0xc4,0xb1,0x2a,0xe,0xa7,0xcc,0xa4,0xe3,0xb6,0x4c,0xd2,0xc2,0x8a,0xb5,0x95, - 0x76,0xde,0x97,0xd9,0xf9,0x52,0x2d,0x2d,0xa0,0x35,0x77,0xcf,0x76,0x72,0x93,0x8e, - 0xcd,0x26,0xdd,0x71,0x39,0x75,0xf3,0x60,0x87,0x79,0x96,0x2b,0xde,0x4c,0x43,0xd4, - 0x77,0xfe,0x53,0x3b,0xdf,0xfb,0x9f,0x0,0x24,0x98,0xb1,0xe,0xc2,0x30,0xc,0x44, - 0x93,0x26,0xc4,0xb4,0x36,0xad,0x60,0x42,0xea,0x44,0x59,0xf8,0xff,0x5f,0x42,0x59, - 0xa8,0x80,0xad,0x90,0xb6,0x10,0xce,0x61,0xf7,0x62,0x2b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0x9d,0xd5,0x1a,0x3d,0xc8,0xdc,0x4a,0x65,0x78, - 0x2c,0xca,0x49,0x53,0x28,0x8,0xb1,0x63,0x13,0x76,0x92,0x68,0x6a,0x95,0xfd,0x2c, - 0xe0,0xde,0xec,0x6d,0xf0,0x4d,0xf0,0x1,0xa3,0x53,0x22,0xa5,0x9e,0x28,0x95,0x45, - 0x95,0x4b,0x2e,0x12,0xe3,0xb7,0x7b,0x1,0x36,0xe7,0xab,0x3,0x8c,0xf8,0x9c,0x96, - 0x19,0x32,0x68,0xca,0xde,0x20,0x6e,0xfd,0xfd,0x5,0xe0,0xc0,0x5c,0x72,0x10,0x84, - 0xa1,0x28,0xda,0x96,0xb6,0x50,0x3e,0x11,0x13,0x89,0xe,0x1c,0xa9,0xcb,0x77,0xe2, - 0x4a,0x5c,0x82,0x3,0x63,0x30,0xc1,0x10,0x29,0x9f,0x42,0x3f,0xd4,0x57,0xb7,0xf0, - 0x92,0x7b,0xef,0x39,0xf,0xe0,0x46,0xdb,0x95,0x62,0xc6,0xb5,0xfb,0x3f,0x75,0x43, - 0x7b,0x43,0x77,0x98,0xdc,0xb5,0xf7,0xdb,0xb5,0x12,0x6e,0x77,0xde,0xdb,0xfe,0x65, - 0x57,0xb9,0xd8,0xa1,0x3a,0x1d,0x67,0x86,0xa6,0xb1,0x85,0xe3,0x23,0x5c,0x2,0xa2, - 0x0,0xbc,0x29,0xff,0xf0,0x45,0x87,0x43,0x98,0x89,0xb7,0xd1,0x57,0x71,0xf9,0xa4, - 0x19,0x2c,0xf,0x8,0x10,0xba,0x50,0x5e,0x88,0xa4,0xa4,0x51,0xb0,0x76,0x63,0x7a, - 0xa8,0xc1,0x34,0xa9,0x99,0x7f,0x77,0xa3,0x8c,0xd0,0x0,0xe0,0x9a,0x91,0x35,0x15, - 0x10,0xc,0x47,0x2,0xb9,0x40,0x3c,0xf4,0xbc,0x98,0x72,0x7b,0x20,0x3c,0x96,0x12, - 0x7c,0x51,0x75,0xf6,0xc3,0x72,0xbf,0x11,0x39,0x9b,0xe2,0xa9,0xd1,0xba,0xb1,0x5e, - 0x11,0x6a,0x70,0xc,0x7e,0x4e,0xf1,0x4f,0x0,0x9a,0xac,0x1c,0x9,0x61,0x18,0x6, - 0x46,0xd8,0x92,0xc2,0x55,0xd1,0xf0,0x1e,0xa,0xda,0xfc,0xff,0x5,0x69,0x68,0x32, - 0xc6,0x39,0xb0,0x93,0xb0,0xcb,0xc,0x1f,0xb0,0xc7,0xd6,0x1e,0x5a,0x49,0xb8,0xcb, - 0x10,0xf9,0x4d,0xe6,0xb6,0xfd,0xff,0x4,0x6,0xf0,0x60,0xdc,0x67,0xdc,0x2e,0x8f, - 0xee,0x79,0xbc,0xb7,0x43,0x45,0x8b,0x3b,0xcd,0x51,0xde,0xb4,0xb1,0xcc,0x39,0xfb, - 0x66,0x60,0xbe,0xb6,0x80,0x44,0x6e,0x74,0x21,0xbe,0xe0,0x15,0x8,0x72,0xe2,0x42, - 0xde,0xf0,0x5c,0x74,0xcb,0x1a,0xdc,0xf4,0x6a,0xe0,0x4,0xee,0x88,0x6b,0x88,0x1f, - 0x3d,0x14,0x12,0xc4,0x18,0x25,0xe0,0x79,0xe,0x2b,0x62,0xe5,0xcb,0xc9,0xcf,0x4d, - 0x85,0xf4,0x41,0x88,0x2,0xaa,0x86,0xff,0xcc,0xe3,0x92,0x12,0xba,0x86,0x2,0x63, - 0xf1,0xdd,0xa7,0xd7,0x3c,0xf4,0x29,0x54,0x30,0x4f,0xcb,0x48,0x24,0x43,0x9a,0xbe, - 0x2,0xd0,0x64,0xee,0x4a,0x8,0x83,0x40,0x14,0xd,0xbb,0x44,0x89,0x96,0x56,0x36, - 0xfe,0xff,0xa7,0x39,0x56,0x4e,0x2,0xe1,0x11,0xcc,0x78,0xd6,0x8c,0x54,0x94,0x50, - 0x70,0xcf,0xb9,0x8b,0x1e,0xdf,0x4a,0xc7,0xc4,0x74,0xf8,0x2f,0xf6,0xa6,0x34,0x68, - 0x57,0x8d,0x5b,0x5f,0xef,0x8f,0x5b,0x13,0xec,0xbb,0x54,0x3,0x16,0x78,0xb0,0x3a, - 0x3a,0x2a,0x67,0x18,0x7f,0xed,0xbc,0xc0,0x59,0xc,0xda,0x46,0xa2,0x0,0x8a,0xcc, - 0x17,0x31,0x6e,0xa,0xb9,0xff,0x24,0x3f,0xc4,0x45,0xe7,0x16,0xa7,0x73,0xb8,0x26, - 0x3d,0x99,0x5,0xc8,0x30,0xf1,0xec,0x50,0x3b,0x4f,0x69,0x20,0x78,0x3f,0x9b,0x8a, - 0x43,0x59,0x72,0xe9,0xe7,0xcb,0x84,0x26,0x2d,0x29,0xa6,0x5c,0xb8,0x87,0x11,0xaf, - 0xab,0xec,0xbe,0xad,0xed,0xfd,0x9a,0xa9,0x70,0xc1,0x87,0xbd,0x19,0x3b,0x39,0x65, - 0xad,0xf9,0x2b,0x0,0x4d,0x66,0xa0,0xc3,0x20,0x8,0x3,0xd1,0x49,0x69,0xd0,0x6c, - 0x31,0xfb,0x82,0xfd,0xff,0xa7,0x2d,0x4b,0x16,0xe3,0x36,0x1,0x95,0xd2,0x5d,0x25, - 0x7e,0x2,0xa5,0xdc,0xbd,0x3b,0xa0,0x7e,0x4d,0x7e,0xb4,0xfd,0x32,0x9d,0x7,0x80, - 0xeb,0x59,0xc1,0x48,0x17,0x7d,0x3d,0xdf,0xbe,0xcf,0xf7,0xc7,0xf8,0xab,0x1f,0x44, - 0x1a,0x31,0x36,0xcd,0x2,0x40,0xaf,0x2e,0x30,0x94,0x48,0x99,0x90,0x85,0x8d,0xd9, - 0x48,0x60,0x66,0x1d,0x43,0xb2,0x10,0x68,0xb6,0x15,0x3e,0xcc,0xbe,0x18,0x6f,0x56, - 0xb6,0xba,0xf5,0x70,0xe,0x69,0x5,0xa3,0x99,0x2,0x46,0x58,0x62,0x5a,0xf0,0xb2, - 0x80,0x9,0x29,0x45,0x90,0xdf,0x70,0xbd,0x69,0x47,0x33,0xa6,0x5e,0xc4,0xf9,0x50, - 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bb,0x72,0x93,0x21,0xcf,0x3e,0x67,0xde,0xf1,0x92,0x9f, - 0x0,0x64,0x99,0x5d,0xa,0x80,0x20,0x10,0x84,0x2b,0x4,0xed,0x0,0x42,0xf7,0x3f, - 0x5f,0x4,0x15,0x11,0x8a,0xeb,0xf6,0xd,0xf5,0x96,0x7,0x70,0x7f,0x9c,0x75,0x67, - 0x77,0x3e,0x85,0xf8,0x7f,0x1c,0x1a,0x43,0xba,0x5d,0x88,0xa0,0x14,0x98,0xc0,0xcb, - 0x55,0x97,0x9c,0x53,0xc,0xd6,0x6a,0x9c,0x13,0xe3,0x1,0x37,0x24,0xa9,0x7d,0x93, - 0xb4,0x59,0x25,0xdb,0x4,0x2d,0x3d,0xe8,0xa0,0x8,0xe4,0x5f,0xf,0xda,0xdb,0x3, - 0x48,0xea,0x83,0x22,0x20,0x27,0x5a,0x2c,0x8f,0x62,0xe,0x12,0x51,0x31,0x61,0x9a, - 0x96,0xf0,0xa,0x72,0xdd,0xad,0xb4,0x20,0xe2,0x14,0xea,0x4d,0x0,0x7e,0xee,0xe7, - 0xb1,0x6e,0xb1,0x27,0xbe,0x43,0x9,0x90,0x4e,0x83,0x56,0xbb,0xc7,0x1c,0xd8,0x7b, - 0x5,0xa7,0x47,0x0,0xae,0xac,0x2d,0x7,0x40,0x10,0x86,0x61,0x96,0x69,0xbc,0x1, - 0xf1,0xfe,0xe7,0xd3,0x28,0xf1,0x39,0x19,0xb6,0xf8,0x61,0xe2,0x3f,0x1f,0xb0,0x75, - 0x74,0x6d,0xbf,0x21,0xfe,0xbf,0x0,0x7f,0xa,0x19,0xe1,0xad,0x5c,0x41,0x87,0x8f, - 0x79,0xcf,0x76,0xc7,0x21,0xa,0x9d,0xe8,0xcb,0x99,0x42,0x30,0x64,0xe,0x14,0xe6, - 0x5e,0xe3,0x10,0xd7,0x5a,0xe,0x82,0x86,0xce,0x0,0xa8,0xa1,0x2b,0xb9,0x35,0x93, - 0xf3,0x2,0xd6,0xc4,0xb1,0x2d,0x66,0x15,0x6c,0x9b,0x66,0x55,0x52,0xd0,0x5f,0x4, - 0xac,0x71,0xba,0x4a,0xbb,0x2,0xae,0x53,0xdc,0xff,0x76,0xcc,0xde,0x3a,0xa5,0x34, - 0x2e,0xe4,0x40,0xed,0x85,0xb6,0x21,0x24,0x3c,0x9a,0x4d,0x47,0xa1,0xa1,0x4e,0xc, - 0xc7,0xb9,0x1,0x9f,0x8f,0x0,0x5c,0x99,0x5b,0xe,0x40,0x40,0xc,0x45,0x87,0xf2, - 0x41,0xbc,0x63,0xff,0x3b,0x14,0x19,0x11,0x31,0xc1,0x70,0x2e,0x7f,0x36,0x30,0xe9, - 0xed,0xa4,0xb7,0xa7,0xad,0xe5,0x64,0x49,0x9b,0x38,0xf7,0x2b,0x62,0x8d,0x8a,0x89, - 0x96,0x2c,0xb8,0xc8,0x6b,0xab,0x27,0xa0,0xec,0x97,0xb5,0x1e,0xea,0x7e,0x6c,0x20, - 0x5,0xac,0x94,0x4e,0xa9,0x38,0xce,0x20,0x64,0x88,0xef,0x4,0x20,0xae,0x22,0x51, - 0x2a,0x7,0x7a,0x3c,0x96,0x8b,0xf6,0xef,0x84,0xa5,0x5d,0x97,0x51,0x3d,0x56,0x16, - 0x90,0x83,0xcb,0x35,0x53,0x22,0x4f,0x80,0x4f,0x58,0x80,0x83,0xf1,0x69,0xd1,0x85, - 0x6d,0xb7,0x98,0xe2,0x76,0x7e,0x9a,0x2d,0xc9,0xba,0xaa,0xe5,0x45,0x4,0xa3,0x41, - 0xda,0x48,0xa,0x4e,0x12,0x74,0x78,0xba,0xee,0x83,0xe0,0x1f,0x1,0xb8,0x30,0x97, - 0x24,0x0,0x41,0x18,0x86,0x56,0x47,0xf9,0xe8,0xfd,0xaf,0xe9,0x67,0x46,0x7,0x50, - 0x4,0x5f,0x71,0xe7,0x8e,0x65,0xd2,0x36,0x9,0xad,0x76,0xe0,0x53,0xf0,0x8f,0x40, - 0xd7,0x37,0x2,0x4a,0xa3,0x28,0xd1,0x47,0x7c,0xa5,0xa,0xb2,0x9e,0x7b,0x96,0x28, - 0x46,0x8,0x2b,0xe4,0x77,0x5d,0x64,0x43,0x4,0x2e,0xd3,0xb,0x8d,0x5b,0xd7,0xae, - 0xaa,0x32,0x68,0xe6,0xc6,0x14,0xa1,0x4c,0xac,0xc0,0xb4,0x3f,0x12,0x7b,0x1a,0x49, - 0x31,0x59,0xdb,0xca,0x42,0x1a,0x60,0x20,0xf8,0x30,0x9d,0xd3,0x4b,0xd9,0x80,0x71, - 0x3c,0x5,0x94,0x39,0xe4,0x7d,0xd9,0x78,0xcc,0xce,0x87,0x23,0x26,0x75,0xe4,0xe2, - 0xac,0x7,0xb,0x69,0x10,0x43,0x82,0xb0,0x9e,0x72,0x7b,0xf4,0x36,0xbe,0x2,0x90, - 0x69,0x2d,0x4b,0x0,0x82,0x20,0x50,0x49,0x7b,0x58,0x87,0xfe,0xff,0x23,0x3b,0x55, - 0x34,0x29,0xda,0x6e,0xd3,0xad,0x23,0x1e,0x64,0x18,0x58,0x58,0x5c,0xbf,0xc,0xfc, - 0x4b,0x48,0x2a,0xb5,0x44,0xcc,0x4a,0xe1,0xed,0xb0,0x1d,0xc0,0xc5,0x50,0x70,0x92, - 0xe3,0xbd,0xd5,0xb6,0xfb,0xe4,0x26,0x70,0x36,0xb1,0xc9,0x80,0xe9,0x11,0x3d,0xb, - 0x29,0x41,0x11,0x84,0x57,0xd7,0x34,0x8e,0x65,0xac,0x60,0xd9,0x3a,0x0,0xb7,0xc9, - 0xec,0x87,0xa5,0xc5,0x55,0x52,0xe4,0x5e,0x7c,0xf1,0xf,0x2,0x8,0x95,0xa7,0x72, - 0xc1,0x49,0x21,0xb2,0x0,0x1c,0x56,0xf4,0x54,0xdd,0x15,0x71,0x7b,0xd7,0x9f,0x5a, - 0xf4,0x28,0x21,0x47,0xf4,0x7e,0x38,0xba,0x69,0x66,0xbe,0x54,0x3a,0x2a,0xa5,0x81, - 0x44,0xbe,0x7b,0x4,0xa0,0xd3,0xc,0x72,0x0,0x4,0x61,0x20,0x48,0x41,0x25,0xf1, - 0xa0,0xc6,0xff,0xbf,0xd2,0x44,0xa3,0x88,0xc4,0x9d,0x7a,0x96,0x17,0x50,0x92,0xdd, - 0xb6,0x3b,0x74,0xe1,0xe7,0x60,0x4a,0xe1,0x63,0x6,0xc6,0x42,0x1c,0x51,0xa7,0xca, - 0xd0,0x78,0xa6,0x97,0x3b,0x8f,0x52,0x43,0xd3,0xd8,0xa2,0xf5,0x6b,0x5a,0xe6,0xbc, - 0xa6,0x6c,0x32,0xc5,0x1,0xa,0x43,0xb8,0xed,0x1,0x2b,0x66,0xb,0x2e,0x80,0x1, - 0xd4,0x96,0x46,0xff,0x54,0x22,0xa9,0x40,0x54,0x33,0x29,0x85,0xa7,0x36,0x91,0x4, - 0x18,0xc9,0xe8,0x4e,0x97,0xf6,0xf2,0x5b,0x2a,0x97,0x64,0xfb,0x7d,0x53,0x67,0x2e, - 0x34,0x5d,0xc,0xf8,0xa1,0x5f,0x57,0x47,0x36,0x66,0x2a,0x32,0x91,0x53,0x1,0x22, - 0x5f,0x1,0xe8,0x34,0x83,0x1d,0x0,0x41,0x18,0x86,0x2a,0xa2,0x98,0x18,0xfd,0xff, - 0x3f,0xf4,0xc0,0xd1,0x98,0x48,0x2,0x68,0x5f,0xef,0xde,0x77,0x28,0x6c,0xb0,0xad, - 0xed,0x6f,0x6,0xc6,0xc1,0xda,0xbe,0xd7,0x1d,0x5c,0x8,0x11,0x6f,0x3,0x14,0xd0, - 0x3a,0x2f,0x29,0x29,0x60,0x3f,0xb6,0xf2,0x94,0x7c,0x66,0xe5,0x54,0x53,0x80,0xba, - 0xe3,0xd4,0xfd,0x43,0x23,0xf1,0xeb,0xa4,0x48,0x82,0x34,0x43,0x3,0x7d,0x3d,0xb7, - 0xb0,0xdc,0xbb,0xd8,0xac,0xb3,0x57,0x24,0x48,0xe8,0x80,0x5e,0xed,0xb5,0x10,0xc2, - 0xa6,0xdb,0x55,0xaf,0x1d,0xa2,0xea,0xf1,0xbe,0x60,0xee,0xb0,0x1a,0x10,0x40,0xf5, - 0x9,0x54,0x83,0x25,0xd1,0x23,0x80,0x6b,0x43,0x53,0xe,0xe1,0x13,0x80,0x2e,0xb3, - 0x59,0x1,0x10,0x4,0x82,0x70,0x69,0xda,0x16,0x8,0x51,0xd0,0xfb,0xbf,0x5e,0xd0, - 0x31,0xf2,0x2f,0xab,0x19,0x3b,0x77,0xf3,0xa0,0xb,0xeb,0x2c,0xeb,0xce,0xe7,0xaf, - 0x2,0xc4,0x11,0xec,0xcc,0x2d,0x2d,0x3a,0xea,0xd1,0x42,0x60,0x38,0x18,0x2e,0xee, - 0x6f,0x6e,0x4d,0x98,0x45,0xed,0x2c,0x4b,0xf6,0xc5,0x6f,0xa1,0x1c,0x29,0xef,0x79, - 0x5a,0xdd,0xe8,0x4,0xc5,0xa1,0xd,0x92,0xc6,0x79,0x42,0x8a,0xa6,0xca,0xa8,0x2a, - 0x0,0xe8,0xcc,0x93,0x31,0x6d,0x26,0x8f,0x10,0x5a,0x45,0xba,0x9,0x22,0xf1,0xa, - 0x8e,0x68,0x16,0x50,0x59,0x2a,0x9c,0x44,0xf4,0x5,0x56,0x8a,0x60,0x92,0xdf,0x9b, - 0x48,0x15,0xfb,0x70,0xa7,0xe1,0x8a,0x78,0x29,0x44,0x86,0xde,0x40,0x1,0x76,0x8b, - 0x57,0x0,0x3e,0xcd,0x24,0x7,0x40,0x18,0x86,0x81,0x80,0x4a,0x29,0xa8,0x12,0xff, - 0x7f,0x27,0x62,0xe9,0x2,0x65,0x1c,0xee,0x5c,0xa3,0xf6,0x10,0x25,0xb1,0x63,0x39, - 0x3f,0x9,0x18,0xc1,0xd1,0x33,0xb3,0xc,0x2f,0x67,0xa7,0x2d,0x30,0xa6,0x9b,0x34, - 0xf4,0x84,0xba,0x3a,0x5c,0x5b,0x2,0x52,0x7c,0x33,0xb5,0xbb,0x97,0xf3,0x28,0x2d, - 0x6d,0x79,0xad,0x3e,0xba,0x25,0x4e,0x4a,0x55,0x57,0x7,0x66,0xf7,0x7f,0xd0,0xa, - 0x8b,0x36,0x9e,0xc9,0x18,0xd0,0x61,0x40,0xcf,0xa,0x7d,0x33,0x22,0x66,0xf,0xb1, - 0xb6,0x49,0xf2,0xa8,0x56,0x19,0x8d,0xfe,0xc0,0x3e,0x83,0xf4,0x47,0xa5,0x20,0xf4, - 0x1d,0x71,0x60,0x5f,0xd3,0x1c,0xc2,0xa8,0xfe,0xd1,0x16,0xca,0xa7,0x57,0x0,0x2a, - 0xcd,0x25,0x7,0x40,0x10,0x6,0xa2,0x16,0xa3,0xe0,0xfd,0x6f,0xaa,0x31,0x86,0x84, - 0x10,0xdf,0x6b,0xe2,0xc2,0x3d,0x2c,0xe8,0x67,0xda,0x99,0xc1,0x12,0xfa,0x3c,0x8d, - 0x1f,0x92,0x66,0xcd,0x47,0x3d,0x2a,0xb4,0x90,0xd8,0x83,0x79,0x3c,0x23,0xf4,0x53, - 0x3c,0xd9,0xb6,0x46,0x91,0xf4,0xa7,0xf,0xc6,0x19,0x4b,0x27,0x2d,0xa0,0xd7,0xe2, - 0x28,0xbd,0xce,0x9b,0x2e,0x54,0x8d,0x67,0x73,0x2d,0xa9,0x3b,0x46,0x65,0x57,0x75, - 0xbb,0x1a,0xaa,0xce,0x39,0xbf,0xb8,0xb2,0xaf,0x9a,0x70,0x89,0xbd,0x14,0xa9,0x1e, - 0x82,0xf4,0x5d,0x60,0x4d,0x4a,0x35,0x15,0x3c,0xfc,0x25,0x50,0xe0,0xd6,0x90,0xa3, - 0x14,0x86,0x49,0x2,0xb1,0x13,0x17,0x49,0xb0,0x2d,0xb0,0xbc,0x2,0x90,0x69,0x2e, - 0x39,0x0,0x83,0x20,0x14,0xec,0xc2,0xfb,0x9f,0xb5,0x8d,0x11,0xa3,0xb1,0x9f,0x19, - 0xba,0x74,0x67,0x88,0x89,0x28,0xf,0x78,0x8,0x86,0xd1,0x9d,0x47,0xfc,0x84,0x14, - 0x6b,0x82,0xb4,0xcc,0x2d,0x3a,0x80,0x99,0x2a,0x85,0xa0,0xa,0x16,0x14,0x11,0xdc, - 0x81,0x9a,0x42,0x66,0xad,0xd8,0xee,0xb2,0xfc,0xef,0x3d,0xe6,0x58,0xad,0xc6,0x75, - 0xd6,0x16,0xfd,0x59,0xbc,0x3a,0x1b,0x38,0x8e,0x28,0xae,0x7e,0xf9,0x25,0x5a,0x74, - 0xf,0xf5,0xf3,0xd7,0x4c,0x2,0x24,0x5d,0xb5,0x28,0x14,0xf4,0x58,0x60,0x40,0xb7, - 0x6f,0xe7,0x45,0x32,0x75,0xd8,0xe5,0xc6,0x68,0x8e,0x41,0x14,0x3b,0x7a,0xd9,0x81, - 0x7,0x90,0x2c,0x3f,0x1,0xb8,0x34,0x83,0x1d,0x0,0x41,0x18,0x86,0xa,0x12,0x9, - 0x44,0xff,0xff,0x27,0xbd,0xa8,0x21,0x41,0x34,0x6a,0x1f,0xbb,0x79,0xe1,0x46,0x42, - 0x46,0xd6,0x76,0x5d,0x83,0xbd,0xdb,0xce,0x5f,0x2b,0xab,0x40,0x34,0xa1,0x7f,0x25, - 0xb9,0x74,0x49,0x13,0x3d,0x6b,0xa8,0xa7,0x93,0x37,0xae,0x5a,0xd3,0xf8,0xe,0x3a, - 0x5,0x4b,0x88,0xc0,0x24,0xb8,0x8d,0xaa,0x7a,0x98,0xf0,0xa3,0x5b,0x3d,0xd6,0x5a, - 0xb7,0x7b,0xcf,0x25,0x65,0x29,0xe5,0x14,0x31,0x2f,0xdc,0xbc,0x64,0x1a,0xec,0xc4, - 0xe7,0xd2,0x20,0x81,0xff,0xce,0xf7,0x41,0x4,0x42,0x24,0x61,0x8d,0x23,0x34,0x26, - 0x3d,0x3b,0x46,0xe1,0xaa,0x48,0xf9,0x22,0x2b,0x40,0x69,0x24,0xf7,0x3c,0xab,0xc0, - 0xce,0x9a,0x96,0x28,0x18,0x3e,0x1,0xb8,0x34,0x7b,0x15,0x0,0x61,0x18,0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0x5e,0xd2,0x40,0x8e,0xba,0x3c, - 0xde,0x8a,0x89,0x21,0xf6,0xaf,0x0,0x54,0x9a,0x51,0xe,0x80,0x30,0x8,0x43,0x75, - 0x73,0x5f,0x9c,0xc1,0xec,0xfe,0xb7,0x9b,0x5f,0x26,0xba,0x38,0xfb,0x3a,0x7f,0x3c, - 0x1,0x10,0xa0,0xd0,0xc2,0xb7,0x4a,0xcc,0xd,0xf5,0xd7,0xc4,0xfe,0xd5,0x92,0x97, - 0x11,0x1,0x9e,0xc,0x84,0x75,0x95,0x6f,0xdd,0x6b,0x3b,0x9a,0x20,0x5d,0xc6,0xb8, - 0x5,0x97,0x64,0x16,0x29,0x5e,0x72,0x23,0xcb,0x30,0x33,0xc4,0xb0,0x37,0xc6,0x6b, - 0x87,0x33,0x2e,0xce,0x3e,0xfa,0x99,0xb2,0xf2,0xc,0xf5,0x93,0xc2,0x3e,0x2f,0xe, - 0xb7,0x2,0x44,0xa0,0x71,0x4a,0xc4,0x7e,0x67,0x11,0xb9,0x2f,0xf4,0xa4,0x5,0x79, - 0x32,0xe,0x1,0xd7,0x8e,0xeb,0xcf,0x19,0x85,0xb8,0xba,0x1e,0x3a,0xd2,0x6a,0xb2, - 0x91,0x9c,0x5f,0x1,0x68,0x34,0xb7,0x15,0x0,0x41,0x20,0x88,0xb2,0x5e,0x2a,0xa2, - 0xc0,0xb7,0xfa,0xff,0x5f,0x14,0x29,0x12,0xa1,0x33,0x99,0xf,0xbe,0x9,0xee,0x2e, - 0xb3,0x97,0x59,0x27,0x74,0x61,0x45,0xcf,0xe3,0x4e,0x2c,0x15,0x39,0x12,0x53,0x42, - 0x91,0xc9,0x7d,0x9f,0x59,0xde,0x31,0x31,0x33,0x78,0xb8,0xf3,0x38,0xcb,0x55,0x28, - 0xe3,0x4c,0x41,0xa6,0x76,0x4f,0x3a,0x52,0x18,0x39,0x3c,0x10,0x47,0xfb,0x90,0x68, - 0x64,0x60,0xb2,0xfe,0x3e,0x9,0x26,0xf2,0x41,0xb0,0xcf,0x16,0xa7,0x15,0x1c,0xe4, - 0xbb,0xd5,0xf2,0x6c,0xbb,0xa5,0xb4,0x10,0x9,0x80,0x4f,0xe3,0x35,0x6d,0x6d,0x30, - 0xc2,0x69,0xc7,0xd6,0xb4,0x49,0xf3,0xe2,0x79,0x26,0xa2,0x24,0x99,0x1c,0xd6,0x73, - 0x57,0xb4,0x2c,0xcc,0x8a,0xe0,0x2b,0x0,0x91,0x56,0x90,0x3,0x20,0x8,0xc3,0x70, - 0xc1,0xa3,0xd3,0xe8,0xff,0xdf,0x67,0xc2,0x49,0x4f,0x1c,0x20,0xcc,0xb5,0x23,0xf1, - 0xce,0x85,0xc2,0xb6,0xae,0xed,0x5f,0x3,0x34,0xeb,0xc3,0xa2,0x1c,0xde,0x34,0x7d, - 0x58,0x50,0x26,0xb2,0xa9,0x52,0x98,0x6d,0xaa,0x4e,0x76,0xee,0x52,0x10,0x33,0xca, - 0x39,0x56,0xb9,0x25,0x9a,0x7c,0x8a,0x61,0x45,0xe7,0x3a,0x49,0x30,0x11,0x22,0x32, - 0xe5,0x2,0x10,0x3b,0x3e,0xf5,0x60,0xf4,0x70,0x96,0x4a,0xf7,0x95,0xc0,0xde,0xa7, - 0xd5,0x5a,0xcf,0xeb,0xd0,0x1d,0x12,0xa9,0xf7,0x37,0x88,0xad,0x38,0xda,0x91,0x97, - 0x3,0x29,0x7,0xde,0x4c,0xd,0x9,0xef,0x29,0xf1,0xbb,0xd,0xc8,0xae,0x9f,0x0, - 0x4c,0x9a,0xc1,0xa,0xc0,0x20,0xc,0x43,0xc5,0xed,0x30,0xfc,0xff,0x1f,0x75,0x50, - 0x3c,0x8c,0xe9,0xfa,0x92,0xd,0x76,0x93,0x42,0xa1,0x11,0x69,0x4d,0x93,0x97,0xf, - 0x78,0xe,0x88,0x4f,0x65,0xe9,0x47,0x6b,0x34,0x8a,0x2,0xd8,0x2d,0x1f,0x92,0xc, - 0xd,0x2b,0xe3,0x67,0xef,0x23,0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b,0x8c,0x3f, - 0xa3,0x44,0x85,0x55,0x4,0x92,0xc3,0x4d,0xaa,0xdc,0xc3,0x9c,0xb,0xde,0x6a,0x60, - 0x93,0x1f,0x8f,0x0,0x3,0x0,0x87,0x84,0x2a,0x97,0x59,0xf0,0x66,0x15,0x0,0x0, - 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, - + 0x0,0x0,0x23,0xdb, + 0x89, + 0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0, + 0x0,0x0,0x40,0x0,0x0,0x0,0x40,0x8,0x2,0x0,0x0,0x0,0x25,0xb,0xe6,0x89, + 0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13, + 0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1, + 0x8e,0x7c,0xfb,0x51,0x93,0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a, + 0x25,0x0,0x0,0x80,0x83,0x0,0x0,0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75, + 0x30,0x0,0x0,0xea,0x60,0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5, + 0x46,0x0,0x0,0x23,0x51,0x49,0x44,0x41,0x54,0x78,0xda,0x14,0x8e,0xcb,0xe,0xc2, + 0x20,0x14,0x44,0xe1,0x42,0x81,0x36,0xb6,0x1a,0xa3,0x69,0x52,0xb7,0xfe,0xff,0x87, + 0xb8,0x77,0x6d,0x74,0x65,0x5a,0x83,0x11,0x2c,0x5,0xca,0x43,0x9c,0xc5,0xe4,0xac, + 0xce,0xc,0xbe,0x5c,0xef,0x94,0xfc,0x83,0x10,0x2,0x80,0x94,0x52,0x8,0x31,0xa3, + 0xcc,0x48,0x4e,0x31,0x86,0x10,0xac,0x77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,0x42,0x7a,0xf,0xb9,0xa2,0x24,0x50,0xb,0xed,0xdd,0xa9,0x75,0xb6, + 0x31,0xa,0xf7,0xed,0xc8,0xeb,0x1c,0x3f,0x39,0x27,0x6,0x66,0x81,0x1f,0x12,0x80, + 0x73,0x4e,0x6b,0xcd,0xb6,0x5c,0xfb,0x15,0x80,0x23,0xb2,0xd9,0x41,0x18,0x86,0x61, + 0x70,0xd3,0xa6,0x74,0x6c,0x1c,0x10,0x9a,0x58,0xc5,0xfb,0x3f,0x18,0x3b,0x83,0x18, + 0x8c,0xee,0xa7,0xcb,0xda,0x90,0x62,0xf9,0x18,0xc9,0x5f,0x6c,0x4,0x60,0x50,0x42, + 0x58,0xa,0x2a,0xa0,0x14,0x5,0x55,0x23,0x5a,0xe7,0xe4,0xd,0x4a,0x49,0x36,0xd1, + 0xb6,0xe4,0x3,0x14,0xd7,0xae,0x2,0x63,0x8f,0xcd,0x79,0x18,0x3f,0x44,0x84,0xc2, + 0x97,0x98,0xf6,0x24,0x87,0xcc,0x39,0xd2,0x46,0x39,0x4f,0xdf,0xad,0xc2,0xdc,0x5e, + 0xba,0xd6,0xd4,0xbe,0xf3,0x7d,0x7f,0xf,0x21,0x58,0x34,0x27,0x6d,0x58,0xa9,0x79, + 0x5e,0x67,0xcd,0x24,0x19,0x68,0x65,0x98,0xf7,0xf0,0x3a,0xec,0x9b,0x49,0x74,0xf3, + 0xd7,0xac,0x41,0x86,0x6f,0x9c,0x53,0x99,0xc6,0xe7,0x23,0x2e,0x93,0xd5,0xa0,0xe2, + 0xba,0x93,0x80,0x14,0x1,0x0,0xfe,0x55,0x2a,0x17,0x74,0xe6,0x9f,0x0,0x2c,0x92, + 0xcd,0xe,0x82,0x30,0x10,0x84,0xbb,0xdb,0x1f,0x1b,0x4d,0x40,0x51,0x63,0x0,0xe3, + 0xc9,0xf7,0x7f,0x2b,0xe5,0xa4,0x98,0x94,0xd6,0xb6,0x50,0xea,0xa2,0xee,0x61,0x93, + 0xb9,0xcd,0xcc,0x37,0x2,0xf2,0xc,0x44,0x96,0x4,0xcb,0x1c,0x40,0x72,0x9e,0x91, + 0x52,0x22,0x19,0xe7,0x42,0x72,0x6,0x6f,0xef,0xf3,0x14,0x85,0xa2,0xcc,0x2,0x18, + 0xd2,0xc2,0x30,0x3,0x91,0xd5,0x4a,0x59,0x3b,0x98,0x1,0x75,0x55,0x2,0x2e,0xf9, + 0xea,0xba,0x71,0xdd,0xc3,0x86,0xb8,0xd6,0x4a,0x6c,0xb4,0x2e,0x76,0x68,0x23,0x75, + 0x70,0x69,0xce,0xa6,0x7f,0x9e,0xf6,0x55,0xf4,0xee,0xde,0xdd,0xae,0x6d,0x1b,0x11, + 0xc2,0x94,0xa4,0x5e,0x3d,0x5f,0xbd,0x1b,0x4c,0x88,0xfc,0x50,0x16,0xc7,0x6d,0x39, + 0x8d,0x71,0x81,0x3d,0x6,0x67,0x4d,0xe,0x5e,0xce,0x89,0x25,0x32,0x39,0x3,0xfe, + 0x8f,0x2a,0x23,0xfd,0xdb,0x52,0xfa,0xfe,0x8f,0x0,0x1c,0x92,0x3b,0xf,0xc2,0x30, + 0xc,0x84,0x93,0xb6,0xa1,0x49,0x85,0x98,0x78,0x95,0x81,0x81,0x81,0x81,0xff,0xff, + 0xa7,0x18,0x4a,0x1f,0x69,0x53,0x27,0xa6,0x16,0x17,0xa4,0xc8,0x3a,0x4b,0x8e,0x75, + 0xd6,0x7d,0xf9,0x80,0x42,0xe9,0x12,0x87,0x2a,0x3c,0x55,0x15,0x6,0x13,0x10,0x11, + 0x8c,0x4b,0xfe,0x69,0x76,0x26,0x32,0x2f,0x21,0xb8,0xc6,0x35,0x75,0x95,0x8,0x3b, + 0xd4,0xd4,0xf,0x7e,0x5d,0x61,0x1f,0x44,0x82,0xb6,0x61,0xf6,0x81,0x52,0x7b,0x7f, + 0xbc,0x7d,0x24,0x1e,0x45,0x15,0xfd,0x18,0x3e,0xdd,0x70,0xae,0x1d,0xb6,0xde,0xae, + 0xad,0xbb,0x9c,0x84,0xe9,0xb0,0xb7,0xc7,0xd7,0x73,0xa1,0xd4,0x4d,0x3e,0x81,0xe3, + 0x35,0x48,0x22,0x3,0x4,0xb4,0x58,0x67,0x4b,0xbd,0x6d,0x31,0x88,0x30,0x2,0xd5, + 0x44,0xa5,0x7c,0x61,0x83,0x11,0xe9,0x96,0x5,0x4c,0xf3,0x3f,0x7,0x98,0x86,0x40, + 0xcd,0x3d,0xf3,0x4f,0x0,0x12,0xca,0x65,0x7,0x81,0x10,0x8,0x82,0xc,0x8f,0x21, + 0xac,0x31,0xfe,0xff,0x7f,0x79,0xf0,0xa6,0x77,0x2f,0x26,0x2b,0x8c,0xc,0xa0,0x36, + 0x2c,0x5c,0x81,0x74,0x51,0xd,0x1e,0xb5,0x71,0xe4,0xa0,0x1f,0x7c,0x13,0x16,0xe9, + 0x17,0x81,0xb5,0x6e,0xcc,0xde,0xe3,0x19,0x84,0x68,0x6d,0xd5,0x56,0x55,0x27,0x1e, + 0xe1,0x6a,0xea,0x7b,0xdf,0xb1,0x6,0xc6,0x72,0x91,0x2c,0x70,0xac,0x32,0x46,0x79, + 0xdc,0xa5,0x14,0x54,0x65,0x6e,0x47,0x17,0xac,0x97,0xde,0x5e,0x25,0x3f,0x6f,0xd7, + 0x2d,0x6,0x76,0xe6,0x72,0x8a,0x89,0x43,0x4a,0x67,0xe,0xbc,0xc5,0x61,0xbc,0x61, + 0xa6,0xf6,0xf9,0x11,0xb2,0xe0,0xc,0x98,0xed,0x6a,0xbe,0x83,0xd1,0x54,0xef,0x3a, + 0x5c,0xf4,0x46,0x33,0x2,0x88,0xd6,0x5c,0xe3,0x0,0x0,0xcf,0xf1,0xc7,0xfc,0x5, + 0x20,0xa1,0xdc,0x76,0x10,0x6,0x81,0x20,0xda,0xe5,0x22,0xa0,0xb1,0xc6,0xf4,0xff, + 0x3f,0x11,0x41,0xd3,0xa6,0x85,0xb2,0xe0,0x40,0xdf,0xe0,0x8d,0x33,0x33,0x7,0x85, + 0x8c,0xa5,0xd6,0xd3,0x0,0x0,0xdf,0x34,0xf4,0x95,0x7d,0x52,0x12,0xe2,0xf6,0x56, + 0x30,0x5c,0x22,0x63,0x2c,0xa6,0x9b,0xf3,0xf,0x63,0x49,0x67,0x81,0x8e,0x0,0xa3, + 0x75,0x6b,0xfb,0xe9,0x3f,0x31,0x55,0x4e,0x8d,0xd7,0x10,0x20,0xa1,0x20,0x54,0x8c, + 0xea,0xc8,0x58,0x37,0xbf,0xee,0xf3,0xf3,0xf1,0x8d,0xc1,0x47,0xf,0x80,0x2d,0x89, + 0x65,0x79,0xb3,0xd0,0xc4,0xe4,0x9c,0x25,0x51,0x19,0x1,0x2a,0x84,0xaf,0xac,0x12, + 0x13,0x17,0x77,0x53,0x42,0x5a,0xc0,0xe4,0x56,0x70,0xaa,0x20,0xeb,0x72,0xf1,0xb1, + 0x1f,0xd7,0xa3,0xaf,0xaf,0x85,0xc6,0xfa,0x71,0x5,0xc1,0x5f,0x0,0x12,0xca,0x60, + 0x7,0x81,0x10,0x6,0xa2,0x60,0xb,0x15,0x56,0xe2,0xc9,0xff,0xff,0xc2,0x35,0x6a, + 0xe2,0xca,0xa2,0x14,0xa7,0x6c,0xcf,0x4d,0x9a,0xbe,0xcc,0x3c,0xf6,0x21,0xe8,0xac, + 0x27,0x78,0xb7,0xb9,0x61,0xed,0x70,0xe8,0x92,0x43,0x82,0x4c,0x2a,0x10,0xeb,0x50, + 0x16,0x9,0x58,0xc0,0xf7,0x43,0x2f,0x5,0x24,0x53,0x77,0x74,0xcb,0x4b,0xee,0xee, + 0x55,0xd,0x56,0x4e,0x71,0x5d,0xef,0xfa,0xd9,0x9,0xf4,0x15,0x55,0xb,0x91,0xfd, + 0xfb,0xbb,0x95,0x50,0xe4,0x5a,0x1e,0xdb,0xb3,0xda,0x39,0x45,0xa4,0xb4,0xee,0x69, + 0x50,0x8a,0xe2,0xb5,0x65,0x3e,0x9d,0x65,0x41,0xa3,0x98,0x62,0x1c,0x9d,0x70,0x6c, + 0xc0,0x6,0xea,0xc9,0xc8,0xc2,0xd,0x15,0x41,0xff,0xb5,0x83,0xfd,0x61,0x21,0x8b, + 0x9,0x6c,0x39,0xed,0x82,0xf9,0xb,0x40,0x52,0xb9,0x2b,0x21,0xc,0x2,0x51,0x14, + 0x36,0x40,0x40,0x13,0xfd,0xff,0x3f,0xb4,0x70,0x6c,0xc,0x23,0x12,0x82,0x39,0x8b, + 0xd,0x5,0xc5,0x32,0xdc,0xc7,0x59,0x57,0xf6,0x46,0x80,0x60,0x13,0x97,0x96,0x6, + 0xff,0x4c,0xd3,0x5a,0x6b,0xa1,0xed,0x64,0xcd,0x8,0x15,0x26,0x1,0xa9,0x84,0x68, + 0x97,0xc4,0x20,0x2a,0xae,0x43,0xe9,0x88,0x9f,0x8d,0xf,0xf3,0x72,0x8d,0xde,0xaf, + 0xf7,0x15,0xa4,0xe4,0xfc,0x0,0xed,0x29,0x46,0x1e,0x78,0xbf,0x9e,0x3d,0x48,0xd9, + 0x72,0xdd,0x2b,0xb6,0xb2,0x6d,0xac,0xb8,0xed,0x73,0x60,0x78,0xaf,0xdf,0x90,0xa6, + 0x25,0x85,0x5b,0x74,0x51,0x6,0x31,0x94,0xd3,0xbd,0x74,0x18,0xa6,0xb6,0x83,0xa8, + 0x43,0xf0,0xc9,0xaa,0xb8,0x54,0x74,0xac,0x29,0xce,0xff,0x1f,0xfa,0xc8,0x36,0x3a, + 0x37,0x91,0x53,0x0,0x8e,0xca,0x68,0x87,0x41,0x10,0x86,0xa2,0xa2,0x96,0x4a,0xb6, + 0x65,0xcf,0x26,0xfe,0xff,0xd7,0xc9,0x1c,0x93,0x31,0x5b,0x25,0xee,0x56,0x9e,0x9, + 0x6d,0xe9,0x39,0x6d,0xf,0x1e,0x8,0x37,0xc8,0x23,0x4b,0x3,0xcb,0xe,0x18,0x46, + 0x68,0x3c,0xe4,0xae,0xcd,0x60,0x23,0x16,0x2,0xd8,0xae,0xe8,0xda,0xb2,0x6d,0xd0,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b,0x9c,0x88,0x5e,0xda, + 0xdd,0x69,0x23,0xf6,0x6f,0x44,0xb7,0x34,0xfe,0x17,0x80,0xc3,0x2a,0xc9,0x41,0x18, + 0x86,0x81,0x69,0x9c,0xb8,0xa2,0x2a,0x7,0xfe,0xff,0x39,0x6e,0x48,0x70,0x81,0xb6, + 0x4a,0x8a,0xe5,0x85,0x9,0x67,0xcb,0xab,0x66,0x71,0xa1,0xfe,0x19,0xcc,0xf8,0xf3, + 0x62,0xa1,0xe1,0xc9,0x31,0xbe,0x9,0x98,0xd9,0xfc,0x35,0xeb,0xe1,0x1d,0xe6,0x46, + 0x75,0xf2,0x54,0xf3,0x2c,0x41,0x5f,0x84,0x4c,0xcf,0x73,0xda,0x1b,0x6d,0x92,0x9b, + 0x53,0x77,0xd6,0x10,0x4a,0x2,0x5,0x78,0xbc,0x8f,0x57,0xbb,0xa3,0x3,0x44,0x68, + 0xf0,0x65,0x66,0x20,0xfa,0xd9,0x3a,0x50,0x8e,0x52,0x9a,0xd,0x78,0x51,0x2f,0x4d, + 0xb9,0x6f,0xb6,0x70,0x3e,0x3c,0x6e,0x97,0x74,0x7a,0x5b,0xb9,0x7a,0x62,0x24,0xa8, + 0xe1,0x70,0x35,0x65,0x35,0x81,0x3c,0x61,0x34,0x34,0xd6,0xb4,0x4e,0x4c,0x54,0xc4, + 0x81,0x5f,0x8d,0xab,0xca,0xd8,0xa2,0xc6,0x5e,0x4b,0xfc,0x4,0x60,0xa9,0xdc,0x96, + 0x18,0x4,0x61,0x20,0xa,0x99,0x34,0xea,0xff,0x7f,0xa8,0xad,0x62,0x34,0x54,0x86, + 0x1e,0xa6,0x3e,0xc0,0x23,0x97,0xcd,0x9e,0x5d,0xed,0x99,0xf0,0xe1,0xc5,0x95,0xdd, + 0x26,0x3,0xe7,0x7f,0xe2,0xc2,0x14,0xa4,0xa2,0x80,0x4,0x59,0x1f,0x62,0xb2,0x68, + 0xe2,0x2f,0x8e,0x18,0x5e,0x0,0x52,0x70,0x28,0xb5,0x5b,0xf9,0xfd,0x68,0xb8,0xae, + 0xdc,0x9d,0xd6,0xf7,0x46,0x6,0x70,0xe,0xed,0x71,0x9d,0x67,0x54,0x7,0x8c,0xb2, + 0xed,0x8f,0x2e,0x2d,0xc3,0x26,0x48,0xd,0x93,0xf6,0x8c,0xa9,0xea,0xd1,0x3c,0xbe, + 0x1f,0x50,0x1e,0x56,0x27,0x7b,0x15,0x9,0x59,0x13,0xd5,0xaf,0x73,0xf8,0x95,0xa4, + 0xe1,0x71,0x93,0xd7,0xac,0x8,0x50,0x82,0xa1,0xa5,0x4c,0x88,0xe0,0x93,0xdb,0x6e, + 0x86,0xf0,0x13,0x80,0xc4,0x72,0xc9,0x61,0x18,0x84,0xa1,0x20,0x94,0x4f,0x68,0xd8, + 0xf4,0xfe,0x7,0x4c,0x97,0x5d,0x34,0x84,0x10,0x20,0xee,0x58,0xdd,0x20,0x21,0x10, + 0x60,0x3f,0x33,0xcf,0xde,0x38,0x62,0x63,0x48,0xf6,0xdf,0x2a,0x20,0xdd,0x7d,0x7, + 0xe0,0xc6,0xcc,0x19,0xd,0xec,0x3c,0xd8,0x9e,0x16,0x90,0x6d,0x82,0x7f,0x78,0xbb, + 0x8c,0xc8,0x92,0x25,0xe1,0xf1,0xb3,0x9b,0x6f,0x2d,0xbd,0x49,0xcc,0x53,0xe2,0x1c, + 0x48,0xac,0x30,0x68,0x7b,0x6d,0x52,0x90,0xd3,0xa9,0xa7,0x2b,0x9,0xf8,0x9,0xc, + 0x38,0x21,0xa7,0x1e,0x54,0x82,0x82,0xce,0xe,0x45,0xe1,0x44,0xd1,0x2e,0x21,0x7b, + 0x75,0x24,0xb2,0xae,0x40,0xe7,0x22,0x7,0x56,0x69,0xe2,0x2e,0x4a,0xe5,0xa,0x29, + 0x5a,0x49,0xd2,0xb2,0x7b,0xae,0x2f,0xdf,0x6b,0xc1,0x13,0xb7,0xf7,0x86,0x5b,0xf3, + 0xda,0x9f,0x0,0x1c,0x96,0xb1,0xe,0xc2,0x30,0xc,0x44,0x51,0xea,0x88,0x22,0x28, + 0x2,0x46,0xfe,0xff,0x6b,0x98,0x99,0x98,0x90,0x48,0x5b,0xc1,0x0,0x3,0xad,0x50, + 0xdc,0x24,0xe5,0xb9,0xb3,0x93,0xe8,0xa4,0xf8,0xde,0x9d,0xc,0x31,0xf1,0xda,0xd2, + 0x2c,0x4c,0xbf,0xf1,0x60,0x59,0xb5,0xb5,0x33,0x90,0x32,0xd8,0x88,0xd4,0x54,0x83, + 0x79,0xd6,0x38,0x66,0xe,0x4f,0x89,0x9f,0xc0,0x73,0x5c,0x39,0x9f,0x76,0x87,0x63, + 0x73,0xf,0xe1,0xfd,0xfb,0x66,0x57,0x27,0x8d,0xb0,0x9c,0x5,0xdb,0x8a,0x47,0x41, + 0x65,0xad,0x84,0x34,0x47,0x7c,0x1,0x29,0xce,0x7b,0xa5,0x2a,0x25,0x62,0x0,0xc0, + 0x53,0x11,0x40,0x3,0x90,0x81,0x7b,0x24,0x70,0x99,0xcc,0x5c,0x2b,0x4b,0x6,0x1a, + 0x0,0x11,0xc8,0x98,0x12,0x81,0x1d,0x4b,0xa5,0x79,0x2f,0x4,0x82,0x39,0x32,0x77, + 0xaf,0xc7,0xed,0x7a,0xf9,0x3c,0xdb,0x3e,0x84,0x41,0xf1,0xbf,0xfb,0xb,0x40,0x62, + 0xd9,0xed,0x20,0x8,0x2,0x60,0x14,0x3,0x9b,0x81,0x33,0x67,0xef,0xff,0x34,0xdd, + 0xd4,0x45,0x5b,0x5b,0xef,0xa1,0xe9,0x54,0x50,0x11,0x3a,0xd8,0x13,0xf0,0x1,0xdf, + 0xcf,0x51,0x93,0xf3,0xc7,0xbb,0x23,0x9f,0xd3,0xf7,0x7f,0x5b,0x71,0xa3,0xc9,0x5a, + 0xec,0x63,0xca,0x2,0xf5,0x8b,0x63,0x6e,0xe7,0x71,0xe8,0x49,0x34,0x1a,0x30,0x0, + 0xa,0x5c,0xd8,0x73,0xbd,0xe8,0xaa,0x1,0x5d,0x84,0xdb,0xea,0x4a,0xd5,0xb7,0x86, + 0xcd,0x6,0x21,0xaf,0xda,0x90,0x76,0xbe,0x42,0xc8,0xd4,0xd7,0x6e,0xa3,0x3a,0x8b, + 0xf3,0xa5,0xec,0x86,0xb9,0xfb,0xf6,0x6b,0xa4,0xdd,0x81,0xe3,0xf5,0x98,0x99,0x53, + 0x4a,0x57,0x94,0x20,0x71,0x2e,0x82,0xe4,0x5e,0xec,0x71,0xc4,0x94,0xca,0x67,0x41, + 0x26,0xae,0x11,0x79,0xb6,0xe2,0x75,0xa3,0xb2,0xf7,0xe3,0xf9,0x79,0xdd,0xfd,0xd4, + 0xda,0xb1,0x5,0x83,0x2,0x79,0x8a,0xf2,0x27,0x0,0xc9,0xe5,0xb2,0x83,0x30,0x8, + 0x44,0x51,0x1e,0x1,0x94,0x6a,0x62,0x75,0x63,0x1a,0xe3,0xff,0x7f,0x8d,0x5f,0x60, + 0xa2,0x6b,0x75,0xd1,0x50,0xda,0xaa,0x3c,0xc6,0x3b,0x95,0x35,0x21,0xe1,0xce,0xcc, + 0xe1,0x80,0x12,0x19,0xb1,0x2c,0xb6,0x6,0x18,0xec,0x1f,0xb3,0x70,0xf,0x6d,0x31, + 0xd9,0x89,0x0,0x69,0x9c,0x8a,0x20,0xac,0xdb,0xee,0x28,0x97,0x15,0x53,0x5a,0x17, + 0x41,0x59,0x72,0x81,0xfa,0x10,0xf,0xed,0xfe,0xdc,0x35,0x50,0x5b,0xf4,0xf8,0x77, + 0x1a,0x61,0x15,0xf9,0x1d,0x70,0x4f,0xd6,0x44,0x3c,0x31,0x42,0x31,0x2e,0xdc,0xda, + 0xc8,0xd4,0x6d,0xfc,0xa9,0x3d,0xc6,0x38,0x8c,0x93,0x9a,0x93,0xfe,0x94,0xe5,0x97, + 0x40,0xd2,0x2,0x35,0x24,0x10,0x33,0x66,0x2,0x51,0xb2,0xc9,0xa4,0x19,0xd0,0x75, + 0xbe,0x41,0x57,0x3c,0x5f,0xf7,0xc7,0xd0,0xd7,0x12,0x6e,0xd7,0x4b,0xa5,0xa8,0x6c, + 0x35,0xde,0x61,0x37,0xaa,0xa9,0xb4,0xf8,0x9,0x40,0x71,0xb5,0xe4,0x20,0xc,0x2, + 0x51,0x6b,0x49,0x8,0x60,0xaa,0x77,0xa8,0xf7,0xbf,0x8d,0x5b,0xe3,0xc2,0xa5,0x92, + 0xda,0xb4,0x33,0x2d,0xcc,0x50,0xdf,0x2c,0xd9,0x3d,0x78,0x5f,0x5c,0x8c,0x81,0x99, + 0xd,0xb6,0xaa,0xf5,0x85,0x85,0xbe,0x59,0xc,0x4c,0x17,0xad,0x75,0x61,0x87,0xb3, + 0xd5,0x5e,0x81,0x28,0xe,0xed,0xce,0xb6,0x2e,0xfa,0xda,0x94,0x77,0x7c,0x9,0x48, + 0xb5,0x8e,0xf7,0xb1,0xc7,0x14,0x5a,0x26,0x22,0xe,0x52,0xf0,0x20,0x68,0x75,0x83, + 0x8d,0x7b,0xbb,0x43,0x20,0x49,0xd3,0xc3,0x2a,0x99,0x3b,0x1f,0xfd,0x70,0x4d,0x3b, + 0x7b,0xc1,0xf2,0x69,0x18,0x20,0x8c,0xcc,0x4,0x3,0xa7,0x4a,0x68,0x38,0x21,0xe3, + 0xb5,0xd9,0xa8,0x41,0x82,0xfd,0x72,0x7e,0xaf,0xf0,0xff,0xfc,0x7a,0x3e,0x88,0x67, + 0x9f,0x5c,0xb8,0xc4,0x6d,0xfb,0x42,0x2f,0xe9,0x36,0xe4,0xcf,0x4,0x7b,0x1,0xda, + 0x5f,0x0,0x96,0xcb,0x68,0x9,0x41,0x10,0x88,0xa2,0x22,0x86,0x85,0x54,0x63,0xff, + 0xff,0x75,0xf6,0x52,0x3d,0x95,0xe6,0x20,0x82,0xd0,0xd9,0xea,0x7,0x98,0x61,0xf7, + 0x5e,0xce,0xa1,0x21,0xeb,0xff,0xc1,0x1b,0xc0,0x2b,0xfa,0xf0,0x43,0x59,0xae,0x9b, + 0x4,0xab,0xa8,0x58,0x12,0xac,0xf8,0x8,0xd4,0xa9,0x1c,0x11,0x62,0xcb,0xd4,0xc, + 0xac,0xd6,0xa7,0xa3,0xdb,0x11,0x3c,0x1f,0xaa,0x30,0xef,0x4b,0x94,0x9a,0x93,0x4, + 0xad,0xb7,0xef,0x27,0xe,0x69,0xd8,0xb8,0xb6,0xac,0x40,0x19,0xf4,0xdb,0x3a,0x9e, + 0xf6,0x5c,0x16,0xb5,0x8e,0x65,0x9a,0x2a,0x71,0xc7,0xcc,0xd9,0x45,0xac,0x38,0x45, + 0x2f,0xca,0x7b,0x68,0x15,0x8a,0x7a,0x7b,0xdc,0x87,0xeb,0xf0,0x1c,0xa1,0xcb,0x6b, + 0xf6,0x73,0xdf,0x27,0x6b,0x2a,0xeb,0xce,0xcc,0x1e,0x71,0xb1,0xdd,0xc5,0x74,0xad, + 0x7e,0xa3,0x62,0x6a,0xd,0xcb,0x47,0x0,0x8a,0xcb,0x6d,0x5,0x61,0x18,0x8,0xa2, + 0x6d,0x36,0x95,0x46,0x85,0xa2,0x2f,0x7d,0xc8,0xff,0x7f,0x53,0x41,0xb0,0xcf,0x42, + 0x55,0x14,0xe9,0x25,0x49,0x97,0x78,0xf2,0x5,0xbb,0x2c,0x3b,0x33,0x67,0xec,0x7b, + 0x7a,0x78,0xef,0x61,0xbd,0x42,0xa1,0x25,0x23,0x8a,0x8e,0x38,0x99,0x15,0xcd,0xb8, + 0x93,0xf2,0xc5,0x4d,0xb4,0xf5,0x2f,0xe8,0xb2,0x69,0x30,0x2,0xe5,0x40,0xa0,0x84, + 0xf1,0x15,0x52,0x23,0x9a,0x95,0x28,0xde,0xe7,0xef,0x6b,0x1,0x83,0xd1,0x6b,0xa, + 0xa6,0x50,0x19,0x36,0x90,0xad,0xd0,0xc,0x69,0x1e,0x22,0x94,0xbe,0xb6,0x5,0xc2, + 0x95,0x1a,0x18,0x3,0xa2,0x66,0x7b,0x46,0x4,0x1c,0x32,0xc3,0x5f,0x69,0xb,0x2b, + 0xd3,0x31,0xcb,0xe1,0x36,0x8c,0xe3,0xfd,0xf9,0x99,0x10,0x76,0xcd,0xef,0x57,0xeb, + 0xa1,0x13,0xd7,0x9f,0x53,0x8e,0xf9,0x64,0x32,0xf1,0xe0,0xaa,0xee,0xe2,0x10,0xcc, + 0xb1,0x31,0xfb,0x9c,0xa0,0x85,0xbf,0x0,0x2c,0x97,0xcb,0xe,0xc2,0x20,0x10,0x45, + 0xb,0xb4,0x3c,0x4a,0x8c,0xfa,0xff,0xdf,0xe4,0xca,0xc6,0xc4,0xa5,0x26,0xae,0x7d, + 0x54,0xdb,0x6a,0x3b,0xe0,0xc1,0xb8,0x61,0xcd,0x30,0xf7,0x92,0x73,0xea,0xe3,0x61, + 0x8f,0x15,0xc2,0x39,0xc5,0xa5,0xfe,0x88,0x54,0xce,0xfc,0x66,0xc3,0xc4,0xbf,0x9a, + 0x79,0x73,0x66,0x51,0x95,0xd5,0xd2,0x38,0x5f,0xd9,0x40,0xa4,0x92,0xc,0x28,0xdf, + 0x86,0xf8,0x5d,0xfb,0xe5,0x39,0x0,0x33,0x74,0x8a,0xa0,0x8c,0x4b,0xc2,0x53,0xb9, + 0x6a,0xb1,0xf,0x86,0x1d,0xf9,0xe2,0x4a,0x9b,0xf3,0x8f,0x1f,0xc9,0x7c,0xe1,0x47, + 0xd6,0x64,0xcc,0x94,0x96,0x89,0xad,0xa6,0x22,0x28,0x74,0xa0,0xb5,0xee,0x7c,0x39, + 0xed,0xba,0xee,0xd1,0xdf,0x55,0x2d,0x3e,0x36,0x33,0x3d,0xc8,0x58,0xeb,0x5a,0x6f, + 0x57,0x4a,0x26,0x15,0x3,0x3a,0xaa,0xbd,0x9,0xd1,0xc9,0xeb,0xd3,0x5a,0x73,0x13, + 0x1,0xef,0xbf,0x2,0x70,0x5c,0xee,0x38,0x8,0xc3,0x40,0x10,0xb5,0x22,0x7f,0x62, + 0x82,0x28,0x88,0x84,0x72,0x4,0x72,0xff,0x33,0x40,0x41,0x4d,0x95,0x1b,0x50,0x20, + 0x10,0x8e,0x94,0x8f,0x63,0x9b,0xb7,0xb9,0xc1,0x68,0x77,0x34,0xf3,0x46,0x3f,0xee, + 0xb7,0x4b,0x7b,0xee,0xfb,0x2b,0xc8,0xba,0x77,0x8d,0x10,0x5,0xcd,0xa6,0xd2,0xa8, + 0xf6,0x20,0x2d,0x4b,0x82,0xa5,0xb1,0x6,0xc6,0xd9,0x74,0x59,0xf3,0xdc,0x78,0x6a, + 0xe5,0xe4,0x75,0x35,0x7d,0xdf,0x91,0x3d,0xbe,0x84,0xf,0x5d,0x5a,0x68,0x9a,0x14, + 0xb3,0x7c,0xb2,0x82,0x25,0xd1,0x9d,0x4,0xc,0x51,0xce,0x92,0x20,0x61,0x85,0xf, + 0x64,0x7b,0x8,0xe1,0xf3,0xc6,0x58,0xb0,0x7f,0xa4,0xd8,0x6c,0x6d,0xac,0xb5,0xe3, + 0x34,0x3d,0x87,0xe1,0x15,0x2,0x22,0xf,0x4d,0x5d,0x3c,0x41,0x48,0xf2,0xba,0x63, + 0xd7,0xae,0x32,0x1d,0x6c,0xf6,0x9a,0x13,0x33,0x23,0xac,0x63,0x55,0xff,0xd4,0x36, + 0x73,0x5c,0xe3,0xcc,0x5f,0x0,0x92,0xcb,0x65,0x7,0x41,0x18,0x88,0xa2,0x95,0xb6, + 0x54,0xa5,0x15,0x74,0x65,0xa2,0xff,0xff,0x3b,0x2e,0x58,0x98,0xb8,0x71,0xe5,0xc2, + 0xc4,0x98,0x0,0x3e,0x80,0x62,0xe3,0x19,0xfd,0x82,0xa6,0x93,0x3b,0x77,0xce,0x31, + 0xf5,0xa1,0x2e,0x7d,0xd8,0xef,0xb6,0x45,0x58,0xf6,0x6f,0x9,0x0,0x6f,0x72,0xa, + 0x71,0x56,0x91,0x1b,0xe6,0xe8,0xe8,0x76,0x48,0x5b,0x82,0x3a,0xc3,0x57,0xfa,0x81, + 0xde,0x96,0x3d,0x6b,0xa6,0xfe,0x85,0xc6,0x4c,0x2c,0x37,0x98,0xb4,0x4e,0x1a,0x23, + 0x19,0xa2,0x0,0x8a,0x95,0xab,0x4,0xff,0xd,0x3f,0x8f,0x85,0xea,0xf9,0x38,0x80, + 0xf5,0x17,0x57,0xa,0x8e,0xc9,0x3e,0x95,0xd4,0x8e,0xe1,0x2c,0xab,0x4f,0xcc,0x62, + 0xba,0x5d,0x2f,0xe7,0xd3,0x91,0xa6,0xb2,0xb9,0x72,0x79,0x32,0xd0,0x92,0x1d,0xcb, + 0x6a,0xee,0x2b,0x33,0x46,0x2,0xa8,0x8b,0xa0,0xda,0xc7,0xdd,0x6f,0x12,0x58,0xa3, + 0xb2,0x55,0xd7,0xe9,0xe4,0x9a,0x45,0xe5,0xbe,0x2,0x90,0x60,0x6,0x29,0xc,0xc2, + 0x40,0x14,0x9d,0x3a,0x41,0xa2,0x45,0xe8,0xc2,0x45,0xdd,0x88,0x7a,0xff,0x9b,0x58, + 0xe8,0x31,0x4a,0x71,0xd3,0x88,0x14,0xb,0x9,0xf6,0x4d,0xdc,0xcd,0x32,0x4c,0xfe, + 0xcc,0x7f,0x7f,0x90,0x86,0x22,0x41,0x5f,0xfb,0x71,0x1a,0x98,0xa3,0x9c,0x1c,0xe, + 0x44,0xfe,0xdd,0x41,0xc7,0xc8,0xf,0x58,0x56,0xc7,0x89,0xd8,0x78,0xc9,0x58,0xdd, + 0xc0,0xdc,0x14,0x26,0xbf,0x5c,0x24,0x46,0x15,0x87,0x39,0xc4,0xf4,0x47,0x59,0x80, + 0x3a,0xf1,0x44,0x40,0x4c,0x16,0xac,0x34,0xb6,0xc9,0x71,0x35,0xdf,0x2b,0xec,0x6e, + 0x20,0xf6,0x76,0x55,0xba,0x47,0x92,0x21,0x34,0xe8,0x25,0x6c,0x61,0x7e,0x3e,0x5e, + 0xcb,0x5b,0x54,0x9a,0x5b,0xc5,0xc2,0xa1,0xe3,0xe2,0x52,0xd7,0xdf,0x5d,0xe9,0xd6, + 0x10,0x44,0x23,0xd2,0x67,0xf0,0x48,0x2b,0xde,0x35,0x9f,0x65,0x63,0x4d,0x5c,0xdb, + 0x12,0x26,0xff,0xb,0xc0,0x81,0xb9,0xac,0x30,0x8,0x3,0x51,0x34,0xf1,0x11,0x5f, + 0x84,0xda,0x95,0x14,0x11,0xfc,0xff,0x2f,0x71,0xd1,0xaf,0x50,0xba,0x29,0xa5,0x5d, + 0x34,0x18,0xaa,0x43,0xed,0x99,0x6e,0x13,0x86,0xcc,0xc0,0xcc,0x9d,0x7b,0x92,0x16, + 0x5,0x3d,0xd,0x63,0x44,0x1a,0xb3,0xbb,0xf4,0xeb,0xca,0x9c,0xf1,0xbc,0x51,0x29, + 0x15,0x65,0x2b,0xfd,0x81,0x1,0xe7,0x38,0xdc,0xd4,0x27,0x7e,0x48,0xee,0x8b,0x71, + 0xa3,0xc9,0xac,0x45,0x9,0x32,0x87,0xda,0x8b,0x3d,0xb0,0xf2,0x38,0x46,0x8d,0x16, + 0x89,0xa8,0xc3,0xf6,0x77,0xbd,0x94,0x4c,0xf9,0x87,0x66,0xad,0x75,0x1a,0xa5,0x15, + 0xa4,0x58,0x8,0xc1,0x78,0x22,0xd3,0x46,0x42,0xc,0xd3,0x75,0x9a,0x6f,0xb,0x2b, + 0xc,0xb6,0x71,0x35,0x2e,0x14,0x1c,0xdc,0x4b,0xef,0x86,0xb1,0xe7,0x36,0xbc,0x5f, + 0xfe,0x54,0xf9,0xb6,0x61,0xc9,0x27,0x8c,0xb6,0xa4,0x8f,0xfb,0x13,0x42,0xad,0xce, + 0x79,0x59,0xe7,0x3f,0x1,0x48,0x2e,0x9b,0x16,0x4,0x42,0x20,0xc,0xeb,0x66,0x28, + 0x59,0x11,0x4,0xdd,0x82,0x2e,0x41,0x9d,0xfa,0xff,0xff,0x64,0xb,0xa,0x3a,0x6, + 0x19,0x4b,0x6d,0xae,0xa9,0x63,0xbd,0x63,0xf7,0x39,0x38,0x23,0xef,0xc7,0x83,0x8a, + 0x50,0xba,0xee,0x71,0x6c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,0x7a,0x48,0x46,0x28,0x30, + 0xf1,0xe,0xf9,0x4,0xe1,0xd0,0x9d,0x21,0x60,0x23,0x3a,0xa2,0x25,0xa0,0xa,0x2, + 0x74,0x7a,0xc6,0x87,0x93,0x6f,0x38,0x32,0xa0,0x10,0x49,0xae,0x54,0x48,0x86,0x40, + 0xc1,0x38,0xe,0xb4,0xe6,0x70,0xa5,0x98,0x26,0x7a,0x6b,0x6e,0xcf,0xab,0x73,0x4d, + 0x92,0x8d,0x32,0x99,0x55,0x26,0xd0,0x45,0x36,0x62,0x58,0xec,0x29,0x3f,0x9c,0x2f, + 0x5,0x2d,0xba,0x2c,0x1f,0xd5,0xab,0xe2,0x1f,0xa5,0xeb,0x84,0xae,0x67,0xdb,0xbe, + 0xae,0x2d,0x9c,0xdb,0xa5,0x9b,0x88,0x26,0xd3,0xbb,0xef,0x7d,0xe9,0x9a,0xfe,0x27, + 0x0,0x7,0xe6,0xb6,0x82,0x20,0x10,0x45,0xd1,0x1c,0xe7,0xd2,0x98,0x59,0x22,0x21, + 0x41,0x41,0xf8,0x14,0xf5,0x16,0xf4,0xff,0xff,0x23,0x6,0x5a,0x91,0x3a,0x23,0xd6, + 0x9a,0x7e,0xe0,0xc0,0xb9,0xec,0xbd,0xd7,0xc,0x92,0x37,0xe4,0xcb,0xd7,0x79,0xf9, + 0x27,0x52,0x4,0xfb,0x6a,0xdb,0x7e,0x1c,0xae,0xb7,0xbb,0xd4,0xe6,0x8d,0x2e,0x81, + 0x16,0x9a,0x8c,0x54,0xc0,0x7a,0x86,0x8c,0xc5,0xc7,0xe1,0x2b,0xf,0x7,0x84,0xec, + 0x11,0x87,0xb,0x57,0xef,0x43,0x49,0x26,0x2e,0x17,0x18,0x9f,0x4e,0x94,0x24,0xe7, + 0xb4,0x80,0x14,0x15,0xc1,0xaf,0x88,0xa4,0x48,0x1a,0x44,0x8,0x56,0x8,0x52,0x57, + 0xaf,0xc4,0xb1,0x2a,0xe,0xa7,0xcc,0xa4,0xe3,0xb6,0x4c,0xd2,0xc2,0x8a,0xb5,0x95, + 0x76,0xde,0x97,0xd9,0xf9,0x52,0x2d,0x2d,0xa0,0x35,0x77,0xcf,0x76,0x72,0x93,0x8e, + 0xcd,0x26,0xdd,0x71,0x39,0x75,0xf3,0x60,0x87,0x79,0x96,0x2b,0xde,0x4c,0x43,0xd4, + 0x77,0xfe,0x53,0x3b,0xdf,0xfb,0x9f,0x0,0x24,0x98,0xb1,0xe,0xc2,0x30,0xc,0x44, + 0x93,0x26,0xc4,0xb4,0x36,0xad,0x60,0x42,0xea,0x44,0x59,0xf8,0xff,0x5f,0x42,0x59, + 0xa8,0x80,0xad,0x90,0xb6,0x10,0xce,0x61,0xf7,0x62,0x2b,0xb9,0x7b,0x77,0x8e,0xb8, + 0x29,0xd0,0xb5,0xa8,0x6e,0x64,0x30,0xb6,0x72,0xda,0x6d,0x1c,0x67,0xe3,0x4f,0xc3, + 0x80,0x2c,0x33,0x6b,0xd9,0x67,0xa0,0x34,0x5a,0x5a,0xe6,0xe5,0x63,0x35,0xfa,0x63, + 0x66,0x2d,0x8c,0xaa,0x50,0xe7,0xb1,0x7b,0x32,0x79,0xaa,0x10,0x3,0xc9,0x19,0xf, + 0x4f,0x48,0x0,0x1,0xeb,0x4b,0xd3,0x7,0x1c,0x77,0x2a,0x3c,0x78,0x4b,0xff,0x4d, + 0x40,0xcf,0xd4,0xd2,0xb1,0x67,0xe9,0x56,0xe2,0xc4,0x87,0x8d,0x6d,0x9c,0x15,0x6a, + 0x77,0xe1,0x72,0xee,0xbb,0xbd,0xc0,0x6b,0x63,0xbc,0xe2,0x5a,0x14,0x6a,0xae,0xc5, + 0x7e,0xb7,0xf,0x24,0x89,0xf4,0x12,0xe1,0x50,0x5,0xfc,0x3c,0x48,0xe1,0x3d,0x3e, + 0xf3,0x5b,0x9d,0xf1,0x27,0x0,0x47,0x66,0x97,0x83,0x20,0x10,0x3,0x61,0x74,0x97, + 0xfd,0x3,0x59,0xe2,0xbe,0x70,0x2,0x13,0xe3,0xfd,0xf,0x64,0xc4,0x7,0x1f,0xc4, + 0x65,0xb,0xa8,0x90,0x88,0x53,0x4e,0xd0,0x26,0xfd,0xd2,0xce,0x4c,0x5,0x98,0x1, + 0x8,0x68,0x81,0x97,0xcb,0x96,0x3,0x6d,0x69,0xcc,0x7a,0xbb,0x3e,0x94,0x31,0xa7, + 0xcb,0x19,0xe,0x70,0xe4,0x44,0x0,0x77,0x36,0x63,0xa5,0xc7,0x8f,0x1,0xf6,0x6e, + 0xda,0x40,0xae,0x3b,0x1c,0x7c,0x1a,0xa8,0x7b,0xb6,0xb1,0xbf,0xd3,0xd0,0xd3,0x18, + 0x85,0xcc,0xca,0xda,0x15,0x95,0x83,0x9d,0xd5,0x1a,0x3d,0xc8,0xdc,0x4a,0x65,0x78, + 0x2c,0xca,0x49,0x53,0x28,0x8,0xb1,0x63,0x13,0x76,0x92,0x68,0x6a,0x95,0xfd,0x2c, + 0xe0,0xde,0xec,0x6d,0xf0,0x4d,0xf0,0x1,0xa3,0x53,0x22,0xa5,0x9e,0x28,0x95,0x45, + 0x95,0x4b,0x2e,0x12,0xe3,0xb7,0x7b,0x1,0x36,0xe7,0xab,0x3,0x8c,0xf8,0x9c,0x96, + 0x19,0x32,0x68,0xca,0xde,0x20,0x6e,0xfd,0xfd,0x5,0xe0,0xc0,0x5c,0x72,0x10,0x84, + 0xa1,0x28,0xda,0x96,0xb6,0x50,0x3e,0x11,0x13,0x89,0xe,0x1c,0xa9,0xcb,0x77,0xe2, + 0x4a,0x5c,0x82,0x3,0x63,0x30,0xc1,0x10,0x29,0x9f,0x42,0x3f,0xd4,0x57,0xb7,0xf0, + 0x92,0x7b,0xef,0x39,0xf,0xe0,0x46,0xdb,0x95,0x62,0xc6,0xb5,0xfb,0x3f,0x75,0x43, + 0x7b,0x43,0x77,0x98,0xdc,0xb5,0xf7,0xdb,0xb5,0x12,0x6e,0x77,0xde,0xdb,0xfe,0x65, + 0x57,0xb9,0xd8,0xa1,0x3a,0x1d,0x67,0x86,0xa6,0xb1,0x85,0xe3,0x23,0x5c,0x2,0xa2, + 0x0,0xbc,0x29,0xff,0xf0,0x45,0x87,0x43,0x98,0x89,0xb7,0xd1,0x57,0x71,0xf9,0xa4, + 0x19,0x2c,0xf,0x8,0x10,0xba,0x50,0x5e,0x88,0xa4,0xa4,0x51,0xb0,0x76,0x63,0x7a, + 0xa8,0xc1,0x34,0xa9,0x99,0x7f,0x77,0xa3,0x8c,0xd0,0x0,0xe0,0x9a,0x91,0x35,0x15, + 0x10,0xc,0x47,0x2,0xb9,0x40,0x3c,0xf4,0xbc,0x98,0x72,0x7b,0x20,0x3c,0x96,0x12, + 0x7c,0x51,0x75,0xf6,0xc3,0x72,0xbf,0x11,0x39,0x9b,0xe2,0xa9,0xd1,0xba,0xb1,0x5e, + 0x11,0x6a,0x70,0xc,0x7e,0x4e,0xf1,0x4f,0x0,0x9a,0xac,0x1c,0x9,0x61,0x18,0x6, + 0x46,0xd8,0x92,0xc2,0x55,0xd1,0xf0,0x1e,0xa,0xda,0xfc,0xff,0x5,0x69,0x68,0x32, + 0xc6,0x39,0xb0,0x93,0xb0,0xcb,0xc,0x1f,0xb0,0xc7,0xd6,0x1e,0x5a,0x49,0xb8,0xcb, + 0x10,0xf9,0x4d,0xe6,0xb6,0xfd,0xff,0x4,0x6,0xf0,0x60,0xdc,0x67,0xdc,0x2e,0x8f, + 0xee,0x79,0xbc,0xb7,0x43,0x45,0x8b,0x3b,0xcd,0x51,0xde,0xb4,0xb1,0xcc,0x39,0xfb, + 0x66,0x60,0xbe,0xb6,0x80,0x44,0x6e,0x74,0x21,0xbe,0xe0,0x15,0x8,0x72,0xe2,0x42, + 0xde,0xf0,0x5c,0x74,0xcb,0x1a,0xdc,0xf4,0x6a,0xe0,0x4,0xee,0x88,0x6b,0x88,0x1f, + 0x3d,0x14,0x12,0xc4,0x18,0x25,0xe0,0x79,0xe,0x2b,0x62,0xe5,0xcb,0xc9,0xcf,0x4d, + 0x85,0xf4,0x41,0x88,0x2,0xaa,0x86,0xff,0xcc,0xe3,0x92,0x12,0xba,0x86,0x2,0x63, + 0xf1,0xdd,0xa7,0xd7,0x3c,0xf4,0x29,0x54,0x30,0x4f,0xcb,0x48,0x24,0x43,0x9a,0xbe, + 0x2,0xd0,0x64,0xee,0x4a,0x8,0x83,0x40,0x14,0xd,0xbb,0x44,0x89,0x96,0x56,0x36, + 0xfe,0xff,0xa7,0x39,0x56,0x4e,0x2,0xe1,0x11,0xcc,0x78,0xd6,0x8c,0x54,0x94,0x50, + 0x70,0xcf,0xb9,0x8b,0x1e,0xdf,0x4a,0xc7,0xc4,0x74,0xf8,0x2f,0xf6,0xa6,0x34,0x68, + 0x57,0x8d,0x5b,0x5f,0xef,0x8f,0x5b,0x13,0xec,0xbb,0x54,0x3,0x16,0x78,0xb0,0x3a, + 0x3a,0x2a,0x67,0x18,0x7f,0xed,0xbc,0xc0,0x59,0xc,0xda,0x46,0xa2,0x0,0x8a,0xcc, + 0x17,0x31,0x6e,0xa,0xb9,0xff,0x24,0x3f,0xc4,0x45,0xe7,0x16,0xa7,0x73,0xb8,0x26, + 0x3d,0x99,0x5,0xc8,0x30,0xf1,0xec,0x50,0x3b,0x4f,0x69,0x20,0x78,0x3f,0x9b,0x8a, + 0x43,0x59,0x72,0xe9,0xe7,0xcb,0x84,0x26,0x2d,0x29,0xa6,0x5c,0xb8,0x87,0x11,0xaf, + 0xab,0xec,0xbe,0xad,0xed,0xfd,0x9a,0xa9,0x70,0xc1,0x87,0xbd,0x19,0x3b,0x39,0x65, + 0xad,0xf9,0x2b,0x0,0x4d,0x66,0xa0,0xc3,0x20,0x8,0x3,0xd1,0x49,0x69,0xd0,0x6c, + 0x31,0xfb,0x82,0xfd,0xff,0xa7,0x2d,0x4b,0x16,0xe3,0x36,0x1,0x95,0xd2,0x5d,0x25, + 0x7e,0x2,0xa5,0xdc,0xbd,0x3b,0xa0,0x7e,0x4d,0x7e,0xb4,0xfd,0x32,0x9d,0x7,0x80, + 0xeb,0x59,0xc1,0x48,0x17,0x7d,0x3d,0xdf,0xbe,0xcf,0xf7,0xc7,0xf8,0xab,0x1f,0x44, + 0x1a,0x31,0x36,0xcd,0x2,0x40,0xaf,0x2e,0x30,0x94,0x48,0x99,0x90,0x85,0x8d,0xd9, + 0x48,0x60,0x66,0x1d,0x43,0xb2,0x10,0x68,0xb6,0x15,0x3e,0xcc,0xbe,0x18,0x6f,0x56, + 0xb6,0xba,0xf5,0x70,0xe,0x69,0x5,0xa3,0x99,0x2,0x46,0x58,0x62,0x5a,0xf0,0xb2, + 0x80,0x9,0x29,0x45,0x90,0xdf,0x70,0xbd,0x69,0x47,0x33,0xa6,0x5e,0xc4,0xf9,0x50, + 0x6c,0xa9,0xc8,0xed,0x61,0x5b,0xf6,0xef,0x14,0xe3,0x9c,0xbd,0x12,0x14,0x17,0x3e, + 0x78,0x5c,0x1a,0x41,0xe1,0xff,0x2,0x70,0x65,0xe6,0x3a,0xc,0x83,0x40,0x10,0x5, + 0x9f,0x28,0x8a,0xb0,0x94,0x22,0x45,0xfa,0xfc,0xff,0x8f,0xa5,0x71,0xe,0x4c,0x14, + 0xf0,0xfa,0x4d,0xdc,0xb9,0x43,0x54,0xab,0x65,0xd8,0x9d,0xa3,0xdd,0xe3,0x9a,0xc3, + 0xb,0xe8,0x23,0x78,0x53,0xf8,0xc4,0xe,0x31,0x47,0x3f,0x6e,0xf7,0x6b,0x19,0x44, + 0x37,0x28,0xc1,0xfb,0x2c,0xa3,0x16,0xae,0x40,0x9d,0xe9,0xb5,0xe6,0x37,0x7,0xcf, + 0xd8,0x37,0x61,0x92,0x7b,0x2d,0x71,0x99,0x53,0xc8,0xde,0xd8,0xd4,0xc9,0x4a,0x4, + 0x20,0xae,0x9e,0xac,0x4,0x57,0xcf,0xff,0xac,0xb,0x4d,0x7,0xd6,0x97,0x9d,0x6a, + 0xa4,0xbc,0x8c,0x21,0xc4,0xe9,0xc2,0x50,0x83,0x76,0x74,0xdd,0x88,0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xae,0xac,0x2d,0x7,0x40,0x10,0x86,0x61,0x96,0x69,0xbc,0x1, + 0xf1,0xfe,0xe7,0xd3,0x28,0xf1,0x39,0x19,0xb6,0xf8,0x61,0xe2,0x3f,0x1f,0xb0,0x75, + 0x74,0x6d,0xbf,0x21,0xfe,0xbf,0x0,0x7f,0xa,0x19,0xe1,0xad,0x5c,0x41,0x87,0x8f, + 0x79,0xcf,0x76,0xc7,0x21,0xa,0x9d,0xe8,0xcb,0x99,0x42,0x30,0x64,0xe,0x14,0xe6, + 0x5e,0xe3,0x10,0xd7,0x5a,0xe,0x82,0x86,0xce,0x0,0xa8,0xa1,0x2b,0xb9,0x35,0x93, + 0xf3,0x2,0xd6,0xc4,0xb1,0x2d,0x66,0x15,0x6c,0x9b,0x66,0x55,0x52,0xd0,0x5f,0x4, + 0xac,0x71,0xba,0x4a,0xbb,0x2,0xae,0x53,0xdc,0xff,0x76,0xcc,0xde,0x3a,0xa5,0x34, + 0x2e,0xe4,0x40,0xed,0x85,0xb6,0x21,0x24,0x3c,0x9a,0x4d,0x47,0xa1,0xa1,0x4e,0xc, + 0xc7,0xb9,0x1,0x9f,0x8f,0x0,0x5c,0x99,0x5b,0xe,0x40,0x40,0xc,0x45,0x87,0xf2, + 0x41,0xbc,0x63,0xff,0x3b,0x14,0x19,0x11,0x31,0xc1,0x70,0x2e,0x7f,0x36,0x30,0xe9, + 0xed,0xa4,0xb7,0xa7,0xad,0xe5,0x64,0x49,0x9b,0x38,0xf7,0x2b,0x62,0x8d,0x8a,0x89, + 0x96,0x2c,0xb8,0xc8,0x6b,0xab,0x27,0xa0,0xec,0x97,0xb5,0x1e,0xea,0x7e,0x6c,0x20, + 0x5,0xac,0x94,0x4e,0xa9,0x38,0xce,0x20,0x64,0x88,0xef,0x4,0x20,0xae,0x22,0x51, + 0x2a,0x7,0x7a,0x3c,0x96,0x8b,0xf6,0xef,0x84,0xa5,0x5d,0x97,0x51,0x3d,0x56,0x16, + 0x90,0x83,0xcb,0x35,0x53,0x22,0x4f,0x80,0x4f,0x58,0x80,0x83,0xf1,0x69,0xd1,0x85, + 0x6d,0xb7,0x98,0xe2,0x76,0x7e,0x9a,0x2d,0xc9,0xba,0xaa,0xe5,0x45,0x4,0xa3,0x41, + 0xda,0x48,0xa,0x4e,0x12,0x74,0x78,0xba,0xee,0x83,0xe0,0x1f,0x1,0xb8,0x30,0x97, + 0x24,0x0,0x41,0x18,0x86,0x56,0x47,0xf9,0xe8,0xfd,0xaf,0xe9,0x67,0x46,0x7,0x50, + 0x4,0x5f,0x71,0xe7,0x8e,0x65,0xd2,0x36,0x9,0xad,0x76,0xe0,0x53,0xf0,0x8f,0x40, + 0xd7,0x37,0x2,0x4a,0xa3,0x28,0xd1,0x47,0x7c,0xa5,0xa,0xb2,0x9e,0x7b,0x96,0x28, + 0x46,0x8,0x2b,0xe4,0x77,0x5d,0x64,0x43,0x4,0x2e,0xd3,0xb,0x8d,0x5b,0xd7,0xae, + 0xaa,0x32,0x68,0xe6,0xc6,0x14,0xa1,0x4c,0xac,0xc0,0xb4,0x3f,0x12,0x7b,0x1a,0x49, + 0x31,0x59,0xdb,0xca,0x42,0x1a,0x60,0x20,0xf8,0x30,0x9d,0xd3,0x4b,0xd9,0x80,0x71, + 0x3c,0x5,0x94,0x39,0xe4,0x7d,0xd9,0x78,0xcc,0xce,0x87,0x23,0x26,0x75,0xe4,0xe2, + 0xac,0x7,0xb,0x69,0x10,0x43,0x82,0xb0,0x9e,0x72,0x7b,0xf4,0x36,0xbe,0x2,0x90, + 0x69,0x2d,0x4b,0x0,0x82,0x20,0x50,0x49,0x7b,0x58,0x87,0xfe,0xff,0x23,0x3b,0x55, + 0x34,0x29,0xda,0x6e,0xd3,0xad,0x23,0x1e,0x64,0x18,0x58,0x58,0x5c,0xbf,0xc,0xfc, + 0x4b,0x48,0x2a,0xb5,0x44,0xcc,0x4a,0xe1,0xed,0xb0,0x1d,0xc0,0xc5,0x50,0x70,0x92, + 0xe3,0xbd,0xd5,0xb6,0xfb,0xe4,0x26,0x70,0x36,0xb1,0xc9,0x80,0xe9,0x11,0x3d,0xb, + 0x29,0x41,0x11,0x84,0x57,0xd7,0x34,0x8e,0x65,0xac,0x60,0xd9,0x3a,0x0,0xb7,0xc9, + 0xec,0x87,0xa5,0xc5,0x55,0x52,0xe4,0x5e,0x7c,0xf1,0xf,0x2,0x8,0x95,0xa7,0x72, + 0xc1,0x49,0x21,0xb2,0x0,0x1c,0x56,0xf4,0x54,0xdd,0x15,0x71,0x7b,0xd7,0x9f,0x5a, + 0xf4,0x28,0x21,0x47,0xf4,0x7e,0x38,0xba,0x69,0x66,0xbe,0x54,0x3a,0x2a,0xa5,0x81, + 0x44,0xbe,0x7b,0x4,0xa0,0xd3,0xc,0x72,0x0,0x4,0x61,0x20,0x48,0x41,0x25,0xf1, + 0xa0,0xc6,0xff,0xbf,0xd2,0x44,0xa3,0x88,0xc4,0x9d,0x7a,0x96,0x17,0x50,0x92,0xdd, + 0xb6,0x3b,0x74,0xe1,0xe7,0x60,0x4a,0xe1,0x63,0x6,0xc6,0x42,0x1c,0x51,0xa7,0xca, + 0xd0,0x78,0xa6,0x97,0x3b,0x8f,0x52,0x43,0xd3,0xd8,0xa2,0xf5,0x6b,0x5a,0xe6,0xbc, + 0xa6,0x6c,0x32,0xc5,0x1,0xa,0x43,0xb8,0xed,0x1,0x2b,0x66,0xb,0x2e,0x80,0x1, + 0xd4,0x96,0x46,0xff,0x54,0x22,0xa9,0x40,0x54,0x33,0x29,0x85,0xa7,0x36,0x91,0x4, + 0x18,0xc9,0xe8,0x4e,0x97,0xf6,0xf2,0x5b,0x2a,0x97,0x64,0xfb,0x7d,0x53,0x67,0x2e, + 0x34,0x5d,0xc,0xf8,0xa1,0x5f,0x57,0x47,0x36,0x66,0x2a,0x32,0x91,0x53,0x1,0x22, + 0x5f,0x1,0xe8,0x34,0x83,0x1d,0x0,0x41,0x18,0x86,0x2a,0xa2,0x98,0x18,0xfd,0xff, + 0x3f,0xf4,0xc0,0xd1,0x98,0x48,0x2,0x68,0x5f,0xef,0xde,0x77,0x28,0x6c,0xb0,0xad, + 0xed,0x6f,0x6,0xc6,0xc1,0xda,0xbe,0xd7,0x1d,0x5c,0x8,0x11,0x6f,0x3,0x14,0xd0, + 0x3a,0x2f,0x29,0x29,0x60,0x3f,0xb6,0xf2,0x94,0x7c,0x66,0xe5,0x54,0x53,0x80,0xba, + 0xe3,0xd4,0xfd,0x43,0x23,0xf1,0xeb,0xa4,0x48,0x82,0x34,0x43,0x3,0x7d,0x3d,0xb7, + 0xb0,0xdc,0xbb,0xd8,0xac,0xb3,0x57,0x24,0x48,0xe8,0x80,0x5e,0xed,0xb5,0x10,0xc2, + 0xa6,0xdb,0x55,0xaf,0x1d,0xa2,0xea,0xf1,0xbe,0x60,0xee,0xb0,0x1a,0x10,0x40,0xf5, + 0x9,0x54,0x83,0x25,0xd1,0x23,0x80,0x6b,0x43,0x53,0xe,0xe1,0x13,0x80,0x2e,0xb3, + 0x59,0x1,0x10,0x4,0x82,0x70,0x69,0xda,0x16,0x8,0x51,0xd0,0xfb,0xbf,0x5e,0xd0, + 0x31,0xf2,0x2f,0xab,0x19,0x3b,0x77,0xf3,0xa0,0xb,0xeb,0x2c,0xeb,0xce,0xe7,0xaf, + 0x2,0xc4,0x11,0xec,0xcc,0x2d,0x2d,0x3a,0xea,0xd1,0x42,0x60,0x38,0x18,0x2e,0xee, + 0x6f,0x6e,0x4d,0x98,0x45,0xed,0x2c,0x4b,0xf6,0xc5,0x6f,0xa1,0x1c,0x29,0xef,0x79, + 0x5a,0xdd,0xe8,0x4,0xc5,0xa1,0xd,0x92,0xc6,0x79,0x42,0x8a,0xa6,0xca,0xa8,0x2a, + 0x0,0xe8,0xcc,0x93,0x31,0x6d,0x26,0x8f,0x10,0x5a,0x45,0xba,0x9,0x22,0xf1,0xa, + 0x8e,0x68,0x16,0x50,0x59,0x2a,0x9c,0x44,0xf4,0x5,0x56,0x8a,0x60,0x92,0xdf,0x9b, + 0x48,0x15,0xfb,0x70,0xa7,0xe1,0x8a,0x78,0x29,0x44,0x86,0xde,0x40,0x1,0x76,0x8b, + 0x57,0x0,0x3e,0xcd,0x24,0x7,0x40,0x18,0x86,0x81,0x80,0x4a,0x29,0xa8,0x12,0xff, + 0x7f,0x27,0x62,0xe9,0x2,0x65,0x1c,0xee,0x5c,0xa3,0xf6,0x10,0x25,0xb1,0x63,0x39, + 0x3f,0x9,0x18,0xc1,0xd1,0x33,0xb3,0xc,0x2f,0x67,0xa7,0x2d,0x30,0xa6,0x9b,0x34, + 0xf4,0x84,0xba,0x3a,0x5c,0x5b,0x2,0x52,0x7c,0x33,0xb5,0xbb,0x97,0xf3,0x28,0x2d, + 0x6d,0x79,0xad,0x3e,0xba,0x25,0x4e,0x4a,0x55,0x57,0x7,0x66,0xf7,0x7f,0xd0,0xa, + 0x8b,0x36,0x9e,0xc9,0x18,0xd0,0x61,0x40,0xcf,0xa,0x7d,0x33,0x22,0x66,0xf,0xb1, + 0xb6,0x49,0xf2,0xa8,0x56,0x19,0x8d,0xfe,0xc0,0x3e,0x83,0xf4,0x47,0xa5,0x20,0xf4, + 0x1d,0x71,0x60,0x5f,0xd3,0x1c,0xc2,0xa8,0xfe,0xd1,0x16,0xca,0xa7,0x57,0x0,0x2a, + 0xcd,0x25,0x7,0x40,0x10,0x6,0xa2,0x16,0xa3,0xe0,0xfd,0x6f,0xaa,0x31,0x86,0x84, + 0x10,0xdf,0x6b,0xe2,0xc2,0x3d,0x2c,0xe8,0x67,0xda,0x99,0xc1,0x12,0xfa,0x3c,0x8d, + 0x1f,0x92,0x66,0xcd,0x47,0x3d,0x2a,0xb4,0x90,0xd8,0x83,0x79,0x3c,0x23,0xf4,0x53, + 0x3c,0xd9,0xb6,0x46,0x91,0xf4,0xa7,0xf,0xc6,0x19,0x4b,0x27,0x2d,0xa0,0xd7,0xe2, + 0x28,0xbd,0xce,0x9b,0x2e,0x54,0x8d,0x67,0x73,0x2d,0xa9,0x3b,0x46,0x65,0x57,0x75, + 0xbb,0x1a,0xaa,0xce,0x39,0xbf,0xb8,0xb2,0xaf,0x9a,0x70,0x89,0xbd,0x14,0xa9,0x1e, + 0x82,0xf4,0x5d,0x60,0x4d,0x4a,0x35,0x15,0x3c,0xfc,0x25,0x50,0xe0,0xd6,0x90,0xa3, + 0x14,0x86,0x49,0x2,0xb1,0x13,0x17,0x49,0xb0,0x2d,0xb0,0xbc,0x2,0x90,0x69,0x2e, + 0x39,0x0,0x83,0x20,0x14,0xec,0xc2,0xfb,0x9f,0xb5,0x8d,0x11,0xa3,0xb1,0x9f,0x19, + 0xba,0x74,0x67,0x88,0x89,0x28,0xf,0x78,0x8,0x86,0xd1,0x9d,0x47,0xfc,0x84,0x14, + 0x6b,0x82,0xb4,0xcc,0x2d,0x3a,0x80,0x99,0x2a,0x85,0xa0,0xa,0x16,0x14,0x11,0xdc, + 0x81,0x9a,0x42,0x66,0xad,0xd8,0xee,0xb2,0xfc,0xef,0x3d,0xe6,0x58,0xad,0xc6,0x75, + 0xd6,0x16,0xfd,0x59,0xbc,0x3a,0x1b,0x38,0x8e,0x28,0xae,0x7e,0xf9,0x25,0x5a,0x74, + 0xf,0xf5,0xf3,0xd7,0x4c,0x2,0x24,0x5d,0xb5,0x28,0x14,0xf4,0x58,0x60,0x40,0xb7, + 0x6f,0xe7,0x45,0x32,0x75,0xd8,0xe5,0xc6,0x68,0x8e,0x41,0x14,0x3b,0x7a,0xd9,0x81, + 0x7,0x90,0x2c,0x3f,0x1,0xb8,0x34,0x83,0x1d,0x0,0x41,0x18,0x86,0xa,0x12,0x9, + 0x44,0xff,0xff,0x27,0xbd,0xa8,0x21,0x41,0x34,0x6a,0x1f,0xbb,0x79,0xe1,0x46,0x42, + 0x46,0xd6,0x76,0x5d,0x83,0xbd,0xdb,0xce,0x5f,0x2b,0xab,0x40,0x34,0xa1,0x7f,0x25, + 0xb9,0x74,0x49,0x13,0x3d,0x6b,0xa8,0xa7,0x93,0x37,0xae,0x5a,0xd3,0xf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x93,0x17,0x20,0x81,0x35,0x6d,0x69, + 0x37,0x82,0xad,0x1f,0x2f,0xf4,0x11,0x3f,0x98,0x81,0xd8,0xd9,0x23,0x89,0x83,0x96, + 0xca,0xbe,0x87,0xbb,0x4f,0xf8,0xff,0xb8,0x19,0x41,0xe3,0xa5,0xd0,0x56,0x6a,0x9e, + 0x19,0xba,0x7a,0xec,0x84,0x9a,0x9b,0x5c,0x83,0x75,0xcc,0x60,0xd0,0xd5,0xd9,0x32, + 0xa1,0x6f,0xd9,0xed,0xd8,0xd6,0x5a,0x66,0x1,0xef,0xe,0x82,0x81,0x11,0x1f,0xf2, + 0x31,0x1a,0x1d,0x46,0x2f,0x1d,0x11,0x8f,0x77,0xfd,0x5e,0xd2,0x40,0x8e,0xba,0x3c, + 0xde,0x8a,0x89,0x21,0xf6,0xaf,0x0,0x54,0x9a,0x51,0xe,0x80,0x30,0x8,0x43,0x75, + 0x73,0x5f,0x9c,0xc1,0xec,0xfe,0xb7,0x9b,0x5f,0x26,0xba,0x38,0xfb,0x3a,0x7f,0x3c, + 0x1,0x10,0xa0,0xd0,0xc2,0xb7,0x4a,0xcc,0xd,0xf5,0xd7,0xc4,0xfe,0xd5,0x92,0x97, + 0x11,0x1,0x9e,0xc,0x84,0x75,0x95,0x6f,0xdd,0x6b,0x3b,0x9a,0x20,0x5d,0xc6,0xb8, + 0x5,0x97,0x64,0x16,0x29,0x5e,0x72,0x23,0xcb,0x30,0x33,0xc4,0xb0,0x37,0xc6,0x6b, + 0x87,0x33,0x2e,0xce,0x3e,0xfa,0x99,0xb2,0xf2,0xc,0xf5,0x93,0xc2,0x3e,0x2f,0xe, + 0xb7,0x2,0x44,0xa0,0x71,0x4a,0xc4,0x7e,0x67,0x11,0xb9,0x2f,0xf4,0xa4,0x5,0x79, + 0x32,0xe,0x1,0xd7,0x8e,0xeb,0xcf,0x19,0x85,0xb8,0xba,0x1e,0x3a,0xd2,0x6a,0xb2, + 0x91,0x9c,0x5f,0x1,0x68,0x34,0xb7,0x15,0x0,0x41,0x20,0x88,0xb2,0x5e,0x2a,0xa2, + 0xc0,0xb7,0xfa,0xff,0x5f,0x14,0x29,0x12,0xa1,0x33,0x99,0xf,0xbe,0x9,0xee,0x2e, + 0xb3,0x97,0x59,0x27,0x74,0x61,0x45,0xcf,0xe3,0x4e,0x2c,0x15,0x39,0x12,0x53,0x42, + 0x91,0xc9,0x7d,0x9f,0x59,0xde,0x31,0x31,0x33,0x78,0xb8,0xf3,0x38,0xcb,0x55,0x28, + 0xe3,0x4c,0x41,0xa6,0x76,0x4f,0x3a,0x52,0x18,0x39,0x3c,0x10,0x47,0xfb,0x90,0x68, + 0x64,0x60,0xb2,0xfe,0x3e,0x9,0x26,0xf2,0x41,0xb0,0xcf,0x16,0xa7,0x15,0x1c,0xe4, + 0xbb,0xd5,0xf2,0x6c,0xbb,0xa5,0xb4,0x10,0x9,0x80,0x4f,0xe3,0x35,0x6d,0x6d,0x30, + 0xc2,0x69,0xc7,0xd6,0xb4,0x49,0xf3,0xe2,0x79,0x26,0xa2,0x24,0x99,0x1c,0xd6,0x73, + 0x57,0xb4,0x2c,0xcc,0x8a,0xe0,0x2b,0x0,0x91,0x56,0x90,0x3,0x20,0x8,0xc3,0x70, + 0xc1,0xa3,0xd3,0xe8,0xff,0xdf,0x67,0xc2,0x49,0x4f,0x1c,0x20,0xcc,0xb5,0x23,0xf1, + 0xce,0x85,0xc2,0xb6,0xae,0xed,0x5f,0x3,0x34,0xeb,0xc3,0xa2,0x1c,0xde,0x34,0x7d, + 0x58,0x50,0x26,0xb2,0xa9,0x52,0x98,0x6d,0xaa,0x4e,0x76,0xee,0x52,0x10,0x33,0xca, + 0x39,0x56,0xb9,0x25,0x9a,0x7c,0x8a,0x61,0x45,0xe7,0x3a,0x49,0x30,0x11,0x22,0x32, + 0xe5,0x2,0x10,0x3b,0x3e,0xf5,0x60,0xf4,0x70,0x96,0x4a,0xf7,0x95,0xc0,0xde,0xa7, + 0xd5,0x5a,0xcf,0xeb,0xd0,0x1d,0x12,0xa9,0xf7,0x37,0x88,0xad,0x38,0xda,0x91,0x97, + 0x3,0x29,0x7,0xde,0x4c,0xd,0x9,0xef,0x29,0xf1,0xbb,0xd,0xc8,0xae,0x9f,0x0, + 0x4c,0x9a,0xc1,0xa,0xc0,0x20,0xc,0x43,0xc5,0xed,0x30,0xfc,0xff,0x1f,0x75,0x50, + 0x3c,0x8c,0xe9,0xfa,0x92,0xd,0x76,0x93,0x42,0xa1,0x11,0x69,0x4d,0x93,0x97,0xf, + 0x78,0xe,0x88,0x4f,0x65,0xe9,0x47,0x6b,0x34,0x8a,0x2,0xd8,0x2d,0x1f,0x92,0xc, + 0xd,0x2b,0xe3,0x67,0xef,0x23,0x2,0x27,0x20,0x83,0xf0,0x3,0x3c,0xe7,0xdf,0x42, + 0xe5,0xe5,0x80,0x63,0xc6,0x6f,0xc3,0xa1,0xc9,0xb7,0xfe,0x85,0x40,0x55,0x2,0xc2, + 0x26,0x33,0x7a,0xae,0x88,0x91,0x6d,0xab,0x62,0xad,0xd8,0xed,0x17,0xbb,0xd8,0x60, + 0x4b,0x68,0xb9,0x8b,0xd9,0xa3,0xb2,0xb9,0xa5,0x3c,0x2,0x6,0xd1,0xaa,0x3e,0x2, + 0x30,0x69,0x2e,0x29,0x0,0xc3,0x20,0x10,0x25,0x4a,0x7b,0xff,0xd3,0xd6,0x42,0x16, + 0xc9,0x3c,0x87,0x86,0x6e,0xb3,0x12,0xd4,0xf9,0x98,0x49,0x59,0xb5,0x53,0x3d,0xc, + 0x25,0xf7,0x23,0xf3,0xc6,0x12,0x2e,0x95,0x8e,0x62,0x98,0x8,0x14,0xe9,0x1f,0xe1, + 0x4f,0x49,0xac,0xb3,0x65,0xe9,0xbe,0x39,0x78,0xe4,0xd2,0xcf,0x3d,0xe6,0x7f,0xdd, + 0xf8,0xd2,0x92,0xe1,0x76,0xf5,0xb,0x72,0xae,0xbf,0xe3,0x1,0xc3,0xe,0x36,0xa4, + 0xe6,0x5c,0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,0x0,0x2,0x70, + 0x69,0x5,0x39,0x0,0x82,0x30,0x4c,0x37,0x85,0xff,0x3f,0x57,0x22,0xcc,0xb6,0x13, + 0x62,0xbc,0xc1,0x6d,0xb,0x6d,0xe9,0xa0,0x8a,0x25,0x4d,0x2,0x64,0x1d,0x29,0xe7, + 0x4,0x46,0xbc,0xe1,0x9b,0xab,0xb5,0xac,0xc8,0xe8,0x46,0x6c,0x35,0xb0,0x4f,0x38, + 0xe5,0x76,0xbd,0x10,0x7f,0x55,0xe1,0xd7,0xaa,0xbe,0xfd,0x3a,0x8e,0xb6,0x9c,0x91, + 0x84,0x57,0xe2,0x72,0xbb,0x95,0x68,0x1a,0x82,0x9,0xac,0x4,0x47,0x6b,0x8c,0x3f, + 0xa3,0x44,0x85,0x55,0x4,0x92,0xc3,0x4d,0xaa,0xdc,0xc3,0x9c,0xb,0xde,0x6a,0x60, + 0x93,0x1f,0x8f,0x0,0x3,0x0,0x87,0x84,0x2a,0x97,0x59,0xf0,0x66,0x15,0x0,0x0, + 0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82, + }; static const unsigned char qt_resource_name[] = { - // icons - 0x0,0x5, - 0x0,0x6f,0xa6,0x53, - 0x0,0x69, - 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x73, + // icons + 0x0,0x5, + 0x0,0x6f,0xa6,0x53, + 0x0,0x69, + 0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x73, // fit-page-32.png - 0x0,0xf, - 0xe,0xe8,0x18,0x47, - 0x0,0x66, - 0x0,0x69,0x0,0x74,0x0,0x2d,0x0,0x70,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x2d,0x0,0x33,0x0,0x32,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0xf, + 0xe,0xe8,0x18,0x47, + 0x0,0x66, + 0x0,0x69,0x0,0x74,0x0,0x2d,0x0,0x70,0x0,0x61,0x0,0x67,0x0,0x65,0x0,0x2d,0x0,0x33,0x0,0x32,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // inputPoint.png - 0x0,0xe, - 0x6,0xae,0x65,0xe7, - 0x0,0x69, - 0x0,0x6e,0x0,0x70,0x0,0x75,0x0,0x74,0x0,0x50,0x0,0x6f,0x0,0x69,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0xe, + 0x6,0xae,0x65,0xe7, + 0x0,0x69, + 0x0,0x6e,0x0,0x70,0x0,0x75,0x0,0x74,0x0,0x50,0x0,0x6f,0x0,0x69,0x0,0x6e,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // vertex.png - 0x0,0xa, - 0xa,0xc4,0xce,0x67, - 0x0,0x76, - 0x0,0x65,0x0,0x72,0x0,0x74,0x0,0x65,0x0,0x78,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0xa, + 0xa,0xc4,0xce,0x67, + 0x0,0x76, + 0x0,0x65,0x0,0x72,0x0,0x74,0x0,0x65,0x0,0x78,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // until.png - 0x0,0x9, - 0xa,0xff,0xaf,0xe7, - 0x0,0x75, - 0x0,0x6e,0x0,0x74,0x0,0x69,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0x9, + 0xa,0xff,0xaf,0xe7, + 0x0,0x75, + 0x0,0x6e,0x0,0x74,0x0,0x69,0x0,0x6c,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // triangulation.png - 0x0,0x11, - 0x8,0x9f,0x38,0x7, - 0x0,0x74, - 0x0,0x72,0x0,0x69,0x0,0x61,0x0,0x6e,0x0,0x67,0x0,0x75,0x0,0x6c,0x0,0x61,0x0,0x74,0x0,0x69,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - + 0x0,0x11, + 0x8,0x9f,0x38,0x7, + 0x0,0x74, + 0x0,0x72,0x0,0x69,0x0,0x61,0x0,0x6e,0x0,0x67,0x0,0x75,0x0,0x6c,0x0,0x61,0x0,0x74,0x0,0x69,0x0,0x6f,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + // fileSave.png - 0x0,0xc, - 0x5,0x68,0x2,0x67, - 0x0,0x66, - 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x53,0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0xc, + 0x5,0x68,0x2,0x67, + 0x0,0x66, + 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x53,0x0,0x61,0x0,0x76,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // Voronoi_diagram_2.png - 0x0,0x15, - 0x3,0x5d,0x10,0x67, - 0x0,0x56, - 0x0,0x6f,0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x6f,0x0,0x69,0x0,0x5f,0x0,0x64,0x0,0x69,0x0,0x61,0x0,0x67,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x5f,0x0,0x32, - 0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0x15, + 0x3,0x5d,0x10,0x67, + 0x0,0x56, + 0x0,0x6f,0x0,0x72,0x0,0x6f,0x0,0x6e,0x0,0x6f,0x0,0x69,0x0,0x5f,0x0,0x64,0x0,0x69,0x0,0x61,0x0,0x67,0x0,0x72,0x0,0x61,0x0,0x6d,0x0,0x5f,0x0,0x32, + 0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // fileNew.png - 0x0,0xb, - 0x4,0x14,0x52,0x7, - 0x0,0x66, - 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x4e,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0xb, + 0x4,0x14,0x52,0x7, + 0x0,0x66, + 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x4e,0x0,0x65,0x0,0x77,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // fileOpen.png - 0x0,0xc, - 0xb,0x21,0x3,0x87, - 0x0,0x66, - 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x4f,0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + 0x0,0xc, + 0xb,0x21,0x3,0x87, + 0x0,0x66, + 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x4f,0x0,0x70,0x0,0x65,0x0,0x6e,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, // snapshot.png - 0x0,0xc, - 0x0,0x2e,0x58,0x67, - 0x0,0x73, - 0x0,0x6e,0x0,0x61,0x0,0x70,0x0,0x73,0x0,0x68,0x0,0x6f,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, - + 0x0,0xc, + 0x0,0x2e,0x58,0x67, + 0x0,0x73, + 0x0,0x6e,0x0,0x61,0x0,0x70,0x0,0x73,0x0,0x68,0x0,0x6f,0x0,0x74,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67, + }; static const unsigned char qt_resource_struct[] = { - // : - 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, - // :/icons - 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0x2, - // :/icons/snapshot.png - 0x0,0x0,0x1,0x38,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x48,0x5e, - // :/icons/Voronoi_diagram_2.png - 0x0,0x0,0x0,0xce,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x32,0xbf, - // :/icons/fileNew.png - 0x0,0x0,0x0,0xfe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3e,0xd8, - // :/icons/fileSave.png - 0x0,0x0,0x0,0xb0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x2e,0x6, - // :/icons/inputPoint.png - 0x0,0x0,0x0,0x34,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x5,0x36, - // :/icons/triangulation.png - 0x0,0x0,0x0,0x88,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x10,0x87, - // :/icons/vertex.png - 0x0,0x0,0x0,0x56,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9,0xb3, - // :/icons/until.png - 0x0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb,0x1f, - // :/icons/fileOpen.png - 0x0,0x0,0x1,0x1a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x41,0xdc, - // :/icons/fit-page-32.png - 0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, + // : + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1, + // :/icons + 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xa,0x0,0x0,0x0,0x2, + // :/icons/snapshot.png + 0x0,0x0,0x1,0x38,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x48,0x5e, + // :/icons/Voronoi_diagram_2.png + 0x0,0x0,0x0,0xce,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x32,0xbf, + // :/icons/fileNew.png + 0x0,0x0,0x0,0xfe,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x3e,0xd8, + // :/icons/fileSave.png + 0x0,0x0,0x0,0xb0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x2e,0x6, + // :/icons/inputPoint.png + 0x0,0x0,0x0,0x34,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x5,0x36, + // :/icons/triangulation.png + 0x0,0x0,0x0,0x88,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x10,0x87, + // :/icons/vertex.png + 0x0,0x0,0x0,0x56,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x9,0xb3, + // :/icons/until.png + 0x0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0xb,0x1f, + // :/icons/fileOpen.png + 0x0,0x0,0x1,0x1a,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x41,0xdc, + // :/icons/fit-page-32.png + 0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, }; QT_BEGIN_NAMESPACE extern Q_CORE_EXPORT bool qRegisterResourceData - (int, const unsigned char *, const unsigned char *, const unsigned char *); +(int, const unsigned char *, const unsigned char *, const unsigned char *); extern Q_CORE_EXPORT bool qUnregisterResourceData - (int, const unsigned char *, const unsigned char *, const unsigned char *); +(int, const unsigned char *, const unsigned char *, const unsigned char *); QT_END_NAMESPACE int QT_MANGLE_NAMESPACE(qInitResources_pwsrec)() { - QT_PREPEND_NAMESPACE(qRegisterResourceData) - (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); - return 1; + QT_PREPEND_NAMESPACE(qRegisterResourceData) + (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; } Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_pwsrec)) int QT_MANGLE_NAMESPACE(qCleanupResources_pwsrec)() { - QT_PREPEND_NAMESPACE(qUnregisterResourceData) - (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); - return 1; + QT_PREPEND_NAMESPACE(qUnregisterResourceData) + (0x01, qt_resource_struct, qt_resource_name, qt_resource_data); + return 1; } Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_pwsrec)) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h index 4cb1fc65900..b8886e54b7c 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/random.h @@ -4,23 +4,23 @@ inline double random_double(const double min, const double max) { - double range = max - min; - return min + (double(rand()) / double(RAND_MAX)) * range; + double range = max - min; + return min + (double(rand()) / double(RAND_MAX)) * range; } inline int random_int(const int min, const int max) { - int range = max - min; - return min + int((double(rand())/double(RAND_MAX)) * range); + int range = max - min; + return min + int((double(rand())/double(RAND_MAX)) * range); } template Vector random_vec(const double scale) { - double dx = random_double(-scale, scale); - double dy = random_double(-scale, scale); - return Vector(dx, dy); + double dx = random_double(-scale, scale); + double dy = random_double(-scale, scale); + return Vector(dx, dy); } #endif diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 544e2e7be93..a615cbc5da4 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -13,931 +13,931 @@ typedef Reconstruction_simplification_kerneled_2 R_s_k_2; void R_s_k_2::print_stats() const { - int nb_solid = 0; - int nb_ghost = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) nb_ghost++; - else nb_solid++; - } - - std::cerr << blue << "STATS" << white << std::endl; - std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; - std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; - std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; - std::cerr << "# solid: " << nb_solid << std::endl; - std::cerr << "# ghost: " << nb_ghost << std::endl; + int nb_solid = 0; + int nb_ghost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) nb_ghost++; + else nb_solid++; + } + + std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; + std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; + std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; + std::cerr << "# solid: " << nb_solid << std::endl; + std::cerr << "# ghost: " << nb_ghost << std::endl; } QColor R_s_k_2::get_color(float value) const { - float hue = 240.0*(1.0 - value); - QColor color; - color.setHsv(hue, 255, 255); - return color; + float hue = 240.0*(1.0 - value); + QColor color; + color.setHsv(hue, 255, 255); + return color; } void R_s_k_2::draw_point(const Point& point) { - ::glBegin(GL_POINTS); - ::glVertex2f(point.x(), point.y()); - ::glEnd(); + ::glBegin(GL_POINTS); + ::glVertex2f(point.x(), point.y()); + ::glEnd(); } void R_s_k_2::draw_segment(const Point& s, const Point& t) { - ::glBegin(GL_LINES); - ::glVertex2d(s.x(), s.y()); - ::glVertex2d(t.x(), t.y()); - ::glEnd(); + ::glBegin(GL_LINES); + ::glVertex2d(s.x(), s.y()); + ::glVertex2d(t.x(), t.y()); + ::glEnd(); } void R_s_k_2::draw_edge(const Edge& edge) { - int i = edge.second; - Face_handle face = edge.first; - Point a = face->vertex((i+1)%3)->point(); - Point b = face->vertex((i+2)%3)->point(); - draw_segment(a, b); + int i = edge.second; + Face_handle face = edge.first; + Point a = face->vertex((i+1)%3)->point(); + Point b = face->vertex((i+2)%3)->point(); + draw_segment(a, b); } void R_s_k_2::draw_face(Face_handle face) { - ::glBegin(GL_TRIANGLES); - for (int i = 0; i < 3; ++i) - { - Point p = face->vertex(i)->point(); - ::glVertex2f(p.x(), p.y()); - } - ::glEnd(); + ::glBegin(GL_TRIANGLES); + for (int i = 0; i < 3; ++i) + { + Point p = face->vertex(i)->point(); + ::glVertex2f(p.x(), p.y()); + } + ::glEnd(); } void R_s_k_2::draw_edge_with_arrow(const Point& s, const Point& t) { - Vector vec = t - s; - Vector vec90(-vec.y(),vec.x()); - - // draw edge - draw_segment(s, t); - - // draw an arrow toward merged vertex - Point a = t - 0.4 * vec; - Point b = a - 0.2 * vec - 0.1 * vec90; - Point c = a - 0.2 * vec + 0.1 * vec90; - ::glBegin(GL_TRIANGLES); - ::glVertex2d(a.x(), a.y()); - ::glVertex2d(b.x(), b.y()); - ::glVertex2d(c.x(), c.y()); - ::glEnd(); + Vector vec = t - s; + Vector vec90(-vec.y(),vec.x()); + + // draw edge + draw_segment(s, t); + + // draw an arrow toward merged vertex + Point a = t - 0.4 * vec; + Point b = a - 0.2 * vec - 0.1 * vec90; + Point c = a - 0.2 * vec + 0.1 * vec90; + ::glBegin(GL_TRIANGLES); + ::glVertex2d(a.x(), a.y()); + ::glVertex2d(b.x(), b.y()); + ::glVertex2d(c.x(), c.y()); + ::glEnd(); } void R_s_k_2::draw_vertices(const float point_size, - const float red, - const float green, - const float blue) + const float red, + const float green, + const float blue) { - for (Finite_vertices_iterator vi = m_dt.finite_vertices_begin(); - vi != m_dt.finite_vertices_end(); vi++) + for (Finite_vertices_iterator vi = m_dt.finite_vertices_begin(); + vi != m_dt.finite_vertices_end(); vi++) + { + Vertex_handle vertex = vi; + if (vertex->pinned()) { - Vertex_handle vertex = vi; - if (vertex->pinned()) - { - ::glPointSize(point_size); - ::glColor3f(0.0f, 0.0f, 0.0f); - } - else - { - ::glPointSize(3*point_size); - ::glColor3f(red,green,blue); - } - draw_point(vertex->point()); + ::glPointSize(point_size); + ::glColor3f(0.0f, 0.0f, 0.0f); } + else + { + ::glPointSize(3*point_size); + ::glColor3f(red,green,blue); + } + draw_point(vertex->point()); + } } void R_s_k_2::draw_edges(const float line_width, - const float red, - const float green, - const float blue) + const float red, + const float green, + const float blue) { - ::glLineWidth(line_width); - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ei++) - { - Edge edge = *ei; - Edge twin = m_dt.twin_edge(edge); - if (m_dt.is_pinned(edge) && m_dt.is_pinned(twin)) - ::glColor3f(0.9f,0.9f,0.75f); - else - ::glColor3f(red,green,blue); - draw_edge(edge); - } + ::glLineWidth(line_width); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ei++) + { + Edge edge = *ei; + Edge twin = m_dt.twin_edge(edge); + if (m_dt.is_pinned(edge) && m_dt.is_pinned(twin)) + ::glColor3f(0.9f,0.9f,0.75f); + else + ::glColor3f(red,green,blue); + draw_edge(edge); + } } void R_s_k_2::draw_footpoints(const float line_width, - const float red, - const float green, - const float blue) + const float red, + const float green, + const float blue) { - draw_mesh_footpoints(m_dt, line_width, red, green, blue); + draw_mesh_footpoints(m_dt, line_width, red, green, blue); } void R_s_k_2::draw_mesh_footpoints(const Triangulation& mesh, - const float line_width, - const float red, - const float green, - const float blue) + const float line_width, + const float red, + const float green, + const float blue) { - ::glLineWidth(line_width); - for (Finite_edges_iterator ei = mesh.finite_edges_begin(); ei != mesh.finite_edges_end(); ei++) - { - Edge edge = *ei; - draw_edge_footpoints(mesh, edge, red, green, blue); - draw_edge_footpoints(mesh, mesh.twin_edge(edge), red, green, blue); - } + ::glLineWidth(line_width); + for (Finite_edges_iterator ei = mesh.finite_edges_begin(); ei != mesh.finite_edges_end(); ei++) + { + Edge edge = *ei; + draw_edge_footpoints(mesh, edge, red, green, blue); + draw_edge_footpoints(mesh, mesh.twin_edge(edge), red, green, blue); + } } void R_s_k_2::draw_edge_footpoints(const Triangulation& mesh, - const Edge& edge, - const float red, - const float green, - const float blue) + const Edge& edge, + const float red, + const float green, + const float blue) { - const Point& a = mesh.source_vertex(edge)->point(); - const Point& b = mesh.target_vertex(edge)->point(); - const Sample_vector& samples = edge.first->samples(edge.second); - - Sample_vector::const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) - { - Sample_* sample = *it; - Point p = sample->point(); - FT m = 0.5*(1.0 - sample->mass()); + const Point& a = mesh.source_vertex(edge)->point(); + const Point& b = mesh.target_vertex(edge)->point(); + const Sample_vector& samples = edge.first->samples(edge.second); - Point q; - if (mesh.get_plan(edge) == 0) - { - ::glColor3f(0.8f + m, m, m); - FT Da = CGAL::squared_distance(p, a); - FT Db = CGAL::squared_distance(p, b); - if (Da < Db) q = a; - else q = b; - } - else - { - ::glColor3f(red + m, green + m, blue + m); - FT t = sample->coordinate(); - q = CGAL::ORIGIN + (1.0 - t)*(a - CGAL::ORIGIN) + t*(b - CGAL::ORIGIN); - } - draw_segment(p, q); + Sample_vector::const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) + { + Sample_* sample = *it; + Point p = sample->point(); + FT m = 0.5*(1.0 - sample->mass()); + + Point q; + if (mesh.get_plan(edge) == 0) + { + ::glColor3f(0.8f + m, m, m); + FT Da = CGAL::squared_distance(p, a); + FT Db = CGAL::squared_distance(p, b); + if (Da < Db) q = a; + else q = b; } + else + { + ::glColor3f(red + m, green + m, blue + m); + FT t = sample->coordinate(); + q = CGAL::ORIGIN + (1.0 - t)*(a - CGAL::ORIGIN) + t*(b - CGAL::ORIGIN); + } + draw_segment(p, q); + } } void R_s_k_2::draw_pedges(const float line_width) { - int nb_edges = 0; - int nb_pinned = 0; - int nb_cyclic = 0; - int nb_discart = 0; - FT min_value = (std::numeric_limits::max)(); - FT max_value = -(std::numeric_limits::max)(); - std::vector values; - std::vector edges; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + int nb_edges = 0; + int nb_pinned = 0; + int nb_cyclic = 0; + int nb_discart = 0; + FT min_value = (std::numeric_limits::max)(); + FT max_value = -(std::numeric_limits::max)(); + std::vector values; + std::vector edges; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + for (unsigned int i = 0; i < 2; ++i) { - Edge edge = *ei; - for (unsigned int i = 0; i < 2; ++i) - { - if (m_dt.is_pinned(edge)) - { - nb_pinned++; - continue; - } - - if (m_dt.is_target_cyclic(edge)) - { - nb_cyclic++; - continue; - } + if (m_dt.is_pinned(edge)) + { + nb_pinned++; + continue; + } - PEdge pedge; - bool ok = create_pedge(edge, pedge); - if (ok) - { - edges.push_back(edge); - values.push_back(pedge.priority()); - min_value = (std::min)(min_value, values.back()); - max_value = (std::max)(max_value, values.back()); - } - else - { - nb_discart++; - ::glColor3f(1.0, 0.0, 1.0); - draw_edge(edge); - } - edge = m_dt.twin_edge(edge); - nb_edges++; - } + if (m_dt.is_target_cyclic(edge)) + { + nb_cyclic++; + continue; + } + + PEdge pedge; + bool ok = create_pedge(edge, pedge); + if (ok) + { + edges.push_back(edge); + values.push_back(pedge.priority()); + min_value = (std::min)(min_value, values.back()); + max_value = (std::max)(max_value, values.back()); + } + else + { + nb_discart++; + ::glColor3f(1.0, 0.0, 1.0); + draw_edge(edge); + } + edge = m_dt.twin_edge(edge); + nb_edges++; } - if (min_value == max_value) max_value += 1.0; - - std::size_t N = values.size(); - for (unsigned int i = 0; i < N; ++i) - draw_one_pedge(edges[i], values[i], min_value, max_value, line_width); + } + if (min_value == max_value) max_value += 1.0; - std::cout << "There are: " << N << " pedges" - << " x " << nb_discart << " discarted" - << " x " << nb_pinned << " pinned" - << " x " << nb_cyclic << " cyclic" - << " = " << nb_edges << " edges" - << std::endl; + std::size_t N = values.size(); + for (unsigned int i = 0; i < N; ++i) + draw_one_pedge(edges[i], values[i], min_value, max_value, line_width); + + std::cout << "There are: " << N << " pedges" + << " x " << nb_discart << " discarted" + << " x " << nb_pinned << " pinned" + << " x " << nb_cyclic << " cyclic" + << " = " << nb_edges << " edges" + << std::endl; } void R_s_k_2::draw_one_pedge(const Edge& edge, - const FT value, - const FT min_value, - const FT max_value, - const float line_width) + const FT value, + const FT min_value, + const FT max_value, + const float line_width) { - if (value == min_value) - { - ::glLineWidth(2*line_width); - ::glColor3f(0.0f, 0.0f, 0.0f); - } - else - { - ::glLineWidth(line_width); - FT color = (value - min_value) / (max_value - min_value); - QColor qcolor = get_color(color); - ::glColor3f(qcolor.redF(), qcolor.greenF(), qcolor.blueF()); - } - - Point s = m_dt.source_vertex(edge)->point(); - Point t = m_dt.target_vertex(edge)->point(); - Point c = CGAL::midpoint(s, t); - draw_edge_with_arrow(c, t); + if (value == min_value) + { + ::glLineWidth(2*line_width); + ::glColor3f(0.0f, 0.0f, 0.0f); + } + else + { + ::glLineWidth(line_width); + FT color = (value - min_value) / (max_value - min_value); + QColor qcolor = get_color(color); + ::glColor3f(qcolor.redF(), qcolor.greenF(), qcolor.blueF()); + } + + Point s = m_dt.source_vertex(edge)->point(); + Point t = m_dt.target_vertex(edge)->point(); + Point c = CGAL::midpoint(s, t); + draw_edge_with_arrow(c, t); } void R_s_k_2::draw_costs(const float line_width, const bool view_ghost) { - FT min_value = (std::numeric_limits::max)(); - FT max_value = -(std::numeric_limits::max)(); - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - FT value = m_dt.get_cost(edge).finalize(m_alpha); - min_value = (std::min)(min_value, value); - max_value = (std::max)(max_value, value); - } - if (min_value == max_value) max_value += 1.0; - - ::glLineWidth(line_width); - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - draw_one_cost(edge, min_value, max_value, view_ghost); - } + FT min_value = (std::numeric_limits::max)(); + FT max_value = -(std::numeric_limits::max)(); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_cost(edge).finalize(m_alpha); + min_value = (std::min)(min_value, value); + max_value = (std::max)(max_value, value); + } + if (min_value == max_value) max_value += 1.0; + + ::glLineWidth(line_width); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + draw_one_cost(edge, min_value, max_value, view_ghost); + } } void R_s_k_2::draw_one_cost(const Edge& edge, - const FT min_value, - const FT max_value, - const bool view_ghost) + const FT min_value, + const FT max_value, + const bool view_ghost) { - FT mass = m_dt.get_mass(edge); - if (mass == 0.0) - { - if (!view_ghost) return; - ::glColor3f(0.5f, 0.5f, 0.5f); - draw_edge(edge); - return; - } - - if (m_dt.is_ghost(edge)) - { - if (!view_ghost) return; - ::glColor3f(0.5f, 0.5f, 0.5f); - draw_edge(edge); - return; - } - - FT value = m_dt.get_cost(edge).finalize(m_alpha); - FT color = (value - min_value) / (max_value - min_value); - ::glColor3d(0.0, 1.0-color, color); // [green, blue] + FT mass = m_dt.get_mass(edge); + if (mass == 0.0) + { + if (!view_ghost) return; + ::glColor3f(0.5f, 0.5f, 0.5f); draw_edge(edge); + return; + } + + if (m_dt.is_ghost(edge)) + { + if (!view_ghost) return; + ::glColor3f(0.5f, 0.5f, 0.5f); + draw_edge(edge); + return; + } + + FT value = m_dt.get_cost(edge).finalize(m_alpha); + FT color = (value - min_value) / (max_value - min_value); + ::glColor3d(0.0, 1.0-color, color); // [green, blue] + draw_edge(edge); } void R_s_k_2::draw_relevance(const float line_width, const int nb, const bool incolors) { - MultiIndex mindex; - FT min_value = (std::numeric_limits::max)(); - FT max_value = -(std::numeric_limits::max)(); - unsigned nb_initial = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - FT value = m_dt.get_edge_relevance(edge); // >= 0 - - nb_initial++; - min_value = (std::min)(min_value, value); - max_value = (std::max)(max_value, value); - mindex.insert(PEdge(edge, value)); - } - if (min_value == max_value) max_value += 1.0; - - ::glLineWidth(line_width); - int nb_remove = (std::min)(nb, int(mindex.size())); + MultiIndex mindex; + FT min_value = (std::numeric_limits::max)(); + FT max_value = -(std::numeric_limits::max)(); + unsigned nb_initial = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_edge_relevance(edge); // >= 0 - ::glColor3d(0.5, 0.1, 0.1); - for (int i = 0; i < nb_remove; ++i) - { + nb_initial++; + min_value = (std::min)(min_value, value); + max_value = (std::max)(max_value, value); + mindex.insert(PEdge(edge, value)); + } + if (min_value == max_value) max_value += 1.0; - PEdge pedge = *(mindex.get<1>()).begin(); - (mindex.get<0>()).erase(pedge); - if (incolors) draw_edge(pedge.edge()); - } - - ::glColor3d(0.0, 0.5, 0.0); - while (!mindex.empty()) + ::glLineWidth(line_width); + int nb_remove = (std::min)(nb, int(mindex.size())); + + ::glColor3d(0.5, 0.1, 0.1); + for (int i = 0; i < nb_remove; ++i) + { + + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); + if (incolors) draw_edge(pedge.edge()); + } + + ::glColor3d(0.0, 0.5, 0.0); + while (!mindex.empty()) + { + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); + if (incolors) { - PEdge pedge = *(mindex.get<1>()).begin(); - (mindex.get<0>()).erase(pedge); - if (incolors) - { - FT value = pedge.priority(); - value = (value - min_value) / (max_value - min_value); - value = 0.7*(1.0 - value); - ::glColor3d(value, value, value); - } - draw_edge(pedge.edge()); + FT value = pedge.priority(); + value = (value - min_value) / (max_value - min_value); + value = 0.7*(1.0 - value); + ::glColor3d(value, value, value); } + draw_edge(pedge.edge()); + } } void R_s_k_2::draw_bins(const float thickness) { - ::glLineWidth(thickness); - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.get_plan(edge) == 0) - draw_bins_plan0(edge); - else - draw_bins_plan1(edge); - } + ::glLineWidth(thickness); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.get_plan(edge) == 0) + draw_bins_plan0(edge); + else + draw_bins_plan1(edge); + } } void R_s_k_2::draw_bins_plan0(const Edge& edge) { - Edge twin = m_dt.twin_edge(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); - - Sample_vector samples; - m_dt.collect_samples_from_edge(edge, samples); - m_dt.collect_samples_from_edge(twin, samples); - - ::glColor3f(0.0f, 1.0f, 0.0f); - Sample_vector_const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) - { - Sample_* sample = *it; - const Point& ps = sample->point(); - - Point q = pa; - FT Da = CGAL::squared_distance(ps, pa); - FT Db = CGAL::squared_distance(ps, pb); - if (Da > Db) q = pb; - - draw_segment(ps, q); - } + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + Sample_vector samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + ::glColor3f(0.0f, 1.0f, 0.0f); + Sample_vector_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) + { + Sample_* sample = *it; + const Point& ps = sample->point(); + + Point q = pa; + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + if (Da > Db) q = pb; + + draw_segment(ps, q); + } } void R_s_k_2::draw_bins_plan1(const Edge& edge) { - FT M = m_dt.get_mass(edge); - Vector va = m_dt.source_vertex(edge)->point() - CGAL::ORIGIN; - Vector vb = m_dt.target_vertex(edge)->point() - CGAL::ORIGIN; - - ::glColor3f(1.0f, 0.0f, 0.0f); - SQueue queue; - FT start = 0.0; - m_dt.sort_samples_from_edge(edge, queue); - while (!queue.empty()) - { - PSample psample = queue.top(); - queue.pop(); - - const FT m = psample.sample()->mass(); - const Point& ps = psample.sample()->point(); - - FT bin = m/M; - FT alpha = start + 0.5*bin; - Point q = CGAL::ORIGIN + (1.0-alpha)*va + alpha*vb; - start += bin; - - draw_segment(ps, q); - } + FT M = m_dt.get_mass(edge); + Vector va = m_dt.source_vertex(edge)->point() - CGAL::ORIGIN; + Vector vb = m_dt.target_vertex(edge)->point() - CGAL::ORIGIN; + + ::glColor3f(1.0f, 0.0f, 0.0f); + SQueue queue; + FT start = 0.0; + m_dt.sort_samples_from_edge(edge, queue); + while (!queue.empty()) + { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + FT bin = m/M; + FT alpha = start + 0.5*bin; + Point q = CGAL::ORIGIN + (1.0-alpha)*va + alpha*vb; + start += bin; + + draw_segment(ps, q); + } } void R_s_k_2::draw_relocation() { - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); v != m_dt.finite_vertices_end(); ++v) + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); v != m_dt.finite_vertices_end(); ++v) + { + Vertex_handle vertex = v; + if (vertex->pinned()) continue; + + const Point& pv = vertex->point(); + v->relocated() = compute_relocation(vertex); + + Vector move(0.0, 0.0); + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) { - Vertex_handle vertex = v; - if (vertex->pinned()) continue; - - const Point& pv = vertex->point(); - v->relocated() = compute_relocation(vertex); - - Vector move(0.0, 0.0); - Edge_circulator ecirc = m_dt.incident_edges(vertex); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (m_dt.source_vertex(edge) != vertex) - edge = m_dt.twin_edge(edge); - - Vector grad(0.0, 0.0); - if (m_dt.get_plan(edge) == 0) - grad = compute_gradient_for_plan0(edge); - else - grad = compute_gradient_for_plan1(edge); - - move = move + grad; - ::glLineWidth(2.0f); - ::glColor3f(1.0f, 1.0f, 0.0f); - draw_edge_with_arrow(pv, pv-grad); - } - - ::glLineWidth(1.0f); - ::glColor3f(1.0f, 0.0f, 0.0f); - draw_edge_with_arrow(pv, pv-move); + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + Vector grad(0.0, 0.0); + if (m_dt.get_plan(edge) == 0) + grad = compute_gradient_for_plan0(edge); + else + grad = compute_gradient_for_plan1(edge); + + move = move + grad; + ::glLineWidth(2.0f); + ::glColor3f(1.0f, 1.0f, 0.0f); + draw_edge_with_arrow(pv, pv-grad); } - - ::glBegin(GL_LINES); - ::glLineWidth(3.0f); - ::glColor3f(0.1f, 1.0f, 1.0f); - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - Edge twin = m_dt.twin_edge(edge); - if (m_dt.is_pinned(edge) || m_dt.is_pinned(twin)) continue; - - const Point& pa = m_dt.source_vertex(edge)->relocated(); - const Point& pb = m_dt.target_vertex(edge)->relocated(); - ::glVertex2d(pa.x(), pa.y()); - ::glVertex2d(pb.x(), pb.y()); - } - ::glEnd(); + + ::glLineWidth(1.0f); + ::glColor3f(1.0f, 0.0f, 0.0f); + draw_edge_with_arrow(pv, pv-move); + } + + ::glBegin(GL_LINES); + ::glLineWidth(3.0f); + ::glColor3f(0.1f, 1.0f, 1.0f); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + Edge twin = m_dt.twin_edge(edge); + if (m_dt.is_pinned(edge) || m_dt.is_pinned(twin)) continue; + + const Point& pa = m_dt.source_vertex(edge)->relocated(); + const Point& pb = m_dt.target_vertex(edge)->relocated(); + ::glVertex2d(pa.x(), pa.y()); + ::glVertex2d(pb.x(), pb.y()); + } + ::glEnd(); } bool R_s_k_2::locate_edge(const Point& query, Edge& edge) { - if (m_dt.number_of_faces() == 0) return false; - - Face_handle face = m_dt.locate(query); - if (face == Face_handle()) return false; - if (m_dt.is_infinite(face)) return false; - - edge = m_dt.find_nearest_edge(query, face); - if (edge.first == Face_handle()) return false; - - if (m_dt.is_pinned(edge) || m_dt.is_target_cyclic(edge)) - return false; + if (m_dt.number_of_faces() == 0) return false; - return true; + Face_handle face = m_dt.locate(query); + if (face == Face_handle()) return false; + if (m_dt.is_infinite(face)) return false; + + edge = m_dt.find_nearest_edge(query, face); + if (edge.first == Face_handle()) return false; + + if (m_dt.is_pinned(edge) || m_dt.is_target_cyclic(edge)) + return false; + + return true; } void R_s_k_2::draw_one_ring(const float point_size, const float line_width, const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - draw_mesh_one_ring(point_size, line_width, copy, copy_edge); + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + draw_mesh_one_ring(point_size, line_width, copy, copy_edge); } void R_s_k_2::draw_mesh_one_ring(const float point_size, - const float line_width, - const Triangulation& mesh, - const Edge& edge) + const float line_width, + const Triangulation& mesh, + const Edge& edge) { - Vertex_handle s = mesh.source_vertex(edge); - Vertex_handle t = mesh.target_vertex(edge); - - draw_bg_faces(mesh, 1.0f, 0.7f, 0.7f, 0.5f); - draw_vertex_faces(s, mesh, 0.7f, 0.7f, 1.0f, 1.0f); - - ::glLineWidth(line_width); - draw_bg_edges(mesh, 0.7f, 0.3f, 0.7f, 1.f, 0.f, 0.f); - draw_vertex_edges(s, mesh, 0.f, 0.8f, 0.f, 0.f, 0.2f, 0.2f); - - ::glLineWidth(2.0f*line_width); - ::glColor3f(0., 0., 1.); - draw_edge_with_arrow(s->point(), t->point()); - - ::glPointSize(0.5*point_size); - draw_bg_vertices(mesh, 0.f, 0.f, 0.f); - ::glPointSize(point_size); - ::glColor3f(0., 1., 0.); - draw_point(s->point()); - ::glColor3f(1., 1., 0.); - draw_point(t->point()); + Vertex_handle s = mesh.source_vertex(edge); + Vertex_handle t = mesh.target_vertex(edge); + + draw_bg_faces(mesh, 1.0f, 0.7f, 0.7f, 0.5f); + draw_vertex_faces(s, mesh, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(line_width); + draw_bg_edges(mesh, 0.7f, 0.3f, 0.7f, 1.f, 0.f, 0.f); + draw_vertex_edges(s, mesh, 0.f, 0.8f, 0.f, 0.f, 0.2f, 0.2f); + + ::glLineWidth(2.0f*line_width); + ::glColor3f(0., 0., 1.); + draw_edge_with_arrow(s->point(), t->point()); + + ::glPointSize(0.5*point_size); + draw_bg_vertices(mesh, 0.f, 0.f, 0.f); + ::glPointSize(point_size); + ::glColor3f(0., 1., 0.); + draw_point(s->point()); + ::glColor3f(1., 1., 0.); + draw_point(t->point()); } void R_s_k_2::draw_blocking_edges(const float point_size, const float line_width, const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); } void R_s_k_2::draw_mesh_blocking_edges(const float point_size, - const float line_width, - const Triangulation& mesh, - const Edge& edge) + const float line_width, + const Triangulation& mesh, + const Edge& edge) { - Vertex_handle s = mesh.source_vertex(edge); - Vertex_handle t = mesh.target_vertex(edge); + Vertex_handle s = mesh.source_vertex(edge); + Vertex_handle t = mesh.target_vertex(edge); - draw_mesh_one_ring(point_size, line_width, mesh, edge); - - ::glColor3f(0.0f, 0.0f, 0.0f); - ::glLineWidth(2.0f*line_width); - Face_circulator fcirc = mesh.incident_faces(s); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) + draw_mesh_one_ring(point_size, line_width, mesh, edge); + + ::glColor3f(0.0f, 0.0f, 0.0f); + ::glLineWidth(2.0f*line_width); + Face_circulator fcirc = mesh.incident_faces(s); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + Edge ab(f, f->index(s)); + Vertex_handle a = mesh.source_vertex(ab); + Vertex_handle b = mesh.target_vertex(ab); + if (!mesh.is_triangle_ccw(a, b, t)) { - Face_handle f = fcirc; - Edge ab(f, f->index(s)); - Vertex_handle a = mesh.source_vertex(ab); - Vertex_handle b = mesh.target_vertex(ab); - if (!mesh.is_triangle_ccw(a, b, t)) - { - draw_segment(a->point(), b->point()); - } + draw_segment(a->point(), b->point()); } + } } void R_s_k_2::draw_collapsible_edge(const float point_size, - const float line_width, - const Point& query) + const float line_width, + const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - Vertex_handle copy_src = copy.source_vertex(copy_edge); - Vertex_handle copy_dst = copy.target_vertex(copy_edge); - - Edge_vector copy_hull; - copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); - ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; - if (ok) - draw_mesh_one_ring(point_size, line_width, copy, copy_edge); - else - draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + + Edge_vector copy_hull; + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + + if (ok) + draw_mesh_one_ring(point_size, line_width, copy, copy_edge); + else + draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); } void R_s_k_2::draw_simulation(const float point_size, - const float line_width, - const Point& query) + const float line_width, + const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - Vertex_handle copy_src = copy.source_vertex(copy_edge); - Vertex_handle copy_dst = copy.target_vertex(copy_edge); - - Edge_vector copy_hull; - copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); - ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); - - if (!ok) - { - draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); - return; - } - - copy.collapse(copy_edge, m_verbose); - - draw_bg_faces(copy, 1.0f, 0.7f, 0.7f, 0.5f); - draw_vertex_faces(copy_dst, copy, 0.7f, 0.7f, 1.0f, 1.0f); - - ::glLineWidth(line_width); - draw_bg_edges(copy, 0.7f, 0.3f, 0.7f, 1.f, 0.f, 0.f); - draw_vertex_edges(copy_dst, copy, 0.f, 0.8f, 0.f, 0.f, 0.8f, 0.8f); - - ::glPointSize(0.5*point_size); - draw_bg_vertices(copy, 0.f, 0.f, 0.f); - ::glPointSize(point_size); - ::glColor3f(1., 1., 0.); - draw_point(copy_dst->point()); + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + + Edge_vector copy_hull; + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + + if (!ok) + { + draw_mesh_blocking_edges(point_size, line_width, copy, copy_edge); + return; + } + + copy.collapse(copy_edge, m_verbose); + + draw_bg_faces(copy, 1.0f, 0.7f, 0.7f, 0.5f); + draw_vertex_faces(copy_dst, copy, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(line_width); + draw_bg_edges(copy, 0.7f, 0.3f, 0.7f, 1.f, 0.f, 0.f); + draw_vertex_edges(copy_dst, copy, 0.f, 0.8f, 0.f, 0.f, 0.8f, 0.8f); + + ::glPointSize(0.5*point_size); + draw_bg_vertices(copy, 0.f, 0.f, 0.f); + ::glPointSize(point_size); + ::glColor3f(1., 1., 0.); + draw_point(copy_dst->point()); } void R_s_k_2::draw_cost_stencil(const float point_size, - const float line_width, - const Point& query) + const float line_width, + const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - Vertex_handle copy_src = copy.source_vertex(copy_edge); - Vertex_handle copy_dst = copy.target_vertex(copy_edge); - - Edge_vector copy_hull; - copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); - ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); - if (!ok) return; - copy.collapse(copy_edge, m_verbose); - - draw_bg_faces(copy, 0.7f, 0.7f, 1.0f, 1.0f); - - ::glLineWidth(line_width); - ::glPointSize(point_size); + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; - Edge_vector stencil; - collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), stencil); - for (Edge_vector::const_iterator it = stencil.begin(); it != stencil.end(); ++it) - { - Edge e = *it; - ::glColor3f(0.7f, 0.4f, 0.0f); - draw_edge(e); - ::glColor3f(0.0f, 0.0f, 0.0f); - draw_point(copy.source_vertex(e)->point()); - draw_point(copy.target_vertex(e)->point()); - } + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + + Edge_vector copy_hull; + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + if (!ok) return; + copy.collapse(copy_edge, m_verbose); + + draw_bg_faces(copy, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(line_width); + ::glPointSize(point_size); + + Edge_vector stencil; + collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), stencil); + for (Edge_vector::const_iterator it = stencil.begin(); it != stencil.end(); ++it) + { + Edge e = *it; + ::glColor3f(0.7f, 0.4f, 0.0f); + draw_edge(e); + ::glColor3f(0.0f, 0.0f, 0.0f); + draw_point(copy.source_vertex(e)->point()); + draw_point(copy.target_vertex(e)->point()); + } } void R_s_k_2::draw_remove_queue_stencil(const float point_size, - const float line_width, - const Point& query) + const float line_width, + const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Edge_vector hull; - Edge_vector stencil; - Edge_vector::const_iterator it; - Vertex_handle src = m_dt.source_vertex(edge); - m_dt.get_edges_from_star_minus_link(src, hull, true); - collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); - - draw_vertex_faces(src, m_dt, 0.7f, 0.7f, 1.0f, 1.0f); - - ::glLineWidth(0.5*line_width); - for (it = stencil.begin(); it != stencil.end(); ++it) - { - Edge ab = *it; - ::glColor3f(1.0f, 0.6f, 1.0f); - draw_edge(ab); - } - - ::glLineWidth(line_width); - ::glPointSize(point_size); - for (it = stencil.begin(); it != stencil.end(); ++it) - { - Edge ab = *it; - Vertex_handle va = ab.first->vertex( (ab.second+1)%3 ); - Vertex_handle vb = ab.first->vertex( (ab.second+2)%3 ); - const Point& pa = va->point(); - const Point& pb = vb->point(); - Point pc = CGAL::midpoint(pa, pb); - ::glColor3f(0.8f, 0.2f, 0.8f); - draw_edge_with_arrow(pc, pb); - ::glColor3f(0.0f, 0.0f, 0.0f); - draw_point(pa); - draw_point(pb); - } + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; + + Edge_vector hull; + Edge_vector stencil; + Edge_vector::const_iterator it; + Vertex_handle src = m_dt.source_vertex(edge); + m_dt.get_edges_from_star_minus_link(src, hull, true); + collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); + + draw_vertex_faces(src, m_dt, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(0.5*line_width); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + ::glColor3f(1.0f, 0.6f, 1.0f); + draw_edge(ab); + } + + ::glLineWidth(line_width); + ::glPointSize(point_size); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + Vertex_handle va = ab.first->vertex( (ab.second+1)%3 ); + Vertex_handle vb = ab.first->vertex( (ab.second+2)%3 ); + const Point& pa = va->point(); + const Point& pb = vb->point(); + Point pc = CGAL::midpoint(pa, pb); + ::glColor3f(0.8f, 0.2f, 0.8f); + draw_edge_with_arrow(pc, pb); + ::glColor3f(0.0f, 0.0f, 0.0f); + draw_point(pa); + draw_point(pb); + } } void R_s_k_2::draw_push_queue_stencil(const float point_size, - const float line_width, - const Point& query) + const float line_width, + const Point& query) { - Edge edge; - bool ok = locate_edge(query, edge); - if (!ok) return; - - Edge_vector hull; - Edge_vector stencil; - Vertex_handle src = m_dt.source_vertex(edge); - m_dt.get_edges_from_star_minus_link(src, hull, true); - collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); + Edge edge; + bool ok = locate_edge(query, edge); + if (!ok) return; - Edge_vector::iterator it = stencil.begin(); - while (it != stencil.end()) - { - Edge edge = *it; - if (m_dt.source_vertex(edge) == src) - it = stencil.erase(it); - else if (m_dt.target_vertex(edge) == src) - it = stencil.erase(it); - else - it++; - } - - Triangulation copy; - Edge_vector copy_hull; - Edge_vector copy_stencil; - Edge copy_edge = copy_star(edge, copy); - Vertex_handle copy_src = copy.source_vertex(copy_edge); - Vertex_handle copy_dst = copy.target_vertex(copy_edge); - copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); - ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); - if (!ok) return; - copy.collapse(copy_edge, m_verbose); - collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), copy_stencil); + Edge_vector hull; + Edge_vector stencil; + Vertex_handle src = m_dt.source_vertex(edge); + m_dt.get_edges_from_star_minus_link(src, hull, true); + collect_pqueue_stencil(m_dt, hull.begin(), hull.end(), stencil); - for (it = copy_stencil.begin(); it != copy_stencil.end(); ++it) - { - Edge edge = *it; - Edge twin = copy.twin_edge(edge); - if (!copy.is_pinned(edge)) stencil.push_back(edge); - if (!copy.is_pinned(twin)) stencil.push_back(twin); - } + Edge_vector::iterator it = stencil.begin(); + while (it != stencil.end()) + { + Edge edge = *it; + if (m_dt.source_vertex(edge) == src) + it = stencil.erase(it); + else if (m_dt.target_vertex(edge) == src) + it = stencil.erase(it); + else + it++; + } - draw_bg_faces(copy, 0.7f, 0.7f, 1.0f, 1.0f); + Triangulation copy; + Edge_vector copy_hull; + Edge_vector copy_stencil; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_src = copy.source_vertex(copy_edge); + Vertex_handle copy_dst = copy.target_vertex(copy_edge); + copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); + if (!ok) return; + copy.collapse(copy_edge, m_verbose); + collect_cost_stencil(copy, copy_hull.begin(), copy_hull.end(), copy_stencil); - ::glLineWidth(0.5*line_width); - for (it = stencil.begin(); it != stencil.end(); ++it) - { - Edge ab = *it; - ::glColor3f(1.0f, 0.6f, 1.0f); - draw_edge(ab); - } - - ::glLineWidth(line_width); - ::glPointSize(point_size); - for (it = stencil.begin(); it != stencil.end(); ++it) - { - Edge ab = *it; - Vertex_handle va = ab.first->vertex( (ab.second+1)%3 ); - Vertex_handle vb = ab.first->vertex( (ab.second+2)%3 ); - const Point& pa = va->point(); - const Point& pb = vb->point(); - Point pc = CGAL::midpoint(pa, pb); - ::glColor3f(0.8f, 0.2f, 0.8f); - draw_edge_with_arrow(pc, pb); - ::glColor3f(0.0f, 0.0f, 0.0f); - draw_point(pa); - draw_point(pb); - } + for (it = copy_stencil.begin(); it != copy_stencil.end(); ++it) + { + Edge edge = *it; + Edge twin = copy.twin_edge(edge); + if (!copy.is_pinned(edge)) stencil.push_back(edge); + if (!copy.is_pinned(twin)) stencil.push_back(twin); + } + + draw_bg_faces(copy, 0.7f, 0.7f, 1.0f, 1.0f); + + ::glLineWidth(0.5*line_width); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + ::glColor3f(1.0f, 0.6f, 1.0f); + draw_edge(ab); + } + + ::glLineWidth(line_width); + ::glPointSize(point_size); + for (it = stencil.begin(); it != stencil.end(); ++it) + { + Edge ab = *it; + Vertex_handle va = ab.first->vertex( (ab.second+1)%3 ); + Vertex_handle vb = ab.first->vertex( (ab.second+2)%3 ); + const Point& pa = va->point(); + const Point& pb = vb->point(); + Point pc = CGAL::midpoint(pa, pb); + ::glColor3f(0.8f, 0.2f, 0.8f); + draw_edge_with_arrow(pc, pb); + ::glColor3f(0.0f, 0.0f, 0.0f); + draw_point(pa); + draw_point(pb); + } } void R_s_k_2::draw_bg_faces(const Triangulation& mesh, - const float red, - const float green, - const float blue, - const float alpha) + const float red, + const float green, + const float blue, + const float alpha) { - ::glEnable(GL_BLEND); - ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - ::glColor4f(red, green, blue, alpha); - for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) - { - Face_handle f = fi; - draw_face(f); - } - ::glDisable(GL_BLEND); + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ::glColor4f(red, green, blue, alpha); + for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) + { + Face_handle f = fi; + draw_face(f); + } + ::glDisable(GL_BLEND); } void R_s_k_2::draw_bg_edges(const Triangulation& mesh, - const float ri, - const float gi, - const float bi, - const float ro, - const float go, - const float bo) + const float ri, + const float gi, + const float bi, + const float ro, + const float go, + const float bo) { - for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) + for (Finite_faces_iterator fi = mesh.finite_faces_begin(); fi != mesh.finite_faces_end(); ++fi) + { + Face_handle f = fi; + for (unsigned int i = 0; i < 3; ++i) { - Face_handle f = fi; - for (unsigned int i = 0; i < 3; ++i) - { - Edge e(f, i); - e = mesh.twin_edge(e); - if (mesh.is_infinite(e.first)) - ::glColor3f(ro, go, bo); - else - ::glColor3f(ri, gi, bi); - draw_edge(e); - } + Edge e(f, i); + e = mesh.twin_edge(e); + if (mesh.is_infinite(e.first)) + ::glColor3f(ro, go, bo); + else + ::glColor3f(ri, gi, bi); + draw_edge(e); } + } } void R_s_k_2::draw_bg_vertices(const Triangulation& mesh, - const float red, - const float green, - const float blue) + const float red, + const float green, + const float blue) { - ::glColor3f(red, green, blue); - for (Finite_vertices_iterator vi = mesh.finite_vertices_begin(); vi != mesh.finite_vertices_end(); ++vi) - { - Vertex_handle v = vi; - draw_point(v->point()); - } + ::glColor3f(red, green, blue); + for (Finite_vertices_iterator vi = mesh.finite_vertices_begin(); vi != mesh.finite_vertices_end(); ++vi) + { + Vertex_handle v = vi; + draw_point(v->point()); + } } void R_s_k_2::draw_vertex_faces(Vertex_handle vertex, - const Triangulation& mesh, - const float red, - const float green, - const float blue, - const float alpha) + const Triangulation& mesh, + const float red, + const float green, + const float blue, + const float alpha) { - ::glEnable(GL_BLEND); - ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - ::glColor4f(red, green, blue, alpha); - Face_circulator fcirc = mesh.incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle f = fcirc; - if (mesh.is_infinite(f)) continue; - draw_face(f); - } - ::glDisable(GL_BLEND); + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ::glColor4f(red, green, blue, alpha); + Face_circulator fcirc = mesh.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + if (mesh.is_infinite(f)) continue; + draw_face(f); + } + ::glDisable(GL_BLEND); } void R_s_k_2::draw_vertex_edges(Vertex_handle vertex, - const Triangulation& mesh, - const float ri, - const float gi, - const float bi, - const float ro, - const float go, - const float bo) + const Triangulation& mesh, + const float ri, + const float gi, + const float bi, + const float ro, + const float go, + const float bo) { - Face_circulator fcirc = mesh.incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) + Face_circulator fcirc = mesh.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + int index = f->index(vertex); + for (unsigned int i = 0; i < 3; ++i) { - Face_handle f = fcirc; - int index = f->index(vertex); - for (unsigned int i = 0; i < 3; ++i) - { - Edge e(f, i); - if (mesh.is_infinite(e)) continue; - if (static_cast(i) == index) ::glColor3f(ro, go, bo); - else ::glColor3f(ri, gi, bi); - draw_edge(e); - } + Edge e(f, i); + if (mesh.is_infinite(e)) continue; + if (static_cast(i) == index) ::glColor3f(ro, go, bo); + else ::glColor3f(ri, gi, bi); + draw_edge(e); } + } } void R_s_k_2::save_edges(std::ofstream& ofs, const int nb) { - MultiIndex mindex; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - FT value = m_dt.get_edge_relevance(edge); // >= 0 - mindex.insert(PEdge(edge, value)); - } + MultiIndex mindex; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + FT value = m_dt.get_edge_relevance(edge); // >= 0 + mindex.insert(PEdge(edge, value)); + } - int nb_remove = (std::min)(nb, int(mindex.size())); - for (int i = 0; i < nb_remove; ++i) - { - PEdge pedge = *(mindex.get<1>()).begin(); - (mindex.get<0>()).erase(pedge); + int nb_remove = (std::min)(nb, int(mindex.size())); + for (int i = 0; i < nb_remove; ++i) + { + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); - } - - while (!mindex.empty()) - { - PEdge pedge = *(mindex.get<1>()).begin(); - (mindex.get<0>()).erase(pedge); - save_one_edge(ofs, pedge.edge()); - } + } + + while (!mindex.empty()) + { + PEdge pedge = *(mindex.get<1>()).begin(); + (mindex.get<0>()).erase(pedge); + save_one_edge(ofs, pedge.edge()); + } } void R_s_k_2::save_one_edge(std::ofstream& ofs, const Edge& edge) { - int i = edge.second; - Face_handle face = edge.first; - Point const& a = face->vertex((i+1)%3)->point(); - Point const& b = face->vertex((i+2)%3)->point(); - ofs << a << " - " << b << std::endl; + int i = edge.second; + Face_handle face = edge.first; + Point const& a = face->vertex((i+1)%3)->point(); + Point const& b = face->vertex((i+2)%3)->point(); + ofs << a << " - " << b << std::endl; } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index a7643af473d..7da6aeba521 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -24,1100 +24,1100 @@ class Scene { public: - typedef std::pair PointMassPair; + typedef std::pair PointMassPair; - typedef std::vector PointMassList; - typedef PointMassList::const_iterator InputIterator; + typedef std::vector PointMassList; + typedef PointMassList::const_iterator InputIterator; - typedef CGAL::value_type_traits::type MassPoint; + typedef CGAL::value_type_traits::type MassPoint; - typedef CGAL::First_of_pair_property_map Point_property_map; - typedef CGAL::Second_of_pair_property_map Mass_property_map; + typedef CGAL::First_of_pair_property_map Point_property_map; + typedef CGAL::Second_of_pair_property_map Mass_property_map; - typedef CGAL::Reconstruction_simplification_2 R_s_2; + typedef CGAL::Reconstruction_simplification_2 R_s_2; - typedef K::Segment_2 Segment; + typedef K::Segment_2 Segment; - typedef R_s_2::Vector Vector; + typedef R_s_2::Vector Vector; - typedef R_s_2::Vertex Vertex; - typedef R_s_2::Vertex_handle Vertex_handle; - typedef R_s_2::Vertex_iterator Vertex_iterator; - typedef R_s_2::Vertex_circulator Vertex_circulator; - typedef R_s_2::Finite_vertices_iterator Finite_vertices_iterator; + typedef R_s_2::Vertex Vertex; + typedef R_s_2::Vertex_handle Vertex_handle; + typedef R_s_2::Vertex_iterator Vertex_iterator; + typedef R_s_2::Vertex_circulator Vertex_circulator; + typedef R_s_2::Finite_vertices_iterator Finite_vertices_iterator; - typedef R_s_2::Edge Edge; - typedef R_s_2::Edge_iterator Edge_iterator; - typedef R_s_2::Edge_circulator Edge_circulator; - typedef R_s_2::Finite_edges_iterator Finite_edges_iterator; + typedef R_s_2::Edge Edge; + typedef R_s_2::Edge_iterator Edge_iterator; + typedef R_s_2::Edge_circulator Edge_circulator; + typedef R_s_2::Finite_edges_iterator Finite_edges_iterator; - typedef R_s_2::Face Face; - typedef R_s_2::Face_handle Face_handle; - typedef R_s_2::Face_iterator Face_iterator; - typedef R_s_2::Face_circulator Face_circulator; - typedef R_s_2::Finite_faces_iterator Finite_faces_iterator; + typedef R_s_2::Face Face; + typedef R_s_2::Face_handle Face_handle; + typedef R_s_2::Face_iterator Face_iterator; + typedef R_s_2::Face_circulator Face_circulator; + typedef R_s_2::Finite_faces_iterator Finite_faces_iterator; - typedef R_s_2::Vertex_handle_map Vertex_handle_map; - typedef R_s_2::Face_handle_map Face_handle_map; + typedef R_s_2::Vertex_handle_map Vertex_handle_map; + typedef R_s_2::Face_handle_map Face_handle_map; - typedef R_s_2::Vertex_handle_set Vertex_handle_set; - typedef R_s_2::Edge_set Edge_set; + typedef R_s_2::Vertex_handle_set Vertex_handle_set; + typedef R_s_2::Edge_set Edge_set; - typedef R_s_2::Edge_vector Edge_vector; + typedef R_s_2::Edge_vector Edge_vector; - typedef R_s_2::Sample_ Sample_; - typedef R_s_2::Sample_vector Sample_vector; - typedef R_s_2::Sample_vector_const_iterator Sample_vector_const_iterator; + typedef R_s_2::Sample_ Sample_; + typedef R_s_2::Sample_vector Sample_vector; + typedef R_s_2::Sample_vector_const_iterator Sample_vector_const_iterator; - typedef R_s_2::Point_vector Point_vector; - typedef R_s_2::Point_vector_const_iterator Point_vector_const_iterator; + typedef R_s_2::Point_vector Point_vector; + typedef R_s_2::Point_vector_const_iterator Point_vector_const_iterator; - typedef R_s_2::PSample PSample; - typedef R_s_2::SQueue SQueue; + typedef R_s_2::PSample PSample; + typedef R_s_2::SQueue SQueue; - typedef R_s_2::Rec_edge_2 PEdge; + typedef R_s_2::Rec_edge_2 PEdge; private: - // data - std::vector m_samples; - double m_min_mass; - double m_max_mass; + // data + std::vector m_samples; + double m_min_mass; + double m_max_mass; - Reconstruction_simplification_kerneled_2* m_pwsrec; - int m_ignore; + Reconstruction_simplification_kerneled_2* m_pwsrec; + int m_ignore; - // bbox - double m_bbox_x; - double m_bbox_y; - double m_bbox_size; + // bbox + double m_bbox_x; + double m_bbox_y; + double m_bbox_size; public: - Scene() { - srand(0); // for sake of repeatability - m_min_mass = 0.0; - m_max_mass = 0.0; - m_ignore = 0; - m_bbox_x = 0.0; - m_bbox_y = 0.0; - m_bbox_size = 1.0; + Scene() { + srand(0); // for sake of repeatability + m_min_mass = 0.0; + m_max_mass = 0.0; + m_ignore = 0; + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; - m_pwsrec = new Reconstruction_simplification_kerneled_2(); - } + m_pwsrec = new Reconstruction_simplification_kerneled_2(); + } - ~Scene() { - clear(); - } + ~Scene() { + clear(); + } - void clear() { - m_pwsrec->clear(); - m_samples.clear(); - m_max_mass = 0.0; - } + void clear() { + m_pwsrec->clear(); + m_samples.clear(); + m_max_mass = 0.0; + } - void set_min_mass(const double min_value) { - m_min_mass = min_value; - } + void set_min_mass(const double min_value) { + m_min_mass = min_value; + } - void set_nb_edges_to_ignore(int nb) { - m_ignore = nb; - } + void set_nb_edges_to_ignore(int nb) { + m_ignore = nb; + } - void invert_mass() { - double new_max_mass = 0.0; - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample_& sample = *it; - sample.mass() = m_max_mass - sample.mass(); - new_max_mass = (std::max)(new_max_mass, sample.mass()); - } - m_max_mass = new_max_mass; - } + void invert_mass() { + double new_max_mass = 0.0; + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample_& sample = *it; + sample.mass() = m_max_mass - sample.mass(); + new_max_mass = (std::max)(new_max_mass, sample.mass()); + } + m_max_mass = new_max_mass; + } - void clamp_mass() { - std::vector new_samples; - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample_& sample = *it; - if (sample.mass() > m_min_mass) { - sample.mass() = 1.0; - new_samples.push_back(sample); - } - } - m_samples = new_samples; - m_max_mass = 1.0; - } + void clamp_mass() { + std::vector new_samples; + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample_& sample = *it; + if (sample.mass() > m_min_mass) { + sample.mass() = 1.0; + new_samples.push_back(sample); + } + } + m_samples = new_samples; + m_max_mass = 1.0; + } - void subdivide() { - if (m_samples.size() < 3) - return; + void subdivide() { + if (m_samples.size() < 3) + return; - std::vector new_samples; - std::vector::const_iterator it = m_samples.begin(); - std::vector::const_iterator last = it++; - while (it != m_samples.end()) { - Point p = CGAL::midpoint(last->point(), it->point()); - FT m = 0.5 * (last->mass() + it->mass()); - new_samples.push_back(Sample_(p, m)); - last = it++; - } - it = m_samples.begin(); - Point p = CGAL::midpoint(last->point(), it->point()); - FT m = 0.5 * (last->mass() + it->mass()); - new_samples.push_back(Sample_(p, m)); + std::vector new_samples; + std::vector::const_iterator it = m_samples.begin(); + std::vector::const_iterator last = it++; + while (it != m_samples.end()) { + Point p = CGAL::midpoint(last->point(), it->point()); + FT m = 0.5 * (last->mass() + it->mass()); + new_samples.push_back(Sample_(p, m)); + last = it++; + } + it = m_samples.begin(); + Point p = CGAL::midpoint(last->point(), it->point()); + FT m = 0.5 * (last->mass() + it->mass()); + new_samples.push_back(Sample_(p, m)); - std::vector final_samples; - std::vector::const_iterator it2 = new_samples.begin(); - while (it != m_samples.end() && it2 != new_samples.end()) { - final_samples.push_back(*it); - final_samples.push_back(*it2); - it++; - it2++; - } + std::vector final_samples; + std::vector::const_iterator it2 = new_samples.begin(); + while (it != m_samples.end() && it2 != new_samples.end()) { + final_samples.push_back(*it); + final_samples.push_back(*it2); + it++; + it2++; + } - m_samples = final_samples; - } + m_samples = final_samples; + } - // SAMPLE // + // SAMPLE // - void add_sample(const Point& point, const FT mass = 1.0) { - m_samples.push_back(Sample_(point, mass)); - m_max_mass = (std::max)(m_max_mass, mass); - } + void add_sample(const Point& point, const FT mass = 1.0) { + m_samples.push_back(Sample_(point, mass)); + m_max_mass = (std::max)(m_max_mass, mass); + } - void add_outliers(const unsigned int nb) { - std::cerr << "add " << nb << " outliers..."; - for (unsigned int i = 0; i < nb; i++) { - Point outlier = CGAL::ORIGIN + random_vec(1.3); - m_samples.push_back(outlier); - } - std::cerr << "done" << std::endl; - } + void add_outliers(const unsigned int nb) { + std::cerr << "add " << nb << " outliers..."; + for (unsigned int i = 0; i < nb; i++) { + Point outlier = CGAL::ORIGIN + random_vec(1.3); + m_samples.push_back(outlier); + } + std::cerr << "done" << std::endl; + } - void noise(const FT scale) { - std::cerr << "noise by " << scale << "..."; - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); it++) { - Sample_& sample = *it; - Point& point = sample.point(); - point = point + random_vec(scale); - } - std::cerr << "done" << std::endl; - } + void noise(const FT scale) { + std::cerr << "noise by " << scale << "..."; + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++) { + Sample_& sample = *it; + Point& point = sample.point(); + point = point + random_vec(scale); + } + std::cerr << "done" << std::endl; + } - void normalize_points() { - noise(1e-5); - compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); - if (m_bbox_size == 0.0) - return; + void normalize_points() { + noise(1e-5); + compute_bbox(m_bbox_x, m_bbox_y, m_bbox_size); + if (m_bbox_size == 0.0) + return; - Point center(m_bbox_x, m_bbox_y); - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample_& sample = *it; - Vector vec = (sample.point() - center) / m_bbox_size; - sample.point() = CGAL::ORIGIN + vec; - } - m_bbox_x = m_bbox_y = 0.0; - m_bbox_size = 1.0; - } + Point center(m_bbox_x, m_bbox_y); + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample_& sample = *it; + Vector vec = (sample.point() - center) / m_bbox_size; + sample.point() = CGAL::ORIGIN + vec; + } + m_bbox_x = m_bbox_y = 0.0; + m_bbox_size = 1.0; + } - void compute_bbox(double &x, double &y, double &scale) { - if (m_samples.empty()) { - x = y = 0.0; - scale = 1.0; - return; - } + void compute_bbox(double &x, double &y, double &scale) { + if (m_samples.empty()) { + x = y = 0.0; + scale = 1.0; + return; + } - FT x_min, x_max, y_min, y_max; - std::vector::const_iterator it = m_samples.begin(); - Point p = it->point(); - x_min = x_max = p.x(); - y_min = y_max = p.y(); - ++it; - for (; it != m_samples.end(); ++it) { - p = it->point(); - x_min = (std::min)(x_min, p.x()); - x_max = (std::max)(x_max, p.x()); - y_min = (std::min)(y_min, p.y()); - y_max = (std::max)(y_max, p.y()); - } + FT x_min, x_max, y_min, y_max; + std::vector::const_iterator it = m_samples.begin(); + Point p = it->point(); + x_min = x_max = p.x(); + y_min = y_max = p.y(); + ++it; + for (; it != m_samples.end(); ++it) { + p = it->point(); + x_min = (std::min)(x_min, p.x()); + x_max = (std::max)(x_max, p.x()); + y_min = (std::min)(y_min, p.y()); + y_max = (std::max)(y_max, p.y()); + } - x = 0.5 * (x_min + x_max); - y = 0.5 * (y_min + y_max); - scale = (std::max)(x_max - x_min, y_max - y_min); - if (scale == 0.0) - scale = 1.0; - } + x = 0.5 * (x_min + x_max); + y = 0.5 * (y_min + y_max); + scale = (std::max)(x_max - x_min, y_max - y_min); + if (scale == 0.0) + scale = 1.0; + } - // IO SAMPLES // + // IO SAMPLES // - void load(const QString& filename, const bool gradient) { - // TODO: load xml + void load(const QString& filename, const bool gradient) { + // TODO: load xml - if (filename.contains(".xy", Qt::CaseInsensitive)) { - load_xy_file(filename); - normalize_points(); - return; - } + if (filename.contains(".xy", Qt::CaseInsensitive)) { + load_xy_file(filename); + normalize_points(); + return; + } - if (filename.contains(".txt", Qt::CaseInsensitive)) { - load_xy_file(filename); - normalize_points(); - return; - } + if (filename.contains(".txt", Qt::CaseInsensitive)) { + load_xy_file(filename); + normalize_points(); + return; + } - if (filename.contains(".gtn", Qt::CaseInsensitive)) { - load_gathan_file(filename); - normalize_points(); - return; - } + if (filename.contains(".gtn", Qt::CaseInsensitive)) { + load_gathan_file(filename); + normalize_points(); + return; + } - if (filename.contains(".dat", Qt::CaseInsensitive)) { - load_dat_file(filename); - normalize_points(); - return; - } + if (filename.contains(".dat", Qt::CaseInsensitive)) { + load_dat_file(filename); + normalize_points(); + return; + } - if (filename.contains(".bmp", Qt::CaseInsensitive)) { - if (gradient) - load_gradient(filename); - else - load_image(filename); - normalize_points(); - return; - } + if (filename.contains(".bmp", Qt::CaseInsensitive)) { + if (gradient) + load_gradient(filename); + else + load_image(filename); + normalize_points(); + return; + } - std::cerr << "Invalid file (try .xy, .dat, .bmp)" << std::endl; - } + std::cerr << "Invalid file (try .xy, .dat, .bmp)" << std::endl; + } - void load_xy_file(const QString& fileName) { + void load_xy_file(const QString& fileName) { - std::cout << "FILENAME " << fileName.toUtf8().constData() << std::endl; - std::ifstream ifs(qPrintable(fileName)); - std::cerr << "read xy..."; - Point point; - unsigned int nb = 0; - while (ifs >> point) { - add_sample(point, 1.0); - nb++; - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - } + std::cout << "FILENAME " << fileName.toUtf8().constData() << std::endl; + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read xy..."; + Point point; + unsigned int nb = 0; + while (ifs >> point) { + add_sample(point, 1.0); + nb++; + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + } - void load_gathan_file(const QString& fileName) { - std::ifstream ifs(qPrintable(fileName)); - std::cerr << "read gathan..."; - Point point; - unsigned nb, x, y, z; - ifs >> nb >> x >> y >> z; - for (unsigned int i = 0; i < nb; ++i) { - ifs >> x >> point; - add_sample(point, 1.0); - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - } + void load_gathan_file(const QString& fileName) { + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read gathan..."; + Point point; + unsigned nb, x, y, z; + ifs >> nb >> x >> y >> z; + for (unsigned int i = 0; i < nb; ++i) { + ifs >> x >> point; + add_sample(point, 1.0); + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + } - void load_dat_file(const QString& fileName) { - std::ifstream ifs(qPrintable(fileName)); - std::cerr << "read dat..."; - Point point; - unsigned int n, m, nb = 0; - ifs >> n; - for (unsigned int i = 0; i < n; ++i) { - ifs >> m; - for (unsigned int j = 0; j < m; ++j) { - ifs >> point; - add_sample(point, 1.0); - } - nb += m; - } - std::cerr << "done (" << nb << " points)" << std::endl; - ifs.close(); - } + void load_dat_file(const QString& fileName) { + std::ifstream ifs(qPrintable(fileName)); + std::cerr << "read dat..."; + Point point; + unsigned int n, m, nb = 0; + ifs >> n; + for (unsigned int i = 0; i < n; ++i) { + ifs >> m; + for (unsigned int j = 0; j < m; ++j) { + ifs >> point; + add_sample(point, 1.0); + } + nb += m; + } + std::cerr << "done (" << nb << " points)" << std::endl; + ifs.close(); + } - void load_image(const QString& fileName) { - std::cerr << "read image..."; - cimg_library::CImg image(qPrintable(fileName)); - std::cerr << "done" << std::endl; + void load_image(const QString& fileName) { + std::cerr << "read image..."; + cimg_library::CImg image(qPrintable(fileName)); + std::cerr << "done" << std::endl; - std::cerr << "compute grayscale..."; - cimg_library::CImg grayscale = - image.RGBtoHSV().get_channel(2).normalize(0.0f, 1.0f); - std::cerr << "done" << std::endl; + std::cerr << "compute grayscale..."; + cimg_library::CImg grayscale = + image.RGBtoHSV().get_channel(2).normalize(0.0f, 1.0f); + std::cerr << "done" << std::endl; - // turn pixels into weighted samples - std::cerr << "add samples..."; - for (int i = 0; i < grayscale.width(); i++) { - for (int j = 0; j < grayscale.height(); j++) { - float mass = 1.0f - grayscale.atXY(i, j); - double x = double(i) / grayscale.width(); - double y = 1.0 - double(j) / grayscale.height(); + // turn pixels into weighted samples + std::cerr << "add samples..."; + for (int i = 0; i < grayscale.width(); i++) { + for (int j = 0; j < grayscale.height(); j++) { + float mass = 1.0f - grayscale.atXY(i, j); + double x = double(i) / grayscale.width(); + double y = 1.0 - double(j) / grayscale.height(); if (mass > 0.f) - add_sample(Point(x, y), mass); - } - } - std::cerr << "done (" << m_samples.size() << ")" << std::endl; - } - - void load_gradient(const QString& fileName) { - std::cerr << "read image..."; - cimg_library::CImg image(qPrintable(fileName)); - std::cerr << "done" << std::endl; - - std::cerr << "compute gradient..."; - cimg_library::CImgList grad = image.get_gradient(); - cimg_library::CImg normgrad = sqrt( - grad[0].pow(2) + grad[1].pow(2)).normalize(0.0f, 1.0f); - std::cerr << "done" << std::endl; - - // turn pixels into weighted samples - std::cerr << "add samples..."; - for (int i = 0; i < normgrad.width(); i++) { - for (int j = 0; j < normgrad.height(); j++) { - float mass = normgrad.atXY(i, j); - double x = double(i) / normgrad.width(); - double y = 1.0 - double(j) / normgrad.height(); - add_sample(Point(x, y), mass); - } - } - std::cerr << "done (" << m_samples.size() << ")" << std::endl; - } - - void print_vertex(Vertex vertex) { - std::cout <<"vertex " << vertex << std::endl; - } - - - void print_edge(PEdge edge) { - int i = ((edge).edge()).second; - Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); - Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); - std::cout <<"( " << (edge).priority() << ") ( " << a - << " , " << b << " )" << std::endl; - } - - - void debug_print() { - - - std::vector isolated_points; - std::vector edges; - - m_pwsrec->list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); - - - - int vertex_count = 0; - for (std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - vertex_count++; - std::cout << *it << std::endl; - } - assert(vertex_count == 18); - - int edge_count = 0; - for (std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - std::cout << *it << std::endl; - edge_count++; - } - } - - void save(const QString& filename) { - std::cout << "SAVE-------------" << std::endl; - debug_print(); - - if (filename.contains(".edges", Qt::CaseInsensitive)) { - std::ofstream ofs(qPrintable(filename)); - m_pwsrec->save_edges(ofs, m_ignore); - ofs.close(); - return; - } - - Sample_vector samples; - for (std::vector::iterator it = m_samples.begin(); - it != m_samples.end(); ++it) { - Sample_& s = *it; - if (s.mass() < m_min_mass) - continue; - samples.push_back(&s); - } - - if (filename.contains(".xy", Qt::CaseInsensitive)) { - save_xy(filename, samples); - return; - } - - if (filename.contains(".poff", Qt::CaseInsensitive)) { - save_poff(filename, samples); - return; - } - - if (filename.contains(".gtn", Qt::CaseInsensitive)) { - save_gtn(filename, samples); - return; - } - - if (filename.contains(".pwn", Qt::CaseInsensitive)) { - save_pwn(filename, samples); - return; - } - } - - void save_pwn(const QString& filename, const Sample_vector& samples) { - std::vector normals; - compute_normals(samples, normals); - std::ofstream ofs(qPrintable(filename)); - std::vector::const_iterator ni = normals.begin(); - for (Sample_vector_const_iterator it = samples.begin(); - it != samples.end(); ++it) { - Sample_* sample = *it; - ofs << sample->point() << " " << *ni << std::endl; - ni++; - } - ofs.close(); - } - - void compute_normals(const Sample_vector& samples, - std::vector& normals) { - normals.clear(); - Point last = samples.back()->point(); - Sample_vector_const_iterator si = samples.begin(); - while (si != samples.end()) { - Point p = (*si)->point(); - si++; - Point next = samples.front()->point(); - if (si != samples.end()) - next = (*si)->point(); - - Vector ab = p - last; - Vector bc = next - p; - Vector ab90(ab.y(), -ab.x()); - Vector bc90(bc.y(), -bc.x()); - - Vector ni = ab90 + bc90; - FT norm = std::sqrt(ni * ni); - if (norm != 0.0) - ni = ni / norm; - normals.push_back(ni); - - last = p; - } - } - - void save_xy(const QString& filename, const Sample_vector& samples) { - std::ofstream ofs(qPrintable(filename)); - for (Sample_vector_const_iterator it = samples.begin(); - it != samples.end(); ++it) { - Sample_* sample = *it; - ofs << sample->point() << std::endl; - } - ofs.close(); - } - - void save_poff(const QString& filename, const Sample_vector& samples) { - std::ofstream ofs(qPrintable(filename)); - ofs << "POFF " << samples.size() << " 0 0" << std::endl; - for (Sample_vector_const_iterator it = samples.begin(); - it != samples.end(); ++it) { - Sample_* sample = *it; - ofs << sample->point() << std::endl; - } - ofs.close(); - } - - void save_gtn(const QString& filename, const Sample_vector& samples) { - std::ofstream ofs(qPrintable(filename)); - ofs << samples.size() << " 2 0 0" << std::endl; - unsigned int i = 0; - for (Sample_vector_const_iterator it = samples.begin(); - it != samples.end(); ++it, ++i) { - Sample_* sample = *it; - ofs << i << " " << sample->point() << std::endl; - } - ofs.close(); - } - - // RECONSTRUCTION // - - void set_parameters(const int verbose, const int mchoice, - const bool use_flip, const double alpha, const double norm_tol, - const double tang_tol, const unsigned int relocation, - const double ghost) { - - m_pwsrec->set_verbose(verbose); - m_pwsrec->set_random_sample_size(mchoice); - m_pwsrec->set_use_flip(use_flip); - m_pwsrec->set_alpha(alpha); - m_pwsrec->set_tang_tol(tang_tol * m_bbox_size); - m_pwsrec->set_norm_tol(norm_tol * m_bbox_size); - m_pwsrec->set_relocation(relocation); - m_pwsrec->set_relevance(ghost); - } - - bool init_reconstruction(const double percentage) { - std::cout << " init_reconstruction " << std::endl; - - if (m_samples.empty()) { - std::cerr << "initialization failed (empty point set)" << std::endl; - return false; - } - - Sample_vector vertices, samples; - select_samples(percentage, vertices, samples); - - PointMassList point_mass_list; - Sample_vector_const_iterator it; - for (it = vertices.begin(); it != vertices.end(); it++) { - point_mass_list.push_back( - std::make_pair((*it)->point(), (*it)->mass())); - } - - Point_property_map point_pmap; - Mass_property_map mass_pmap; - MassPoint mp; - - m_pwsrec->initialize(point_mass_list.begin(), point_mass_list.end(), - point_pmap, mass_pmap); - - return true; - } - - void decimate(const double percentage) { - std::cout << "Decimate from " << m_samples.size() << " to..."; - std::vector selected; - - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); it++) { - const double rd = random_double(0.0, 1.0); - if (rd >= percentage) - selected.push_back(*it); - } - - m_samples.clear(); - std::copy(selected.begin(), selected.end(), - std::back_inserter(m_samples)); - std::cout << m_samples.size() << std::endl; - } - - void keep_one_point_out_of(const int n) { - std::cout << "Decimate from " << m_samples.size() << " to..."; - std::vector selected; - - int index = 0; - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); it++, index++) { - if (index % n == 0) - selected.push_back(*it); - } - - m_samples.clear(); - std::copy(selected.begin(), selected.end(), - std::back_inserter(m_samples)); - std::cout << m_samples.size() << std::endl; - } - - void select_samples(const double percentage, Sample_vector& vertices, - Sample_vector& samples) { - std::vector::iterator it; - for (it = m_samples.begin(); it != m_samples.end(); ++it) { - Sample_& s = *it; - if (s.mass() <= m_min_mass) - continue; - - samples.push_back(&s); - FT rv = random_double(0.0, 1.0); - if (rv <= percentage) - vertices.push_back(&s); - } - } - - void reconstruct_until(const unsigned int nv) { - std::cout << "reconstruct_until" << std::endl; - m_pwsrec->run_until(nv); - } - - void reconstruct(const unsigned int steps) { - std::cout << "reconstruct" << std::endl; - m_pwsrec->run(steps); - } - - void relocate_all_points() { - std::cout << "relocate_all_points" << std::endl; - m_pwsrec->relocate_all_points(); - } - - void print_stats() { - std::cout << "print_stats" << std::endl; - m_pwsrec->print_stats(); - } - - // RENDER // - - void render(const bool view_points, const bool view_vertices, - const bool view_edges, const bool view_ghost_edges, - const bool view_edge_cost, const bool view_edge_priority, - const bool view_bins, const bool view_foot_points, - const bool view_relocation, const bool view_tolerance, - const bool view_incolors, const bool view_edge_relevance, - const float point_size, const float vertex_size, - const float line_thickness) { - if (m_pwsrec == NULL) { - return; - } - - if (view_edges) - m_pwsrec->draw_edges(0.5f * line_thickness, 0.4f, 0.4f, 0.4f); - - if (view_edge_cost) - m_pwsrec->draw_costs(line_thickness, view_ghost_edges); - - if (view_edge_priority) - m_pwsrec->draw_pedges(line_thickness); - - if (view_edge_relevance) - m_pwsrec->draw_relevance(line_thickness, m_ignore, view_incolors); - - if (view_relocation) - m_pwsrec->draw_relocation(); - - if (view_vertices) - m_pwsrec->draw_vertices(vertex_size, 0.0f, 0.0f, 0.5f); - - if (view_bins) - m_pwsrec->draw_bins(0.5f * line_thickness); - - if (view_foot_points) - m_pwsrec->draw_footpoints(line_thickness, 0.2f, 0.8f, 0.2f); - - if (view_tolerance) - draw_circles(); - - if (view_points) - draw_samples(point_size); - } - - void render_simulation(const Point& point, int option, - const float vertex_size, const float line_width) { - - std::cout << "render_simulation" << std::endl; - - switch (option) { - case 0: - m_pwsrec->draw_one_ring(vertex_size, line_width, point); - break; - case 1: - m_pwsrec->draw_blocking_edges(vertex_size, line_width, point); - break; - case 2: - m_pwsrec->draw_collapsible_edge(vertex_size, line_width, point); - break; - case 3: - m_pwsrec->draw_simulation(vertex_size, line_width, point); - break; - case 4: - m_pwsrec->draw_remove_queue_stencil(vertex_size, line_width, point); - break; - case 5: - m_pwsrec->draw_cost_stencil(vertex_size, line_width, point); - break; - case 6: - m_pwsrec->draw_push_queue_stencil(vertex_size, line_width, point); - break; - default: - break; - } - } - - void draw_samples(const float point_size) { - double max_value = m_max_mass; - if (max_value == 0.0) - max_value = 1.0; - - ::glPointSize(point_size); - ::glBegin(GL_POINTS); - std::vector::const_iterator it; - for (it = m_samples.begin(); it != m_samples.end(); it++) { - double mass = it->mass(); - if (mass <= m_min_mass) - continue; - - float value = mass / m_max_mass; - float grey = 0.9 * (1.0f - value); - ::glColor3f(grey, grey, grey); - const Point& p = it->point(); - ::glVertex2d(p.x(), p.y()); - } - ::glEnd(); - } - - void draw_circles() { - Sample_vector vertices, samples; - select_samples(1.0, vertices, samples); - double percentage = 500.0 / double(vertices.size()); - percentage = (std::min)(percentage, 1.0); - - samples.clear(); - vertices.clear(); - select_samples(percentage, vertices, samples); - - ::glEnable(GL_BLEND); - ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - ::glColor4f(1.0f, 1.0f, 0.2f, 0.25f); - for (Sample_vector_const_iterator it = samples.begin(); - it != samples.end(); it++) { - Sample_* sample = *it; - draw_one_circle(sample->point()); - } - ::glDisable(GL_BLEND); - } - - void draw_one_circle(const Point& center) { - unsigned int N = 10; - const double r = std::sqrt(m_pwsrec->get_norm_tol()); - const double x = center.x(); - const double y = center.y(); - ::glBegin (GL_POLYGON); - for (unsigned int i = 0; i < N; ++i) { - double angle = 2.0 * M_PI * (double(i) / double(N)); - double u = r * std::cos(angle) + x; - double v = r * std::sin(angle) + y; - ::glVertex2d(u, v); - } - ::glEnd(); - } - - // PREDEFINED EXAMPLES // - - void make_line(const unsigned int nb, const Point& start, - const Point& end) { - Point curr = start; - Vector incr = (end - start) / nb; - for (unsigned int i = 0; i < nb; i++) { - add_sample(curr); - curr = curr + incr; - } - } - - void make_circle_arc(const unsigned int nb, const Point& c, - const double radius, const double min_angle = 0.0, - const double max_angle = 360.0) { - const double range = max_angle - min_angle; - const double incr = range / double(nb); - for (double angle = min_angle; angle < max_angle; angle += incr) { - double angle_rad = (angle / 360.0) * 6.2831853; - double x = c.x() + radius * cos(angle_rad); - double y = c.y() + radius * sin(angle_rad); - Point point(x, y); - add_sample(point); - } - } - - void append_widely_variable_sampling(const float d1, const float d2) { - double angle; - double incr = d1; - Point c = Point(0.5, 0.5); - const double radius = 0.5; - // 0-90 deg -> d1 - for (angle = 0.0; angle < 90.0; angle += incr) { - double angle_rad = (angle / 360.0) * 6.2831853; - double x = c.x() + radius * cos(angle_rad); - double y = c.y() + radius * sin(angle_rad); - Point point(x, y); - add_sample(point); - } - // 90-180 deg -> d1 -> d2 - for (angle = 90.0; angle < 180.0; angle += incr) { - double angle_rad = (angle / 360.0) * 6.2831853; - double x = c.x() + radius * cos(angle_rad); - double y = c.y() + radius * sin(angle_rad); - Point point(x, y); - add_sample(point); - incr = d1 + (d2 - d1) / 90.0 * (angle - 90); - } - // 180-270 deg -> d2 - incr = d2; - for (angle = 180.0; angle < 270.0; angle += incr) { - double angle_rad = (angle / 360.0) * 6.2831853; - double x = c.x() + radius * cos(angle_rad); - double y = c.y() + radius * sin(angle_rad); - Point point(x, y); - add_sample(point); - } - // 270-360 deg -> d2 -> d1 - incr = d2; - for (angle = 270.0; angle < 360.0; angle += incr) { - double angle_rad = (angle / 360.0) * 6.2831853; - double x = c.x() + radius * cos(angle_rad); - double y = c.y() + radius * sin(angle_rad); - Point point(x, y); - add_sample(point); - incr = d2 + (d1 - d2) / 90.0 * (angle - 270.0); - } - } - - void append_predefined_line(const int density) { - std::cerr << "append line..."; - Point start(0.0, 0.5); - Point end(1.0, 0.5); - make_line(density, start, end); - std::cerr << "done" << std::endl; - } - - void append_predefined_parallel_lines(const int nb_lines, const float space, - const int density) { - std::cerr << "append parallel lines..."; - FT x[4]; - x[0] = 0.0; - x[1] = 0.75; - x[2] = 1.0; - x[3] = 1.75; - FT y = 0.0; - for (int i = 0; i < nb_lines; ++i) { - int j = i % 2; - Point start(x[j], y); - Point end(x[j + 2], y); - make_line(density, start, end); - y += space; - } - std::cerr << "done" << std::endl; - } - - void append_predefined_circle(const int density, const float x, - const float y, const float radius) { - std::cerr << "append circle..."; - Point center(x, y); - make_circle_arc(density, center, radius); - std::cerr << "done" << std::endl; - } - - void append_predefined_spiral(const int nb_loops, const int density) { - std::cerr << "append spiral..."; - Point center(0.5, 0.5); - const FT max_radius = 0.5; - const FT spacing = 10. / density; // target spacing - double radius = max_radius; - const double max_angle = nb_loops * 360.0; - for (double angle = max_angle; angle > 0.0; /**/) { - double angle_rad = (angle / 360.0) * 6.2831853; - double x = center.x() + radius * cos(angle_rad); - double y = center.y() + radius * sin(angle_rad); - Point point(x, y); - add_sample(point); - - const double angle_incr = atan(spacing / radius); - angle -= angle_incr; - radius = max_radius * angle / max_angle; - } - std::cerr << "done" << std::endl; - } - - void append_predefined_half_circle(const int density) { - std::cerr << "append half circle..."; - Point center(0.5, 0.5); - make_circle_arc(density, center, 0.5, 0.0, 180.0); - std::cerr << "done" << std::endl; - } - - void append_predefined_box(const int density, const float x, const float y, - const float size_x, const float size_y) { - std::cerr << "append box..."; - Point a(x - size_x / 2, y - size_y / 2); - Point b(x + size_x / 2, y - size_y / 2); - Point c(x + size_x / 2, y + size_y / 2); - Point d(x - size_x / 2, y + size_y / 2); - make_line(density, a, b); - make_line(density, b, c); - make_line(density, c, d); - make_line(density, d, a); - std::cerr << "done" << std::endl; - } - - void append_predefined_box_with_boundaries(const int density) { - std::cerr << "append box with boundaries..."; - - Point a(0.1, 0.1); - Point b(0.4, 0.1); - Point c(0.6, 0.1); - Point d(0.9, 0.1); - Point e(0.9, 0.4); - Point f(0.9, 0.6); - Point g(0.9, 0.9); - Point h(0.6, 0.9); - Point i(0.4, 0.9); - Point j(0.1, 0.9); - Point k(0.1, 0.6); - Point l(0.1, 0.4); - - make_line(density, a, b); - make_line(density, c, d); - make_line(density, d, e); - make_line(density, f, g); - make_line(density, g, h); - make_line(density, i, j); - make_line(density, j, k); - make_line(density, l, a); - - std::cerr << "done" << std::endl; - } - - void append_predefined_box_with_missing_corners(const int density) { - std::cerr << "append box with missing corners..."; - Point a(0.12, 0.1); - Point b(0.88, 0.1); - Point c(0.9, 0.12); - Point d(0.9, 0.88); - Point e(0.88, 0.9); - Point f(0.12, 0.9); - Point g(0.1, 0.88); - Point h(0.1, 0.12); - make_line(density, a, b); - make_line(density, c, d); - make_line(density, e, f); - make_line(density, g, h); - std::cerr << "done" << std::endl; - } - - void append_predefined_boxes(const int density) { - std::cerr << "append two boxes..."; - Point a(0.0, 0.0); - Point b(0.2, 0.0); - Point c(0.2, 1.0); - Point d(0.0, 1.0); - make_line(2 * density, a, b); - make_line(10 * density, b, c); - make_line(2 * density, c, d); - make_line(10 * density, d, a); - - Point e(0.3, 0.0); - Point f(0.4, 0.0); - Point g(0.4, 0.3); - Point h(0.3, 0.3); - make_line(1 * density, e, f); - make_line(3 * density, f, g); - make_line(1 * density, g, h); - make_line(3 * density, h, e); - std::cerr << "done" << std::endl; - } - - void append_predefined_stair(const int density) { - std::cerr << "append stair..."; - Point a(0.0, 0.0); - Point b(0.1, 0.0); - Point c(0.1, 0.1); - Point d(0.2, 0.1); - Point e(0.2, 0.2); - Point f(0.3, 0.2); - Point g(0.3, 0.3); - Point h(0.4, 0.3); - Point i(0.4, 0.4); - - make_line(density, a, b); - make_line(density, b, c); - make_line(density, c, d); - make_line(density, d, e); - make_line(density, e, f); - make_line(density, f, g); - make_line(density, g, h); - make_line(density, h, i); - std::cerr << "done" << std::endl; - } - - void append_predefined_skyline(const int density) { - std::cerr << "append skyline..."; - Point a(0.0, 0.0); - Point b(0.1, 0.0); - Point c(0.1, 0.5); - Point d(0.3, 0.5); - Point e(0.3, 0.2); - Point f(0.4, 0.2); - Point g(0.4, 0.4); - Point h(0.6, 0.4); - Point i(0.6, -0.1); - Point j(0.7, -0.1); - Point k(0.7, 0.2); - Point l(0.8, 0.2); - Point m(0.8, 0.7); - Point n(0.9, 0.7); - Point o(0.9, 0.5); - Point p(1.0, 0.5); - Point q(1.0, 0.1); - Point r(1.1, 0.1); - Point s(1.1, -0.1); - Point t(1.2, -0.1); - - make_line(1 * density, a, b); - make_line(5 * density, b, c); - make_line(2 * density, c, d); - make_line(3 * density, d, e); - make_line(1 * density, e, f); - make_line(2 * density, f, g); - make_line(2 * density, g, h); - make_line(5 * density, h, i); - make_line(1 * density, i, j); - make_line(3 * density, j, k); - make_line(1 * density, k, l); - make_line(5 * density, l, m); - make_line(1 * density, m, n); - make_line(2 * density, n, o); - make_line(1 * density, o, p); - make_line(4 * density, p, q); - make_line(1 * density, q, r); - make_line(2 * density, r, s); - make_line(1 * density, s, t); - std::cerr << "done" << std::endl; - } - - void append_star(const int nb_branches, const int density) { - std::cerr << "append star..."; - const double deg_in_rad = 3.1415926535897932384626 / 180.0; - const double incr = 180.0 / nb_branches; - double angle = 0.0; - const Point center(0.5, 0.5); - for (int i = 0; i < nb_branches; i++) { - const double angle_rad = angle * deg_in_rad; - Vector v(sin(angle_rad), cos(angle_rad)); - Point a = center + v; - Point b = center - v; - make_line(density, a, b); - angle += incr; - } - std::cerr << "done" << std::endl; - } - - void append_predefined_increasingly_sharp_angles(const int density, - const double min_angle) { - const double deg_in_rad = 3.1415926535897932384626 / 180.0; - double prev_angle = 0.0; - double curr_angle = min_angle; - double incr = min_angle; - const double r1 = 0.5; - const Point center(0.5, 0.5); - while (curr_angle < 360.0) { - Vector va(r1 * cos(prev_angle * deg_in_rad), - r1 * sin(prev_angle * deg_in_rad)); - Vector vb(r1 * cos(curr_angle * deg_in_rad), - r1 * sin(curr_angle * deg_in_rad)); - const double average_angle = 0.5 * (prev_angle + curr_angle); - Vector vc(r1 * cos(average_angle * deg_in_rad), - r1 * sin(average_angle * deg_in_rad)); - Point a = center + va; - Point b = center + vb; - Point c = center + 2 * vc; - - make_line(density, a, c); - make_line(density, b, c); - - prev_angle = curr_angle; - curr_angle += incr; - incr += 2.0; - } - noise(1e-5); - } + add_sample(Point(x, y), mass); + } + } + std::cerr << "done (" << m_samples.size() << ")" << std::endl; + } + + void load_gradient(const QString& fileName) { + std::cerr << "read image..."; + cimg_library::CImg image(qPrintable(fileName)); + std::cerr << "done" << std::endl; + + std::cerr << "compute gradient..."; + cimg_library::CImgList grad = image.get_gradient(); + cimg_library::CImg normgrad = sqrt( + grad[0].pow(2) + grad[1].pow(2)).normalize(0.0f, 1.0f); + std::cerr << "done" << std::endl; + + // turn pixels into weighted samples + std::cerr << "add samples..."; + for (int i = 0; i < normgrad.width(); i++) { + for (int j = 0; j < normgrad.height(); j++) { + float mass = normgrad.atXY(i, j); + double x = double(i) / normgrad.width(); + double y = 1.0 - double(j) / normgrad.height(); + add_sample(Point(x, y), mass); + } + } + std::cerr << "done (" << m_samples.size() << ")" << std::endl; + } + + void print_vertex(Vertex vertex) { + std::cout <<"vertex " << vertex << std::endl; + } + + + void print_edge(PEdge edge) { + int i = ((edge).edge()).second; + Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); + Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); + std::cout <<"( " << (edge).priority() << ") ( " << a + << " , " << b << " )" << std::endl; + } + + + void debug_print() { + + + std::vector isolated_points; + std::vector edges; + + m_pwsrec->list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); + + + + int vertex_count = 0; + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + vertex_count++; + std::cout << *it << std::endl; + } + assert(vertex_count == 18); + + int edge_count = 0; + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + edge_count++; + } + } + + void save(const QString& filename) { + std::cout << "SAVE-------------" << std::endl; + debug_print(); + + if (filename.contains(".edges", Qt::CaseInsensitive)) { + std::ofstream ofs(qPrintable(filename)); + m_pwsrec->save_edges(ofs, m_ignore); + ofs.close(); + return; + } + + Sample_vector samples; + for (std::vector::iterator it = m_samples.begin(); + it != m_samples.end(); ++it) { + Sample_& s = *it; + if (s.mass() < m_min_mass) + continue; + samples.push_back(&s); + } + + if (filename.contains(".xy", Qt::CaseInsensitive)) { + save_xy(filename, samples); + return; + } + + if (filename.contains(".poff", Qt::CaseInsensitive)) { + save_poff(filename, samples); + return; + } + + if (filename.contains(".gtn", Qt::CaseInsensitive)) { + save_gtn(filename, samples); + return; + } + + if (filename.contains(".pwn", Qt::CaseInsensitive)) { + save_pwn(filename, samples); + return; + } + } + + void save_pwn(const QString& filename, const Sample_vector& samples) { + std::vector normals; + compute_normals(samples, normals); + std::ofstream ofs(qPrintable(filename)); + std::vector::const_iterator ni = normals.begin(); + for (Sample_vector_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample_* sample = *it; + ofs << sample->point() << " " << *ni << std::endl; + ni++; + } + ofs.close(); + } + + void compute_normals(const Sample_vector& samples, + std::vector& normals) { + normals.clear(); + Point last = samples.back()->point(); + Sample_vector_const_iterator si = samples.begin(); + while (si != samples.end()) { + Point p = (*si)->point(); + si++; + Point next = samples.front()->point(); + if (si != samples.end()) + next = (*si)->point(); + + Vector ab = p - last; + Vector bc = next - p; + Vector ab90(ab.y(), -ab.x()); + Vector bc90(bc.y(), -bc.x()); + + Vector ni = ab90 + bc90; + FT norm = std::sqrt(ni * ni); + if (norm != 0.0) + ni = ni / norm; + normals.push_back(ni); + + last = p; + } + } + + void save_xy(const QString& filename, const Sample_vector& samples) { + std::ofstream ofs(qPrintable(filename)); + for (Sample_vector_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample_* sample = *it; + ofs << sample->point() << std::endl; + } + ofs.close(); + } + + void save_poff(const QString& filename, const Sample_vector& samples) { + std::ofstream ofs(qPrintable(filename)); + ofs << "POFF " << samples.size() << " 0 0" << std::endl; + for (Sample_vector_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample_* sample = *it; + ofs << sample->point() << std::endl; + } + ofs.close(); + } + + void save_gtn(const QString& filename, const Sample_vector& samples) { + std::ofstream ofs(qPrintable(filename)); + ofs << samples.size() << " 2 0 0" << std::endl; + unsigned int i = 0; + for (Sample_vector_const_iterator it = samples.begin(); + it != samples.end(); ++it, ++i) { + Sample_* sample = *it; + ofs << i << " " << sample->point() << std::endl; + } + ofs.close(); + } + + // RECONSTRUCTION // + + void set_parameters(const int verbose, const int mchoice, + const bool use_flip, const double alpha, const double norm_tol, + const double tang_tol, const unsigned int relocation, + const double ghost) { + + m_pwsrec->set_verbose(verbose); + m_pwsrec->set_random_sample_size(mchoice); + m_pwsrec->set_use_flip(use_flip); + m_pwsrec->set_alpha(alpha); + m_pwsrec->set_tang_tol(tang_tol * m_bbox_size); + m_pwsrec->set_norm_tol(norm_tol * m_bbox_size); + m_pwsrec->set_relocation(relocation); + m_pwsrec->set_relevance(ghost); + } + + bool init_reconstruction(const double percentage) { + std::cout << " init_reconstruction " << std::endl; + + if (m_samples.empty()) { + std::cerr << "initialization failed (empty point set)" << std::endl; + return false; + } + + Sample_vector vertices, samples; + select_samples(percentage, vertices, samples); + + PointMassList point_mass_list; + Sample_vector_const_iterator it; + for (it = vertices.begin(); it != vertices.end(); it++) { + point_mass_list.push_back( + std::make_pair((*it)->point(), (*it)->mass())); + } + + Point_property_map point_pmap; + Mass_property_map mass_pmap; + MassPoint mp; + + m_pwsrec->initialize(point_mass_list.begin(), point_mass_list.end(), + point_pmap, mass_pmap); + + return true; + } + + void decimate(const double percentage) { + std::cout << "Decimate from " << m_samples.size() << " to..."; + std::vector selected; + + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++) { + const double rd = random_double(0.0, 1.0); + if (rd >= percentage) + selected.push_back(*it); + } + + m_samples.clear(); + std::copy(selected.begin(), selected.end(), + std::back_inserter(m_samples)); + std::cout << m_samples.size() << std::endl; + } + + void keep_one_point_out_of(const int n) { + std::cout << "Decimate from " << m_samples.size() << " to..."; + std::vector selected; + + int index = 0; + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++, index++) { + if (index % n == 0) + selected.push_back(*it); + } + + m_samples.clear(); + std::copy(selected.begin(), selected.end(), + std::back_inserter(m_samples)); + std::cout << m_samples.size() << std::endl; + } + + void select_samples(const double percentage, Sample_vector& vertices, + Sample_vector& samples) { + std::vector::iterator it; + for (it = m_samples.begin(); it != m_samples.end(); ++it) { + Sample_& s = *it; + if (s.mass() <= m_min_mass) + continue; + + samples.push_back(&s); + FT rv = random_double(0.0, 1.0); + if (rv <= percentage) + vertices.push_back(&s); + } + } + + void reconstruct_until(const unsigned int nv) { + std::cout << "reconstruct_until" << std::endl; + m_pwsrec->run_until(nv); + } + + void reconstruct(const unsigned int steps) { + std::cout << "reconstruct" << std::endl; + m_pwsrec->run(steps); + } + + void relocate_all_points() { + std::cout << "relocate_all_points" << std::endl; + m_pwsrec->relocate_all_points(); + } + + void print_stats() { + std::cout << "print_stats" << std::endl; + m_pwsrec->print_stats(); + } + + // RENDER // + + void render(const bool view_points, const bool view_vertices, + const bool view_edges, const bool view_ghost_edges, + const bool view_edge_cost, const bool view_edge_priority, + const bool view_bins, const bool view_foot_points, + const bool view_relocation, const bool view_tolerance, + const bool view_incolors, const bool view_edge_relevance, + const float point_size, const float vertex_size, + const float line_thickness) { + if (m_pwsrec == NULL) { + return; + } + + if (view_edges) + m_pwsrec->draw_edges(0.5f * line_thickness, 0.4f, 0.4f, 0.4f); + + if (view_edge_cost) + m_pwsrec->draw_costs(line_thickness, view_ghost_edges); + + if (view_edge_priority) + m_pwsrec->draw_pedges(line_thickness); + + if (view_edge_relevance) + m_pwsrec->draw_relevance(line_thickness, m_ignore, view_incolors); + + if (view_relocation) + m_pwsrec->draw_relocation(); + + if (view_vertices) + m_pwsrec->draw_vertices(vertex_size, 0.0f, 0.0f, 0.5f); + + if (view_bins) + m_pwsrec->draw_bins(0.5f * line_thickness); + + if (view_foot_points) + m_pwsrec->draw_footpoints(line_thickness, 0.2f, 0.8f, 0.2f); + + if (view_tolerance) + draw_circles(); + + if (view_points) + draw_samples(point_size); + } + + void render_simulation(const Point& point, int option, + const float vertex_size, const float line_width) { + + std::cout << "render_simulation" << std::endl; + + switch (option) { + case 0: + m_pwsrec->draw_one_ring(vertex_size, line_width, point); + break; + case 1: + m_pwsrec->draw_blocking_edges(vertex_size, line_width, point); + break; + case 2: + m_pwsrec->draw_collapsible_edge(vertex_size, line_width, point); + break; + case 3: + m_pwsrec->draw_simulation(vertex_size, line_width, point); + break; + case 4: + m_pwsrec->draw_remove_queue_stencil(vertex_size, line_width, point); + break; + case 5: + m_pwsrec->draw_cost_stencil(vertex_size, line_width, point); + break; + case 6: + m_pwsrec->draw_push_queue_stencil(vertex_size, line_width, point); + break; + default: + break; + } + } + + void draw_samples(const float point_size) { + double max_value = m_max_mass; + if (max_value == 0.0) + max_value = 1.0; + + ::glPointSize(point_size); + ::glBegin(GL_POINTS); + std::vector::const_iterator it; + for (it = m_samples.begin(); it != m_samples.end(); it++) { + double mass = it->mass(); + if (mass <= m_min_mass) + continue; + + float value = mass / m_max_mass; + float grey = 0.9 * (1.0f - value); + ::glColor3f(grey, grey, grey); + const Point& p = it->point(); + ::glVertex2d(p.x(), p.y()); + } + ::glEnd(); + } + + void draw_circles() { + Sample_vector vertices, samples; + select_samples(1.0, vertices, samples); + double percentage = 500.0 / double(vertices.size()); + percentage = (std::min)(percentage, 1.0); + + samples.clear(); + vertices.clear(); + select_samples(percentage, vertices, samples); + + ::glEnable(GL_BLEND); + ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + ::glColor4f(1.0f, 1.0f, 0.2f, 0.25f); + for (Sample_vector_const_iterator it = samples.begin(); + it != samples.end(); it++) { + Sample_* sample = *it; + draw_one_circle(sample->point()); + } + ::glDisable(GL_BLEND); + } + + void draw_one_circle(const Point& center) { + unsigned int N = 10; + const double r = std::sqrt(m_pwsrec->get_norm_tol()); + const double x = center.x(); + const double y = center.y(); + ::glBegin (GL_POLYGON); + for (unsigned int i = 0; i < N; ++i) { + double angle = 2.0 * M_PI * (double(i) / double(N)); + double u = r * std::cos(angle) + x; + double v = r * std::sin(angle) + y; + ::glVertex2d(u, v); + } + ::glEnd(); + } + + // PREDEFINED EXAMPLES // + + void make_line(const unsigned int nb, const Point& start, + const Point& end) { + Point curr = start; + Vector incr = (end - start) / nb; + for (unsigned int i = 0; i < nb; i++) { + add_sample(curr); + curr = curr + incr; + } + } + + void make_circle_arc(const unsigned int nb, const Point& c, + const double radius, const double min_angle = 0.0, + const double max_angle = 360.0) { + const double range = max_angle - min_angle; + const double incr = range / double(nb); + for (double angle = min_angle; angle < max_angle; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + } + } + + void append_widely_variable_sampling(const float d1, const float d2) { + double angle; + double incr = d1; + Point c = Point(0.5, 0.5); + const double radius = 0.5; + // 0-90 deg -> d1 + for (angle = 0.0; angle < 90.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + } + // 90-180 deg -> d1 -> d2 + for (angle = 90.0; angle < 180.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + incr = d1 + (d2 - d1) / 90.0 * (angle - 90); + } + // 180-270 deg -> d2 + incr = d2; + for (angle = 180.0; angle < 270.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + } + // 270-360 deg -> d2 -> d1 + incr = d2; + for (angle = 270.0; angle < 360.0; angle += incr) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = c.x() + radius * cos(angle_rad); + double y = c.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + incr = d2 + (d1 - d2) / 90.0 * (angle - 270.0); + } + } + + void append_predefined_line(const int density) { + std::cerr << "append line..."; + Point start(0.0, 0.5); + Point end(1.0, 0.5); + make_line(density, start, end); + std::cerr << "done" << std::endl; + } + + void append_predefined_parallel_lines(const int nb_lines, const float space, + const int density) { + std::cerr << "append parallel lines..."; + FT x[4]; + x[0] = 0.0; + x[1] = 0.75; + x[2] = 1.0; + x[3] = 1.75; + FT y = 0.0; + for (int i = 0; i < nb_lines; ++i) { + int j = i % 2; + Point start(x[j], y); + Point end(x[j + 2], y); + make_line(density, start, end); + y += space; + } + std::cerr << "done" << std::endl; + } + + void append_predefined_circle(const int density, const float x, + const float y, const float radius) { + std::cerr << "append circle..."; + Point center(x, y); + make_circle_arc(density, center, radius); + std::cerr << "done" << std::endl; + } + + void append_predefined_spiral(const int nb_loops, const int density) { + std::cerr << "append spiral..."; + Point center(0.5, 0.5); + const FT max_radius = 0.5; + const FT spacing = 10. / density; // target spacing + double radius = max_radius; + const double max_angle = nb_loops * 360.0; + for (double angle = max_angle; angle > 0.0; /**/) { + double angle_rad = (angle / 360.0) * 6.2831853; + double x = center.x() + radius * cos(angle_rad); + double y = center.y() + radius * sin(angle_rad); + Point point(x, y); + add_sample(point); + + const double angle_incr = atan(spacing / radius); + angle -= angle_incr; + radius = max_radius * angle / max_angle; + } + std::cerr << "done" << std::endl; + } + + void append_predefined_half_circle(const int density) { + std::cerr << "append half circle..."; + Point center(0.5, 0.5); + make_circle_arc(density, center, 0.5, 0.0, 180.0); + std::cerr << "done" << std::endl; + } + + void append_predefined_box(const int density, const float x, const float y, + const float size_x, const float size_y) { + std::cerr << "append box..."; + Point a(x - size_x / 2, y - size_y / 2); + Point b(x + size_x / 2, y - size_y / 2); + Point c(x + size_x / 2, y + size_y / 2); + Point d(x - size_x / 2, y + size_y / 2); + make_line(density, a, b); + make_line(density, b, c); + make_line(density, c, d); + make_line(density, d, a); + std::cerr << "done" << std::endl; + } + + void append_predefined_box_with_boundaries(const int density) { + std::cerr << "append box with boundaries..."; + + Point a(0.1, 0.1); + Point b(0.4, 0.1); + Point c(0.6, 0.1); + Point d(0.9, 0.1); + Point e(0.9, 0.4); + Point f(0.9, 0.6); + Point g(0.9, 0.9); + Point h(0.6, 0.9); + Point i(0.4, 0.9); + Point j(0.1, 0.9); + Point k(0.1, 0.6); + Point l(0.1, 0.4); + + make_line(density, a, b); + make_line(density, c, d); + make_line(density, d, e); + make_line(density, f, g); + make_line(density, g, h); + make_line(density, i, j); + make_line(density, j, k); + make_line(density, l, a); + + std::cerr << "done" << std::endl; + } + + void append_predefined_box_with_missing_corners(const int density) { + std::cerr << "append box with missing corners..."; + Point a(0.12, 0.1); + Point b(0.88, 0.1); + Point c(0.9, 0.12); + Point d(0.9, 0.88); + Point e(0.88, 0.9); + Point f(0.12, 0.9); + Point g(0.1, 0.88); + Point h(0.1, 0.12); + make_line(density, a, b); + make_line(density, c, d); + make_line(density, e, f); + make_line(density, g, h); + std::cerr << "done" << std::endl; + } + + void append_predefined_boxes(const int density) { + std::cerr << "append two boxes..."; + Point a(0.0, 0.0); + Point b(0.2, 0.0); + Point c(0.2, 1.0); + Point d(0.0, 1.0); + make_line(2 * density, a, b); + make_line(10 * density, b, c); + make_line(2 * density, c, d); + make_line(10 * density, d, a); + + Point e(0.3, 0.0); + Point f(0.4, 0.0); + Point g(0.4, 0.3); + Point h(0.3, 0.3); + make_line(1 * density, e, f); + make_line(3 * density, f, g); + make_line(1 * density, g, h); + make_line(3 * density, h, e); + std::cerr << "done" << std::endl; + } + + void append_predefined_stair(const int density) { + std::cerr << "append stair..."; + Point a(0.0, 0.0); + Point b(0.1, 0.0); + Point c(0.1, 0.1); + Point d(0.2, 0.1); + Point e(0.2, 0.2); + Point f(0.3, 0.2); + Point g(0.3, 0.3); + Point h(0.4, 0.3); + Point i(0.4, 0.4); + + make_line(density, a, b); + make_line(density, b, c); + make_line(density, c, d); + make_line(density, d, e); + make_line(density, e, f); + make_line(density, f, g); + make_line(density, g, h); + make_line(density, h, i); + std::cerr << "done" << std::endl; + } + + void append_predefined_skyline(const int density) { + std::cerr << "append skyline..."; + Point a(0.0, 0.0); + Point b(0.1, 0.0); + Point c(0.1, 0.5); + Point d(0.3, 0.5); + Point e(0.3, 0.2); + Point f(0.4, 0.2); + Point g(0.4, 0.4); + Point h(0.6, 0.4); + Point i(0.6, -0.1); + Point j(0.7, -0.1); + Point k(0.7, 0.2); + Point l(0.8, 0.2); + Point m(0.8, 0.7); + Point n(0.9, 0.7); + Point o(0.9, 0.5); + Point p(1.0, 0.5); + Point q(1.0, 0.1); + Point r(1.1, 0.1); + Point s(1.1, -0.1); + Point t(1.2, -0.1); + + make_line(1 * density, a, b); + make_line(5 * density, b, c); + make_line(2 * density, c, d); + make_line(3 * density, d, e); + make_line(1 * density, e, f); + make_line(2 * density, f, g); + make_line(2 * density, g, h); + make_line(5 * density, h, i); + make_line(1 * density, i, j); + make_line(3 * density, j, k); + make_line(1 * density, k, l); + make_line(5 * density, l, m); + make_line(1 * density, m, n); + make_line(2 * density, n, o); + make_line(1 * density, o, p); + make_line(4 * density, p, q); + make_line(1 * density, q, r); + make_line(2 * density, r, s); + make_line(1 * density, s, t); + std::cerr << "done" << std::endl; + } + + void append_star(const int nb_branches, const int density) { + std::cerr << "append star..."; + const double deg_in_rad = 3.1415926535897932384626 / 180.0; + const double incr = 180.0 / nb_branches; + double angle = 0.0; + const Point center(0.5, 0.5); + for (int i = 0; i < nb_branches; i++) { + const double angle_rad = angle * deg_in_rad; + Vector v(sin(angle_rad), cos(angle_rad)); + Point a = center + v; + Point b = center - v; + make_line(density, a, b); + angle += incr; + } + std::cerr << "done" << std::endl; + } + + void append_predefined_increasingly_sharp_angles(const int density, + const double min_angle) { + const double deg_in_rad = 3.1415926535897932384626 / 180.0; + double prev_angle = 0.0; + double curr_angle = min_angle; + double incr = min_angle; + const double r1 = 0.5; + const Point center(0.5, 0.5); + while (curr_angle < 360.0) { + Vector va(r1 * cos(prev_angle * deg_in_rad), + r1 * sin(prev_angle * deg_in_rad)); + Vector vb(r1 * cos(curr_angle * deg_in_rad), + r1 * sin(curr_angle * deg_in_rad)); + const double average_angle = 0.5 * (prev_angle + curr_angle); + Vector vc(r1 * cos(average_angle * deg_in_rad), + r1 * sin(average_angle * deg_in_rad)); + Point a = center + va; + Point b = center + vb; + Point c = center + 2 * vc; + + make_line(density, a, c); + make_line(density, b, c); + + prev_angle = curr_angle; + curr_angle += incr; + incr += 2.0; + } + noise(1e-5); + } }; #endif // SCENE_H_ diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h index 3da363dd12d..688f7bd4ad8 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_options.h @@ -1,10 +1,10 @@ /******************************************************************************** -** Form generated from reading UI file 'options.ui' -** -** Created by: Qt User Interface Compiler version 4.8.6 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ + ** Form generated from reading UI file 'options.ui' + ** + ** Created by: Qt User Interface Compiler version 4.8.6 + ** + ** WARNING! All changes made in this file will be lost when recompiling UI file! + ********************************************************************************/ #ifndef UI_OPTIONS_H #define UI_OPTIONS_H @@ -29,286 +29,286 @@ QT_BEGIN_NAMESPACE class Ui_Dialog_options { public: - QDialogButtonBox *buttonBox; - QCheckBox *use_flip_checkbox; - QWidget *layoutWidget; - QVBoxLayout *vboxLayout; - QHBoxLayout *hboxLayout; - QLabel *verbose_label; - QSpinBox *verbose_spinbox; - QHBoxLayout *hboxLayout1; - QLabel *mchoice_label; - QSpinBox *mchoice_spinbox; - QHBoxLayout *hboxLayout2; - QLabel *percent_label; - QSpinBox *percent_spinbox; - QHBoxLayout *hboxLayout3; - QLabel *norm_tol_label; - QDoubleSpinBox *norm_tol_spinbox; - QHBoxLayout *hboxLayout4; - QLabel *tang_tol_label; - QDoubleSpinBox *tang_tol_spinbox; - QHBoxLayout *hboxLayout5; - QLabel *alpha_label; - QDoubleSpinBox *alpha_spinbox; - QHBoxLayout *hboxLayout6; - QLabel *relocation_label; - QSpinBox *relocation_spinbox; - QHBoxLayout *hboxLayout7; - QLabel *ghost_vs_solid_label; - QDoubleSpinBox *ghost_spinbox; - QWidget *widget; - QVBoxLayout *vboxLayout1; - QHBoxLayout *hboxLayout8; - QLabel *thickness; - QDoubleSpinBox *thickness_spinbox; - QHBoxLayout *hboxLayout9; - QLabel *point_size; - QDoubleSpinBox *point_size_spinbox; - QHBoxLayout *hboxLayout10; - QLabel *vertex_size; - QDoubleSpinBox *vertex_size_spinbox; - - void setupUi(QDialog *Dialog_options) - { - if (Dialog_options->objectName().isEmpty()) - Dialog_options->setObjectName(QString::fromUtf8("Dialog_options")); - Dialog_options->resize(409, 379); - buttonBox = new QDialogButtonBox(Dialog_options); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); - buttonBox->setGeometry(QRect(40, 330, 341, 32)); - buttonBox->setOrientation(Qt::Horizontal); - buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); - use_flip_checkbox = new QCheckBox(Dialog_options); - use_flip_checkbox->setObjectName(QString::fromUtf8("use_flip_checkbox")); - use_flip_checkbox->setGeometry(QRect(220, 20, 159, 21)); - layoutWidget = new QWidget(Dialog_options); - layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); - layoutWidget->setGeometry(QRect(20, 20, 188, 304)); - vboxLayout = new QVBoxLayout(layoutWidget); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - vboxLayout->setContentsMargins(0, 0, 0, 0); - hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - verbose_label = new QLabel(layoutWidget); - verbose_label->setObjectName(QString::fromUtf8("verbose_label")); - - hboxLayout->addWidget(verbose_label); - - verbose_spinbox = new QSpinBox(layoutWidget); - verbose_spinbox->setObjectName(QString::fromUtf8("verbose_spinbox")); - verbose_spinbox->setMaximum(2); - - hboxLayout->addWidget(verbose_spinbox); - - - vboxLayout->addLayout(hboxLayout); - - hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - mchoice_label = new QLabel(layoutWidget); - mchoice_label->setObjectName(QString::fromUtf8("mchoice_label")); - - hboxLayout1->addWidget(mchoice_label); - - mchoice_spinbox = new QSpinBox(layoutWidget); - mchoice_spinbox->setObjectName(QString::fromUtf8("mchoice_spinbox")); - mchoice_spinbox->setMaximum(100); - mchoice_spinbox->setValue(100); - - hboxLayout1->addWidget(mchoice_spinbox); - - - vboxLayout->addLayout(hboxLayout1); - - hboxLayout2 = new QHBoxLayout(); - hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); - percent_label = new QLabel(layoutWidget); - percent_label->setObjectName(QString::fromUtf8("percent_label")); - - hboxLayout2->addWidget(percent_label); - - percent_spinbox = new QSpinBox(layoutWidget); - percent_spinbox->setObjectName(QString::fromUtf8("percent_spinbox")); - percent_spinbox->setMaximum(100); - percent_spinbox->setValue(100); - - hboxLayout2->addWidget(percent_spinbox); - - - vboxLayout->addLayout(hboxLayout2); - - hboxLayout3 = new QHBoxLayout(); - hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); - norm_tol_label = new QLabel(layoutWidget); - norm_tol_label->setObjectName(QString::fromUtf8("norm_tol_label")); + QDialogButtonBox *buttonBox; + QCheckBox *use_flip_checkbox; + QWidget *layoutWidget; + QVBoxLayout *vboxLayout; + QHBoxLayout *hboxLayout; + QLabel *verbose_label; + QSpinBox *verbose_spinbox; + QHBoxLayout *hboxLayout1; + QLabel *mchoice_label; + QSpinBox *mchoice_spinbox; + QHBoxLayout *hboxLayout2; + QLabel *percent_label; + QSpinBox *percent_spinbox; + QHBoxLayout *hboxLayout3; + QLabel *norm_tol_label; + QDoubleSpinBox *norm_tol_spinbox; + QHBoxLayout *hboxLayout4; + QLabel *tang_tol_label; + QDoubleSpinBox *tang_tol_spinbox; + QHBoxLayout *hboxLayout5; + QLabel *alpha_label; + QDoubleSpinBox *alpha_spinbox; + QHBoxLayout *hboxLayout6; + QLabel *relocation_label; + QSpinBox *relocation_spinbox; + QHBoxLayout *hboxLayout7; + QLabel *ghost_vs_solid_label; + QDoubleSpinBox *ghost_spinbox; + QWidget *widget; + QVBoxLayout *vboxLayout1; + QHBoxLayout *hboxLayout8; + QLabel *thickness; + QDoubleSpinBox *thickness_spinbox; + QHBoxLayout *hboxLayout9; + QLabel *point_size; + QDoubleSpinBox *point_size_spinbox; + QHBoxLayout *hboxLayout10; + QLabel *vertex_size; + QDoubleSpinBox *vertex_size_spinbox; + + void setupUi(QDialog *Dialog_options) + { + if (Dialog_options->objectName().isEmpty()) + Dialog_options->setObjectName(QString::fromUtf8("Dialog_options")); + Dialog_options->resize(409, 379); + buttonBox = new QDialogButtonBox(Dialog_options); + buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setGeometry(QRect(40, 330, 341, 32)); + buttonBox->setOrientation(Qt::Horizontal); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); + use_flip_checkbox = new QCheckBox(Dialog_options); + use_flip_checkbox->setObjectName(QString::fromUtf8("use_flip_checkbox")); + use_flip_checkbox->setGeometry(QRect(220, 20, 159, 21)); + layoutWidget = new QWidget(Dialog_options); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(20, 20, 188, 304)); + vboxLayout = new QVBoxLayout(layoutWidget); + vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + vboxLayout->setContentsMargins(0, 0, 0, 0); + hboxLayout = new QHBoxLayout(); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + verbose_label = new QLabel(layoutWidget); + verbose_label->setObjectName(QString::fromUtf8("verbose_label")); + + hboxLayout->addWidget(verbose_label); + + verbose_spinbox = new QSpinBox(layoutWidget); + verbose_spinbox->setObjectName(QString::fromUtf8("verbose_spinbox")); + verbose_spinbox->setMaximum(2); + + hboxLayout->addWidget(verbose_spinbox); + + + vboxLayout->addLayout(hboxLayout); + + hboxLayout1 = new QHBoxLayout(); + hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + mchoice_label = new QLabel(layoutWidget); + mchoice_label->setObjectName(QString::fromUtf8("mchoice_label")); + + hboxLayout1->addWidget(mchoice_label); + + mchoice_spinbox = new QSpinBox(layoutWidget); + mchoice_spinbox->setObjectName(QString::fromUtf8("mchoice_spinbox")); + mchoice_spinbox->setMaximum(100); + mchoice_spinbox->setValue(100); + + hboxLayout1->addWidget(mchoice_spinbox); + + + vboxLayout->addLayout(hboxLayout1); + + hboxLayout2 = new QHBoxLayout(); + hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2")); + percent_label = new QLabel(layoutWidget); + percent_label->setObjectName(QString::fromUtf8("percent_label")); + + hboxLayout2->addWidget(percent_label); + + percent_spinbox = new QSpinBox(layoutWidget); + percent_spinbox->setObjectName(QString::fromUtf8("percent_spinbox")); + percent_spinbox->setMaximum(100); + percent_spinbox->setValue(100); + + hboxLayout2->addWidget(percent_spinbox); + + + vboxLayout->addLayout(hboxLayout2); + + hboxLayout3 = new QHBoxLayout(); + hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3")); + norm_tol_label = new QLabel(layoutWidget); + norm_tol_label->setObjectName(QString::fromUtf8("norm_tol_label")); - hboxLayout3->addWidget(norm_tol_label); + hboxLayout3->addWidget(norm_tol_label); - norm_tol_spinbox = new QDoubleSpinBox(layoutWidget); - norm_tol_spinbox->setObjectName(QString::fromUtf8("norm_tol_spinbox")); - norm_tol_spinbox->setDecimals(3); - norm_tol_spinbox->setMaximum(100); - norm_tol_spinbox->setSingleStep(0.05); - norm_tol_spinbox->setValue(100); + norm_tol_spinbox = new QDoubleSpinBox(layoutWidget); + norm_tol_spinbox->setObjectName(QString::fromUtf8("norm_tol_spinbox")); + norm_tol_spinbox->setDecimals(3); + norm_tol_spinbox->setMaximum(100); + norm_tol_spinbox->setSingleStep(0.05); + norm_tol_spinbox->setValue(100); - hboxLayout3->addWidget(norm_tol_spinbox); + hboxLayout3->addWidget(norm_tol_spinbox); - vboxLayout->addLayout(hboxLayout3); + vboxLayout->addLayout(hboxLayout3); - hboxLayout4 = new QHBoxLayout(); - hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); - tang_tol_label = new QLabel(layoutWidget); - tang_tol_label->setObjectName(QString::fromUtf8("tang_tol_label")); + hboxLayout4 = new QHBoxLayout(); + hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4")); + tang_tol_label = new QLabel(layoutWidget); + tang_tol_label->setObjectName(QString::fromUtf8("tang_tol_label")); - hboxLayout4->addWidget(tang_tol_label); + hboxLayout4->addWidget(tang_tol_label); - tang_tol_spinbox = new QDoubleSpinBox(layoutWidget); - tang_tol_spinbox->setObjectName(QString::fromUtf8("tang_tol_spinbox")); - tang_tol_spinbox->setDecimals(3); - tang_tol_spinbox->setMaximum(100); - tang_tol_spinbox->setSingleStep(0.05); - tang_tol_spinbox->setValue(100); + tang_tol_spinbox = new QDoubleSpinBox(layoutWidget); + tang_tol_spinbox->setObjectName(QString::fromUtf8("tang_tol_spinbox")); + tang_tol_spinbox->setDecimals(3); + tang_tol_spinbox->setMaximum(100); + tang_tol_spinbox->setSingleStep(0.05); + tang_tol_spinbox->setValue(100); - hboxLayout4->addWidget(tang_tol_spinbox); + hboxLayout4->addWidget(tang_tol_spinbox); - vboxLayout->addLayout(hboxLayout4); + vboxLayout->addLayout(hboxLayout4); - hboxLayout5 = new QHBoxLayout(); - hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); - alpha_label = new QLabel(layoutWidget); - alpha_label->setObjectName(QString::fromUtf8("alpha_label")); + hboxLayout5 = new QHBoxLayout(); + hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5")); + alpha_label = new QLabel(layoutWidget); + alpha_label->setObjectName(QString::fromUtf8("alpha_label")); - hboxLayout5->addWidget(alpha_label); + hboxLayout5->addWidget(alpha_label); - alpha_spinbox = new QDoubleSpinBox(layoutWidget); - alpha_spinbox->setObjectName(QString::fromUtf8("alpha_spinbox")); - alpha_spinbox->setDecimals(3); - alpha_spinbox->setMaximum(100); - alpha_spinbox->setSingleStep(0.05); - alpha_spinbox->setValue(100); + alpha_spinbox = new QDoubleSpinBox(layoutWidget); + alpha_spinbox->setObjectName(QString::fromUtf8("alpha_spinbox")); + alpha_spinbox->setDecimals(3); + alpha_spinbox->setMaximum(100); + alpha_spinbox->setSingleStep(0.05); + alpha_spinbox->setValue(100); - hboxLayout5->addWidget(alpha_spinbox); + hboxLayout5->addWidget(alpha_spinbox); - vboxLayout->addLayout(hboxLayout5); + vboxLayout->addLayout(hboxLayout5); - hboxLayout6 = new QHBoxLayout(); - hboxLayout6->setObjectName(QString::fromUtf8("hboxLayout6")); - relocation_label = new QLabel(layoutWidget); - relocation_label->setObjectName(QString::fromUtf8("relocation_label")); + hboxLayout6 = new QHBoxLayout(); + hboxLayout6->setObjectName(QString::fromUtf8("hboxLayout6")); + relocation_label = new QLabel(layoutWidget); + relocation_label->setObjectName(QString::fromUtf8("relocation_label")); - hboxLayout6->addWidget(relocation_label); + hboxLayout6->addWidget(relocation_label); - relocation_spinbox = new QSpinBox(layoutWidget); - relocation_spinbox->setObjectName(QString::fromUtf8("relocation_spinbox")); + relocation_spinbox = new QSpinBox(layoutWidget); + relocation_spinbox->setObjectName(QString::fromUtf8("relocation_spinbox")); - hboxLayout6->addWidget(relocation_spinbox); + hboxLayout6->addWidget(relocation_spinbox); - vboxLayout->addLayout(hboxLayout6); + vboxLayout->addLayout(hboxLayout6); - hboxLayout7 = new QHBoxLayout(); - hboxLayout7->setObjectName(QString::fromUtf8("hboxLayout7")); - ghost_vs_solid_label = new QLabel(layoutWidget); - ghost_vs_solid_label->setObjectName(QString::fromUtf8("ghost_vs_solid_label")); + hboxLayout7 = new QHBoxLayout(); + hboxLayout7->setObjectName(QString::fromUtf8("hboxLayout7")); + ghost_vs_solid_label = new QLabel(layoutWidget); + ghost_vs_solid_label->setObjectName(QString::fromUtf8("ghost_vs_solid_label")); - hboxLayout7->addWidget(ghost_vs_solid_label); + hboxLayout7->addWidget(ghost_vs_solid_label); - ghost_spinbox = new QDoubleSpinBox(layoutWidget); - ghost_spinbox->setObjectName(QString::fromUtf8("ghost_spinbox")); - ghost_spinbox->setDecimals(3); - ghost_spinbox->setMaximum(100); - ghost_spinbox->setSingleStep(0.05); - ghost_spinbox->setValue(100); + ghost_spinbox = new QDoubleSpinBox(layoutWidget); + ghost_spinbox->setObjectName(QString::fromUtf8("ghost_spinbox")); + ghost_spinbox->setDecimals(3); + ghost_spinbox->setMaximum(100); + ghost_spinbox->setSingleStep(0.05); + ghost_spinbox->setValue(100); - hboxLayout7->addWidget(ghost_spinbox); + hboxLayout7->addWidget(ghost_spinbox); - vboxLayout->addLayout(hboxLayout7); + vboxLayout->addLayout(hboxLayout7); - widget = new QWidget(Dialog_options); - widget->setObjectName(QString::fromUtf8("widget")); - widget->setGeometry(QRect(220, 210, 174, 109)); - vboxLayout1 = new QVBoxLayout(widget); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - vboxLayout1->setContentsMargins(0, 0, 0, 0); - hboxLayout8 = new QHBoxLayout(); - hboxLayout8->setObjectName(QString::fromUtf8("hboxLayout8")); - thickness = new QLabel(widget); - thickness->setObjectName(QString::fromUtf8("thickness")); + widget = new QWidget(Dialog_options); + widget->setObjectName(QString::fromUtf8("widget")); + widget->setGeometry(QRect(220, 210, 174, 109)); + vboxLayout1 = new QVBoxLayout(widget); + vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + vboxLayout1->setContentsMargins(0, 0, 0, 0); + hboxLayout8 = new QHBoxLayout(); + hboxLayout8->setObjectName(QString::fromUtf8("hboxLayout8")); + thickness = new QLabel(widget); + thickness->setObjectName(QString::fromUtf8("thickness")); - hboxLayout8->addWidget(thickness); + hboxLayout8->addWidget(thickness); - thickness_spinbox = new QDoubleSpinBox(widget); - thickness_spinbox->setObjectName(QString::fromUtf8("thickness_spinbox")); + thickness_spinbox = new QDoubleSpinBox(widget); + thickness_spinbox->setObjectName(QString::fromUtf8("thickness_spinbox")); - hboxLayout8->addWidget(thickness_spinbox); + hboxLayout8->addWidget(thickness_spinbox); - vboxLayout1->addLayout(hboxLayout8); + vboxLayout1->addLayout(hboxLayout8); - hboxLayout9 = new QHBoxLayout(); - hboxLayout9->setObjectName(QString::fromUtf8("hboxLayout9")); - point_size = new QLabel(widget); - point_size->setObjectName(QString::fromUtf8("point_size")); + hboxLayout9 = new QHBoxLayout(); + hboxLayout9->setObjectName(QString::fromUtf8("hboxLayout9")); + point_size = new QLabel(widget); + point_size->setObjectName(QString::fromUtf8("point_size")); - hboxLayout9->addWidget(point_size); + hboxLayout9->addWidget(point_size); - point_size_spinbox = new QDoubleSpinBox(widget); - point_size_spinbox->setObjectName(QString::fromUtf8("point_size_spinbox")); + point_size_spinbox = new QDoubleSpinBox(widget); + point_size_spinbox->setObjectName(QString::fromUtf8("point_size_spinbox")); - hboxLayout9->addWidget(point_size_spinbox); + hboxLayout9->addWidget(point_size_spinbox); - vboxLayout1->addLayout(hboxLayout9); + vboxLayout1->addLayout(hboxLayout9); - hboxLayout10 = new QHBoxLayout(); - hboxLayout10->setObjectName(QString::fromUtf8("hboxLayout10")); - vertex_size = new QLabel(widget); - vertex_size->setObjectName(QString::fromUtf8("vertex_size")); + hboxLayout10 = new QHBoxLayout(); + hboxLayout10->setObjectName(QString::fromUtf8("hboxLayout10")); + vertex_size = new QLabel(widget); + vertex_size->setObjectName(QString::fromUtf8("vertex_size")); - hboxLayout10->addWidget(vertex_size); + hboxLayout10->addWidget(vertex_size); - vertex_size_spinbox = new QDoubleSpinBox(widget); - vertex_size_spinbox->setObjectName(QString::fromUtf8("vertex_size_spinbox")); + vertex_size_spinbox = new QDoubleSpinBox(widget); + vertex_size_spinbox->setObjectName(QString::fromUtf8("vertex_size_spinbox")); - hboxLayout10->addWidget(vertex_size_spinbox); + hboxLayout10->addWidget(vertex_size_spinbox); - vboxLayout1->addLayout(hboxLayout10); + vboxLayout1->addLayout(hboxLayout10); - retranslateUi(Dialog_options); - QObject::connect(buttonBox, SIGNAL(accepted()), Dialog_options, SLOT(accept())); - QObject::connect(buttonBox, SIGNAL(rejected()), Dialog_options, SLOT(reject())); + retranslateUi(Dialog_options); + QObject::connect(buttonBox, SIGNAL(accepted()), Dialog_options, SLOT(accept())); + QObject::connect(buttonBox, SIGNAL(rejected()), Dialog_options, SLOT(reject())); - QMetaObject::connectSlotsByName(Dialog_options); - } // setupUi + QMetaObject::connectSlotsByName(Dialog_options); + } // setupUi - void retranslateUi(QDialog *Dialog_options) - { - Dialog_options->setWindowTitle(QApplication::translate("Dialog_options", "Options", 0, QApplication::UnicodeUTF8)); - use_flip_checkbox->setText(QApplication::translate("Dialog_options", "use flip", 0, QApplication::UnicodeUTF8)); - verbose_label->setText(QApplication::translate("Dialog_options", "Verbose", 0, QApplication::UnicodeUTF8)); - mchoice_label->setText(QApplication::translate("Dialog_options", "Multiply Choice #", 0, QApplication::UnicodeUTF8)); - percent_label->setText(QApplication::translate("Dialog_options", "Init with %", 0, QApplication::UnicodeUTF8)); - norm_tol_label->setText(QApplication::translate("Dialog_options", "Normal Tol", 0, QApplication::UnicodeUTF8)); - tang_tol_label->setText(QApplication::translate("Dialog_options", "Tangential Tol", 0, QApplication::UnicodeUTF8)); - alpha_label->setText(QApplication::translate("Dialog_options", "Alpha", 0, QApplication::UnicodeUTF8)); - relocation_label->setText(QApplication::translate("Dialog_options", "Relocation", 0, QApplication::UnicodeUTF8)); - ghost_vs_solid_label->setText(QApplication::translate("Dialog_options", "Ghost vs solid", 0, QApplication::UnicodeUTF8)); - thickness->setText(QApplication::translate("Dialog_options", "Line thickness", 0, QApplication::UnicodeUTF8)); - point_size->setText(QApplication::translate("Dialog_options", "Point size", 0, QApplication::UnicodeUTF8)); - vertex_size->setText(QApplication::translate("Dialog_options", "Vertex size", 0, QApplication::UnicodeUTF8)); - } // retranslateUi + void retranslateUi(QDialog *Dialog_options) + { + Dialog_options->setWindowTitle(QApplication::translate("Dialog_options", "Options", 0, QApplication::UnicodeUTF8)); + use_flip_checkbox->setText(QApplication::translate("Dialog_options", "use flip", 0, QApplication::UnicodeUTF8)); + verbose_label->setText(QApplication::translate("Dialog_options", "Verbose", 0, QApplication::UnicodeUTF8)); + mchoice_label->setText(QApplication::translate("Dialog_options", "Multiply Choice #", 0, QApplication::UnicodeUTF8)); + percent_label->setText(QApplication::translate("Dialog_options", "Init with %", 0, QApplication::UnicodeUTF8)); + norm_tol_label->setText(QApplication::translate("Dialog_options", "Normal Tol", 0, QApplication::UnicodeUTF8)); + tang_tol_label->setText(QApplication::translate("Dialog_options", "Tangential Tol", 0, QApplication::UnicodeUTF8)); + alpha_label->setText(QApplication::translate("Dialog_options", "Alpha", 0, QApplication::UnicodeUTF8)); + relocation_label->setText(QApplication::translate("Dialog_options", "Relocation", 0, QApplication::UnicodeUTF8)); + ghost_vs_solid_label->setText(QApplication::translate("Dialog_options", "Ghost vs solid", 0, QApplication::UnicodeUTF8)); + thickness->setText(QApplication::translate("Dialog_options", "Line thickness", 0, QApplication::UnicodeUTF8)); + point_size->setText(QApplication::translate("Dialog_options", "Point size", 0, QApplication::UnicodeUTF8)); + vertex_size->setText(QApplication::translate("Dialog_options", "Vertex size", 0, QApplication::UnicodeUTF8)); + } // retranslateUi }; namespace Ui { - class Dialog_options: public Ui_Dialog_options {}; +class Dialog_options: public Ui_Dialog_options {}; } // namespace Ui QT_END_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h index 946d1f3f0c0..7439d8487b5 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/ui_pwsrec.h @@ -1,10 +1,10 @@ /******************************************************************************** -** Form generated from reading UI file 'pwsrec.ui' -** -** Created by: Qt User Interface Compiler version 4.8.6 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ + ** Form generated from reading UI file 'pwsrec.ui' + ** + ** Created by: Qt User Interface Compiler version 4.8.6 + ** + ** WARNING! All changes made in this file will be lost when recompiling UI file! + ********************************************************************************/ #ifndef UI_PWSREC_H #define UI_PWSREC_H @@ -35,521 +35,521 @@ QT_BEGIN_NAMESPACE class Ui_MainWindow { public: - QAction *actionQuit; - QAction *actionInsertPoint; - QAction *actionClear; - QAction *actionLoadPoints; - QAction *actionSave; - QAction *actionCircle; - QAction *actionHalf_circle; - QAction *actionBox; - QAction *actionLine; - QAction *actionReconstruction_init; - QAction *actionReconstruction_one_step; - QAction *actionView_foot_points; - QAction *actionView_points; - QAction *actionView_edges; - QAction *actionRecenter; - QAction *actionView_vertices; - QAction *actionBoxes; - QAction *actionStair; - QAction *actionSkyline; - QAction *actionView_edge_priority; - QAction *actionReconstruction_10_steps; - QAction *actionReconstruction_100_steps; - QAction *actionReconstruction_1000_steps; - QAction *actionAdd_outliers; - QAction *actionSnapshot; - QAction *actionIncreasingly_sharp_angles; - QAction *actionBox_with_boundaries; - QAction *actionBox_with_missing_corners; - QAction *actionStar; - QAction *actionSpiral; - QAction *actionSet_parameters; - QAction *actionView_edge_cost; - QAction *actionReconstruction_until; - QAction *actionParallel_lines; - QAction *actionNoise; - QAction *actionActivate_simulation; - QAction *actionView_simulation; - QAction *actionRelocate_vertices; - QAction *actionView_relocation; - QAction *actionView_ghost; - QAction *actionInvert_mass; - QAction *actionView_relevance; - QAction *actionView_tolerance; - QAction *actionView_incolors; - QAction *actionClamp_mass; - QAction *actionView_bins; - QAction *actionPrint_Stats; - QAction *actionSubdivide; - QAction *actionWidely_variable_sampling; - QAction *actionDecimate; - QAction *actionKeep_one_point_out_of_n; - QAction *actionSet_MChoice; - QWidget *centralwidget; - QGridLayout *gridLayout; - QVBoxLayout *vboxLayout; - GlViewer *viewer; - QVBoxLayout *vboxLayout1; - QSlider *min_mass_slider; - QHBoxLayout *hboxLayout; - QSpacerItem *spacerItem; - QHBoxLayout *hboxLayout1; - QLabel *label; - QSpinBox *discard_spinbox; - QStatusBar *statusbar; - QMenuBar *menubar; - QMenu *menuFile; - QMenu *menuPoint_set; - QMenu *menuPredefined; - QMenu *menuAlgorithms; - QMenu *menuReconstruction; - QMenu *menuView; - QToolBar *toolBar; + QAction *actionQuit; + QAction *actionInsertPoint; + QAction *actionClear; + QAction *actionLoadPoints; + QAction *actionSave; + QAction *actionCircle; + QAction *actionHalf_circle; + QAction *actionBox; + QAction *actionLine; + QAction *actionReconstruction_init; + QAction *actionReconstruction_one_step; + QAction *actionView_foot_points; + QAction *actionView_points; + QAction *actionView_edges; + QAction *actionRecenter; + QAction *actionView_vertices; + QAction *actionBoxes; + QAction *actionStair; + QAction *actionSkyline; + QAction *actionView_edge_priority; + QAction *actionReconstruction_10_steps; + QAction *actionReconstruction_100_steps; + QAction *actionReconstruction_1000_steps; + QAction *actionAdd_outliers; + QAction *actionSnapshot; + QAction *actionIncreasingly_sharp_angles; + QAction *actionBox_with_boundaries; + QAction *actionBox_with_missing_corners; + QAction *actionStar; + QAction *actionSpiral; + QAction *actionSet_parameters; + QAction *actionView_edge_cost; + QAction *actionReconstruction_until; + QAction *actionParallel_lines; + QAction *actionNoise; + QAction *actionActivate_simulation; + QAction *actionView_simulation; + QAction *actionRelocate_vertices; + QAction *actionView_relocation; + QAction *actionView_ghost; + QAction *actionInvert_mass; + QAction *actionView_relevance; + QAction *actionView_tolerance; + QAction *actionView_incolors; + QAction *actionClamp_mass; + QAction *actionView_bins; + QAction *actionPrint_Stats; + QAction *actionSubdivide; + QAction *actionWidely_variable_sampling; + QAction *actionDecimate; + QAction *actionKeep_one_point_out_of_n; + QAction *actionSet_MChoice; + QWidget *centralwidget; + QGridLayout *gridLayout; + QVBoxLayout *vboxLayout; + GlViewer *viewer; + QVBoxLayout *vboxLayout1; + QSlider *min_mass_slider; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + QHBoxLayout *hboxLayout1; + QLabel *label; + QSpinBox *discard_spinbox; + QStatusBar *statusbar; + QMenuBar *menubar; + QMenu *menuFile; + QMenu *menuPoint_set; + QMenu *menuPredefined; + QMenu *menuAlgorithms; + QMenu *menuReconstruction; + QMenu *menuView; + QToolBar *toolBar; - void setupUi(QMainWindow *MainWindow) - { - if (MainWindow->objectName().isEmpty()) - MainWindow->setObjectName(QString::fromUtf8("MainWindow")); - MainWindow->resize(680, 680); - actionQuit = new QAction(MainWindow); - actionQuit->setObjectName(QString::fromUtf8("actionQuit")); - actionInsertPoint = new QAction(MainWindow); - actionInsertPoint->setObjectName(QString::fromUtf8("actionInsertPoint")); - actionInsertPoint->setCheckable(true); - actionInsertPoint->setChecked(false); - QIcon icon; - icon.addFile(QString::fromUtf8(":/icons/inputPoint.png"), QSize(), QIcon::Normal, QIcon::Off); - actionInsertPoint->setIcon(icon); - actionClear = new QAction(MainWindow); - actionClear->setObjectName(QString::fromUtf8("actionClear")); - QIcon icon1; - icon1.addFile(QString::fromUtf8(":/icons/fileNew.png"), QSize(), QIcon::Normal, QIcon::Off); - actionClear->setIcon(icon1); - actionLoadPoints = new QAction(MainWindow); - actionLoadPoints->setObjectName(QString::fromUtf8("actionLoadPoints")); - QIcon icon2; - icon2.addFile(QString::fromUtf8(":/icons/fileOpen.png"), QSize(), QIcon::Normal, QIcon::Off); - actionLoadPoints->setIcon(icon2); - actionSave = new QAction(MainWindow); - actionSave->setObjectName(QString::fromUtf8("actionSave")); - QIcon icon3; - icon3.addFile(QString::fromUtf8(":/icons/fileSave.png"), QSize(), QIcon::Normal, QIcon::Off); - actionSave->setIcon(icon3); - actionCircle = new QAction(MainWindow); - actionCircle->setObjectName(QString::fromUtf8("actionCircle")); - actionHalf_circle = new QAction(MainWindow); - actionHalf_circle->setObjectName(QString::fromUtf8("actionHalf_circle")); - actionBox = new QAction(MainWindow); - actionBox->setObjectName(QString::fromUtf8("actionBox")); - actionLine = new QAction(MainWindow); - actionLine->setObjectName(QString::fromUtf8("actionLine")); - actionReconstruction_init = new QAction(MainWindow); - actionReconstruction_init->setObjectName(QString::fromUtf8("actionReconstruction_init")); - actionReconstruction_one_step = new QAction(MainWindow); - actionReconstruction_one_step->setObjectName(QString::fromUtf8("actionReconstruction_one_step")); - actionView_foot_points = new QAction(MainWindow); - actionView_foot_points->setObjectName(QString::fromUtf8("actionView_foot_points")); - actionView_foot_points->setCheckable(true); - actionView_foot_points->setChecked(false); - actionView_points = new QAction(MainWindow); - actionView_points->setObjectName(QString::fromUtf8("actionView_points")); - actionView_points->setCheckable(true); - actionView_points->setChecked(true); - actionView_edges = new QAction(MainWindow); - actionView_edges->setObjectName(QString::fromUtf8("actionView_edges")); - actionView_edges->setCheckable(true); - actionView_edges->setChecked(false); - actionRecenter = new QAction(MainWindow); - actionRecenter->setObjectName(QString::fromUtf8("actionRecenter")); - QIcon icon4; - icon4.addFile(QString::fromUtf8(":/icons/fit-page-32.png"), QSize(), QIcon::Normal, QIcon::Off); - actionRecenter->setIcon(icon4); - actionView_vertices = new QAction(MainWindow); - actionView_vertices->setObjectName(QString::fromUtf8("actionView_vertices")); - actionView_vertices->setCheckable(true); - actionView_vertices->setChecked(true); - actionBoxes = new QAction(MainWindow); - actionBoxes->setObjectName(QString::fromUtf8("actionBoxes")); - actionStair = new QAction(MainWindow); - actionStair->setObjectName(QString::fromUtf8("actionStair")); - actionSkyline = new QAction(MainWindow); - actionSkyline->setObjectName(QString::fromUtf8("actionSkyline")); - actionView_edge_priority = new QAction(MainWindow); - actionView_edge_priority->setObjectName(QString::fromUtf8("actionView_edge_priority")); - actionView_edge_priority->setCheckable(true); - actionView_edge_priority->setChecked(false); - actionReconstruction_10_steps = new QAction(MainWindow); - actionReconstruction_10_steps->setObjectName(QString::fromUtf8("actionReconstruction_10_steps")); - actionReconstruction_100_steps = new QAction(MainWindow); - actionReconstruction_100_steps->setObjectName(QString::fromUtf8("actionReconstruction_100_steps")); - actionReconstruction_1000_steps = new QAction(MainWindow); - actionReconstruction_1000_steps->setObjectName(QString::fromUtf8("actionReconstruction_1000_steps")); - actionAdd_outliers = new QAction(MainWindow); - actionAdd_outliers->setObjectName(QString::fromUtf8("actionAdd_outliers")); - actionSnapshot = new QAction(MainWindow); - actionSnapshot->setObjectName(QString::fromUtf8("actionSnapshot")); - QIcon icon5; - icon5.addFile(QString::fromUtf8(":/icons/snapshot.png"), QSize(), QIcon::Normal, QIcon::Off); - actionSnapshot->setIcon(icon5); - actionIncreasingly_sharp_angles = new QAction(MainWindow); - actionIncreasingly_sharp_angles->setObjectName(QString::fromUtf8("actionIncreasingly_sharp_angles")); - actionBox_with_boundaries = new QAction(MainWindow); - actionBox_with_boundaries->setObjectName(QString::fromUtf8("actionBox_with_boundaries")); - actionBox_with_missing_corners = new QAction(MainWindow); - actionBox_with_missing_corners->setObjectName(QString::fromUtf8("actionBox_with_missing_corners")); - actionStar = new QAction(MainWindow); - actionStar->setObjectName(QString::fromUtf8("actionStar")); - actionSpiral = new QAction(MainWindow); - actionSpiral->setObjectName(QString::fromUtf8("actionSpiral")); - actionSet_parameters = new QAction(MainWindow); - actionSet_parameters->setObjectName(QString::fromUtf8("actionSet_parameters")); - actionView_edge_cost = new QAction(MainWindow); - actionView_edge_cost->setObjectName(QString::fromUtf8("actionView_edge_cost")); - actionView_edge_cost->setCheckable(true); - actionView_edge_cost->setChecked(false); - actionReconstruction_until = new QAction(MainWindow); - actionReconstruction_until->setObjectName(QString::fromUtf8("actionReconstruction_until")); - actionParallel_lines = new QAction(MainWindow); - actionParallel_lines->setObjectName(QString::fromUtf8("actionParallel_lines")); - actionNoise = new QAction(MainWindow); - actionNoise->setObjectName(QString::fromUtf8("actionNoise")); - actionActivate_simulation = new QAction(MainWindow); - actionActivate_simulation->setObjectName(QString::fromUtf8("actionActivate_simulation")); - actionActivate_simulation->setCheckable(true); - QIcon icon6; - icon6.addFile(QString::fromUtf8(":/icons/vertex.png"), QSize(), QIcon::Normal, QIcon::Off); - actionActivate_simulation->setIcon(icon6); - actionView_simulation = new QAction(MainWindow); - actionView_simulation->setObjectName(QString::fromUtf8("actionView_simulation")); - actionRelocate_vertices = new QAction(MainWindow); - actionRelocate_vertices->setObjectName(QString::fromUtf8("actionRelocate_vertices")); - actionView_relocation = new QAction(MainWindow); - actionView_relocation->setObjectName(QString::fromUtf8("actionView_relocation")); - actionView_relocation->setCheckable(true); - actionView_ghost = new QAction(MainWindow); - actionView_ghost->setObjectName(QString::fromUtf8("actionView_ghost")); - actionView_ghost->setCheckable(true); - actionView_ghost->setChecked(false); - actionInvert_mass = new QAction(MainWindow); - actionInvert_mass->setObjectName(QString::fromUtf8("actionInvert_mass")); - actionView_relevance = new QAction(MainWindow); - actionView_relevance->setObjectName(QString::fromUtf8("actionView_relevance")); - actionView_relevance->setCheckable(true); - actionView_relevance->setChecked(true); - actionView_tolerance = new QAction(MainWindow); - actionView_tolerance->setObjectName(QString::fromUtf8("actionView_tolerance")); - actionView_tolerance->setCheckable(true); - actionView_incolors = new QAction(MainWindow); - actionView_incolors->setObjectName(QString::fromUtf8("actionView_incolors")); - actionView_incolors->setCheckable(true); - actionView_incolors->setChecked(false); - actionClamp_mass = new QAction(MainWindow); - actionClamp_mass->setObjectName(QString::fromUtf8("actionClamp_mass")); - actionView_bins = new QAction(MainWindow); - actionView_bins->setObjectName(QString::fromUtf8("actionView_bins")); - actionView_bins->setCheckable(true); - actionPrint_Stats = new QAction(MainWindow); - actionPrint_Stats->setObjectName(QString::fromUtf8("actionPrint_Stats")); - actionSubdivide = new QAction(MainWindow); - actionSubdivide->setObjectName(QString::fromUtf8("actionSubdivide")); - actionWidely_variable_sampling = new QAction(MainWindow); - actionWidely_variable_sampling->setObjectName(QString::fromUtf8("actionWidely_variable_sampling")); - actionDecimate = new QAction(MainWindow); - actionDecimate->setObjectName(QString::fromUtf8("actionDecimate")); - actionKeep_one_point_out_of_n = new QAction(MainWindow); - actionKeep_one_point_out_of_n->setObjectName(QString::fromUtf8("actionKeep_one_point_out_of_n")); - actionSet_MChoice = new QAction(MainWindow); - actionSet_MChoice->setObjectName(QString::fromUtf8("actionSet_MChoice")); - actionSet_MChoice->setCheckable(true); - centralwidget = new QWidget(MainWindow); - centralwidget->setObjectName(QString::fromUtf8("centralwidget")); - gridLayout = new QGridLayout(centralwidget); - gridLayout->setObjectName(QString::fromUtf8("gridLayout")); - vboxLayout = new QVBoxLayout(); - vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); - viewer = new GlViewer(centralwidget); - viewer->setObjectName(QString::fromUtf8("viewer")); - viewer->setFocusPolicy(Qt::StrongFocus); - viewer->setLocale(QLocale(QLocale::English, QLocale::UnitedStates)); + void setupUi(QMainWindow *MainWindow) + { + if (MainWindow->objectName().isEmpty()) + MainWindow->setObjectName(QString::fromUtf8("MainWindow")); + MainWindow->resize(680, 680); + actionQuit = new QAction(MainWindow); + actionQuit->setObjectName(QString::fromUtf8("actionQuit")); + actionInsertPoint = new QAction(MainWindow); + actionInsertPoint->setObjectName(QString::fromUtf8("actionInsertPoint")); + actionInsertPoint->setCheckable(true); + actionInsertPoint->setChecked(false); + QIcon icon; + icon.addFile(QString::fromUtf8(":/icons/inputPoint.png"), QSize(), QIcon::Normal, QIcon::Off); + actionInsertPoint->setIcon(icon); + actionClear = new QAction(MainWindow); + actionClear->setObjectName(QString::fromUtf8("actionClear")); + QIcon icon1; + icon1.addFile(QString::fromUtf8(":/icons/fileNew.png"), QSize(), QIcon::Normal, QIcon::Off); + actionClear->setIcon(icon1); + actionLoadPoints = new QAction(MainWindow); + actionLoadPoints->setObjectName(QString::fromUtf8("actionLoadPoints")); + QIcon icon2; + icon2.addFile(QString::fromUtf8(":/icons/fileOpen.png"), QSize(), QIcon::Normal, QIcon::Off); + actionLoadPoints->setIcon(icon2); + actionSave = new QAction(MainWindow); + actionSave->setObjectName(QString::fromUtf8("actionSave")); + QIcon icon3; + icon3.addFile(QString::fromUtf8(":/icons/fileSave.png"), QSize(), QIcon::Normal, QIcon::Off); + actionSave->setIcon(icon3); + actionCircle = new QAction(MainWindow); + actionCircle->setObjectName(QString::fromUtf8("actionCircle")); + actionHalf_circle = new QAction(MainWindow); + actionHalf_circle->setObjectName(QString::fromUtf8("actionHalf_circle")); + actionBox = new QAction(MainWindow); + actionBox->setObjectName(QString::fromUtf8("actionBox")); + actionLine = new QAction(MainWindow); + actionLine->setObjectName(QString::fromUtf8("actionLine")); + actionReconstruction_init = new QAction(MainWindow); + actionReconstruction_init->setObjectName(QString::fromUtf8("actionReconstruction_init")); + actionReconstruction_one_step = new QAction(MainWindow); + actionReconstruction_one_step->setObjectName(QString::fromUtf8("actionReconstruction_one_step")); + actionView_foot_points = new QAction(MainWindow); + actionView_foot_points->setObjectName(QString::fromUtf8("actionView_foot_points")); + actionView_foot_points->setCheckable(true); + actionView_foot_points->setChecked(false); + actionView_points = new QAction(MainWindow); + actionView_points->setObjectName(QString::fromUtf8("actionView_points")); + actionView_points->setCheckable(true); + actionView_points->setChecked(true); + actionView_edges = new QAction(MainWindow); + actionView_edges->setObjectName(QString::fromUtf8("actionView_edges")); + actionView_edges->setCheckable(true); + actionView_edges->setChecked(false); + actionRecenter = new QAction(MainWindow); + actionRecenter->setObjectName(QString::fromUtf8("actionRecenter")); + QIcon icon4; + icon4.addFile(QString::fromUtf8(":/icons/fit-page-32.png"), QSize(), QIcon::Normal, QIcon::Off); + actionRecenter->setIcon(icon4); + actionView_vertices = new QAction(MainWindow); + actionView_vertices->setObjectName(QString::fromUtf8("actionView_vertices")); + actionView_vertices->setCheckable(true); + actionView_vertices->setChecked(true); + actionBoxes = new QAction(MainWindow); + actionBoxes->setObjectName(QString::fromUtf8("actionBoxes")); + actionStair = new QAction(MainWindow); + actionStair->setObjectName(QString::fromUtf8("actionStair")); + actionSkyline = new QAction(MainWindow); + actionSkyline->setObjectName(QString::fromUtf8("actionSkyline")); + actionView_edge_priority = new QAction(MainWindow); + actionView_edge_priority->setObjectName(QString::fromUtf8("actionView_edge_priority")); + actionView_edge_priority->setCheckable(true); + actionView_edge_priority->setChecked(false); + actionReconstruction_10_steps = new QAction(MainWindow); + actionReconstruction_10_steps->setObjectName(QString::fromUtf8("actionReconstruction_10_steps")); + actionReconstruction_100_steps = new QAction(MainWindow); + actionReconstruction_100_steps->setObjectName(QString::fromUtf8("actionReconstruction_100_steps")); + actionReconstruction_1000_steps = new QAction(MainWindow); + actionReconstruction_1000_steps->setObjectName(QString::fromUtf8("actionReconstruction_1000_steps")); + actionAdd_outliers = new QAction(MainWindow); + actionAdd_outliers->setObjectName(QString::fromUtf8("actionAdd_outliers")); + actionSnapshot = new QAction(MainWindow); + actionSnapshot->setObjectName(QString::fromUtf8("actionSnapshot")); + QIcon icon5; + icon5.addFile(QString::fromUtf8(":/icons/snapshot.png"), QSize(), QIcon::Normal, QIcon::Off); + actionSnapshot->setIcon(icon5); + actionIncreasingly_sharp_angles = new QAction(MainWindow); + actionIncreasingly_sharp_angles->setObjectName(QString::fromUtf8("actionIncreasingly_sharp_angles")); + actionBox_with_boundaries = new QAction(MainWindow); + actionBox_with_boundaries->setObjectName(QString::fromUtf8("actionBox_with_boundaries")); + actionBox_with_missing_corners = new QAction(MainWindow); + actionBox_with_missing_corners->setObjectName(QString::fromUtf8("actionBox_with_missing_corners")); + actionStar = new QAction(MainWindow); + actionStar->setObjectName(QString::fromUtf8("actionStar")); + actionSpiral = new QAction(MainWindow); + actionSpiral->setObjectName(QString::fromUtf8("actionSpiral")); + actionSet_parameters = new QAction(MainWindow); + actionSet_parameters->setObjectName(QString::fromUtf8("actionSet_parameters")); + actionView_edge_cost = new QAction(MainWindow); + actionView_edge_cost->setObjectName(QString::fromUtf8("actionView_edge_cost")); + actionView_edge_cost->setCheckable(true); + actionView_edge_cost->setChecked(false); + actionReconstruction_until = new QAction(MainWindow); + actionReconstruction_until->setObjectName(QString::fromUtf8("actionReconstruction_until")); + actionParallel_lines = new QAction(MainWindow); + actionParallel_lines->setObjectName(QString::fromUtf8("actionParallel_lines")); + actionNoise = new QAction(MainWindow); + actionNoise->setObjectName(QString::fromUtf8("actionNoise")); + actionActivate_simulation = new QAction(MainWindow); + actionActivate_simulation->setObjectName(QString::fromUtf8("actionActivate_simulation")); + actionActivate_simulation->setCheckable(true); + QIcon icon6; + icon6.addFile(QString::fromUtf8(":/icons/vertex.png"), QSize(), QIcon::Normal, QIcon::Off); + actionActivate_simulation->setIcon(icon6); + actionView_simulation = new QAction(MainWindow); + actionView_simulation->setObjectName(QString::fromUtf8("actionView_simulation")); + actionRelocate_vertices = new QAction(MainWindow); + actionRelocate_vertices->setObjectName(QString::fromUtf8("actionRelocate_vertices")); + actionView_relocation = new QAction(MainWindow); + actionView_relocation->setObjectName(QString::fromUtf8("actionView_relocation")); + actionView_relocation->setCheckable(true); + actionView_ghost = new QAction(MainWindow); + actionView_ghost->setObjectName(QString::fromUtf8("actionView_ghost")); + actionView_ghost->setCheckable(true); + actionView_ghost->setChecked(false); + actionInvert_mass = new QAction(MainWindow); + actionInvert_mass->setObjectName(QString::fromUtf8("actionInvert_mass")); + actionView_relevance = new QAction(MainWindow); + actionView_relevance->setObjectName(QString::fromUtf8("actionView_relevance")); + actionView_relevance->setCheckable(true); + actionView_relevance->setChecked(true); + actionView_tolerance = new QAction(MainWindow); + actionView_tolerance->setObjectName(QString::fromUtf8("actionView_tolerance")); + actionView_tolerance->setCheckable(true); + actionView_incolors = new QAction(MainWindow); + actionView_incolors->setObjectName(QString::fromUtf8("actionView_incolors")); + actionView_incolors->setCheckable(true); + actionView_incolors->setChecked(false); + actionClamp_mass = new QAction(MainWindow); + actionClamp_mass->setObjectName(QString::fromUtf8("actionClamp_mass")); + actionView_bins = new QAction(MainWindow); + actionView_bins->setObjectName(QString::fromUtf8("actionView_bins")); + actionView_bins->setCheckable(true); + actionPrint_Stats = new QAction(MainWindow); + actionPrint_Stats->setObjectName(QString::fromUtf8("actionPrint_Stats")); + actionSubdivide = new QAction(MainWindow); + actionSubdivide->setObjectName(QString::fromUtf8("actionSubdivide")); + actionWidely_variable_sampling = new QAction(MainWindow); + actionWidely_variable_sampling->setObjectName(QString::fromUtf8("actionWidely_variable_sampling")); + actionDecimate = new QAction(MainWindow); + actionDecimate->setObjectName(QString::fromUtf8("actionDecimate")); + actionKeep_one_point_out_of_n = new QAction(MainWindow); + actionKeep_one_point_out_of_n->setObjectName(QString::fromUtf8("actionKeep_one_point_out_of_n")); + actionSet_MChoice = new QAction(MainWindow); + actionSet_MChoice->setObjectName(QString::fromUtf8("actionSet_MChoice")); + actionSet_MChoice->setCheckable(true); + centralwidget = new QWidget(MainWindow); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + gridLayout = new QGridLayout(centralwidget); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + vboxLayout = new QVBoxLayout(); + vboxLayout->setObjectName(QString::fromUtf8("vboxLayout")); + viewer = new GlViewer(centralwidget); + viewer->setObjectName(QString::fromUtf8("viewer")); + viewer->setFocusPolicy(Qt::StrongFocus); + viewer->setLocale(QLocale(QLocale::English, QLocale::UnitedStates)); - vboxLayout->addWidget(viewer); + vboxLayout->addWidget(viewer); - vboxLayout1 = new QVBoxLayout(); - vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); - min_mass_slider = new QSlider(centralwidget); - min_mass_slider->setObjectName(QString::fromUtf8("min_mass_slider")); - min_mass_slider->setOrientation(Qt::Horizontal); + vboxLayout1 = new QVBoxLayout(); + vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1")); + min_mass_slider = new QSlider(centralwidget); + min_mass_slider->setObjectName(QString::fromUtf8("min_mass_slider")); + min_mass_slider->setOrientation(Qt::Horizontal); - vboxLayout1->addWidget(min_mass_slider); + vboxLayout1->addWidget(min_mass_slider); - hboxLayout = new QHBoxLayout(); - hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); - spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + hboxLayout = new QHBoxLayout(); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - hboxLayout->addItem(spacerItem); + hboxLayout->addItem(spacerItem); - hboxLayout1 = new QHBoxLayout(); - hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); - label = new QLabel(centralwidget); - label->setObjectName(QString::fromUtf8("label")); + hboxLayout1 = new QHBoxLayout(); + hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); + label = new QLabel(centralwidget); + label->setObjectName(QString::fromUtf8("label")); - hboxLayout1->addWidget(label); + hboxLayout1->addWidget(label); - discard_spinbox = new QSpinBox(centralwidget); - discard_spinbox->setObjectName(QString::fromUtf8("discard_spinbox")); - discard_spinbox->setMaximum(10000); + discard_spinbox = new QSpinBox(centralwidget); + discard_spinbox->setObjectName(QString::fromUtf8("discard_spinbox")); + discard_spinbox->setMaximum(10000); - hboxLayout1->addWidget(discard_spinbox); + hboxLayout1->addWidget(discard_spinbox); - hboxLayout->addLayout(hboxLayout1); + hboxLayout->addLayout(hboxLayout1); - vboxLayout1->addLayout(hboxLayout); + vboxLayout1->addLayout(hboxLayout); - vboxLayout->addLayout(vboxLayout1); + vboxLayout->addLayout(vboxLayout1); - gridLayout->addLayout(vboxLayout, 0, 0, 1, 1); + gridLayout->addLayout(vboxLayout, 0, 0, 1, 1); - MainWindow->setCentralWidget(centralwidget); - statusbar = new QStatusBar(MainWindow); - statusbar->setObjectName(QString::fromUtf8("statusbar")); - MainWindow->setStatusBar(statusbar); - menubar = new QMenuBar(MainWindow); - menubar->setObjectName(QString::fromUtf8("menubar")); - menubar->setGeometry(QRect(0, 0, 680, 22)); - menuFile = new QMenu(menubar); - menuFile->setObjectName(QString::fromUtf8("menuFile")); - menuPoint_set = new QMenu(menubar); - menuPoint_set->setObjectName(QString::fromUtf8("menuPoint_set")); - menuPredefined = new QMenu(menuPoint_set); - menuPredefined->setObjectName(QString::fromUtf8("menuPredefined")); - menuAlgorithms = new QMenu(menubar); - menuAlgorithms->setObjectName(QString::fromUtf8("menuAlgorithms")); - menuReconstruction = new QMenu(menuAlgorithms); - menuReconstruction->setObjectName(QString::fromUtf8("menuReconstruction")); - menuView = new QMenu(menubar); - menuView->setObjectName(QString::fromUtf8("menuView")); - MainWindow->setMenuBar(menubar); - toolBar = new QToolBar(MainWindow); - toolBar->setObjectName(QString::fromUtf8("toolBar")); - toolBar->setLocale(QLocale(QLocale::English, QLocale::UnitedStates)); - MainWindow->addToolBar(Qt::TopToolBarArea, toolBar); - QWidget::setTabOrder(min_mass_slider, discard_spinbox); + MainWindow->setCentralWidget(centralwidget); + statusbar = new QStatusBar(MainWindow); + statusbar->setObjectName(QString::fromUtf8("statusbar")); + MainWindow->setStatusBar(statusbar); + menubar = new QMenuBar(MainWindow); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 680, 22)); + menuFile = new QMenu(menubar); + menuFile->setObjectName(QString::fromUtf8("menuFile")); + menuPoint_set = new QMenu(menubar); + menuPoint_set->setObjectName(QString::fromUtf8("menuPoint_set")); + menuPredefined = new QMenu(menuPoint_set); + menuPredefined->setObjectName(QString::fromUtf8("menuPredefined")); + menuAlgorithms = new QMenu(menubar); + menuAlgorithms->setObjectName(QString::fromUtf8("menuAlgorithms")); + menuReconstruction = new QMenu(menuAlgorithms); + menuReconstruction->setObjectName(QString::fromUtf8("menuReconstruction")); + menuView = new QMenu(menubar); + menuView->setObjectName(QString::fromUtf8("menuView")); + MainWindow->setMenuBar(menubar); + toolBar = new QToolBar(MainWindow); + toolBar->setObjectName(QString::fromUtf8("toolBar")); + toolBar->setLocale(QLocale(QLocale::English, QLocale::UnitedStates)); + MainWindow->addToolBar(Qt::TopToolBarArea, toolBar); + QWidget::setTabOrder(min_mass_slider, discard_spinbox); - menubar->addAction(menuFile->menuAction()); - menubar->addAction(menuPoint_set->menuAction()); - menubar->addAction(menuAlgorithms->menuAction()); - menubar->addAction(menuView->menuAction()); - menuFile->addAction(actionLoadPoints); - menuFile->addAction(actionSave); - menuFile->addAction(actionSnapshot); - menuFile->addAction(actionQuit); - menuPoint_set->addAction(menuPredefined->menuAction()); - menuPoint_set->addAction(actionNoise); - menuPoint_set->addAction(actionAdd_outliers); - menuPoint_set->addSeparator(); - menuPoint_set->addAction(actionDecimate); - menuPoint_set->addAction(actionKeep_one_point_out_of_n); - menuPoint_set->addAction(actionSubdivide); - menuPoint_set->addSeparator(); - menuPoint_set->addAction(actionInvert_mass); - menuPoint_set->addAction(actionClamp_mass); - menuPoint_set->addSeparator(); - menuPoint_set->addAction(actionInsertPoint); - menuPoint_set->addSeparator(); - menuPoint_set->addAction(actionClear); - menuPredefined->addAction(actionLine); - menuPredefined->addAction(actionParallel_lines); - menuPredefined->addAction(actionCircle); - menuPredefined->addAction(actionHalf_circle); - menuPredefined->addAction(actionWidely_variable_sampling); - menuPredefined->addAction(actionSpiral); - menuPredefined->addAction(actionBox); - menuPredefined->addAction(actionBoxes); - menuPredefined->addAction(actionBox_with_boundaries); - menuPredefined->addAction(actionBox_with_missing_corners); - menuPredefined->addAction(actionStar); - menuPredefined->addAction(actionStair); - menuPredefined->addAction(actionSkyline); - menuPredefined->addAction(actionIncreasingly_sharp_angles); - menuAlgorithms->addAction(actionSet_parameters); - menuAlgorithms->addAction(actionSet_MChoice); - menuAlgorithms->addSeparator(); - menuAlgorithms->addAction(actionReconstruction_init); - menuAlgorithms->addAction(menuReconstruction->menuAction()); - menuAlgorithms->addAction(actionRelocate_vertices); - menuAlgorithms->addSeparator(); - menuAlgorithms->addAction(actionPrint_Stats); - menuReconstruction->addAction(actionReconstruction_one_step); - menuReconstruction->addAction(actionReconstruction_10_steps); - menuReconstruction->addAction(actionReconstruction_100_steps); - menuReconstruction->addAction(actionReconstruction_1000_steps); - menuReconstruction->addAction(actionReconstruction_until); - menuView->addAction(actionView_points); - menuView->addSeparator(); - menuView->addAction(actionView_vertices); - menuView->addAction(actionView_edges); - menuView->addSeparator(); - menuView->addAction(actionView_ghost); - menuView->addAction(actionView_relevance); - menuView->addAction(actionView_incolors); - menuView->addSeparator(); - menuView->addAction(actionView_edge_cost); - menuView->addAction(actionView_edge_priority); - menuView->addSeparator(); - menuView->addAction(actionView_bins); - menuView->addAction(actionView_foot_points); - menuView->addAction(actionView_relocation); - menuView->addAction(actionView_tolerance); - menuView->addSeparator(); - menuView->addAction(actionActivate_simulation); - menuView->addAction(actionView_simulation); - menuView->addSeparator(); - menuView->addAction(actionRecenter); - toolBar->addAction(actionClear); - toolBar->addAction(actionLoadPoints); - toolBar->addAction(actionSave); - toolBar->addAction(actionSnapshot); - toolBar->addSeparator(); - toolBar->addAction(actionInsertPoint); - toolBar->addAction(actionActivate_simulation); - toolBar->addSeparator(); - toolBar->addAction(actionRecenter); + menubar->addAction(menuFile->menuAction()); + menubar->addAction(menuPoint_set->menuAction()); + menubar->addAction(menuAlgorithms->menuAction()); + menubar->addAction(menuView->menuAction()); + menuFile->addAction(actionLoadPoints); + menuFile->addAction(actionSave); + menuFile->addAction(actionSnapshot); + menuFile->addAction(actionQuit); + menuPoint_set->addAction(menuPredefined->menuAction()); + menuPoint_set->addAction(actionNoise); + menuPoint_set->addAction(actionAdd_outliers); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionDecimate); + menuPoint_set->addAction(actionKeep_one_point_out_of_n); + menuPoint_set->addAction(actionSubdivide); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionInvert_mass); + menuPoint_set->addAction(actionClamp_mass); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionInsertPoint); + menuPoint_set->addSeparator(); + menuPoint_set->addAction(actionClear); + menuPredefined->addAction(actionLine); + menuPredefined->addAction(actionParallel_lines); + menuPredefined->addAction(actionCircle); + menuPredefined->addAction(actionHalf_circle); + menuPredefined->addAction(actionWidely_variable_sampling); + menuPredefined->addAction(actionSpiral); + menuPredefined->addAction(actionBox); + menuPredefined->addAction(actionBoxes); + menuPredefined->addAction(actionBox_with_boundaries); + menuPredefined->addAction(actionBox_with_missing_corners); + menuPredefined->addAction(actionStar); + menuPredefined->addAction(actionStair); + menuPredefined->addAction(actionSkyline); + menuPredefined->addAction(actionIncreasingly_sharp_angles); + menuAlgorithms->addAction(actionSet_parameters); + menuAlgorithms->addAction(actionSet_MChoice); + menuAlgorithms->addSeparator(); + menuAlgorithms->addAction(actionReconstruction_init); + menuAlgorithms->addAction(menuReconstruction->menuAction()); + menuAlgorithms->addAction(actionRelocate_vertices); + menuAlgorithms->addSeparator(); + menuAlgorithms->addAction(actionPrint_Stats); + menuReconstruction->addAction(actionReconstruction_one_step); + menuReconstruction->addAction(actionReconstruction_10_steps); + menuReconstruction->addAction(actionReconstruction_100_steps); + menuReconstruction->addAction(actionReconstruction_1000_steps); + menuReconstruction->addAction(actionReconstruction_until); + menuView->addAction(actionView_points); + menuView->addSeparator(); + menuView->addAction(actionView_vertices); + menuView->addAction(actionView_edges); + menuView->addSeparator(); + menuView->addAction(actionView_ghost); + menuView->addAction(actionView_relevance); + menuView->addAction(actionView_incolors); + menuView->addSeparator(); + menuView->addAction(actionView_edge_cost); + menuView->addAction(actionView_edge_priority); + menuView->addSeparator(); + menuView->addAction(actionView_bins); + menuView->addAction(actionView_foot_points); + menuView->addAction(actionView_relocation); + menuView->addAction(actionView_tolerance); + menuView->addSeparator(); + menuView->addAction(actionActivate_simulation); + menuView->addAction(actionView_simulation); + menuView->addSeparator(); + menuView->addAction(actionRecenter); + toolBar->addAction(actionClear); + toolBar->addAction(actionLoadPoints); + toolBar->addAction(actionSave); + toolBar->addAction(actionSnapshot); + toolBar->addSeparator(); + toolBar->addAction(actionInsertPoint); + toolBar->addAction(actionActivate_simulation); + toolBar->addSeparator(); + toolBar->addAction(actionRecenter); - retranslateUi(MainWindow); + retranslateUi(MainWindow); - QMetaObject::connectSlotsByName(MainWindow); - } // setupUi + QMetaObject::connectSlotsByName(MainWindow); + } // setupUi - void retranslateUi(QMainWindow *MainWindow) - { - MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Reconstruction_simplification_2 Demo", 0, QApplication::UnicodeUTF8)); - actionQuit->setText(QApplication::translate("MainWindow", "Quit", 0, QApplication::UnicodeUTF8)); - actionQuit->setShortcut(QApplication::translate("MainWindow", "Ctrl+Q", 0, QApplication::UnicodeUTF8)); - actionInsertPoint->setText(QApplication::translate("MainWindow", "Insert mode", 0, QApplication::UnicodeUTF8)); + void retranslateUi(QMainWindow *MainWindow) + { + MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Reconstruction_simplification_2 Demo", 0, QApplication::UnicodeUTF8)); + actionQuit->setText(QApplication::translate("MainWindow", "Quit", 0, QApplication::UnicodeUTF8)); + actionQuit->setShortcut(QApplication::translate("MainWindow", "Ctrl+Q", 0, QApplication::UnicodeUTF8)); + actionInsertPoint->setText(QApplication::translate("MainWindow", "Insert mode", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_TOOLTIP - actionInsertPoint->setToolTip(QApplication::translate("MainWindow", "Insert Point", 0, QApplication::UnicodeUTF8)); + actionInsertPoint->setToolTip(QApplication::translate("MainWindow", "Insert Point", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_TOOLTIP #ifndef QT_NO_STATUSTIP - actionInsertPoint->setStatusTip(QApplication::translate("MainWindow", "Insert Point", 0, QApplication::UnicodeUTF8)); + actionInsertPoint->setStatusTip(QApplication::translate("MainWindow", "Insert Point", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionClear->setText(QApplication::translate("MainWindow", "Clear", 0, QApplication::UnicodeUTF8)); + actionClear->setText(QApplication::translate("MainWindow", "Clear", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP - actionClear->setStatusTip(QApplication::translate("MainWindow", "Clear", 0, QApplication::UnicodeUTF8)); + actionClear->setStatusTip(QApplication::translate("MainWindow", "Clear", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionClear->setShortcut(QApplication::translate("MainWindow", "Space", 0, QApplication::UnicodeUTF8)); - actionLoadPoints->setText(QApplication::translate("MainWindow", "Load Points", 0, QApplication::UnicodeUTF8)); + actionClear->setShortcut(QApplication::translate("MainWindow", "Space", 0, QApplication::UnicodeUTF8)); + actionLoadPoints->setText(QApplication::translate("MainWindow", "Load Points", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP - actionLoadPoints->setStatusTip(QApplication::translate("MainWindow", "Load Points", 0, QApplication::UnicodeUTF8)); + actionLoadPoints->setStatusTip(QApplication::translate("MainWindow", "Load Points", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionLoadPoints->setShortcut(QApplication::translate("MainWindow", "Ctrl+O", 0, QApplication::UnicodeUTF8)); - actionSave->setText(QApplication::translate("MainWindow", "Save", 0, QApplication::UnicodeUTF8)); + actionLoadPoints->setShortcut(QApplication::translate("MainWindow", "Ctrl+O", 0, QApplication::UnicodeUTF8)); + actionSave->setText(QApplication::translate("MainWindow", "Save", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP - actionSave->setStatusTip(QApplication::translate("MainWindow", "Save Points", 0, QApplication::UnicodeUTF8)); + actionSave->setStatusTip(QApplication::translate("MainWindow", "Save Points", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionSave->setShortcut(QApplication::translate("MainWindow", "Ctrl+S", 0, QApplication::UnicodeUTF8)); - actionCircle->setText(QApplication::translate("MainWindow", "Circle...", 0, QApplication::UnicodeUTF8)); - actionHalf_circle->setText(QApplication::translate("MainWindow", "Half circle...", 0, QApplication::UnicodeUTF8)); - actionBox->setText(QApplication::translate("MainWindow", "Box...", 0, QApplication::UnicodeUTF8)); - actionBox->setShortcut(QApplication::translate("MainWindow", "B", 0, QApplication::UnicodeUTF8)); - actionLine->setText(QApplication::translate("MainWindow", "Line...", 0, QApplication::UnicodeUTF8)); - actionReconstruction_init->setText(QApplication::translate("MainWindow", "Init", 0, QApplication::UnicodeUTF8)); - actionReconstruction_init->setShortcut(QApplication::translate("MainWindow", "I", 0, QApplication::UnicodeUTF8)); - actionReconstruction_one_step->setText(QApplication::translate("MainWindow", "1 step", 0, QApplication::UnicodeUTF8)); - actionReconstruction_one_step->setShortcut(QApplication::translate("MainWindow", "R", 0, QApplication::UnicodeUTF8)); - actionView_foot_points->setText(QApplication::translate("MainWindow", "Foot points", 0, QApplication::UnicodeUTF8)); + actionSave->setShortcut(QApplication::translate("MainWindow", "Ctrl+S", 0, QApplication::UnicodeUTF8)); + actionCircle->setText(QApplication::translate("MainWindow", "Circle...", 0, QApplication::UnicodeUTF8)); + actionHalf_circle->setText(QApplication::translate("MainWindow", "Half circle...", 0, QApplication::UnicodeUTF8)); + actionBox->setText(QApplication::translate("MainWindow", "Box...", 0, QApplication::UnicodeUTF8)); + actionBox->setShortcut(QApplication::translate("MainWindow", "B", 0, QApplication::UnicodeUTF8)); + actionLine->setText(QApplication::translate("MainWindow", "Line...", 0, QApplication::UnicodeUTF8)); + actionReconstruction_init->setText(QApplication::translate("MainWindow", "Init", 0, QApplication::UnicodeUTF8)); + actionReconstruction_init->setShortcut(QApplication::translate("MainWindow", "I", 0, QApplication::UnicodeUTF8)); + actionReconstruction_one_step->setText(QApplication::translate("MainWindow", "1 step", 0, QApplication::UnicodeUTF8)); + actionReconstruction_one_step->setShortcut(QApplication::translate("MainWindow", "R", 0, QApplication::UnicodeUTF8)); + actionView_foot_points->setText(QApplication::translate("MainWindow", "Foot points", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP - actionView_foot_points->setStatusTip(QApplication::translate("MainWindow", "View foot points", 0, QApplication::UnicodeUTF8)); + actionView_foot_points->setStatusTip(QApplication::translate("MainWindow", "View foot points", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionView_foot_points->setShortcut(QApplication::translate("MainWindow", "T", 0, QApplication::UnicodeUTF8)); - actionView_points->setText(QApplication::translate("MainWindow", "Points", 0, QApplication::UnicodeUTF8)); + actionView_foot_points->setShortcut(QApplication::translate("MainWindow", "T", 0, QApplication::UnicodeUTF8)); + actionView_points->setText(QApplication::translate("MainWindow", "Points", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP - actionView_points->setStatusTip(QApplication::translate("MainWindow", "View points", 0, QApplication::UnicodeUTF8)); + actionView_points->setStatusTip(QApplication::translate("MainWindow", "View points", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionView_points->setShortcut(QApplication::translate("MainWindow", "P", 0, QApplication::UnicodeUTF8)); - actionView_edges->setText(QApplication::translate("MainWindow", "Edges", 0, QApplication::UnicodeUTF8)); + actionView_points->setShortcut(QApplication::translate("MainWindow", "P", 0, QApplication::UnicodeUTF8)); + actionView_edges->setText(QApplication::translate("MainWindow", "Edges", 0, QApplication::UnicodeUTF8)); #ifndef QT_NO_STATUSTIP - actionView_edges->setStatusTip(QApplication::translate("MainWindow", "View edges", 0, QApplication::UnicodeUTF8)); + actionView_edges->setStatusTip(QApplication::translate("MainWindow", "View edges", 0, QApplication::UnicodeUTF8)); #endif // QT_NO_STATUSTIP - actionView_edges->setShortcut(QApplication::translate("MainWindow", "E", 0, QApplication::UnicodeUTF8)); - actionRecenter->setText(QApplication::translate("MainWindow", "Recenter", 0, QApplication::UnicodeUTF8)); - actionView_vertices->setText(QApplication::translate("MainWindow", "Vertices", 0, QApplication::UnicodeUTF8)); - actionView_vertices->setShortcut(QApplication::translate("MainWindow", "V", 0, QApplication::UnicodeUTF8)); - actionBoxes->setText(QApplication::translate("MainWindow", "Two boxes...", 0, QApplication::UnicodeUTF8)); - actionStair->setText(QApplication::translate("MainWindow", "Stair...", 0, QApplication::UnicodeUTF8)); - actionSkyline->setText(QApplication::translate("MainWindow", "Skyline...", 0, QApplication::UnicodeUTF8)); - actionView_edge_priority->setText(QApplication::translate("MainWindow", "Edge priority", 0, QApplication::UnicodeUTF8)); - actionView_edge_priority->setShortcut(QApplication::translate("MainWindow", "Z", 0, QApplication::UnicodeUTF8)); - actionReconstruction_10_steps->setText(QApplication::translate("MainWindow", "10 steps", 0, QApplication::UnicodeUTF8)); - actionReconstruction_10_steps->setShortcut(QApplication::translate("MainWindow", "1", 0, QApplication::UnicodeUTF8)); - actionReconstruction_100_steps->setText(QApplication::translate("MainWindow", "100 steps", 0, QApplication::UnicodeUTF8)); - actionReconstruction_100_steps->setShortcut(QApplication::translate("MainWindow", "2", 0, QApplication::UnicodeUTF8)); - actionReconstruction_1000_steps->setText(QApplication::translate("MainWindow", "1000 steps", 0, QApplication::UnicodeUTF8)); - actionReconstruction_1000_steps->setShortcut(QApplication::translate("MainWindow", "3", 0, QApplication::UnicodeUTF8)); - actionAdd_outliers->setText(QApplication::translate("MainWindow", "Add outliers", 0, QApplication::UnicodeUTF8)); - actionAdd_outliers->setShortcut(QApplication::translate("MainWindow", "O", 0, QApplication::UnicodeUTF8)); - actionSnapshot->setText(QApplication::translate("MainWindow", "Snapshot", 0, QApplication::UnicodeUTF8)); - actionSnapshot->setShortcut(QApplication::translate("MainWindow", "Ctrl+C", 0, QApplication::UnicodeUTF8)); - actionIncreasingly_sharp_angles->setText(QApplication::translate("MainWindow", "Increasingly sharp angles...", 0, QApplication::UnicodeUTF8)); - actionBox_with_boundaries->setText(QApplication::translate("MainWindow", "Box with boundaries...", 0, QApplication::UnicodeUTF8)); - actionBox_with_missing_corners->setText(QApplication::translate("MainWindow", "Box with missing corners...", 0, QApplication::UnicodeUTF8)); - actionStar->setText(QApplication::translate("MainWindow", "Star...", 0, QApplication::UnicodeUTF8)); - actionSpiral->setText(QApplication::translate("MainWindow", "Spiral...", 0, QApplication::UnicodeUTF8)); - actionSet_parameters->setText(QApplication::translate("MainWindow", "Parameters", 0, QApplication::UnicodeUTF8)); - actionSet_parameters->setShortcut(QApplication::translate("MainWindow", "Ctrl+P", 0, QApplication::UnicodeUTF8)); - actionView_edge_cost->setText(QApplication::translate("MainWindow", "Edge cost", 0, QApplication::UnicodeUTF8)); - actionView_edge_cost->setShortcut(QApplication::translate("MainWindow", "C", 0, QApplication::UnicodeUTF8)); - actionReconstruction_until->setText(QApplication::translate("MainWindow", "until", 0, QApplication::UnicodeUTF8)); - actionReconstruction_until->setShortcut(QApplication::translate("MainWindow", "U", 0, QApplication::UnicodeUTF8)); - actionParallel_lines->setText(QApplication::translate("MainWindow", "Parallel lines...", 0, QApplication::UnicodeUTF8)); - actionNoise->setText(QApplication::translate("MainWindow", "Noise", 0, QApplication::UnicodeUTF8)); - actionNoise->setShortcut(QApplication::translate("MainWindow", "N", 0, QApplication::UnicodeUTF8)); - actionActivate_simulation->setText(QApplication::translate("MainWindow", "Simulation", 0, QApplication::UnicodeUTF8)); - actionView_simulation->setText(QApplication::translate("MainWindow", "Simulation stage", 0, QApplication::UnicodeUTF8)); - actionView_simulation->setShortcut(QApplication::translate("MainWindow", "A", 0, QApplication::UnicodeUTF8)); - actionRelocate_vertices->setText(QApplication::translate("MainWindow", "Relocate", 0, QApplication::UnicodeUTF8)); - actionRelocate_vertices->setShortcut(QApplication::translate("MainWindow", "L", 0, QApplication::UnicodeUTF8)); - actionView_relocation->setText(QApplication::translate("MainWindow", "Relocation", 0, QApplication::UnicodeUTF8)); - actionView_relocation->setShortcut(QApplication::translate("MainWindow", "Shift+L", 0, QApplication::UnicodeUTF8)); - actionView_ghost->setText(QApplication::translate("MainWindow", "Ghost edges", 0, QApplication::UnicodeUTF8)); - actionView_ghost->setShortcut(QApplication::translate("MainWindow", "G", 0, QApplication::UnicodeUTF8)); - actionInvert_mass->setText(QApplication::translate("MainWindow", "Invert mass", 0, QApplication::UnicodeUTF8)); - actionInvert_mass->setShortcut(QApplication::translate("MainWindow", "Shift+I", 0, QApplication::UnicodeUTF8)); - actionView_relevance->setText(QApplication::translate("MainWindow", "Relevance", 0, QApplication::UnicodeUTF8)); - actionView_relevance->setShortcut(QApplication::translate("MainWindow", "Shift+R", 0, QApplication::UnicodeUTF8)); - actionView_tolerance->setText(QApplication::translate("MainWindow", "Tolerance", 0, QApplication::UnicodeUTF8)); - actionView_tolerance->setShortcut(QApplication::translate("MainWindow", "Shift+T", 0, QApplication::UnicodeUTF8)); - actionView_incolors->setText(QApplication::translate("MainWindow", "In colors", 0, QApplication::UnicodeUTF8)); - actionClamp_mass->setText(QApplication::translate("MainWindow", "Clamp mass", 0, QApplication::UnicodeUTF8)); - actionView_bins->setText(QApplication::translate("MainWindow", "Bins", 0, QApplication::UnicodeUTF8)); - actionView_bins->setShortcut(QApplication::translate("MainWindow", "Shift+B", 0, QApplication::UnicodeUTF8)); - actionPrint_Stats->setText(QApplication::translate("MainWindow", "Print Stats", 0, QApplication::UnicodeUTF8)); - actionPrint_Stats->setShortcut(QApplication::translate("MainWindow", "Shift+S", 0, QApplication::UnicodeUTF8)); - actionSubdivide->setText(QApplication::translate("MainWindow", "Subdivide", 0, QApplication::UnicodeUTF8)); - actionWidely_variable_sampling->setText(QApplication::translate("MainWindow", "Widely variable sampling", 0, QApplication::UnicodeUTF8)); - actionDecimate->setText(QApplication::translate("MainWindow", "Decimate", 0, QApplication::UnicodeUTF8)); - actionKeep_one_point_out_of_n->setText(QApplication::translate("MainWindow", "One point out of n", 0, QApplication::UnicodeUTF8)); - actionSet_MChoice->setText(QApplication::translate("MainWindow", "Multiple Choice", 0, QApplication::UnicodeUTF8)); - actionSet_MChoice->setShortcut(QApplication::translate("MainWindow", "M", 0, QApplication::UnicodeUTF8)); - label->setText(QApplication::translate("MainWindow", "Discard", 0, QApplication::UnicodeUTF8)); - menuFile->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8)); - menuPoint_set->setTitle(QApplication::translate("MainWindow", "Data", 0, QApplication::UnicodeUTF8)); - menuPredefined->setTitle(QApplication::translate("MainWindow", "Predefined", 0, QApplication::UnicodeUTF8)); - menuAlgorithms->setTitle(QApplication::translate("MainWindow", "Algorithms", 0, QApplication::UnicodeUTF8)); - menuReconstruction->setTitle(QApplication::translate("MainWindow", "Decimate", 0, QApplication::UnicodeUTF8)); - menuView->setTitle(QApplication::translate("MainWindow", "View", 0, QApplication::UnicodeUTF8)); - toolBar->setWindowTitle(QApplication::translate("MainWindow", "toolBar", 0, QApplication::UnicodeUTF8)); - } // retranslateUi + actionView_edges->setShortcut(QApplication::translate("MainWindow", "E", 0, QApplication::UnicodeUTF8)); + actionRecenter->setText(QApplication::translate("MainWindow", "Recenter", 0, QApplication::UnicodeUTF8)); + actionView_vertices->setText(QApplication::translate("MainWindow", "Vertices", 0, QApplication::UnicodeUTF8)); + actionView_vertices->setShortcut(QApplication::translate("MainWindow", "V", 0, QApplication::UnicodeUTF8)); + actionBoxes->setText(QApplication::translate("MainWindow", "Two boxes...", 0, QApplication::UnicodeUTF8)); + actionStair->setText(QApplication::translate("MainWindow", "Stair...", 0, QApplication::UnicodeUTF8)); + actionSkyline->setText(QApplication::translate("MainWindow", "Skyline...", 0, QApplication::UnicodeUTF8)); + actionView_edge_priority->setText(QApplication::translate("MainWindow", "Edge priority", 0, QApplication::UnicodeUTF8)); + actionView_edge_priority->setShortcut(QApplication::translate("MainWindow", "Z", 0, QApplication::UnicodeUTF8)); + actionReconstruction_10_steps->setText(QApplication::translate("MainWindow", "10 steps", 0, QApplication::UnicodeUTF8)); + actionReconstruction_10_steps->setShortcut(QApplication::translate("MainWindow", "1", 0, QApplication::UnicodeUTF8)); + actionReconstruction_100_steps->setText(QApplication::translate("MainWindow", "100 steps", 0, QApplication::UnicodeUTF8)); + actionReconstruction_100_steps->setShortcut(QApplication::translate("MainWindow", "2", 0, QApplication::UnicodeUTF8)); + actionReconstruction_1000_steps->setText(QApplication::translate("MainWindow", "1000 steps", 0, QApplication::UnicodeUTF8)); + actionReconstruction_1000_steps->setShortcut(QApplication::translate("MainWindow", "3", 0, QApplication::UnicodeUTF8)); + actionAdd_outliers->setText(QApplication::translate("MainWindow", "Add outliers", 0, QApplication::UnicodeUTF8)); + actionAdd_outliers->setShortcut(QApplication::translate("MainWindow", "O", 0, QApplication::UnicodeUTF8)); + actionSnapshot->setText(QApplication::translate("MainWindow", "Snapshot", 0, QApplication::UnicodeUTF8)); + actionSnapshot->setShortcut(QApplication::translate("MainWindow", "Ctrl+C", 0, QApplication::UnicodeUTF8)); + actionIncreasingly_sharp_angles->setText(QApplication::translate("MainWindow", "Increasingly sharp angles...", 0, QApplication::UnicodeUTF8)); + actionBox_with_boundaries->setText(QApplication::translate("MainWindow", "Box with boundaries...", 0, QApplication::UnicodeUTF8)); + actionBox_with_missing_corners->setText(QApplication::translate("MainWindow", "Box with missing corners...", 0, QApplication::UnicodeUTF8)); + actionStar->setText(QApplication::translate("MainWindow", "Star...", 0, QApplication::UnicodeUTF8)); + actionSpiral->setText(QApplication::translate("MainWindow", "Spiral...", 0, QApplication::UnicodeUTF8)); + actionSet_parameters->setText(QApplication::translate("MainWindow", "Parameters", 0, QApplication::UnicodeUTF8)); + actionSet_parameters->setShortcut(QApplication::translate("MainWindow", "Ctrl+P", 0, QApplication::UnicodeUTF8)); + actionView_edge_cost->setText(QApplication::translate("MainWindow", "Edge cost", 0, QApplication::UnicodeUTF8)); + actionView_edge_cost->setShortcut(QApplication::translate("MainWindow", "C", 0, QApplication::UnicodeUTF8)); + actionReconstruction_until->setText(QApplication::translate("MainWindow", "until", 0, QApplication::UnicodeUTF8)); + actionReconstruction_until->setShortcut(QApplication::translate("MainWindow", "U", 0, QApplication::UnicodeUTF8)); + actionParallel_lines->setText(QApplication::translate("MainWindow", "Parallel lines...", 0, QApplication::UnicodeUTF8)); + actionNoise->setText(QApplication::translate("MainWindow", "Noise", 0, QApplication::UnicodeUTF8)); + actionNoise->setShortcut(QApplication::translate("MainWindow", "N", 0, QApplication::UnicodeUTF8)); + actionActivate_simulation->setText(QApplication::translate("MainWindow", "Simulation", 0, QApplication::UnicodeUTF8)); + actionView_simulation->setText(QApplication::translate("MainWindow", "Simulation stage", 0, QApplication::UnicodeUTF8)); + actionView_simulation->setShortcut(QApplication::translate("MainWindow", "A", 0, QApplication::UnicodeUTF8)); + actionRelocate_vertices->setText(QApplication::translate("MainWindow", "Relocate", 0, QApplication::UnicodeUTF8)); + actionRelocate_vertices->setShortcut(QApplication::translate("MainWindow", "L", 0, QApplication::UnicodeUTF8)); + actionView_relocation->setText(QApplication::translate("MainWindow", "Relocation", 0, QApplication::UnicodeUTF8)); + actionView_relocation->setShortcut(QApplication::translate("MainWindow", "Shift+L", 0, QApplication::UnicodeUTF8)); + actionView_ghost->setText(QApplication::translate("MainWindow", "Ghost edges", 0, QApplication::UnicodeUTF8)); + actionView_ghost->setShortcut(QApplication::translate("MainWindow", "G", 0, QApplication::UnicodeUTF8)); + actionInvert_mass->setText(QApplication::translate("MainWindow", "Invert mass", 0, QApplication::UnicodeUTF8)); + actionInvert_mass->setShortcut(QApplication::translate("MainWindow", "Shift+I", 0, QApplication::UnicodeUTF8)); + actionView_relevance->setText(QApplication::translate("MainWindow", "Relevance", 0, QApplication::UnicodeUTF8)); + actionView_relevance->setShortcut(QApplication::translate("MainWindow", "Shift+R", 0, QApplication::UnicodeUTF8)); + actionView_tolerance->setText(QApplication::translate("MainWindow", "Tolerance", 0, QApplication::UnicodeUTF8)); + actionView_tolerance->setShortcut(QApplication::translate("MainWindow", "Shift+T", 0, QApplication::UnicodeUTF8)); + actionView_incolors->setText(QApplication::translate("MainWindow", "In colors", 0, QApplication::UnicodeUTF8)); + actionClamp_mass->setText(QApplication::translate("MainWindow", "Clamp mass", 0, QApplication::UnicodeUTF8)); + actionView_bins->setText(QApplication::translate("MainWindow", "Bins", 0, QApplication::UnicodeUTF8)); + actionView_bins->setShortcut(QApplication::translate("MainWindow", "Shift+B", 0, QApplication::UnicodeUTF8)); + actionPrint_Stats->setText(QApplication::translate("MainWindow", "Print Stats", 0, QApplication::UnicodeUTF8)); + actionPrint_Stats->setShortcut(QApplication::translate("MainWindow", "Shift+S", 0, QApplication::UnicodeUTF8)); + actionSubdivide->setText(QApplication::translate("MainWindow", "Subdivide", 0, QApplication::UnicodeUTF8)); + actionWidely_variable_sampling->setText(QApplication::translate("MainWindow", "Widely variable sampling", 0, QApplication::UnicodeUTF8)); + actionDecimate->setText(QApplication::translate("MainWindow", "Decimate", 0, QApplication::UnicodeUTF8)); + actionKeep_one_point_out_of_n->setText(QApplication::translate("MainWindow", "One point out of n", 0, QApplication::UnicodeUTF8)); + actionSet_MChoice->setText(QApplication::translate("MainWindow", "Multiple Choice", 0, QApplication::UnicodeUTF8)); + actionSet_MChoice->setShortcut(QApplication::translate("MainWindow", "M", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("MainWindow", "Discard", 0, QApplication::UnicodeUTF8)); + menuFile->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8)); + menuPoint_set->setTitle(QApplication::translate("MainWindow", "Data", 0, QApplication::UnicodeUTF8)); + menuPredefined->setTitle(QApplication::translate("MainWindow", "Predefined", 0, QApplication::UnicodeUTF8)); + menuAlgorithms->setTitle(QApplication::translate("MainWindow", "Algorithms", 0, QApplication::UnicodeUTF8)); + menuReconstruction->setTitle(QApplication::translate("MainWindow", "Decimate", 0, QApplication::UnicodeUTF8)); + menuView->setTitle(QApplication::translate("MainWindow", "View", 0, QApplication::UnicodeUTF8)); + toolBar->setWindowTitle(QApplication::translate("MainWindow", "toolBar", 0, QApplication::UnicodeUTF8)); + } // retranslateUi }; namespace Ui { - class MainWindow: public Ui_MainWindow {}; +class MainWindow: public Ui_MainWindow {}; } // namespace Ui QT_END_NAMESPACE diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp index af29f1d3c29..43512ddfdad 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp @@ -18,219 +18,219 @@ MainWindow::MainWindow() : QMainWindow(), Ui_MainWindow(), maxNumRecentFiles(15), recentFileActs(15) { - setupUi(this); + setupUi(this); - // init scene - m_scene = new Scene; - viewer->set_scene(m_scene); + // init scene + m_scene = new Scene; + viewer->set_scene(m_scene); - // options - m_verbose = 0; - m_mchoice = 0; - m_ghost = 1.0; - m_alpha = 50.0; - m_use_flip = true; - m_percent = 100.0; - m_norm_tol = 100.0; - m_tang_tol = 100.0; - m_relocation = 0; + // options + m_verbose = 0; + m_mchoice = 0; + m_ghost = 1.0; + m_alpha = 50.0; + m_use_flip = true; + m_percent = 100.0; + m_norm_tol = 100.0; + m_tang_tol = 100.0; + m_relocation = 0; - // accepts drop events - setAcceptDrops(true); + // accepts drop events + setAcceptDrops(true); - // Handling actions - addRecentFiles(menuFile, actionQuit); - connect(actionQuit, SIGNAL(triggered()), this, SLOT(close())); - connect(min_mass_slider, SIGNAL(valueChanged(int)), this, SLOT(update())); - connect(discard_spinbox, SIGNAL(valueChanged(int)), this, SLOT(update())); - connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); + // Handling actions + addRecentFiles(menuFile, actionQuit); + connect(actionQuit, SIGNAL(triggered()), this, SLOT(close())); + connect(min_mass_slider, SIGNAL(valueChanged(int)), this, SLOT(update())); + connect(discard_spinbox, SIGNAL(valueChanged(int)), this, SLOT(update())); + connect(this, SIGNAL(openRecentFile(QString)), this, SLOT(open(QString))); } MainWindow::~MainWindow() { - delete m_scene; + delete m_scene; } void MainWindow::addToRecentFiles(QString fileName) { - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); - files.removeAll(fileName); - files.prepend(fileName); - while (files.size() > (int)maxNumRecentFiles) - files.removeLast(); - settings.setValue("recentFileList", files); - updateRecentFileActions(); + QSettings settings; + QStringList files = settings.value("recentFileList").toStringList(); + files.removeAll(fileName); + files.prepend(fileName); + while (files.size() > (int)maxNumRecentFiles) + files.removeLast(); + settings.setValue("recentFileList", files); + updateRecentFileActions(); } void MainWindow::dropEvent(QDropEvent *event) { - Q_FOREACH(QUrl url, event->mimeData()->urls()) - { - QString filename = url.toLocalFile(); - if (!filename.isEmpty()) - { - QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename); - open(filename); - } - } - event->acceptProposedAction(); + Q_FOREACH(QUrl url, event->mimeData()->urls()) + { + QString filename = url.toLocalFile(); + if (!filename.isEmpty()) + { + QTextStream(stderr) << QString("dropEvent(\"%1\")\n").arg(filename); + open(filename); + } + } + event->acceptProposedAction(); } void MainWindow::closeEvent(QCloseEvent *event) { - event->accept(); + event->accept(); } void MainWindow::dragEnterEvent(QDragEnterEvent *event) { - if (event->mimeData()->hasFormat("text/uri-list")) - event->acceptProposedAction(); + if (event->mimeData()->hasFormat("text/uri-list")) + event->acceptProposedAction(); } void MainWindow::openRecentFile_aux() { - QAction* action = qobject_cast(sender()); - if (action) - emit openRecentFile(action->data().toString()); + QAction* action = qobject_cast(sender()); + if (action) + emit openRecentFile(action->data().toString()); } void MainWindow::updateRecentFileActions() { - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); + QSettings settings; + QStringList files = settings.value("recentFileList").toStringList(); - int numRecentFiles = qMin(files.size(), (int)maxNumberOfRecentFiles()); - for (int i = 0; i < numRecentFiles; ++i) { - QString strippedName = QFileInfo(files[i]).fileName(); - QString text = tr("&%1 %2").arg(i).arg(strippedName); - recentFileActs[i]->setText(text); - recentFileActs[i]->setData(files[i]); - recentFileActs[i]->setVisible(true); - } - for (unsigned int j = numRecentFiles; j < maxNumberOfRecentFiles(); ++j) - recentFileActs[j]->setVisible(false); + int numRecentFiles = qMin(files.size(), (int)maxNumberOfRecentFiles()); + for (int i = 0; i < numRecentFiles; ++i) { + QString strippedName = QFileInfo(files[i]).fileName(); + QString text = tr("&%1 %2").arg(i).arg(strippedName); + recentFileActs[i]->setText(text); + recentFileActs[i]->setData(files[i]); + recentFileActs[i]->setVisible(true); + } + for (unsigned int j = numRecentFiles; j < maxNumberOfRecentFiles(); ++j) + recentFileActs[j]->setVisible(false); - recentFilesSeparator->setVisible(numRecentFiles > 0); + recentFilesSeparator->setVisible(numRecentFiles > 0); } void MainWindow::addRecentFiles(QMenu* menu, QAction* insertBeforeAction) { - if (insertBeforeAction) - recentFilesSeparator = menu->insertSeparator(insertBeforeAction); - else - recentFilesSeparator = menu->addSeparator(); - recentFilesSeparator->setVisible(false); + if (insertBeforeAction) + recentFilesSeparator = menu->insertSeparator(insertBeforeAction); + else + recentFilesSeparator = menu->addSeparator(); + recentFilesSeparator->setVisible(false); - for (unsigned int i = 0; i < maxNumberOfRecentFiles(); ++i) { - recentFileActs[i] = new QAction(this); - recentFileActs[i]->setVisible(false); - connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile_aux())); - if (insertBeforeAction) - menu->insertAction(insertBeforeAction, recentFileActs[i]); - else - menu->addAction(recentFileActs[i]); - } - updateRecentFileActions(); + for (unsigned int i = 0; i < maxNumberOfRecentFiles(); ++i) { + recentFileActs[i] = new QAction(this); + recentFileActs[i]->setVisible(false); + connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile_aux())); + if (insertBeforeAction) + menu->insertAction(insertBeforeAction, recentFileActs[i]); + else + menu->addAction(recentFileActs[i]); + } + updateRecentFileActions(); } void MainWindow::open(const QString& filename) { - bool use_grad = false; - if (filename.contains(".bmp", Qt::CaseInsensitive)) - { - QMessageBox::StandardButton reply; - reply = QMessageBox::question(this, tr("Open BMP"), "Use gradient?", - QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); - if (reply == QMessageBox::Yes) - use_grad = true; - else if (reply == QMessageBox::No) - use_grad = false; - else - return; - } - - QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->load(filename, use_grad); - QApplication::restoreOverrideCursor(); - addToRecentFiles(filename); - update(); + bool use_grad = false; + if (filename.contains(".bmp", Qt::CaseInsensitive)) + { + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, tr("Open BMP"), "Use gradient?", + QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); + if (reply == QMessageBox::Yes) + use_grad = true; + else if (reply == QMessageBox::No) + use_grad = false; + else + return; + } + + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->load(filename, use_grad); + QApplication::restoreOverrideCursor(); + addToRecentFiles(filename); + update(); } void MainWindow::save(const QString& filename) { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->save(filename); - QApplication::restoreOverrideCursor(); - std::cout << "File " << filename.toStdString() << " saved" << std::endl; + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->save(filename); + QApplication::restoreOverrideCursor(); + std::cout << "File " << filename.toStdString() << " saved" << std::endl; } void MainWindow::update() { - m_scene->set_min_mass(min_mass()); - m_scene->set_nb_edges_to_ignore(ignore_edges()); - viewer->repaint(); + m_scene->set_min_mass(min_mass()); + m_scene->set_nb_edges_to_ignore(ignore_edges()); + viewer->repaint(); } void MainWindow::on_actionClear_triggered() { - m_scene->clear(); - update(); + m_scene->clear(); + update(); } void MainWindow::on_actionLoadPoints_triggered() { - QString fileName = - QFileDialog::getOpenFileName(this, tr("Open point set"), "."); - if (fileName.isEmpty()) return; - open(fileName); + QString fileName = + QFileDialog::getOpenFileName(this, tr("Open point set"), "."); + if (fileName.isEmpty()) return; + open(fileName); } void MainWindow::on_actionSave_triggered() { - QString filename = - QFileDialog::getSaveFileName(this, tr("Save point set"), "."); - if (filename.isEmpty()) return; - save(filename); + QString filename = + QFileDialog::getSaveFileName(this, tr("Save point set"), "."); + if (filename.isEmpty()) return; + save(filename); } void MainWindow::on_actionSnapshot_triggered() { - std::cout << "snapshot..."; - QApplication::setOverrideCursor(Qt::WaitCursor); - QClipboard *qb = QApplication::clipboard(); - viewer->makeCurrent(); - viewer->raise(); - QImage snapshot = viewer->grabFrameBuffer(true); - qb->setImage(snapshot); - QApplication::restoreOverrideCursor(); - std::cout << "done" << std::endl; + std::cout << "snapshot..."; + QApplication::setOverrideCursor(Qt::WaitCursor); + QClipboard *qb = QApplication::clipboard(); + viewer->makeCurrent(); + viewer->raise(); + QImage snapshot = viewer->grabFrameBuffer(true); + qb->setImage(snapshot); + QApplication::restoreOverrideCursor(); + std::cout << "done" << std::endl; } void MainWindow::on_actionInsertPoint_toggled() { - viewer->toggle_insert_points(); - update(); + viewer->toggle_insert_points(); + update(); } void MainWindow::on_actionRecenter_triggered() { - double center_x, center_y, scale; - m_scene->compute_bbox(center_x, center_y, scale); - viewer->set_camera(center_x, center_y, 1. / scale); - update(); + double center_x, center_y, scale; + m_scene->compute_bbox(center_x, center_y, scale); + viewer->set_camera(center_x, center_y, 1. / scale); + update(); } void MainWindow::on_actionInvert_mass_triggered() { - m_scene->invert_mass(); - update(); + m_scene->invert_mass(); + update(); } void MainWindow::on_actionClamp_mass_triggered() { - m_scene->clamp_mass(); - update(); + m_scene->clamp_mass(); + update(); } /////////////////////////// @@ -239,275 +239,275 @@ void MainWindow::on_actionClamp_mass_triggered() void MainWindow::on_actionCircle_triggered() { - bool ok; - int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 300, 10, 10000, 1, &ok); - if (!ok) return; + bool ok; + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 300, 10, 10000, 1, &ok); + if (!ok) return; - float x = QInputDialog::getDouble( - this, tr("Center x"), tr("Center x:"), 0.0, 0.0, 10, 1, &ok); - if (!ok) return; + float x = QInputDialog::getDouble( + this, tr("Center x"), tr("Center x:"), 0.0, 0.0, 10, 1, &ok); + if (!ok) return; - float y = QInputDialog::getDouble( - this, tr("Center y"), tr("Center y:"), 0.0, 0.0, 10, 1, &ok); - if (!ok) return; + float y = QInputDialog::getDouble( + this, tr("Center y"), tr("Center y:"), 0.0, 0.0, 10, 1, &ok); + if (!ok) return; - float radius = QInputDialog::getDouble( - this, tr("Radius"), tr("Radius:"), 0.5, 0.1, 10, 1, &ok); - if (!ok) return; + float radius = QInputDialog::getDouble( + this, tr("Radius"), tr("Radius:"), 0.5, 0.1, 10, 1, &ok); + if (!ok) return; - m_scene->append_predefined_circle(density, x, y, radius); - update(); + m_scene->append_predefined_circle(density, x, y, radius); + update(); } void MainWindow::on_actionHalf_circle_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 150, 10, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 150, 10, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_half_circle(density); - update(); + m_scene->append_predefined_half_circle(density); + update(); } void MainWindow::on_actionSpiral_triggered() { - bool ok; + bool ok; - int loops = QInputDialog::getInteger( - this, tr("Loops"), tr("Number:"), 3, 1, 10000, 1, &ok); - if (!ok) return; + int loops = QInputDialog::getInteger( + this, tr("Loops"), tr("Number:"), 3, 1, 10000, 1, &ok); + if (!ok) return; - int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); - if (!ok) return; + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_spiral(loops,density); - update(); + m_scene->append_predefined_spiral(loops,density); + update(); } void MainWindow::on_actionLine_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 50, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 50, 1, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_line(density); - update(); + m_scene->append_predefined_line(density); + update(); } void MainWindow::on_actionBox_triggered() { - bool ok; - int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); + if (!ok) return; - float x = QInputDialog::getDouble( - this, tr("x"), tr("x:"), 0.0, 0.0, 10.0, 1, &ok); - if (!ok) return; + float x = QInputDialog::getDouble( + this, tr("x"), tr("x:"), 0.0, 0.0, 10.0, 1, &ok); + if (!ok) return; - float y = QInputDialog::getDouble( - this, tr("y"), tr("y:"), 0.0, 0.0, 10.0, 1, &ok); - if (!ok) return; + float y = QInputDialog::getDouble( + this, tr("y"), tr("y:"), 0.0, 0.0, 10.0, 1, &ok); + if (!ok) return; - float sx = QInputDialog::getDouble( - this, tr("size x"), tr("size x:"), 1.0, 0.1, 10.0, 1, &ok); - if (!ok) return; + float sx = QInputDialog::getDouble( + this, tr("size x"), tr("size x:"), 1.0, 0.1, 10.0, 1, &ok); + if (!ok) return; - float sy = QInputDialog::getDouble( - this, tr("size y"), tr("size y:"), 1.0, 0.1, 10.0, 1, &ok); - if (!ok) return; + float sy = QInputDialog::getDouble( + this, tr("size y"), tr("size y:"), 1.0, 0.1, 10.0, 1, &ok); + if (!ok) return; - m_scene->append_predefined_box(density, x, y, sx, sy); - update(); + m_scene->append_predefined_box(density, x, y, sx, sy); + update(); } void MainWindow::on_actionBoxes_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_boxes(density); - update(); + m_scene->append_predefined_boxes(density); + update(); } void MainWindow::on_actionParallel_lines_triggered() { - bool ok; + bool ok; - int lines = QInputDialog::getInteger( - this, tr("Lines"), tr("Number:"), 3, 1, 10000, 1, &ok); - if(!ok) return; + int lines = QInputDialog::getInteger( + this, tr("Lines"), tr("Number:"), 3, 1, 10000, 1, &ok); + if(!ok) return; - float space = QInputDialog::getDouble( - this, tr("Space"), tr("Space:"), 0.2, 0.1, 10, 1, &ok); - if (!ok) return; + float space = QInputDialog::getDouble( + this, tr("Space"), tr("Space:"), 0.2, 0.1, 10, 1, &ok); + if (!ok) return; - int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); - if(!ok) return; + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if(!ok) return; - m_scene->append_predefined_parallel_lines(lines, space, density); - update(); + m_scene->append_predefined_parallel_lines(lines, space, density); + update(); } void MainWindow::on_actionBox_with_boundaries_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_box_with_boundaries(density); - update(); + m_scene->append_predefined_box_with_boundaries(density); + update(); } void MainWindow::on_actionBox_with_missing_corners_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_box_with_missing_corners(density); - update(); + m_scene->append_predefined_box_with_missing_corners(density); + update(); } void MainWindow::on_actionStar_triggered() { - bool ok; - int nb_branches = QInputDialog::getInteger( - this, tr("Branches"), tr("Branches:"), 20, 2, 10000, 1, &ok); - if(!ok) return; - - int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 100, 10, 10000, 1, &ok); - if(!ok) return; + bool ok; + int nb_branches = QInputDialog::getInteger( + this, tr("Branches"), tr("Branches:"), 20, 2, 10000, 1, &ok); + if(!ok) return; - m_scene->append_star(nb_branches,density); - update(); + int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 100, 10, 10000, 1, &ok); + if(!ok) return; + + m_scene->append_star(nb_branches,density); + update(); } void MainWindow::on_actionStair_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 30, 2, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 30, 2, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_stair(density); - on_actionRecenter_triggered(); - update(); + m_scene->append_predefined_stair(density); + on_actionRecenter_triggered(); + update(); } void MainWindow::on_actionSkyline_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 10, 1, 10000, 1, &ok); + if (!ok) return; - m_scene->append_predefined_skyline(density); - on_actionRecenter_triggered(); - update(); + m_scene->append_predefined_skyline(density); + on_actionRecenter_triggered(); + update(); } void MainWindow::on_actionIncreasingly_sharp_angles_triggered() { - bool ok; - unsigned int density = QInputDialog::getInteger( - this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int density = QInputDialog::getInteger( + this, tr("Density"), tr("Density:"), 100, 1, 10000, 1, &ok); + if (!ok) return; - double min_angle = QInputDialog::getDouble( - this, tr("Min Angle"), tr("Min Angle:"), 1.0, 1.0, 360.0, 1.0, &ok); - if (!ok) return; + double min_angle = QInputDialog::getDouble( + this, tr("Min Angle"), tr("Min Angle:"), 1.0, 1.0, 360.0, 1.0, &ok); + if (!ok) return; - m_scene->append_predefined_increasingly_sharp_angles(density, min_angle); - on_actionRecenter_triggered(); - update(); + m_scene->append_predefined_increasingly_sharp_angles(density, min_angle); + on_actionRecenter_triggered(); + update(); } void MainWindow::on_actionWidely_variable_sampling_triggered() { - bool ok; - float d1 = QInputDialog::getDouble( - this, tr("Delta-angle"), tr("Delta-angle:"), 1, 0.01, 20.0, 0.01, &ok); - if (!ok) return; - - float d2 = QInputDialog::getDouble( - this, tr("Delta-angle"), tr("Delta-angle:"), 10, 0.01, 30.0, 0.01, &ok); - if (!ok) return; - - m_scene->append_widely_variable_sampling(d1, d2); - update(); + bool ok; + float d1 = QInputDialog::getDouble( + this, tr("Delta-angle"), tr("Delta-angle:"), 1, 0.01, 20.0, 0.01, &ok); + if (!ok) return; + + float d2 = QInputDialog::getDouble( + this, tr("Delta-angle"), tr("Delta-angle:"), 10, 0.01, 30.0, 0.01, &ok); + if (!ok) return; + + m_scene->append_widely_variable_sampling(d1, d2); + update(); } void MainWindow::on_actionNoise_triggered() { - bool ok; - double noise = QInputDialog::getDouble( - this, tr("Noise"), tr("Amount:"), 0.003, 0.0, 1000.0, 8, &ok); - if (!ok) return; + bool ok; + double noise = QInputDialog::getDouble( + this, tr("Noise"), tr("Amount:"), 0.003, 0.0, 1000.0, 8, &ok); + if (!ok) return; - QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->noise(noise); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->noise(noise); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionAdd_outliers_triggered() { - bool ok; - unsigned int nb = (unsigned) - QInputDialog::getInteger( - this, tr("Outliers"), tr("How many:"), 10, 1, 100000, 1, &ok); - if (!ok) return; + bool ok; + unsigned int nb = (unsigned) + QInputDialog::getInteger( + this, tr("Outliers"), tr("How many:"), 10, 1, 100000, 1, &ok); + if (!ok) return; - QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->add_outliers(nb); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->add_outliers(nb); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionSubdivide_triggered() { - m_scene->subdivide(); - update(); + m_scene->subdivide(); + update(); } void MainWindow::on_actionDecimate_triggered() { - bool ok; - int percent = QInputDialog::getInteger( - this, tr("Decimate"), tr("Percentage:"), 50, 1, 100, 1, &ok); - if (!ok) return; + bool ok; + int percent = QInputDialog::getInteger( + this, tr("Decimate"), tr("Percentage:"), 50, 1, 100, 1, &ok); + if (!ok) return; - QApplication::setOverrideCursor(Qt::WaitCursor); - const double percentage = double(percent) / 100.0; - m_scene->decimate(percentage); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + const double percentage = double(percent) / 100.0; + m_scene->decimate(percentage); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionKeep_one_point_out_of_n_triggered() { - bool ok; - int n = QInputDialog::getInteger( - this, tr("Keep one point out of"), tr("n:"), 2, 2, 1000, 1, &ok); - if (!ok) return; + bool ok; + int n = QInputDialog::getInteger( + this, tr("Keep one point out of"), tr("n:"), 2, 2, 1000, 1, &ok); + if (!ok) return; - QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->keep_one_point_out_of(n); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->keep_one_point_out_of(n); + QApplication::restoreOverrideCursor(); + update(); } //////////////////// @@ -516,81 +516,81 @@ void MainWindow::on_actionKeep_one_point_out_of_n_triggered() void MainWindow::set_scene_parameters() { - m_scene->set_parameters(m_verbose, m_mchoice, m_use_flip, - alpha(), norm_tol(), tang_tol(), - m_relocation, m_ghost); + m_scene->set_parameters(m_verbose, m_mchoice, m_use_flip, + alpha(), norm_tol(), tang_tol(), + m_relocation, m_ghost); } void MainWindow::on_actionReconstruction_init_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - set_scene_parameters(); - m_scene->init_reconstruction(percentage()); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->init_reconstruction(percentage()); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionReconstruction_one_step_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - set_scene_parameters(); - m_scene->reconstruct(1); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(1); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionReconstruction_10_steps_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - set_scene_parameters(); - m_scene->reconstruct(10); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(10); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionReconstruction_100_steps_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - set_scene_parameters(); - m_scene->reconstruct(100); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(100); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionReconstruction_1000_steps_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - set_scene_parameters(); - m_scene->reconstruct(1000); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct(1000); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionReconstruction_until_triggered() { - bool ok; - int nb_points = QInputDialog::getInteger( - this, tr("Number of Points"), tr("Nb:"), 4, 1, 1000000, 1, &ok); - if (!ok) return; + bool ok; + int nb_points = QInputDialog::getInteger( + this, tr("Number of Points"), tr("Nb:"), 4, 1, 1000000, 1, &ok); + if (!ok) return; - QApplication::setOverrideCursor(Qt::WaitCursor); - set_scene_parameters(); - m_scene->reconstruct_until(nb_points); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + set_scene_parameters(); + m_scene->reconstruct_until(nb_points); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionRelocate_vertices_triggered() { - QApplication::setOverrideCursor(Qt::WaitCursor); - m_scene->relocate_all_points(); - QApplication::restoreOverrideCursor(); - update(); + QApplication::setOverrideCursor(Qt::WaitCursor); + m_scene->relocate_all_points(); + QApplication::restoreOverrideCursor(); + update(); } void MainWindow::on_actionPrint_Stats_triggered() { - m_scene->print_stats(); + m_scene->print_stats(); } ////////// @@ -599,130 +599,130 @@ void MainWindow::on_actionPrint_Stats_triggered() void MainWindow::on_actionView_points_toggled() { - viewer->toggle_view_points(); - update(); + viewer->toggle_view_points(); + update(); } void MainWindow::on_actionView_vertices_toggled() { - viewer->toggle_view_vertices(); - update(); + viewer->toggle_view_vertices(); + update(); } void MainWindow::on_actionView_edges_toggled() { - viewer->toggle_view_edges(); - update(); + viewer->toggle_view_edges(); + update(); } void MainWindow::on_actionView_ghost_toggled() { - viewer->toggle_view_ghost_edges(); - update(); + viewer->toggle_view_ghost_edges(); + update(); } void MainWindow::on_actionView_edge_cost_toggled() { - viewer->toggle_view_edge_cost(); - update(); + viewer->toggle_view_edge_cost(); + update(); } void MainWindow::on_actionView_edge_priority_toggled() { - viewer->toggle_view_edge_priority(); - update(); + viewer->toggle_view_edge_priority(); + update(); } void MainWindow::on_actionView_bins_toggled() { - viewer->toggle_view_bins(); - update(); + viewer->toggle_view_bins(); + update(); } void MainWindow::on_actionView_foot_points_toggled() { - viewer->toggle_view_foot_points(); - update(); + viewer->toggle_view_foot_points(); + update(); } void MainWindow::on_actionView_relocation_toggled() { - viewer->toggle_view_relocation(); - update(); + viewer->toggle_view_relocation(); + update(); } void MainWindow::on_actionView_tolerance_toggled() { - viewer->toggle_view_tolerance(); - update(); + viewer->toggle_view_tolerance(); + update(); } void MainWindow::on_actionView_incolors_toggled() { - viewer->toggle_view_incolors(); - update(); + viewer->toggle_view_incolors(); + update(); } void MainWindow::on_actionView_relevance_toggled() { - viewer->toggle_view_edge_relevance(); - update(); + viewer->toggle_view_edge_relevance(); + update(); } void MainWindow::on_actionActivate_simulation_toggled() { - viewer->toggle_activate_simulation(); - update(); + viewer->toggle_activate_simulation(); + update(); } void MainWindow::on_actionView_simulation_triggered() { - viewer->toggle_simulation_stage(); - update(); + viewer->toggle_simulation_stage(); + update(); } void MainWindow::on_actionSet_parameters_triggered() { - Dialog_options dlg; - dlg.set_all_ranges(); - dlg.set_verbose(m_verbose); - dlg.set_random_sample_size(m_mchoice); - dlg.set_percent(m_percent); - dlg.set_norm_tol(m_norm_tol); - dlg.set_tang_tol(m_tang_tol); - dlg.set_alpha(m_alpha); - dlg.set_relocation(m_relocation); - dlg.set_relevance(m_ghost); - dlg.set_use_flip(m_use_flip); - dlg.set_line_thickness(viewer->line_thickness()); - dlg.set_point_size(viewer->point_size()); - dlg.set_vertex_size(viewer->vertex_size()); + Dialog_options dlg; + dlg.set_all_ranges(); + dlg.set_verbose(m_verbose); + dlg.set_random_sample_size(m_mchoice); + dlg.set_percent(m_percent); + dlg.set_norm_tol(m_norm_tol); + dlg.set_tang_tol(m_tang_tol); + dlg.set_alpha(m_alpha); + dlg.set_relocation(m_relocation); + dlg.set_relevance(m_ghost); + dlg.set_use_flip(m_use_flip); + dlg.set_line_thickness(viewer->line_thickness()); + dlg.set_point_size(viewer->point_size()); + dlg.set_vertex_size(viewer->vertex_size()); - if (dlg.exec() == QDialog::Accepted) - { - m_verbose = dlg.get_verbose(); - m_mchoice = dlg.get_mchoice(); - m_percent = dlg.get_percent(); - m_norm_tol = dlg.get_norm_tol(); - m_tang_tol = dlg.get_tang_tol(); - m_alpha = dlg.get_alpha(); - m_relocation = dlg.get_relocation(); - m_ghost = dlg.get_ghost(); - m_use_flip = dlg.get_use_flip(); + if (dlg.exec() == QDialog::Accepted) + { + m_verbose = dlg.get_verbose(); + m_mchoice = dlg.get_mchoice(); + m_percent = dlg.get_percent(); + m_norm_tol = dlg.get_norm_tol(); + m_tang_tol = dlg.get_tang_tol(); + m_alpha = dlg.get_alpha(); + m_relocation = dlg.get_relocation(); + m_ghost = dlg.get_ghost(); + m_use_flip = dlg.get_use_flip(); - set_scene_parameters(); - viewer->line_thickness() = dlg.get_line_thickness(); - viewer->point_size() = dlg.get_point_size(); - viewer->vertex_size() = dlg.get_vertex_size(); - update(); - } + set_scene_parameters(); + viewer->line_thickness() = dlg.get_line_thickness(); + viewer->point_size() = dlg.get_point_size(); + viewer->vertex_size() = dlg.get_vertex_size(); + update(); + } } void MainWindow::on_actionSet_MChoice_toggled() { - if (m_mchoice == 0) - m_mchoice = 10; - else - m_mchoice = 0; - set_scene_parameters(); + if (m_mchoice == 0) + m_mchoice = 10; + else + m_mchoice = 0; + set_scene_parameters(); } diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h index 7badc653e47..1cbf54a2c45 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.h @@ -14,137 +14,137 @@ class MainWindow : public QMainWindow, public Ui_MainWindow { - Q_OBJECT - + Q_OBJECT + private: - Scene* m_scene; - - // main options - int m_verbose; - int m_mchoice; - bool m_use_flip; - double m_alpha; - double m_ghost; - double m_percent; - double m_norm_tol; - double m_tang_tol; + Scene* m_scene; + + // main options + int m_verbose; + int m_mchoice; + bool m_use_flip; + double m_alpha; + double m_ghost; + double m_percent; + double m_norm_tol; + double m_tang_tol; double m_relocation; - - unsigned int maxNumRecentFiles; - QAction* recentFilesSeparator; - QVector recentFileActs; - + + unsigned int maxNumRecentFiles; + QAction* recentFilesSeparator; + QVector recentFileActs; + public: - MainWindow(); - ~MainWindow(); - - // Parameters - void set_scene_parameters(); - - double percentage() const { return m_percent / 100.0; } - - double norm_tol() const { return m_norm_tol / 100.0; } - - double tang_tol() const { return m_tang_tol / 100.0; } - - double alpha() const { return m_alpha / 100.0; } - - double min_mass() const - { - double value = double(min_mass_slider->value()); - double max_value = double(min_mass_slider->maximum()); - return value / max_value; - } - - int ignore_edges() const - { - return discard_spinbox->value(); - } - -protected slots: - // drag and drop - void dropEvent(QDropEvent *event); - void closeEvent(QCloseEvent *event); - void dragEnterEvent(QDragEnterEvent *event); - - // recent files - void openRecentFile_aux(); - void updateRecentFileActions(); - void addToRecentFiles(QString fileName); - void addRecentFiles(QMenu* menu, QAction* insertBefore = 0); - unsigned int maxNumberOfRecentFiles() const {return maxNumRecentFiles;} - - // io - void open(const QString& file); - void save(const QString& file); - -public slots: - // render - void update(); - void on_actionRecenter_triggered(); + MainWindow(); + ~MainWindow(); - // io - void on_actionClear_triggered(); - void on_actionLoadPoints_triggered(); - void on_actionSave_triggered(); - void on_actionInsertPoint_toggled(); - void on_actionSnapshot_triggered(); - void on_actionInvert_mass_triggered(); - void on_actionClamp_mass_triggered(); - void on_actionSubdivide_triggered(); - void on_actionDecimate_triggered(); - void on_actionKeep_one_point_out_of_n_triggered(); - - // data - void on_actionStar_triggered(); - void on_actionBox_triggered(); - void on_actionLine_triggered(); - void on_actionStair_triggered(); - void on_actionBoxes_triggered(); - void on_actionNoise_triggered(); - void on_actionSpiral_triggered(); - void on_actionCircle_triggered(); - void on_actionSkyline_triggered(); - void on_actionHalf_circle_triggered(); - void on_actionAdd_outliers_triggered(); - void on_actionParallel_lines_triggered(); - void on_actionBox_with_boundaries_triggered(); - void on_actionBox_with_missing_corners_triggered(); - void on_actionIncreasingly_sharp_angles_triggered(); - void on_actionWidely_variable_sampling_triggered(); - - // reconstruction - void on_actionSet_MChoice_toggled(); - void on_actionSet_parameters_triggered(); - void on_actionReconstruction_init_triggered(); - void on_actionReconstruction_one_step_triggered(); - void on_actionReconstruction_10_steps_triggered(); - void on_actionReconstruction_100_steps_triggered(); - void on_actionReconstruction_1000_steps_triggered(); - void on_actionReconstruction_until_triggered(); - void on_actionRelocate_vertices_triggered(); - void on_actionPrint_Stats_triggered(); - - // view - void on_actionView_points_toggled(); - void on_actionView_vertices_toggled(); - void on_actionView_edges_toggled(); - void on_actionView_ghost_toggled(); - void on_actionView_edge_cost_toggled(); - void on_actionView_edge_priority_toggled(); - void on_actionView_incolors_toggled(); - void on_actionView_relevance_toggled(); + // Parameters + void set_scene_parameters(); - void on_actionView_bins_toggled(); - void on_actionView_foot_points_toggled(); - void on_actionView_relocation_toggled(); - void on_actionView_tolerance_toggled(); - - void on_actionActivate_simulation_toggled(); - void on_actionView_simulation_triggered(); - -signals: - void openRecentFile(QString filename); + double percentage() const { return m_percent / 100.0; } + + double norm_tol() const { return m_norm_tol / 100.0; } + + double tang_tol() const { return m_tang_tol / 100.0; } + + double alpha() const { return m_alpha / 100.0; } + + double min_mass() const + { + double value = double(min_mass_slider->value()); + double max_value = double(min_mass_slider->maximum()); + return value / max_value; + } + + int ignore_edges() const + { + return discard_spinbox->value(); + } + + protected slots: + // drag and drop + void dropEvent(QDropEvent *event); + void closeEvent(QCloseEvent *event); + void dragEnterEvent(QDragEnterEvent *event); + + // recent files + void openRecentFile_aux(); + void updateRecentFileActions(); + void addToRecentFiles(QString fileName); + void addRecentFiles(QMenu* menu, QAction* insertBefore = 0); + unsigned int maxNumberOfRecentFiles() const {return maxNumRecentFiles;} + + // io + void open(const QString& file); + void save(const QString& file); + + public slots: + // render + void update(); + void on_actionRecenter_triggered(); + + // io + void on_actionClear_triggered(); + void on_actionLoadPoints_triggered(); + void on_actionSave_triggered(); + void on_actionInsertPoint_toggled(); + void on_actionSnapshot_triggered(); + void on_actionInvert_mass_triggered(); + void on_actionClamp_mass_triggered(); + void on_actionSubdivide_triggered(); + void on_actionDecimate_triggered(); + void on_actionKeep_one_point_out_of_n_triggered(); + + // data + void on_actionStar_triggered(); + void on_actionBox_triggered(); + void on_actionLine_triggered(); + void on_actionStair_triggered(); + void on_actionBoxes_triggered(); + void on_actionNoise_triggered(); + void on_actionSpiral_triggered(); + void on_actionCircle_triggered(); + void on_actionSkyline_triggered(); + void on_actionHalf_circle_triggered(); + void on_actionAdd_outliers_triggered(); + void on_actionParallel_lines_triggered(); + void on_actionBox_with_boundaries_triggered(); + void on_actionBox_with_missing_corners_triggered(); + void on_actionIncreasingly_sharp_angles_triggered(); + void on_actionWidely_variable_sampling_triggered(); + + // reconstruction + void on_actionSet_MChoice_toggled(); + void on_actionSet_parameters_triggered(); + void on_actionReconstruction_init_triggered(); + void on_actionReconstruction_one_step_triggered(); + void on_actionReconstruction_10_steps_triggered(); + void on_actionReconstruction_100_steps_triggered(); + void on_actionReconstruction_1000_steps_triggered(); + void on_actionReconstruction_until_triggered(); + void on_actionRelocate_vertices_triggered(); + void on_actionPrint_Stats_triggered(); + + // view + void on_actionView_points_toggled(); + void on_actionView_vertices_toggled(); + void on_actionView_edges_toggled(); + void on_actionView_ghost_toggled(); + void on_actionView_edge_cost_toggled(); + void on_actionView_edge_priority_toggled(); + void on_actionView_incolors_toggled(); + void on_actionView_relevance_toggled(); + + void on_actionView_bins_toggled(); + void on_actionView_foot_points_toggled(); + void on_actionView_relocation_toggled(); + void on_actionView_tolerance_toggled(); + + void on_actionActivate_simulation_toggled(); + void on_actionView_simulation_triggered(); + + signals: + void openRecentFile(QString filename); }; #endif // WINDOW_ diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp index 240fc231757..42681a5358d 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_mass_example.cpp @@ -25,49 +25,49 @@ typedef CGAL::First_of_pair_property_map Point_property_map; typedef CGAL::Second_of_pair_property_map Mass_property_map; typedef CGAL::Reconstruction_simplification_2< - K, Point_property_map, Mass_property_map> Rs_2; + K, Point_property_map, Mass_property_map> Rs_2; void load_xym_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(filename.c_str()); - - Point point; - FT mass; + std::ifstream ifs(filename.c_str()); - while (ifs >> point && ifs >> mass) - points.push_back(std::make_pair(point, mass)); - - ifs.close(); + Point point; + FT mass; + + while (ifs >> point && ifs >> mass) + points.push_back(std::make_pair(point, mass)); + + ifs.close(); } int main () { PointMassList points; - + load_xym_file("data/stair.xym", points); - + Point_property_map point_pmap; Mass_property_map mass_pmap; - + Rs_2 rs2(points, point_pmap, mass_pmap); - + rs2.run(100); // 100 steps - + std::vector isolated_vertices; std::vector edges; - + rs2.list_output (std::back_inserter(isolated_vertices), std::back_inserter(edges)); - + std::cerr << "Isolated vertices" << std::endl; std::vector::iterator vit; for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++) - std::cout << *vit << std::endl; - + std::cout << *vit << std::endl; + std::cerr << "Edges" << std::endl; std::vector::iterator eit; for (eit = edges.begin(); eit != edges.end(); eit++) - std::cout << *eit << std::endl; - + std::cout << *eit << std::endl; + return 0; } diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp index 537c28b4c96..3e6b03d9161 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_output_example.cpp @@ -22,7 +22,7 @@ void load_xy_file(const std::string& filename, std::vector& points) Point point; while (ifs >> point) points.push_back(point); - + ifs.close(); } @@ -30,17 +30,17 @@ void load_xy_file(const std::string& filename, std::vector& points) void list_output(Rs_2& rs2) { std::cout << "(-------------List output---------- )" << std::endl; - + std::vector isolated_points; std::vector segments; - + rs2.list_output ( - std::back_inserter(isolated_points), std::back_inserter(segments)); - + std::back_inserter(isolated_points), std::back_inserter(segments)); + std::vector::iterator pit; for (pit = isolated_points.begin(); pit != isolated_points.end(); pit++) std::cout << *pit << std::endl; - + std::vector::iterator sit; for (sit = segments.begin(); sit != segments.end(); sit++) std::cout << *sit << std::endl; @@ -50,22 +50,22 @@ void list_output(Rs_2& rs2) void indexed_output(Rs_2& rs2) { std::cout << "(-------------Off output---------- )" << std::endl; - + std::vector points; std::vector isolated_vertices; std::vector > edges; rs2.indexed_output( - std::back_inserter(points), - std::back_inserter(isolated_vertices), - std::back_inserter(edges)); - + std::back_inserter(points), + std::back_inserter(isolated_vertices), + std::back_inserter(edges)); + std::cout << "OFF " << points.size() << " 0 " << edges.size() << std::endl; // points std::vector::iterator pit; for (pit = points.begin(); pit != points.end(); pit++) - std::cout << *pit << std::endl; + std::cout << *pit << std::endl; // isolated vertices std::vector::iterator vit; @@ -81,9 +81,9 @@ void indexed_output(Rs_2& rs2) int main () { std::vector points; - + load_xy_file("data/stair-noise00.xy", points); - + Rs_2 rs2(points); rs2.run(100); // 100 steps diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp index 6dc758cdb6a..cef12aa47ed 100644 --- a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp +++ b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/rs2_simplest_example.cpp @@ -26,7 +26,7 @@ void load_xy_file(const std::string& fileName, std::vector& points) Point point; while (ifs >> point) points.push_back(point); - + ifs.close(); } @@ -34,10 +34,10 @@ int main () { std::vector points; load_xy_file("data/stair.xy", points); - + Rs_2 rs2(points); rs2.run(100); // 100 steps - + return 0; } diff --git a/Reconstruction_simplification_2/include/CGAL/Cost.h b/Reconstruction_simplification_2/include/CGAL/Cost.h index 980bd102c79..7878764fd0c 100644 --- a/Reconstruction_simplification_2/include/CGAL/Cost.h +++ b/Reconstruction_simplification_2/include/CGAL/Cost.h @@ -25,82 +25,82 @@ template class Cost { private: - FT m_norm; - FT m_tang; - FT m_max_norm; - FT m_max_tang; - + FT m_norm; + FT m_tang; + FT m_max_norm; + FT m_max_tang; + public: - Cost() - { - m_norm = 0.0; - m_tang = 0.0; - m_max_norm = 0.0; - m_max_tang = 0.0; - } - - Cost(const FT norm, const FT tang) - { - m_norm = norm; - m_tang = tang; - m_max_norm = norm; - m_max_tang = tang; - } - - ~Cost() { } - - Cost& operator = (const Cost& cost) - { - m_norm = cost.norm(); - m_tang = cost.tang(); - m_max_norm = cost.max_norm(); - m_max_tang = cost.max_tang(); - return *this; - } - - const FT norm() const { return m_norm; } - - const FT tang() const { return m_tang; } + Cost() +{ + m_norm = 0.0; + m_tang = 0.0; + m_max_norm = 0.0; + m_max_tang = 0.0; +} - const FT max_norm() const { return m_max_norm; } + Cost(const FT norm, const FT tang) + { + m_norm = norm; + m_tang = tang; + m_max_norm = norm; + m_max_tang = tang; + } - const FT max_tang() const { return m_max_tang; } + ~Cost() { } - FT finalize(const FT alpha = 0.5) const - { - return 2.0 * (alpha * m_norm + (1.0 - alpha) * m_tang); - } - - void divide(const FT ratio) - { - assert(ratio != 0.0); - m_norm /= ratio; - m_tang /= ratio; - } - - void add(const Cost& cost, const FT mass = 1.0) - { - m_norm += mass * cost.norm(); - m_tang += mass * cost.tang(); - } - - void reset_max() - { - m_max_norm = 0.0; - m_max_tang = 0.0; - } + Cost& operator = (const Cost& cost) + { + m_norm = cost.norm(); + m_tang = cost.tang(); + m_max_norm = cost.max_norm(); + m_max_tang = cost.max_tang(); + return *this; + } - void update_max(const Cost& cost) - { - m_max_norm = (std::max)(m_max_norm, cost.max_norm()); - m_max_tang = (std::max)(m_max_tang, cost.max_tang()); - } + const FT norm() const { return m_norm; } - void compute_max(const FT norm, const FT tang) - { - m_max_norm = (std::max)(m_max_norm, norm); - m_max_tang = (std::max)(m_max_tang, tang); - } + const FT tang() const { return m_tang; } + + const FT max_norm() const { return m_max_norm; } + + const FT max_tang() const { return m_max_tang; } + + FT finalize(const FT alpha = 0.5) const + { + return 2.0 * (alpha * m_norm + (1.0 - alpha) * m_tang); + } + + void divide(const FT ratio) + { + assert(ratio != 0.0); + m_norm /= ratio; + m_tang /= ratio; + } + + void add(const Cost& cost, const FT mass = 1.0) + { + m_norm += mass * cost.norm(); + m_tang += mass * cost.tang(); + } + + void reset_max() + { + m_max_norm = 0.0; + m_max_tang = 0.0; + } + + void update_max(const Cost& cost) + { + m_max_norm = (std::max)(m_max_norm, cost.max_norm()); + m_max_tang = (std::max)(m_max_tang, cost.max_tang()); + } + + void compute_max(const FT norm, const FT tang) + { + m_max_norm = (std::max)(m_max_norm, norm); + m_max_tang = (std::max)(m_max_tang, tang); + } }; #endif diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h index 10951df8121..2164da96f0b 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_edge_2.h @@ -21,120 +21,122 @@ #ifndef RECONSTRUCTION_EDGE_2_H_ #define RECONSTRUCTION_EDGE_2_H_ -template -class Reconstruction_edge_2 -{ +template +class Reconstruction_edge_2 { protected: - Edge m_edge; - Vertex_handle m_source; - Vertex_handle m_target; + Edge m_edge; + Vertex_handle m_source; + Vertex_handle m_target; - FT m_before_cost; - FT m_after_cost; + FT m_before_cost; + FT m_after_cost; public: - Reconstruction_edge_2() - { - m_edge = Edge(Face_handle(), 0); - m_source = Vertex_handle(); - m_target = Vertex_handle(); + Reconstruction_edge_2() { + m_edge = Edge(Face_handle(), 0); + m_source = Vertex_handle(); + m_target = Vertex_handle(); - m_before_cost = 0.0; - m_after_cost = 0.0; - } + m_before_cost = 0.0; + m_after_cost = 0.0; + } - Reconstruction_edge_2(const Reconstruction_edge_2& pedge) - { - m_edge = pedge.edge(); - m_source = pedge.source(); - m_target = pedge.target(); + Reconstruction_edge_2(const Reconstruction_edge_2& pedge) { + m_edge = pedge.edge(); + m_source = pedge.source(); + m_target = pedge.target(); - m_before_cost = pedge.before(); - m_after_cost = pedge.after(); - } + m_before_cost = pedge.before(); + m_after_cost = pedge.after(); + } - Reconstruction_edge_2(const Edge& edge, - const FT before, - const FT after) - { - m_edge = edge; - get_vertices(); + Reconstruction_edge_2(const Edge& edge, const FT before, const FT after) { + m_edge = edge; + get_vertices(); - m_before_cost = before; - m_after_cost = after; - } + m_before_cost = before; + m_after_cost = after; + } - Reconstruction_edge_2(const Edge& edge, - const FT priority = 0.0) - { - m_edge = edge; - get_vertices(); + Reconstruction_edge_2(const Edge& edge, const FT priority = 0.0) { + m_edge = edge; + get_vertices(); - m_before_cost = 0.0; - m_after_cost = priority; - } + m_before_cost = 0.0; + m_after_cost = priority; + } - Reconstruction_edge_2(Vertex_handle source, Vertex_handle target) - { - m_edge = Edge(Face_handle(), 0); - m_source = source; - m_target = target; + Reconstruction_edge_2(Vertex_handle source, Vertex_handle target) { + m_edge = Edge(Face_handle(), 0); + m_source = source; + m_target = target; - m_before_cost = 0.0; - m_after_cost = 0.0; - } + m_before_cost = 0.0; + m_after_cost = 0.0; + } - virtual ~Reconstruction_edge_2() { } + virtual ~Reconstruction_edge_2() { + } - Reconstruction_edge_2& operator = (const Reconstruction_edge_2& pedge) - { - m_edge = pedge.edge(); - m_source = pedge.source(); - m_target = pedge.target(); + Reconstruction_edge_2& operator =(const Reconstruction_edge_2& pedge) { + m_edge = pedge.edge(); + m_source = pedge.source(); + m_target = pedge.target(); - m_before_cost = pedge.before(); - m_after_cost = pedge.after(); + m_before_cost = pedge.before(); + m_after_cost = pedge.after(); - return *this; - } + return *this; + } - bool operator == (const Reconstruction_edge_2& pedge) const - { - return (m_source->id() == pedge.source()->id() && - m_target->id() == pedge.target()->id()); - } + bool operator ==(const Reconstruction_edge_2& pedge) const { + return (m_source->id() == pedge.source()->id() + && m_target->id() == pedge.target()->id()); + } - bool operator < (const Reconstruction_edge_2& pedge) const - { - if (m_source->id() < pedge.source()->id()) return true; - if (m_source->id() > pedge.source()->id()) return false; + bool operator <(const Reconstruction_edge_2& pedge) const { + if (m_source->id() < pedge.source()->id()) + return true; + if (m_source->id() > pedge.source()->id()) + return false; - if (m_target->id() < pedge.target()->id()) return true; - return false; - } + if (m_target->id() < pedge.target()->id()) + return true; + return false; + } - const Edge& edge() const { return m_edge; } + const Edge& edge() const { + return m_edge; + } - const Vertex_handle& source() const { return m_source; } + const Vertex_handle& source() const { + return m_source; + } - const Vertex_handle& target() const { return m_target; } + const Vertex_handle& target() const { + return m_target; + } - const FT before() const { return m_before_cost; } + const FT before() const { + return m_before_cost; + } - const FT after() const { return m_after_cost; } + const FT after() const { + return m_after_cost; + } - const FT priority() const { return after() - before(); } + const FT priority() const { + return after() - before(); + } protected: - void get_vertices() - { - int index = m_edge.second; - m_source = m_edge.first->vertex( (index+1)%3 ); - m_target = m_edge.first->vertex( (index+2)%3 ); - } + void get_vertices() { + int index = m_edge.second; + m_source = m_edge.first->vertex((index + 1) % 3); + m_target = m_edge.first->vertex((index + 2) % 3); + } }; #endif - /* RECONSTRUCTION_EDGE_2_H_ */ diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h index b7a30193a35..3dcd99e9884 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_face_base_2.h @@ -45,191 +45,191 @@ class Reconstruction_face_base_2 : public Fb public: - typedef Fb Base; - typedef typename Base::Vertex_handle Vertex_handle; - typedef typename Base::Face_handle Face_handle; + typedef Fb Base; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Face_handle Face_handle; - template < typename TDS2 > - struct Rebind_TDS { - typedef typename Base::template Rebind_TDS::Other Fb2; - typedef Reconstruction_face_base_2 Other; - }; + template < typename TDS2 > + struct Rebind_TDS { + typedef typename Base::template Rebind_TDS::Other Fb2; + typedef Reconstruction_face_base_2 Other; + }; - typedef typename Kernel::FT FT; - typedef Cost Cost_; - typedef Sample Sample_; - typedef std::vector Sample_vector; + typedef typename Kernel::FT FT; + typedef Cost Cost_; + typedef Sample Sample_; + typedef std::vector Sample_vector; private: - Sample_vector m_samples[3]; - FT m_mass[3]; + Sample_vector m_samples[3]; + FT m_mass[3]; - Cost_ m_cost0[3]; - Cost_ m_cost1[3]; - int m_plan[3]; + Cost_ m_cost0[3]; + Cost_ m_cost1[3]; + int m_plan[3]; - FT m_relevance[3]; + FT m_relevance[3]; public: - Reconstruction_face_base_2() - : Base() - { - init(); - } + Reconstruction_face_base_2() +: Base() +{ + init(); +} - Reconstruction_face_base_2(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3) - : Base(v1,v2,v3) - { - init(); - } + Reconstruction_face_base_2(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3) + : Base(v1,v2,v3) + { + init(); + } - Reconstruction_face_base_2(Vertex_handle v1, - Vertex_handle v2, - Vertex_handle v3, - Face_handle f1, - Face_handle f2, - Face_handle f3) - : Base(v1,v2,v3,f1,f2,f3) - { - init(); - } + Reconstruction_face_base_2(Vertex_handle v1, + Vertex_handle v2, + Vertex_handle v3, + Face_handle f1, + Face_handle f2, + Face_handle f3) + : Base(v1,v2,v3,f1,f2,f3) + { + init(); + } - Reconstruction_face_base_2(Face_handle f) - : Base(f) - { - m_samples[0] = f->samples(0); - m_samples[1] = f->samples(1); - m_samples[2] = f->samples(2); + Reconstruction_face_base_2(Face_handle f) + : Base(f) + { + m_samples[0] = f->samples(0); + m_samples[1] = f->samples(1); + m_samples[2] = f->samples(2); - m_mass[0] = f->mass(0); - m_mass[1] = f->mass(1); - m_mass[2] = f->mass(2); + m_mass[0] = f->mass(0); + m_mass[1] = f->mass(1); + m_mass[2] = f->mass(2); - m_cost0[0] = f->vertex_cost(0); - m_cost0[1] = f->vertex_cost(1); - m_cost0[2] = f->vertex_cost(2); + m_cost0[0] = f->vertex_cost(0); + m_cost0[1] = f->vertex_cost(1); + m_cost0[2] = f->vertex_cost(2); - m_cost1[0] = f->edge_cost(0); - m_cost1[1] = f->edge_cost(1); - m_cost1[2] = f->edge_cost(2); + m_cost1[0] = f->edge_cost(0); + m_cost1[1] = f->edge_cost(1); + m_cost1[2] = f->edge_cost(2); - m_plan[0] = f->plan(0); - m_plan[1] = f->plan(1); - m_plan[2] = f->plan(2); + m_plan[0] = f->plan(0); + m_plan[1] = f->plan(1); + m_plan[2] = f->plan(2); - m_relevance[0] = f->relevance(0); - m_relevance[1] = f->relevance(1); - m_relevance[2] = f->relevance(2); - } + m_relevance[0] = f->relevance(0); + m_relevance[1] = f->relevance(1); + m_relevance[2] = f->relevance(2); + } - virtual ~Reconstruction_face_base_2() - { - clean_all_samples(); - } + virtual ~Reconstruction_face_base_2() + { + clean_all_samples(); + } - void init() - { - m_mass[0] = 0.0; - m_mass[1] = 0.0; - m_mass[2] = 0.0; + void init() + { + m_mass[0] = 0.0; + m_mass[1] = 0.0; + m_mass[2] = 0.0; - m_cost0[0] = Cost_(); - m_cost0[1] = Cost_(); - m_cost0[2] = Cost_(); + m_cost0[0] = Cost_(); + m_cost0[1] = Cost_(); + m_cost0[2] = Cost_(); - m_cost1[0] = Cost_(); - m_cost1[1] = Cost_(); - m_cost1[2] = Cost_(); + m_cost1[0] = Cost_(); + m_cost1[1] = Cost_(); + m_cost1[2] = Cost_(); - m_plan[0] = 0; - m_plan[1] = 0; - m_plan[2] = 0; + m_plan[0] = 0; + m_plan[1] = 0; + m_plan[2] = 0; - m_relevance[0] = 0; - m_relevance[1] = 0; - m_relevance[2] = 0; + m_relevance[0] = 0; + m_relevance[1] = 0; + m_relevance[2] = 0; - } + } - int plan(int edge) const { return m_plan[edge]; } - int& plan(int edge) { return m_plan[edge]; } + int plan(int edge) const { return m_plan[edge]; } + int& plan(int edge) { return m_plan[edge]; } - const FT& mass(int edge) const { return m_mass[edge]; } - FT& mass(int edge) { return m_mass[edge]; } + const FT& mass(int edge) const { return m_mass[edge]; } + FT& mass(int edge) { return m_mass[edge]; } - const Cost_& vertex_cost(int edge) const { return m_cost0[edge]; } - Cost_& vertex_cost(int edge) { return m_cost0[edge]; } + const Cost_& vertex_cost(int edge) const { return m_cost0[edge]; } + Cost_& vertex_cost(int edge) { return m_cost0[edge]; } - const Cost_& edge_cost(int edge) const { return m_cost1[edge]; } - Cost_& edge_cost(int edge) { return m_cost1[edge]; } + const Cost_& edge_cost(int edge) const { return m_cost1[edge]; } + Cost_& edge_cost(int edge) { return m_cost1[edge]; } - const FT& relevance(int edge) const { return m_relevance[edge]; } - FT& relevance(int edge) { return m_relevance[edge]; } + const FT& relevance(int edge) const { return m_relevance[edge]; } + FT& relevance(int edge) { return m_relevance[edge]; } - const Cost_& cost(int edge) const - { - if (plan(edge) == 0) return vertex_cost(edge); - return edge_cost(edge); - } + const Cost_& cost(int edge) const + { + if (plan(edge) == 0) return vertex_cost(edge); + return edge_cost(edge); + } - bool ghost(int edge) const - { - if (mass(edge) == 0.0) return true; - if (plan(edge) == 0) return true; - return false; - } + bool ghost(int edge) const + { + if (mass(edge) == 0.0) return true; + if (plan(edge) == 0) return true; + return false; + } - const Sample_vector& samples(int edge) const { return m_samples[edge]; } - Sample_vector& samples(int edge) { return m_samples[edge]; } + const Sample_vector& samples(int edge) const { return m_samples[edge]; } + Sample_vector& samples(int edge) { return m_samples[edge]; } - void add_sample(int edge, Sample_* sample) - { - m_samples[edge].push_back(sample); - } + void add_sample(int edge, Sample_* sample) + { + m_samples[edge].push_back(sample); + } - void clean_samples(int edge) - { - m_samples[edge].clear(); - } + void clean_samples(int edge) + { + m_samples[edge].clear(); + } - void clean_all_samples() - { - for (int i = 0; i < 3; ++i) - clean_samples(i); - } + void clean_all_samples() + { + for (int i = 0; i < 3; ++i) + clean_samples(i); + } }; //---------------STRUCT LESS FACE_HANDLE--------------------- template struct less_Face_handle { - void get_vertices_id(const T& face, int& a, int& b, int& c) const - { - a = face->vertex(0)->id(); - b = face->vertex(1)->id(); - c = face->vertex(2)->id(); - } + void get_vertices_id(const T& face, int& a, int& b, int& c) const + { + a = face->vertex(0)->id(); + b = face->vertex(1)->id(); + c = face->vertex(2)->id(); + } - bool operator() (const T& a, const T& b) const - { - int a0, a1, a2; - get_vertices_id(a, a0, a1, a2); + bool operator() (const T& a, const T& b) const + { + int a0, a1, a2; + get_vertices_id(a, a0, a1, a2); - int b0, b1, b2; - get_vertices_id(b, b0, b1, b2); + int b0, b1, b2; + get_vertices_id(b, b0, b1, b2); - if (a0 < b0) return true; - if (a0 > b0) return false; + if (a0 < b0) return true; + if (a0 > b0) return false; - if (a1 < b1) return true; - if (a1 > b1) return false; + if (a1 < b1) return true; + if (a1 > b1) return false; - if (a2 < b2) return true; - return false; - } + if (a2 < b2) return true; + return false; + } }; @@ -237,29 +237,29 @@ struct less_Face_handle template struct less_Edge { - void get_vertices_id(const T& a, int& i, int& j) const - { - i = a.first->vertex( (a.second+1)%3 )->id(); - j = a.first->vertex( (a.second+2)%3 )->id(); - if (i > j) std::swap(i, j); - } + void get_vertices_id(const T& a, int& i, int& j) const + { + i = a.first->vertex( (a.second+1)%3 )->id(); + j = a.first->vertex( (a.second+2)%3 )->id(); + if (i > j) std::swap(i, j); + } - bool operator() (const T& a, const T& b) const - { - int a0, a1; - get_vertices_id(a, a0, a1); + bool operator() (const T& a, const T& b) const + { + int a0, a1; + get_vertices_id(a, a0, a1); - int b0, b1; - get_vertices_id(b, b0, b1); + int b0, b1; + get_vertices_id(b, b0, b1); - if (a0 < b0) return true; - if (a0 > b0) return false; - if (a1 < b1) return true; - return false; - } + if (a0 < b0) return true; + if (a0 > b0) return false; + if (a1 < b1) return true; + return false; + } - /// \endcond + /// \endcond }; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index ab0b50b225b..180a4ebc810 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -80,115 +80,115 @@ Furthermore, we can relocate the vertices by calling `relocate_points()`. */ template, - class MassMap = boost::static_property_map > +class PointMap = boost::typed_identity_property_map , +class MassMap = boost::static_property_map > class Reconstruction_simplification_2 { public: - /// \name Types - /// @{ - /*! + /// \name Types + /// @{ + /*! Number type. - */ - typedef typename Gt::FT FT; + */ + typedef typename Gt::FT FT; - /*! + /*! Point type. - */ - typedef typename Gt::Point_2 Point; + */ + typedef typename Gt::Point_2 Point; - /// \cond SKIP_IN_MANUAL - /*! + /// \cond SKIP_IN_MANUAL + /*! Vector type. - */ - typedef typename Gt::Vector_2 Vector; + */ + typedef typename Gt::Vector_2 Vector; - typedef typename std::pair PointMassPair; - typedef typename std::vector PointMassList; + typedef typename std::pair PointMassPair; + typedef typename std::vector PointMassList; - /*! + /*! The Output simplex. - */ - typedef Reconstruction_triangulation_2 Triangulation; + */ + typedef Reconstruction_triangulation_2 Triangulation; - typedef typename Triangulation::Vertex Vertex; - typedef typename Triangulation::Vertex_handle Vertex_handle; - typedef typename Triangulation::Vertex_iterator Vertex_iterator; - typedef typename Triangulation::Vertex_circulator Vertex_circulator; - typedef typename Triangulation::Finite_vertices_iterator - Finite_vertices_iterator; + typedef typename Triangulation::Vertex Vertex; + typedef typename Triangulation::Vertex_handle Vertex_handle; + typedef typename Triangulation::Vertex_iterator Vertex_iterator; + typedef typename Triangulation::Vertex_circulator Vertex_circulator; + typedef typename Triangulation::Finite_vertices_iterator + Finite_vertices_iterator; - typedef typename Triangulation::Edge Edge; - typedef typename Triangulation::Edge_iterator Edge_iterator; - typedef typename Triangulation::Edge_circulator Edge_circulator; - typedef typename Triangulation::Finite_edges_iterator Finite_edges_iterator; + typedef typename Triangulation::Edge Edge; + typedef typename Triangulation::Edge_iterator Edge_iterator; + typedef typename Triangulation::Edge_circulator Edge_circulator; + typedef typename Triangulation::Finite_edges_iterator Finite_edges_iterator; - typedef typename Triangulation::Face Face; - typedef typename Triangulation::Face_handle Face_handle; - typedef typename Triangulation::Face_iterator Face_iterator; - typedef typename Triangulation::Face_circulator Face_circulator; - typedef typename Triangulation::Finite_faces_iterator Finite_faces_iterator; + typedef typename Triangulation::Face Face; + typedef typename Triangulation::Face_handle Face_handle; + typedef typename Triangulation::Face_iterator Face_iterator; + typedef typename Triangulation::Face_circulator Face_circulator; + typedef typename Triangulation::Finite_faces_iterator Finite_faces_iterator; - typedef typename Triangulation::Vertex_handle_map Vertex_handle_map; - typedef typename Triangulation::Face_handle_map Face_handle_map; + typedef typename Triangulation::Vertex_handle_map Vertex_handle_map; + typedef typename Triangulation::Face_handle_map Face_handle_map; - typedef typename Triangulation::Vertex_handle_set Vertex_handle_set; - typedef typename Triangulation::Edge_set Edge_set; + typedef typename Triangulation::Vertex_handle_set Vertex_handle_set; + typedef typename Triangulation::Edge_set Edge_set; - typedef typename Triangulation::Edge_vector Edge_vector; - typedef std::list Edge_list; + typedef typename Triangulation::Edge_vector Edge_vector; + typedef std::list Edge_list; - typedef typename Triangulation::Cost_ Cost_; - typedef typename Triangulation::Sample_ Sample_; - typedef typename Triangulation::Sample_vector Sample_vector; - typedef typename Triangulation::Sample_vector_const_iterator - Sample_vector_const_iterator; + typedef typename Triangulation::Cost_ Cost_; + typedef typename Triangulation::Sample_ Sample_; + typedef typename Triangulation::Sample_vector Sample_vector; + typedef typename Triangulation::Sample_vector_const_iterator + Sample_vector_const_iterator; - typedef typename Triangulation::Point_vector Point_vector; - typedef typename Triangulation::Point_vector_const_iterator - Point_vector_const_iterator; + typedef typename Triangulation::Point_vector Point_vector; + typedef typename Triangulation::Point_vector_const_iterator + Point_vector_const_iterator; - typedef typename Triangulation::PSample PSample; - typedef typename Triangulation::SQueue SQueue; + typedef typename Triangulation::PSample PSample; + typedef typename Triangulation::SQueue SQueue; - typedef typename Triangulation::Rec_edge_2 Rec_edge_2; + typedef typename Triangulation::Rec_edge_2 Rec_edge_2; - typedef typename Triangulation::MultiIndex MultiIndex; + typedef typename Triangulation::MultiIndex MultiIndex; - /// @} + /// @} protected: - Triangulation m_dt; - MultiIndex m_mindex; - int m_ignore; - int m_verbose; - std::size_t m_mchoice; // # Edges - bool m_use_flip; - double m_alpha; // [0, 1] - double m_norm_tol; // [0,BBOX] - double m_tang_tol; // [0,BBOX] - double m_ghost; // ghost vs solid - unsigned int m_relocation; // # relocations + Triangulation m_dt; + MultiIndex m_mindex; + int m_ignore; + int m_verbose; + std::size_t m_mchoice; // # Edges + bool m_use_flip; + double m_alpha; // [0, 1] + double m_norm_tol; // [0,BBOX] + double m_tang_tol; // [0,BBOX] + double m_ghost; // ghost vs solid + unsigned int m_relocation; // # relocations - // bbox - double m_bbox_x; - double m_bbox_y; - double m_bbox_size; + // bbox + double m_bbox_x; + double m_bbox_y; + double m_bbox_size; - PointMap point_pmap; - MassMap mass_pmap; + PointMap point_pmap; + MassMap mass_pmap; - /// \endcond + /// \endcond - public: +public: - /// \name Initialization - /// @{ + /// \name Initialization + /// @{ - /*! + /*! The constructor of the reconstruction simplification class for a given range of point-mass pairs. which already builds an initial simplicial complex. @@ -205,119 +205,119 @@ protected: \param relocation The number of point relocations that are performed between two edge collapses. \param verbose controls how much console output is produced by the algorithm. The values are 0, 1, or > 1. - */ - template - Reconstruction_simplification_2(const InputRange& input_range, - PointMap point_map = PointMap(), - MassMap mass_map = MassMap(1), - std::size_t sample_size = 0, - bool use_flip = true, - unsigned int relocation = 0, - int verbose = 0) - : m_verbose(verbose), - m_mchoice(sample_size), - m_use_flip(use_flip), - m_relocation(relocation), - point_pmap(point_map), - mass_pmap(mass_map) - { - m_alpha = 0.5; - m_norm_tol = 1.0; - m_tang_tol = 1.0; - m_ghost = 1.0; + */ + template + Reconstruction_simplification_2(const InputRange& input_range, + PointMap point_map = PointMap(), + MassMap mass_map = MassMap(1), + std::size_t sample_size = 0, + bool use_flip = true, + unsigned int relocation = 0, + int verbose = 0) + : m_verbose(verbose), + m_mchoice(sample_size), + m_use_flip(use_flip), + m_relocation(relocation), + point_pmap(point_map), + mass_pmap(mass_map) + { + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; - m_bbox_x = 0.0; - m_bbox_y = 0.0; - m_bbox_size = 1.0; + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; - m_ignore = 0; - initialize(input_range.begin(), input_range.end()); - } + m_ignore = 0; + initialize(input_range.begin(), input_range.end()); + } - /// @} + /// @} - /// \name Settting Parameters + /// \name Settting Parameters /// @{ - /*! + /*! If `sample_size == 0`, the simplification is performed using an exhaustive priority queue. If `sample_size` is stricly positive the simplification is performed using a multiple choice approach, ie, a best-choice selection in a random sample of edge collapse operators, of size `sample_size`. A typical value for the sample size is 15, but this value must be enlarged when targeting a very coarse simplification. \param sample_size If `sample_size != 0`, the size of the random sample replaces the priority queue. - */ + */ void set_random_sample_size(std::size_t sample_size) { - m_mchoice = sample_size; - } + m_mchoice = sample_size; + } - /*! + /*! Determines how much console output the algorithm generates. If set to a value larger than 0 details about the reconstruction process are written to `std::err`. \param verbose The verbosity level. - */ + */ void set_verbose(int verbose) { - m_verbose = verbose; - } + m_verbose = verbose; + } - /// \cond SKIP_IN_MANUAL - void set_alpha(const double alpha) { - m_alpha = alpha; - } - /// \endcond + /// \cond SKIP_IN_MANUAL + void set_alpha(const double alpha) { + m_alpha = alpha; + } + /// \endcond - /*! + /*! The use_flip parameter determines whether the edge flipping procedure is used for the half-edge collapse. - */ - void set_use_flip(const bool use_flip) { - m_use_flip = use_flip; - } + */ + void set_use_flip(const bool use_flip) { + m_use_flip = use_flip; + } - /// \cond SKIP_IN_MANUAL - void set_norm_tol(const double norm_tol) { - m_norm_tol = norm_tol; - } + /// \cond SKIP_IN_MANUAL + void set_norm_tol(const double norm_tol) { + m_norm_tol = norm_tol; + } - double get_norm_tol() const { - return m_norm_tol; - } + double get_norm_tol() const { + return m_norm_tol; + } - void set_tang_tol(const double tang_tol) { - m_tang_tol = tang_tol; - } + void set_tang_tol(const double tang_tol) { + m_tang_tol = tang_tol; + } - double get_tang_tol() const { - return m_tang_tol; - } - /// \endcond + double get_tang_tol() const { + return m_tang_tol; + } + /// \endcond - /*! + /*! Sets the number of vertex relocations that are performed between two edge collapses. - */ + */ void set_relocation(unsigned int relocation) { - m_relocation = relocation; - } + m_relocation = relocation; + } - /// \cond SKIP_IN_MANUAL - unsigned int get_relocation() const { - return m_relocation; - } - /// \endcond + /// \cond SKIP_IN_MANUAL + unsigned int get_relocation() const { + return m_relocation; + } + /// \endcond - /*! + /*! \param relevance The relevance threshold used for filtering the edges. An edge is relevant from the approximation point of view if it is long, covers a large mass (or equivalently the @@ -327,955 +327,955 @@ protected: |e| denotes its length and cost(e) its transport cost. As the cost is defined by mass time squared distance the relevance is unitless. - + The default value is 0, so that all edges receiving some mass are considered relevant. Setting a large relevance value is used to get robustness to a large amount of outliers. - */ - void set_relevance(const double relevance) { - m_ghost = relevance; - m_dt.ghost_factor() = m_ghost; - } + */ + void set_relevance(const double relevance) { + m_ghost = relevance; + m_dt.ghost_factor() = m_ghost; + } - /// \cond SKIP_IN_MANUAL - double get_ghost() { - return m_ghost; - } + /// \cond SKIP_IN_MANUAL + double get_ghost() { + return m_ghost; + } /// @} - /// \cond SKIP_IN_MANUAL + /// \cond SKIP_IN_MANUAL - Reconstruction_simplification_2() { - initialize_parameters(); - } - - - ~Reconstruction_simplification_2() { - clear(); - } - - void initialize_parameters() { - - - m_verbose = 0; - m_mchoice = 0; - m_use_flip = true; - m_alpha = 0.5; - m_norm_tol = 1.0; - m_tang_tol = 1.0; - m_ghost = 1.0; - m_relocation = 0; - - m_bbox_x = 0.0; - m_bbox_y = 0.0; - m_bbox_size = 1.0; - - m_ignore = 0; - } - - //Function if one wants to create a Reconstruction_simplification_2 - //without yet specifying the input in the constructor. - template - void initialize(InputIterator start_itr, - InputIterator beyond_itr, - PointMap point_map, - MassMap mass_map) { - - point_pmap = point_map; - mass_pmap = mass_map; - - initialize(start_itr, beyond_itr); - - } - - - template - void initialize(InputIterator start, InputIterator beyond) { - - clear(); - - insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); - - init(start, beyond); - - std::vector m_samples; - for (InputIterator it = start; it != beyond; it++) { - #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 - Point point = get(point_pmap, it); - FT mass = get( mass_pmap, it); - #else - Point point = get(point_pmap, *it); - FT mass = get( mass_pmap, *it); - #endif - Sample_* s = new Sample_(point, mass); - m_samples.push_back(s); - } - assign_samples(m_samples.begin(), m_samples.end()); + Reconstruction_simplification_2() { + initialize_parameters(); + } + + + ~Reconstruction_simplification_2() { + clear(); + } + + void initialize_parameters() { + + + m_verbose = 0; + m_mchoice = 0; + m_use_flip = true; + m_alpha = 0.5; + m_norm_tol = 1.0; + m_tang_tol = 1.0; + m_ghost = 1.0; + m_relocation = 0; + + m_bbox_x = 0.0; + m_bbox_y = 0.0; + m_bbox_size = 1.0; + + m_ignore = 0; + } + + //Function if one wants to create a Reconstruction_simplification_2 + //without yet specifying the input in the constructor. + template + void initialize(InputIterator start_itr, + InputIterator beyond_itr, + PointMap point_map, + MassMap mass_map) { + + point_pmap = point_map; + mass_pmap = mass_map; + + initialize(start_itr, beyond_itr); + + } + + + template + void initialize(InputIterator start, InputIterator beyond) { + + clear(); + + insert_loose_bbox(m_bbox_x, m_bbox_y, 2 * m_bbox_size); + + init(start, beyond); + + std::vector m_samples; + for (InputIterator it = start; it != beyond; it++) { +#ifdef CGAL_USE_PROPERTY_MAPS_API_V1 + Point point = get(point_pmap, it); + FT mass = get( mass_pmap, it); +#else + Point point = get(point_pmap, *it); + FT mass = get( mass_pmap, *it); +#endif + Sample_* s = new Sample_(point, mass); + m_samples.push_back(s); } + assign_samples(m_samples.begin(), m_samples.end()); + } - template - Vector random_vec(const double scale) + template + Vector random_vec(const double scale) + { + double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; + return Vector(dx, dy); + } + + void clear() { + // Deallocate samples + for (Vertex_iterator vi = m_dt.vertices_begin(); + vi != m_dt.vertices_end(); ++vi) { - double dx = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; - double dy = -scale + (double(rand()) / double(RAND_MAX)) * 2* scale; - return Vector(dx, dy); + Sample_ *s = vi->get_sample(); + if (s) + delete s; } - void clear() { - // Deallocate samples - for (Vertex_iterator vi = m_dt.vertices_begin(); - vi != m_dt.vertices_end(); ++vi) - { - Sample_ *s = vi->get_sample(); - if (s) - delete s; - } - - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge &edge = *ei; - const Sample_vector& samples = edge.first->samples(edge.second); - Sample_vector::const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) - { - delete *it; - } - } - - m_dt.clear(); - m_mindex.clear(); + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge &edge = *ei; + const Sample_vector& samples = edge.first->samples(edge.second); + Sample_vector::const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) + { + delete *it; + } } - double time_duration(const double init) { - return (clock() - init) / CLOCKS_PER_SEC; - } + m_dt.clear(); + m_mindex.clear(); + } + + double time_duration(const double init) { + return (clock() - init) / CLOCKS_PER_SEC; + } - // INIT // - void insert_loose_bbox(const double x, const double y, const double size) { - double timer = clock(); - std::cerr << yellow << "insert loose bbox" << white << "..."; - - int nb = static_cast(m_dt.number_of_vertices()); - insert_point(Point(x - size, y - size), true, nb++); - insert_point(Point(x - size, y + size), true, nb++); - insert_point(Point(x + size, y + size), true, nb++); - insert_point(Point(x + size, y - size), true, nb++); - - std::cerr << yellow << "done" << white << " (" << nb << " vertices, " - << yellow << time_duration(timer) << white << " s)" - << std::endl; - } - - template // value_type = Point* - void init(Iterator begin, Iterator beyond) { - double timer = clock(); - std::cerr << yellow << "init" << white << "..."; + // INIT // + void insert_loose_bbox(const double x, const double y, const double size) { + double timer = clock(); + std::cerr << yellow << "insert loose bbox" << white << "..."; int nb = static_cast(m_dt.number_of_vertices()); - m_dt.infinite_vertex()->pinned() = true; - for (Iterator it = begin; it != beyond; it++) { - #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 + insert_point(Point(x - size, y - size), true, nb++); + insert_point(Point(x - size, y + size), true, nb++); + insert_point(Point(x + size, y + size), true, nb++); + insert_point(Point(x + size, y - size), true, nb++); + + std::cerr << yellow << "done" << white << " (" << nb << " vertices, " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + template // value_type = Point* + void init(Iterator begin, Iterator beyond) { + double timer = clock(); + std::cerr << yellow << "init" << white << "..."; + + int nb = static_cast(m_dt.number_of_vertices()); + m_dt.infinite_vertex()->pinned() = true; + for (Iterator it = begin; it != beyond; it++) { +#ifdef CGAL_USE_PROPERTY_MAPS_API_V1 Point point = get(point_pmap, it); - #else +#else Point point = get(point_pmap, *it); - #endif - insert_point(point, false, nb++); - } - - std::cerr << yellow << "done" << white << " (" << nb << " vertices, " - << yellow << time_duration(timer) << white << " s)" - << std::endl; +#endif + insert_point(point, false, nb++); } - Vertex_handle insert_point(const Point& point, const bool pinned, - const int id) { - Vertex_handle v = m_dt.insert(point); - v->pinned() = pinned; - v->id() = id; - return v; + std::cerr << yellow << "done" << white << " (" << nb << " vertices, " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } + + Vertex_handle insert_point(const Point& point, const bool pinned, + const int id) { + Vertex_handle v = m_dt.insert(point); + v->pinned() = pinned; + v->id() = id; + return v; + } + + // ASSIGNMENT // + + void cleanup_assignments() { + m_dt.cleanup_assignments(); + } + + template // value_type = Sample_* + void assign_samples(Iterator begin, Iterator end) { + double timer = clock(); + std::cerr << yellow << "assign samples" << white << "..."; + + m_dt.assign_samples(begin, end); + m_dt.reset_all_costs(); + + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } + + void reassign_samples() { + Sample_vector samples; + m_dt.collect_all_samples(samples); + m_dt.cleanup_assignments(); + m_dt.assign_samples(samples.begin(), samples.end()); + m_dt.reset_all_costs(); + } + + void reassign_samples_around_vertex(Vertex_handle vertex) { + Sample_vector samples; + m_dt.collect_samples_from_vertex(vertex, samples, true); + m_dt.assign_samples(samples.begin(), samples.end()); + + Edge_vector hull; + m_dt.get_edges_from_star_minus_link(vertex, hull, true); + update_cost(hull.begin(), hull.end()); + } + + + bool do_collapse(Edge edge) { + bool ok; + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle t = m_dt.target_vertex(edge); + + if (m_verbose > 0) { + std::cerr << std::endl << green << "do collapse " << white << "(" + << s->id() << "->" << t->id() << ") ... " << std::endl; } - // ASSIGNMENT // + Sample_vector samples; + m_dt.collect_samples_from_vertex(s, samples, true); - void cleanup_assignments() { - m_dt.cleanup_assignments(); + Edge_vector hull; + m_dt.get_edges_from_star_minus_link(s, hull, true); + + if (m_mchoice == 0) + remove_stencil_from_pqueue(hull.begin(), hull.end()); + + if (m_use_flip) + ok = m_dt.make_collapsible(edge, hull.begin(), hull.end(), + m_verbose); + + // debug test + ok = m_dt.check_kernel_test(edge); + if (!ok) { + std::cerr << red << "do_collapse: kernel test failed: " << white + << std::endl; + return false; + } + // + + m_dt.collapse(edge, m_verbose); + + m_dt.assign_samples(samples.begin(), samples.end()); + + update_cost(hull.begin(), hull.end()); + + if (m_mchoice == 0) + push_stencil_to_pqueue(hull.begin(), hull.end()); + + for (unsigned int i = 0; i < m_relocation; ++i) { + relocate_one_ring(hull.begin(), hull.end()); } - template // value_type = Sample_* - void assign_samples(Iterator begin, Iterator end) { - double timer = clock(); - std::cerr << yellow << "assign samples" << white << "..."; - - m_dt.assign_samples(begin, end); - m_dt.reset_all_costs(); - - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; + if (m_verbose > 0) { + std::cerr << green << "done" << std::endl; } - void reassign_samples() { - Sample_vector samples; - m_dt.collect_all_samples(samples); - m_dt.cleanup_assignments(); - m_dt.assign_samples(samples.begin(), samples.end()); - m_dt.reset_all_costs(); + return true; + } + + bool simulate_collapse(const Edge& edge, Cost_& cost) { + bool ok; + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle t = m_dt.target_vertex(edge); + + if (m_verbose > 1) { + std::cerr << green << "simulate collapse " << white << "(" + << s->id() << "->" << t->id() << ") ... " << std::endl; } - void reassign_samples_around_vertex(Vertex_handle vertex) { - Sample_vector samples; - m_dt.collect_samples_from_vertex(vertex, samples, true); - m_dt.assign_samples(samples.begin(), samples.end()); + Triangulation copy; + Edge copy_edge = copy_star(edge, copy); + Vertex_handle copy_source = copy.source_vertex(copy_edge); - Edge_vector hull; - m_dt.get_edges_from_star_minus_link(vertex, hull, true); - update_cost(hull.begin(), hull.end()); - } - - - bool do_collapse(Edge edge) { - bool ok; - Vertex_handle s = m_dt.source_vertex(edge); - Vertex_handle t = m_dt.target_vertex(edge); - - if (m_verbose > 0) { - std::cerr << std::endl << green << "do collapse " << white << "(" - << s->id() << "->" << t->id() << ") ... " << std::endl; - } - - Sample_vector samples; - m_dt.collect_samples_from_vertex(s, samples, true); - - Edge_vector hull; - m_dt.get_edges_from_star_minus_link(s, hull, true); - - if (m_mchoice == 0) - remove_stencil_from_pqueue(hull.begin(), hull.end()); - - if (m_use_flip) - ok = m_dt.make_collapsible(edge, hull.begin(), hull.end(), - m_verbose); - - // debug test - ok = m_dt.check_kernel_test(edge); - if (!ok) { - std::cerr << red << "do_collapse: kernel test failed: " << white - << std::endl; - return false; - } - // - - m_dt.collapse(edge, m_verbose); - - m_dt.assign_samples(samples.begin(), samples.end()); - - update_cost(hull.begin(), hull.end()); - - if (m_mchoice == 0) - push_stencil_to_pqueue(hull.begin(), hull.end()); - - for (unsigned int i = 0; i < m_relocation; ++i) { - relocate_one_ring(hull.begin(), hull.end()); - } - - if (m_verbose > 0) { - std::cerr << green << "done" << std::endl; - } - - return true; - } - - bool simulate_collapse(const Edge& edge, Cost_& cost) { - bool ok; - Vertex_handle s = m_dt.source_vertex(edge); - Vertex_handle t = m_dt.target_vertex(edge); - - if (m_verbose > 1) { - std::cerr << green << "simulate collapse " << white << "(" - << s->id() << "->" << t->id() << ") ... " << std::endl; - } - - Triangulation copy; - Edge copy_edge = copy_star(edge, copy); - Vertex_handle copy_source = copy.source_vertex(copy_edge); - - if (m_use_flip) { - Edge_vector copy_hull; - copy.get_edges_from_star_minus_link(copy_source, copy_hull, true); - ok = copy.make_collapsible(copy_edge, copy_hull.begin(), - copy_hull.end(), m_verbose); - if (!ok) { - std::cerr << yellow << "simulation: failed (make collapsible)" - << white << std::endl; - return false; - } - } - - ok = copy.check_kernel_test(copy_edge); - if (!ok) { - std::cerr << yellow << "simulation: failed (kernel test)" << white - << std::endl; - return false; - } - - copy.collapse(copy_edge, m_verbose); - - Sample_vector samples; - m_dt.collect_samples_from_vertex(s, samples, false); - - backup_samples(samples.begin(), samples.end()); - copy.assign_samples_brute_force(samples.begin(), samples.end()); - copy.reset_all_costs(); - cost = copy.compute_total_cost(); - restore_samples(samples.begin(), samples.end()); - - if (m_verbose > 1) { - std::cerr << green << "done" << white << std::endl; - } - - return true; - } - - template // value_type = Sample_* - void backup_samples(Iterator begin, Iterator end) { - for (Iterator it = begin; it != end; ++it) { - Sample_* sample = *it; - sample->backup(); - } - } - - template // value_type = Sample_* - void restore_samples(Iterator begin, Iterator end) { - for (Iterator it = begin; it != end; ++it) { - Sample_* sample = *it; - sample->restore(); - } - } - - // PEDGE // - - bool decimate() { - bool ok; - Rec_edge_2 pedge; - ok = pick_edge(m_mchoice, pedge); - if (!ok) - return false; - - ok = do_collapse(pedge.edge()); - if (!ok) - return false; - return true; - } - -bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { - Cost_ after_cost; - bool ok = simulate_collapse(edge, after_cost); - if (!ok) - return false; - - bool within_tol = is_within_tol(after_cost); - if (!within_tol) - return false; - - Vertex_handle source = m_dt.source_vertex(edge); - Cost_ before_cost = m_dt.compute_cost_around_vertex(source); - - FT before = before_cost.finalize(m_alpha); - FT after = after_cost.finalize(m_alpha); - pedge = Rec_edge_2(edge, before, after); - return true; - } - - bool is_within_tol(const Cost_& cost) const { - if (cost.max_norm() > m_norm_tol) - return false; - if (cost.max_tang() > m_tang_tol) - return false; - return true; - } - - // COST // - - void init_cost() { - m_dt.reset_all_costs(); - } - - template // value_type = Edge - void update_cost(Iterator begin, Iterator end) { - Edge_vector edges; - collect_cost_stencil(m_dt, begin, end, edges); - - typename Edge_vector::iterator ei; - for (ei = edges.begin(); ei != edges.end(); ++ei) { - Edge edge = *ei; - m_dt.update_cost(edge); - } - } - - template // value_type = Edge - void collect_cost_stencil(const Triangulation& mesh, Iterator begin, - Iterator end, Edge_vector& edges) { - Edge_set done; - Edge_list fifo; - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - fifo.push_back(edge); - done.insert(edge); - } - - while (!fifo.empty()) { - Edge edge = fifo.front(); - fifo.pop_front(); - - edge = mesh.twin_edge(edge); - edges.push_back(edge); - - Edge next = mesh.next_edge(edge); - if (done.insert(next).second) - fifo.push_back(next); - - Edge prev = mesh.prev_edge(edge); - if (done.insert(prev).second) - fifo.push_back(prev); - } - } - - // PQUEUE (MCHOICE or EXHAUSTIVE) // - - bool pick_edge(std::size_t nb, Rec_edge_2& best_pedge) { - if (m_dt.number_of_faces() < 2) - return false; - - std::size_t ne = 2 * m_dt.tds().number_of_edges(); - if (nb > ne) - nb = ne; - - bool ok; - if (nb == 0) { - ok = pick_edge_from_pqueue(best_pedge); - return ok; - } - m_mindex.clear(); - - if (nb == ne) { - ok = pick_edge_brute_force(best_pedge); - return ok; - } - - ok = pick_edge_randomly(nb, best_pedge); - return ok; - } - - bool pick_edge_from_pqueue(Rec_edge_2& best_pedge) { - if (m_mindex.empty()) - populate_pqueue(); - if (m_mindex.empty()) - return false; - best_pedge = *(m_mindex.template get<1>()).begin(); - (m_mindex.template get<0>()).erase(best_pedge); - return true; - } - - bool pick_edge_brute_force(Rec_edge_2& best_pedge) { - MultiIndex mindex; - Finite_edges_iterator ei; - for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); - ++ei) { - Edge edge = *ei; - push_to_mindex(edge, mindex); - - - edge = m_dt.twin_edge(edge); - push_to_mindex(edge, mindex); - } - if (mindex.empty()) - return false; - best_pedge = *(mindex.template get<1>()).begin(); - return true; - } - - bool pick_edge_randomly(std::size_t nb, Rec_edge_2& best_pedge) { - MultiIndex mindex; - for (std::size_t i = 0; i < nb; ++i) { - Rec_edge_2 pedge; - if (random_pedge(pedge)) - mindex.insert(pedge); - } - if (mindex.empty()) - return false; - best_pedge = *(mindex.template get<1>()).begin(); - return true; - } - - void populate_pqueue() { - Finite_edges_iterator ei; - for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); - ++ei) { - Edge edge = *ei; - push_to_mindex(edge, m_mindex); - - edge = m_dt.twin_edge(edge); - push_to_mindex(edge, m_mindex); - } - } - - - bool push_to_mindex(const Edge& edge, MultiIndex& mindex) { - if (m_dt.is_pinned(edge)) - return false; - if (m_dt.is_target_cyclic(edge)) - return false; - - Rec_edge_2 pedge; - bool ok = create_pedge(edge, pedge); - if (!ok) - return false; - mindex.insert(pedge); - return true; - } - - - - bool random_pedge(Rec_edge_2& pedge) { - for (unsigned i = 0; i < 10; ++i) { - Edge edge = m_dt.random_finite_edge(); - if (m_dt.is_pinned(edge)) - continue; - if (m_dt.is_target_cyclic(edge)) - continue; - bool ok = create_pedge(edge, pedge); - if (ok) - return true; - } + if (m_use_flip) { + Edge_vector copy_hull; + copy.get_edges_from_star_minus_link(copy_source, copy_hull, true); + ok = copy.make_collapsible(copy_edge, copy_hull.begin(), + copy_hull.end(), m_verbose); + if (!ok) { + std::cerr << yellow << "simulation: failed (make collapsible)" + << white << std::endl; return false; + } } - template // value_type = Edge - void remove_stencil_from_pqueue(Iterator begin, Iterator end) { - if (m_mindex.empty()) - return; - - Edge_vector edges; - collect_pqueue_stencil(m_dt, begin, end, edges); - - typename Edge_vector::const_iterator ei; - for (ei = edges.begin(); ei != edges.end(); ++ei) { - Edge edge = *ei; - (m_mindex.template get<0>()).erase(Rec_edge_2(edge)); - } + ok = copy.check_kernel_test(copy_edge); + if (!ok) { + std::cerr << yellow << "simulation: failed (kernel test)" << white + << std::endl; + return false; } - template // value_type = Edge - void push_stencil_to_pqueue(Iterator begin, Iterator end) { - Edge_vector edges; - collect_pqueue_stencil(m_dt, begin, end, edges); + copy.collapse(copy_edge, m_verbose); - typename Edge_vector::const_iterator ei; - for (ei = edges.begin(); ei != edges.end(); ++ei) { - Edge edge = *ei; - push_to_mindex(edge, m_mindex); - } + Sample_vector samples; + m_dt.collect_samples_from_vertex(s, samples, false); + + backup_samples(samples.begin(), samples.end()); + copy.assign_samples_brute_force(samples.begin(), samples.end()); + copy.reset_all_costs(); + cost = copy.compute_total_cost(); + restore_samples(samples.begin(), samples.end()); + + if (m_verbose > 1) { + std::cerr << green << "done" << white << std::endl; } - template // value_type = Edge - void collect_pqueue_stencil(const Triangulation& mesh, Iterator begin, - Iterator end, Edge_vector& edges) { - Vertex_handle_set vertex_set; - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - Edge twin = mesh.twin_edge(edge); + return true; + } - Vertex_handle s = mesh.source_vertex(edge); - if (!s->pinned()) - vertex_set.insert(s); + template // value_type = Sample_* + void backup_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample_* sample = *it; + sample->backup(); + } + } - Vertex_handle t = mesh.target_vertex(edge); - if (!t->pinned()) - vertex_set.insert(t); + template // value_type = Sample_* + void restore_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample_* sample = *it; + sample->restore(); + } + } - Vertex_handle f = mesh.opposite_vertex(edge); - if (!f->pinned()) - vertex_set.insert(f); + // PEDGE // - Vertex_handle b = mesh.opposite_vertex(twin); - if (!b->pinned()) - vertex_set.insert(b); - } + bool decimate() { + bool ok; + Rec_edge_2 pedge; + ok = pick_edge(m_mchoice, pedge); + if (!ok) + return false; - typename Vertex_handle_set::const_iterator vi; - for (vi = vertex_set.begin(); vi != vertex_set.end(); ++vi) { - Vertex_handle v = *vi; - Edge_circulator ecirc = mesh.incident_edges(v); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (mesh.source_vertex(edge) != v) - edge = mesh.twin_edge(edge); - edges.push_back(edge); - } - } + ok = do_collapse(pedge.edge()); + if (!ok) + return false; + return true; + } + + bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { + Cost_ after_cost; + bool ok = simulate_collapse(edge, after_cost); + if (!ok) + return false; + + bool within_tol = is_within_tol(after_cost); + if (!within_tol) + return false; + + Vertex_handle source = m_dt.source_vertex(edge); + Cost_ before_cost = m_dt.compute_cost_around_vertex(source); + + FT before = before_cost.finalize(m_alpha); + FT after = after_cost.finalize(m_alpha); + pedge = Rec_edge_2(edge, before, after); + return true; + } + + bool is_within_tol(const Cost_& cost) const { + if (cost.max_norm() > m_norm_tol) + return false; + if (cost.max_tang() > m_tang_tol) + return false; + return true; + } + + // COST // + + void init_cost() { + m_dt.reset_all_costs(); + } + + template // value_type = Edge + void update_cost(Iterator begin, Iterator end) { + Edge_vector edges; + collect_cost_stencil(m_dt, begin, end, edges); + + typename Edge_vector::iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + m_dt.update_cost(edge); + } + } + + template // value_type = Edge + void collect_cost_stencil(const Triangulation& mesh, Iterator begin, + Iterator end, Edge_vector& edges) { + Edge_set done; + Edge_list fifo; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + fifo.push_back(edge); + done.insert(edge); } - // COPY STAR // + while (!fifo.empty()) { + Edge edge = fifo.front(); + fifo.pop_front(); - // edge must not be pinned or have cyclic target - Edge copy_star(const Edge& edge, Triangulation& copy) { - copy.tds().set_dimension(2); - copy.infinite_vertex()->pinned() = true; + edge = mesh.twin_edge(edge); + edges.push_back(edge); - // copy vertices - Vertex_handle_map cvmap; + Edge next = mesh.next_edge(edge); + if (done.insert(next).second) + fifo.push_back(next); - Vertex_handle s = m_dt.source_vertex(edge); - Vertex_handle cs = copy.tds().create_vertex(); - cvmap[s] = copy_vertex(s, cs); + Edge prev = mesh.prev_edge(edge); + if (done.insert(prev).second) + fifo.push_back(prev); + } + } - Vertex_circulator vcirc = m_dt.incident_vertices(s); - Vertex_circulator vend = vcirc; - CGAL_For_all(vcirc, vend) - { - Vertex_handle v = vcirc; - if (cvmap.find(v) == cvmap.end()) { - Vertex_handle cv = copy.tds().create_vertex(); - cvmap[v] = copy_vertex(v, cv); - } - } + // PQUEUE (MCHOICE or EXHAUSTIVE) // - // copy faces - Face_handle_map cfmap; - Face_circulator fcirc = m_dt.incident_faces(s); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle f = fcirc; - Face_handle cf = copy.tds().create_face(); - cfmap[f] = copy_face(f, cf, cvmap); - } + bool pick_edge(std::size_t nb, Rec_edge_2& best_pedge) { + if (m_dt.number_of_faces() < 2) + return false; - // set neighbors - fcirc = m_dt.incident_faces(s); - fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle f = fcirc; - copy_neighbors(f, s, cvmap, cfmap); - } + std::size_t ne = 2 * m_dt.tds().number_of_edges(); + if (nb > ne) + nb = ne; - // make copy homeomorphic to S^2 - close_copy_mesh(cs, copy); + bool ok; + if (nb == 0) { + ok = pick_edge_from_pqueue(best_pedge); + return ok; + } + m_mindex.clear(); - // copy samples surrounding star - copy_samples(s, cs, cfmap, copy); - - // get copy of edge - Edge copy_edge = get_copy_edge(edge, cvmap, cfmap); - return copy_edge; + if (nb == ne) { + ok = pick_edge_brute_force(best_pedge); + return ok; } - Vertex_handle copy_vertex(Vertex_handle v0, Vertex_handle v1) { - v1->id() = v0->id(); - v1->set_point(v0->point()); - v1->pinned() = v0->pinned(); - v1->set_sample(v0->get_sample()); - return v1; + ok = pick_edge_randomly(nb, best_pedge); + return ok; + } + + bool pick_edge_from_pqueue(Rec_edge_2& best_pedge) { + if (m_mindex.empty()) + populate_pqueue(); + if (m_mindex.empty()) + return false; + best_pedge = *(m_mindex.template get<1>()).begin(); + (m_mindex.template get<0>()).erase(best_pedge); + return true; + } + + bool pick_edge_brute_force(Rec_edge_2& best_pedge) { + MultiIndex mindex; + Finite_edges_iterator ei; + for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); + ++ei) { + Edge edge = *ei; + push_to_mindex(edge, mindex); + + + edge = m_dt.twin_edge(edge); + push_to_mindex(edge, mindex); + } + if (mindex.empty()) + return false; + best_pedge = *(mindex.template get<1>()).begin(); + return true; + } + + bool pick_edge_randomly(std::size_t nb, Rec_edge_2& best_pedge) { + MultiIndex mindex; + for (std::size_t i = 0; i < nb; ++i) { + Rec_edge_2 pedge; + if (random_pedge(pedge)) + mindex.insert(pedge); + } + if (mindex.empty()) + return false; + best_pedge = *(mindex.template get<1>()).begin(); + return true; + } + + void populate_pqueue() { + Finite_edges_iterator ei; + for (ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); + ++ei) { + Edge edge = *ei; + push_to_mindex(edge, m_mindex); + + edge = m_dt.twin_edge(edge); + push_to_mindex(edge, m_mindex); + } + } + + + bool push_to_mindex(const Edge& edge, MultiIndex& mindex) { + if (m_dt.is_pinned(edge)) + return false; + if (m_dt.is_target_cyclic(edge)) + return false; + + Rec_edge_2 pedge; + bool ok = create_pedge(edge, pedge); + if (!ok) + return false; + mindex.insert(pedge); + return true; + } + + + + bool random_pedge(Rec_edge_2& pedge) { + for (unsigned i = 0; i < 10; ++i) { + Edge edge = m_dt.random_finite_edge(); + if (m_dt.is_pinned(edge)) + continue; + if (m_dt.is_target_cyclic(edge)) + continue; + bool ok = create_pedge(edge, pedge); + if (ok) + return true; + } + return false; + } + + template // value_type = Edge + void remove_stencil_from_pqueue(Iterator begin, Iterator end) { + if (m_mindex.empty()) + return; + + Edge_vector edges; + collect_pqueue_stencil(m_dt, begin, end, edges); + + typename Edge_vector::const_iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + (m_mindex.template get<0>()).erase(Rec_edge_2(edge)); + } + } + + template // value_type = Edge + void push_stencil_to_pqueue(Iterator begin, Iterator end) { + Edge_vector edges; + collect_pqueue_stencil(m_dt, begin, end, edges); + + typename Edge_vector::const_iterator ei; + for (ei = edges.begin(); ei != edges.end(); ++ei) { + Edge edge = *ei; + push_to_mindex(edge, m_mindex); + } + } + + template // value_type = Edge + void collect_pqueue_stencil(const Triangulation& mesh, Iterator begin, + Iterator end, Edge_vector& edges) { + Vertex_handle_set vertex_set; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + Edge twin = mesh.twin_edge(edge); + + Vertex_handle s = mesh.source_vertex(edge); + if (!s->pinned()) + vertex_set.insert(s); + + Vertex_handle t = mesh.target_vertex(edge); + if (!t->pinned()) + vertex_set.insert(t); + + Vertex_handle f = mesh.opposite_vertex(edge); + if (!f->pinned()) + vertex_set.insert(f); + + Vertex_handle b = mesh.opposite_vertex(twin); + if (!b->pinned()) + vertex_set.insert(b); } - Face_handle copy_face(Face_handle f0, Face_handle f1, - Vertex_handle_map& vmap) { - for (unsigned i = 0; i < 3; ++i) { - Vertex_handle v0i = f0->vertex(i); - Vertex_handle v1i = vmap[v0i]; - f1->set_vertex(i, v1i); - v1i->set_face(f1); - } - return f1; + typename Vertex_handle_set::const_iterator vi; + for (vi = vertex_set.begin(); vi != vertex_set.end(); ++vi) { + Vertex_handle v = *vi; + Edge_circulator ecirc = mesh.incident_edges(v); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (mesh.source_vertex(edge) != v) + edge = mesh.twin_edge(edge); + edges.push_back(edge); + } + } + } + + // COPY STAR // + + // edge must not be pinned or have cyclic target + Edge copy_star(const Edge& edge, Triangulation& copy) { + copy.tds().set_dimension(2); + copy.infinite_vertex()->pinned() = true; + + // copy vertices + Vertex_handle_map cvmap; + + Vertex_handle s = m_dt.source_vertex(edge); + Vertex_handle cs = copy.tds().create_vertex(); + cvmap[s] = copy_vertex(s, cs); + + Vertex_circulator vcirc = m_dt.incident_vertices(s); + Vertex_circulator vend = vcirc; + CGAL_For_all(vcirc, vend) + { + Vertex_handle v = vcirc; + if (cvmap.find(v) == cvmap.end()) { + Vertex_handle cv = copy.tds().create_vertex(); + cvmap[v] = copy_vertex(v, cv); + } } - void copy_neighbors(Face_handle f, Vertex_handle v, Vertex_handle_map& vmap, - Face_handle_map& fmap) { - int i = f->index(v); - Face_handle cf = fmap[f]; - Vertex_handle cv = vmap[v]; - - if (fmap.find(f->neighbor(i)) != fmap.end()) { - Face_handle fi = f->neighbor(i); - Face_handle cfi = fmap[fi]; - cf->set_neighbor(i, cfi); - } - - for (unsigned j = 0; j < 2; ++j) { - i = (i + 1) % 3; - Face_handle fi = f->neighbor(i); - Face_handle cfi = fmap[fi]; - cf->set_neighbor(i, cfi); - } + // copy faces + Face_handle_map cfmap; + Face_circulator fcirc = m_dt.incident_faces(s); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + Face_handle cf = copy.tds().create_face(); + cfmap[f] = copy_face(f, cf, cvmap); } - void close_copy_mesh(Vertex_handle vertex, Triangulation& copy) { - std::vector outer_faces; - - Face_circulator fcirc = copy.incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int i = face->index(vertex); - - if (face->neighbor(i) != Face_handle()) - continue; - - Vertex_handle v1 = face->vertex((i + 1) % 3); - Vertex_handle v2 = face->vertex((i + 2) % 3); - - Face_handle outer = copy.tds().create_face(); - outer->set_vertex(0, copy.infinite_vertex()); - outer->set_vertex(1, v2); - outer->set_vertex(2, v1); - - face->set_neighbor(i, outer); - outer->set_neighbor(0, face); - - outer_faces.push_back(outer); - } - - for (unsigned i = 0; i < outer_faces.size(); ++i) { - unsigned j = (i + 1) % outer_faces.size(); - outer_faces[i]->set_neighbor(2, outer_faces[j]); - outer_faces[j]->set_neighbor(1, outer_faces[i]); - } - - if (!outer_faces.empty()) - copy.infinite_vertex()->set_face(outer_faces[0]); + // set neighbors + fcirc = m_dt.incident_faces(s); + fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle f = fcirc; + copy_neighbors(f, s, cvmap, cfmap); } - void copy_samples(Vertex_handle vertex, Vertex_handle copy_vertex, - Face_handle_map& fmap, Triangulation& copy) { - Face_circulator fcirc = m_dt.incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - Edge twin = m_dt.twin_edge(Edge(face, index)); + // make copy homeomorphic to S^2 + close_copy_mesh(cs, copy); - Face_handle copy_face = fmap[face]; - index = copy_face->index(copy_vertex); - Edge copy_twin = copy.twin_edge(Edge(copy_face, index)); + // copy samples surrounding star + copy_samples(s, cs, cfmap, copy); - Sample_vector samples; - m_dt.collect_samples_from_edge(twin, samples); - copy_twin.first->samples(copy_twin.second) = samples; - } - copy_vertex->set_sample(NULL); + // get copy of edge + Edge copy_edge = get_copy_edge(edge, cvmap, cfmap); + return copy_edge; + } + + Vertex_handle copy_vertex(Vertex_handle v0, Vertex_handle v1) { + v1->id() = v0->id(); + v1->set_point(v0->point()); + v1->pinned() = v0->pinned(); + v1->set_sample(v0->get_sample()); + return v1; + } + + Face_handle copy_face(Face_handle f0, Face_handle f1, + Vertex_handle_map& vmap) { + for (unsigned i = 0; i < 3; ++i) { + Vertex_handle v0i = f0->vertex(i); + Vertex_handle v1i = vmap[v0i]; + f1->set_vertex(i, v1i); + v1i->set_face(f1); + } + return f1; + } + + void copy_neighbors(Face_handle f, Vertex_handle v, Vertex_handle_map& vmap, + Face_handle_map& fmap) { + int i = f->index(v); + Face_handle cf = fmap[f]; + Vertex_handle cv = vmap[v]; + + if (fmap.find(f->neighbor(i)) != fmap.end()) { + Face_handle fi = f->neighbor(i); + Face_handle cfi = fmap[fi]; + cf->set_neighbor(i, cfi); } - Edge get_copy_edge(const Edge& edge, Vertex_handle_map& vmap, - Face_handle_map& fmap) { - Face_handle f = edge.first; - Vertex_handle v = f->vertex(edge.second); + for (unsigned j = 0; j < 2; ++j) { + i = (i + 1) % 3; + Face_handle fi = f->neighbor(i); + Face_handle cfi = fmap[fi]; + cf->set_neighbor(i, cfi); + } + } - Face_handle cf = fmap[f]; - Vertex_handle cv = vmap[v]; + void close_copy_mesh(Vertex_handle vertex, Triangulation& copy) { + std::vector outer_faces; - return Edge(cf, cf->index(cv)); + Face_circulator fcirc = copy.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int i = face->index(vertex); + + if (face->neighbor(i) != Face_handle()) + continue; + + Vertex_handle v1 = face->vertex((i + 1) % 3); + Vertex_handle v2 = face->vertex((i + 2) % 3); + + Face_handle outer = copy.tds().create_face(); + outer->set_vertex(0, copy.infinite_vertex()); + outer->set_vertex(1, v2); + outer->set_vertex(2, v1); + + face->set_neighbor(i, outer); + outer->set_neighbor(0, face); + + outer_faces.push_back(outer); } - // RELOCATION // - - void relocate_one_vertex(Vertex_handle vertex) { - std::swap(vertex->point(), vertex->relocated()); - reassign_samples_around_vertex(vertex); + for (unsigned i = 0; i < outer_faces.size(); ++i) { + unsigned j = (i + 1) % outer_faces.size(); + outer_faces[i]->set_neighbor(2, outer_faces[j]); + outer_faces[j]->set_neighbor(1, outer_faces[i]); } - template // value_type = Edge - void relocate_one_ring(Iterator begin, Iterator end) { - Vertex_handle_set vertices; - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - vertices.insert(m_dt.source_vertex(edge)); - vertices.insert(m_dt.target_vertex(edge)); - } + if (!outer_faces.empty()) + copy.infinite_vertex()->set_face(outer_faces[0]); + } - typename Vertex_handle_set::const_iterator vi; - for (vi = vertices.begin(); vi != vertices.end(); ++vi) { - Vertex_handle v = *vi; - if (v->pinned()) - continue; - v->relocated() = compute_relocation(v); - } + void copy_samples(Vertex_handle vertex, Vertex_handle copy_vertex, + Face_handle_map& fmap, Triangulation& copy) { + Face_circulator fcirc = m_dt.incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + Edge twin = m_dt.twin_edge(Edge(face, index)); - for (vi = vertices.begin(); vi != vertices.end(); ++vi) { - Vertex_handle v = *vi; - if (v->pinned()) - continue; - if (v->point() == v->relocated()) - continue; + Face_handle copy_face = fmap[face]; + index = copy_face->index(copy_vertex); + Edge copy_twin = copy.twin_edge(Edge(copy_face, index)); - Edge_vector hull; - m_dt.get_edges_from_star_minus_link(v, hull, false); - bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), - hull.end()); + Sample_vector samples; + m_dt.collect_samples_from_edge(twin, samples); + copy_twin.first->samples(copy_twin.second) = samples; + } + copy_vertex->set_sample(NULL); + } - if (ok) { - // do relocation - FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); - relocate_one_vertex(v); - FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + Edge get_copy_edge(const Edge& edge, Vertex_handle_map& vmap, + Face_handle_map& fmap) { + Face_handle f = edge.first; + Vertex_handle v = f->vertex(edge.second); - if (norm_bef < norm_aft) { - // undo relocation - relocate_one_vertex(v); - } else if (m_mchoice == 0) { - // update queue - hull.clear(); - m_dt.get_edges_from_star_minus_link(v, hull, true); - remove_stencil_from_pqueue(hull.begin(), hull.end()); - push_stencil_to_pqueue(hull.begin(), hull.end()); - } - } - } + Face_handle cf = fmap[f]; + Vertex_handle cv = vmap[v]; + + return Edge(cf, cf->index(cv)); + } + + // RELOCATION // + + void relocate_one_vertex(Vertex_handle vertex) { + std::swap(vertex->point(), vertex->relocated()); + reassign_samples_around_vertex(vertex); + } + + template // value_type = Edge + void relocate_one_ring(Iterator begin, Iterator end) { + Vertex_handle_set vertices; + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + vertices.insert(m_dt.source_vertex(edge)); + vertices.insert(m_dt.target_vertex(edge)); } - /// \endcond - - - /// \cond SKIP_IN_MANUAL - Vector compute_gradient(Vertex_handle vertex) { - Vector grad(0.0, 0.0); - Edge_circulator ecirc = m_dt.incident_edges(vertex); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (m_dt.source_vertex(edge) != vertex) - edge = m_dt.twin_edge(edge); - - if (m_dt.get_plan(edge) == 0) - grad = grad + compute_gradient_for_plan0(edge); - else - grad = grad + compute_gradient_for_plan1(edge); - } - return grad; + typename Vertex_handle_set::const_iterator vi; + for (vi = vertices.begin(); vi != vertices.end(); ++vi) { + Vertex_handle v = *vi; + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); } - Point compute_relocation(Vertex_handle vertex) { - FT coef = 0.0; - Vector rhs(0.0, 0.0); + for (vi = vertices.begin(); vi != vertices.end(); ++vi) { + Vertex_handle v = *vi; + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; - Edge_circulator ecirc = m_dt.incident_edges(vertex); - Edge_circulator eend = ecirc; - CGAL_For_all(ecirc, eend) - { - Edge edge = *ecirc; - if (m_dt.source_vertex(edge) != vertex) - edge = m_dt.twin_edge(edge); + Edge_vector hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); - if (m_dt.get_plan(edge) == 0) - compute_relocation_for_plan0(edge, coef, rhs); - else - compute_relocation_for_plan1(edge, coef, rhs); + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + + if (norm_bef < norm_aft) { + // undo relocation + relocate_one_vertex(v); + } else if (m_mchoice == 0) { + // update queue + hull.clear(); + m_dt.get_edges_from_star_minus_link(v, hull, true); + remove_stencil_from_pqueue(hull.begin(), hull.end()); + push_stencil_to_pqueue(hull.begin(), hull.end()); } - compute_relocation_for_vertex(vertex, coef, rhs); - - if (coef == 0.0) - return vertex->point(); - return CGAL::ORIGIN + (rhs / coef); + } } + } - void compute_relocation_for_vertex(Vertex_handle vertex, FT& coef, - Vector& rhs) { - Sample_* sample = vertex->get_sample(); - if (sample) { - const FT m = sample->mass(); - const Point& ps = sample->point(); - rhs = rhs + m * (ps - CGAL::ORIGIN); - coef += m; - } + /// \endcond + + + /// \cond SKIP_IN_MANUAL + Vector compute_gradient(Vertex_handle vertex) { + Vector grad(0.0, 0.0); + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); + + if (m_dt.get_plan(edge) == 0) + grad = grad + compute_gradient_for_plan0(edge); + else + grad = grad + compute_gradient_for_plan1(edge); } + return grad; + } - Vector compute_gradient_for_plan0(const Edge& edge) { - Edge twin = m_dt.twin_edge(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); + Point compute_relocation(Vertex_handle vertex) { + FT coef = 0.0; + Vector rhs(0.0, 0.0); - Sample_vector samples; - m_dt.collect_samples_from_edge(edge, samples); - m_dt.collect_samples_from_edge(twin, samples); + Edge_circulator ecirc = m_dt.incident_edges(vertex); + Edge_circulator eend = ecirc; + CGAL_For_all(ecirc, eend) + { + Edge edge = *ecirc; + if (m_dt.source_vertex(edge) != vertex) + edge = m_dt.twin_edge(edge); - Vector grad(0.0, 0.0); - Sample_vector_const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) { - Sample_* sample = *it; - const FT m = sample->mass(); - const Point& ps = sample->point(); - - FT Da = CGAL::squared_distance(ps, pa); - FT Db = CGAL::squared_distance(ps, pb); - if (Da < Db) - grad = grad + m * (pa - ps); - } - return grad; + if (m_dt.get_plan(edge) == 0) + compute_relocation_for_plan0(edge, coef, rhs); + else + compute_relocation_for_plan1(edge, coef, rhs); } + compute_relocation_for_vertex(vertex, coef, rhs); - void compute_relocation_for_plan0(const Edge& edge, FT& coef, Vector& rhs) { - Edge twin = m_dt.twin_edge(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); + if (coef == 0.0) + return vertex->point(); + return CGAL::ORIGIN + (rhs / coef); + } - Sample_vector samples; - m_dt.collect_samples_from_edge(edge, samples); - m_dt.collect_samples_from_edge(twin, samples); - - Sample_vector_const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) { - Sample_* sample = *it; - const FT m = sample->mass(); - const Point& ps = sample->point(); - - FT Da = CGAL::squared_distance(ps, pa); - FT Db = CGAL::squared_distance(ps, pb); - - if (Da < Db) { - rhs = rhs + m * (ps - CGAL::ORIGIN); - coef += m; - } - } + void compute_relocation_for_vertex(Vertex_handle vertex, FT& coef, + Vector& rhs) { + Sample_* sample = vertex->get_sample(); + if (sample) { + const FT m = sample->mass(); + const Point& ps = sample->point(); + rhs = rhs + m * (ps - CGAL::ORIGIN); + coef += m; } + } - Vector compute_gradient_for_plan1(const Edge& edge) { - FT M = m_dt.get_mass(edge); - const Point& pa = m_dt.source_vertex(edge)->point(); - const Point& pb = m_dt.target_vertex(edge)->point(); + Vector compute_gradient_for_plan0(const Edge& edge) { + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); - SQueue queue; - m_dt.sort_samples_from_edge(edge, queue); + Sample_vector samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); - //FT start = 0.0; - Vector grad(0.0, 0.0); - while (!queue.empty()) { - PSample psample = queue.top(); - queue.pop(); + Vector grad(0.0, 0.0); + Sample_vector_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) { + Sample_* sample = *it; + const FT m = sample->mass(); + const Point& ps = sample->point(); - const FT m = psample.sample()->mass(); - const Point& ps = psample.sample()->point(); + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + if (Da < Db) + grad = grad + m * (pa - ps); + } + return grad; + } - // normal + tangnetial - const FT coord = psample.priority(); - Point pf = CGAL::ORIGIN + (1.0 - coord) * (pa - CGAL::ORIGIN) - + coord * (pb - CGAL::ORIGIN); - grad = grad + m * (1.0 - coord) * (pf - ps); + void compute_relocation_for_plan0(const Edge& edge, FT& coef, Vector& rhs) { + Edge twin = m_dt.twin_edge(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); - /* + Sample_vector samples; + m_dt.collect_samples_from_edge(edge, samples); + m_dt.collect_samples_from_edge(twin, samples); + + Sample_vector_const_iterator it; + for (it = samples.begin(); it != samples.end(); ++it) { + Sample_* sample = *it; + const FT m = sample->mass(); + const Point& ps = sample->point(); + + FT Da = CGAL::squared_distance(ps, pa); + FT Db = CGAL::squared_distance(ps, pb); + + if (Da < Db) { + rhs = rhs + m * (ps - CGAL::ORIGIN); + coef += m; + } + } + } + + Vector compute_gradient_for_plan1(const Edge& edge) { + FT M = m_dt.get_mass(edge); + const Point& pa = m_dt.source_vertex(edge)->point(); + const Point& pb = m_dt.target_vertex(edge)->point(); + + SQueue queue; + m_dt.sort_samples_from_edge(edge, queue); + + //FT start = 0.0; + Vector grad(0.0, 0.0); + while (!queue.empty()) { + PSample psample = queue.top(); + queue.pop(); + + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); + + // normal + tangnetial + const FT coord = psample.priority(); + Point pf = CGAL::ORIGIN + (1.0 - coord) * (pa - CGAL::ORIGIN) + + coord * (pb - CGAL::ORIGIN); + grad = grad + m * (1.0 - coord) * (pf - ps); + + /* // only normal FT bin = m/M; FT center = start + 0.5*bin; @@ -1283,38 +1283,38 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { start += bin; grad = grad + m*(bin*bin/12.0)*(pa - pb); grad = grad + m*(1.0-center)*(pc - pf); - */ - } - return grad; + */ } + return grad; + } - void compute_relocation_for_plan1(const Edge& edge, FT& coef, Vector& rhs) { - //FT M = m_dt.get_mass(edge); - const Point& pb = m_dt.target_vertex(edge)->point(); + void compute_relocation_for_plan1(const Edge& edge, FT& coef, Vector& rhs) { + //FT M = m_dt.get_mass(edge); + const Point& pb = m_dt.target_vertex(edge)->point(); - SQueue queue; - m_dt.sort_samples_from_edge(edge, queue); + SQueue queue; + m_dt.sort_samples_from_edge(edge, queue); - //FT start = 0.0; - while (!queue.empty()) { - PSample psample = queue.top(); - queue.pop(); + //FT start = 0.0; + while (!queue.empty()) { + PSample psample = queue.top(); + queue.pop(); - const FT m = psample.sample()->mass(); - const Point& ps = psample.sample()->point(); + const FT m = psample.sample()->mass(); + const Point& ps = psample.sample()->point(); - const FT coord = psample.priority(); - const FT one_minus_coord = 1.0 - coord; + const FT coord = psample.priority(); + const FT one_minus_coord = 1.0 - coord; - // normal + tangential - coef += m * one_minus_coord * one_minus_coord; - rhs = - rhs - + m * one_minus_coord - * ((ps - CGAL::ORIGIN) - - coord * (pb - CGAL::ORIGIN)); + // normal + tangential + coef += m * one_minus_coord * one_minus_coord; + rhs = + rhs + + m * one_minus_coord + * ((ps - CGAL::ORIGIN) + - coord * (pb - CGAL::ORIGIN)); - /* + /* // only normal FT bin = m/M; FT center = start + 0.5*bin; @@ -1326,182 +1326,182 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { coef += m*one_minus_center*(coord - center); rhs = rhs + m*one_minus_center*(coord - center)*(pb - CGAL::ORIGIN); - */ - } + */ } + } - void print_stats_debug() const + void print_stats_debug() const + { + int nb_solid = 0; + int nb_ghost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) { - int nb_solid = 0; - int nb_ghost = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) nb_ghost++; - else nb_solid++; - } - - std::cerr << blue << "STATS" << white << std::endl; - std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; - std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; - std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; - std::cerr << "# solid: " << nb_solid << std::endl; - std::cerr << "# ghost: " << nb_ghost << std::endl; + Edge edge = *ei; + if (m_dt.is_ghost(edge)) nb_ghost++; + else nb_solid++; } + std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; + std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; + std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; + std::cerr << "# solid: " << nb_solid << std::endl; + std::cerr << "# ghost: " << nb_ghost << std::endl; + } - /*! + + /*! Returns the number of vertices present in the reconstructed triangulation. - */ - std::size_t number_of_vertices() { - return m_dt.number_of_vertices() - 4; + */ + std::size_t number_of_vertices() { + return m_dt.number_of_vertices() - 4; - } + } - /*! + /*! Returns the number of (solid) edges present in the reconstructed triangulation. - */ - int number_of_edges() { - int nb_solid = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; - nb_solid++; - } - return nb_solid; + */ + int number_of_edges() { + int nb_solid = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; + nb_solid++; } + return nb_solid; + } - /*! + /*! Returns the cost of the (solid) edges present in the reconstructed triangulation. - */ - FT total_edge_cost() { - FT total_cost = 0; - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) continue; + */ + FT total_edge_cost() { + FT total_cost = 0; + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); + ei != m_dt.finite_edges_end(); ++ei) { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) continue; - total_cost += m_dt.get_cost(edge).finalize(); - } - return total_cost; + total_cost += m_dt.get_cost(edge).finalize(); } + return total_cost; + } - /// \endcond + /// \endcond /// \name Simplification /// You can freely mix calls of the following functions. /// @{ - /*! + /*! Computes a shape consisting of `np` points, reconstructing the input points. \param np The number of points which will be present in the output. - */ + */ void run_until(std::size_t np) { - double timer = clock(); - std::cerr << yellow << "reconstruct until " << white << np << " V"; + double timer = clock(); + std::cerr << yellow << "reconstruct until " << white << np << " V"; - std::size_t N = np + 4; - std::size_t performed = 0; - while (m_dt.number_of_vertices() > N) { - bool ok = decimate(); - if (!ok) - break; - performed++; - } + std::size_t N = np + 4; + std::size_t performed = 0; + while (m_dt.number_of_vertices() > N) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } - std::cerr << yellow << " done" << white << " (" << performed - << " iters, " << m_dt.number_of_vertices() - 4 << " V " - << yellow << time_duration(timer) << white << " s)" - << std::endl; - } + std::cerr << yellow << " done" << white << " (" << performed + << " iters, " << m_dt.number_of_vertices() - 4 << " V " + << yellow << time_duration(timer) << white << " s)" + << std::endl; + } - /*! + /*! Computes a shape, reconstructing the input, by performing `steps` edge collapse operators on the output simplex. \param steps The number of edge collapse operators to be performed. - */ - void run(const unsigned steps) { - double timer = clock(); - std::cerr << yellow << "reconstruct " << steps << white; + */ + void run(const unsigned steps) { + double timer = clock(); + std::cerr << yellow << "reconstruct " << steps << white; - unsigned performed = 0; - for (unsigned i = 0; i < steps; ++i) { - bool ok = decimate(); - if (!ok) - break; - performed++; - } + unsigned performed = 0; + for (unsigned i = 0; i < steps; ++i) { + bool ok = decimate(); + if (!ok) + break; + performed++; + } - std::cerr << yellow << " done" << white << " (" << performed << "/" - << steps << " iters, " << m_dt.number_of_vertices() - 4 - << " V, " << yellow << time_duration(timer) << white << " s)" - << std::endl; - } + std::cerr << yellow << " done" << white << " (" << performed << "/" + << steps << " iters, " << m_dt.number_of_vertices() - 4 + << " V, " << yellow << time_duration(timer) << white << " s)" + << std::endl; + } - /*! + /*! Since noise and missing data may prevent the reconstructed shape to have sharp corners well located, the algorithm offers the possibility to automatically relocate points after each edge contraction. The new location of the points is chosen such that the fitting of the output segments to the input points is improved. - */ - void relocate_all_points() { - double timer = clock(); - std::cerr << yellow << "relocate all points" << white << "..."; + */ + void relocate_all_points() { + double timer = clock(); + std::cerr << yellow << "relocate all points" << white << "..."; - m_mindex.clear(); // pqueue must be recomputed + m_mindex.clear(); // pqueue must be recomputed - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); - v != m_dt.finite_vertices_end(); ++v) { - if (v->pinned()) - continue; - v->relocated() = compute_relocation(v); - } - - for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); - v != m_dt.finite_vertices_end(); ++v) { - if (v->pinned()) - continue; - if (v->point() == v->relocated()) - continue; - - Edge_vector hull; - m_dt.get_edges_from_star_minus_link(v, hull, false); - bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), - hull.end()); - - if (ok) { - // do relocation - FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); - relocate_one_vertex(v); - FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); - - // undo relocation - if (norm_bef < norm_aft) - relocate_one_vertex(v); - } - } - - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + v->relocated() = compute_relocation(v); } + for (Finite_vertices_iterator v = m_dt.finite_vertices_begin(); + v != m_dt.finite_vertices_end(); ++v) { + if (v->pinned()) + continue; + if (v->point() == v->relocated()) + continue; + + Edge_vector hull; + m_dt.get_edges_from_star_minus_link(v, hull, false); + bool ok = m_dt.is_in_kernel(v->relocated(), hull.begin(), + hull.end()); + + if (ok) { + // do relocation + FT norm_bef = m_dt.compute_cost_around_vertex(v).norm(); + relocate_one_vertex(v); + FT norm_aft = m_dt.compute_cost_around_vertex(v).norm(); + + // undo relocation + if (norm_bef < norm_aft) + relocate_one_vertex(v); + } + } + + std::cerr << yellow << "done" << white << " (" << yellow + << time_duration(timer) << white << " s)" << std::endl; + } + /// @} - /// \name Output - /// @{ + /// \name Output + /// @{ - /*! + /*! Writes the points and segments of the output simplex in an indexed format into output iterators. \tparam PointOutputIterator An output iterator with value type `Point`. \tparam IndexOutputIterator An output iterator with value type `std::size_t` @@ -1510,73 +1510,73 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { \param points The output iterator for all points \param isolated_points The output iterator for the indices of isolated points \param segments The output iterator for the pairs of segment indices - */ + */ template + typename IndexOutputIterator, + typename IndexPairOutputIterator> CGAL::cpp11::tuple + IndexOutputIterator, + IndexPairOutputIterator> indexed_output(PointOutputIterator points, - IndexOutputIterator isolated_points, - IndexPairOutputIterator segments) { + IndexOutputIterator isolated_points, + IndexPairOutputIterator segments) { - typedef typename Gt::Segment_2 Segment; - std::vector isolated_points_; - std::vector edges; + typedef typename Gt::Segment_2 Segment; + std::vector isolated_points_; + std::vector edges; - list_output ( - std::back_inserter(isolated_points_), std::back_inserter(edges)); + list_output ( + std::back_inserter(isolated_points_), std::back_inserter(edges)); - // vertices_of_edges - std::set edge_vertices; - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { + // vertices_of_edges + std::set edge_vertices; + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { - Point a = (*it).source(); - Point b = (*it).target(); + Point a = (*it).source(); + Point b = (*it).target(); - edge_vertices.insert(a); - edge_vertices.insert(b); - } - - std::size_t count_points = 0; - for (typename std::set::iterator it = edge_vertices.begin(); - it != edge_vertices.end(); it++) { - - *points++ = *it; - ++count_points; - } - - for (typename std::vector::iterator it = isolated_points_.begin(); - it != isolated_points_.end(); it++) { - - *isolated_points++ = count_points; - *points++ = *it; - ++count_points; - } - - for (typename std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - - Point const& a = it->source(); - Point const& b = it->target(); - - typename std::set::iterator it_a = edge_vertices.find(a); - typename std::set::iterator it_b = edge_vertices.find(b); - - std::size_t pos_a = std::distance(edge_vertices.begin(), it_a); - std::size_t pos_b = std::distance(edge_vertices.begin(), it_b); - - *segments++ = std::make_pair(pos_a, pos_b); - } - - return CGAL::cpp11::make_tuple(points, isolated_points, segments); + edge_vertices.insert(a); + edge_vertices.insert(b); } - /// \cond SKIP_IN_MANUAL + std::size_t count_points = 0; + for (typename std::set::iterator it = edge_vertices.begin(); + it != edge_vertices.end(); it++) { - /*! + *points++ = *it; + ++count_points; + } + + for (typename std::vector::iterator it = isolated_points_.begin(); + it != isolated_points_.end(); it++) { + + *isolated_points++ = count_points; + *points++ = *it; + ++count_points; + } + + for (typename std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + + Point const& a = it->source(); + Point const& b = it->target(); + + typename std::set::iterator it_a = edge_vertices.find(a); + typename std::set::iterator it_b = edge_vertices.find(b); + + std::size_t pos_a = std::distance(edge_vertices.begin(), it_a); + std::size_t pos_b = std::distance(edge_vertices.begin(), it_b); + + *segments++ = std::make_pair(pos_a, pos_b); + } + + return CGAL::cpp11::make_tuple(points, isolated_points, segments); + } + + /// \cond SKIP_IN_MANUAL + + /*! Returns the solid edges and vertices present after the reconstruction process finished. @@ -1587,98 +1587,98 @@ bool create_pedge(const Edge& edge, Rec_edge_2& pedge) { \tparam PointOutputIterator The output iterator type for storing the isolated points \tparam SegmentOutputIterator The output iterator type for storing the edges as segments. - */ - template - void list_output (PointOutputIterator v_it, SegmentOutputIterator e_it) { + */ + template + void list_output (PointOutputIterator v_it, SegmentOutputIterator e_it) { - for (Vertex_iterator vi = m_dt.vertices_begin(); - vi != m_dt.vertices_end(); ++vi) - { + for (Vertex_iterator vi = m_dt.vertices_begin(); + vi != m_dt.vertices_end(); ++vi) + { - bool incident_edges_have_sample = false; - typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); - typename Triangulation::Edge_circulator cur = start; + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = m_dt.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; - do { - if (!m_dt.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) { - Point p = (*vi).point(); - *v_it = p; - v_it++; - } - } + do { + if (!m_dt.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; } + ++cur; + } while (cur != start); - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) - { - Edge edge = *ei; - if (m_dt.is_ghost(edge)) - continue; - - int index = edge.second; - Vertex_handle source = edge.first->vertex( (index+1)%3 ); - Vertex_handle target = edge.first->vertex( (index+2)%3 ); - - typename Gt::Segment_2 s(source->point(), target->point()); - *e_it = s; - e_it++; + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) { + Point p = (*vi).point(); + *v_it = p; + v_it++; } - - + } } - /// \endcond + for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei) + { + Edge edge = *ei; + if (m_dt.is_ghost(edge)) + continue; + int index = edge.second; + Vertex_handle source = edge.first->vertex( (index+1)%3 ); + Vertex_handle target = edge.first->vertex( (index+2)%3 ); - /// \cond SKIP_IN_MANUAL - void extract_tds_output(Triangulation& rt2) { - rt2 = m_dt; - //mark vertices - for (Vertex_iterator vi = rt2.vertices_begin(); - vi != rt2.vertices_end(); ++vi) - { - - bool incident_edges_have_sample = false; - typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); - typename Triangulation::Edge_circulator cur = start; - - do { - if (!rt2.is_ghost(*cur)) { - incident_edges_have_sample = true; - break; - } - ++cur; - } while (cur != start); - - if (!incident_edges_have_sample) { - if ((*vi).has_sample_assigned()) - (*vi).set_relevance(1); - } - } - - - // mark edges - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) - { - Edge edge = *ei; - FT relevance = 0; - if (!rt2.is_ghost(edge)) { - relevance = rt2.get_edge_relevance(edge); // >= 0 - } - edge.first->relevance(edge.second) = relevance; - } + typename Gt::Segment_2 s(source->point(), target->point()); + *e_it = s; + e_it++; } + } + /// \endcond + + + + /// \cond SKIP_IN_MANUAL + void extract_tds_output(Triangulation& rt2) { + rt2 = m_dt; + //mark vertices + for (Vertex_iterator vi = rt2.vertices_begin(); + vi != rt2.vertices_end(); ++vi) + { + + bool incident_edges_have_sample = false; + typename Triangulation::Edge_circulator start = rt2.incident_edges(vi); + typename Triangulation::Edge_circulator cur = start; + + do { + if (!rt2.is_ghost(*cur)) { + incident_edges_have_sample = true; + break; + } + ++cur; + } while (cur != start); + + if (!incident_edges_have_sample) { + if ((*vi).has_sample_assigned()) + (*vi).set_relevance(1); + } + } + + + // mark edges + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); ei != rt2.finite_edges_end(); ++ei) + { + Edge edge = *ei; + FT relevance = 0; + if (!rt2.is_ghost(edge)) { + relevance = rt2.get_edge_relevance(edge); // >= 0 + } + edge.first->relevance(edge.second) = relevance; + } + } + + /// \endcond - /// @} + /// @} }; } diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index f4cc842417a..7ccd46139a2 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -71,1013 +71,1013 @@ namespace CGAL { /// The vertex class must derive from Reconstruction_vertex_base_2. /// The face class must derive from Reconstruction_face_base_2. template, - Reconstruction_face_base_2 > > +class Tds_ = Triangulation_data_structure_2< +Reconstruction_vertex_base_2, +Reconstruction_face_base_2 > > class Reconstruction_triangulation_2: public Delaunay_triangulation_2 { +Tds_> { public: - typedef Delaunay_triangulation_2 Base; + typedef Delaunay_triangulation_2 Base; - typedef typename Kernel::FT FT; - typedef typename Kernel::Point_2 Point; - typedef typename Kernel::Vector_2 Vector; - typedef typename Kernel::Ray_2 Ray; - typedef typename Kernel::Line_2 Line; - typedef typename Kernel::Segment_2 Segment; - typedef typename Kernel::Triangle_2 Triangle; + typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; + typedef typename Kernel::Vector_2 Vector; + typedef typename Kernel::Ray_2 Ray; + typedef typename Kernel::Line_2 Line; + typedef typename Kernel::Segment_2 Segment; + typedef typename Kernel::Triangle_2 Triangle; - typedef typename Base::Vertex Vertex; - typedef typename Base::Vertex_handle Vertex_handle; - typedef typename Base::Vertex_iterator Vertex_iterator; - typedef typename Base::Vertex_circulator Vertex_circulator; - typedef typename Base::Finite_vertices_iterator Finite_vertices_iterator; + typedef typename Base::Vertex Vertex; + typedef typename Base::Vertex_handle Vertex_handle; + typedef typename Base::Vertex_iterator Vertex_iterator; + typedef typename Base::Vertex_circulator Vertex_circulator; + typedef typename Base::Finite_vertices_iterator Finite_vertices_iterator; - typedef typename Base::Edge Edge; - typedef typename Base::Edge_iterator Edge_iterator; - typedef typename Base::Edge_circulator Edge_circulator; - typedef typename Base::Finite_edges_iterator Finite_edges_iterator; + typedef typename Base::Edge Edge; + typedef typename Base::Edge_iterator Edge_iterator; + typedef typename Base::Edge_circulator Edge_circulator; + typedef typename Base::Finite_edges_iterator Finite_edges_iterator; - typedef typename Base::Face Face; - typedef typename Base::Face_handle Face_handle; - typedef typename Base::Face_iterator Face_iterator; - typedef typename Base::Face_circulator Face_circulator; - typedef typename Base::Finite_faces_iterator Finite_faces_iterator; + typedef typename Base::Face Face; + typedef typename Base::Face_handle Face_handle; + typedef typename Base::Face_iterator Face_iterator; + typedef typename Base::Face_circulator Face_circulator; + typedef typename Base::Finite_faces_iterator Finite_faces_iterator; - typedef std::map > Vertex_handle_map; - typedef std::map > - Face_handle_map; + typedef std::map > Vertex_handle_map; + typedef std::map > + Face_handle_map; - typedef std::set > - Vertex_handle_set; - typedef std::set > Edge_set; + typedef std::set > + Vertex_handle_set; + typedef std::set > Edge_set; - typedef std::vector Edge_vector; + typedef std::vector Edge_vector; - typedef std::vector Point_vector; - typedef typename Point_vector::const_iterator Point_vector_const_iterator; + typedef std::vector Point_vector; + typedef typename Point_vector::const_iterator Point_vector_const_iterator; - typedef Cost Cost_; - typedef Sample Sample_; - typedef std::vector Sample_vector; - typedef typename Sample_vector::const_iterator Sample_vector_const_iterator; + typedef Cost Cost_; + typedef Sample Sample_; + typedef std::vector Sample_vector; + typedef typename Sample_vector::const_iterator Sample_vector_const_iterator; - typedef Sample_with_priority PSample; - typedef std::priority_queue, - greater_priority > SQueue; + typedef Sample_with_priority PSample; + typedef std::priority_queue, + greater_priority > SQueue; - typedef Reconstruction_edge_2 - Rec_edge_2; + typedef Reconstruction_edge_2 + Rec_edge_2; - typedef boost::multi_index_container< - Rec_edge_2, - boost::multi_index::indexed_by< - // sort by Rec_edge_2::operator< - boost::multi_index::ordered_unique< boost::multi_index::identity< - Rec_edge_2 > > , - // sort by Rec_edge_2::priority() - boost::multi_index::ordered_non_unique< - boost::multi_index::const_mem_fun< - Rec_edge_2,const FT,&Rec_edge_2::priority> > - > - > MultiIndex; + typedef boost::multi_index_container< + Rec_edge_2, + boost::multi_index::indexed_by< + // sort by Rec_edge_2::operator< + boost::multi_index::ordered_unique< boost::multi_index::identity< + Rec_edge_2 > > , + // sort by Rec_edge_2::priority() + boost::multi_index::ordered_non_unique< + boost::multi_index::const_mem_fun< + Rec_edge_2,const FT,&Rec_edge_2::priority> > + > + > MultiIndex; - double m_factor; // ghost vs solid + double m_factor; // ghost vs solid public: - Reconstruction_triangulation_2() { - m_factor = 1.0; - } + Reconstruction_triangulation_2() { + m_factor = 1.0; + } - ~Reconstruction_triangulation_2() { - } + ~Reconstruction_triangulation_2() { + } - double& ghost_factor() { - return m_factor; - } + double& ghost_factor() { + return m_factor; + } - const double& ghost_factor() const { - return m_factor; - } + const double& ghost_factor() const { + return m_factor; + } - Edge random_finite_edge() { + Edge random_finite_edge() { static CGAL::Random rng; - std::size_t nbf = Base::number_of_faces(); - int offset = rng.get_int(0, static_cast(nbf - 1)); - Finite_faces_iterator fi = Base::finite_faces_begin(); - for (int i = 0; i < offset; i++) - fi++; - Face_handle face = fi; + std::size_t nbf = Base::number_of_faces(); + int offset = rng.get_int(0, static_cast(nbf - 1)); + Finite_faces_iterator fi = Base::finite_faces_begin(); + for (int i = 0; i < offset; i++) + fi++; + Face_handle face = fi; int index = rng.get_int(0, 40) % 3; - return Edge(face, index); - } - - // ACCESS // - - Vertex_handle source_vertex(const Edge& edge) const { - return edge.first->vertex(Base::ccw(edge.second)); - } - - Vertex_handle target_vertex(const Edge& edge) const { - return edge.first->vertex(Base::cw(edge.second)); - } - - Vertex_handle opposite_vertex(const Edge& edge) const { - return edge.first->vertex(edge.second); - } - - bool is_pinned(const Edge& edge) const { - Vertex_handle s = source_vertex(edge); - if (s->pinned()) - return true; - return false; - } - - Edge twin_edge(const Edge& edge) const { - Face_handle f = edge.first; - Vertex_handle v = source_vertex(edge); - Face_handle nf = f->neighbor(edge.second); - return Edge(nf, Base::ccw(nf->index(v))); - } - - Edge next_edge(const Edge& edge) const { - Face_handle f = edge.first; - int index = Base::ccw(edge.second); - return Edge(f, index); - } - - Edge prev_edge(const Edge& edge) const { - Face_handle f = edge.first; - int index = Base::cw(edge.second); - return Edge(f, index); - } - - FT get_length(const Edge& edge) const { - Segment segment = get_segment(edge); - return std::sqrt(segment.squared_length()); - } - - Segment get_segment(const Edge& edge) const { - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - return Segment(ps, pt); - } - - Triangle get_triangle(Face_handle face) const { - Vertex_handle v0 = face->vertex(0); - Vertex_handle v1 = face->vertex(1); - Vertex_handle v2 = face->vertex(2); - return Triangle(v0->point(), v1->point(), v2->point()); - } - - // GET LINK // - - void get_vertices_from_edge_link(const Edge& edge, - Vertex_handle_set& vertices) const { - vertices.insert(opposite_vertex(edge)); - vertices.insert(opposite_vertex(twin_edge(edge))); - } - - void get_vertices_from_vertex_link(Vertex_handle vertex, - Vertex_handle_set& vertices) const { - Vertex_circulator vcirc = Base::incident_vertices(vertex); - Vertex_circulator vend = vcirc; - CGAL_For_all(vcirc, vend) - { - Vertex_handle v = vcirc; - vertices.insert(v); - } - } - - // boundary of star(vertex) - // 'outward' chooses the orientation of the boundary - void get_edges_from_star_minus_link(Vertex_handle vertex, Edge_vector& hull, - bool outward = false) const { - Face_circulator fcirc = Base::incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - Edge edge(face, index); - if (outward) - edge = twin_edge(edge); - hull.push_back(edge); - } - } - - // ATTRIBUTES // - - bool is_ghost(const Edge& edge) const { - return edge.first->ghost(edge.second); - } - - int get_plan(const Edge& edge) const { - return edge.first->plan(edge.second); - } - - void set_plan(const Edge& edge, int simplex) { - edge.first->plan(edge.second) = simplex; - } - - FT get_mass(const Edge& edge) const { - return edge.first->mass(edge.second); - } - - void set_mass(const Edge& edge, const FT mass) { - edge.first->mass(edge.second) = mass; - } - - const Cost_& get_cost(const Edge& edge) const { - return edge.first->cost(edge.second); - } - - void set_vertex_cost(const Edge& edge, const Cost_& cost) { - edge.first->vertex_cost(edge.second) = cost; - } - - void set_edge_cost(const Edge& edge, const Cost_& cost) { - edge.first->edge_cost(edge.second) = cost; - } - - FT get_vertex_minus_edge_cost(const Edge& edge) const { - const Cost_& vcost = edge.first->vertex_cost(edge.second); - const Cost_& ecost = edge.first->edge_cost(edge.second); - return vcost.finalize() - m_factor * ecost.finalize(); - } - - FT get_vertex_over_edge_cost(const Edge& edge) const { - FT vvalue = edge.first->vertex_cost(edge.second).finalize(); - FT evalue = edge.first->edge_cost(edge.second).finalize(); - if (evalue == vvalue) - return 1.0 / m_factor; - return vvalue / (m_factor * evalue); - } - - FT get_edge_relevance(const Edge& edge) const { - FT M = get_mass(edge); - if (M == 0.0) - return 0.0; - - FT L = get_length(edge); - FT cost = get_cost(edge).finalize(); - return M * L * L / cost; - } - - FT get_density(const Edge& edge) const { - FT length = get_length(edge); - FT mass = get_mass(edge); - return (mass / length); - } - - unsigned int nb_samples(const Edge& edge) const { - Edge twin = twin_edge(edge); - return edge.first->samples(edge.second).size() - + twin.first->samples(twin.second).size(); - } - - void collect_samples_from_edge(const Edge& edge, Sample_vector& samples) { - const Sample_vector& edge_samples = edge.first->samples(edge.second); - samples.insert(samples.end(), edge_samples.begin(), edge_samples.end()); - } - - void collect_samples_from_vertex(Vertex_handle vertex, Sample_vector& samples, - bool cleanup) { - Face_circulator fcirc = Base::incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - - Edge edge(face, index); - collect_samples_from_edge(edge, samples); - - Edge next = next_edge(edge); - collect_samples_from_edge(next, samples); - - Edge prev = prev_edge(edge); - collect_samples_from_edge(prev, samples); - - if (cleanup) - face->clean_all_samples(); - } - Sample_* sample = vertex->get_sample(); - if (sample) - samples.push_back(sample); - if (cleanup) - vertex->set_sample(NULL); - } - - void collect_all_samples(Sample_vector& samples) { - for (Finite_edges_iterator ei = Base::finite_edges_begin(); - ei != Base::finite_edges_end(); ++ei) { - Edge edge = *ei; - Edge twin = twin_edge(edge); - collect_samples_from_edge(edge, samples); - collect_samples_from_edge(twin, samples); - } - for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); - vi != Base::finite_vertices_end(); ++vi) { - Vertex_handle v = vi; - Sample_* sample = v->get_sample(); - if (sample) - samples.push_back(sample); - } - } - - void cleanup_assignments() { - for (Finite_faces_iterator fi = Base::finite_faces_begin(); - fi != Base::finite_faces_end(); ++fi) { - fi->clean_all_samples(); - } - for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); - vi != Base::finite_vertices_end(); ++vi) { - vi->set_sample(NULL); - } - } - - // COST // - - Cost_ compute_total_cost() const { - Cost_ sum; - for (Finite_edges_iterator ei = Base::finite_edges_begin(); - ei != Base::finite_edges_end(); ++ei) { - Edge edge = *ei; - const Cost_& cost = get_cost(edge); - sum.update_max(cost); - sum.add(cost); - } - return sum; - } - - Cost_ compute_cost_around_vertex(Vertex_handle vertex) const { - Cost_ inner; - Cost_ outer; - Face_circulator fcirc = Base::incident_faces(vertex); - Face_circulator fend = fcirc; - CGAL_For_all(fcirc, fend) - { - Face_handle face = fcirc; - int index = face->index(vertex); - - Edge edge(face, index); - Cost_ cost = get_cost(edge); - outer.update_max(cost); - outer.add(cost); - - edge = next_edge(edge); - cost = get_cost(edge); - inner.update_max(cost); - inner.add(cost); - - edge = next_edge(edge); - cost = get_cost(edge); - inner.update_max(cost); - inner.add(cost); - } - inner.divide(2.0); - - Cost_ sum; - sum.add(inner); - sum.add(outer); - sum.update_max(inner); - sum.update_max(outer); - return sum; - } - - void reset_all_costs() { - for (Finite_edges_iterator ei = Base::finite_edges_begin(); - ei != Base::finite_edges_end(); ++ei) { - Edge edge = *ei; - update_cost(edge); - } - } - - void update_cost(const Edge& edge) { - compute_mass(edge); - compute_edge_cost(edge); - compute_vertex_cost(edge); - select_plan(edge); - } - - void compute_mass(const Edge& edge) { - FT mass = 0.0; - - typename Sample_vector::const_iterator it; - const Sample_vector& samples0 = edge.first->samples(edge.second); - for (it = samples0.begin(); it != samples0.end(); ++it) { - Sample_* sample = *it; - mass += sample->mass(); - } - - Edge twin = twin_edge(edge); - const Sample_vector& samples1 = twin.first->samples(twin.second); - for (it = samples1.begin(); it != samples1.end(); ++it) { - Sample_* sample = *it; - mass += sample->mass(); - } - - set_mass(edge, mass); - set_mass(twin, mass); - } - - void select_plan(const Edge& edge) { - // transport plan: - // 0 - to vertex - // 1 - to edge - - int plan = 0; - FT diff = get_vertex_minus_edge_cost(edge); - if (diff >= 0.0) - plan = 1; - - Edge twin = twin_edge(edge); - set_plan(edge, plan); - set_plan(twin, plan); - } - - void compute_edge_cost(const Edge& edge) { - SQueue squeue; - FT M = get_mass(edge); - FT L = get_length(edge); - sort_samples_from_edge(edge, squeue); - Cost_ cost = compute_cost_from_squeue(squeue, M, L); - - Edge twin = twin_edge(edge); - set_edge_cost(edge, cost); - set_edge_cost(twin, cost); - } - - void sort_samples_from_edge(const Edge& edge, SQueue& squeue) { - typename Sample_vector::const_iterator it; - const Sample_vector& samples0 = edge.first->samples(edge.second); - for (it = samples0.begin(); it != samples0.end(); ++it) { - Sample_* sample = *it; - squeue.push(PSample(sample, sample->coordinate())); - } - - Edge twin = twin_edge(edge); - const Sample_vector& samples1 = twin.first->samples(twin.second); - for (it = samples1.begin(); it != samples1.end(); ++it) { - Sample_* sample = *it; - squeue.push(PSample(sample, 1.0 - sample->coordinate())); - } - } - - Cost_ compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) { - if (squeue.empty()) - return Cost_(); - if (M == 0.0) - return Cost_(); - - Cost_ sum; - FT start = 0.0; - FT coef = L / M; - while (!squeue.empty()) { - PSample psample = squeue.top(); - squeue.pop(); - - FT mass = psample.sample()->mass(); - FT coord = psample.priority() * L; - FT bin = mass * coef; - FT center = start + 0.5 * bin; - FT pos = coord - center; - - FT norm2 = psample.sample()->distance2(); - FT tang2 = bin * bin / 12 + pos * pos; - - sum.add(Cost_(norm2, tang2), mass); - sum.compute_max(norm2, tang2); - - start += bin; - } - return sum; - } - - void compute_vertex_cost(const Edge& edge) { - Edge twin = twin_edge(edge); - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - - Sample_vector samples; - collect_samples_from_edge(edge, samples); - collect_samples_from_edge(twin, samples); - - Cost_ sum; - for (Sample_vector_const_iterator it = samples.begin(); - it != samples.end(); ++it) { - Sample_* sample = *it; - FT mass = sample->mass(); - const Point& query = sample->point(); - - FT Ds = CGAL::squared_distance(query, ps); - FT Dt = CGAL::squared_distance(query, pt); - FT dist2 = ((std::min))(Ds, Dt); - - FT norm2 = sample->distance2(); - FT tang2 = dist2 - norm2; - - sum.add(Cost_(norm2, tang2), mass); - sum.compute_max(norm2, tang2); - } - set_vertex_cost(edge, sum); - set_vertex_cost(twin, sum); - } - - // SAMPLE // - - template // value_type = Sample_* - void assign_samples(Iterator begin, Iterator end) { - for (Iterator it = begin; it != end; ++it) { - Sample_* sample = *it; - assign_sample(sample); - } - } - - template // value_type = Sample_* - void assign_samples_brute_force(Iterator begin, Iterator end) { - for (Iterator it = begin; it != end; ++it) { - Sample_* sample = *it; - assign_sample_brute_force(sample); - } - } - - bool assign_sample(Sample_* sample) { - const Point& point = sample->point(); - Face_handle face = Base::locate(point); - - if (face == Face_handle() || Base::is_infinite(face)) { - std::cout << "free bird" << std::endl; - return false; - } - - Vertex_handle vertex = find_nearest_vertex(point, face); - if (vertex != Vertex_handle()) { - assign_sample_to_vertex(sample, vertex); - return true; - } - - Edge edge = find_nearest_edge(point, face); - assign_sample_to_edge(sample, edge); - return true; - } - - bool assign_sample_brute_force(Sample_* sample) { - const Point& point = sample->point(); - Face_handle nearest_face = Face_handle(); - for (Finite_faces_iterator fi = Base::finite_faces_begin(); - fi != Base::finite_faces_end(); ++fi) { - Face_handle face = fi; - if (face_has_point(face, point)) { - nearest_face = face; - break; - } - } - - if (nearest_face == Face_handle()) { - std::cout << "free bird" << std::endl; - return false; - } - - Vertex_handle vertex = find_nearest_vertex(point, nearest_face); - if (vertex != Vertex_handle()) { - assign_sample_to_vertex(sample, vertex); - return true; - } - - Edge edge = find_nearest_edge(point, nearest_face); - assign_sample_to_edge(sample, edge); - return true; - } - - bool face_has_point(Face_handle face, const Point& query) const { - for (int i = 0; i < 3; ++i) { - Edge edge(face, i); - const Point& ps = source_vertex(edge)->point(); - const Point& pt = target_vertex(edge)->point(); - if (!compute_triangle_ccw(ps, pt, query)) - return false; - } - return true; - } - - Vertex_handle find_nearest_vertex(const Point& point, - Face_handle face) const { - for (int i = 0; i < 3; ++i) { - Vertex_handle vi = face->vertex(i); - const Point& pi = vi->point(); - if (pi == point) - return vi; - } - return Vertex_handle(); - } - - Edge find_nearest_edge(const Point& point, Face_handle face) const { - FT min_dist2 = (std::numeric_limits::max)(); - Edge nearest(Face_handle(), 0); - for (int i = 0; i < 3; ++i) { - Edge edge(face, i); - Segment segment = get_segment(edge); - FT dist2 = compute_distance2(point, segment); - if (dist2 < min_dist2) { - min_dist2 = dist2; - nearest = edge; - } - } - - if (nearest.first == Face_handle()) { - std::cout << "nearest edge not found" << std::endl; - } - return nearest; - } - - void assign_sample_to_vertex(Sample_* sample, Vertex_handle vertex) { - if (vertex->get_sample()) { - std::cout << "assign to vertex: vertex already has sample" - << std::endl; - } - - sample->distance2() = 0.0; - sample->coordinate() = 0.0; - vertex->set_sample(sample); - } - - void assign_sample_to_edge(Sample_* sample, const Edge& edge) { - Segment segment = get_segment(edge); - const Point& query = sample->point(); - sample->distance2() = compute_distance2(query, segment); - sample->coordinate() = compute_coordinate(query, segment); - edge.first->add_sample(edge.second, sample); - } - - FT compute_distance2(const Point& query, const Segment& segment) const { - Line line = segment.supporting_line(); - if (line.has_on(query)) - return 0.0; - - Point proj = line.projection(query); - return CGAL::squared_distance(query, proj); - } - - FT compute_coordinate(const Point& q, const Segment& segment) const { - const Point& p0 = segment.source(); - const Point& p1 = segment.target(); - Vector p0p1 = p1 - p0; - Vector p0q = q - p0; - FT t = (p0q * p0p1) / (p0p1 * p0p1); - return t; // [0,1] - } - - // SIGNED DISTANCE // - - // signed distance from line(a,b) to point t - FT signed_distance(Vertex_handle a, Vertex_handle b, - Vertex_handle t) const { - const Point& pa = a->point(); - const Point& pb = b->point(); - const Point& pt = t->point(); - return compute_signed_distance(pa, pb, pt); - } - - // signed distance from line(a,b) to point t - FT compute_signed_distance(const Point& pa, const Point& pb, - const Point& pt) const { - if (pt == pa) - return 0.0; - if (pt == pb) - return 0.0; - if (pa == pb) - return std::sqrt(CGAL::squared_distance(pa, pt)); - - Vector vab = pb - pa; - vab = vab / sqrt(vab * vab); - Vector vab90(-vab.y(), vab.x()); - Vector vat = pt - pa; - return (vat * vab90); - } - - // signed distance from t to the intersection of line(a,b) and line(t,s) - FT signed_distance_from_intersection(Vertex_handle a, Vertex_handle b, - Vertex_handle t, Vertex_handle s) const { - const Point& pa = a->point(); - const Point& pb = b->point(); - const Point& pt = t->point(); - const Point& ps = s->point(); - return compute_signed_distance_from_intersection(pa, pb, pt, ps); - } - - // signed distance from t to the intersection of line(a,b) and line(t,s) - FT compute_signed_distance_from_intersection(const Point& pa, - const Point& pb, const Point& pt, const Point& ps) const { - FT Dabt = compute_signed_distance(pa, pb, pt); - if (Dabt == 0.0) - return 0.0; - - Line lab(pa, pb - pa); - Line lts(pt, ps - pt); - - FT Dqt = (std::numeric_limits::max)(); - CGAL::Object result = CGAL::intersection(lab, lts); - const Point* iq = CGAL::object_cast(&result); - if (iq) - Dqt = std::sqrt(CGAL::squared_distance(*iq, pt)); - - if (Dabt < 0.0) - Dqt = -Dqt; - return Dqt; - } - - bool is_triangle_ccw(Vertex_handle a, Vertex_handle b, - Vertex_handle c) const { - const Point& pa = a->point(); - const Point& pb = b->point(); - const Point& pc = c->point(); - return compute_triangle_ccw(pa, pb, pc); - } - - bool compute_triangle_ccw(const Point& pa, const Point& pb, - const Point& pc) const { - FT dist = compute_signed_distance(pa, pb, pc); - return (dist > -EPS); - } - - // COMBINATORIAL TESTS // - - // (a,b) is cyclic if (a,b,c) and (a,c,b) exist - bool is_edge_cyclic(const Edge& edge) const { - Vertex_handle f = opposite_vertex(edge); - Vertex_handle b = opposite_vertex(twin_edge(edge)); - return (f == b); - } - - // b from (a,b) is cyclic if (a,b,c) and (b,a,c) exist - bool is_target_cyclic(const Edge& edge) const { - if (!is_edge_cyclic(edge)) - return false; - - Edge twin = twin_edge(edge); - Edge prev = prev_edge(twin); - Face_handle fp = prev.first->neighbor(prev.second); - Face_handle ft = twin.first->neighbor(twin.second); - return (fp == ft); - } - - bool is_flippable(const Edge& edge) const { - Edge twin = twin_edge(edge); - if (Base::is_infinite(twin.first)) - return false; - if (Base::is_infinite(edge.first)) - return false; - - Vertex_handle vs = source_vertex(edge); - Vertex_handle vt = target_vertex(edge); - Vertex_handle vf = opposite_vertex(edge); - Vertex_handle vb = opposite_vertex(twin); - - if (!is_triangle_ccw(vs, vb, vf)) - return false; - if (!is_triangle_ccw(vt, vf, vb)) - return false; - return true; - } - - bool is_collapsible(const Edge& edge) const { - if (!check_link_test(edge)) - return false; - if (!check_kernel_test(edge)) - return false; - return true; - } - - bool check_link_test(const Edge& edge) const { - Vertex_handle s = source_vertex(edge); - Vertex_handle t = target_vertex(edge); - - if (s == t) - return false; - typename Vertex_handle_set::const_iterator it; - - Vertex_handle_set svertices; - get_vertices_from_vertex_link(s, svertices); - - Vertex_handle_set tvertices; - get_vertices_from_vertex_link(t, tvertices); - - // link(s) inter link(t) - Vertex_handle_set ivertices; - for (it = svertices.begin(); it != svertices.end(); ++it) { - Vertex_handle v = *it; - if (tvertices.find(v) != tvertices.end()) - ivertices.insert(v); - } - - Vertex_handle_set evertices; - get_vertices_from_edge_link(edge, evertices); - - // link(edge) =? link(s) inter link(t) - if (evertices.size() != ivertices.size()) - return false; - - for (it = evertices.begin(); it != evertices.end(); ++it) { - Vertex_handle v = *it; - if (ivertices.find(v) == ivertices.end()) - return false; - } - return true; - } - - bool check_kernel_test(const Edge& edge) const { - Vertex_handle s = source_vertex(edge); - Vertex_handle t = target_vertex(edge); - - Edge_vector hull; - get_edges_from_star_minus_link(s, hull); - return is_in_kernel(t->point(), hull.begin(), hull.end()); - } - - template // value_type = Edge - bool is_in_kernel(const Point& query, Iterator begin, Iterator end) const { - for (Iterator it = begin; it != end; ++it) { - Edge edge = *it; - const Point& pa = source_vertex(edge)->point(); - const Point& pb = target_vertex(edge)->point(); - if (!compute_triangle_ccw(pa, pb, query)) - return false; - } - return true; - } - - // COLLAPSE // - - // (s,a,b) + (s,b,c) -> (s,a,c) + (a,b,c) - // st = (source,target) from 'make_collapsible' - // return (a,c) - Edge flip(const Edge& sb, Edge& st, int /*verbose*/ = 0) { - Vertex_handle t = target_vertex(st); - - Edge sc = twin_edge(prev_edge(sb)); - Base::tds().flip(sb.first, sb.second); - Edge ac = prev_edge(twin_edge(sc)); - - Vertex_handle a = source_vertex(ac); - if (a == t) - st = prev_edge(ac); - - return ac; - } - - void collapse(const Edge& edge, int /*verbose*/ = 0) { - if (is_edge_cyclic(edge)) { - collapse_cyclic_edge(edge); - return; - } - - Edge twin = twin_edge(edge); - Base::tds().join_vertices(twin); - } - - // (a,b,c) + (c,b,a) + (a,c,i) + (c,a,j) -> - // (a,c,i) + (c,a,j) - void collapse_cyclic_edge(const Edge& bc, int verbose = 1) { - if (verbose > 0) - std::cout << "collapse_cyclic_edge ... "; - - Edge cb = twin_edge(bc); - Face_handle abc = bc.first; - Face_handle cba = cb.first; - - Vertex_handle b = source_vertex(bc); - Vertex_handle c = target_vertex(bc); - Vertex_handle a = opposite_vertex(bc); - - Edge ac = twin_edge(next_edge(bc)); - Edge ca = twin_edge(prev_edge(cb)); - - a->set_face(ac.first); - c->set_face(ca.first); - ac.first->set_neighbor(ac.second, ca.first); - ca.first->set_neighbor(ca.second, ac.first); - - this->delete_face(abc); - this->delete_face(cba); - this->delete_vertex(b); - - if (verbose > 0) - std::cout << "done" << std::endl; - } - - //TODO IV remove -------- - void print_edge(Rec_edge_2 edge) { - int i = ((edge).edge()).second; - Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); - Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); - std::cout <<"( " << (edge).priority() << ") ( " << a << " , " << b << " )" << std::endl; - } - //-------- - - template // value_type = Edge - bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) - { - Vertex_handle source = source_vertex(edge); - Vertex_handle target = target_vertex(edge); - - MultiIndex multi_ind; - for (Iterator it = begin; it != end; ++it) - { - Edge ab = twin_edge(*it); - Vertex_handle a = source_vertex(ab); - Vertex_handle b = target_vertex(ab); - FT D = signed_distance_from_intersection(a, b, target, source); - if (D < 0.0) { - multi_ind.insert(Rec_edge_2(ab, D)); - } - } - - - int nb_flips = 0; - while (!multi_ind.empty()) - { - Rec_edge_2 pedge = *(multi_ind.template get<1>()).begin(); - FT Dbc = pedge.priority(); - Edge bc = pedge.edge(); - (multi_ind.template get<0>()).erase(pedge); - - Edge sb = prev_edge(bc); - Edge ab = prev_edge(twin_edge(sb)); - Edge sc = twin_edge(next_edge(bc)); - Edge cd = next_edge(sc); - - Vertex_handle a = source_vertex(ab); - Vertex_handle b = source_vertex(bc); - Vertex_handle c = target_vertex(bc); - Vertex_handle d = target_vertex(cd); - - FT Dac = -(std::numeric_limits::max)(); - if (a != c && is_triangle_ccw(a, b, c)) - Dac = signed_distance_from_intersection(a, c, target, source); - - FT Dbd = -(std::numeric_limits::max)(); - if (b != d && is_triangle_ccw(b, c, d)) - Dbd = signed_distance_from_intersection(b, d, target, source); - - if (Dac == -(std::numeric_limits::max)() && Dbd == - -(std::numeric_limits::max)()) - { - // TODO: IV comment in std::cerr << red << "--- - //No flips available ---" << white << std::endl; - std::cerr << "--- No flips available ---" << std::endl; - return false; - } - - if ((std::max)(Dac, Dbd) + EPS < Dbc) - { - std::cerr.precision(10); - // TODO: IV comment in std::cerr << red << "-- - //- Flip makes kernel worse ---" << white << std::endl; - std::cerr << "--- Flip makes kernel worse ---" - << std::endl; - std::cerr << Dac << " or " << Dbd << " vs " - << Dbc << std::endl; - std::cerr << "a: " << a->point() << std::endl; - std::cerr << "b: " << b->point() << std::endl; - std::cerr << "c: " << c->point() << std::endl; - std::cerr << "d: " << d->point() << std::endl; - std::cerr << "t: " << target->point() << std::endl; - std::cerr << "diff = " << Dbc - (std::max)(Dac, Dbd) << std::endl; - return false; - } - - if (Dac > Dbd) - { - (multi_ind.template get<0>()).erase(Rec_edge_2(ab)); - - Edge ac = flip(sb, edge, verbose); - if (Dac < 0.0) { - multi_ind.insert(Rec_edge_2(ac, Dac)); - } - } - else - { - (multi_ind.template get<0>()).erase(Rec_edge_2(cd)); - Edge bd = flip(sc, edge, verbose); - if (Dbd < 0.0) { - multi_ind.insert(Rec_edge_2(bd, Dbd)); - } - } - nb_flips++; - } - - if (verbose > 1) - //TODO: IV Comment in std::cerr << red << "--- - //Flip makes kernel worse ---" << white << std::endl; - std::cerr << "Nb flips: " << nb_flips << std::endl; - - return true; - } + return Edge(face, index); + } + + // ACCESS // + + Vertex_handle source_vertex(const Edge& edge) const { + return edge.first->vertex(Base::ccw(edge.second)); + } + + Vertex_handle target_vertex(const Edge& edge) const { + return edge.first->vertex(Base::cw(edge.second)); + } + + Vertex_handle opposite_vertex(const Edge& edge) const { + return edge.first->vertex(edge.second); + } + + bool is_pinned(const Edge& edge) const { + Vertex_handle s = source_vertex(edge); + if (s->pinned()) + return true; + return false; + } + + Edge twin_edge(const Edge& edge) const { + Face_handle f = edge.first; + Vertex_handle v = source_vertex(edge); + Face_handle nf = f->neighbor(edge.second); + return Edge(nf, Base::ccw(nf->index(v))); + } + + Edge next_edge(const Edge& edge) const { + Face_handle f = edge.first; + int index = Base::ccw(edge.second); + return Edge(f, index); + } + + Edge prev_edge(const Edge& edge) const { + Face_handle f = edge.first; + int index = Base::cw(edge.second); + return Edge(f, index); + } + + FT get_length(const Edge& edge) const { + Segment segment = get_segment(edge); + return std::sqrt(segment.squared_length()); + } + + Segment get_segment(const Edge& edge) const { + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + return Segment(ps, pt); + } + + Triangle get_triangle(Face_handle face) const { + Vertex_handle v0 = face->vertex(0); + Vertex_handle v1 = face->vertex(1); + Vertex_handle v2 = face->vertex(2); + return Triangle(v0->point(), v1->point(), v2->point()); + } + + // GET LINK // + + void get_vertices_from_edge_link(const Edge& edge, + Vertex_handle_set& vertices) const { + vertices.insert(opposite_vertex(edge)); + vertices.insert(opposite_vertex(twin_edge(edge))); + } + + void get_vertices_from_vertex_link(Vertex_handle vertex, + Vertex_handle_set& vertices) const { + Vertex_circulator vcirc = Base::incident_vertices(vertex); + Vertex_circulator vend = vcirc; + CGAL_For_all(vcirc, vend) + { + Vertex_handle v = vcirc; + vertices.insert(v); + } + } + + // boundary of star(vertex) + // 'outward' chooses the orientation of the boundary + void get_edges_from_star_minus_link(Vertex_handle vertex, Edge_vector& hull, + bool outward = false) const { + Face_circulator fcirc = Base::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + Edge edge(face, index); + if (outward) + edge = twin_edge(edge); + hull.push_back(edge); + } + } + + // ATTRIBUTES // + + bool is_ghost(const Edge& edge) const { + return edge.first->ghost(edge.second); + } + + int get_plan(const Edge& edge) const { + return edge.first->plan(edge.second); + } + + void set_plan(const Edge& edge, int simplex) { + edge.first->plan(edge.second) = simplex; + } + + FT get_mass(const Edge& edge) const { + return edge.first->mass(edge.second); + } + + void set_mass(const Edge& edge, const FT mass) { + edge.first->mass(edge.second) = mass; + } + + const Cost_& get_cost(const Edge& edge) const { + return edge.first->cost(edge.second); + } + + void set_vertex_cost(const Edge& edge, const Cost_& cost) { + edge.first->vertex_cost(edge.second) = cost; + } + + void set_edge_cost(const Edge& edge, const Cost_& cost) { + edge.first->edge_cost(edge.second) = cost; + } + + FT get_vertex_minus_edge_cost(const Edge& edge) const { + const Cost_& vcost = edge.first->vertex_cost(edge.second); + const Cost_& ecost = edge.first->edge_cost(edge.second); + return vcost.finalize() - m_factor * ecost.finalize(); + } + + FT get_vertex_over_edge_cost(const Edge& edge) const { + FT vvalue = edge.first->vertex_cost(edge.second).finalize(); + FT evalue = edge.first->edge_cost(edge.second).finalize(); + if (evalue == vvalue) + return 1.0 / m_factor; + return vvalue / (m_factor * evalue); + } + + FT get_edge_relevance(const Edge& edge) const { + FT M = get_mass(edge); + if (M == 0.0) + return 0.0; + + FT L = get_length(edge); + FT cost = get_cost(edge).finalize(); + return M * L * L / cost; + } + + FT get_density(const Edge& edge) const { + FT length = get_length(edge); + FT mass = get_mass(edge); + return (mass / length); + } + + unsigned int nb_samples(const Edge& edge) const { + Edge twin = twin_edge(edge); + return edge.first->samples(edge.second).size() + + twin.first->samples(twin.second).size(); + } + + void collect_samples_from_edge(const Edge& edge, Sample_vector& samples) { + const Sample_vector& edge_samples = edge.first->samples(edge.second); + samples.insert(samples.end(), edge_samples.begin(), edge_samples.end()); + } + + void collect_samples_from_vertex(Vertex_handle vertex, Sample_vector& samples, + bool cleanup) { + Face_circulator fcirc = Base::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + + Edge edge(face, index); + collect_samples_from_edge(edge, samples); + + Edge next = next_edge(edge); + collect_samples_from_edge(next, samples); + + Edge prev = prev_edge(edge); + collect_samples_from_edge(prev, samples); + + if (cleanup) + face->clean_all_samples(); + } + Sample_* sample = vertex->get_sample(); + if (sample) + samples.push_back(sample); + if (cleanup) + vertex->set_sample(NULL); + } + + void collect_all_samples(Sample_vector& samples) { + for (Finite_edges_iterator ei = Base::finite_edges_begin(); + ei != Base::finite_edges_end(); ++ei) { + Edge edge = *ei; + Edge twin = twin_edge(edge); + collect_samples_from_edge(edge, samples); + collect_samples_from_edge(twin, samples); + } + for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); + vi != Base::finite_vertices_end(); ++vi) { + Vertex_handle v = vi; + Sample_* sample = v->get_sample(); + if (sample) + samples.push_back(sample); + } + } + + void cleanup_assignments() { + for (Finite_faces_iterator fi = Base::finite_faces_begin(); + fi != Base::finite_faces_end(); ++fi) { + fi->clean_all_samples(); + } + for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); + vi != Base::finite_vertices_end(); ++vi) { + vi->set_sample(NULL); + } + } + + // COST // + + Cost_ compute_total_cost() const { + Cost_ sum; + for (Finite_edges_iterator ei = Base::finite_edges_begin(); + ei != Base::finite_edges_end(); ++ei) { + Edge edge = *ei; + const Cost_& cost = get_cost(edge); + sum.update_max(cost); + sum.add(cost); + } + return sum; + } + + Cost_ compute_cost_around_vertex(Vertex_handle vertex) const { + Cost_ inner; + Cost_ outer; + Face_circulator fcirc = Base::incident_faces(vertex); + Face_circulator fend = fcirc; + CGAL_For_all(fcirc, fend) + { + Face_handle face = fcirc; + int index = face->index(vertex); + + Edge edge(face, index); + Cost_ cost = get_cost(edge); + outer.update_max(cost); + outer.add(cost); + + edge = next_edge(edge); + cost = get_cost(edge); + inner.update_max(cost); + inner.add(cost); + + edge = next_edge(edge); + cost = get_cost(edge); + inner.update_max(cost); + inner.add(cost); + } + inner.divide(2.0); + + Cost_ sum; + sum.add(inner); + sum.add(outer); + sum.update_max(inner); + sum.update_max(outer); + return sum; + } + + void reset_all_costs() { + for (Finite_edges_iterator ei = Base::finite_edges_begin(); + ei != Base::finite_edges_end(); ++ei) { + Edge edge = *ei; + update_cost(edge); + } + } + + void update_cost(const Edge& edge) { + compute_mass(edge); + compute_edge_cost(edge); + compute_vertex_cost(edge); + select_plan(edge); + } + + void compute_mass(const Edge& edge) { + FT mass = 0.0; + + typename Sample_vector::const_iterator it; + const Sample_vector& samples0 = edge.first->samples(edge.second); + for (it = samples0.begin(); it != samples0.end(); ++it) { + Sample_* sample = *it; + mass += sample->mass(); + } + + Edge twin = twin_edge(edge); + const Sample_vector& samples1 = twin.first->samples(twin.second); + for (it = samples1.begin(); it != samples1.end(); ++it) { + Sample_* sample = *it; + mass += sample->mass(); + } + + set_mass(edge, mass); + set_mass(twin, mass); + } + + void select_plan(const Edge& edge) { + // transport plan: + // 0 - to vertex + // 1 - to edge + + int plan = 0; + FT diff = get_vertex_minus_edge_cost(edge); + if (diff >= 0.0) + plan = 1; + + Edge twin = twin_edge(edge); + set_plan(edge, plan); + set_plan(twin, plan); + } + + void compute_edge_cost(const Edge& edge) { + SQueue squeue; + FT M = get_mass(edge); + FT L = get_length(edge); + sort_samples_from_edge(edge, squeue); + Cost_ cost = compute_cost_from_squeue(squeue, M, L); + + Edge twin = twin_edge(edge); + set_edge_cost(edge, cost); + set_edge_cost(twin, cost); + } + + void sort_samples_from_edge(const Edge& edge, SQueue& squeue) { + typename Sample_vector::const_iterator it; + const Sample_vector& samples0 = edge.first->samples(edge.second); + for (it = samples0.begin(); it != samples0.end(); ++it) { + Sample_* sample = *it; + squeue.push(PSample(sample, sample->coordinate())); + } + + Edge twin = twin_edge(edge); + const Sample_vector& samples1 = twin.first->samples(twin.second); + for (it = samples1.begin(); it != samples1.end(); ++it) { + Sample_* sample = *it; + squeue.push(PSample(sample, 1.0 - sample->coordinate())); + } + } + + Cost_ compute_cost_from_squeue(SQueue& squeue, const FT M, const FT L) { + if (squeue.empty()) + return Cost_(); + if (M == 0.0) + return Cost_(); + + Cost_ sum; + FT start = 0.0; + FT coef = L / M; + while (!squeue.empty()) { + PSample psample = squeue.top(); + squeue.pop(); + + FT mass = psample.sample()->mass(); + FT coord = psample.priority() * L; + FT bin = mass * coef; + FT center = start + 0.5 * bin; + FT pos = coord - center; + + FT norm2 = psample.sample()->distance2(); + FT tang2 = bin * bin / 12 + pos * pos; + + sum.add(Cost_(norm2, tang2), mass); + sum.compute_max(norm2, tang2); + + start += bin; + } + return sum; + } + + void compute_vertex_cost(const Edge& edge) { + Edge twin = twin_edge(edge); + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + + Sample_vector samples; + collect_samples_from_edge(edge, samples); + collect_samples_from_edge(twin, samples); + + Cost_ sum; + for (Sample_vector_const_iterator it = samples.begin(); + it != samples.end(); ++it) { + Sample_* sample = *it; + FT mass = sample->mass(); + const Point& query = sample->point(); + + FT Ds = CGAL::squared_distance(query, ps); + FT Dt = CGAL::squared_distance(query, pt); + FT dist2 = ((std::min))(Ds, Dt); + + FT norm2 = sample->distance2(); + FT tang2 = dist2 - norm2; + + sum.add(Cost_(norm2, tang2), mass); + sum.compute_max(norm2, tang2); + } + set_vertex_cost(edge, sum); + set_vertex_cost(twin, sum); + } + + // SAMPLE // + + template // value_type = Sample_* + void assign_samples(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample_* sample = *it; + assign_sample(sample); + } + } + + template // value_type = Sample_* + void assign_samples_brute_force(Iterator begin, Iterator end) { + for (Iterator it = begin; it != end; ++it) { + Sample_* sample = *it; + assign_sample_brute_force(sample); + } + } + + bool assign_sample(Sample_* sample) { + const Point& point = sample->point(); + Face_handle face = Base::locate(point); + + if (face == Face_handle() || Base::is_infinite(face)) { + std::cout << "free bird" << std::endl; + return false; + } + + Vertex_handle vertex = find_nearest_vertex(point, face); + if (vertex != Vertex_handle()) { + assign_sample_to_vertex(sample, vertex); + return true; + } + + Edge edge = find_nearest_edge(point, face); + assign_sample_to_edge(sample, edge); + return true; + } + + bool assign_sample_brute_force(Sample_* sample) { + const Point& point = sample->point(); + Face_handle nearest_face = Face_handle(); + for (Finite_faces_iterator fi = Base::finite_faces_begin(); + fi != Base::finite_faces_end(); ++fi) { + Face_handle face = fi; + if (face_has_point(face, point)) { + nearest_face = face; + break; + } + } + + if (nearest_face == Face_handle()) { + std::cout << "free bird" << std::endl; + return false; + } + + Vertex_handle vertex = find_nearest_vertex(point, nearest_face); + if (vertex != Vertex_handle()) { + assign_sample_to_vertex(sample, vertex); + return true; + } + + Edge edge = find_nearest_edge(point, nearest_face); + assign_sample_to_edge(sample, edge); + return true; + } + + bool face_has_point(Face_handle face, const Point& query) const { + for (int i = 0; i < 3; ++i) { + Edge edge(face, i); + const Point& ps = source_vertex(edge)->point(); + const Point& pt = target_vertex(edge)->point(); + if (!compute_triangle_ccw(ps, pt, query)) + return false; + } + return true; + } + + Vertex_handle find_nearest_vertex(const Point& point, + Face_handle face) const { + for (int i = 0; i < 3; ++i) { + Vertex_handle vi = face->vertex(i); + const Point& pi = vi->point(); + if (pi == point) + return vi; + } + return Vertex_handle(); + } + + Edge find_nearest_edge(const Point& point, Face_handle face) const { + FT min_dist2 = (std::numeric_limits::max)(); + Edge nearest(Face_handle(), 0); + for (int i = 0; i < 3; ++i) { + Edge edge(face, i); + Segment segment = get_segment(edge); + FT dist2 = compute_distance2(point, segment); + if (dist2 < min_dist2) { + min_dist2 = dist2; + nearest = edge; + } + } + + if (nearest.first == Face_handle()) { + std::cout << "nearest edge not found" << std::endl; + } + return nearest; + } + + void assign_sample_to_vertex(Sample_* sample, Vertex_handle vertex) { + if (vertex->get_sample()) { + std::cout << "assign to vertex: vertex already has sample" + << std::endl; + } + + sample->distance2() = 0.0; + sample->coordinate() = 0.0; + vertex->set_sample(sample); + } + + void assign_sample_to_edge(Sample_* sample, const Edge& edge) { + Segment segment = get_segment(edge); + const Point& query = sample->point(); + sample->distance2() = compute_distance2(query, segment); + sample->coordinate() = compute_coordinate(query, segment); + edge.first->add_sample(edge.second, sample); + } + + FT compute_distance2(const Point& query, const Segment& segment) const { + Line line = segment.supporting_line(); + if (line.has_on(query)) + return 0.0; + + Point proj = line.projection(query); + return CGAL::squared_distance(query, proj); + } + + FT compute_coordinate(const Point& q, const Segment& segment) const { + const Point& p0 = segment.source(); + const Point& p1 = segment.target(); + Vector p0p1 = p1 - p0; + Vector p0q = q - p0; + FT t = (p0q * p0p1) / (p0p1 * p0p1); + return t; // [0,1] + } + + // SIGNED DISTANCE // + + // signed distance from line(a,b) to point t + FT signed_distance(Vertex_handle a, Vertex_handle b, + Vertex_handle t) const { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pt = t->point(); + return compute_signed_distance(pa, pb, pt); + } + + // signed distance from line(a,b) to point t + FT compute_signed_distance(const Point& pa, const Point& pb, + const Point& pt) const { + if (pt == pa) + return 0.0; + if (pt == pb) + return 0.0; + if (pa == pb) + return std::sqrt(CGAL::squared_distance(pa, pt)); + + Vector vab = pb - pa; + vab = vab / sqrt(vab * vab); + Vector vab90(-vab.y(), vab.x()); + Vector vat = pt - pa; + return (vat * vab90); + } + + // signed distance from t to the intersection of line(a,b) and line(t,s) + FT signed_distance_from_intersection(Vertex_handle a, Vertex_handle b, + Vertex_handle t, Vertex_handle s) const { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pt = t->point(); + const Point& ps = s->point(); + return compute_signed_distance_from_intersection(pa, pb, pt, ps); + } + + // signed distance from t to the intersection of line(a,b) and line(t,s) + FT compute_signed_distance_from_intersection(const Point& pa, + const Point& pb, const Point& pt, const Point& ps) const { + FT Dabt = compute_signed_distance(pa, pb, pt); + if (Dabt == 0.0) + return 0.0; + + Line lab(pa, pb - pa); + Line lts(pt, ps - pt); + + FT Dqt = (std::numeric_limits::max)(); + CGAL::Object result = CGAL::intersection(lab, lts); + const Point* iq = CGAL::object_cast(&result); + if (iq) + Dqt = std::sqrt(CGAL::squared_distance(*iq, pt)); + + if (Dabt < 0.0) + Dqt = -Dqt; + return Dqt; + } + + bool is_triangle_ccw(Vertex_handle a, Vertex_handle b, + Vertex_handle c) const { + const Point& pa = a->point(); + const Point& pb = b->point(); + const Point& pc = c->point(); + return compute_triangle_ccw(pa, pb, pc); + } + + bool compute_triangle_ccw(const Point& pa, const Point& pb, + const Point& pc) const { + FT dist = compute_signed_distance(pa, pb, pc); + return (dist > -EPS); + } + + // COMBINATORIAL TESTS // + + // (a,b) is cyclic if (a,b,c) and (a,c,b) exist + bool is_edge_cyclic(const Edge& edge) const { + Vertex_handle f = opposite_vertex(edge); + Vertex_handle b = opposite_vertex(twin_edge(edge)); + return (f == b); + } + + // b from (a,b) is cyclic if (a,b,c) and (b,a,c) exist + bool is_target_cyclic(const Edge& edge) const { + if (!is_edge_cyclic(edge)) + return false; + + Edge twin = twin_edge(edge); + Edge prev = prev_edge(twin); + Face_handle fp = prev.first->neighbor(prev.second); + Face_handle ft = twin.first->neighbor(twin.second); + return (fp == ft); + } + + bool is_flippable(const Edge& edge) const { + Edge twin = twin_edge(edge); + if (Base::is_infinite(twin.first)) + return false; + if (Base::is_infinite(edge.first)) + return false; + + Vertex_handle vs = source_vertex(edge); + Vertex_handle vt = target_vertex(edge); + Vertex_handle vf = opposite_vertex(edge); + Vertex_handle vb = opposite_vertex(twin); + + if (!is_triangle_ccw(vs, vb, vf)) + return false; + if (!is_triangle_ccw(vt, vf, vb)) + return false; + return true; + } + + bool is_collapsible(const Edge& edge) const { + if (!check_link_test(edge)) + return false; + if (!check_kernel_test(edge)) + return false; + return true; + } + + bool check_link_test(const Edge& edge) const { + Vertex_handle s = source_vertex(edge); + Vertex_handle t = target_vertex(edge); + + if (s == t) + return false; + typename Vertex_handle_set::const_iterator it; + + Vertex_handle_set svertices; + get_vertices_from_vertex_link(s, svertices); + + Vertex_handle_set tvertices; + get_vertices_from_vertex_link(t, tvertices); + + // link(s) inter link(t) + Vertex_handle_set ivertices; + for (it = svertices.begin(); it != svertices.end(); ++it) { + Vertex_handle v = *it; + if (tvertices.find(v) != tvertices.end()) + ivertices.insert(v); + } + + Vertex_handle_set evertices; + get_vertices_from_edge_link(edge, evertices); + + // link(edge) =? link(s) inter link(t) + if (evertices.size() != ivertices.size()) + return false; + + for (it = evertices.begin(); it != evertices.end(); ++it) { + Vertex_handle v = *it; + if (ivertices.find(v) == ivertices.end()) + return false; + } + return true; + } + + bool check_kernel_test(const Edge& edge) const { + Vertex_handle s = source_vertex(edge); + Vertex_handle t = target_vertex(edge); + + Edge_vector hull; + get_edges_from_star_minus_link(s, hull); + return is_in_kernel(t->point(), hull.begin(), hull.end()); + } + + template // value_type = Edge + bool is_in_kernel(const Point& query, Iterator begin, Iterator end) const { + for (Iterator it = begin; it != end; ++it) { + Edge edge = *it; + const Point& pa = source_vertex(edge)->point(); + const Point& pb = target_vertex(edge)->point(); + if (!compute_triangle_ccw(pa, pb, query)) + return false; + } + return true; + } + + // COLLAPSE // + + // (s,a,b) + (s,b,c) -> (s,a,c) + (a,b,c) + // st = (source,target) from 'make_collapsible' + // return (a,c) + Edge flip(const Edge& sb, Edge& st, int /*verbose*/ = 0) { + Vertex_handle t = target_vertex(st); + + Edge sc = twin_edge(prev_edge(sb)); + Base::tds().flip(sb.first, sb.second); + Edge ac = prev_edge(twin_edge(sc)); + + Vertex_handle a = source_vertex(ac); + if (a == t) + st = prev_edge(ac); + + return ac; + } + + void collapse(const Edge& edge, int /*verbose*/ = 0) { + if (is_edge_cyclic(edge)) { + collapse_cyclic_edge(edge); + return; + } + + Edge twin = twin_edge(edge); + Base::tds().join_vertices(twin); + } + + // (a,b,c) + (c,b,a) + (a,c,i) + (c,a,j) -> + // (a,c,i) + (c,a,j) + void collapse_cyclic_edge(const Edge& bc, int verbose = 1) { + if (verbose > 0) + std::cout << "collapse_cyclic_edge ... "; + + Edge cb = twin_edge(bc); + Face_handle abc = bc.first; + Face_handle cba = cb.first; + + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle a = opposite_vertex(bc); + + Edge ac = twin_edge(next_edge(bc)); + Edge ca = twin_edge(prev_edge(cb)); + + a->set_face(ac.first); + c->set_face(ca.first); + ac.first->set_neighbor(ac.second, ca.first); + ca.first->set_neighbor(ca.second, ac.first); + + this->delete_face(abc); + this->delete_face(cba); + this->delete_vertex(b); + + if (verbose > 0) + std::cout << "done" << std::endl; + } + + //TODO IV remove -------- + void print_edge(Rec_edge_2 edge) { + int i = ((edge).edge()).second; + Point a = ((edge).edge()).first->vertex((i+1)%3)->point(); + Point b = ((edge).edge()).first->vertex((i+2)%3)->point(); + std::cout <<"( " << (edge).priority() << ") ( " << a << " , " << b << " )" << std::endl; + } + //-------- + + template // value_type = Edge + bool make_collapsible(Edge& edge, Iterator begin, Iterator end, int verbose = 0) + { + Vertex_handle source = source_vertex(edge); + Vertex_handle target = target_vertex(edge); + + MultiIndex multi_ind; + for (Iterator it = begin; it != end; ++it) + { + Edge ab = twin_edge(*it); + Vertex_handle a = source_vertex(ab); + Vertex_handle b = target_vertex(ab); + FT D = signed_distance_from_intersection(a, b, target, source); + if (D < 0.0) { + multi_ind.insert(Rec_edge_2(ab, D)); + } + } + + + int nb_flips = 0; + while (!multi_ind.empty()) + { + Rec_edge_2 pedge = *(multi_ind.template get<1>()).begin(); + FT Dbc = pedge.priority(); + Edge bc = pedge.edge(); + (multi_ind.template get<0>()).erase(pedge); + + Edge sb = prev_edge(bc); + Edge ab = prev_edge(twin_edge(sb)); + Edge sc = twin_edge(next_edge(bc)); + Edge cd = next_edge(sc); + + Vertex_handle a = source_vertex(ab); + Vertex_handle b = source_vertex(bc); + Vertex_handle c = target_vertex(bc); + Vertex_handle d = target_vertex(cd); + + FT Dac = -(std::numeric_limits::max)(); + if (a != c && is_triangle_ccw(a, b, c)) + Dac = signed_distance_from_intersection(a, c, target, source); + + FT Dbd = -(std::numeric_limits::max)(); + if (b != d && is_triangle_ccw(b, c, d)) + Dbd = signed_distance_from_intersection(b, d, target, source); + + if (Dac == -(std::numeric_limits::max)() && Dbd == + -(std::numeric_limits::max)()) + { + // TODO: IV comment in std::cerr << red << "--- + //No flips available ---" << white << std::endl; + std::cerr << "--- No flips available ---" << std::endl; + return false; + } + + if ((std::max)(Dac, Dbd) + EPS < Dbc) + { + std::cerr.precision(10); + // TODO: IV comment in std::cerr << red << "-- + //- Flip makes kernel worse ---" << white << std::endl; + std::cerr << "--- Flip makes kernel worse ---" + << std::endl; + std::cerr << Dac << " or " << Dbd << " vs " + << Dbc << std::endl; + std::cerr << "a: " << a->point() << std::endl; + std::cerr << "b: " << b->point() << std::endl; + std::cerr << "c: " << c->point() << std::endl; + std::cerr << "d: " << d->point() << std::endl; + std::cerr << "t: " << target->point() << std::endl; + std::cerr << "diff = " << Dbc - (std::max)(Dac, Dbd) << std::endl; + return false; + } + + if (Dac > Dbd) + { + (multi_ind.template get<0>()).erase(Rec_edge_2(ab)); + + Edge ac = flip(sb, edge, verbose); + if (Dac < 0.0) { + multi_ind.insert(Rec_edge_2(ac, Dac)); + } + } + else + { + (multi_ind.template get<0>()).erase(Rec_edge_2(cd)); + Edge bd = flip(sc, edge, verbose); + if (Dbd < 0.0) { + multi_ind.insert(Rec_edge_2(bd, Dbd)); + } + } + nb_flips++; + } + + if (verbose > 1) + //TODO: IV Comment in std::cerr << red << "--- + //Flip makes kernel worse ---" << white << std::endl; + std::cerr << "Nb flips: " << nb_flips << std::endl; + + return true; + } }; } //namespace CGAL diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h index 6287e7e4b31..67b61e813ad 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_vertex_base_2.h @@ -35,93 +35,93 @@ template < class Kernel, class Vb = Triangulation_vertex_base_2 > class Reconstruction_vertex_base_2 : public Vb { - /// \cond SKIP_IN_MANUAL + /// \cond SKIP_IN_MANUAL public: - typedef Vb Base; - typedef typename Kernel::FT FT; - typedef Sample Sample_; - typedef typename Kernel::Point_2 Point; - typedef typename Base::Face_handle Face_handle; + typedef Vb Base; + typedef typename Kernel::FT FT; + typedef Sample Sample_; + typedef typename Kernel::Point_2 Point; + typedef typename Base::Face_handle Face_handle; - template < typename TDS2 > - struct Rebind_TDS { - typedef typename Base::template Rebind_TDS::Other Vb2; - typedef Reconstruction_vertex_base_2 Other; - }; + template < typename TDS2 > + struct Rebind_TDS { + typedef typename Base::template Rebind_TDS::Other Vb2; + typedef Reconstruction_vertex_base_2 Other; + }; private: - int m_id; - bool m_pinned; - Sample_* m_sample; - Point m_relocated; - FT m_relevance; + int m_id; + bool m_pinned; + Sample_* m_sample; + Point m_relocated; + FT m_relevance; public: - Reconstruction_vertex_base_2() - : Base() - { - m_id = -1; - m_pinned = false; - m_sample = NULL; - m_relevance = 0; - } + Reconstruction_vertex_base_2() +: Base() +{ + m_id = -1; + m_pinned = false; + m_sample = NULL; + m_relevance = 0; +} - Reconstruction_vertex_base_2(const Point & p) - : Base(p) - { - m_id = -1; - m_pinned = false; - m_sample = NULL; - m_relevance = 0; - } + Reconstruction_vertex_base_2(const Point & p) + : Base(p) + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + m_relevance = 0; + } - Reconstruction_vertex_base_2(Face_handle f) - : Base(f) - { - m_id = -1; - m_pinned = false; - m_sample = NULL; - m_relevance = 0; - } + Reconstruction_vertex_base_2(Face_handle f) + : Base(f) + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + m_relevance = 0; + } - Reconstruction_vertex_base_2(const Point & p, Face_handle f) - : Base(p, f) - { - m_id = -1; - m_pinned = false; - m_sample = NULL; - m_relevance = 0; - } + Reconstruction_vertex_base_2(const Point & p, Face_handle f) + : Base(p, f) + { + m_id = -1; + m_pinned = false; + m_sample = NULL; + m_relevance = 0; + } - virtual ~Reconstruction_vertex_base_2() { } + virtual ~Reconstruction_vertex_base_2() { } - int id() const { return m_id; } - int& id() { return m_id; } + int id() const { return m_id; } + int& id() { return m_id; } - bool pinned() const { return m_pinned; } - bool& pinned() { return m_pinned; } + bool pinned() const { return m_pinned; } + bool& pinned() { return m_pinned; } - FT get_relevance() const { return m_relevance; } - void set_relevance(FT relevance) { m_relevance = relevance; } + FT get_relevance() const { return m_relevance; } + void set_relevance(FT relevance) { m_relevance = relevance; } - Sample_* get_sample() const { return m_sample; } - void set_sample(Sample_* sample) { m_sample = sample; } + Sample_* get_sample() const { return m_sample; } + void set_sample(Sample_* sample) { m_sample = sample; } - const Point& relocated() const { return m_relocated; } - Point& relocated() { return m_relocated; } + const Point& relocated() const { return m_relocated; } + Point& relocated() { return m_relocated; } - bool has_sample_assigned() const { return get_sample() != NULL; } + bool has_sample_assigned() const { return get_sample() != NULL; } }; //---------------STRUCT LESS VERTEX_HANDLE--------------------- template struct less_Vertex_handle { - bool operator() (const T& a, const T& b) const - { - return (a->id() < b->id()); - } + bool operator() (const T& a, const T& b) const + { + return (a->id() < b->id()); + } }; diff --git a/Reconstruction_simplification_2/include/CGAL/Sample.h b/Reconstruction_simplification_2/include/CGAL/Sample.h index 8bb3ab01f1b..d424a635fcf 100644 --- a/Reconstruction_simplification_2/include/CGAL/Sample.h +++ b/Reconstruction_simplification_2/include/CGAL/Sample.h @@ -28,117 +28,117 @@ template class Sample { public: - typedef typename Kernel::FT FT; - typedef typename Kernel::Point_2 Point; - -private: - Point m_point; - FT m_mass; - - FT m_dist2_to_edge; - FT m_coordinate; - - FT m_backup_dist2; - FT m_backup_coord; - -public: - Sample(const Point& point, - const FT mass = 1.0) - { - m_mass = mass; - m_point = point; - - m_dist2_to_edge = 0.0; - m_coordinate = 0.0; - - m_backup_dist2 = 0.0; - m_backup_coord = 0.0; - } + typedef typename Kernel::FT FT; + typedef typename Kernel::Point_2 Point; - Sample(const Sample& sample) - { - m_mass = sample.mass(); - m_point = sample.point(); - - m_dist2_to_edge = 0.0; - m_coordinate = 0.0; - - m_backup_dist2 = 0.0; - m_backup_coord = 0.0; - } - - ~Sample() { } - - const Point& point() const { return m_point; } - Point& point() { return m_point; } - - const FT& mass() const { return m_mass; } - FT& mass() { return m_mass; } - - const FT& distance2() const { return m_dist2_to_edge; } - FT& distance2() { return m_dist2_to_edge; } - - const FT& coordinate() const { return m_coordinate; } - FT& coordinate() { return m_coordinate; } - - void backup() - { - m_backup_dist2 = m_dist2_to_edge; - m_backup_coord = m_coordinate; - } - - void restore() - { - m_dist2_to_edge = m_backup_dist2; - m_coordinate = m_backup_coord; - } +private: + Point m_point; + FT m_mass; + + FT m_dist2_to_edge; + FT m_coordinate; + + FT m_backup_dist2; + FT m_backup_coord; + +public: + Sample(const Point& point, + const FT mass = 1.0) +{ + m_mass = mass; + m_point = point; + + m_dist2_to_edge = 0.0; + m_coordinate = 0.0; + + m_backup_dist2 = 0.0; + m_backup_coord = 0.0; +} + + Sample(const Sample& sample) + { + m_mass = sample.mass(); + m_point = sample.point(); + + m_dist2_to_edge = 0.0; + m_coordinate = 0.0; + + m_backup_dist2 = 0.0; + m_backup_coord = 0.0; + } + + ~Sample() { } + + const Point& point() const { return m_point; } + Point& point() { return m_point; } + + const FT& mass() const { return m_mass; } + FT& mass() { return m_mass; } + + const FT& distance2() const { return m_dist2_to_edge; } + FT& distance2() { return m_dist2_to_edge; } + + const FT& coordinate() const { return m_coordinate; } + FT& coordinate() { return m_coordinate; } + + void backup() + { + m_backup_dist2 = m_dist2_to_edge; + m_backup_coord = m_coordinate; + } + + void restore() + { + m_dist2_to_edge = m_backup_dist2; + m_coordinate = m_backup_coord; + } }; template class Sample_with_priority { public: - typedef typename Sample::FT FT; - + typedef typename Sample::FT FT; + private: - Sample* m_sample; - FT m_priority; - + Sample* m_sample; + FT m_priority; + public: - Sample_with_priority(Sample* sample, const FT priority = 0.0) - { - m_sample = sample; - m_priority = priority; - } - - Sample_with_priority(const Sample_with_priority& psample) - { - m_sample = psample.sample(); - m_priority = psample.priority(); - } - - ~Sample_with_priority() { } - - Sample_with_priority& operator = (const Sample_with_priority& psample) - { - m_sample = psample.sample(); - m_priority = psample.priority(); - return *this; - } - - Sample* sample() const { return m_sample; } - - const FT priority() const { return m_priority; } + Sample_with_priority(Sample* sample, const FT priority = 0.0) +{ + m_sample = sample; + m_priority = priority; +} + + Sample_with_priority(const Sample_with_priority& psample) + { + m_sample = psample.sample(); + m_priority = psample.priority(); + } + + ~Sample_with_priority() { } + + Sample_with_priority& operator = (const Sample_with_priority& psample) + { + m_sample = psample.sample(); + m_priority = psample.priority(); + return *this; + } + + Sample* sample() const { return m_sample; } + + const FT priority() const { return m_priority; } }; template struct greater_priority { - bool operator() (const T& a, const T& b) const - { - return ( a.priority() > b.priority() ); - } + bool operator() (const T& a, const T& b) const + { + return ( a.priority() > b.priority() ); + } }; } //end namespace CGAL diff --git a/Reconstruction_simplification_2/include/CGAL/console_color.h b/Reconstruction_simplification_2/include/CGAL/console_color.h index 0201b098242..50554178257 100644 --- a/Reconstruction_simplification_2/include/CGAL/console_color.h +++ b/Reconstruction_simplification_2/include/CGAL/console_color.h @@ -10,59 +10,59 @@ inline std::ostream& blue(std::ostream &s) { #if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, - FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, + FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); #else - s << "\x1b[0;34m"; + s << "\x1b[0;34m"; #endif - return s; + return s; } inline std::ostream& red(std::ostream &s) { #if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY); + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY); #else - s << "\x1b[0;31m"; + s << "\x1b[0;31m"; #endif - return s; + return s; } inline std::ostream& green(std::ostream &s) { #if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY); + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY); #else - s << "\x1b[0;32m"; + s << "\x1b[0;32m"; #endif - return s; + return s; } inline std::ostream& yellow(std::ostream &s) { #if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, - FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, + FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); #else - s << "\x1b[0;33m"; + s << "\x1b[0;33m"; #endif - return s; + return s; } inline std::ostream& white(std::ostream &s) { #if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, - FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); + HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); + SetConsoleTextAttribute(hStdout, + FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); #else - s << "\x1b[0;37m"; + s << "\x1b[0;37m"; #endif - return s; + return s; } #endif diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp index e6c4f1f10f3..e74e3ee273c 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_basic.cpp @@ -18,13 +18,13 @@ typedef K::FT FT; int main () { - std::vector points; - //use the stair example for testing - load_xy_file_points("data/stair-noise00.xy", points); + std::vector points; + //use the stair example for testing + load_xy_file_points("data/stair-noise00.xy", points); - CGAL::Reconstruction_simplification_2 rs2(points); + CGAL::Reconstruction_simplification_2 rs2(points); - rs2.run(100); //100 steps + rs2.run(100); //100 steps - rs2.print_stats_debug(); + rs2.print_stats_debug(); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp index 45eae036637..c765a4a16d0 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_flip_procedure.cpp @@ -23,22 +23,22 @@ typedef K::FT FT; int main () { - std::vector points; - //use the stair example for testing - load_xy_file_points("data/stair-noise00.xy", points); + std::vector points; + //use the stair example for testing + load_xy_file_points("data/stair-noise00.xy", points); - for (std::size_t i = 1; i <= points.size();) { + for (std::size_t i = 1; i <= points.size();) { - CGAL::Reconstruction_simplification_2 rs2(points); + CGAL::Reconstruction_simplification_2 rs2(points); - rs2.run_until(i); + rs2.run_until(i); - rs2.print_stats_debug(); + rs2.print_stats_debug(); - assert(rs2.number_of_vertices() == i); + assert(rs2.number_of_vertices() == i); - i = i + 20; + i = i + 20; - } + } } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index c71e1364c8f..e6030c4d6e7 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -34,98 +34,98 @@ void test_index_output(Rs_2& rs2); int main () { - std::vector points; - //use the stair example for testing - load_xy_file_points("data/stair-noise00.xy", points); + std::vector points; + //use the stair example for testing + load_xy_file_points("data/stair-noise00.xy", points); - Rs_2 rs2(points); + Rs_2 rs2(points); - rs2.run(100); //100 steps + rs2.run(100); //100 steps - test_list_output(rs2); - test_index_output(rs2); + test_list_output(rs2); + test_index_output(rs2); } void test_index_output(Rs_2& rs2) { - std::cout <<"(-------------OFF OUTPUT---------- )" << std::endl; - - std::vector points; - std::vector isolated_points; - std::vector > edges; - rs2.indexed_output( + std::cout <<"(-------------OFF OUTPUT---------- )" << std::endl; + + std::vector points; + std::vector isolated_points; + std::vector > edges; + rs2.indexed_output( std::back_inserter(points), std::back_inserter(isolated_points), std::back_inserter(edges)); - - std::stringstream sstr; - sstr << "OFF " << points.size() << - " 0 " << edges.size() << std::endl; + std::stringstream sstr; - for (std::vector::iterator it = points.begin(); - it != points.end(); it++) { + sstr << "OFF " << points.size() << + " 0 " << edges.size() << std::endl; - sstr << *it << std::endl; - } + for (std::vector::iterator it = points.begin(); + it != points.end(); it++) { - for (std::vector >::iterator it - = edges.begin(); - it != edges.end(); it++) { + sstr << *it << std::endl; + } - sstr << "2 " << it->first << " " << it->second << std::endl; - } + for (std::vector >::iterator it + = edges.begin(); + it != edges.end(); it++) { - std::cout << sstr.str() << std::endl; + sstr << "2 " << it->first << " " << it->second << std::endl; + } - //print + std::cout << sstr.str() << std::endl; - //test cardinalities + //print - std::vector res; - while (1){ - std::string line; - std::getline(sstr, line); - if (!sstr.good()) - break; - res.push_back(line); - } + //test cardinalities - assert(res.size() == 92); + std::vector res; + while (1){ + std::string line; + std::getline(sstr, line); + if (!sstr.good()) + break; + res.push_back(line); + } - assert(res.front() == "OFF 60 0 31"); + assert(res.size() == 92); - for (int i = 61; i < 92; i++) { - assert(res[i].substr(0,2) == "2 "); - } + assert(res.front() == "OFF 60 0 31"); + + for (int i = 61; i < 92; i++) { + assert(res[i].substr(0,2) == "2 "); + } } void test_list_output(Rs_2& rs2) { - std::cout <<"(-------------List OUTPUT---------- )" << std::endl; + std::cout <<"(-------------List OUTPUT---------- )" << std::endl; - std::vector isolated_points; - std::vector edges; + std::vector isolated_points; + std::vector edges; - rs2.list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); + rs2.list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); - int vertex_count = 0; - for (std::vector::iterator it = isolated_points.begin(); - it != isolated_points.end(); it++) { - vertex_count++; - std::cout << *it << std::endl; - } - assert(vertex_count == 18); + int vertex_count = 0; + for (std::vector::iterator it = isolated_points.begin(); + it != isolated_points.end(); it++) { + vertex_count++; + std::cout << *it << std::endl; + } + assert(vertex_count == 18); - int edge_count = 0; - for (std::vector::iterator it = edges.begin(); - it != edges.end(); it++) { - std::cout << *it << std::endl; - edge_count++; - } - assert(edge_count >= 29 && edge_count <= 33); + int edge_count = 0; + for (std::vector::iterator it = edges.begin(); + it != edges.end(); it++) { + std::cout << *it << std::endl; + edge_count++; + } + assert(edge_count >= 29 && edge_count <= 33); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp index 02d0d6537d8..e7f3a2436a1 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_quality.cpp @@ -29,26 +29,26 @@ typedef CGAL::Second_of_pair_property_map Mass_property_map; int main () { - PointMassList points; - //use the stair example for testing - load_xy_file("data/stair-noise00.xy", points); + PointMassList points; + //use the stair example for testing + load_xy_file("data/stair-noise00.xy", points); - Point_property_map point_pmap; - Mass_property_map mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; - CGAL::Reconstruction_simplification_2 - rs2(points, point_pmap, mass_pmap); + CGAL::Reconstruction_simplification_2 + rs2(points, point_pmap, mass_pmap); - rs2.run_until(9); + rs2.run_until(9); - std::cout << " total_edge_cost "<< rs2.total_edge_cost() << std::endl; + std::cout << " total_edge_cost "<< rs2.total_edge_cost() << std::endl; - assert(rs2.total_edge_cost() < 0.3); - assert(0 < rs2.total_edge_cost()); + assert(rs2.total_edge_cost() < 0.3); + assert(0 < rs2.total_edge_cost()); - rs2.print_stats_debug(); + rs2.print_stats_debug(); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp index e8cd0ff1535..5550813f345 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_reconstruction_until.cpp @@ -25,25 +25,25 @@ typedef K::Segment_2 Segment; int main () { - std::vector points; + std::vector points; - //use the stair example for testing - load_xy_file_points("data/stair-noise00.xy", points); + //use the stair example for testing + load_xy_file_points("data/stair-noise00.xy", points); - CGAL::Reconstruction_simplification_2 rs2(points); + CGAL::Reconstruction_simplification_2 rs2(points); - rs2.run_until(9); + rs2.run_until(9); - rs2.print_stats_debug(); + rs2.print_stats_debug(); - std::vector isolated_points; - std::vector edges; + std::vector isolated_points; + std::vector edges; - rs2.list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); + rs2.list_output (std::back_inserter(isolated_points), std::back_inserter(edges)); - std::cout << "isolated_points " << isolated_points.size() << std::endl; - std::cout << "edges " << edges.size() << std::endl; + std::cout << "isolated_points " << isolated_points.size() << std::endl; + std::cout << "edges " << edges.size() << std::endl; - assert(isolated_points.size() == 0); - assert(edges.size() == 8); + assert(isolated_points.size() == 0); + assert(edges.size() == 8); } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index 3d199426c82..d47f5d3c708 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -44,124 +44,124 @@ void test_edge_collapse(); int main () { - test_num_of_vertices_in_triangulation(); - test_edge_collapse(); + test_num_of_vertices_in_triangulation(); + test_edge_collapse(); } void print_edge(R_edge_2 pedge) { - Edge edge = pedge.edge(); + Edge edge = pedge.edge(); - int i = edge.second; - Point a = edge.first->vertex((i+1)%3)->point(); - Point b = edge.first->vertex((i+2)%3)->point(); - std::cout << a << " , " << b << " : " << pedge.priority() << std::endl; + int i = edge.second; + Point a = edge.first->vertex((i+1)%3)->point(); + Point b = edge.first->vertex((i+2)%3)->point(); + std::cout << a << " , " << b << " : " << pedge.priority() << std::endl; } void test_edge_collapse() { - std::cerr << "test_edge_collapse" << std::endl; + std::cerr << "test_edge_collapse" << std::endl; - PointMassList points; - //use the stair example for testing - load_xy_file("data/stair-noise00.xy", points); + PointMassList points; + //use the stair example for testing + load_xy_file("data/stair-noise00.xy", points); - Point_property_map point_pmap; - Mass_property_map mass_pmap; + Point_property_map point_pmap; + Mass_property_map mass_pmap; - CGAL::Reconstruction_simplification_2 - rs2(points, point_pmap, mass_pmap); + CGAL::Reconstruction_simplification_2 + rs2(points, point_pmap, mass_pmap); - Rt_2 rt2; - rs2.extract_tds_output(rt2); + Rt_2 rt2; + rs2.extract_tds_output(rt2); - FT min_priority = 1000; - R_edge_2 contract_edge; - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); - ei != rt2.finite_edges_end(); ++ei) { + FT min_priority = 1000; + R_edge_2 contract_edge; + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); + ei != rt2.finite_edges_end(); ++ei) { - R_edge_2 cur_r_edge; - if(!rs2.create_pedge(*ei, cur_r_edge)) - continue; + R_edge_2 cur_r_edge; + if(!rs2.create_pedge(*ei, cur_r_edge)) + continue; - print_edge(cur_r_edge); + print_edge(cur_r_edge); - if (cur_r_edge.priority() < min_priority && cur_r_edge.priority() > 0) { - min_priority = cur_r_edge.priority(); - contract_edge = cur_r_edge; - } - } + if (cur_r_edge.priority() < min_priority && cur_r_edge.priority() > 0) { + min_priority = cur_r_edge.priority(); + contract_edge = cur_r_edge; + } + } - R_edge_2 pedge; - rs2.pick_edge(0, pedge); + R_edge_2 pedge; + rs2.pick_edge(0, pedge); - std::cout << "--------" << std::endl; - print_edge(contract_edge); + std::cout << "--------" << std::endl; + print_edge(contract_edge); - print_edge(pedge); + print_edge(pedge); - std::cout << "--------" << std::endl; + std::cout << "--------" << std::endl; - //test that the right edge was picked for collapsing - // N.B.: it can be two different edges if several edges have the same - // priority value. - assert(CGAL::abs(pedge.priority() - contract_edge.priority()) - < pedge.priority()*1e-13); - rs2.do_collapse(contract_edge.edge()); + //test that the right edge was picked for collapsing + // N.B.: it can be two different edges if several edges have the same + // priority value. + assert(CGAL::abs(pedge.priority() - contract_edge.priority()) + < pedge.priority()*1e-13); + rs2.do_collapse(contract_edge.edge()); - bool found = false; - for (Finite_edges_iterator ei = rt2.finite_edges_begin(); - ei != rt2.finite_edges_end(); ++ei) { - if (*ei == contract_edge.edge()) { - found = true; - break; - } - } + bool found = false; + for (Finite_edges_iterator ei = rt2.finite_edges_begin(); + ei != rt2.finite_edges_end(); ++ei) { + if (*ei == contract_edge.edge()) { + found = true; + break; + } + } - //test that the edge was collapsed - assert(!found); - CGAL_USE(found); + //test that the edge was collapsed + assert(!found); + CGAL_USE(found); } void test_num_of_vertices_in_triangulation() { - std::cerr << "test_num_of_vertices_in_triangulation" << std::endl; + std::cerr << "test_num_of_vertices_in_triangulation" << std::endl; - PointMassList points = *(simple_point_set()); + PointMassList points = *(simple_point_set()); - CGAL::Reconstruction_simplification_2 rs2; - int nb = 0; - for (PointMassList::iterator it = points.begin(); it != points.end(); it++) { - PointMassPair pmp = *it; - Point point = pmp.first; - rs2.insert_point(point, false, nb++); - } + CGAL::Reconstruction_simplification_2 rs2; + int nb = 0; + for (PointMassList::iterator it = points.begin(); it != points.end(); it++) { + PointMassPair pmp = *it; + Point point = pmp.first; + rs2.insert_point(point, false, nb++); + } - Rt_2 rt2; - rs2.extract_tds_output(rt2); + Rt_2 rt2; + rs2.extract_tds_output(rt2); - //test if vertices are indeed added to the Reconstruction_triangulation_2 - assert(points.size() == rt2.number_of_vertices()); + //test if vertices are indeed added to the Reconstruction_triangulation_2 + assert(points.size() == rt2.number_of_vertices()); } PointMassList* simple_point_set() { - PointMassList *points = new PointMassList(); + PointMassList *points = new PointMassList(); - points->push_back(std::make_pair(Point(0.1,0.1), 1)); - points->push_back(std::make_pair(Point(0.4,0.1), 1)); - points->push_back(std::make_pair(Point(0.6,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.4), 1)); - points->push_back(std::make_pair(Point(0.9,0.6), 1)); - points->push_back(std::make_pair(Point(0.9,0.9), 1)); - points->push_back(std::make_pair(Point(0.6,0.9), 1)); - points->push_back(std::make_pair(Point(0.4,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.6), 1)); - points->push_back(std::make_pair(Point(0.1,0.4), 1)); + points->push_back(std::make_pair(Point(0.1,0.1), 1)); + points->push_back(std::make_pair(Point(0.4,0.1), 1)); + points->push_back(std::make_pair(Point(0.6,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.1), 1)); + points->push_back(std::make_pair(Point(0.9,0.4), 1)); + points->push_back(std::make_pair(Point(0.9,0.6), 1)); + points->push_back(std::make_pair(Point(0.9,0.9), 1)); + points->push_back(std::make_pair(Point(0.6,0.9), 1)); + points->push_back(std::make_pair(Point(0.4,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.9), 1)); + points->push_back(std::make_pair(Point(0.1,0.6), 1)); + points->push_back(std::make_pair(Point(0.1,0.4), 1)); - return points; + return points; } diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h index 051d8a4b741..bb446ca5bd8 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/testing_tools.h @@ -4,22 +4,22 @@ template void load_xy_file(const std::string& filename, PointMassList& points) { - std::ifstream ifs(filename.c_str()); - Point point; - while (ifs >> point) - points.push_back(std::make_pair(point, 1)); + std::ifstream ifs(filename.c_str()); + Point point; + while (ifs >> point) + points.push_back(std::make_pair(point, 1)); - ifs.close(); + ifs.close(); } template void load_xy_file_points(const std::string& fileName, std::vector& points) { - std::ifstream ifs(fileName.c_str()); - Point point; - while (ifs >> point) - { - points.push_back(point); - } - ifs.close(); + std::ifstream ifs(fileName.c_str()); + Point point; + while (ifs >> point) + { + points.push_back(point); + } + ifs.close(); } From 42bc775e7a7196f974bd846bd3336f88c40da830 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 23 Jun 2015 09:10:51 +0200 Subject: [PATCH 170/201] typename was missing --- .../include/CGAL/Reconstruction_simplification_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 180a4ebc810..a5432bfc753 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -443,7 +443,7 @@ public: { Edge &edge = *ei; const Sample_vector& samples = edge.first->samples(edge.second); - Sample_vector::const_iterator it; + Sample_vector_const_iterator it; for (it = samples.begin(); it != samples.end(); ++it) { delete *it; From df4077b2df9a007625415f7b8bb6470534a1f4cd Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 23 Jun 2015 09:24:24 +0200 Subject: [PATCH 171/201] Unused param --- .../demo/Reconstruction_simplification_2/dialog_options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h index aad065c680a..784d84605b6 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/dialog_options.h @@ -8,7 +8,7 @@ class Dialog_options : public QDialog, private Ui::Dialog_options Q_OBJECT public: - Dialog_options(QWidget *parent = 0) + Dialog_options(QWidget * = 0) { setupUi(this); } From 7e37c50fb6bdaf7ae8ba08854561acbc3f9e24c5 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 24 Jun 2015 17:47:13 +0200 Subject: [PATCH 172/201] More tolerance + untabify --- .../test_output_modules.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index e6030c4d6e7..99e870e12a8 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -16,10 +16,10 @@ #include "testing_tools.h" typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef K::Point_2 Point; -typedef K::Segment_2 Segment; +typedef K::Point_2 Point; +typedef K::Segment_2 Segment; -typedef K::FT FT; +typedef K::FT FT; typedef CGAL::Reconstruction_simplification_2 Rs_2; @@ -93,11 +93,11 @@ void test_index_output(Rs_2& rs2) { res.push_back(line); } - assert(res.size() == 92); + assert(res.size() >= 89 && res.size() <= 95); + assert(points.size() >= 57 && points.size() <= 63); + assert(edges.size() >= 28 && edges.size() <= 34); - assert(res.front() == "OFF 60 0 31"); - - for (int i = 61; i < 92; i++) { + for (int i = points.size() + 1 ; i < res.size() ; i++) { assert(res[i].substr(0,2) == "2 "); } } From f8b4636f5fed640f891d7317916e7df73554f780 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Thu, 25 Jun 2015 13:32:53 +0200 Subject: [PATCH 173/201] Fix warning --- .../Reconstruction_simplification_2/test_output_modules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp index 99e870e12a8..03f3e6cac77 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_output_modules.cpp @@ -97,7 +97,7 @@ void test_index_output(Rs_2& rs2) { assert(points.size() >= 57 && points.size() <= 63); assert(edges.size() >= 28 && edges.size() <= 34); - for (int i = points.size() + 1 ; i < res.size() ; i++) { + for (std::size_t i = points.size() + 1 ; i < res.size() ; i++) { assert(res[i].substr(0,2) == "2 "); } } From cb55fa6ade54c5fa5a7e7df6625ab944e4a0a904 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 26 Jun 2015 09:47:25 +0200 Subject: [PATCH 174/201] We were not deallocating all samples --- .../CGAL/Reconstruction_simplification_2.h | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index a5432bfc753..e71b397730f 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -429,25 +429,13 @@ public: } void clear() { + Sample_vector samples; + m_dt.collect_all_samples(samples); // Deallocate samples - for (Vertex_iterator vi = m_dt.vertices_begin(); - vi != m_dt.vertices_end(); ++vi) + for (Sample_vector_const_iterator s_it = samples.begin(); + s_it != samples.end(); ++s_it) { - Sample_ *s = vi->get_sample(); - if (s) - delete s; - } - - for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); - ei != m_dt.finite_edges_end(); ++ei) - { - Edge &edge = *ei; - const Sample_vector& samples = edge.first->samples(edge.second); - Sample_vector_const_iterator it; - for (it = samples.begin(); it != samples.end(); ++it) - { - delete *it; - } + delete *s_it; } m_dt.clear(); From 714926b1dba309aeaafa4646bd6b70e3b4649d66 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 29 Jun 2015 13:57:39 +0200 Subject: [PATCH 175/201] Brand new CMakeLists.txt --- .../CMakeLists.txt | 154 ++++++++++-------- 1 file changed, 90 insertions(+), 64 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt index 85a57b0099b..778a557665b 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt @@ -1,95 +1,121 @@ -# CMake -# Fernando de Goes (fdegoes@caltech.edu) -# Copyright @ 2011 +# This is the CMake script for compiling the Reconstruction_simplification_2 demo. + project(Reconstruction_simplification_2_demo) -cmake_minimum_required(VERSION 2.4.5) -cmake_policy(VERSION 2.4.5) +cmake_minimum_required(VERSION 2.6.2) +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3) + cmake_policy(VERSION 2.8.4) +else() + cmake_policy(VERSION 2.6) +endif() set( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true ) -if(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) +# Include this package's headers first +include_directories( BEFORE ./ ./include ../../include ) -############ -# Packages # -############ +# Find CGAL and CGAL Qt4 +find_package(CGAL COMPONENTS Qt4) +include( ${CGAL_USE_FILE} ) +# Find Qt4 itself set( QT_USE_QTXML TRUE ) set( QT_USE_QTMAIN TRUE ) set( QT_USE_QTSCRIPT TRUE ) set( QT_USE_QTOPENGL TRUE ) - -find_package(OpenGL) find_package(Qt4) -find_package(CGAL COMPONENTS Qt4) +# Find OpenGL +find_package(OpenGL) +# Find QGLViewer +if(QT4_FOUND) + include(${QT_USE_FILE}) + find_package(QGLViewer ) +endif(QT4_FOUND) -set( -SRCS -glviewer.cpp -main.cpp -window.cpp -render.cpp -) +if(CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) -set( -MOCS -moc_dialog_options.cxx -moc_glviewer.cxx -moc_window.cxx -) + include_directories ( ${QGLVIEWER_INCLUDE_DIR} ) -set( -UIS -pwsrec.ui -options.ui -) + set( + SRCS + glviewer.cpp + main.cpp + window.cpp + render.cpp + ) -######### -# Build # -######### + set( + MOCS + moc_dialog_options.cxx + moc_glviewer.cxx + moc_window.cxx + ) -# Includes -include_directories(BEFORE . ./build) -include(${QT_USE_FILE}) -include_directories(${GLUT_INCLUDE_DIR}) -include_directories(${OPENGL_INCLUDE_DIR}) -include(${CGAL_USE_FILE}) + set( + UIS + pwsrec.ui + options.ui + ) + + qt4_wrap_ui( UI_FILES ${UIS} ) + include(AddFileDependencies) + qt4_generate_moc( "window.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_window.cxx" ) + add_file_dependencies( moc_window.cxx "${CMAKE_CURRENT_SOURCE_DIR}/window.h" ) - include_directories (BEFORE "../../include") - include_directories (BEFORE "include") + qt4_generate_moc( "glviewer.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_glviewer.cxx" ) + add_file_dependencies( moc_glviewer.cxx "${CMAKE_CURRENT_SOURCE_DIR}/glviewer.h" ) + qt4_generate_moc( "dialog_options.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_dialog_options.cxx" ) + add_file_dependencies( moc_dialog_options.cxx "${CMAKE_CURRENT_SOURCE_DIR}/dialog_options.h" ) + qt4_add_resources ( RESOURCE_FILES pwsrec.qrc ) -# UI files -qt4_wrap_ui( DT_UI_FILES ${UIS} ) + add_executable ( Reconstruction_simplification_2_demo ${SRCS} ${MOCS} ${UI_FILES} ${RESOURCE_FILES} ${CGAL_ADDITIONAL_FILES} ${CGAL_RESOURCE_FILES}) -# QRC files -qt4_add_resources( DT_RESOURCE_FILES pwsrec.qrc ) + # Link with Qt libraries + target_link_libraries( Reconstruction_simplification_2_demo ${QT_LIBRARIES} ) -# MOC files -qt4_generate_moc( window.h moc_window.cxx ) -qt4_generate_moc( glviewer.h moc_glviewer.cxx ) -qt4_generate_moc( dialog_options.h moc_dialog_options.cxx ) + # Link with CGAL + target_link_libraries( Reconstruction_simplification_2_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) -# The executable itself. -add_executable( ${PROJECT_NAME} ${SRCS} ${MOCS} ${DT_UI_FILES} ${DT_RESOURCE_FILES} ) + # Link with libQGLViewer, OpenGL + target_link_libraries( Reconstruction_simplification_2_demo ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) -# Link with Qt libraries -target_link_libraries( ${PROJECT_NAME} ${QT_LIBRARIES} ) + # Link with CImg dependencies + if( NOT WIN32 ) + target_link_libraries( Reconstruction_simplification_2_demo -L/usr/X11R6/lib -lm -lpthread -lX11 ) + endif() -# Link with Glut and OpenGL -target_link_libraries( ${PROJECT_NAME} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ) + add_to_cached_list( CGAL_EXECUTABLE_TARGETS Reconstruction_simplification_2_demo ) -# Link with CImg dependencies -if( NOT WIN32 ) - target_link_libraries( ${PROJECT_NAME} -L/usr/X11R6/lib -lm -lpthread -lX11 ) -endif() - -# Link with CGAL -target_link_libraries( ${PROJECT_NAME} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +else (CGAL_FOUND AND CGAL_CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) + + set(RS2_MISSING_DEPS "") + + if(NOT CGAL_FOUND) + set(RS2_MISSING_DEPS "the CGAL library, ${RS2_MISSING_DEPS}") + endif() + + if(NOT CGAL_Qt4_FOUND) + set(RS2_MISSING_DEPS "the CGAL Qt4 library, ${RS2_MISSING_DEPS}") + endif() + + if(NOT QT4_FOUND) + set(RS2_MISSING_DEPS "Qt4, ${RS2_MISSING_DEPS}") + endif() + + if(NOT OPENGL_FOUND) + set(RS2_MISSING_DEPS "OpenGL, ${RS2_MISSING_DEPS}") + endif() + + if(NOT QGLVIEWER_FOUND) + set(RS2_MISSING_DEPS "QGLViewer, ${RS2_MISSING_DEPS}") + endif() + + message(STATUS "NOTICE: This demo requires ${RS2_MISSING_DEPS}and will not be compiled.") + +endif (CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) From dbd7591803c833a1b4a052735e3ebe92dd26b1ac Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 29 Jun 2015 20:31:58 +0200 Subject: [PATCH 176/201] Fix memory leak --- .../test_vertex_edge.cpp | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp index d47f5d3c708..2f759c816bf 100644 --- a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp +++ b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/test_vertex_edge.cpp @@ -37,8 +37,7 @@ typedef Rt_2::Finite_edges_iterator Finite_edges_iterator; typedef Rt_2::Edge Edge; typedef Rt_2::Rec_edge_2 R_edge_2; -PointMassList* load_xy_file(const std::string& fileName); -PointMassList* simple_point_set(); +void simple_point_set(PointMassList &points); void test_num_of_vertices_in_triangulation(); void test_edge_collapse(); @@ -127,7 +126,8 @@ void test_edge_collapse() { void test_num_of_vertices_in_triangulation() { std::cerr << "test_num_of_vertices_in_triangulation" << std::endl; - PointMassList points = *(simple_point_set()); + PointMassList points; + simple_point_set(points); CGAL::Reconstruction_simplification_2 rs2; int nb = 0; @@ -144,24 +144,20 @@ void test_num_of_vertices_in_triangulation() { assert(points.size() == rt2.number_of_vertices()); } -PointMassList* simple_point_set() { +void simple_point_set(PointMassList &points) { - PointMassList *points = new PointMassList(); - - points->push_back(std::make_pair(Point(0.1,0.1), 1)); - points->push_back(std::make_pair(Point(0.4,0.1), 1)); - points->push_back(std::make_pair(Point(0.6,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.1), 1)); - points->push_back(std::make_pair(Point(0.9,0.4), 1)); - points->push_back(std::make_pair(Point(0.9,0.6), 1)); - points->push_back(std::make_pair(Point(0.9,0.9), 1)); - points->push_back(std::make_pair(Point(0.6,0.9), 1)); - points->push_back(std::make_pair(Point(0.4,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.9), 1)); - points->push_back(std::make_pair(Point(0.1,0.6), 1)); - points->push_back(std::make_pair(Point(0.1,0.4), 1)); - - return points; + points.push_back(std::make_pair(Point(0.1,0.1), 1)); + points.push_back(std::make_pair(Point(0.4,0.1), 1)); + points.push_back(std::make_pair(Point(0.6,0.1), 1)); + points.push_back(std::make_pair(Point(0.9,0.1), 1)); + points.push_back(std::make_pair(Point(0.9,0.4), 1)); + points.push_back(std::make_pair(Point(0.9,0.6), 1)); + points.push_back(std::make_pair(Point(0.9,0.9), 1)); + points.push_back(std::make_pair(Point(0.6,0.9), 1)); + points.push_back(std::make_pair(Point(0.4,0.9), 1)); + points.push_back(std::make_pair(Point(0.1,0.9), 1)); + points.push_back(std::make_pair(Point(0.1,0.6), 1)); + points.push_back(std::make_pair(Point(0.1,0.4), 1)); } From 486b0a531aa13bebecfef8f82dc0bf1c6a2c915e Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Tue, 30 Jun 2015 13:57:52 +0200 Subject: [PATCH 177/201] Add cgal_test_with_cmake --- .../cgal_test_with_cmake | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake new file mode 100644 index 00000000000..73abaebb8fd --- /dev/null +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake @@ -0,0 +1,113 @@ +#! /bin/sh + +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test_with_cmake +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + + ERRORFILE=error.txt + DO_RUN=y + if [ -z "${MAKE_CMD}" ]; then + MAKE_CMD=make + fi + NEED_CLEAN= + +#---------------------------------------------------------------------# +# configure +#---------------------------------------------------------------------# + +configure() +{ + echo "Configuring... " + + if eval 'cmake "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ + -DCGAL_DIR="$CGAL_DIR" \ + .' ; then + + echo " successful configuration" >> $ERRORFILE + else + echo " ERROR: configuration" >> $ERRORFILE + fi +} + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + SUCCESS="y" + + if eval '"${MAKE_CMD}" VERBOSE=ON -fMakefile $1' ; then + echo " successful compilation of $1" >> $ERRORFILE + else + echo " ERROR: compilation of $1" >> $ERRORFILE + SUCCESS="" + fi + + if [ -n "$DO_RUN" ] ; then + if [ -n "${SUCCESS}" ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND `cat $1.cmd`" + fi + if [ -f $1.cin ] ; then + COMMAND="cat $1.cin | $COMMAND" + fi + echo "Executing $1 ... " + echo + ulimit -t 3600 2> /dev/null + if eval $COMMAND > $OUTPUTFILE 2>&1 ; then + echo " successful execution of $1" >> $ERRORFILE + else + echo " ERROR: execution of $1" >> $ERRORFILE + fi + else + echo " ERROR: not executed $1" >> $ERRORFILE + fi + fi +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# configure, compile and run the tests +#---------------------------------------------------------------------# + +configure + +if [ $# -ne 0 ] ; then + for file in $* ; do + compile_and_run $file + done +else + echo "Run all tests." +if grep -qE "^Reconstruction_simplification_2_demo:" Makefile; then + compile_and_run Reconstruction_simplification_2_demo + NEED_CLEAN=y +fi +fi + +# +# The clean target generated by CMake under cygwin +# always fails for some reason +# +if [ -n "${NEED_CLEAN}" ]; then + if ! ( uname | grep -q "CYGWIN" ) ; then + "${MAKE_CMD}" -fMakefile clean + fi +fi From e291e9136976955241d18bc1cc00a996a3fef416 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 1 Jul 2015 09:48:55 +0200 Subject: [PATCH 178/201] Added the package --- Installation/changes.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Installation/changes.html b/Installation/changes.html index b6da5cd32f0..715e2f539d6 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -131,6 +131,15 @@ and src/ directories). components of the mesh. +

Reconstruction Simplification 2 (new package)

+
    +
  • + This package implements a method to reconstruct and simplify 2D + point sets. The input is a set of 2D points with mass attributes, + possibly hampered by noise and outliers. The output is a set of + line segments and isolated points which approximate the input points. +
  • +

Approximation of Ridges and Umbilics on Triangulated Surface Meshes

    From fada7387f0b580af213692e1da5a5af8dae354b9 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 1 Jul 2015 11:08:22 +0200 Subject: [PATCH 179/201] Renamed main.cpp so that the testsuite can use the default cgal_test_with_cmake --- .../CMakeLists.txt | 2 +- ... Reconstruction_simplification_2_demo.cpp} | 0 .../cgal_test_with_cmake | 113 ------------------ 3 files changed, 1 insertion(+), 114 deletions(-) rename Reconstruction_simplification_2/demo/Reconstruction_simplification_2/{main.cpp => Reconstruction_simplification_2_demo.cpp} (100%) delete mode 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt index 778a557665b..71eb364196b 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/CMakeLists.txt @@ -41,7 +41,7 @@ if(CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FO set( SRCS glviewer.cpp - main.cpp + Reconstruction_simplification_2_demo.cpp window.cpp render.cpp ) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_2_demo.cpp similarity index 100% rename from Reconstruction_simplification_2/demo/Reconstruction_simplification_2/main.cpp rename to Reconstruction_simplification_2/demo/Reconstruction_simplification_2/Reconstruction_simplification_2_demo.cpp diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake deleted file mode 100644 index 73abaebb8fd..00000000000 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/cgal_test_with_cmake +++ /dev/null @@ -1,113 +0,0 @@ -#! /bin/sh - -# This is a script for the CGAL test suite. Such a script must obey -# the following rules: -# -# - the name of the script is cgal_test_with_cmake -# - for every target two one line messages are written to the file 'error.txt' -# the first one indicates if the compilation was successful -# the second one indicates if the execution was successful -# if one of the two was not successful, the line should start with 'ERROR:' -# - running the script should not require any user interaction -# - the script should clean up object files and executables - - ERRORFILE=error.txt - DO_RUN=y - if [ -z "${MAKE_CMD}" ]; then - MAKE_CMD=make - fi - NEED_CLEAN= - -#---------------------------------------------------------------------# -# configure -#---------------------------------------------------------------------# - -configure() -{ - echo "Configuring... " - - if eval 'cmake "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \ - -DCGAL_DIR="$CGAL_DIR" \ - .' ; then - - echo " successful configuration" >> $ERRORFILE - else - echo " ERROR: configuration" >> $ERRORFILE - fi -} - -#---------------------------------------------------------------------# -# compile_and_run -#---------------------------------------------------------------------# - -compile_and_run() -{ - echo "Compiling $1 ... " - SUCCESS="y" - - if eval '"${MAKE_CMD}" VERBOSE=ON -fMakefile $1' ; then - echo " successful compilation of $1" >> $ERRORFILE - else - echo " ERROR: compilation of $1" >> $ERRORFILE - SUCCESS="" - fi - - if [ -n "$DO_RUN" ] ; then - if [ -n "${SUCCESS}" ] ; then - OUTPUTFILE=ProgramOutput.$1.$PLATFORM - rm -f $OUTPUTFILE - COMMAND="./$1" - if [ -f $1.cmd ] ; then - COMMAND="$COMMAND `cat $1.cmd`" - fi - if [ -f $1.cin ] ; then - COMMAND="cat $1.cin | $COMMAND" - fi - echo "Executing $1 ... " - echo - ulimit -t 3600 2> /dev/null - if eval $COMMAND > $OUTPUTFILE 2>&1 ; then - echo " successful execution of $1" >> $ERRORFILE - else - echo " ERROR: execution of $1" >> $ERRORFILE - fi - else - echo " ERROR: not executed $1" >> $ERRORFILE - fi - fi -} - -#---------------------------------------------------------------------# -# remove the previous error file -#---------------------------------------------------------------------# - -rm -f $ERRORFILE -touch $ERRORFILE - -#---------------------------------------------------------------------# -# configure, compile and run the tests -#---------------------------------------------------------------------# - -configure - -if [ $# -ne 0 ] ; then - for file in $* ; do - compile_and_run $file - done -else - echo "Run all tests." -if grep -qE "^Reconstruction_simplification_2_demo:" Makefile; then - compile_and_run Reconstruction_simplification_2_demo - NEED_CLEAN=y -fi -fi - -# -# The clean target generated by CMake under cygwin -# always fails for some reason -# -if [ -n "${NEED_CLEAN}" ]; then - if ! ( uname | grep -q "CYGWIN" ) ; then - "${MAKE_CMD}" -fMakefile clean - fi -fi From 62f09c36d02f6ba453dada64f06a5e20f7c8f317 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Wed, 1 Jul 2015 15:02:07 +0200 Subject: [PATCH 180/201] Fix warning --- .../include/CGAL/Triangulation_data_structure_2.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h index 530085392bb..0e3d6c4495a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_data_structure_2.h @@ -1527,7 +1527,7 @@ join_vertices(Face_handle f, int i, Vertex_handle v) return join_vertices(f->neighbor(i), mirror_index(f,i), v); } - int deg2 = degree(v2); + size_type deg2 = degree(v2); CGAL_triangulation_precondition( deg2 >= 3 ); @@ -1605,7 +1605,8 @@ join_vertices(Face_handle f, int i, Vertex_handle v) ++fc; } while ( fc != fc_start ); - CGAL_triangulation_assertion( int(star_faces_of_v2.size()) == deg2 ); + CGAL_triangulation_assertion( + static_cast(star_faces_of_v2.size()) == deg2 ); // from this point and on we modify the values From 84665ec1df0d651ee6e415c58929461610fced3b Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Thu, 2 Jul 2015 09:53:02 +0200 Subject: [PATCH 181/201] Fix include --- .../demo/Reconstruction_simplification_2/scene.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h index 7da6aeba521..55ccc227c6f 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/scene.h @@ -10,7 +10,7 @@ // local #include #include "Reconstruction_simplification_kerneled_2.h" -#include "../../include/CGAL/Reconstruction_simplification_2.h" +#include From 77be839fa5168cfd2092f4982f8356c0481eb3cf Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 2 Jul 2015 15:05:28 +0200 Subject: [PATCH 182/201] Fix permissions --- .../demo/Reconstruction_simplification_2/data/round_rect00.xy | 0 .../demo/Reconstruction_simplification_2/data/skyline_noisy00.xy | 0 .../demo/Reconstruction_simplification_2/data/stair-noise00.xy | 0 .../examples/Reconstruction_simplification_2/data/stair.xy | 0 .../test/Reconstruction_simplification_2/data/stair-noise00.xy | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy mode change 100755 => 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy mode change 100755 => 100644 Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy mode change 100755 => 100644 Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy mode change 100755 => 100644 Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/round_rect00.xy old mode 100755 new mode 100644 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/skyline_noisy00.xy old mode 100755 new mode 100644 diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/data/stair-noise00.xy old mode 100755 new mode 100644 diff --git a/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy b/Reconstruction_simplification_2/examples/Reconstruction_simplification_2/data/stair.xy old mode 100755 new mode 100644 diff --git a/Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy b/Reconstruction_simplification_2/test/Reconstruction_simplification_2/data/stair-noise00.xy old mode 100755 new mode 100644 From 2511ee9d6f9d7a89be97c52d54b2c77d4d8c6a56 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 3 Jul 2015 08:54:36 +0200 Subject: [PATCH 183/201] Removed console_color.h --- .../render.cpp | 2 +- .../CGAL/Reconstruction_simplification_2.h | 55 +++++++-------- .../CGAL/Reconstruction_triangulation_2.h | 6 -- .../include/CGAL/console_color.h | 68 ------------------- 4 files changed, 26 insertions(+), 105 deletions(-) delete mode 100644 Reconstruction_simplification_2/include/CGAL/console_color.h diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index a615cbc5da4..36648e18d47 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -23,7 +23,7 @@ void R_s_k_2::print_stats() const else nb_solid++; } - std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "STATS" << std::endl; std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index e71b397730f..6e0a15a643d 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -22,7 +22,6 @@ #include #include -#include #include @@ -451,7 +450,7 @@ public: // INIT // void insert_loose_bbox(const double x, const double y, const double size) { double timer = clock(); - std::cerr << yellow << "insert loose bbox" << white << "..."; + std::cerr << "insert loose bbox" << "..."; int nb = static_cast(m_dt.number_of_vertices()); insert_point(Point(x - size, y - size), true, nb++); @@ -459,15 +458,15 @@ public: insert_point(Point(x + size, y + size), true, nb++); insert_point(Point(x + size, y - size), true, nb++); - std::cerr << yellow << "done" << white << " (" << nb << " vertices, " - << yellow << time_duration(timer) << white << " s)" + std::cerr << "done" << " (" << nb << " vertices, " + << time_duration(timer) << " s)" << std::endl; } template // value_type = Point* void init(Iterator begin, Iterator beyond) { double timer = clock(); - std::cerr << yellow << "init" << white << "..."; + std::cerr << "init" << "..."; int nb = static_cast(m_dt.number_of_vertices()); m_dt.infinite_vertex()->pinned() = true; @@ -480,8 +479,8 @@ public: insert_point(point, false, nb++); } - std::cerr << yellow << "done" << white << " (" << nb << " vertices, " - << yellow << time_duration(timer) << white << " s)" + std::cerr << "done" << " (" << nb << " vertices, " + << time_duration(timer) << " s)" << std::endl; } @@ -502,13 +501,12 @@ public: template // value_type = Sample_* void assign_samples(Iterator begin, Iterator end) { double timer = clock(); - std::cerr << yellow << "assign samples" << white << "..."; + std::cerr << "assign samples" << "..."; m_dt.assign_samples(begin, end); m_dt.reset_all_costs(); - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; + std::cerr << "done" << " (" << time_duration(timer) << " s)" << std::endl; } void reassign_samples() { @@ -536,7 +534,7 @@ public: Vertex_handle t = m_dt.target_vertex(edge); if (m_verbose > 0) { - std::cerr << std::endl << green << "do collapse " << white << "(" + std::cerr << std::endl << "do collapse " << "(" << s->id() << "->" << t->id() << ") ... " << std::endl; } @@ -556,8 +554,7 @@ public: // debug test ok = m_dt.check_kernel_test(edge); if (!ok) { - std::cerr << red << "do_collapse: kernel test failed: " << white - << std::endl; + std::cerr << "do_collapse: kernel test failed: " << std::endl; return false; } // @@ -576,7 +573,7 @@ public: } if (m_verbose > 0) { - std::cerr << green << "done" << std::endl; + std::cerr << "done" << std::endl; } return true; @@ -588,7 +585,7 @@ public: Vertex_handle t = m_dt.target_vertex(edge); if (m_verbose > 1) { - std::cerr << green << "simulate collapse " << white << "(" + std::cerr << "simulate collapse " << "(" << s->id() << "->" << t->id() << ") ... " << std::endl; } @@ -602,16 +599,15 @@ public: ok = copy.make_collapsible(copy_edge, copy_hull.begin(), copy_hull.end(), m_verbose); if (!ok) { - std::cerr << yellow << "simulation: failed (make collapsible)" - << white << std::endl; + std::cerr << "simulation: failed (make collapsible)" + << std::endl; return false; } } ok = copy.check_kernel_test(copy_edge); if (!ok) { - std::cerr << yellow << "simulation: failed (kernel test)" << white - << std::endl; + std::cerr << "simulation: failed (kernel test)" << std::endl; return false; } @@ -627,7 +623,7 @@ public: restore_samples(samples.begin(), samples.end()); if (m_verbose > 1) { - std::cerr << green << "done" << white << std::endl; + std::cerr << "done" << std::endl; } return true; @@ -1330,7 +1326,7 @@ public: else nb_solid++; } - std::cerr << blue << "STATS" << white << std::endl; + std::cerr << "STATS" << std::endl; std::cerr << "# vertices : " << m_dt.number_of_vertices()-4 << std::endl; std::cerr << "# triangles: " << m_dt.number_of_faces() << std::endl; std::cerr << "# edges: " << m_dt.tds().number_of_edges() << std::endl; @@ -1394,7 +1390,7 @@ public: */ void run_until(std::size_t np) { double timer = clock(); - std::cerr << yellow << "reconstruct until " << white << np << " V"; + std::cerr << "reconstruct until " << np << " V"; std::size_t N = np + 4; std::size_t performed = 0; @@ -1405,9 +1401,9 @@ public: performed++; } - std::cerr << yellow << " done" << white << " (" << performed + std::cerr << " done" << " (" << performed << " iters, " << m_dt.number_of_vertices() - 4 << " V " - << yellow << time_duration(timer) << white << " s)" + << time_duration(timer) << " s)" << std::endl; } @@ -1419,7 +1415,7 @@ public: */ void run(const unsigned steps) { double timer = clock(); - std::cerr << yellow << "reconstruct " << steps << white; + std::cerr << "reconstruct " << steps; unsigned performed = 0; for (unsigned i = 0; i < steps; ++i) { @@ -1429,9 +1425,9 @@ public: performed++; } - std::cerr << yellow << " done" << white << " (" << performed << "/" + std::cerr << " done" << " (" << performed << "/" << steps << " iters, " << m_dt.number_of_vertices() - 4 - << " V, " << yellow << time_duration(timer) << white << " s)" + << " V, " << time_duration(timer) << " s)" << std::endl; } @@ -1445,7 +1441,7 @@ public: */ void relocate_all_points() { double timer = clock(); - std::cerr << yellow << "relocate all points" << white << "..."; + std::cerr << "relocate all points" << "..."; m_mindex.clear(); // pqueue must be recomputed @@ -1480,8 +1476,7 @@ public: } } - std::cerr << yellow << "done" << white << " (" << yellow - << time_duration(timer) << white << " s)" << std::endl; + std::cerr << "done" << " (" << time_duration(timer) << " s)" << std::endl; } /// @} diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h index 7ccd46139a2..f399d94dc3d 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_triangulation_2.h @@ -1027,8 +1027,6 @@ public: if (Dac == -(std::numeric_limits::max)() && Dbd == -(std::numeric_limits::max)()) { - // TODO: IV comment in std::cerr << red << "--- - //No flips available ---" << white << std::endl; std::cerr << "--- No flips available ---" << std::endl; return false; } @@ -1036,8 +1034,6 @@ public: if ((std::max)(Dac, Dbd) + EPS < Dbc) { std::cerr.precision(10); - // TODO: IV comment in std::cerr << red << "-- - //- Flip makes kernel worse ---" << white << std::endl; std::cerr << "--- Flip makes kernel worse ---" << std::endl; std::cerr << Dac << " or " << Dbd << " vs " @@ -1072,8 +1068,6 @@ public: } if (verbose > 1) - //TODO: IV Comment in std::cerr << red << "--- - //Flip makes kernel worse ---" << white << std::endl; std::cerr << "Nb flips: " << nb_flips << std::endl; return true; diff --git a/Reconstruction_simplification_2/include/CGAL/console_color.h b/Reconstruction_simplification_2/include/CGAL/console_color.h deleted file mode 100644 index 50554178257..00000000000 --- a/Reconstruction_simplification_2/include/CGAL/console_color.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef CONSOLE_COLOR_H_ -#define CONSOLE_COLOR_H_ - -#include - -#if defined(WIN32) -#include -#endif - -inline std::ostream& blue(std::ostream &s) -{ -#if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, - FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY); -#else - s << "\x1b[0;34m"; -#endif - return s; -} - -inline std::ostream& red(std::ostream &s) -{ -#if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_RED|FOREGROUND_INTENSITY); -#else - s << "\x1b[0;31m"; -#endif - return s; -} - -inline std::ostream& green(std::ostream &s) -{ -#if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, FOREGROUND_GREEN|FOREGROUND_INTENSITY); -#else - s << "\x1b[0;32m"; -#endif - return s; -} - -inline std::ostream& yellow(std::ostream &s) -{ -#if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, - FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY); -#else - s << "\x1b[0;33m"; -#endif - return s; -} - -inline std::ostream& white(std::ostream &s) -{ -#if defined(WIN32) - HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(hStdout, - FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE); -#else - s << "\x1b[0;37m"; -#endif - return s; -} - -#endif From af7e59ad5152d0228dcda3b1854afc4859981cb6 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Mon, 6 Jul 2015 20:08:45 +0200 Subject: [PATCH 184/201] Fix warnings --- .../demo/Reconstruction_simplification_2/render.cpp | 1 - .../demo/Reconstruction_simplification_2/window.cpp | 4 ++-- .../include/CGAL/Reconstruction_simplification_2.h | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp index 36648e18d47..27fa0ed4279 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/render.cpp @@ -600,7 +600,6 @@ void R_s_k_2::draw_collapsible_edge(const float point_size, Triangulation copy; Edge copy_edge = copy_star(edge, copy); Vertex_handle copy_src = copy.source_vertex(copy_edge); - Vertex_handle copy_dst = copy.target_vertex(copy_edge); Edge_vector copy_hull; copy.get_edges_from_star_minus_link(copy_src, copy_hull, true); diff --git a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp index 43512ddfdad..d8f034ccb90 100644 --- a/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp +++ b/Reconstruction_simplification_2/demo/Reconstruction_simplification_2/window.cpp @@ -439,11 +439,11 @@ void MainWindow::on_actionWidely_variable_sampling_triggered() { bool ok; float d1 = QInputDialog::getDouble( - this, tr("Delta-angle"), tr("Delta-angle:"), 1, 0.01, 20.0, 0.01, &ok); + this, tr("Delta-angle"), tr("Delta-angle:"), 1, 0.01, 20.0, 2, &ok); if (!ok) return; float d2 = QInputDialog::getDouble( - this, tr("Delta-angle"), tr("Delta-angle:"), 10, 0.01, 30.0, 0.01, &ok); + this, tr("Delta-angle"), tr("Delta-angle:"), 10, 0.01, 30.0, 2, &ok); if (!ok) return; m_scene->append_widely_variable_sampling(d1, d2); diff --git a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h index 6e0a15a643d..30636182566 100644 --- a/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h +++ b/Reconstruction_simplification_2/include/CGAL/Reconstruction_simplification_2.h @@ -1237,7 +1237,7 @@ public: } Vector compute_gradient_for_plan1(const Edge& edge) { - FT M = m_dt.get_mass(edge); + //FT M = m_dt.get_mass(edge); const Point& pa = m_dt.source_vertex(edge)->point(); const Point& pb = m_dt.target_vertex(edge)->point(); From 3c3fb9b0bb35bdaa4f0b063feac3984cf49db0e3 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 7 Jul 2015 14:59:36 +0200 Subject: [PATCH 185/201] move to place holder --- Installation/changes.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Installation/changes.html b/Installation/changes.html index 715e2f539d6..fc912fbd45f 100644 --- a/Installation/changes.html +++ b/Installation/changes.html @@ -131,6 +131,9 @@ and src/ directories). components of the mesh.
+ + +

Reconstruction Simplification 2 (new package)

  • @@ -140,6 +143,20 @@ and src/ directories). line segments and isolated points which approximate the input points.
+ + + + + + + + + + + + + +

Approximation of Ridges and Umbilics on Triangulated Surface Meshes