|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66810 - in sandbox/geometry/boost/geometry: algorithms algorithms/detail/overlay algorithms/detail/sections core extensions/gis/io/wkt extensions/gis/latlong extensions/io/svg extensions/nsphere/algorithms extensions/nsphere/core extensions/nsphere/geometries geometries iterators multi/geometries strategies strategies/cartesian
From: barend.gehrels_at_[hidden]
Date: 2010-11-28 08:23:48
Author: barendgehrels
Date: 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
New Revision: 66810
URL: http://svn.boost.org/trac/boost/changeset/66810
Log:
Major update:
1) all provided geometries are now in namespace model
2) segment is renamed to model::referring_segment, there is also a model::segment which owns the points
Text files modified:
sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp | 4
sandbox/geometry/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp | 4
sandbox/geometry/boost/geometry/algorithms/detail/overlay/dissolver.hpp | 4
sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp | 6
sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 4
sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp | 36 ++--
sandbox/geometry/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp | 22 ++-
sandbox/geometry/boost/geometry/algorithms/detail/overlay/ring_properties.hpp | 2
sandbox/geometry/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp | 2
sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp | 6
sandbox/geometry/boost/geometry/algorithms/for_each.hpp | 2
sandbox/geometry/boost/geometry/core/replace_point_type.hpp | 10
sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp | 2
sandbox/geometry/boost/geometry/extensions/gis/latlong/latlong.hpp | 6
sandbox/geometry/boost/geometry/extensions/gis/latlong/point_ll.hpp | 21 ++-
sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp | 82 ++++++------
sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/append.hpp | 6
sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/area.hpp | 4
sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/clear.hpp | 2
sandbox/geometry/boost/geometry/extensions/nsphere/core/replace_point_type.hpp | 2
sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp | 5
sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp | 5
sandbox/geometry/boost/geometry/extensions/nsphere/geometries/nsphere.hpp | 21 ++-
sandbox/geometry/boost/geometry/geometries/box.hpp | 23 ++-
sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp | 6
sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp | 7 +
sandbox/geometry/boost/geometry/geometries/linear_ring.hpp | 92 ---------------
sandbox/geometry/boost/geometry/geometries/linestring.hpp | 7
sandbox/geometry/boost/geometry/geometries/point.hpp | 20 ++-
sandbox/geometry/boost/geometry/geometries/point_xy.hpp | 21 ++-
sandbox/geometry/boost/geometry/geometries/polygon.hpp | 244 ++++++++++-----------------------------
sandbox/geometry/boost/geometry/geometries/segment.hpp | 109 ++++++++---------
sandbox/geometry/boost/geometry/iterators/segment_returning_iterator.hpp | 2
sandbox/geometry/boost/geometry/multi/geometries/multi_linestring.hpp | 9 +
sandbox/geometry/boost/geometry/multi/geometries/multi_point.hpp | 9 +
sandbox/geometry/boost/geometry/multi/geometries/multi_polygon.hpp | 9 +
sandbox/geometry/boost/geometry/strategies/cartesian/distance_projected_point.hpp | 2
sandbox/geometry/boost/geometry/strategies/intersection.hpp | 4
38 files changed, 351 insertions(+), 471 deletions(-)
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -603,7 +603,7 @@
//if (! only_positive)
{
- typedef geometry::box<point_type> box_type;
+ typedef model::box<point_type> box_type;
box_type total = geometry::make_envelope<box_type>(geometry1);
geometry::combine(total,
geometry::make_envelope<box_type>(geometry2));
@@ -627,7 +627,7 @@
Geometry1,
Geometry2,
std::vector<ring_type>,
- geometry::box<point_type>
+ model::box<point_type>
>::apply(ring_properties_container,
geometry1, geometry2, rings, direction, dissolve, total);
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -42,7 +42,7 @@
class liang_barsky
{
private:
- typedef geometry::segment<Point> segment_type;
+ typedef model::referring_segment<Point> segment_type;
template <typename T>
inline bool check_edge(T const& p, T const& q, T& t1, T& t2) const
@@ -197,7 +197,7 @@
bool c1 = false;
bool c2 = false;
- segment<point_type> s(p1, p2);
+ model::referring_segment<point_type> s(p1, p2);
if (!strategy.clip_segment(b, s, c1, c2))
{
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/dissolver.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/dissolver.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/dissolver.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -277,7 +277,7 @@
{
typedef typename boost::range_value<Vector>::type value_type;
typedef typename geometry::point_type<value_type>::type point_type;
- typedef geometry::box<point_type> box_type;
+ typedef model::box<point_type> box_type;
for(typename boost::range_iterator<Vector const>::type
it = boost::begin(v);
it != boost::end(v);
@@ -482,7 +482,7 @@
typedef typename boost::range_value<OutputCollection>::type output_type;
typedef typename geometry::point_type<output_type>::type point_type;
- typedef geometry::box<point_type> box_type;
+ typedef model::box<point_type> box_type;
typedef dissolve_helper<box_type> dissolve_helper_type;
typedef std::vector<dissolve_helper_type> helper_vector_type;
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -49,12 +49,12 @@
TurnInfo const& tp_model,
OutputIterator out)
{
- typedef segment<Point1 const> segment_type1;
- typedef segment<Point1 const> segment_type2;
+ typedef model::referring_segment<Point1 const> segment_type1;
+ typedef model::referring_segment<Point1 const> segment_type2;
segment_type1 p1(pi, pj), p2(pj, pk);
segment_type2 q1(qi, qj), q2(qj, qk);
- //
+ //
typename strategy::return_type result = strategy::apply(p1, q1);
for (std::size_t i = 0; i < result.template get<0>().count; i++)
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -726,8 +726,8 @@
TurnInfo const& tp_model,
OutputIterator out)
{
- typedef segment<Point1 const> segment_type1;
- typedef segment<Point1 const> segment_type2;
+ typedef model::referring_segment<Point1 const> segment_type1;
+ typedef model::referring_segment<Point1 const> segment_type2;
segment_type1 p1(pi, pj), p2(pj, pk);
segment_type2 q1(qi, qj), q2(qj, qk);
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -238,8 +238,8 @@
private :
typedef typename geometry::point_type<Geometry1>::type point1_type;
typedef typename geometry::point_type<Geometry2>::type point2_type;
- typedef typename geometry::segment<point1_type const> segment1_type;
- typedef typename geometry::segment<point2_type const> segment2_type;
+ typedef typename model::referring_segment<point1_type const> segment1_type;
+ typedef typename model::referring_segment<point2_type const> segment2_type;
template <size_t Dim, typename Point, typename Box>
@@ -283,9 +283,9 @@
// So we mimic it here
template <typename Range, typename Section, typename Box>
static inline void get_start_point_iterator(Section & section,
- Range const& range,
- typename boost::range_iterator<Range const>::type& it,
- typename boost::range_iterator<Range const>::type& prev,
+ Range const& range,
+ typename boost::range_iterator<Range const>::type& it,
+ typename boost::range_iterator<Range const>::type& prev,
typename boost::range_iterator<Range const>::type& end,
int& index, int& ndi,
int dir, Box const& other_bounding_box)
@@ -478,8 +478,8 @@
// (to enable input-pointer-point-types)
typedef typename boost::range_value<Turns>::type ip_type;
typedef typename ip_type::point_type point_type;
- typedef typename geometry::sections<geometry::box<point_type>, 1> sections1_type;
- typedef typename geometry::sections<geometry::box<point_type>, 1> sections2_type;
+ typedef typename geometry::sections<model::box<point_type>, 1> sections1_type;
+ typedef typename geometry::sections<model::box<point_type>, 1> sections2_type;
sections1_type sec1;
sections2_type sec2;
@@ -488,7 +488,7 @@
geometry::sectionalize(geometry2, sec2);
// Divide and conquer
- geometry::box<point_type> box;
+ model::box<point_type> box;
geometry::assign_inverse(box);
add_sections(box, sec1);
add_sections(box, sec2);
@@ -589,7 +589,7 @@
if (true)
{
get_turns_with_box(seg_id, source_id2,
- *prev, *it, *next,
+ *prev, *it, *next,
bp[0], bp[i1], bp[2], bp[i3], // note the "i" here
turns);
// TODO: call the interrupt policy if applicable
@@ -620,14 +620,14 @@
static inline void get_turns_with_box(segment_identifier const& seg_id, int source_id2,
// Points from a range:
- point_type const& rp0,
- point_type const& rp1,
+ point_type const& rp0,
+ point_type const& rp1,
point_type const& rp2,
// Points from the box
- box_point_type const& bp0,
- box_point_type const& bp1,
+ box_point_type const& bp0,
+ box_point_type const& bp1,
box_point_type const& bp2,
- box_point_type const& bp3,
+ box_point_type const& bp3,
// Output
Turns& turns)
{
@@ -695,7 +695,7 @@
intersector_type::apply(
source_id1, geometry::exterior_ring(polygon),
- source_id2, box, turns, interrupt_policy,
+ source_id2, box, turns, interrupt_policy,
multi_index, -1);
int i = 0;
@@ -705,7 +705,7 @@
{
intersector_type::apply(
source_id1, *it,
- source_id2, box, turns, interrupt_policy,
+ source_id2, box, turns, interrupt_policy,
multi_index, i);
}
@@ -752,7 +752,7 @@
>
struct get_turns
<
- polygon_tag, box_tag,
+ polygon_tag, box_tag,
Polygon, Box,
Turns,
TurnPolicy,
@@ -775,7 +775,7 @@
>
struct get_turns
<
- ring_tag, box_tag,
+ ring_tag, box_tag,
Ring, Box,
Turns,
TurnPolicy,
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -52,7 +52,7 @@
typedef typename Indexed::type turn_operation_type;
typedef typename geometry::point_type<Geometry1>::type point_type;
- typedef geometry::segment<point_type const> segment_type;
+ typedef model::referring_segment<point_type const> segment_type;
// Determine how p/r and p/s are located.
template <typename P>
@@ -97,6 +97,8 @@
) const
{
if (skip) return;
+
+
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
point_type pi, pj, ri, rj, si, sj;
geometry::copy_segment_points(m_geometry1, m_geometry2,
@@ -111,7 +113,7 @@
bool prc = false, psc = false, rsc = false;
overlap_info(pi, pj, ri, rj, si, sj, prc, psc, rsc);
-
+
int const side_ri_p = m_strategy.apply(pi, pj, ri);
int const side_rj_p = m_strategy.apply(pi, pj, rj);
int const side_si_p = m_strategy.apply(pi, pj, si);
@@ -130,7 +132,7 @@
std::cout << " s//r: " << side_si_r << " / " << side_sj_r << std::endl;
#endif
- std::cout << header
+ std::cout << header
//<< " order: " << order
<< " ops: " << operation_char(left.subject.operation)
<< "/" << operation_char(right.subject.operation)
@@ -244,17 +246,19 @@
inline bool consider_iu_iu(Indexed const& left, Indexed const& right,
std::string const& header) const
{
- debug_consider(0, left, right, header);
+ //debug_consider(0, left, right, header);
// In general, order it like "union, intersection".
if (left.subject.operation == operation_intersection
&& right.subject.operation == operation_union)
{
+ //debug_consider(0, left, right, header, false, "i,u", false);
return false;
}
else if (left.subject.operation == operation_union
&& right.subject.operation == operation_intersection)
{
+ //debug_consider(0, left, right, header, false, "u,i", true);
return true;
}
@@ -294,7 +298,7 @@
{
ret = side_ri_p == 1; // #100
- //debug_consider(0, left, right, header, false, "coming from opposite", ret);
+ debug_consider(0, left, right, header, false, "opp.", ret);
return ret;
}
#ifdef BOOST_GEOMETRY_DEBUG_ENRICH
@@ -322,7 +326,7 @@
ret = side_si_r == 1;
}
- //debug_consider(0, left, right, header, false, "other", ret);
+ debug_consider(0, left, right, header, false, "left or right", ret);
return ret;
}
@@ -334,18 +338,18 @@
// Take the one NOT overlapping
bool ret = false;
bool found = false;
- if (pr_ov && ! ps_ov)
+ if (pr_ov && ! ps_ov)
{
ret = true;
found = true;
}
- else if (!pr_ov && ps_ov)
+ else if (!pr_ov && ps_ov)
{
ret = false;
found = true;
}
- //debug_consider(0, left, right, header, false, "aligned", ret);
+ debug_consider(0, left, right, header, false, "aligned", ret);
if (found)
{
return ret;
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/ring_properties.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/ring_properties.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/ring_properties.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -26,7 +26,7 @@
struct ring_properties
{
typedef Point point_type;
- typedef geometry::box<Point> box_type;
+ typedef model::box<Point> box_type;
ring_identifier ring_id;
typename area_result<Point>::type area;
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -45,7 +45,7 @@
{
typedef typename geometry::sections
<
- geometry::box <typename geometry::point_type<Geometry>::type>,
+ model::box <typename geometry::point_type<Geometry>::type>,
1
> sections_type;
Modified: sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -239,7 +239,7 @@
>
struct sectionalize_part
{
- typedef geometry::segment<Point const> segment_type;
+ typedef model::referring_segment<Point const> segment_type;
typedef typename boost::range_value<Sections>::type section_type;
typedef typename boost::range_iterator<Range const>::type iterator_type;
@@ -362,7 +362,7 @@
static inline void apply(Range const& range, Sections& sections,
int ring_index = -1, int multi_index = -1)
{
- typedef segment<Point const> segment_type;
+ typedef model::referring_segment<Point const> segment_type;
view_type view(range);
@@ -387,7 +387,7 @@
sectionalize_part
<
- view_type, Point, Sections,
+ view_type, Point, Sections,
DimensionCount, MaxCount
>::apply(sections, section, index, ndi,
view, ring_index, multi_index);
Modified: sandbox/geometry/boost/geometry/algorithms/for_each.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/for_each.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/for_each.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -92,7 +92,7 @@
iterator_type previous = it++;
while(it != boost::end(range))
{
- segment<point_type> s(*previous, *it);
+ model::referring_segment<point_type> s(*previous, *it);
f(s);
previous = it++;
}
Modified: sandbox/geometry/boost/geometry/core/replace_point_type.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/core/replace_point_type.hpp (original)
+++ sandbox/geometry/boost/geometry/core/replace_point_type.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -47,31 +47,31 @@
template <typename Geometry, typename NewPointType>
struct replace_point_type<linestring_tag, Geometry, NewPointType>
{
- typedef linestring<NewPointType> type;
+ typedef model::linestring<NewPointType> type;
};
template <typename Geometry, typename NewPointType>
struct replace_point_type<segment_tag, Geometry, NewPointType>
{
- typedef segment<NewPointType> type;
+ typedef model::segment<NewPointType> type;
};
template <typename Geometry, typename NewPointType>
struct replace_point_type<ring_tag, Geometry, NewPointType>
{
- typedef linear_ring<NewPointType> type;
+ typedef model::linear_ring<NewPointType> type;
};
template <typename Geometry, typename NewPointType>
struct replace_point_type<box_tag, Geometry, NewPointType>
{
- typedef box<NewPointType> type;
+ typedef model::box<NewPointType> type;
};
template <typename Geometry, typename NewPointType>
struct replace_point_type<polygon_tag, Geometry, NewPointType>
{
- typedef polygon<NewPointType> type;
+ typedef model::polygon<NewPointType> type;
};
Modified: sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -191,7 +191,7 @@
Box const& box)
{
// Convert to linear ring, then stream
- typedef linear_ring<point_type> ring_type;
+ typedef model::linear_ring<point_type> ring_type;
ring_type ring;
geometry::convert(box, ring);
os << "POLYGON(";
Modified: sandbox/geometry/boost/geometry/extensions/gis/latlong/latlong.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/latlong/latlong.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/latlong/latlong.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -21,6 +21,9 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
typedef point_ll<double, cs::geographic<degree> > point_ll_deg;
typedef linestring<point_ll_deg> linestring_ll_deg;
typedef linear_ring<point_ll_deg> ring_ll_deg;
@@ -35,6 +38,9 @@
typedef box<point_ll_rad> box_ll_rad;
typedef segment<point_ll_rad> segment_ll_rad;
+} // namespace model
+
+
}} // namespace boost::geometry
Modified: sandbox/geometry/boost/geometry/extensions/gis/latlong/point_ll.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/latlong/point_ll.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/latlong/point_ll.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -25,6 +25,10 @@
namespace boost { namespace geometry
{
+
+namespace model
+{
+
/*!
\brief Point using spherical coordinates \a lat and \a lon, on Earth
\ingroup Geometry
@@ -101,6 +105,9 @@
}
};
+
+} // namespace model
+
// Adapt the point_ll to the concept
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
@@ -112,7 +119,7 @@
typename CoordinateSystem,
std::size_t DimensionCount
>
-struct tag<point_ll<CoordinateType, CoordinateSystem, DimensionCount> >
+struct tag<model::point_ll<CoordinateType, CoordinateSystem, DimensionCount> >
{
typedef point_tag type;
};
@@ -125,7 +132,7 @@
>
struct coordinate_type
<
- point_ll<CoordinateType, CoordinateSystem, DimensionCount>
+ model::point_ll<CoordinateType, CoordinateSystem, DimensionCount>
>
{
typedef CoordinateType type;
@@ -139,7 +146,7 @@
>
struct coordinate_system
<
- point_ll<CoordinateType, CoordinateSystem, DimensionCount>
+ model::point_ll<CoordinateType, CoordinateSystem, DimensionCount>
>
{
typedef CoordinateSystem type;
@@ -153,7 +160,7 @@
>
struct dimension
<
- point_ll<CoordinateType, CoordinateSystem, DimensionCount>
+ model::point_ll<CoordinateType, CoordinateSystem, DimensionCount>
>
: boost::mpl::int_<DimensionCount>
{};
@@ -167,17 +174,17 @@
>
struct access
<
- point_ll<CoordinateType, CoordinateSystem, DimensionCount>, Dimension
+ model::point_ll<CoordinateType, CoordinateSystem, DimensionCount>, Dimension
>
{
static inline CoordinateType get(
- point_ll<CoordinateType, CoordinateSystem, DimensionCount> const& p)
+ model::point_ll<CoordinateType, CoordinateSystem, DimensionCount> const& p)
{
return p.template get<Dimension>();
}
static inline void set(
- point_ll<CoordinateType, CoordinateSystem, DimensionCount>& p,
+ model::point_ll<CoordinateType, CoordinateSystem, DimensionCount>& p,
CoordinateType const& value)
{
p.template set<Dimension>(value);
Modified: sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -63,31 +63,31 @@
template <typename Point>
-struct svg_map<boost::geometry::point_tag, false, Point>
+struct svg_map<point_tag, false, Point>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
std::string const& style, int size,
Point const& point, TransformStrategy const& strategy)
{
- boost::geometry::point_xy<int> ipoint;
- boost::geometry::transform(point, ipoint, strategy);
- stream << boost::geometry::svg(ipoint, style, size) << std::endl;
+ model::point_xy<int> ipoint;
+ transform(point, ipoint, strategy);
+ stream << svg(ipoint, style, size) << std::endl;
}
};
template <typename Box>
-struct svg_map<boost::geometry::box_tag, false, Box>
+struct svg_map<box_tag, false, Box>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
std::string const& style, int size,
Box const& box, TransformStrategy const& strategy)
{
- boost::geometry::box<boost::geometry::point_xy<int> > ibox;
- boost::geometry::transform(box, ibox, strategy);
+ model::box<model::point_xy<int> > ibox;
+ transform(box, ibox, strategy);
- stream << boost::geometry::svg(ibox, style, size) << std::endl;
+ stream << svg(ibox, style, size) << std::endl;
}
};
@@ -101,53 +101,53 @@
Range1 const& range, TransformStrategy const& strategy)
{
Range2 irange;
- boost::geometry::transform(range, irange, strategy);
- stream << boost::geometry::svg(irange, style, size) << std::endl;
+ transform(range, irange, strategy);
+ stream << svg(irange, style, size) << std::endl;
}
};
template <typename Segment>
-struct svg_map<boost::geometry::segment_tag, false, Segment>
+struct svg_map<segment_tag, false, Segment>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
std::string const& style, int size,
Segment const& segment, TransformStrategy const& strategy)
{
- typedef boost::geometry::segment_range<Segment> range_type;
+ typedef segment_range<Segment> range_type;
range_type range(segment);
svg_map_range
<
- range_type,
- boost::geometry::linestring<boost::geometry::point_xy<int> >
+ range_type,
+ model::linestring<model::point_xy<int> >
>::apply(stream, style, size, range, strategy);
}
};
template <typename Ring>
-struct svg_map<boost::geometry::ring_tag, false, Ring>
- : svg_map_range<Ring, boost::geometry::linear_ring<boost::geometry::point_xy<int> > >
+struct svg_map<ring_tag, false, Ring>
+ : svg_map_range<Ring, model::linear_ring<model::point_xy<int> > >
{};
template <typename Linestring>
-struct svg_map<boost::geometry::linestring_tag, false, Linestring>
- : svg_map_range<Linestring, boost::geometry::linestring<boost::geometry::point_xy<int> > >
+struct svg_map<linestring_tag, false, Linestring>
+ : svg_map_range<Linestring, model::linestring<model::point_xy<int> > >
{};
template <typename Polygon>
-struct svg_map<boost::geometry::polygon_tag, false, Polygon>
+struct svg_map<polygon_tag, false, Polygon>
{
template <typename TransformStrategy>
static inline void apply(std::ostream& stream,
std::string const& style, int size,
Polygon const& polygon, TransformStrategy const& strategy)
{
- boost::geometry::polygon<boost::geometry::point_xy<int> > ipoly;
- boost::geometry::transform(polygon, ipoly, strategy);
- stream << boost::geometry::svg(ipoly, style, size) << std::endl;
+ model::polygon<model::point_xy<int> > ipoly;
+ transform(polygon, ipoly, strategy);
+ stream << svg(ipoly, style, size) << std::endl;
}
};
@@ -167,7 +167,7 @@
{
svg_map
<
- typename boost::geometry::single_tag<Tag>::type,
+ typename single_tag<Tag>::type,
false,
typename boost::range_value<Multi>::type
>::apply(stream, style, size, *it, strategy);
@@ -187,8 +187,8 @@
{
dispatch::svg_map
<
- typename boost::geometry::tag<Geometry>::type,
- boost::geometry::is_multi<Geometry>::type::value,
+ typename tag<Geometry>::type,
+ is_multi<Geometry>::type::value,
typename boost::remove_const<Geometry>::type
>::apply(stream, style, size, geometry, strategy);
}
@@ -197,8 +197,8 @@
template <typename Point, bool SameScale = true>
class svg_mapper : boost::noncopyable
{
- typedef boost::geometry::point_xy<int> map_point_type;
- typedef boost::geometry::strategy::transform::map_transformer
+ typedef model::point_xy<int> map_point_type;
+ typedef strategy::transform::map_transformer
<
Point,
map_point_type,
@@ -206,7 +206,7 @@
SameScale
> transformer_type;
- boost::geometry::box<Point> m_bounding_box;
+ model::box<Point> m_bounding_box;
boost::scoped_ptr<transformer_type> m_matrix;
std::ostream& m_stream;
int m_width, m_height;
@@ -237,7 +237,7 @@
, m_width(w)
, m_height(h)
{
- boost::geometry::assign_inverse(m_bounding_box);
+ assign_inverse(m_bounding_box);
}
virtual ~svg_mapper()
@@ -248,12 +248,12 @@
template <typename Geometry>
void add(Geometry const& geometry)
{
- if (boost::geometry::num_points(geometry) > 0)
+ if (num_points(geometry) > 0)
{
- boost::geometry::combine(m_bounding_box,
- boost::geometry::make_envelope
+ combine(m_bounding_box,
+ make_envelope
<
- boost::geometry::box<Point>
+ model::box<Point>
>(geometry));
}
}
@@ -266,11 +266,11 @@
(
( boost::is_same
<
- Point,
- typename boost::geometry::point_type<Geometry>::type
+ Point,
+ typename point_type<Geometry>::type
>::value )
, POINT_TYPES_ARE_NOT_SAME_FOR_MAPPER_AND_MAP
- , (types<Point, typename boost::geometry::point_type<Geometry>::type>)
+ , (types<Point, typename point_type<Geometry>::type>)
);
@@ -285,11 +285,11 @@
{
init_matrix();
map_point_type map_point;
- boost::geometry::transform(point, map_point, *m_matrix);
+ transform(point, map_point, *m_matrix);
m_stream
<< "<text style=\"" << style << "\""
- << " x=\"" << boost::geometry::get<0>(map_point) + offset_x << "\""
- << " y=\"" << boost::geometry::get<1>(map_point) + offset_y << "\""
+ << " x=\"" << get<0>(map_point) + offset_x << "\""
+ << " y=\"" << get<1>(map_point) + offset_y << "\""
<< ">";
if (s.find("\n") == std::string::npos)
{
@@ -307,9 +307,9 @@
++it, offset_y += lineheight)
{
m_stream
- << "<tspan x=\"" << boost::geometry::get<0>(map_point) + offset_x
+ << "<tspan x=\"" << get<0>(map_point) + offset_x
<< "\""
- << " y=\"" << boost::geometry::get<1>(map_point) + offset_y
+ << " y=\"" << get<1>(map_point) + offset_y
<< "\""
<< ">" << *it << "</tspan>";
}
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/append.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/append.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/append.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -25,8 +25,10 @@
namespace dispatch
{
-template <typename TagRoP, typename N, typename RoP, bool Std>
-struct append<nsphere_tag, TagRoP, N, RoP, Std> {};
+// This file is probably obsolete
+
+//template <typename TagRoP, typename N, typename RoP, bool Std>
+//struct append<nsphere_tag, TagRoP, N, RoP, Std> {};
} // namespace dispatch
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/area.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/area.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/area.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -61,8 +61,8 @@
{
-template <typename Geometry, order_selector Order, typename Strategy>
-struct area<nsphere_tag, Geometry, Order, Strategy>
+template <typename Geometry, typename Strategy>
+struct area<nsphere_tag, Geometry, Strategy>
: detail::area::circle_area<Geometry, Strategy>
{};
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/clear.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/clear.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/algorithms/clear.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -27,7 +27,7 @@
template <typename Geometry>
-struct clear<nsphere_tag, true, Geometry>
+struct clear<nsphere_tag, Geometry>
: detail::clear::no_action<Geometry>
{};
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/core/replace_point_type.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/core/replace_point_type.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/core/replace_point_type.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -29,7 +29,7 @@
struct replace_point_type<nsphere_tag, Geometry, NewPointType>
{
typedef typename geometry::coordinate_type<Geometry>::type coortype;
- typedef nsphere<NewPointType, coortype> type;
+ typedef model::nsphere<NewPointType, coortype> type;
};
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -15,8 +15,13 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
typedef nsphere<point_2d, double> circle;
+}
+
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -15,8 +15,13 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
typedef nsphere<point_3d, double> sphere;
+}
+
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_EXTENSION_NSPHERE_CARTESIAN3D_HPP
Modified: sandbox/geometry/boost/geometry/extensions/nsphere/geometries/nsphere.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/geometries/nsphere.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/geometries/nsphere.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -22,6 +22,10 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
+
/*!
\brief Class nsphere: defines a circle or a sphere: a point with radius
\ingroup Geometry
@@ -68,33 +72,36 @@
T m_radius;
};
+
+} // namespace model
+
// Traits specializations for n-sphere above
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
template <typename Point, typename RadiusType>
-struct tag< nsphere<Point, RadiusType> >
+struct tag<model::nsphere<Point, RadiusType> >
{
typedef nsphere_tag type;
};
template <typename Point, typename RadiusType>
-struct point_type<nsphere<Point, RadiusType> >
+struct point_type<model::nsphere<Point, RadiusType> >
{
typedef Point type;
};
template <typename Point, typename RadiusType>
-struct radius_type<nsphere<Point, RadiusType> >
+struct radius_type<model::nsphere<Point, RadiusType> >
{
typedef RadiusType type;
};
template <typename Point, typename CoordinateType, std::size_t Dimension>
-struct access<nsphere<Point, CoordinateType>, Dimension>
+struct access<model::nsphere<Point, CoordinateType>, Dimension>
{
- typedef nsphere<Point, CoordinateType> nsphere_type;
+ typedef model::nsphere<Point, CoordinateType> nsphere_type;
static inline CoordinateType get(nsphere_type const& s)
{
@@ -108,9 +115,9 @@
};
template <typename Point, typename RadiusType>
-struct radius_access<nsphere<Point, RadiusType>, RadiusType, 0>
+struct radius_access<model::nsphere<Point, RadiusType>, RadiusType, 0>
{
- typedef nsphere<Point, RadiusType> nsphere_type;
+ typedef model::nsphere<Point, RadiusType> nsphere_type;
static inline RadiusType get(nsphere_type const& s)
{
Modified: sandbox/geometry/boost/geometry/geometries/box.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/box.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/box.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -20,6 +20,10 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
+
/*!
\brief Class box: defines a box made of two describing points
\ingroup geometries
@@ -64,50 +68,53 @@
};
+} // namespace model
+
+
// Traits specializations for box above
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
template <typename Point>
-struct tag<box<Point> >
+struct tag<model::box<Point> >
{
typedef box_tag type;
};
template <typename Point>
-struct point_type<box<Point> >
+struct point_type<model::box<Point> >
{
typedef Point type;
};
template <typename Point, std::size_t Dimension>
-struct indexed_access<box<Point>, min_corner, Dimension>
+struct indexed_access<model::box<Point>, min_corner, Dimension>
{
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
- static inline coordinate_type get(box<Point> const& b)
+ static inline coordinate_type get(model::box<Point> const& b)
{
return geometry::get<Dimension>(b.min_corner());
}
- static inline void set(box<Point>& b, coordinate_type const& value)
+ static inline void set(model::box<Point>& b, coordinate_type const& value)
{
geometry::set<Dimension>(b.min_corner(), value);
}
};
template <typename Point, std::size_t Dimension>
-struct indexed_access<box<Point>, max_corner, Dimension>
+struct indexed_access<model::box<Point>, max_corner, Dimension>
{
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
- static inline coordinate_type get(box<Point> const& b)
+ static inline coordinate_type get(model::box<Point> const& b)
{
return geometry::get<Dimension>(b.max_corner());
}
- static inline void set(box<Point>& b, coordinate_type const& value)
+ static inline void set(model::box<Point>& b, coordinate_type const& value)
{
geometry::set<Dimension>(b.max_corner(), value);
}
Modified: sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -16,6 +16,9 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
typedef point_xy<double, cs::cartesian> point_2d;
typedef linestring<point_2d> linestring_2d;
typedef linear_ring<point_2d> ring_2d;
@@ -23,6 +26,9 @@
typedef box<point_2d> box_2d;
typedef segment<point_2d> segment_2d;
+} // namespace model
+
+
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_GEOMETRIES_CARTESIAN2D_HPP
Modified: sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -15,12 +15,19 @@
namespace boost { namespace geometry
{
+
+namespace model
+{
+
typedef point<double, 3, cs::cartesian> point_3d;
typedef linestring<point_3d> linestring_3d;
typedef linear_ring<point_3d> ring_3d;
typedef polygon<point_3d> polygon_3d;
typedef box<point_3d> box_3d;
+} // namespace model
+
+
}} // namespace boost::geometry
Modified: sandbox/geometry/boost/geometry/geometries/linear_ring.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/linear_ring.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/linear_ring.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -25,98 +25,6 @@
namespace boost { namespace geometry
{
-/*!
- \brief A linear_ring (linear linear_ring) is a closed line which should not be selfintersecting
- \ingroup geometries
- \tparam P point type
- \tparam V optional container type, for example std::vector, std::list, std::deque
- \tparam A optional container-allocator-type
-*/
-template
-<
- typename P,
- template<typename, typename> class V = std::vector,
- bool ClockWise = true, bool Closed = true,
- template<typename> class A = std::allocator
->
-class linear_ring : public V<P, A<P> >
-{
- BOOST_CONCEPT_ASSERT( (concept::Point<P>) );
-};
-
-#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
-namespace traits
-{
-
-template
-<
- typename P,
- template<typename, typename> class V,
- bool ClockWise, bool Closed,
- template<typename> class A
->
-struct tag< linear_ring<P, V, ClockWise, Closed, A> >
-{
- typedef ring_tag type;
-};
-
-
-template
-<
- typename P,
- template<typename, typename> class V,
- bool Closed,
- template<typename> class A
->
-struct point_order< linear_ring<P, V, false, Closed, A> >
-{
- static const order_selector value = counterclockwise;
-};
-
-
-template
-<
- typename P,
- template<typename, typename> class V,
- bool Closed,
- template<typename> class A
->
-struct point_order< linear_ring<P, V, true, Closed, A> >
-{
- static const order_selector value = clockwise;
-};
-
-template
-<
- typename P,
- template<typename, typename> class V,
- bool PointOrder,
- template<typename> class A
->
-struct closure< linear_ring<P, V, PointOrder, true, A> >
-{
- static const closure_selector value = closed;
-};
-
-template
-<
- typename P,
- template<typename, typename> class V,
- bool PointOrder,
- template<typename> class A
->
-struct closure< linear_ring<P, V, PointOrder, false, A> >
-{
- static const closure_selector value = open;
-};
-
-
-} // namespace traits
-#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
-
-
-
-// NEW APPROACH
namespace model
{
/*!
Modified: sandbox/geometry/boost/geometry/geometries/linestring.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/linestring.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/linestring.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -24,6 +24,9 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
/*!
\brief A linestring (named so by OGC) is a collection (default a vector) of points.
\ingroup geometries
@@ -46,6 +49,8 @@
BOOST_CONCEPT_ASSERT( (concept::Point<P>) );
};
+} // namespace model
+
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
@@ -56,7 +61,7 @@
template<typename,typename> class V,
template<typename> class A
>
-struct tag<linestring<P, V, A> >
+struct tag<model::linestring<P, V, A> >
{
typedef linestring_tag type;
};
Modified: sandbox/geometry/boost/geometry/geometries/point.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/point.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/point.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -23,6 +23,10 @@
namespace boost { namespace geometry
{
+
+namespace model
+{
+
/*!
\brief Basic point class, having coordinates defined in a neutral way
\ingroup geometries
@@ -86,6 +90,8 @@
};
+} // namespace model
+
// Adapt the point to the concept
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
@@ -96,7 +102,7 @@
std::size_t DimensionCount,
typename CoordinateSystem
>
-struct tag<point<CoordinateType, DimensionCount, CoordinateSystem> >
+struct tag<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
{
typedef point_tag type;
};
@@ -107,7 +113,7 @@
std::size_t DimensionCount,
typename CoordinateSystem
>
-struct coordinate_type<point<CoordinateType, DimensionCount, CoordinateSystem> >
+struct coordinate_type<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
{
typedef CoordinateType type;
};
@@ -118,7 +124,7 @@
std::size_t DimensionCount,
typename CoordinateSystem
>
-struct coordinate_system<point<CoordinateType, DimensionCount, CoordinateSystem> >
+struct coordinate_system<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
{
typedef CoordinateSystem type;
};
@@ -129,7 +135,7 @@
std::size_t DimensionCount,
typename CoordinateSystem
>
-struct dimension<point<CoordinateType, DimensionCount, CoordinateSystem> >
+struct dimension<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
: boost::mpl::int_<DimensionCount>
{};
@@ -140,16 +146,16 @@
typename CoordinateSystem,
std::size_t Dimension
>
-struct access<point<CoordinateType, DimensionCount, CoordinateSystem>, Dimension>
+struct access<model::point<CoordinateType, DimensionCount, CoordinateSystem>, Dimension>
{
static inline CoordinateType get(
- point<CoordinateType, DimensionCount, CoordinateSystem> const& p)
+ model::point<CoordinateType, DimensionCount, CoordinateSystem> const& p)
{
return p.template get<Dimension>();
}
static inline void set(
- point<CoordinateType, DimensionCount, CoordinateSystem>& p,
+ model::point<CoordinateType, DimensionCount, CoordinateSystem>& p,
CoordinateType const& value)
{
p.template set<Dimension>(value);
Modified: sandbox/geometry/boost/geometry/geometries/point_xy.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/point_xy.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/point_xy.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -19,6 +19,9 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
/*!
\brief 2D point in Cartesian coordinate system
\ingroup geometries
@@ -52,44 +55,48 @@
{ this->template set<1>(v); }
};
+
+} // namespace model
+
+
// Adapt the point_xy to the concept
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
template <typename CoordinateType, typename CoordinateSystem>
-struct tag<point_xy<CoordinateType, CoordinateSystem> >
+struct tag<model::point_xy<CoordinateType, CoordinateSystem> >
{
typedef point_tag type;
};
template<typename CoordinateType, typename CoordinateSystem>
-struct coordinate_type<point_xy<CoordinateType, CoordinateSystem> >
+struct coordinate_type<model::point_xy<CoordinateType, CoordinateSystem> >
{
typedef CoordinateType type;
};
template<typename CoordinateType, typename CoordinateSystem>
-struct coordinate_system<point_xy<CoordinateType, CoordinateSystem> >
+struct coordinate_system<model::point_xy<CoordinateType, CoordinateSystem> >
{
typedef CoordinateSystem type;
};
template<typename CoordinateType, typename CoordinateSystem>
-struct dimension<point_xy<CoordinateType, CoordinateSystem> >
+struct dimension<model::point_xy<CoordinateType, CoordinateSystem> >
: boost::mpl::int_<2>
{};
template<typename CoordinateType, typename CoordinateSystem, std::size_t Dimension>
-struct access<point_xy<CoordinateType, CoordinateSystem>, Dimension >
+struct access<model::point_xy<CoordinateType, CoordinateSystem>, Dimension >
{
static inline CoordinateType get(
- point_xy<CoordinateType, CoordinateSystem> const& p)
+ model::point_xy<CoordinateType, CoordinateSystem> const& p)
{
return p.template get<Dimension>();
}
- static inline void set(point_xy<CoordinateType, CoordinateSystem>& p,
+ static inline void set(model::point_xy<CoordinateType, CoordinateSystem>& p,
CoordinateType const& value)
{
p.template set<Dimension>(value);
Modified: sandbox/geometry/boost/geometry/geometries/polygon.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/polygon.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/polygon.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -24,171 +24,6 @@
namespace boost { namespace geometry
{
-/*!
- \brief The \b polygon contains an outer ring and zero or more inner rings.
- \ingroup geometries
- \tparam P point type
- \tparam PointList optional container type for points,
- for example std::vector, std::list, std::deque
- \tparam RingList optional container type for inner rings,
- for example std::vector, std::list, std::deque
- \tparam ClockWise optional parameter, true for clockwise direction,
- false for CounterClockWise direction
- \tparam Closed optional parameter, true for closed polygons (last point == first point),
- false open points
- \tparam PointAlloc container-allocator-type
- \tparam RingAlloc container-allocator-type
- \note The container collecting the points in the rings can be different
- from the container collecting the inner rings. They all default to vector.
-*/
-template
-<
- typename Point,
- template<typename, typename> class PointList = std::vector,
- template<typename, typename> class RingList = std::vector,
- bool ClockWise = true,
- bool Closed = true,
- template<typename> class PointAlloc = std::allocator,
- template<typename> class RingAlloc = std::allocator
->
-class polygon
-{
- BOOST_CONCEPT_ASSERT( (concept::Point<Point>) );
-
-public:
-
- // Member types
- typedef Point point_type;
- typedef linear_ring<Point, PointList, ClockWise, Closed, PointAlloc> ring_type;
- typedef RingList<ring_type , RingAlloc<ring_type > > inner_container_type;
-
- inline ring_type const& outer() const { return m_outer; }
- inline inner_container_type const& inners() const { return m_inners; }
-
- inline ring_type& outer() { return m_outer; }
- inline inner_container_type & inners() { return m_inners; }
-
- /// Utility method, clears outer and inner rings
- inline void clear()
- {
- m_outer.clear();
- m_inners.clear();
- }
-
-private:
-
- ring_type m_outer;
- inner_container_type m_inners;
-};
-
-
-#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
-namespace traits
-{
-
-template
-<
- typename Point,
- template<typename, typename> class PointList,
- template<typename, typename> class RingList,
- bool ClockWise, bool Closed,
- template<typename> class PointAlloc,
- template<typename> class RingAlloc
->
-struct tag<polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> >
-{
- typedef polygon_tag type;
-};
-
-template
-<
- typename Point,
- template<typename, typename> class PointList,
- template<typename, typename> class RingList,
- bool ClockWise, bool Closed,
- template<typename> class PointAlloc,
- template<typename> class RingAlloc
->
-struct ring_type<polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> >
-{
- typedef typename polygon
- <
- Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc
- >::ring_type type;
-};
-
-template
-<
- typename Point,
- template<typename, typename> class PointList,
- template<typename, typename> class RingList,
- bool ClockWise, bool Closed,
- template<typename> class PointAlloc,
- template<typename> class RingAlloc
->
-struct interior_type< polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> >
-{
- typedef typename polygon
- <
- Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc
- >::inner_container_type type;
-};
-
-template
-<
- typename Point,
- template<typename, typename> class PointList,
- template<typename, typename> class RingList,
- bool ClockWise, bool Closed,
- template<typename> class PointAlloc,
- template<typename> class RingAlloc
->
-struct exterior_ring< polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> >
-{
- typedef polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> polygon_type;
-
- static inline typename polygon_type::ring_type& get(polygon_type& p)
- {
- return p.outer();
- }
-
- static inline typename polygon_type::ring_type const & get(polygon_type const& p)
- {
- return p.outer();
- }
-};
-
-template
-<
- typename Point,
- template<typename, typename> class PointList,
- template<typename, typename> class RingList,
- bool ClockWise, bool Closed,
- template<typename> class PointAlloc,
- template<typename> class RingAlloc
->
-struct interior_rings< polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> >
-{
- typedef polygon<Point, PointList, RingList, ClockWise, Closed, PointAlloc, RingAlloc> polygon_type;
-
- static inline typename polygon_type::inner_container_type& get(
- polygon_type& p)
- {
- return p.inners();
- }
-
- static inline typename polygon_type::inner_container_type const& get(
- polygon_type const& p)
- {
- return p.inners();
- }
-};
-
-} // namespace traits
-#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
-
-
-// NEW APPROACH
namespace model
{
@@ -196,14 +31,14 @@
\brief The \b polygon contains an outer ring and zero or more inner rings.
\ingroup geometries
\tparam P point type
-\tparam PointList optional container type for points,
- for example std::vector, std::list, std::deque
-\tparam RingList optional container type for inner rings,
- for example std::vector, std::list, std::deque
\tparam ClockWise optional parameter, true for clockwise direction,
false for CounterClockWise direction
\tparam Closed optional parameter, true for closed polygons (last point == first point),
false open points
+\tparam PointList optional container type for points,
+ for example std::vector, std::list, std::deque
+\tparam RingList optional container type for inner rings,
+ for example std::vector, std::list, std::deque
\tparam PointAlloc container-allocator-type
\tparam RingAlloc container-allocator-type
\note The container collecting the points in the rings can be different
@@ -266,7 +101,14 @@
template<typename> class PointAlloc,
template<typename> class RingAlloc
>
-struct tag<model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> >
+struct tag
+<
+ model::polygon
+ <
+ Point, ClockWise, Closed,
+ PointList, RingList, PointAlloc, RingAlloc
+ >
+>
{
typedef polygon_tag type;
};
@@ -280,11 +122,20 @@
template<typename> class PointAlloc,
template<typename> class RingAlloc
>
-struct ring_type<model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> >
+struct ring_type
+<
+ model::polygon
+ <
+ Point, ClockWise, Closed,
+ PointList, RingList, PointAlloc, RingAlloc
+ >
+>
{
typedef typename model::polygon
<
- Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc
+ Point, ClockWise, Closed,
+ PointList, RingList,
+ PointAlloc, RingAlloc
>::ring_type type;
};
@@ -297,11 +148,21 @@
template<typename> class PointAlloc,
template<typename> class RingAlloc
>
-struct interior_type<model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> >
+struct interior_type
+<
+ model::polygon
+ <
+ Point, ClockWise, Closed,
+ PointList, RingList,
+ PointAlloc, RingAlloc
+ >
+>
{
typedef typename model::polygon
<
- Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc
+ Point, ClockWise, Closed,
+ PointList, RingList,
+ PointAlloc, RingAlloc
>::inner_container_type type;
};
@@ -314,16 +175,29 @@
template<typename> class PointAlloc,
template<typename> class RingAlloc
>
-struct exterior_ring<model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> >
+struct exterior_ring
+<
+ model::polygon
+ <
+ Point, ClockWise, Closed,
+ PointList, RingList, PointAlloc, RingAlloc
+ >
+>
{
- typedef model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> polygon_type;
+ typedef model::polygon
+ <
+ Point, ClockWise, Closed,
+ PointList, RingList,
+ PointAlloc, RingAlloc
+ > polygon_type;
static inline typename polygon_type::ring_type& get(polygon_type& p)
{
return p.outer();
}
- static inline typename polygon_type::ring_type const & get(polygon_type const& p)
+ static inline typename polygon_type::ring_type const& get(
+ polygon_type const& p)
{
return p.outer();
}
@@ -338,9 +212,21 @@
template<typename> class PointAlloc,
template<typename> class RingAlloc
>
-struct interior_rings<model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> >
+struct interior_rings
+<
+ model::polygon
+ <
+ Point, ClockWise, Closed,
+ PointList, RingList,
+ PointAlloc, RingAlloc
+ >
+>
{
- typedef model::polygon<Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc> polygon_type;
+ typedef model::polygon
+ <
+ Point, ClockWise, Closed, PointList, RingList,
+ PointAlloc, RingAlloc
+ > polygon_type;
static inline typename polygon_type::inner_container_type& get(
polygon_type& p)
Modified: sandbox/geometry/boost/geometry/geometries/segment.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/segment.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/segment.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -20,6 +20,32 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
+/*!
+\brief Class segment: small class containing two points
+\ingroup geometries
+\details From Wikipedia: In geometry, a line segment is a part of a line that is bounded
+ by two distinct end points, and contains every point on the line between its end points.
+\note There is also a point-referring-segment, class referring_segment,
+ containing point references, where points are NOT copied
+*/
+template<typename Point>
+class segment : public std::pair<Point, Point>
+{
+public :
+ inline segment()
+ {}
+
+ inline segment(Point const& p1, Point const& p2)
+ {
+ this->first = p1;
+ this->second = p2;
+ }
+};
+
+
/*!
\brief Class segment: small class containing two (templatized) point references
\ingroup geometries
@@ -34,7 +60,7 @@
\tparam ConstOrNonConstPoint point type of the segment, maybe a point or a const point
*/
template<typename ConstOrNonConstPoint>
-class segment
+class referring_segment
{
BOOST_CONCEPT_ASSERT( (
typename boost::mpl::if_
@@ -52,48 +78,13 @@
point_type& first;
point_type& second;
- inline segment(point_type& p1, point_type& p2)
+ inline referring_segment(point_type& p1, point_type& p2)
: first(p1)
, second(p2)
{}
};
-// Namespace model
-// Anticipates for all geometries, which will be moved to namespace "model":
-
-/*
-Bruno:
-However maybe an even better name
-would be "model", since those geometries model the concepts GGL
-defines. It would state more clearly that those shapes are not mere
-shapes but are also examples of models for our concepts.
-
-Barend:
-I agree that model is a better name. Very good.
-So that is the new proposal :-)
-*/
-
-namespace model
-{
-
-/*!
-\brief segment: segment owning two points
-\note Might be merged with "segment", while "segment" be used as segment<P&>
-*/
-template<typename Point>
-struct segment : public std::pair<Point, Point>
-{
- inline segment()
- {}
-
- inline segment(Point const& p1, Point const& p2)
- {
- this->first = p1;
- this->second = p2;
- }
-};
-
} // namespace model
@@ -102,22 +93,22 @@
namespace traits
{
-template <typename ConstOrNonConstPoint>
-struct tag<segment<ConstOrNonConstPoint> >
+template <typename Point>
+struct tag<model::segment<Point> >
{
typedef segment_tag type;
};
-template <typename ConstOrNonConstPoint>
-struct point_type<segment<ConstOrNonConstPoint> >
+template <typename Point>
+struct point_type<model::segment<Point> >
{
- typedef ConstOrNonConstPoint type;
+ typedef Point type;
};
-template <typename ConstOrNonConstPoint, std::size_t Dimension>
-struct indexed_access<segment<ConstOrNonConstPoint>, 0, Dimension>
+template <typename Point, std::size_t Dimension>
+struct indexed_access<model::segment<Point>, 0, Dimension>
{
- typedef segment<ConstOrNonConstPoint> segment_type;
+ typedef model::segment<Point> segment_type;
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
static inline coordinate_type get(segment_type const& s)
@@ -132,10 +123,10 @@
};
-template <typename ConstOrNonConstPoint, std::size_t Dimension>
-struct indexed_access<segment<ConstOrNonConstPoint>, 1, Dimension>
+template <typename Point, std::size_t Dimension>
+struct indexed_access<model::segment<Point>, 1, Dimension>
{
- typedef segment<ConstOrNonConstPoint> segment_type;
+ typedef model::segment<Point> segment_type;
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
static inline coordinate_type get(segment_type const& s)
@@ -150,22 +141,22 @@
};
-template <typename Point>
-struct tag<model::segment<Point> >
+template <typename ConstOrNonConstPoint>
+struct tag<model::referring_segment<ConstOrNonConstPoint> >
{
typedef segment_tag type;
};
-template <typename Point>
-struct point_type<model::segment<Point> >
+template <typename ConstOrNonConstPoint>
+struct point_type<model::referring_segment<ConstOrNonConstPoint> >
{
- typedef Point type;
+ typedef ConstOrNonConstPoint type;
};
-template <typename Point, std::size_t Dimension>
-struct indexed_access<model::segment<Point>, 0, Dimension>
+template <typename ConstOrNonConstPoint, std::size_t Dimension>
+struct indexed_access<model::referring_segment<ConstOrNonConstPoint>, 0, Dimension>
{
- typedef model::segment<Point> segment_type;
+ typedef model::referring_segment<ConstOrNonConstPoint> segment_type;
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
static inline coordinate_type get(segment_type const& s)
@@ -180,10 +171,10 @@
};
-template <typename Point, std::size_t Dimension>
-struct indexed_access<model::segment<Point>, 1, Dimension>
+template <typename ConstOrNonConstPoint, std::size_t Dimension>
+struct indexed_access<model::referring_segment<ConstOrNonConstPoint>, 1, Dimension>
{
- typedef model::segment<Point> segment_type;
+ typedef model::referring_segment<ConstOrNonConstPoint> segment_type;
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
static inline coordinate_type get(segment_type const& s)
Modified: sandbox/geometry/boost/geometry/iterators/segment_returning_iterator.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/iterators/segment_returning_iterator.hpp (original)
+++ sandbox/geometry/boost/geometry/iterators/segment_returning_iterator.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -34,7 +34,7 @@
{
typedef Base base_type;
typedef Point point_type;
- typedef typename geometry::segment<Point> segment_type;
+ typedef typename model::referring_segment<Point> segment_type;
typedef std::input_iterator_tag iterator_category;
typedef typename std::iterator_traits<Base>::difference_type difference_type;
Modified: sandbox/geometry/boost/geometry/multi/geometries/multi_linestring.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/geometries/multi_linestring.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/geometries/multi_linestring.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -21,6 +21,10 @@
namespace boost { namespace geometry
{
+
+namespace model
+{
+
/*!
\brief multi_line, a collection of linestring
\details Multi-linestring can be used to group lines belonging to each other,
@@ -39,6 +43,9 @@
};
+} // namespace model
+
+
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
@@ -49,7 +56,7 @@
template<typename, typename> class V,
template<typename> class A
>
-struct tag< multi_linestring<L, V, A> >
+struct tag< model::multi_linestring<L, V, A> >
{
typedef multi_linestring_tag type;
};
Modified: sandbox/geometry/boost/geometry/multi/geometries/multi_point.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/geometries/multi_point.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/geometries/multi_point.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -21,6 +21,10 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
+
/*!
\brief multi_point, a collection of points
\details Multipoint can be used to group points belonging to each other,
@@ -38,6 +42,9 @@
BOOST_CONCEPT_ASSERT( (concept::Point<P>) );
};
+} // namespace model
+
+
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
@@ -48,7 +55,7 @@
template<typename, typename> class V,
template<typename> class A
>
-struct tag< multi_point<P, V, A> >
+struct tag< model::multi_point<P, V, A> >
{
typedef multi_point_tag type;
};
Modified: sandbox/geometry/boost/geometry/multi/geometries/multi_polygon.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/geometries/multi_polygon.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/geometries/multi_polygon.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -21,6 +21,9 @@
namespace boost { namespace geometry
{
+namespace model
+{
+
/*!
\brief multi_polygon, a collection of polygons
\details Multi-polygon can be used to group polygons belonging to each other,
@@ -38,6 +41,10 @@
BOOST_CONCEPT_ASSERT( (concept::Polygon<P>) );
};
+
+} // namespace model
+
+
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
@@ -48,7 +55,7 @@
template<typename, typename> class V,
template<typename> class A
>
-struct tag< multi_polygon<P, V, A> >
+struct tag< model::multi_polygon<P, V, A> >
{
typedef multi_polygon_tag type;
};
Modified: sandbox/geometry/boost/geometry/strategies/cartesian/distance_projected_point.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/strategies/cartesian/distance_projected_point.hpp (original)
+++ sandbox/geometry/boost/geometry/strategies/cartesian/distance_projected_point.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -79,7 +79,7 @@
// A projected point of points in Integer coordinates must be able to be
// represented in FP.
- typedef boost::geometry::point
+ typedef model::point
<
fp_type,
dimension<PointOfSegment>::value,
Modified: sandbox/geometry/boost/geometry/strategies/intersection.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/strategies/intersection.hpp (original)
+++ sandbox/geometry/boost/geometry/strategies/intersection.hpp 2010-11-28 08:23:44 EST (Sun, 28 Nov 2010)
@@ -42,8 +42,8 @@
private :
typedef typename geometry::point_type<Geometry1>::type point1_type;
typedef typename geometry::point_type<Geometry2>::type point2_type;
- typedef typename geometry::segment<point1_type const> segment1_type;
- typedef typename geometry::segment<point2_type const> segment2_type;
+ typedef typename model::referring_segment<point1_type const> segment1_type;
+ typedef typename model::referring_segment<point2_type const> segment2_type;
typedef segment_intersection_points
<
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