BRL-CAD
snap.h
Go to the documentation of this file.
1 /* S N A P . H
2  * BRL-CAD
3  *
4  * Copyright (c) 1993-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 /** @addtogroup bv_snap
21  *
22  */
23 /** @{ */
24 /** @file bv/snap.h */
25 
26 #ifndef BV_SNAP_H
27 #define BV_SNAP_H
28 
29 #include "common.h"
30 #include "vmath.h"
31 #include "bv/defines.h"
32 
33 __BEGIN_DECLS
34 
35 /* Logic for snapping points to their closes view lines. */
36 
37 /* Snap sample 2D point to lines active in the view. If populated,
38  * v->gv_s->gv_snap_objs contains a subset of bv_scene_obj pointers indicating
39  * which view objects to consider for snapping. If nonzero,
40  * v->gv_s->gv_snap_flags also tells the routine which categories of objects to
41  * consider - objs objects will also be evaluated against the flags before
42  * being used. */
43 BV_EXPORT extern int bv_snap_lines_2d(struct bview *v, fastf_t *fx, fastf_t *fy);
44 
45 BV_EXPORT extern void bv_view_center_linesnap(struct bview *v);
46 
47 BV_EXPORT extern int bv_snap_lines_3d(point_t *out_pt, struct bview *v, point_t *p);
48 BV_EXPORT extern int bv_snap_grid_2d(struct bview *v, fastf_t *fx, fastf_t *fy);
49 
50 __END_DECLS
51 
52 #endif /* BV_SNAP_H */
53 
54 /** @} */
55 /*
56  * Local Variables:
57  * mode: C
58  * tab-width: 8
59  * indent-tabs-mode: t
60  * c-file-style: "stroustrup"
61  * End:
62  * ex: shiftwidth=4 tabstop=8
63  */
Header file for the BRL-CAD common definitions.
void float float * fy
Definition: tig.h:283
void float * fx
Definition: tig.h:282
int bv_snap_lines_3d(point_t *out_pt, struct bview *v, point_t *p)
int bv_snap_grid_2d(struct bview *v, fastf_t *fx, fastf_t *fy)
int bv_snap_lines_2d(struct bview *v, fastf_t *fx, fastf_t *fy)
void bv_view_center_linesnap(struct bview *v)
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:334
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
Definition: defines.h:489
fundamental vector, matrix, quaternion math macros