[buffer] For clusters (occuption), avoid using turns as starting point

This enables the "get_occupation" again, but skips the get_left_turns function
This commit is contained in:
Barend Gehrels
2014-06-18 14:18:43 +02:00
parent fccd2c2b7f
commit 4415da952b
4 changed files with 10 additions and 16 deletions

View File

@@ -314,23 +314,15 @@ struct buffered_piece_collection
}
}
// 4: From these vectors, get the left turns
// and mark all other turns as to-skip
// 4: Mark all turns as not selectable as a starting point for traversing
// rings. They still can be used to continue already started rings.
for (typename occupation_map_type::iterator it = occupation_map.begin();
it != occupation_map.end(); ++it)
{
buffer_occupation_info& info = it->second;
std::vector<detail::left_turns::left_turn> turns_to_keep;
info.get_left_turns(it->first, turns_to_keep);
if (turns_to_keep.empty())
typename buffer_occupation_info::turn_vector_type const& turns = it->second.turns;
for (int i = 0; i < turns.size(); i++)
{
typename buffer_occupation_info::turn_vector_type const& turns = it->second.turns;
for (int i = 0; i < turns.size(); i++)
{
m_turns[turns[i].turn_index].count_on_occupied++;
}
m_turns[turns[i].turn_index].selectable_start = false;
}
}
}
@@ -551,7 +543,7 @@ struct buffered_piece_collection
}
//get_occupation(); // Temporarily disabled, all tests passing...
get_occupation();
classify_turns();

View File

@@ -137,7 +137,7 @@ inline bool check_graph(TurnPoints& turn_points, operation_type for_operation)
it != boost::end(meta_turns);
++it)
{
if (! (it->turn->blocked() || it->turn->is_discarded()))
if (! (it->turn->blocked() || it->turn->discarded))
{
for (int i = 0 ; i < 2; i++)
{

View File

@@ -268,7 +268,7 @@ public :
++it)
{
// Skip discarded ones
if (! (it->is_discarded() || it->blocked()))
if (! (it->discarded || ! it->selectable_start || it->blocked()))
{
for (turn_operation_iterator_type iit = boost::begin(it->operations);
state.good() && iit != boost::end(it->operations);

View File

@@ -93,6 +93,7 @@ struct turn_info
Point point;
method_type method;
bool discarded;
bool selectable_start; // Can be used as starting-turn in traverse
Container operations;
@@ -100,6 +101,7 @@ struct turn_info
inline turn_info()
: method(method_none)
, discarded(false)
, selectable_start(true)
{}
inline bool both(operation_type type) const