/* Brian O'Connor * * cell.h: functions & data structures for creating cell decomposition */ #ifndef CELL_H #define CELL_H #include "input.h" #include "line.h" //#define CELL_INTS 150 #define CELL_INTS 250 class Obstacle; class PInfo; class VPoly; class PGAdjInfo; /* all obstacles in the world */ class WorldInfo { public: int nObs; Obstacle *robot; Obstacle **obs; Obstacle *border; }; /* all obstacle edges */ class EdgeInfo { public: ~EdgeInfo(); int nEdges; int firstEdge; /* edge where we start iterations */ Line **edges; }; class CellEdge: public Line { public: CellEdge(Point *p1, Point *p2) : Line(p1, p2) { adjInfo = NULL; }; CellEdge *dual; Cell *cell; Cell *dualCell; PGAdjInfo *adjInfo; // for graph search }; class Cell { /* incomplete */ public: int nEdges; int nGapEdges; CellEdge **edges; Point *pt; /* pt for roadmap */ VPoly *vPoly; /* visibility polygon from roadmap pt */ }; class CellInfo { public: int nEdges; CellEdge **edges; int nCells; Cell **cells; }; void BuildDecomposition(char *file, PInfo *pInfo); void RebuildDecomposition(PInfo *pInfo1, PInfo *pInfo2); int OpenEdgeTest(Obstacle *ob, Point *p1, Point *p2); int InsideTest(Line *l, Point *p1, Point *p2); int IsPointAdjacent(Obstacle *ob, Point *p1, Point *p2); void RemoveCell(CellInfo *cells, int i); #endif /* CELL_H */