Exemplo n.º 1
0
int mapQuadTreeAbstraction::getQuadrant(node *which)
{ // int sectorSize;
	// 1. get any child
	node *child = which;
	while (child->getLabelL(kAbstractionLevel) != 0)
		child = getNthChild(child, 0);
	
	int xloc = child->getLabelL(kFirstData); // x loc in map
	int yloc = child->getLabelL(kFirstData+1); // y loc in map

	int level = which->getLabelL(kAbstractionLevel);
	int absSectorSize = (int)pow((double)sectorSize, (double)level+1);
	
	int sectorNum = (getMap()->getMapWidth()/absSectorSize)*(yloc/absSectorSize)+(xloc/absSectorSize);
	
	return sectorNum;
}
Exemplo n.º 2
0
 Element Element::operator[](size_t n) const {
     return getNthChild(*this, n);
 }