Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56d5e320dc | ||
|
|
234f57103e | ||
|
|
9719bde58e | ||
|
|
74c8984713 | ||
|
|
b607d0fe57 | ||
|
|
0998a26201 | ||
|
|
2dea1a87c5 | ||
|
|
062f52ede2 | ||
|
|
58eef97515 | ||
|
|
ff5f34cb44 | ||
|
|
efec572b7c | ||
|
|
8ec4046775 | ||
|
|
022c30c391 | ||
|
|
9b0cc79190 | ||
|
|
25147f58d8 | ||
|
|
d6e65d2cf5 | ||
|
|
b42637c409 | ||
|
|
c20684b379 | ||
|
|
e8c89b3daa | ||
|
|
78e69f6cd7 | ||
|
|
cf152223e0 | ||
|
|
ad946abb5b | ||
|
|
abcf4a4014 | ||
|
|
01ba252bf0 | ||
|
|
4f9d57efb3 | ||
|
|
edee29be28 | ||
|
|
e38887bf2d | ||
|
|
b3f4626319 | ||
|
|
c841db93d8 | ||
|
|
bd6e7cae51 | ||
|
|
7a9dcd5be0 | ||
|
|
80a0f58562 | ||
|
|
876c7b0c40 | ||
|
|
3f32ee7540 | ||
|
|
7bc82a0ef9 | ||
|
|
adfc323aa4 | ||
|
|
fecc00dcff | ||
|
|
8dc5fa5d72 | ||
|
|
237189ff60 | ||
|
|
915d91abc7 | ||
|
|
51b04d211c | ||
|
|
2c42dfaca1 | ||
|
|
41795f11cb | ||
|
|
c9f61eb6ac | ||
|
|
a2f2adf17e | ||
|
|
f75b6e7b1a | ||
|
|
41196e36ed | ||
|
|
017e03bf20 | ||
|
|
48ba96c560 |
@@ -0,0 +1 @@
|
||||
/.deps␍/Makefile␍/Makefile.in␍/aclocal.m4␍/autom4te.cache␍/config.*␍/configure␍/install.*.log␍/libtool␍/ltmain.sh␍/so_locations␍/.settings␍/.project␍/.cdtproject␍/.cproject
|
||||
+2
-1
@@ -17,7 +17,8 @@ brlcadinclude_required = \
|
||||
rtfunc.h \
|
||||
rtgeom.h \
|
||||
rtserver.h \
|
||||
tclcad.h
|
||||
tclcad.h \
|
||||
tie.h
|
||||
|
||||
brlcadinclude_wanted = \
|
||||
analyze.h \
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ struct bot_specific {
|
||||
genptr_t bot_facelist; /* head of linked list */
|
||||
genptr_t *bot_facearray; /* head of face array */
|
||||
size_t bot_tri_per_piece; /* log # tri per peice. 1 << bot_ltpp is tri per piece */
|
||||
|
||||
void *tie; /* FIXME: horrible blind cast, points to one in rt_bot_internal */
|
||||
};
|
||||
|
||||
RT_EXPORT BU_EXTERN(void rt_bot_prep_pieces,
|
||||
|
||||
@@ -1354,6 +1354,7 @@ struct rt_piecelist {
|
||||
/* Used to set globals declared in bot.c */
|
||||
#define RT_DEFAULT_MINPIECES 32
|
||||
#define RT_DEFAULT_TRIS_PER_PIECE 4
|
||||
#define RT_DEFAULT_MINTIE 0xffffffff
|
||||
|
||||
/**
|
||||
* R E S O U R C E
|
||||
@@ -5951,6 +5952,7 @@ RT_EXPORT extern fastf_t rt_cline_radius;
|
||||
/* defined in bot.c */
|
||||
RT_EXPORT extern size_t rt_bot_minpieces;
|
||||
RT_EXPORT extern size_t rt_bot_tri_per_piece;
|
||||
RT_EXPORT extern size_t rt_bot_mintie;
|
||||
RT_EXPORT BU_EXTERN(int rt_bot_sort_faces,
|
||||
(struct rt_bot_internal *bot,
|
||||
size_t tris_per_piece));
|
||||
|
||||
@@ -590,6 +590,7 @@ struct rt_bot_internal
|
||||
* "normals" array, one per face
|
||||
* vertex [num_face_normals*3]
|
||||
*/
|
||||
void *tie; /* FIXME: blind casting. TIE needs to move from TIE_FUNC to XGLUE before this can not suck. */
|
||||
};
|
||||
|
||||
struct rt_bot_list {
|
||||
|
||||
@@ -123,7 +123,7 @@ struct tie_s {
|
||||
unsigned int kdmethod; /* Optimal or Fast */
|
||||
/* all tfloat altered stuff should be at the end. */
|
||||
TIE_3 min, max;
|
||||
vect_t mid;
|
||||
vect_t amin, amax, mid;
|
||||
fastf_t radius;
|
||||
};
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
+36
-28
@@ -8,14 +8,8 @@ AM_CFLAGS = \
|
||||
-I${top_srcdir}/src/adrt/librender \
|
||||
${TCL_CPPFLAGS}
|
||||
|
||||
lib_LTLIBRARIES = libtie.la librender.la
|
||||
|
||||
libtie_la_LIBADD = ${BU} ${BU_LIBS}
|
||||
libtie_la_SOURCES = \
|
||||
libtie/tie0.c \
|
||||
libtie/tie1.c \
|
||||
libtie/tie_kdtree0.c \
|
||||
libtie/tie_kdtree1.c
|
||||
bin_PROGRAMS = adrt_master adrt_slave
|
||||
lib_LTLIBRARIES = librender.la
|
||||
|
||||
librender_la_SOURCES = \
|
||||
load.c \
|
||||
@@ -46,10 +40,34 @@ librender_la_SOURCES = \
|
||||
librender/texture_stack.c
|
||||
|
||||
librender_la_LIBADD = \
|
||||
libtie.la \
|
||||
${GCV} \
|
||||
${GCV_LIBS}
|
||||
|
||||
adrt_master_SOURCES = \
|
||||
master/compnet.c \
|
||||
master/dispatcher.c \
|
||||
master/tienet_master.c \
|
||||
master/master.c
|
||||
|
||||
adrt_master_LDADD = \
|
||||
${RT} \
|
||||
${BU} \
|
||||
${LIBNETWORK} \
|
||||
${LIBTHREAD} \
|
||||
${LIBBSD} \
|
||||
${LIBM} \
|
||||
${LIBZ}
|
||||
|
||||
adrt_slave_SOURCES = \
|
||||
slave/slave.c \
|
||||
slave/tienet_slave.c
|
||||
|
||||
adrt_slave_LDADD = \
|
||||
${RT} \
|
||||
${LIBNETWORK} \
|
||||
${LIBTHREAD} \
|
||||
librender.la
|
||||
|
||||
tieincludedir = $(includedir)/tie
|
||||
tieinclude_HEADERS = \
|
||||
adrt.h \
|
||||
@@ -59,13 +77,17 @@ tieinclude_HEADERS = \
|
||||
librender/render_internal.h \
|
||||
librender/render_util.h \
|
||||
librender/texture.h \
|
||||
librender/texture_internal.h \
|
||||
libtie/tie.h
|
||||
librender/texture_internal.h
|
||||
|
||||
noinst_HEADERS = \
|
||||
libtie/tieprivate.h \
|
||||
load.h \
|
||||
tienet.h
|
||||
tienet.h \
|
||||
master/compnet.h \
|
||||
master/dispatcher.h \
|
||||
master/tienet_master.h \
|
||||
master/master.h \
|
||||
slave/slave.h \
|
||||
slave/tienet_slave.h
|
||||
|
||||
pkglibdir = $(libdir)/isst
|
||||
|
||||
@@ -91,21 +113,7 @@ pkglibdir = $(libdir)/isst
|
||||
EXTRA_DIST = \
|
||||
isst.h \
|
||||
isst.tcl \
|
||||
isst_tcltk.c \
|
||||
libtie/tie.c \
|
||||
libtie/tie_kdtree.c \
|
||||
master/compnet.h \
|
||||
master/master.h \
|
||||
master/tienet_master.c \
|
||||
master/dispatcher.c \
|
||||
master/master.c \
|
||||
master/dispatcher.h \
|
||||
master/tienet_master.h \
|
||||
master/compnet.c \
|
||||
slave/tienet_slave.h \
|
||||
slave/slave.h \
|
||||
slave/slave.c \
|
||||
slave/tienet_slave.c
|
||||
isst_tcltk.c
|
||||
|
||||
LINT=splint $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
|
||||
lint:
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/* T I E 0 . C
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2008-2011 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
|
||||
/** @file tie0.c
|
||||
* tie0.c
|
||||
*
|
||||
*/
|
||||
#include <bu.h>
|
||||
#include "tie.h"
|
||||
|
||||
TIE_EXPORT int tie_check_degenerate = 0;
|
||||
|
||||
#ifdef TIE_PRECISION
|
||||
# undef TIE_PRECISION
|
||||
#endif
|
||||
|
||||
#define TIE_PRECISION 0
|
||||
#include "./tie.c"
|
||||
#undef TIE_PRECISION
|
||||
@@ -1,29 +0,0 @@
|
||||
/* T I E 1 . C
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2008-2011 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file tie1.c
|
||||
* tie1.c
|
||||
*
|
||||
*/
|
||||
|
||||
#define TIE_PRECISION 1
|
||||
#include "./tie.c"
|
||||
#undef TIE_PRECISION
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/* T I E _ K D T R E E 0 . C
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2008-2011 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file tie_kdtree0.c
|
||||
* tie_kdtree0.c
|
||||
*
|
||||
*/
|
||||
|
||||
#define TIE_PRECISION 0
|
||||
|
||||
#include "tie.h"
|
||||
|
||||
TIE_EXPORT fastf_t TIE_PREC;
|
||||
|
||||
#include "./tie_kdtree.c"
|
||||
#undef TIE_PRECISION
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/* T I E _ K D T R E E 1 . C
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2008-2011 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file tie_kdtree1.c
|
||||
* tie_kdtree1.c
|
||||
*
|
||||
*/
|
||||
|
||||
#define TIE_PRECISION 1
|
||||
#include "./tie_kdtree.c"
|
||||
#undef TIE_PRECISION
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libtie/tie.h"
|
||||
#include "tie.h"
|
||||
#include "load.h"
|
||||
|
||||
uint32_t slave_load_mesh_num;
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
#include "rtgeom.h"
|
||||
#include "raytrace.h"
|
||||
|
||||
#include "libtie/tie.h"
|
||||
#include "tie.h"
|
||||
#include "adrt.h"
|
||||
#include "adrt_struct.h"
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#endif
|
||||
#include "bio.h"
|
||||
|
||||
#include "libtie/tie.h"
|
||||
#include "tie.h"
|
||||
#include "adrt.h"
|
||||
#include "tienet.h"
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#endif
|
||||
#include "bio.h"
|
||||
|
||||
#include "libtie/tie.h"
|
||||
#include "tie.h"
|
||||
#include "adrt.h"
|
||||
|
||||
#include "tienet_master.h"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
|
||||
#include "libtie/tie.h"
|
||||
#include "tie.h"
|
||||
#include "adrt.h"
|
||||
#include "tienet.h"
|
||||
#include "tienet_master.h"
|
||||
|
||||
@@ -39,11 +39,10 @@
|
||||
# include <getopt.h>
|
||||
#endif
|
||||
|
||||
#include "libtie/tie.h"
|
||||
#include "tie.h"
|
||||
#include "adrt.h"
|
||||
#include "camera.h"
|
||||
#include "adrt.h"
|
||||
#include "tie.h"
|
||||
#include "render_util.h"
|
||||
|
||||
#include "slave.h"
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
@@ -93,6 +93,8 @@ librt_nil_la_SOURCES = \
|
||||
primitives/bot/bot.c \
|
||||
primitives/bot/bot_brep.cpp \
|
||||
primitives/bot/bot_mirror.c \
|
||||
primitives/bot/btg.c \
|
||||
primitives/bot/btgf.c \
|
||||
primitives/brep/brep.cpp \
|
||||
primitives/brep/brep_debug.cpp \
|
||||
primitives/bspline/bspline.cpp \
|
||||
@@ -278,9 +280,9 @@ parsetest_LDADD = \
|
||||
|
||||
|
||||
noinst_HEADERS = \
|
||||
opennurbs_ext.h \
|
||||
primitives/fixpt.h \
|
||||
primitives/bot/btg.h \
|
||||
primitives/brep/brep_debug.h \
|
||||
primitives/fixpt.h \
|
||||
primitives/metaball/metaball.h \
|
||||
primitives/revolve/revolve.h \
|
||||
primitives/xxx/xxx.h
|
||||
@@ -302,6 +304,8 @@ EXTRA_DIST = \
|
||||
namegen.c \
|
||||
pmalloc.c \
|
||||
primitives/bot/g_bot_include.c \
|
||||
primitives/bot/tie.c \
|
||||
primitives/bot/tie_kdtree.c \
|
||||
timer-nt.c \
|
||||
timer52brl.c \
|
||||
timerhep.c \
|
||||
|
||||
@@ -283,6 +283,11 @@ fastf_t rt_cline_radius = (fastf_t)-1.0;
|
||||
*/
|
||||
size_t rt_bot_minpieces = RT_DEFAULT_MINPIECES;
|
||||
|
||||
/**
|
||||
* minimum number of bot for TIE
|
||||
*/
|
||||
size_t rt_bot_mintie = RT_DEFAULT_MINTIE;
|
||||
|
||||
/**
|
||||
* minimum triangles per piece
|
||||
*/
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
#define GLUE(_a, _b) _a ## _b
|
||||
#define XGLUE(_a, _b) GLUE(_a, _b)
|
||||
|
||||
#include "tie.h"
|
||||
#include "btg.h" /* for the bottie_ functions */
|
||||
|
||||
#define MAXHITS 128
|
||||
|
||||
@@ -68,7 +70,7 @@
|
||||
|
||||
|
||||
/* forward declarations needed for the included routines below */
|
||||
HIDDEN int
|
||||
int
|
||||
rt_bot_makesegs(
|
||||
struct hit *hits,
|
||||
size_t nhits,
|
||||
@@ -203,11 +205,12 @@ rt_bot_prep(struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip)
|
||||
bot_ip = (struct rt_bot_internal *)ip->idb_ptr;
|
||||
RT_BOT_CK_MAGIC(bot_ip);
|
||||
|
||||
if (bot_ip->bot_flags & RT_BOT_USE_FLOATS) {
|
||||
if ( bot_ip->num_faces >= rt_bot_mintie && (bot_ip->face_normals != NULL || bot_ip->orientation != RT_BOT_UNORIENTED) )
|
||||
return bottie_prep_double(stp, bot_ip, rtip);
|
||||
else if (bot_ip->bot_flags & RT_BOT_USE_FLOATS)
|
||||
return rt_bot_prep_float(stp, bot_ip, rtip);
|
||||
} else {
|
||||
else
|
||||
return rt_bot_prep_double(stp, bot_ip, rtip);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +264,7 @@ rt_bot_unoriented_segs(struct hit *hits,
|
||||
* Given an array of hits, make segments out of them. Exactly how
|
||||
* this is to be done depends on the mode of the BoT.
|
||||
*/
|
||||
HIDDEN int
|
||||
int
|
||||
rt_bot_makesegs(struct hit *hits, size_t nhits, struct soltab *stp, struct xray *rp, struct application *ap, struct seg *seghead, struct rt_piecestate *psp)
|
||||
{
|
||||
struct bot_specific *bot = (struct bot_specific *)stp->st_specific;
|
||||
@@ -298,7 +301,9 @@ rt_bot_shot(struct soltab *stp, struct xray *rp, struct application *ap, struct
|
||||
{
|
||||
struct bot_specific *bot = (struct bot_specific *)stp->st_specific;
|
||||
|
||||
if (bot->bot_flags & RT_BOT_USE_FLOATS) {
|
||||
if (bot->tie != NULL) {
|
||||
return bottie_shot_double(stp, rp, ap, seghead);
|
||||
} else if (bot->bot_flags & RT_BOT_USE_FLOATS) {
|
||||
return rt_bot_shot_float(stp, rp, ap, seghead);
|
||||
} else {
|
||||
return rt_bot_shot_double(stp, rp, ap, seghead);
|
||||
@@ -420,6 +425,11 @@ rt_bot_free(struct soltab *stp)
|
||||
struct bot_specific *bot =
|
||||
(struct bot_specific *)stp->st_specific;
|
||||
|
||||
if (bot->tie != NULL) {
|
||||
bottie_free_double(bot->tie);
|
||||
bot->tie = NULL;
|
||||
}
|
||||
|
||||
if (bot->bot_flags & RT_BOT_USE_FLOATS) {
|
||||
rt_bot_free_float(bot);
|
||||
} else {
|
||||
@@ -976,6 +986,8 @@ rt_bot_import5(struct rt_db_internal *ip, const struct bu_external *ep, const fa
|
||||
bip->num_face_normals = 0;
|
||||
}
|
||||
|
||||
bip->tie = NULL;
|
||||
|
||||
return 0; /* OK */
|
||||
}
|
||||
|
||||
@@ -1259,6 +1271,9 @@ rt_bot_ifree2(struct rt_bot_internal *bot_ip)
|
||||
RT_BOT_CK_MAGIC(bot_ip);
|
||||
bot_ip->magic = 0; /* sanity */
|
||||
|
||||
if (bot_ip->tie)
|
||||
bot_ip->tie = NULL;
|
||||
|
||||
if (bot_ip->vertices) {
|
||||
bu_free(bot_ip->vertices, "BOT vertices");
|
||||
bot_ip->vertices = NULL;
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
/* B T G . C
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2010-2010 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file btg.c
|
||||
*
|
||||
* the bot/tie glue.
|
||||
*
|
||||
*/
|
||||
|
||||
#define TIE_PRECISION 1
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "raytrace.h"
|
||||
#include "rtgeom.h"
|
||||
#include "bot.h"
|
||||
#include "tie.h"
|
||||
|
||||
#include "btg.h"
|
||||
|
||||
#include "tie.c"
|
||||
#include "tie_kdtree.c"
|
||||
|
||||
int tie_check_degenerate = 0;
|
||||
fastf_t TIE_PREC = 0.1;
|
||||
|
||||
int rt_bot_makesegs(struct hit *hits, size_t nhits, struct soltab *stp, struct xray *rp, struct application *ap, struct seg *seghead, struct rt_piecestate *psp);
|
||||
|
||||
void *
|
||||
bottie_allocn_double(unsigned long long ntri)
|
||||
{
|
||||
struct tie_s *tie;
|
||||
tie = bu_malloc(sizeof(struct tie_s), "TIE");
|
||||
if(tie == NULL)
|
||||
return NULL;
|
||||
|
||||
tie_init1(tie, ntri, TIE_KDTREE_FAST);
|
||||
return tie;
|
||||
}
|
||||
|
||||
void
|
||||
bottie_push_double(void *vtie, TIE_3 **tri, unsigned int ntri, void *u, unsigned int pstride)
|
||||
{
|
||||
struct tie_s *tie = (struct tie_s *)vtie;
|
||||
|
||||
tie_push1(tie, tri, ntri, u, pstride);
|
||||
}
|
||||
|
||||
int
|
||||
bottie_prep_double(struct soltab *stp, struct rt_bot_internal *bot_ip, struct rt_i *UNUSED(rtip))
|
||||
{
|
||||
struct tie_s *tie;
|
||||
struct bot_specific *bot;
|
||||
unsigned int i;
|
||||
|
||||
RT_BOT_CK_MAGIC(bot_ip);
|
||||
|
||||
BU_GETSTRUCT(bot, bot_specific);
|
||||
stp->st_specific = (genptr_t)bot;
|
||||
bot->bot_mode = bot_ip->mode;
|
||||
bot->bot_orientation = bot_ip->orientation;
|
||||
bot->bot_flags = bot_ip->bot_flags;
|
||||
|
||||
tie = bot_ip->tie = bot->tie = bottie_allocn_double(bot_ip->num_faces);
|
||||
|
||||
for(i=0;i< bot_ip->num_faces; i++) {
|
||||
TIE_3 v, *vp;
|
||||
|
||||
vp = &v;
|
||||
|
||||
v.v[0] = bot_ip->vertices[bot_ip->faces[i*3+0]*3];
|
||||
v.v[1] = bot_ip->vertices[bot_ip->faces[i*3+1]*3];
|
||||
v.v[2] = bot_ip->vertices[bot_ip->faces[i*3+2]*3];
|
||||
bottie_push_double((struct tie_s *)tie, &vp, 1, &i, 0);
|
||||
}
|
||||
|
||||
tie_prep1((struct tie_s *)bot->tie);
|
||||
|
||||
VMOVE(stp->st_min, tie->amin);
|
||||
VMOVE(stp->st_max, tie->amax);
|
||||
VMOVE(stp->st_center, tie->mid);
|
||||
stp->st_aradius = tie->radius;
|
||||
stp->st_bradius = tie->radius;
|
||||
|
||||
return 0; /* always returning OK seems... bad. */
|
||||
}
|
||||
|
||||
#define MAXHITS 128
|
||||
|
||||
struct hitdata_s {
|
||||
int nhits;
|
||||
struct hit hits[MAXHITS];
|
||||
struct tri_specific ts[MAXHITS];
|
||||
struct xray *rp;
|
||||
};
|
||||
|
||||
static void *
|
||||
hitfunc(struct tie_ray_s *UNUSED(ray), struct tie_id_s *id, struct tie_tri_s *UNUSED(tri), void *ptr)
|
||||
{
|
||||
struct hitdata_s *h = (struct hitdata_s *)ptr;
|
||||
struct tri_specific *tsp;
|
||||
struct hit *hp;
|
||||
|
||||
if(h->nhits > (MAXHITS-1)) {
|
||||
bu_log("Too many hits!\n");
|
||||
return (void *)1;
|
||||
}
|
||||
|
||||
hp = &h->hits[h->nhits];
|
||||
tsp = hp->hit_private = &h->ts[h->nhits];
|
||||
h->nhits++;
|
||||
|
||||
|
||||
hp->hit_magic = RT_HIT_MAGIC;
|
||||
hp->hit_dist = id->dist;
|
||||
VMOVE(tsp->tri_N, id->norm);
|
||||
|
||||
/* add hitdist into array and add one to nhits */
|
||||
return NULL; /* continue firing */
|
||||
}
|
||||
|
||||
int
|
||||
bottie_shot_double(struct soltab *stp, struct xray *rp, struct application *ap, struct seg *seghead)
|
||||
{
|
||||
struct bot_specific *bot;
|
||||
struct tie_s *tie;
|
||||
struct hitdata_s hitdata;
|
||||
struct tie_id_s id;
|
||||
struct tie_ray_s ray;
|
||||
|
||||
bot = (struct bot_specific *)stp->st_specific;
|
||||
tie = (struct tie_s *)bot->tie;
|
||||
|
||||
hitdata.nhits = 0;
|
||||
hitdata.rp = &ap->a_ray;
|
||||
|
||||
VMOVE(ray.pos, rp->r_pt);
|
||||
VMOVE(ray.dir, rp->r_dir);
|
||||
ray.depth = ray.kdtree_depth = 0;
|
||||
|
||||
tie_work1(tie, &ray, &id, hitfunc, &hitdata);
|
||||
|
||||
/* use hitfunc to build the hit list */
|
||||
if(hitdata.nhits == 0)
|
||||
return 0;
|
||||
|
||||
return rt_bot_makesegs(hitdata.hits, hitdata.nhits, stp, rp, ap, seghead, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
bottie_free_double(void *vtie)
|
||||
{
|
||||
tie_free((struct tie_s *)vtie);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
@@ -0,0 +1,44 @@
|
||||
/* B T G . H
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2010-2010 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file btg.h
|
||||
*
|
||||
* the bot/tie glue.
|
||||
*
|
||||
*/
|
||||
|
||||
void bottie_push_double(void *vtie, TIE_3 **tri, unsigned int ntri, void *usr, unsigned int pstride);
|
||||
int bottie_prep_double(struct soltab *stp, struct rt_bot_internal *bot, struct rt_i *rtip);
|
||||
int bottie_shot_double(struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead);
|
||||
void bottie_free_double(void *vtie);
|
||||
|
||||
void bottie_push_float(void *vtie, float **tri, unsigned int ntri, void *usr, unsigned int pstride);
|
||||
int bottie_prep_float(struct soltab *stp, struct rt_bot_internal *bot, struct rt_i *rtip);
|
||||
int bottie_shot_float(struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead);
|
||||
void bottie_free_float(void *vtie);
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
@@ -0,0 +1,96 @@
|
||||
/* B T G F . C
|
||||
* BRL-CAD
|
||||
*
|
||||
* Copyright (c) 2010-2010 United States Government as represented by
|
||||
* the U.S. Army Research Laboratory.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* version 2.1 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this file; see the file named COPYING for more
|
||||
* information.
|
||||
*/
|
||||
/** @file btgf.c
|
||||
*
|
||||
* the bot/tie float glue.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#define TIE_PRECISION 0
|
||||
|
||||
#include "raytrace.h"
|
||||
#include "rtgeom.h"
|
||||
#include "tie.h"
|
||||
#include "btg.h"
|
||||
|
||||
#include "tie.c"
|
||||
#include "tie_kdtree.c"
|
||||
|
||||
void *
|
||||
bottie_allocn_float(unsigned long long ntri)
|
||||
{
|
||||
struct tie_s *tie;
|
||||
tie = bu_malloc(sizeof(struct tie_s), "TIE");
|
||||
if(tie == NULL)
|
||||
return NULL;
|
||||
|
||||
tie_init(tie, ntri, TIE_KDTREE_FAST);
|
||||
return (void *)tie;
|
||||
}
|
||||
|
||||
void
|
||||
bottie_push_float(void *UNUSED(vtie), float **UNUSED(tri), unsigned int UNUSED(ntri), void *UNUSED(usr), unsigned int UNUSED(pstride))
|
||||
{
|
||||
struct tie_s *tie = (struct tie_s *)vtie;
|
||||
tie = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
bottie_prep_float(struct soltab *stp,struct rt_bot_internal *bot, struct rt_i *UNUSED(rtip))
|
||||
{
|
||||
struct tie_s *tie = (struct tie_s *)bot->tie;
|
||||
|
||||
tie_prep(tie);
|
||||
VMOVE(stp->st_min, tie->min.v);
|
||||
VMOVE(stp->st_max, tie->max.v);
|
||||
VMOVE(stp->st_center, tie->mid);
|
||||
stp->st_bradius = stp->st_aradius = tie->radius;
|
||||
stp->st_specific = bot;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int
|
||||
hitfunc()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
bottie_shot_float(struct soltab *UNUSED(stp), register struct xray *UNUSED(rp), struct application *UNUSED(ap), struct seg *UNUSED(seghead))
|
||||
{
|
||||
/* use hitfunc to build the hit list */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* tab-width: 8
|
||||
* mode: C
|
||||
* indent-tabs-mode: t
|
||||
* c-file-style: "stroustrup"
|
||||
* End:
|
||||
* ex: shiftwidth=4 tabstop=8
|
||||
*/
|
||||
@@ -763,11 +763,14 @@ rt_tcl_setup(Tcl_Interp *interp)
|
||||
{
|
||||
extern size_t rt_bot_minpieces; /* from globals.c */
|
||||
extern size_t rt_bot_tri_per_piece; /* from globals.c */
|
||||
extern size_t rt_bot_mintie; /* from globals.c */
|
||||
|
||||
Tcl_LinkVar(interp, "rt_bot_minpieces", (char *)&rt_bot_minpieces, TCL_LINK_WIDE_INT);
|
||||
|
||||
Tcl_LinkVar(interp, "rt_bot_tri_per_piece",
|
||||
(char *)&rt_bot_tri_per_piece, TCL_LINK_WIDE_INT);
|
||||
|
||||
Tcl_LinkVar(interp, "rt_bot_mintie", (char *)&rt_bot_mintie, TCL_LINK_WIDE_INT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Executable → Regular
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user