Commit 2fa22114 authored by Federico Ciuffardi's avatar Federico Ciuffardi Committed by Romina Julieta Parada Venossa
Browse files

sync

parent 9e3ac14a
#include "IDisMapGen.h"
#include "DisMapIC.h"
IDisMapGen::IDisMapGen(Map* m, vector<cell_type> obstructed_types, cell_type source_type){
DisMapIC::DisMapIC(Map* m, vector<cell_type> obstructed_types, cell_type source_type){
this->m = m;
this->obstructed_types = obstructed_types;
this->source_type = source_type;
};
// CellData
IDisMapGen::CellData::CellData() {
DisMapIC::CellData::CellData() {
dist = MAXFLOAT;
is_cleared = true;
to_raise = false;
}
void IDisMapGen::CellData::clear_cell() {
void DisMapIC::CellData::clear_cell() {
dist = MAXFLOAT;
is_cleared = true;
sources.clear();
......@@ -39,7 +39,7 @@ boost::tuple<float, vector<pos>> closest_sources(pos p, pos_set sources) {
// recheck sources of n removing the invalid ones O(1) as you can only
// have up to 8 equidistant sources in a 2D grid
bool IDisMapGen::valid(pos_set& sources) {
bool DisMapIC::valid(pos_set& sources) {
for (auto it = sources.begin(); it != sources.end();) {
pos source = (*it);
if ((*m)[source] != source_type) {
......@@ -51,7 +51,7 @@ bool IDisMapGen::valid(pos_set& sources) {
return sources.size() > 0;
}
void IDisMapGen::process_lower(pos s) {
void DisMapIC::process_lower(pos s) {
CellData& s_cd = cell_data[s];
pos_set adj_s = m->adj(s,obstructed_types);
......@@ -88,7 +88,7 @@ void IDisMapGen::process_lower(pos s) {
}
}
void IDisMapGen::process_raise(pos s) {
void DisMapIC::process_raise(pos s) {
CellData& s_cd = cell_data[s];
float min_d = MAXFLOAT;
pos_set s_closest_sources;
......@@ -142,7 +142,7 @@ void IDisMapGen::process_raise(pos s) {
s_cd.to_raise = false;
}
void IDisMapGen::set_consistent_borders(vector<pos> unk_to_free) {
void DisMapIC::set_consistent_borders(vector<pos> unk_to_free) {
pos_set inserted;
for (int i = 0; i < unk_to_free.size(); i++) {
pos s = unk_to_free[i];
......@@ -162,7 +162,7 @@ void IDisMapGen::set_consistent_borders(vector<pos> unk_to_free) {
print_property(inserted, m->g);
}
void IDisMapGen::update_distance_map(vector<pos> source_to_true,
void DisMapIC::update_distance_map(vector<pos> source_to_true,
vector<pos> source_to_false,
vector<pos> obstructed_to_free,
vector<pos> free_to_obstructed){
......
......@@ -5,7 +5,7 @@
#include "pos.h"
#include "utils.h"
class IDisMapGen{
class DisMapIC{
private:
#define NULL_POS pos(MAXFLOAT, MAXFLOAT)
......@@ -55,5 +55,5 @@ class IDisMapGen{
pos_set voro_to_false;
pos_set voro_to_true;
IDisMapGen(Map* m, vector<cell_type> obstructed_types, cell_type source_type);
DisMapIC(Map* m, vector<cell_type> obstructed_types, cell_type source_type);
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment