BRL-CAD
btgf.c
Go to the documentation of this file.
1 /* B T G F . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2010-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @file primitives/bot/btgf.c
21  *
22  * the bot/tie float glue.
23  *
24  */
25 
26 #include "common.h"
27 
28 #define TIE_PRECISION 0
29 
30 #include "raytrace.h"
31 #include "rtgeom.h"
32 #include "tie.h"
33 #include "btg.h"
34 
35 #include "tie.c"
36 #include "tie_kdtree.c"
37 
38 void *
39 bottie_allocn_float(unsigned long long ntri)
40 {
41  struct tie_s *tie;
42  BU_ALLOC(tie, struct tie_s);
43  tie_init(tie, ntri, TIE_KDTREE_FAST);
44  return (void *)tie;
45 }
46 
47 void
48 bottie_push_float(void *UNUSED(vtie), float **UNUSED(tri), unsigned int UNUSED(ntri), void *UNUSED(usr), unsigned int UNUSED(pstride))
49 {
50  return;
51 }
52 
53 int
54 bottie_prep_float(struct soltab *stp,struct rt_bot_internal *bot, struct rt_i *UNUSED(rtip))
55 {
56  struct tie_s *tie = (struct tie_s *)bot->tie;
57 
58  tie_prep(tie);
59  VMOVE(stp->st_min, tie->min);
60  VMOVE(stp->st_max, tie->max);
61  VMOVE(stp->st_center, tie->mid);
62  stp->st_bradius = stp->st_aradius = tie->radius;
63  stp->st_specific = bot;
64 
65  return 0;
66 }
67 
68 
69 int
70 bottie_shot_float(struct soltab *UNUSED(stp), register struct xray *UNUSED(rp), struct application *UNUSED(ap), struct seg *UNUSED(seghead))
71 {
72  /* use hitfunc to build the hit list */
73  return -1;
74 }
75 
76 /*
77  * Local Variables:
78  * tab-width: 8
79  * mode: C
80  * indent-tabs-mode: t
81  * c-file-style: "stroustrup"
82  * End:
83  * ex: shiftwidth=4 tabstop=8
84  */
Definition: raytrace.h:215
Definition: raytrace.h:368
fastf_t st_aradius
Radius of APPROXIMATING sphere.
Definition: raytrace.h:433
int bottie_prep_float(struct soltab *stp, struct rt_bot_internal *bot, struct rt_i *rtip)
Definition: btgf.c:54
void * bottie_allocn_float(unsigned long long ntri)
Definition: btgf.c:39
Header file for the BRL-CAD common definitions.
#define BU_ALLOC(_ptr, _type)
Definition: malloc.h:223
fastf_t st_bradius
Radius of BOUNDING sphere.
Definition: raytrace.h:434
point_t st_max
max X, Y, Z of bounding RPP
Definition: raytrace.h:438
int bottie_shot_float(struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead)
Definition: btgf.c:70
#define UNUSED(parameter)
Definition: common.h:239
point_t st_min
min X, Y, Z of bounding RPP
Definition: raytrace.h:437
void * st_specific
-> ID-specific (private) struct
Definition: raytrace.h:435
void TIE_VAL() tie_prep(struct tie_s *tie)
Definition: tie.c:180
void bottie_push_float(void *vtie, float **tri, unsigned int ntri, void *usr, unsigned int pstride)
Definition: btgf.c:48
void TIE_VAL() tie_init(struct tie_s *tie, unsigned int tri_num, unsigned int kdmethod)
Definition: tie.c:137
point_t st_center
Centroid of solid.
Definition: raytrace.h:432