BRL-CAD
soup.h
Go to the documentation of this file.
1 /* S O U P . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2011-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 
21 /** @file libgcv/soup.h
22  *
23  * BoT soup stuff
24  *
25  */
26 
27 #ifndef LIBGCV_SOUP_H
28 #define LIBGCV_SOUP_H
29 
30 #include "common.h"
31 
32 /* hijack the top four bits of mode. For these operations, the mode should
33  * necessarily be 0x02 */
34 #define INSIDE 0x01
35 #define OUTSIDE 0x02
36 #define SAME 0x04
37 #define OPPOSITE 0x08
38 #define INVERTED 0x10
39 
40 #define SOUP_MAGIC 0x534F5550 /* SOUP, 32b */
41 #define SOUP_CKMAG(_ptr) BU_CKMAG(_ptr, SOUP_MAGIC, "soup")
42 
43 struct face_s {
44  point_t vert[3], min, max;
45  plane_t plane;
46  uint32_t foo;
47 };
48 
49 struct soup_s {
50  uint32_t magic;
51  struct face_s *faces;
52  unsigned long int nfaces, maxfaces;
53 };
54 
56 
57 GCV_EXPORT int soup_add_face(struct soup_s *s, point_t a, point_t b, point_t c, const struct bn_tol *tol);
58 GCV_EXPORT int split_face_single(struct soup_s *s, unsigned long int fid, point_t isectpt[2], struct face_s *opp_face, const struct bn_tol *tol);
59 GCV_EXPORT int split_face(struct soup_s *left, unsigned long int left_face, struct soup_s *right, unsigned long int right_face, const struct bn_tol *tol);
60 GCV_EXPORT int gcv_tri_tri_intersect_with_isectline(struct soup_s *left, struct soup_s *right, struct face_s *lf, struct face_s *rf, int *coplanar, point_t *isectpt, const struct bn_tol *tol);
61 GCV_EXPORT union tree *compose(union tree *left_tree, union tree *right_tree, unsigned long int face_status1, unsigned long int face_status2, unsigned long int face_status3);
62 GCV_EXPORT union tree *invert(union tree *tree);
63 GCV_EXPORT union tree *evaluate(union tree *tr, const struct rt_tess_tol *ttol, const struct bn_tol *tol);
64 
66 
67 #endif /* LIBGCV_SOUP_H */
68 
69 /*
70  * Local Variables:
71  * tab-width: 8
72  * mode: C
73  * indent-tabs-mode: t
74  * c-file-style: "stroustrup"
75  * End:
76  * ex: shiftwidth=4 tabstop=8
77  */
union tree * compose(union tree *left_tree, union tree *right_tree, unsigned long int face_status1, unsigned long int face_status2, unsigned long int face_status3)
Definition: bottess.c:369
if lu s
Definition: nmg_mod.c:3860
point_t vert[3]
Definition: soup.h:44
union tree * invert(union tree *tree)
Definition: bottess.c:304
point_t min
Definition: soup.h:44
Header file for the BRL-CAD common definitions.
Definition: soup.h:43
uint32_t magic
Definition: soup.h:50
int split_face_single(struct soup_s *s, unsigned long int fid, point_t isectpt[2], struct face_s *opp_face, const struct bn_tol *tol)
Definition: bottess.c:115
#define __BEGIN_DECLS
Definition: common.h:73
plane_t plane
Definition: soup.h:45
Support for uniform tolerances.
Definition: tol.h:71
union tree * evaluate(union tree *tr, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
Definition: bottess.c:409
point_t max
Definition: soup.h:44
int split_face(struct soup_s *left, unsigned long int left_face, struct soup_s *right, unsigned long int right_face, const struct bn_tol *tol)
Definition: bottess.c:248
uint32_t foo
Definition: soup.h:46
int soup_add_face(struct soup_s *s, point_t a, point_t b, point_t c, const struct bn_tol *tol)
Definition: bottess.c:101
#define __END_DECLS
Definition: common.h:74
int gcv_tri_tri_intersect_with_isectline(struct soup_s *left, struct soup_s *right, struct face_s *lf, struct face_s *rf, int *coplanar, point_t *isectpt, const struct bn_tol *tol)
struct face_s * faces
Definition: soup.h:51
unsigned long int maxfaces
Definition: soup.h:52
Definition: soup.h:49
unsigned long int nfaces
Definition: soup.h:52