HOG2
MapLineAbstraction.h
Go to the documentation of this file.
1 /*
2  * $Id: MapLineAbstraction.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 11/10/06.
6  * Modified by Nathan Sturtevant on 02/29/20.
7  *
8  * This file is part of HOG2. See https://github.com/nathansttt/hog2 for licensing information.
9  *
10  */
11 
12 #include "MapAbstraction.h"
13 
14 #ifndef MAPLINEABSTRACTION_H
15 #define MAPLINEABSTRACTION_H
16 
17 class MapLineAbstraction : public MapAbstraction {
18 public:
19  MapLineAbstraction(Map *, int dist = 2, bool uniform = true);
21  MapAbstraction *Clone(Map *_m) { return new MapLineAbstraction(_m); }
22 
23  virtual bool Pathable(node *from, node *to);
24 
25  // utility functions
27  virtual void VerifyHierarchy();
28 
29  // hierarchical modifications
31  virtual void RemoveNode(node *n);
33  virtual void RemoveEdge(edge *e, unsigned int absLevel);
35  virtual void AddNode(node *n);
37  virtual void AddEdge(edge *e, unsigned int absLevel);
40  virtual void RepairAbstraction();
41 private:
42  void buildAbstraction();
43  void buildNodeIntoParent(node *n, node *parent);
44  node *createParent(Graph *g, node *n);
45 
46  void addEdges(Graph *g);
47  void addNodes(Graph *g);
50 };
51 
52 #endif
MapLineAbstraction::createParent
node * createParent(Graph *g, node *n)
Definition: MapLineAbstraction.cpp:260
MapLineAbstraction::abstractUniformly
bool abstractUniformly
Definition: MapLineAbstraction.h:49
MapLineAbstraction
Definition: MapLineAbstraction.h:17
MapLineAbstraction::AddNode
virtual void AddNode(node *n)
add node to abstraction
Definition: MapLineAbstraction.cpp:59
MapLineAbstraction::lineDistance
int lineDistance
Definition: MapLineAbstraction.h:48
MapLineAbstraction::buildNodeIntoParent
void buildNodeIntoParent(node *n, node *parent)
Definition: MapLineAbstraction.cpp:251
MapLineAbstraction::RepairAbstraction
virtual void RepairAbstraction()
This must be called after any of the above add/remove operations.
Definition: MapLineAbstraction.cpp:69
MapLineAbstraction::addEdges
void addEdges(Graph *g)
Definition: MapLineAbstraction.cpp:224
Graph
A generic Graph class.
Definition: Graph.h:66
MapLineAbstraction::AddEdge
virtual void AddEdge(edge *e, unsigned int absLevel)
add edge to abstraction
Definition: MapLineAbstraction.cpp:64
MapLineAbstraction::RemoveNode
virtual void RemoveNode(node *n)
remove node from abstraction
Definition: MapLineAbstraction.cpp:49
MapLineAbstraction::Pathable
virtual bool Pathable(node *from, node *to)
MapLineAbstraction::VerifyHierarchy
virtual void VerifyHierarchy()
verify that the hierarchy is consistent
Definition: MapLineAbstraction.cpp:44
MapLineAbstraction::RemoveEdge
virtual void RemoveEdge(edge *e, unsigned int absLevel)
remove edge from abstraction
Definition: MapLineAbstraction.cpp:54
MapLineAbstraction::buildAbstraction
void buildAbstraction()
Definition: MapLineAbstraction.cpp:74
MapLineAbstraction::~MapLineAbstraction
~MapLineAbstraction()
Definition: MapLineAbstraction.cpp:20
MapAbstraction.h
MapLineAbstraction::addNodes
void addNodes(Graph *g)
Definition: MapLineAbstraction.cpp:95
MapLineAbstraction::MapLineAbstraction
MapLineAbstraction(Map *, int dist=2, bool uniform=true)
Definition: MapLineAbstraction.cpp:14
MapLineAbstraction::Clone
MapAbstraction * Clone(Map *_m)
Definition: MapLineAbstraction.h:21
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
Map
A tile-based representation of the world.
Definition: Map.h:142
edge
Edge class for connections between node in a Graph.
Definition: Graph.h:129