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-2023 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 */
40
typedef
enum
{
bg_Union
,
bg_Difference
,
bg_Intersection
,
bg_Xor
}
bg_clip_t
;
41
42
struct
bg_poly_contour
{
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
;
51
struct
bg_poly_contour
*
contour
;
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 */
58
int
gp_line_style
;
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
;
65
struct
bg_polygon
*
polygon
;
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
*/
common.h
Header file for the BRL-CAD common definitions.
bg_clip_t
bg_clip_t
Functions for working with polygons.
Definition:
polygon_types.h:40
bg_Intersection
@ bg_Intersection
Definition:
polygon_types.h:40
bg_Xor
@ bg_Xor
Definition:
polygon_types.h:40
bg_Difference
@ bg_Difference
Definition:
polygon_types.h:40
bg_Union
@ bg_Union
Definition:
polygon_types.h:40
point_t
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition:
vmath.h:351
bg_poly_contour
Definition:
polygon_types.h:42
bg_poly_contour::open
int open
Definition:
polygon_types.h:45
bg_poly_contour::num_points
size_t num_points
Definition:
polygon_types.h:43
bg_poly_contour::point
point_t * point
Definition:
polygon_types.h:44
bg_polygon
Definition:
polygon_types.h:48
bg_polygon::num_contours
size_t num_contours
Definition:
polygon_types.h:49
bg_polygon::gp_color
int gp_color[3]
Definition:
polygon_types.h:56
bg_polygon::gp_line_width
int gp_line_width
Definition:
polygon_types.h:57
bg_polygon::contour
struct bg_poly_contour * contour
Definition:
polygon_types.h:51
bg_polygon::gp_line_style
int gp_line_style
Definition:
polygon_types.h:58
bg_polygon::hole
int * hole
Definition:
polygon_types.h:50
bg_polygons
Definition:
polygon_types.h:63
bg_polygons::polygon
struct bg_polygon * polygon
Definition:
polygon_types.h:65
bg_polygons::num_polygons
size_t num_polygons
Definition:
polygon_types.h:64
vmath.h
fundamental vector, matrix, quaternion math macros
include
bg
polygon_types.h
Generated on Tue Mar 7 2023 23:41:49 for BRL-CAD by
1.9.3