Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61536 - in sandbox/geometry: boost/geometry/extensions/iterators boost/geometry/iterators libs/geometry libs/geometry/doc/testcases libs/geometry/example
From: barend.gehrels_at_[hidden]
Date: 2010-04-24 10:22:22


Author: barendgehrels
Date: 2010-04-24 10:22:22 EDT (Sat, 24 Apr 2010)
New Revision: 61536
URL: http://svn.boost.org/trac/boost/changeset/61536

Log:
Moved section iterators to extensions
Solved wxwidges vcproj
Removed /W4 flag in Jamroot

Added:
   sandbox/geometry/boost/geometry/extensions/iterators/
   sandbox/geometry/boost/geometry/extensions/iterators/section_iterators.hpp
      - copied, changed from r61527, /sandbox/geometry/boost/geometry/iterators/section_iterators.hpp
Removed:
   sandbox/geometry/boost/geometry/iterators/section_iterators.hpp
Binary files modified:
   sandbox/geometry/libs/geometry/doc/testcases/dissolve.ppt
Text files modified:
   sandbox/geometry/boost/geometry/extensions/iterators/section_iterators.hpp | 201 ++++++++++++++++++++-------------------
   sandbox/geometry/libs/geometry/Jamroot | 2
   sandbox/geometry/libs/geometry/example/x04_wxwidgets_world_mapper.vcproj | 9
   3 files changed, 110 insertions(+), 102 deletions(-)

Copied: sandbox/geometry/boost/geometry/extensions/iterators/section_iterators.hpp (from r61527, /sandbox/geometry/boost/geometry/iterators/section_iterators.hpp)
==============================================================================
--- /sandbox/geometry/boost/geometry/iterators/section_iterators.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/iterators/section_iterators.hpp 2010-04-24 10:22:22 EDT (Sat, 24 Apr 2010)
@@ -6,8 +6,14 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ITERATORS_SECTION_ITERATORS_HPP
-#define BOOST_GEOMETRY_ITERATORS_SECTION_ITERATORS_HPP
+#ifndef BOOST_GEOMETRY_EXTENSIONS_ITERATORS_SECTION_ITERATORS_HPP
+#define BOOST_GEOMETRY_EXTENSIONS_ITERATORS_SECTION_ITERATORS_HPP
+
+// 24-04-2010, Moved to extensions/iterators
+// because it was not yet used in the part.
+
+// FILE WILL BE SPLITTED
+
 
 #include <iterator>
 
@@ -18,12 +24,13 @@
 #include <boost/geometry/algorithms/overlaps.hpp>
 
 
-// FILE WILL BE SPLITTED
-
 namespace boost { namespace geometry
 {
+
+
 namespace detail
 {
+
     template <size_t D, typename P, typename B>
     inline bool exceeding(short int dir, P const& point, B const& box)
     {
@@ -60,67 +67,67 @@
     }
 
 
- private :
+private :
+
+ inline void increment()
+ {
+ (this->base_reference())++;
 
- inline void increment()
+ // If end or exceeding specified box, go to next section
+ if (this->base() == m_end
+ || detail::exceeding<D>(m_section_iterator->directions[0], *this->base(), m_box))
         {
- (this->base_reference())++;
+ m_section_iterator++;
+ stay_within_box();
+ }
 
- // If end or exceeding specified box, go to next section
- if (this->base() == m_end
- || detail::exceeding<D>(m_section_iterator->directions[0], *this->base(), m_box))
- {
- m_section_iterator++;
- stay_within_box();
- }
+ }
 
+ // Check if iterator is still in box and if not, go to the next section and advance until it is in box
+ void stay_within_box()
+ {
+ // Find section having overlap with specified box
+ while (m_section_iterator != boost::end(m_sections)
+ && ! overlaps(m_section_iterator->bounding_box, m_box))
+ {
+ m_section_iterator++;
         }
-
- // Check if iterator is still in box and if not, go to the next section and advance until it is in box
- void stay_within_box()
+ if (m_section_iterator != boost::end(m_sections))
         {
- // Find section having overlap with specified box
- while (m_section_iterator != boost::end(m_sections)
- && ! overlaps(m_section_iterator->bounding_box, m_box))
+ this->base_reference() = boost::begin(m_ring) + m_section_iterator->begin_index;
+ m_end = boost::begin(m_ring) + m_section_iterator->end_index + 1;
+
+ // While not yet at box, advance
+ while(this->base() != m_end
+ && detail::preceding<D>(m_section_iterator->directions[0], *this->base(), m_box))
             {
- m_section_iterator++;
+ ++(this->base_reference());
             }
- if (m_section_iterator != boost::end(m_sections))
- {
- this->base_reference() = boost::begin(m_ring) + m_section_iterator->begin_index;
- m_end = boost::begin(m_ring) + m_section_iterator->end_index + 1;
 
- // While not yet at box, advance
- while(this->base() != m_end
- && detail::preceding<D>(m_section_iterator->directions[0], *this->base(), m_box))
- {
- ++(this->base_reference());
- }
-
- if (this->base() == m_end)
- {
- // This should actually not occur because of bbox check, but to be sure
- m_section_iterator++;
- stay_within_box();
- }
- }
- else
+ if (this->base() == m_end)
             {
- this->base_reference() = boost::end(m_ring);
- m_end = boost::end(m_ring);
+ // This should actually not occur because of bbox check, but to be sure
+ m_section_iterator++;
+ stay_within_box();
             }
         }
+ else
+ {
+ this->base_reference() = boost::end(m_ring);
+ m_end = boost::end(m_ring);
+ }
+ }
 
 
- typedef typename boost::range_iterator<G const>::type IT;
- typedef typename boost::range_iterator<S const>::type SIT;
+ typedef typename boost::range_iterator<G const>::type IT;
+ typedef typename boost::range_iterator<S const>::type SIT;
 
- G const& m_ring;
- S const& m_sections;
- B const& m_box;
+ G const& m_ring;
+ S const& m_sections;
+ B const& m_box;
 
- IT m_end;
- SIT m_section_iterator;
+ IT m_end;
+ SIT m_section_iterator;
 };
 
 
@@ -151,69 +158,71 @@
     }
 
 
- private :
+private :
 
- inline void increment()
- {
- m_previous = (this->base_reference())++;
+ inline void increment()
+ {
+ m_previous = (this->base_reference())++;
 
- if (this->base() == m_section_end
- || detail::exceeding<D>(m_dir, *m_previous, *m_box))
- {
- this->base_reference() = m_ring_end;
- }
+ if (this->base() == m_section_end
+ || detail::exceeding<D>(m_dir, *m_previous, *m_box))
+ {
+ this->base_reference() = m_ring_end;
         }
+ }
 
- // Check if iterator is still in box and if not, go to the next section and advance until it is in box
- void init(SEC const& section, G const& ring)
+ // Check if iterator is still in box and if not, go to the next section and advance until it is in box
+ void init(SEC const& section, G const& ring)
+ {
+ //this->base_reference();
+ m_section_end = boost::begin(ring) + section.end_index + 1;
+ m_ring_end = boost::end(ring);
+
+ this->base_reference() = boost::begin(ring) + section.begin_index;
+
+ /* Performance, TO BE CHECKED!
+ normal_iterator next = boost::begin(ring) + section.begin_index;
+ if (next != m_section_end && next != m_ring_end)
         {
- //this->base_reference();
- m_section_end = boost::begin(ring) + section.end_index + 1;
- m_ring_end = boost::end(ring);
-
- this->base_reference() = boost::begin(ring) + section.begin_index;
-
- /* Performance, TO BE CHECKED!
- normal_iterator next = boost::begin(ring) + section.begin_index;
- if (next != m_section_end && next != m_ring_end)
+
+ // While (not end and) not yet at box, advance
+ normal_iterator it = next++;
+ while(next != m_section_end && next != m_ring_end
+ && detail::preceding<D>(m_dir, *next, *m_box))
             {
+ it = next++;
+ }
+
 
- // While (not end and) not yet at box, advance
- normal_iterator it = next++;
- while(next != m_section_end && next != m_ring_end
- && detail::preceding<D>(m_dir, *next, *m_box))
- {
- it = next++;
- }
-
-
- if (it == m_section_end)
- {
- this->base_reference() = m_ring_end;
- }
- else
- {
- this->base_reference() = it;
- }
+ if (it == m_section_end)
+ {
+ this->base_reference() = m_ring_end;
             }
             else
             {
- this->base_reference() = m_ring_end;
+ this->base_reference() = it;
             }
- */
-
- m_previous = this->base();
         }
+ else
+ {
+ this->base_reference() = m_ring_end;
+ }
+ */
+
+ m_previous = this->base();
+ }
 
 
- const B* m_box;
- short int m_dir;
+ const B* m_box;
+ short int m_dir;
 
- normal_iterator m_previous;
- normal_iterator m_section_end;
- normal_iterator m_ring_end;
+ normal_iterator m_previous;
+ normal_iterator m_section_end;
+ normal_iterator m_ring_end;
 };
 
+
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_ITERATORS_SECTION_ITERATORS_HPP
+
+#endif // BOOST_GEOMETRY_EXTENSIONS_ITERATORS_SECTION_ITERATORS_HPP

Deleted: sandbox/geometry/boost/geometry/iterators/section_iterators.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/iterators/section_iterators.hpp 2010-04-24 10:22:22 EDT (Sat, 24 Apr 2010)
+++ (empty file)
@@ -1,219 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_ITERATORS_SECTION_ITERATORS_HPP
-#define BOOST_GEOMETRY_ITERATORS_SECTION_ITERATORS_HPP
-
-#include <iterator>
-
-#include <boost/range.hpp>
-
-#include <boost/geometry/core/access.hpp>
-#include <boost/geometry/iterators/base.hpp>
-#include <boost/geometry/algorithms/overlaps.hpp>
-
-
-// FILE WILL BE SPLITTED
-
-namespace boost { namespace geometry
-{
-namespace detail
-{
- template <size_t D, typename P, typename B>
- inline bool exceeding(short int dir, P const& point, B const& box)
- {
- return (dir == 1 && get<D>(point) > get<1, D>(box))
- || (dir == -1 && get<D>(point) < get<0, D>(box));
- }
-
- template <size_t D, typename P, typename B>
- inline bool preceding(short int dir, P const& point, B const& box)
- {
- return (dir == 1 && get<D>(point) < get<0, D>(box))
- || (dir == -1 && get<D>(point) > get<1, D>(box));
- }
-}
-
-
-// Iterator walking through ring/sections, delivering only those points of the ring
-// which are inside the specified box (using the sections)
-template<typename G, typename S, typename B, size_t D>
-struct section_iterator : public detail::iterators::iterator_base<
- section_iterator<G, S, B, D>,
- typename boost::range_iterator<G const>::type
- >
-{
- friend class boost::iterator_core_access;
-
- inline section_iterator(G const& ring, S const& sections, B const& box)
- : m_ring(ring)
- , m_sections(sections)
- , m_box(box)
- , m_section_iterator(boost::begin(m_sections))
- {
- stay_within_box();
- }
-
-
- private :
-
- inline void increment()
- {
- (this->base_reference())++;
-
- // If end or exceeding specified box, go to next section
- if (this->base() == m_end
- || detail::exceeding<D>(m_section_iterator->directions[0], *this->base(), m_box))
- {
- m_section_iterator++;
- stay_within_box();
- }
-
- }
-
- // Check if iterator is still in box and if not, go to the next section and advance until it is in box
- void stay_within_box()
- {
- // Find section having overlap with specified box
- while (m_section_iterator != boost::end(m_sections)
- && ! overlaps(m_section_iterator->bounding_box, m_box))
- {
- m_section_iterator++;
- }
- if (m_section_iterator != boost::end(m_sections))
- {
- this->base_reference() = boost::begin(m_ring) + m_section_iterator->begin_index;
- m_end = boost::begin(m_ring) + m_section_iterator->end_index + 1;
-
- // While not yet at box, advance
- while(this->base() != m_end
- && detail::preceding<D>(m_section_iterator->directions[0], *this->base(), m_box))
- {
- ++(this->base_reference());
- }
-
- if (this->base() == m_end)
- {
- // This should actually not occur because of bbox check, but to be sure
- m_section_iterator++;
- stay_within_box();
- }
- }
- else
- {
- this->base_reference() = boost::end(m_ring);
- m_end = boost::end(m_ring);
- }
- }
-
-
- typedef typename boost::range_iterator<G const>::type IT;
- typedef typename boost::range_iterator<S const>::type SIT;
-
- G const& m_ring;
- S const& m_sections;
- B const& m_box;
-
- IT m_end;
- SIT m_section_iterator;
-};
-
-
-// Iterator walking through ring/sections, delivering only those points of the ring
-// which are inside the specified box (using the sections)
-template<typename G, typename SEC, typename B, size_t D>
-struct one_section_segment_iterator : public detail::iterators::iterator_base<
- one_section_segment_iterator<G, SEC, B, D>
- , typename boost::range_iterator<G const>::type>
-{
- friend class boost::iterator_core_access;
- typedef typename boost::range_iterator<G const>::type normal_iterator;
-
- inline one_section_segment_iterator(G const& ring, SEC const& section, B const& box)
- : m_box(&box)
- , m_dir(section.directions[0])
- {
- init(section, ring);
- }
-
- inline one_section_segment_iterator(normal_iterator end)
- : m_section_end(end)
- , m_ring_end(end)
- , m_box(NULL)
- , m_dir(0)
- {
- this->base_reference() = end;
- }
-
-
- private :
-
- inline void increment()
- {
- m_previous = (this->base_reference())++;
-
- if (this->base() == m_section_end
- || detail::exceeding<D>(m_dir, *m_previous, *m_box))
- {
- this->base_reference() = m_ring_end;
- }
- }
-
- // Check if iterator is still in box and if not, go to the next section and advance until it is in box
- void init(SEC const& section, G const& ring)
- {
- //this->base_reference();
- m_section_end = boost::begin(ring) + section.end_index + 1;
- m_ring_end = boost::end(ring);
-
- this->base_reference() = boost::begin(ring) + section.begin_index;
-
- /* Performance, TO BE CHECKED!
- normal_iterator next = boost::begin(ring) + section.begin_index;
- if (next != m_section_end && next != m_ring_end)
- {
-
- // While (not end and) not yet at box, advance
- normal_iterator it = next++;
- while(next != m_section_end && next != m_ring_end
- && detail::preceding<D>(m_dir, *next, *m_box))
- {
- it = next++;
- }
-
-
- if (it == m_section_end)
- {
- this->base_reference() = m_ring_end;
- }
- else
- {
- this->base_reference() = it;
- }
- }
- else
- {
- this->base_reference() = m_ring_end;
- }
- */
-
- m_previous = this->base();
- }
-
-
- const B* m_box;
- short int m_dir;
-
- normal_iterator m_previous;
- normal_iterator m_section_end;
- normal_iterator m_ring_end;
-};
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_ITERATORS_SECTION_ITERATORS_HPP

Modified: sandbox/geometry/libs/geometry/Jamroot
==============================================================================
--- sandbox/geometry/libs/geometry/Jamroot (original)
+++ sandbox/geometry/libs/geometry/Jamroot 2010-04-24 10:22:22 EDT (Sat, 24 Apr 2010)
@@ -13,7 +13,7 @@
         <warnings>all
         <toolset>intel:<warnings>on
         <toolset>gcc:<cxxflags>"-pedantic -Wall -Wstrict-aliasing -fstrict-aliasing -Wno-long-long"
- <toolset>msvc:<cxxflags>/W4
         <include>../..
         <include>.
+ <include>/boost//headers
     ;

Modified: sandbox/geometry/libs/geometry/doc/testcases/dissolve.ppt
==============================================================================
Binary files. No diff available.

Modified: sandbox/geometry/libs/geometry/example/x04_wxwidgets_world_mapper.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/example/x04_wxwidgets_world_mapper.vcproj (original)
+++ sandbox/geometry/libs/geometry/example/x04_wxwidgets_world_mapper.vcproj 2010-04-24 10:22:22 EDT (Sat, 24 Apr 2010)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
         ProjectType="Visual C++"
- Version="9,00"
+ Version="9.00"
         Name="x04_wxwidgets_world_mapper"
         ProjectGUID="{DD1D469B-29A8-4873-A596-9CCCB24F54FA}"
         TargetFrameworkVersion="131072"
@@ -44,10 +44,11 @@
                                 Optimization="0"
                                 AdditionalIncludeDirectories="&quot;c:\software\libraries\wxWidgets-2.8.10\lib\vc_lib\mswd&quot;;&quot;c:\software\libraries\wxWidgets-2.8.10\include&quot;;..\..\.."
                                 PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH"
+ RuntimeLibrary="2"
                                 RuntimeTypeInfo="true"
                                 WarningLevel="3"
                                 SuppressStartupBanner="true"
- DebugInformationFormat="1"
+ DebugInformationFormat="3"
                         />
                         <Tool
                                 Name="VCManagedResourceCompilerTool"
@@ -64,7 +65,6 @@
                         <Tool
                                 Name="VCLinkerTool"
                                 AdditionalDependencies="wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib gdiplus.lib"
-
                                 SuppressStartupBanner="true"
                                 AdditionalLibraryDirectories="c:\software\libraries\wxWidgets-2.8.10\lib\vc_lib"
                                 IgnoreDefaultLibraryNames=""
@@ -129,7 +129,7 @@
                                 AdditionalIncludeDirectories="&quot;c:\software\libraries\wxWidgets-2.8.10\lib\vc_lib\mswd&quot;;&quot;c:\software\libraries\wxWidgets-2.8.10\include&quot;;..\..\.."
                                 PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH"
                                 StringPooling="true"
-
+ RuntimeLibrary="2"
                                 EnableFunctionLevelLinking="true"
                                 RuntimeTypeInfo="true"
                                 PrecompiledHeaderFile=""
@@ -151,7 +151,6 @@
                         <Tool
                                 Name="VCLinkerTool"
                                 AdditionalDependencies="wxmsw28_core.lib wxbase28.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib wxregex.lib wxexpat.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib gdiplus.lib"
-
                                 SuppressStartupBanner="true"
                                 AdditionalLibraryDirectories="c:\software\libraries\wxWidgets-2.8.10\lib\vc_lib"
                                 ProgramDatabaseFile=""


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