pcb 4.1.1
An interactive printed circuit board layout editor.

kdtree.c File Reference

#include <stdlib.h>
#include "gts.h"
Include dependency graph for kdtree.c:

Go to the source code of this file.

Functions

static int compare_x (const void *p1, const void *p2)
static int compare_y (const void *p1, const void *p2)
static int compare_z (const void *p1, const void *p2)
GNode * gts_kdtree_new (GPtrArray *points, int(*compare)(const void *, const void *))
GSList * gts_kdtree_range (GNode *tree_3d, GtsBBox *bbox, int(*compare)(const void *, const void *))

Function Documentation

static int compare_x ( const void *  p1,
const void *  p2 
) [static]

Definition at line 24 of file kdtree.c.

References _GtsPoint::x.

Referenced by gts_kdtree_new(), and gts_kdtree_range().

static int compare_y ( const void *  p1,
const void *  p2 
) [static]

Definition at line 33 of file kdtree.c.

References _GtsPoint::y.

Referenced by gts_kdtree_new(), and gts_kdtree_range().

static int compare_z ( const void *  p1,
const void *  p2 
) [static]

Definition at line 42 of file kdtree.c.

References _GtsPoint::z.

Referenced by gts_kdtree_new(), and gts_kdtree_range().

GNode* gts_kdtree_new ( GPtrArray *  points,
int(*)(const void *, const void *)  compare 
)

gts_kdtree_new: : an array of GtsPoint. : always NULL.

Note that the order of the points in array is modified by this function.

Returns: a new 3D tree for .

Definition at line 61 of file kdtree.c.

References compare_x(), compare_y(), compare_z(), gts_kdtree_new(), and node.

Referenced by gts_kdtree_new(), and gts_vertices_merge().

Here is the call graph for this function:

GSList* gts_kdtree_range ( GNode *  tree_3d,
GtsBBox bbox,
int(*)(const void *, const void *)  compare 
)

gts_kdtree_range: : a 3D tree. : a GtsBBox. : always NULL.

Returns: a list of GtsPoint belonging to which are inside .

Definition at line 111 of file kdtree.c.

References compare_x(), compare_y(), compare_z(), gts_bbox_point_is_inside, gts_kdtree_range(), node, _GtsPoint::x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_kdtree_range(), and gts_vertices_merge().

Here is the call graph for this function: