Chapter 1: Quadtrees and Octrees

In this chapter, we introduce the quadtree and octree structures. Their definition and complexity, the recursive construction scheme, and a standard application are presented. Quadtrees and octrees have applications in mesh generation, as shown in Sections 1.3, 1.4, and 1.5.

1.1. Definition

A quadtree is a tree rooted so that every internal node has four children. Every node in the tree corresponds to a square. If a node v has children, their corresponding squares are the four quadrants, as shown in Figure 1.1.

image from book
Figure 1.1: An example of a quadtree.

Quadtrees can store many kinds of data. We will describe the variant that stores a set of points and suggest a recursive definition. A simple recursive splitting of squares is continued until there is only one point in a square. Let P be a set of points.

The definition of a quadtree for a set of points in a square Q = [ x 1 Q : x 2 Q ] — [ y 1 Q : y 2 Q ] is as follows :

  • If P 1, then the quadtree is a single leaf where Q and P are stored.

  • Otherwise, let Q NE , Q NW , Q SW , and Q SE denote the four quadrants. Let x mid := ( x 1 Q + x 2 Q ) / 2 and y mid := ( y 1 Q + y 2 Q ) / 2, and define

    image from book

    The quadtree consists of a root node v , and Q is stored at v . In the following, let Q ( v ) denote the square stored at v . Furthermore, v has four children: the X -child is the root of the quadtree of the set P X , where X is an element of the set { NE, NW, SW, SE }.



Geometric Data Structures for Computer Graphics2006
Geometric Data Structures for Computer Graphics2006
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 69

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net