BRL-CAD
tie_kdtree.c File Reference
#include "tie.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "tieprivate.h"
Include dependency graph for tie_kdtree.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_SLICES   100
 
#define MIN_SLICES   35
 
#define MIN_DENSITY   0.01
 
#define MIN_SPAN   0.15
 
#define SCALE_COEF   1.80
 
#define TIE_KDTREE_NODE_MAX   4 /* Maximum number of triangles that can reside in a given node until it should be split */
 
#define TIE_KDTREE_DEPTH_K1   1.4 /* K1 Depth Constant Coefficient */
 
#define TIE_KDTREE_DEPTH_K2   1 /* K2 Constant */
 
#define _MIN(a, b)   (a)<(b)?(a):(b)
 
#define _MAX(a, b)   (a)>(b)?(a):(b)
 
#define MATH_MIN3(_a, _b, _c, _d)   _a = _MIN((_b), _MIN((_c), (_d)))
 
#define MATH_MAX3(_a, _b, _c, _d)   _a = _MAX((_b), _MAX((_c), (_d)))
 
#define MATH_BBOX(_a, _b, _c, _d, _e)
 
#define AXISTEST_X01(a, b, fa, fb)
 
#define AXISTEST_X2(a, b, fa, fb)
 
#define AXISTEST_Y02(a, b, fa, fb)
 
#define AXISTEST_Y1(a, b, fa, fb)
 
#define AXISTEST_Z12(a, b, fa, fb)
 
#define AXISTEST_Z0(a, b, fa, fb)
 

Functions

void TIE_VAL() tie_kdtree_free (struct tie_s *tie)
 
void TIE_VAL() tie_kdtree_prep (struct tie_s *tie)
 

Detailed Description

tie_kdtree.c

Definition in file tie_kdtree.c.

Macro Definition Documentation

#define MAX_SLICES   100

Definition at line 42 of file tie_kdtree.c.

#define MIN_SLICES   35

Definition at line 43 of file tie_kdtree.c.

#define MIN_DENSITY   0.01

Definition at line 44 of file tie_kdtree.c.

#define MIN_SPAN   0.15

Definition at line 45 of file tie_kdtree.c.

#define SCALE_COEF   1.80

Definition at line 46 of file tie_kdtree.c.

#define TIE_KDTREE_NODE_MAX   4 /* Maximum number of triangles that can reside in a given node until it should be split */

Definition at line 48 of file tie_kdtree.c.

#define TIE_KDTREE_DEPTH_K1   1.4 /* K1 Depth Constant Coefficient */

Definition at line 49 of file tie_kdtree.c.

Referenced by tie_kdtree_prep().

#define TIE_KDTREE_DEPTH_K2   1 /* K2 Constant */

Definition at line 50 of file tie_kdtree.c.

Referenced by tie_kdtree_prep().

#define _MIN (   a,
 
)    (a)<(b)?(a):(b)

Definition at line 52 of file tie_kdtree.c.

#define _MAX (   a,
 
)    (a)>(b)?(a):(b)

Definition at line 53 of file tie_kdtree.c.

#define MATH_MIN3 (   _a,
  _b,
  _c,
  _d 
)    _a = _MIN((_b), _MIN((_c), (_d)))

Definition at line 54 of file tie_kdtree.c.

#define MATH_MAX3 (   _a,
  _b,
  _c,
  _d 
)    _a = _MAX((_b), _MAX((_c), (_d)))

Definition at line 55 of file tie_kdtree.c.

Referenced by tie_kdtree_prep().

#define MATH_BBOX (   _a,
  _b,
  _c,
  _d,
  _e 
)
Value:
{ \
MATH_MIN3(_a.v[0], _c.v[0], _d.v[0], _e.v[0]); \
MATH_MIN3(_a.v[1], _c.v[1], _d.v[1], _e.v[1]); \
MATH_MIN3(_a.v[2], _c.v[2], _d.v[2], _e.v[2]); \
MATH_MAX3(_b.v[0], _c.v[0], _d.v[0], _e.v[0]); \
MATH_MAX3(_b.v[1], _c.v[1], _d.v[1], _e.v[1]); \
MATH_MAX3(_b.v[2], _c.v[2], _d.v[2], _e.v[2]); }
#define MATH_MIN3(_a, _b, _c, _d)
Definition: tie_kdtree.c:54
#define MATH_MAX3(_a, _b, _c, _d)
Definition: tie_kdtree.c:55

Definition at line 57 of file tie_kdtree.c.

#define AXISTEST_X01 (   a,
  b,
  fa,
  fb 
)
Value:
p.v[0] = a*v0.v[1] - b*v0.v[2]; \
p.v[2] = a*v2.v[1] - b*v2.v[2]; \
if (p.v[0] < p.v[2]) { min = p.v[0]; max = p.v[2]; } else { min = p.v[2]; max = p.v[0]; } \
rad = fa * half_size->v[1] + fb * half_size->v[2]; \
if (min > rad || max < -rad) return 0; \
if(share_geom)
Definition: nmg_mod.c:3829
A frame-buffer IO structure.
Definition: fb_private.h:80

Definition at line 66 of file tie_kdtree.c.

#define AXISTEST_X2 (   a,
  b,
  fa,
  fb 
)
Value:
p.v[0] = a*v0.v[1] - b*v0.v[2]; \
p.v[1] = a*v1.v[1] - b*v1.v[2]; \
if (p.v[0] < p.v[1]) { min = p.v[0]; max = p.v[1]; } else { min = p.v[1]; max = p.v[0]; } \
rad = fa * half_size->v[1] + fb * half_size->v[2]; \
if (min > rad || max < -rad) return 0;
if(share_geom)
Definition: nmg_mod.c:3829
A frame-buffer IO structure.
Definition: fb_private.h:80

Definition at line 73 of file tie_kdtree.c.

#define AXISTEST_Y02 (   a,
  b,
  fa,
  fb 
)
Value:
p.v[0] = -a*v0.v[0] + b*v0.v[2]; \
p.v[2] = -a*v2.v[0] + b*v2.v[2]; \
if (p.v[0] < p.v[2]) { min = p.v[0]; max = p.v[2]; } else { min = p.v[2]; max = p.v[0]; } \
rad = fa * half_size->v[0] + fb * half_size->v[2]; \
if (min > rad || max < -rad) return 0;
if(share_geom)
Definition: nmg_mod.c:3829
A frame-buffer IO structure.
Definition: fb_private.h:80

Definition at line 81 of file tie_kdtree.c.

#define AXISTEST_Y1 (   a,
  b,
  fa,
  fb 
)
Value:
p.v[0] = -a*v0.v[0] + b*v0.v[2]; \
p.v[1] = -a*v1.v[0] + b*v1.v[2]; \
if (p.v[0] < p.v[1]) { min = p.v[0]; max = p.v[1]; } else { min = p.v[1]; max = p.v[0]; } \
rad = fa * half_size->v[0] + fb * half_size->v[2]; \
if (min > rad || max < -rad) return 0;
if(share_geom)
Definition: nmg_mod.c:3829
A frame-buffer IO structure.
Definition: fb_private.h:80

Definition at line 88 of file tie_kdtree.c.

#define AXISTEST_Z12 (   a,
  b,
  fa,
  fb 
)
Value:
p.v[1] = a*v1.v[0] - b*v1.v[1]; \
p.v[2] = a*v2.v[0] - b*v2.v[1]; \
if (p.v[2] < p.v[1]) { min = p.v[2]; max = p.v[1]; } else { min = p.v[1]; max = p.v[2]; } \
rad = fa * half_size->v[0] + fb * half_size->v[1]; \
if (min > rad || max < -rad) return 0;
if(share_geom)
Definition: nmg_mod.c:3829
A frame-buffer IO structure.
Definition: fb_private.h:80

Definition at line 96 of file tie_kdtree.c.

#define AXISTEST_Z0 (   a,
  b,
  fa,
  fb 
)
Value:
p.v[0] = a*v0.v[0] - b*v0.v[1]; \
p.v[1] = a*v1.v[0] - b*v1.v[1]; \
if (p.v[0] < p.v[1]) { min = p.v[0]; max = p.v[1]; } else { min = p.v[1]; max = p.v[0]; } \
rad = fa * half_size->v[0] + fb * half_size->v[1]; \
if (min > rad || max < -rad) return 0;
if(share_geom)
Definition: nmg_mod.c:3829
A frame-buffer IO structure.
Definition: fb_private.h:80

Definition at line 103 of file tie_kdtree.c.

Function Documentation

void TIE_VAL() tie_kdtree_free ( struct tie_s *  tie)

Definition at line 694 of file tie_kdtree.c.

References bu_free().

Referenced by tie_free().

Here is the call graph for this function:

void TIE_VAL() tie_kdtree_prep ( struct tie_s *  tie)

Definition at line 705 of file tie_kdtree.c.

References bu_free(), bu_realloc(), delta, if(), MATH_MAX3, TIE_KDTREE_DEPTH_K1, TIE_KDTREE_DEPTH_K2, TIE_PREC, tie_geom_s::tri_list, and tie_geom_s::tri_num.

Referenced by tie_prep().

Here is the call graph for this function: