BRL-CAD
view.h
Go to the documentation of this file.
1/* V I E W . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2008-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/** @addtogroup ged_view
21 *
22 * Geometry EDiting Library Database View Related Functions.
23 *
24 */
25/** @{ */
26/** @file ged/view.h */
27
28#ifndef GED_VIEW_H
29#define GED_VIEW_H
30
31#include "common.h"
32#include "ged/defines.h"
33#include "bg/polygon.h"
34#include "ged/view/adc.h"
35#include "ged/view/matrix.h"
36#include "ged/view/select.h"
37#include "ged/view/state.h"
38
39__BEGIN_DECLS
40
41
42/** Check if a drawable exists */
43#define GED_CHECK_DRAWABLE(_gedp, _flags) \
44 if (_gedp->ged_gdp == GED_DRAWABLE_NULL) { \
45 int ged_check_drawable_quiet = (_flags) & GED_QUIET; \
46 if (!ged_check_drawable_quiet) { \
47 bu_vls_trunc((_gedp)->ged_result_str, 0); \
48 bu_vls_printf((_gedp)->ged_result_str, "A drawable does not exist."); \
49 } \
50 return (_flags); \
51 }
52
53/** Check if a view exists */
54#define GED_CHECK_VIEW(_gedp, _flags) \
55 if (_gedp->ged_gvp == GED_VIEW_NULL) { \
56 int ged_check_view_quiet = (_flags) & GED_QUIET; \
57 if (!ged_check_view_quiet) { \
58 bu_vls_trunc((_gedp)->ged_result_str, 0); \
59 bu_vls_printf((_gedp)->ged_result_str, "A view does not exist."); \
60 } \
61 return (_flags); \
62 }
63
66 void *u_data;
67};
68/* Check ged_bv data associated with a display list */
69GED_EXPORT extern unsigned long long ged_dl_hash(struct display_list *dl);
70
71
72/* defined in display_list.c */
73GED_EXPORT void dl_set_iflag(struct bu_list *hdlp, int iflag);
74GED_EXPORT extern void dl_color_soltab(struct bu_list *hdlp);
75GED_EXPORT extern void dl_erasePathFromDisplay(struct ged *gedp, const char *path, int allow_split);
76GED_EXPORT extern struct display_list *dl_addToDisplay(struct bu_list *hdlp, struct db_i *dbip, const char *name);
77
78GED_EXPORT extern int invent_solid(struct ged *gedp, char *name, struct bu_list *vhead, long int rgb, int copy, fastf_t transparency, int dmode, int csoltab);
79
80/**
81 * Grid utility command.
82 */
83GED_EXPORT extern int ged_grid(struct ged *gedp, int argc, const char *argv[]);
84
85/**
86 * Convert grid coordinates to model coordinates.
87 */
88GED_EXPORT extern int ged_grid2model_lu(struct ged *gedp, int argc, const char *argv[]);
89
90/**
91 * Convert grid coordinates to view coordinates.
92 */
93GED_EXPORT extern int ged_grid2view_lu(struct ged *gedp, int argc, const char *argv[]);
94
95/**
96 * Overlay the specified 2D/3D UNIX plot file
97 */
98GED_EXPORT extern int ged_overlay(struct ged *gedp, int argc, const char *argv[]);
99
100/**
101 * Create a unix plot file of the currently displayed objects.
102 */
103GED_EXPORT extern int ged_plot(struct ged *gedp, int argc, const char *argv[]);
104
105/**
106 * Create a png file of the view.
107 */
108GED_EXPORT extern int ged_png(struct ged *gedp, int argc, const char *argv[]);
109GED_EXPORT extern int ged_screen_grab(struct ged *gedp, int argc, const char *argv[]);
110
111/**
112 * Create a postscript file of the view.
113 */
114GED_EXPORT extern int ged_ps(struct ged *gedp, int argc, const char *argv[]);
115
116/**
117 * Returns the solid table & vector list as a string
118 */
119GED_EXPORT extern int ged_solid_report(struct ged *gedp, int argc, const char *argv[]);
120
121/**
122 * Save the view
123 */
124GED_EXPORT extern int ged_saveview(struct ged *gedp, int argc, const char *argv[]);
125
126
127/**
128 * Return the object hierarchy for all object(s) specified or for all currently displayed
129 */
130GED_EXPORT extern int ged_tree(struct ged *gedp, int argc, const char *argv[]);
131
132
133/**
134 * Vector drawing utility.
135 */
136GED_EXPORT extern int ged_vdraw(struct ged *gedp, int argc, const char *argv[]);
137
138/**
139 * Get/set view attributes
140 */
141GED_EXPORT extern int ged_view_func(struct ged *gedp, int argc, const char *argv[]);
142
143/**
144 * Get/set the unix plot output mode
145 */
146GED_EXPORT extern int ged_set_uplotOutputMode(struct ged *gedp, int argc, const char *argv[]);
147
148GED_EXPORT extern int ged_export_polygon(struct ged *gedp, bv_data_polygon_state *gdpsp, size_t polygon_i, const char *sname);
149GED_EXPORT extern struct bg_polygon *ged_import_polygon(struct ged *gedp, const char *sname);
150GED_EXPORT extern int ged_polygons_overlap(struct ged *gedp, struct bg_polygon *polyA, struct bg_polygon *polyB);
151GED_EXPORT extern void ged_polygon_fill_segments(struct ged *gedp, struct bg_polygon *poly, vect2d_t vfilldir, fastf_t vfilldelta);
152
153__END_DECLS
154
155#endif /* GED_VIEW_H */
156
157/** @} */
158
159/*
160 * Local Variables:
161 * tab-width: 8
162 * mode: C
163 * indent-tabs-mode: t
164 * c-file-style: "stroustrup"
165 * End:
166 * ex: shiftwidth=4 tabstop=8
167 */
Header file for the BRL-CAD common definitions.
int ged_vdraw(struct ged *gedp, int argc, const char *argv[])
int ged_grid2view_lu(struct ged *gedp, int argc, const char *argv[])
int ged_screen_grab(struct ged *gedp, int argc, const char *argv[])
void ged_polygon_fill_segments(struct ged *gedp, struct bg_polygon *poly, vect2d_t vfilldir, fastf_t vfilldelta)
int ged_polygons_overlap(struct ged *gedp, struct bg_polygon *polyA, struct bg_polygon *polyB)
void dl_set_iflag(struct bu_list *hdlp, int iflag)
int ged_saveview(struct ged *gedp, int argc, const char *argv[])
int ged_tree(struct ged *gedp, int argc, const char *argv[])
int invent_solid(struct ged *gedp, char *name, struct bu_list *vhead, long int rgb, int copy, fastf_t transparency, int dmode, int csoltab)
int ged_export_polygon(struct ged *gedp, bv_data_polygon_state *gdpsp, size_t polygon_i, const char *sname)
unsigned long long ged_dl_hash(struct display_list *dl)
int ged_grid2model_lu(struct ged *gedp, int argc, const char *argv[])
int ged_ps(struct ged *gedp, int argc, const char *argv[])
int ged_grid(struct ged *gedp, int argc, const char *argv[])
int ged_set_uplotOutputMode(struct ged *gedp, int argc, const char *argv[])
void dl_color_soltab(struct bu_list *hdlp)
struct display_list * dl_addToDisplay(struct bu_list *hdlp, struct db_i *dbip, const char *name)
int ged_solid_report(struct ged *gedp, int argc, const char *argv[])
struct bg_polygon * ged_import_polygon(struct ged *gedp, const char *sname)
int ged_plot(struct ged *gedp, int argc, const char *argv[])
void dl_erasePathFromDisplay(struct ged *gedp, const char *path, int allow_split)
int ged_view_func(struct ged *gedp, int argc, const char *argv[])
int ged_overlay(struct ged *gedp, int argc, const char *argv[])
int ged_png(struct ged *gedp, int argc, const char *argv[])
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:330
fastf_t vect2d_t[ELEMENTS_PER_VECT2D]
2-tuple vector
Definition: vmath.h:333
Definition: list.h:131
struct db_full_path s_fullpath
Definition: view.h:65
void * u_data
Definition: view.h:66
Definition: defines.h:195