pcb 4.1.1
An interactive printed circuit board layout editor.

bbtree.c File Reference

#include <math.h>
#include "gts.h"
Include dependency graph for bbtree.c:

Go to the source code of this file.

Defines

#define bbox_volume(bb)
#define MINMAX(x1, x2, xmin, xmax)

Functions

static void bbox_init (GtsBBox *bbox)
GtsBBoxClassgts_bbox_class (void)
void gts_bbox_set (GtsBBox *bbox, gpointer bounded, gdouble x1, gdouble y1, gdouble z1, gdouble x2, gdouble y2, gdouble z2)
GtsBBoxgts_bbox_new (GtsBBoxClass *klass, gpointer bounded, gdouble x1, gdouble y1, gdouble z1, gdouble x2, gdouble y2, gdouble z2)
GtsBBoxgts_bbox_triangle (GtsBBoxClass *klass, GtsTriangle *t)
GtsBBoxgts_bbox_segment (GtsBBoxClass *klass, GtsSegment *s)
static void bbox_foreach_vertex (GtsPoint *p, GtsBBox *bb)
GtsBBoxgts_bbox_surface (GtsBBoxClass *klass, GtsSurface *surface)
GtsBBoxgts_bbox_bboxes (GtsBBoxClass *klass, GSList *bboxes)
GtsBBoxgts_bbox_points (GtsBBoxClass *klass, GSList *points)
gboolean gts_bboxes_are_overlapping (GtsBBox *bb1, GtsBBox *bb2)
gdouble gts_bbox_diagonal2 (GtsBBox *bb)
void gts_bbox_draw (GtsBBox *bb, FILE *fptr)
void gts_bbox_point_distance2 (GtsBBox *bb, GtsPoint *p, gdouble *min, gdouble *max)
gboolean gts_bbox_is_stabbed (GtsBBox *bb, GtsPoint *p)
int triBoxOverlap (double boxcenter[3], double boxhalfsize[3], double triverts[3][3])
gboolean gts_bbox_overlaps_triangle (GtsBBox *bb, GtsTriangle *t)
gboolean gts_bbox_overlaps_segment (GtsBBox *bb, GtsSegment *s)
GNode * gts_bb_tree_new (GSList *bboxes)
static void prepend_triangle_bbox (GtsTriangle *t, GSList **bboxes)
GNode * gts_bb_tree_surface (GtsSurface *s)
GSList * gts_bb_tree_stabbed (GNode *tree, GtsPoint *p)
GSList * gts_bb_tree_overlap (GNode *tree, GtsBBox *bbox)
gboolean gts_bb_tree_is_overlapping (GNode *tree, GtsBBox *bbox)
void gts_bb_tree_traverse_overlapping (GNode *tree1, GNode *tree2, GtsBBTreeTraverseFunc func, gpointer data)
void gts_bb_tree_draw (GNode *tree, guint depth, FILE *fptr)
static void bb_tree_free (GNode *tree, gboolean free_leaves)
void gts_bb_tree_destroy (GNode *tree, gboolean free_leaves)
static gdouble bb_tree_min_max (GNode *tree, GtsPoint *p, gdouble min_max, GSList **list)
GSList * gts_bb_tree_point_closest_bboxes (GNode *tree, GtsPoint *p)
gdouble gts_bb_tree_point_distance (GNode *tree, GtsPoint *p, GtsBBoxDistFunc distance, GtsBBox **bbox)
GtsPointgts_bb_tree_point_closest (GNode *tree, GtsPoint *p, GtsBBoxClosestFunc closest, gdouble *distance)
void gts_bb_tree_triangle_distance (GNode *tree, GtsTriangle *t, GtsBBoxDistFunc distance, gdouble delta, GtsRange *range)
void gts_bb_tree_segment_distance (GNode *tree, GtsSegment *s, gdouble(*distance)(GtsPoint *, gpointer), gdouble delta, GtsRange *range)
static void surface_distance_foreach_triangle (GtsTriangle *t, gpointer *data)
void gts_bb_tree_surface_distance (GNode *tree, GtsSurface *s, GtsBBoxDistFunc distance, gdouble delta, GtsRange *range)
static void surface_distance_foreach_boundary (GtsEdge *e, gpointer *data)
void gts_bb_tree_surface_boundary_distance (GNode *tree, GtsSurface *s, gdouble(*distance)(GtsPoint *, gpointer), gdouble delta, GtsRange *range)

Define Documentation

#define bbox_volume (   bb)
Value:
(((bb)->x2 -\
                          (bb)->x1)*\
                         ((bb)->y2 -\
                          (bb)->y1)*\
                         ((bb)->z2 -\
                          (bb)->z1))

Definition at line 318 of file bbtree.c.

Referenced by gts_bb_tree_traverse_overlapping().

#define MINMAX (   x1,
  x2,
  xmin,
  xmax 
)
Value:
{ if (x1 < x2) { xmin = x1; xmax = x2; }\
                                     else { xmin = x2; xmax = x1; } }

Definition at line 381 of file bbtree.c.

Referenced by gts_bbox_point_distance2().


Function Documentation

static void bb_tree_free ( GNode *  tree,
gboolean  free_leaves 
) [static]

Definition at line 797 of file bbtree.c.

References gts_object_destroy().

Referenced by gts_bb_tree_destroy().

Here is the call graph for this function:

static gdouble bb_tree_min_max ( GNode *  tree,
GtsPoint p,
gdouble  min_max,
GSList **  list 
) [static]

Definition at line 832 of file bbtree.c.

References gts_bbox_point_distance2().

Referenced by gts_bb_tree_point_closest_bboxes().

Here is the call graph for this function:

static void bbox_foreach_vertex ( GtsPoint p,
GtsBBox bb 
) [static]
static void bbox_init ( GtsBBox bbox) [static]

Definition at line 23 of file bbtree.c.

References _GtsBBox::bounded.

Referenced by gts_bbox_class().

void gts_bb_tree_destroy ( GNode *  tree,
gboolean  free_leaves 
)

gts_bb_tree_destroy: : a bounding box tree. : if TRUE the bounding boxes given by the user are freed.

Destroys all the bounding boxes created by and destroys the tree itself. If is set to TRUE, destroys boxes given by the user when creating the tree (i.e. leaves of the tree).

Definition at line 824 of file bbtree.c.

References bb_tree_free().

Referenced by gts_surface_distance(), and gts_surface_foreach_intersecting_face().

Here is the call graph for this function:

void gts_bb_tree_draw ( GNode *  tree,
guint  depth,
FILE *  fptr 
)

gts_bb_tree_draw: : a bounding box tree. : a specified depth. : a file pointer.

Write in an OOGL (Geomview) description of for the depth specified by .

Definition at line 771 of file bbtree.c.

References gts_bb_tree_draw(), and gts_bbox_draw().

Referenced by gts_bb_tree_draw().

Here is the call graph for this function:

gboolean gts_bb_tree_is_overlapping ( GNode *  tree,
GtsBBox bbox 
)

gts_bb_tree_is_overlapping: : a bounding box tree. : a GtsBBox.

Returns: TRUE if any leaf of overlaps , FALSE otherwise.

Definition at line 699 of file bbtree.c.

References FALSE, gts_bb_tree_is_overlapping(), gts_bboxes_are_overlapping(), and TRUE.

Referenced by gts_bb_tree_is_overlapping().

Here is the call graph for this function:

GNode* gts_bb_tree_new ( GSList *  bboxes)

gts_bb_tree_new: : a list of GtsBBox.

Builds a new hierarchy of bounding boxes for . At each level, the GNode->data field contains a GtsBBox bounding box of all the children. The tree is binary and is built by repeatedly cutting in two approximately equal halves the bounding boxes at each level until a leaf node (i.e. a bounding box given in ) is reached. In order to minimize the depth of the tree, the cutting direction is always chosen as perpendicular to the longest dimension of the bounding box.

Returns: a new hierarchy of bounding boxes.

Definition at line 543 of file bbtree.c.

References gts_bb_tree_new(), gts_bbox_bboxes(), gts_bbox_class(), node, _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bb_tree_new(), gts_bb_tree_surface(), gts_surface_distance(), and import_geometry().

Here is the call graph for this function:

GSList* gts_bb_tree_overlap ( GNode *  tree,
GtsBBox bbox 
)

gts_bb_tree_overlap: : a bounding box tree. : a GtsBBox.

Returns: a list of bounding boxes, leaves of which overlap .

Definition at line 670 of file bbtree.c.

References gts_bb_tree_overlap(), and gts_bboxes_are_overlapping().

Referenced by gts_bb_tree_overlap().

Here is the call graph for this function:

GtsPoint* gts_bb_tree_point_closest ( GNode *  tree,
GtsPoint p,
GtsBBoxClosestFunc  closest,
gdouble *  distance 
)

gts_bb_tree_point_closest: : a bounding box tree. : a GtsPoint. : a GtsBBoxClosestFunc. : if not NULL is set to the distance between and the new GtsPoint.

Returns: a new GtsPoint, closest point to and belonging to an object of .

Definition at line 964 of file bbtree.c.

References gts_bb_tree_point_closest_bboxes(), GTS_BBOX, GTS_OBJECT, gts_object_destroy(), and gts_point_distance2().

Here is the call graph for this function:

GSList* gts_bb_tree_point_closest_bboxes ( GNode *  tree,
GtsPoint p 
)

gts_bb_tree_point_closest_bboxes: : a bounding box tree. : a GtsPoint.

Returns: a list of GtsBBox. One of the bounding boxes is assured to contain the object of closest to .

Definition at line 880 of file bbtree.c.

References bb_tree_min_max(), gts_bbox_point_distance2(), max, and min.

Referenced by gts_bb_tree_point_closest(), and gts_bb_tree_point_distance().

Here is the call graph for this function:

gdouble gts_bb_tree_point_distance ( GNode *  tree,
GtsPoint p,
GtsBBoxDistFunc  distance,
GtsBBox **  bbox 
)

gts_bb_tree_point_distance: : a bounding box tree. : a GtsPoint. : a GtsBBoxDistFunc. : if not NULL is set to the bounding box containing the closest object.

Returns: the distance as evaluated by between and the closest object in .

Definition at line 925 of file bbtree.c.

References gts_bb_tree_point_closest_bboxes(), and GTS_BBOX.

Referenced by gts_bb_tree_segment_distance(), and gts_bb_tree_triangle_distance().

Here is the call graph for this function:

void gts_bb_tree_segment_distance ( GNode *  tree,
GtsSegment s,
gdouble(*)(GtsPoint *, gpointer)  distance,
gdouble  delta,
GtsRange range 
)

gts_bb_tree_segment_distance: : a bounding box tree. : a GtsSegment. : a GtsBBoxDistFunc. : spatial scale of the sampling to be used. : a GtsRange to be filled with the results.

Given a segment , points are sampled regularly on its length using as increment. The distance from each of these points to the closest object of is computed using and the gts_bb_tree_point_distance() function. The fields of are filled with the number of points sampled, the minimum, average and maximum value and the standard deviation.

Definition at line 1089 of file bbtree.c.

References gts_bb_tree_point_distance(), GTS_OBJECT, GTS_OBJECT_CLASS, gts_object_destroy(), gts_object_new(), GTS_POINT, gts_point_class(), gts_range_add_value(), gts_range_init(), gts_range_update(), gts_vector_init, gts_vector_scalar, n, _GtsSegment::v1, _GtsSegment::v2, _GtsPoint::x, _GtsPoint::y, and _GtsPoint::z.

Referenced by surface_distance_foreach_boundary().

Here is the call graph for this function:

GSList* gts_bb_tree_stabbed ( GNode *  tree,
GtsPoint p 
)

gts_bb_tree_stabbed: : a bounding box tree. : a GtsPoint.

Returns: a list of bounding boxes, leaves of which are stabbed by the ray defined by (see gts_bbox_is_stabbed()).

Definition at line 641 of file bbtree.c.

References gts_bb_tree_stabbed(), and gts_bbox_is_stabbed().

Referenced by cluster_find(), gts_bb_tree_stabbed(), gts_point_is_inside_surface(), and toporouter_bbox_locate().

Here is the call graph for this function:

GNode* gts_bb_tree_surface ( GtsSurface s)

gts_bb_tree_surface: : a GtsSurface.

Returns: a new hierarchy of bounding boxes bounding the faces of .

Definition at line 619 of file bbtree.c.

References gts_bb_tree_new(), gts_surface_foreach_face(), and prepend_triangle_bbox().

Referenced by gts_surface_foreach_intersecting_face().

Here is the call graph for this function:

void gts_bb_tree_surface_boundary_distance ( GNode *  tree,
GtsSurface s,
gdouble(*)(GtsPoint *, gpointer)  distance,
gdouble  delta,
GtsRange range 
)

gts_bb_tree_surface_boundary_distance: : a bounding box tree. : a GtsSurface. : a GtsBBoxDistFunc. : a sampling increment defined as the percentage of the diagonal of the root bounding box of . : a GtsRange to be filled with the results.

Calls gts_bb_tree_segment_distance() for each edge boundary of . The fields of are filled with the minimum, maximum and average distance. The average distance is defined as the sum of the average distances for each boundary edge weighthed by their length and divided by the total length of the boundaries. The standard deviation is defined accordingly. The
field of is filled with the number of sampled points used.

Definition at line 1251 of file bbtree.c.

References gts_bbox_diagonal2(), gts_range_init(), gts_surface_foreach_edge(), _GtsRange::max, _GtsRange::mean, _GtsRange::min, _GtsRange::stddev, _GtsRange::sum, _GtsRange::sum2, and surface_distance_foreach_boundary().

Referenced by gts_surface_distance().

Here is the call graph for this function:

void gts_bb_tree_surface_distance ( GNode *  tree,
GtsSurface s,
GtsBBoxDistFunc  distance,
gdouble  delta,
GtsRange range 
)

gts_bb_tree_surface_distance: : a bounding box tree. : a GtsSurface. : a GtsBBoxDistFunc. : a sampling increment defined as the percentage of the diagonal of the root bounding box of . : a GtsRange to be filled with the results.

Calls gts_bb_tree_triangle_distance() for each face of . The fields of are filled with the minimum, maximum and average distance. The average distance is defined as the sum of the average distances for each triangle weighthed by their area and divided by the total area of the surface. The standard deviation is defined accordingly. The
field of is filled with the number of sampled points used.

Definition at line 1170 of file bbtree.c.

References gts_bbox_diagonal2(), gts_range_init(), gts_surface_foreach_face(), _GtsRange::max, _GtsRange::mean, _GtsRange::min, _GtsRange::stddev, _GtsRange::sum, _GtsRange::sum2, and surface_distance_foreach_triangle().

Referenced by gts_surface_distance().

Here is the call graph for this function:

void gts_bb_tree_traverse_overlapping ( GNode *  tree1,
GNode *  tree2,
GtsBBTreeTraverseFunc  func,
gpointer  data 
)

gts_bb_tree_traverse_overlapping: : a bounding box tree. : a bounding box tree. : a GtsBBTreeTraverseFunc. : user data to be passed to .

Calls for each overlapping pair of leaves of and .

Definition at line 730 of file bbtree.c.

References bbox_volume, gts_bb_tree_traverse_overlapping(), and gts_bboxes_are_overlapping().

Referenced by gts_bb_tree_traverse_overlapping(), gts_surface_foreach_intersecting_face(), and surface_inter_new().

Here is the call graph for this function:

void gts_bb_tree_triangle_distance ( GNode *  tree,
GtsTriangle t,
GtsBBoxDistFunc  distance,
gdouble  delta,
GtsRange range 
)

gts_bb_tree_triangle_distance: : a bounding box tree. : a GtsTriangle. : a GtsBBoxDistFunc. : spatial scale of the sampling to be used. : a GtsRange to be filled with the results.

Given a triangle , points are sampled regularly on its surface using as increment. The distance from each of these points to the closest object of is computed using and the gts_bb_tree_point_distance() function. The fields of are filled with the number of points sampled, the minimum, average and maximum value and the standard deviation.

Definition at line 1015 of file bbtree.c.

References gts_bb_tree_point_distance(), GTS_OBJECT, GTS_OBJECT_CLASS, gts_object_destroy(), gts_object_new(), GTS_POINT, gts_point_class(), gts_range_add_value(), gts_range_init(), gts_range_update(), gts_triangle_vertices(), gts_vector_init, gts_vector_scalar, _GtsPoint::x, x, _GtsPoint::y, y, and _GtsPoint::z.

Referenced by surface_distance_foreach_triangle().

Here is the call graph for this function:

GtsBBox* gts_bbox_bboxes ( GtsBBoxClass klass,
GSList *  bboxes 
)

gts_bbox_bboxes: : a GtsBBoxClass. : a list of GtsBBox.

Returns: a new GtsBBox bounding box of all the bounding boxes in .

Definition at line 225 of file bbtree.c.

References gts_bbox_new(), _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bb_tree_new().

Here is the call graph for this function:

GtsBBoxClass* gts_bbox_class ( void  )

gts_bbox_class:

Returns: the GtsBBoxClass.

Definition at line 33 of file bbtree.c.

References bbox_init(), gts_object_class(), and gts_object_class_new().

Referenced by build_list_boundary(), build_list_face(), gts_bb_tree_new(), gts_vertices_merge(), prepend_triangle_bbox(), and toporouter_bbox_class().

Here is the call graph for this function:

gdouble gts_bbox_diagonal2 ( GtsBBox bb)

gts_bbox_diagonal2: : a GtsBBox.

Returns: the squared length of the diagonal of .

Definition at line 331 of file bbtree.c.

References x, _GtsBBox::x1, _GtsBBox::x2, y, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bb_tree_surface_boundary_distance(), and gts_bb_tree_surface_distance().

void gts_bbox_draw ( GtsBBox bb,
FILE *  fptr 
)

gts_bbox_draw: : a GtsBBox. : a file pointer.

Writes in file an OOGL (Geomview) description of .

Definition at line 351 of file bbtree.c.

References _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bb_tree_draw().

gboolean gts_bbox_is_stabbed ( GtsBBox bb,
GtsPoint p 
)

gts_bbox_is_stabbed: : a GtsBBox. : a GtsPoint.

Returns: TRUE if the ray starting at and ending at (+infty, ->y, ->z) intersects with , FALSE otherwise.

Definition at line 444 of file bbtree.c.

References FALSE, TRUE, _GtsPoint::x, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bb_tree_stabbed().

GtsBBox* gts_bbox_new ( GtsBBoxClass klass,
gpointer  bounded,
gdouble  x1,
gdouble  y1,
gdouble  z1,
gdouble  x2,
gdouble  y2,
gdouble  z2 
)

gts_bbox_new: : a GtsBBoxClass. : the object to be bounded. : x-coordinate of the lower left corner. : y-coordinate of the lower left corner. : z-coordinate of the lower left corner. : x-coordinate of the upper right corner. : y-coordinate of the upper right corner. : z-coordinate of the upper right corner.

Returns: a new GtsBBox.

Definition at line 92 of file bbtree.c.

References GTS_BBOX, gts_bbox_set(), GTS_OBJECT_CLASS, and gts_object_new().

Referenced by gts_bbox_bboxes(), gts_bbox_points(), gts_bbox_segment(), gts_bbox_surface(), gts_bbox_triangle(), and gts_vertices_merge().

Here is the call graph for this function:

gboolean gts_bbox_overlaps_segment ( GtsBBox bb,
GtsSegment s 
)

gts_bbox_overlaps_segment: : a GtsBBox. : a GtsSegment.

This functions uses gts_bbox_overlaps_triangle() with a degenerate triangle.

Returns: TRUE if overlaps with , FALSE otherwise.

Definition at line 504 of file bbtree.c.

References FALSE, GTS_POINT, triBoxOverlap(), _GtsSegment::v1, _GtsSegment::v2, _GtsPoint::x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Here is the call graph for this function:

gboolean gts_bbox_overlaps_triangle ( GtsBBox bb,
GtsTriangle t 
)

gts_bbox_overlaps_triangle: : a GtsBBox. : a GtsTriangle.

This is a wrapper around the fast overlap test of Tomas Akenine-Moller (http://www.cs.lth.se/home/Tomas_Akenine_Moller/).

Returns: TRUE if overlaps with , FALSE otherwise.

Definition at line 470 of file bbtree.c.

References _GtsTriangle::e1, FALSE, GTS_POINT, GTS_SEGMENT, gts_triangle_vertex, triBoxOverlap(), _GtsPoint::x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Here is the call graph for this function:

void gts_bbox_point_distance2 ( GtsBBox bb,
GtsPoint p,
gdouble *  min,
gdouble *  max 
)

gts_bbox_point_distance2: : a GtsBBox. : a GtsPoint. : a pointer on a gdouble. : a pointer on a gdouble.

Sets and to lower and upper bounds for the square of the Euclidean distance between the object contained in and . For these bounds to make any sense the bounding box must be "tight" i.e. each of the 6 faces of the box must at least be touched by one point of the bounded object.

Definition at line 397 of file bbtree.c.

References MIN, MINMAX, _GtsPoint::x, x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by bb_tree_min_max(), and gts_bb_tree_point_closest_bboxes().

GtsBBox* gts_bbox_points ( GtsBBoxClass klass,
GSList *  points 
)

gts_bbox_points: : a GtsBBoxClass. : a list of GtsPoint.

Returns: a new GtsBBox bounding box of .

Definition at line 258 of file bbtree.c.

References gts_bbox_new(), _GtsPoint::x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by toporouter_bbox_create_from_points().

Here is the call graph for this function:

GtsBBox* gts_bbox_segment ( GtsBBoxClass klass,
GtsSegment s 
)

gts_bbox_segment: : a GtsBBoxClass. : a GtsSegment.

Returns: a new GtsBBox bounding box of .

Definition at line 150 of file bbtree.c.

References gts_bbox_new(), GTS_POINT, _GtsSegment::v1, _GtsSegment::v2, _GtsPoint::x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by build_list_boundary().

Here is the call graph for this function:

void gts_bbox_set ( GtsBBox bbox,
gpointer  bounded,
gdouble  x1,
gdouble  y1,
gdouble  z1,
gdouble  x2,
gdouble  y2,
gdouble  z2 
)

gts_bbox_set: : a GtsBBox. : the object to be bounded. : x-coordinate of the lower left corner. : y-coordinate of the lower left corner. : z-coordinate of the lower left corner. : x-coordinate of the upper right corner. : y-coordinate of the upper right corner. : z-coordinate of the upper right corner.

Sets fields of .

Definition at line 66 of file bbtree.c.

References _GtsBBox::bounded, _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bbox_new().

GtsBBox* gts_bbox_surface ( GtsBBoxClass klass,
GtsSurface surface 
)

gts_bbox_surface: : a GtsBBoxClass. : a GtsSurface.

Returns: a new GtsBBox bounding box of .

Definition at line 201 of file bbtree.c.

References bbox_foreach_vertex(), gts_bbox_new(), gts_surface_foreach_vertex(), _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by toporouter_bbox_create().

Here is the call graph for this function:

GtsBBox* gts_bbox_triangle ( GtsBBoxClass klass,
GtsTriangle t 
)

gts_bbox_triangle: : a GtsBBoxClass. : a GtsTriangle.

Returns: a new GtsBBox bounding box of .

Definition at line 113 of file bbtree.c.

References _GtsTriangle::e1, gts_bbox_new(), GTS_POINT, GTS_SEGMENT, gts_triangle_vertex, _GtsPoint::x, _GtsBBox::x1, _GtsBBox::x2, _GtsPoint::y, _GtsBBox::y1, _GtsBBox::y2, _GtsPoint::z, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by build_list_face(), and prepend_triangle_bbox().

Here is the call graph for this function:

gboolean gts_bboxes_are_overlapping ( GtsBBox bb1,
GtsBBox bb2 
)

gts_bboxes_are_overlapping: : a GtsBBox. : a GtsBBox.

Returns: TRUE if the bounding boxes and are overlapping (including just touching), FALSE otherwise.

Definition at line 299 of file bbtree.c.

References FALSE, TRUE, _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Referenced by gts_bb_tree_is_overlapping(), gts_bb_tree_overlap(), and gts_bb_tree_traverse_overlapping().

static void prepend_triangle_bbox ( GtsTriangle t,
GSList **  bboxes 
) [static]

Definition at line 607 of file bbtree.c.

References gts_bbox_class(), and gts_bbox_triangle().

Referenced by gts_bb_tree_surface().

Here is the call graph for this function:

static void surface_distance_foreach_boundary ( GtsEdge e,
gpointer *  data 
) [static]
static void surface_distance_foreach_triangle ( GtsTriangle t,
gpointer *  data 
) [static]

Definition at line 1131 of file bbtree.c.

References gts_bb_tree_triangle_distance(), gts_triangle_area(), _GtsRange::max, _GtsRange::mean, _GtsRange::min, _GtsRange::n, _GtsRange::sum, and _GtsRange::sum2.

Referenced by gts_bb_tree_surface_distance().

Here is the call graph for this function:

int triBoxOverlap ( double  boxcenter[3],
double  boxhalfsize[3],
double  triverts[3][3] 
)

Definition at line 116 of file tribox3.c.

References AXISTEST_X01, AXISTEST_X2, AXISTEST_Y02, AXISTEST_Y1, AXISTEST_Z0, AXISTEST_Z12, CROSS, FINDMINMAX, max, min, planeBoxOverlap(), SUB, X, Y, and Z.

Referenced by gts_bbox_overlaps_segment(), and gts_bbox_overlaps_triangle().

Here is the call graph for this function: