[algorithms][is_valid] fix some wrong usages of std::size_t (should

have been int)
This commit is contained in:
Menelaos Karavelas
2014-06-25 09:34:53 +03:00
parent bcaf4a374a
commit 15773cbf93
2 changed files with 4 additions and 9 deletions

View File

@@ -198,7 +198,7 @@ public:
// inserts a ring vertex in the graph and returns its handle
// ring id's are zero-based (so the first interior ring has id 1)
vertex_handle add_vertex(std::size_t id)
vertex_handle add_vertex(int id)
{
return m_vertices.insert(vertex(id)).first;
}
@@ -212,7 +212,7 @@ public:
if ( res.second )
{
// a new element is inserted
res.first->id( m_num_rings + m_num_turns );
res.first->id( static_cast<int>(m_num_rings + m_num_turns) );
++m_num_turns;
}
return res.first;

View File

@@ -155,11 +155,6 @@ protected:
static inline std::size_t get_vertex_id(int ring_id)
{
return static_cast<std::size_t>(ring_id + 1);
}
template <typename TurnIterator>
static inline bool has_connected_interior(Polygon const& polygon,
TurnIterator first,
@@ -175,9 +170,9 @@ protected:
for (TurnIterator tit = first; tit != beyond; ++tit)
{
typename graph::vertex_handle v1 = g.add_vertex
( get_vertex_id(tit->operations[0].seg_id.ring_index) );
( tit->operations[0].seg_id.ring_index + 1 );
typename graph::vertex_handle v2 = g.add_vertex
( get_vertex_id(tit->operations[0].other_id.ring_index) );
( tit->operations[0].other_id.ring_index + 1 );
typename graph::vertex_handle vip = g.add_vertex(tit->point);
g.add_edge(v1, vip);