BRL-CAD
clip.h
Go to the documentation of this file.
1 /* C L I P . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-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 /*----------------------------------------------------------------------*/
22 /* @file clip.h */
23 /** @addtogroup clip */
24 /** @{ */
25 
26 /**
27  * @brief Clipping functions
28  */
29 
30 #ifndef BN_CLIP_H
31 #define BN_CLIP_H
32 
33 #include "common.h"
34 #include "vmath.h"
35 #include "bn/defines.h"
36 
38 
39 /**
40  * @brief
41  * Clip a 2-D integer line seg against the size of the display
42  */
43 BN_EXPORT extern int bn_lseg_clip(fastf_t *xp1, fastf_t *yp1, fastf_t *xp2, fastf_t *yp2, fastf_t clip_min, fastf_t clip_max);
44 
45 /**
46  * @brief
47  * Clip a ray against a rectangular parallelepiped (RPP)
48  * that has faces parallel to the coordinate planes (a clipping RPP).
49  * The RPP is defined by a minimum point and a maximum point.
50  *
51  * Returns -
52  * 0 if ray does not hit RPP,
53  * !0 if ray hits RPP.
54  *
55  * Implicit Return -
56  * if !0 was returned, "a" and "b" have been clipped to the RPP.
57  */
58 BN_EXPORT extern int bn_ray_vclip(vect_t a, vect_t b, fastf_t *min, fastf_t *max);
59 
61 
62 #endif /* BN_CLIP_H */
63 /** @} */
64 /*
65  * Local Variables:
66  * mode: C
67  * tab-width: 8
68  * indent-tabs-mode: t
69  * c-file-style: "stroustrup"
70  * End:
71  * ex: shiftwidth=4 tabstop=8
72  */
Header file for the BRL-CAD common definitions.
#define __BEGIN_DECLS
Definition: common.h:73
int bn_lseg_clip(fastf_t *xp1, fastf_t *yp1, fastf_t *xp2, fastf_t *yp2, fastf_t clip_min, fastf_t clip_max)
Clipping functions.
Definition: clip.c:61
int bn_ray_vclip(vect_t a, vect_t b, fastf_t *min, fastf_t *max)
Clip a ray against a rectangular parallelepiped (RPP) that has faces parallel to the coordinate plane...
Definition: clip.c:127
#define __END_DECLS
Definition: common.h:74
double fastf_t
Definition: defines.h:300