Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77035 - in sandbox/gtl: boost/polygon boost/polygon/detail libs/polygon/test libs/polygon/voronoi_example
From: sydorchuk.andriy_at_[hidden]
Date: 2012-02-15 18:01:44


Author: asydorchuk
Date: 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
New Revision: 77035
URL: http://svn.boost.org/trac/boost/changeset/77035

Log:
Minor changes to the code style.
Fixing voronoi_test_helper.hpp.
Updating voronoi_visualizer rendering ui.
Text files modified:
   sandbox/gtl/boost/polygon/detail/voronoi_ctypes.hpp | 12 ++++++------
   sandbox/gtl/boost/polygon/detail/voronoi_predicates.hpp | 12 ++++++------
   sandbox/gtl/boost/polygon/detail/voronoi_robust_fpt.hpp | 12 ++++++------
   sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp | 12 ++++++------
   sandbox/gtl/boost/polygon/voronoi.hpp | 4 ++--
   sandbox/gtl/boost/polygon/voronoi_builder.hpp | 6 +++---
   sandbox/gtl/boost/polygon/voronoi_diagram.hpp | 6 +++---
   sandbox/gtl/libs/polygon/test/voronoi_test_helper.hpp | 5 +++--
   sandbox/gtl/libs/polygon/voronoi_example/voronoi_visualizer.cpp | 37 +++++++++++++++++++------------------
   9 files changed, 54 insertions(+), 52 deletions(-)

Modified: sandbox/gtl/boost/polygon/detail/voronoi_ctypes.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_ctypes.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_ctypes.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -7,8 +7,8 @@
 
 // See http://www.boost.org for updates, documentation, and revision history.
 
-#ifndef BOOST_POLYGON_VORONOI_DETAIL_CTYPES
-#define BOOST_POLYGON_VORONOI_DETAIL_CTYPES
+#ifndef BOOST_POLYGON_DETAIL_VORONOI_CTYPES
+#define BOOST_POLYGON_DETAIL_VORONOI_CTYPES
 
 #include <cmath>
 #include <boost/cstdint.hpp>
@@ -721,8 +721,8 @@
     typedef type_converter_efpt to_efpt_converter_type;
     enum { ULPS = 64 };
 };
-} // detail
-} // polygon
-} // boost
+} // detail
+} // polygon
+} // boost
 
-#endif
+#endif // BOOST_POLYGON_DETAIL_VORONOI_CTYPES

Modified: sandbox/gtl/boost/polygon/detail/voronoi_predicates.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_predicates.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_predicates.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -7,8 +7,8 @@
 
 // See http://www.boost.org for updates, documentation, and revision history.
 
-#ifndef BOOST_POLYGON_VORONOI_DETAIL_PREDICATES
-#define BOOST_POLYGON_VORONOI_DETAIL_PREDICATES
+#ifndef BOOST_POLYGON_DETAIL_VORONOI_PREDICATES
+#define BOOST_POLYGON_DETAIL_VORONOI_PREDICATES
 
 #include "voronoi_robust_fpt.hpp"
 
@@ -1379,8 +1379,8 @@
         return dif_x * dif_x + dif_y * dif_y;
     }
 };
-} // detail
-} // polygon
-} // boost
+} // detail
+} // polygon
+} // boost
 
-#endif
+#endif // BOOST_POLYGON_DETAIL_VORONOI_PREDICATES

Modified: sandbox/gtl/boost/polygon/detail/voronoi_robust_fpt.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_robust_fpt.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_robust_fpt.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -7,8 +7,8 @@
 
 // See http://www.boost.org for updates, documentation, and revision history.
 
-#ifndef BOOST_POLYGON_VORONOI_DETAIL_ROBUST_FPT
-#define BOOST_POLYGON_VORONOI_DETAIL_ROBUST_FPT
+#ifndef BOOST_POLYGON_DETAIL_VORONOI_ROBUST_FPT
+#define BOOST_POLYGON_DETAIL_VORONOI_ROBUST_FPT
 
 #include <cmath>
 
@@ -515,8 +515,8 @@
 const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::EVAL3_MAX_RELATIVE_ERROR = 16;
 template <typename _int, typename _fpt, typename _converter>
 const unsigned int robust_sqrt_expr<_int, _fpt, _converter>::EVAL4_MAX_RELATIVE_ERROR = 25;
-} // detail
-} // polygon
-} // boost
+} // detail
+} // polygon
+} // boost
 
-#endif
+#endif // BOOST_POLYGON_DETAIL_VORONOI_ROBUST_FPT

Modified: sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -7,8 +7,8 @@
 
 // See http://www.boost.org for updates, documentation, and revision history.
 
-#ifndef BOOST_POLYGON_VORONOI_DETAIL_STRUCTURES
-#define BOOST_POLYGON_VORONOI_DETAIL_STRUCTURES
+#ifndef BOOST_POLYGON_DETAIL_VORONOI_STRUCTURES
+#define BOOST_POLYGON_DETAIL_VORONOI_STRUCTURES
 
 #include <list>
 #include <queue>
@@ -438,8 +438,8 @@
   Circle *circle_event_;
   Edge *edge_;
 };
-} // detail
-} // polygon
-} // boost
+} // detail
+} // polygon
+} // boost
 
-#endif // BOOST_POLYGON_VORONOI_DETAIL_STRUCTURES
+#endif // BOOST_POLYGON_DETAIL_VORONOI_STRUCTURES

Modified: sandbox/gtl/boost/polygon/voronoi.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/voronoi.hpp (original)
+++ sandbox/gtl/boost/polygon/voronoi.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -54,7 +54,7 @@
   builder.construct(output);
   builder.clear();
 }
-}
-}
+} // polygon
+} // boost
 
 #endif // BOOST_POLYGON_VORONOI

Modified: sandbox/gtl/boost/polygon/voronoi_builder.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/voronoi_builder.hpp (original)
+++ sandbox/gtl/boost/polygon/voronoi_builder.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -531,7 +531,7 @@
     };
 
     typedef voronoi_builder<detail::int32> default_voronoi_builder;
-} // polygon
-} // boost
+} // polygon
+} // boost
 
-#endif
+#endif // BOOST_POLYGON_VORONOI_BUILDER

Modified: sandbox/gtl/boost/polygon/voronoi_diagram.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/voronoi_diagram.hpp (original)
+++ sandbox/gtl/boost/polygon/voronoi_diagram.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -802,7 +802,7 @@
         voronoi_diagram(const voronoi_diagram&);
         void operator=(const voronoi_diagram&);
     };
-} // polygon
-} // boost
+} // polygon
+} // boost
 
-#endif
+#endif // BOOST_POLYGON_VORONOI_DIAGRAM

Modified: sandbox/gtl/libs/polygon/test/voronoi_test_helper.hpp
==============================================================================
--- sandbox/gtl/libs/polygon/test/voronoi_test_helper.hpp (original)
+++ sandbox/gtl/libs/polygon/test/voronoi_test_helper.hpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -11,6 +11,7 @@
 #define VORONOI_TEST_HELPER
 
 #include <iostream>
+#include <iterator>
 #include <fstream>
 #include <map>
 #include <vector>
@@ -212,7 +213,7 @@
 template <typename PointIterator>
 void save_points(PointIterator first, PointIterator last, const char *file_name) {
     std::ofstream ofs(file_name);
- ofs << points.size() << std::endl;
+ ofs << std::distance(first, last) << std::endl;
     for (PointIterator it = first; it != last; ++it) {
         ofs << it->x() << " " << it->y() << std::endl;
     }
@@ -222,7 +223,7 @@
 template <typename SegmentIterator>
 void save_segments(SegmentIterator first, SegmentIterator last, const char *file_name) {
     std::ofstream ofs(file_name);
- ofs << segments.size() << std::endl;
+ ofs << std::distance(first, last) << std::endl;
     for (SegmentIterator it = first; it != last; ++it) {
         ofs << it->low().x() << " " << it->low().y() << " ";
         ofs << it->high().x() << " " << it->high().y() << std::endl;

Modified: sandbox/gtl/libs/polygon/voronoi_example/voronoi_visualizer.cpp
==============================================================================
--- sandbox/gtl/libs/polygon/voronoi_example/voronoi_visualizer.cpp (original)
+++ sandbox/gtl/libs/polygon/voronoi_example/voronoi_visualizer.cpp 2012-02-15 18:01:43 EST (Wed, 15 Feb 2012)
@@ -83,15 +83,15 @@
   }
 
   void paintGL() {
- qglClearColor(QColor::fromRgb(0, 0, 0));
+ qglClearColor(QColor::fromRgb(255, 255, 255));
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
     // Draw voronoi sites.
     {
       const voronoi_cells_type &cells = vd_.cell_records();
       voronoi_cell_const_iterator_type it;
- glColor3f(0.0f, 0.0f, 1.0f);
- glPointSize(6);
+ glColor3f(0.0f, 0.5f, 1.0f);
+ glPointSize(9);
       glBegin(GL_POINTS);
       for (it = cells.begin(); it != cells.end(); ++it) {
         if (!it->contains_segment()) {
@@ -100,8 +100,8 @@
         }
       }
       glEnd();
- glPointSize(4);
- glLineWidth(2.0f);
+ glPointSize(6);
+ glLineWidth(2.7f);
       glBegin(GL_LINES);
       for (it = cells.begin(); it != cells.end(); ++it) {
         if (it->contains_segment()) {
@@ -115,24 +115,25 @@
       glLineWidth(1.0);
     }
 
- // Draw voronoi vertices.
- {
- const voronoi_vertices_type &vertices = vd_.vertex_records();
- voronoi_vertex_const_iterator_type it;
- glColor3f(0.0f, 1.0f, 0.0f);
- glBegin(GL_POINTS);
- for (it = vertices.begin(); it != vertices.end(); ++it) {
- glVertex2f(it->vertex().x() - shift_.x(),
- it->vertex().y() - shift_.y());
- }
- glEnd();
- }
+ //// Draw voronoi vertices.
+ //{
+ // const voronoi_vertices_type &vertices = vd_.vertex_records();
+ // voronoi_vertex_const_iterator_type it;
+ // glColor3f(0.0f, 0.0f, 0.0f);
+ // glBegin(GL_POINTS);
+ // for (it = vertices.begin(); it != vertices.end(); ++it) {
+ // glVertex2f(it->vertex().x() - shift_.x(),
+ // it->vertex().y() - shift_.y());
+ // }
+ // glEnd();
+ //}
 
     // Draw voronoi edges.
     {
       const voronoi_edges_type &edges = vd_.edge_records();
       voronoi_edge_const_iterator_type it;
- glColor3f(0.0f, 1.0f, 0.0f);
+ glColor3f(0.0f, 0.0f, 0.0f);
+ glLineWidth(1.7f);
       glBegin(GL_LINES);
       for (it = edges.begin(); it != edges.end(); ++it) {
         if (!it->is_primary() && primary_edges_only_) {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk