cleanup typedefs, changed template params: vertex_type -> coord_type

This commit is contained in:
Artem Pavlenko 2011-12-06 11:17:14 +00:00
parent 2b05d69fef
commit 91617e7b21

View file

@ -25,7 +25,6 @@
// mapnik
#include <mapnik/vertex_vector.hpp>
#include <mapnik/ctrans.hpp>
#include <mapnik/geom_util.hpp>
// boost
@ -49,9 +48,10 @@ template <typename T, template <typename> class Container=vertex_vector>
class geometry
{
public:
typedef T vertex_type;
typedef typename vertex_type::type value_type;
typedef Container<vertex_type> container_type;
typedef T coord_type;
typedef Container<coord_type> container_type;
typedef typename container_type::value_type value_type;
private:
container_type cont_;
eGeomType type_;
@ -68,6 +68,11 @@ public:
return type_;
}
container_type const& data() const
{
return cont_;
}
box2d<double> envelope() const
{
box2d<double> result;
@ -308,17 +313,17 @@ public:
}
}
void push_vertex(value_type x, value_type y, CommandType c)
void push_vertex(coord_type x, coord_type y, CommandType c)
{
cont_.push_back(x,y,c);
}
void line_to(value_type x,value_type y)
void line_to(coord_type x,coord_type y)
{
push_vertex(x,y,SEG_LINETO);
}
void move_to(value_type x,value_type y)
void move_to(coord_type x,coord_type y)
{
push_vertex(x,y,SEG_MOVETO);
}
@ -343,7 +348,7 @@ public:
itr_=0;
}
bool hit_test(value_type x, value_type y, double tol) const
bool hit_test(coord_type x, coord_type y, double tol) const
{
if (cont_.size() == 1) {
// Handle points
@ -385,7 +390,7 @@ public:
}
};
typedef geometry<vertex2d,vertex_vector> geometry_type;
typedef geometry<double,vertex_vector> geometry_type;
typedef boost::shared_ptr<geometry_type> geometry_ptr;
typedef boost::ptr_vector<geometry_type> geometry_containter;