BRL-CAD
polygon_types.h
Go to the documentation of this file.
1 /* P O L Y G O N _ T Y P E S. H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2024 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 /*----------------------------------------------------------------------*/
22 /* @file polygon_types.h */
23 /** @addtogroup bg_polygon */
24 /** @{ */
25 
26 /**
27  * @brief Functions for working with polygons
28  */
29 
30 #ifndef BG_POLYGON_TYPES_H
31 #define BG_POLYGON_TYPES_H
32 
33 #include "common.h"
34 #include "vmath.h"
35 
36 __BEGIN_DECLS
37 
38 /* The following data types are originally from bv - we keep them
39  * separate here to maximize their ease of reuse */
41 
43  size_t num_points;
44  point_t *point; /* in model coordinates */
45  int open; /* 0 = closed, 1 = open */
46 };
47 
48 struct bg_polygon {
49  size_t num_contours;
50  int *hole;
52 
53  // TODO - in principle these shouldn't be here, but the libtclcad code uses
54  // them so it will take some thought to refactor them up from this
55  // container...
56  int gp_color[3];
57  int gp_line_width; /* in pixels */
59 };
60 
61 #define BG_POLYGON_NULL {0, NULL, NULL, {0, 0, 0}, 0, 0}
62 
63 struct bg_polygons {
64  size_t num_polygons;
66 };
67 
68 __END_DECLS
69 
70 #endif /* BG_POLYGON_TYPES_H */
71 /** @} */
72 /*
73  * Local Variables:
74  * mode: C
75  * tab-width: 8
76  * indent-tabs-mode: t
77  * c-file-style: "stroustrup"
78  * End:
79  * ex: shiftwidth=4 tabstop=8
80  */
Header file for the BRL-CAD common definitions.
bg_clip_t
Functions for working with polygons.
Definition: polygon_types.h:40
@ bg_Intersection
Definition: polygon_types.h:40
@ bg_Xor
Definition: polygon_types.h:40
@ bg_None
Definition: polygon_types.h:40
@ bg_Difference
Definition: polygon_types.h:40
@ bg_Union
Definition: polygon_types.h:40
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
point_t * point
Definition: polygon_types.h:44
size_t num_contours
Definition: polygon_types.h:49
todo in principle these shouldn t be but the libtclcad code uses int gp_color[3]
Definition: polygon_types.h:57
int gp_line_width
Definition: polygon_types.h:58
struct bg_poly_contour * contour
Definition: polygon_types.h:51
int gp_line_style
Definition: polygon_types.h:59
struct bg_polygon * polygon
Definition: polygon_types.h:66
size_t num_polygons
Definition: polygon_types.h:65
fundamental vector, matrix, quaternion math macros