BRL-CAD
tclcad.h
Go to the documentation of this file.
1 /* T C L C A D . 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 /** @addtogroup libtclcad */
21 /** @{ */
22 /** @file tclcad.h
23  *
24  * @brief
25  * Header file for the BRL-CAD TclCAD Library, LIBTCLCAD.
26  *
27  * This library contains convenience routines for preparing and
28  * initializing Tcl.
29  *
30  */
31 
32 #ifndef TCLCAD_H
33 #define TCLCAD_H
34 
35 #include "common.h"
36 #include "bu/cmd.h"
37 #include "tcl.h"
38 #include "dm.h"
39 #include "ged.h"
40 
41 #include "fbserv_obj.h"
42 
44 
45 #ifndef TCLCAD_EXPORT
46 # if defined(TCLCAD_DLL_EXPORTS) && defined(TCLCAD_DLL_IMPORTS)
47 # error "Only TCLCAD_DLL_EXPORTS or TCLCAD_DLL_IMPORTS can be defined, not both."
48 # elif defined(TCLCAD_DLL_EXPORTS)
49 # define TCLCAD_EXPORT __declspec(dllexport)
50 # elif defined(TCLCAD_DLL_IMPORTS)
51 # define TCLCAD_EXPORT __declspec(dllimport)
52 # else
53 # define TCLCAD_EXPORT
54 # endif
55 #endif
56 
57 #define TCLCAD_IDLE_MODE 0
58 #define TCLCAD_ROTATE_MODE 1
59 #define TCLCAD_TRANSLATE_MODE 2
60 #define TCLCAD_SCALE_MODE 3
61 #define TCLCAD_CONSTRAINED_ROTATE_MODE 4
62 #define TCLCAD_CONSTRAINED_TRANSLATE_MODE 5
63 #define TCLCAD_OROTATE_MODE 6
64 #define TCLCAD_OSCALE_MODE 7
65 #define TCLCAD_OTRANSLATE_MODE 8
66 #define TCLCAD_MOVE_ARB_EDGE_MODE 9
67 #define TCLCAD_MOVE_ARB_FACE_MODE 10
68 #define TCLCAD_ROTATE_ARB_FACE_MODE 11
69 #define TCLCAD_PROTATE_MODE 12
70 #define TCLCAD_PSCALE_MODE 13
71 #define TCLCAD_PTRANSLATE_MODE 14
72 #define TCLCAD_POLY_CIRCLE_MODE 15
73 #define TCLCAD_POLY_CONTOUR_MODE 16
74 #define TCLCAD_POLY_ELLIPSE_MODE 17
75 #define TCLCAD_POLY_RECTANGLE_MODE 18
76 #define TCLCAD_POLY_SQUARE_MODE 19
77 #define TCLCAD_RECTANGLE_MODE 20
78 #define TCLCAD_MOVE_METABALL_POINT_MODE 21
79 #define TCLCAD_MOVE_PIPE_POINT_MODE 22
80 #define TCLCAD_MOVE_BOT_POINT_MODE 23
81 #define TCLCAD_MOVE_BOT_POINTS_MODE 24
82 #define TCLCAD_DATA_MOVE_OBJECT_MODE 25
83 #define TCLCAD_DATA_MOVE_POINT_MODE 26
84 #define TCLCAD_DATA_SCALE_MODE 27
85 
86 #define TCLCAD_OBJ_FB_MODE_OFF 0
87 #define TCLCAD_OBJ_FB_MODE_UNDERLAY 1
88 #define TCLCAD_OBJ_FB_MODE_INTERLAY 2
89 #define TCLCAD_OBJ_FB_MODE_OVERLAY 3
90 
91 struct ged_dm_view {
92  struct bu_list l;
95  struct bu_vls gdv_name;
96  struct bview *gdv_view;
98  struct fbserv_obj gdv_fbs;
99  struct ged_obj *gdv_gop;
101 };
102 
103 struct ged_obj {
104  struct ged *go_gedp;
106  struct bu_vls go_name;
114  Tcl_Interp *interp;
116 };
117 #define GED_OBJ_NULL ((struct ged_obj *)0)
118 
119 
120 struct tclcad_obj {
121  struct bu_list l;
122  struct ged_obj *to_gop;
123  Tcl_Interp *to_interp;
124 };
125 
126 #define TCLCAD_OBJ_NULL (struct tclcad_obj *)0
127 
128 TCLCAD_EXPORT extern int tclcad_tk_setup(Tcl_Interp *interp);
129 TCLCAD_EXPORT extern void tclcad_auto_path(Tcl_Interp *interp);
130 TCLCAD_EXPORT extern void tclcad_tcl_library(Tcl_Interp *interp);
131 TCLCAD_EXPORT extern int Tclcad_Init(Tcl_Interp *interp);
132 
133 /* defined in tclcad_obj.c */
134 TCLCAD_EXPORT extern int Go_Init(Tcl_Interp *interp);
135 TCLCAD_EXPORT extern int to_open_tcl(ClientData UNUSED(clientData),
136  Tcl_Interp *interp,
137  int argc,
138  const char **argv);
139 TCLCAD_EXPORT extern struct application *to_rt_gettrees_application(struct ged *gedp,
140  int argc,
141  const char *argv[]);
142 TCLCAD_EXPORT extern void go_refresh(struct ged_obj *gop,
143  struct ged_dm_view *gdvp);
144 TCLCAD_EXPORT extern void go_refresh_draw(struct ged_obj *gop,
145  struct ged_dm_view *gdvp,
146  int restore_zbuffer);
147 
148 /* defined in cmdhist_obj.c */
149 TCLCAD_EXPORT extern int Cho_Init(Tcl_Interp *interp);
150 
151 /**
152  * Open a command history object.
153  *
154  * USAGE:
155  * ch_open name
156  */
157 TCLCAD_EXPORT extern int cho_open_tcl(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv);
158 
159 
160 /**
161  * This is a convenience routine for registering an array of commands
162  * with a Tcl interpreter. Note - this is not intended for use by
163  * commands with associated state (i.e. ClientData). The interp is
164  * passed to the bu_cmdtab function as clientdata instead of the
165  * bu_cmdtab entry.
166  *
167  * @param interp - Tcl interpreter wherein to register the commands
168  * @param cmds - commands and related function pointers
169  *
170  * @return
171  * void
172  */
173 TCLCAD_EXPORT extern void tclcad_register_cmds(Tcl_Interp *interp, struct bu_cmdtab *cmds);
174 
176 
177 #endif /* TCLCAD_H */
178 /** @} */
179 /*
180  * Local Variables:
181  * mode: C
182  * tab-width: 8
183  * indent-tabs-mode: t
184  * c-file-style: "stroustrup"
185  * End:
186  * ex: shiftwidth=4 tabstop=8
187  */
struct application * to_rt_gettrees_application(struct ged *gedp, int argc, const char *argv[])
Definition: tclcad_obj.c:14708
Definition: cmd.h:48
Definition: list.h:118
ustring interp
struct bu_list l
Definition: tclcad.h:92
struct bu_vls gdv_edit_motion_delta_callback
Definition: tclcad.h:94
Definition: ged.h:338
struct bu_vls gdv_callback
Definition: tclcad.h:93
struct bu_hash_tbl * go_edited_paths
Definition: tclcad.h:115
struct bu_vls go_name
Definition: tclcad.h:106
int go_prim_label_list_size
Definition: tclcad.h:111
void go_refresh_draw(struct ged_obj *gop, struct ged_dm_view *gdvp, int restore_zbuffer)
Definition: tclcad_obj.c:14623
struct bu_observer go_observers
Definition: tclcad.h:107
Definition: bview.h:209
Header file for the BRL-CAD common definitions.
struct ged * go_gedp
Definition: tclcad.h:104
int Tclcad_Init(Tcl_Interp *interp)
Definition: tclcad.c:83
struct bu_vls gdv_name
Definition: tclcad.h:95
Tcl_Interp * interp
Definition: tclcad.h:114
dm * gdv_dmp
Definition: tclcad.h:97
int gdv_hide_view
Definition: tclcad.h:100
int tclcad_tk_setup(Tcl_Interp *interp)
int Cho_Init(Tcl_Interp *interp)
Definition: cmdhist_obj.c:160
void tclcad_register_cmds(Tcl_Interp *interp, struct bu_cmdtab *cmds)
Definition: tclcad.c:72
struct bu_vls go_rt_end_callback
Definition: tclcad.h:109
void go_refresh(struct ged_obj *gop, struct ged_dm_view *gdvp)
Definition: tclcad_obj.c:14606
#define __BEGIN_DECLS
Definition: common.h:73
int Go_Init(Tcl_Interp *interp)
create the Tcl command for to_open
Definition: tclcad_obj.c:1421
int go_refresh_on
Definition: tclcad.h:112
struct bview * gdv_view
Definition: tclcad.h:96
struct bu_vls * go_prim_label_list
Definition: tclcad.h:110
#define UNUSED(parameter)
Definition: common.h:239
int cho_open_tcl(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv)
Definition: cmdhist_obj.c:123
struct bu_list l
Definition: tclcad.h:121
int to_open_tcl(ClientData clientData, Tcl_Interp *interp, int argc, const char **argv)
A TCL interface to wdb_fopen() and wdb_dbopen().
Definition: tclcad_obj.c:1623
struct ged_dm_view go_head_views
Definition: tclcad.h:105
struct fbserv_obj gdv_fbs
Definition: tclcad.h:98
struct bu_vls go_more_args_callback
Definition: tclcad.h:108
#define __END_DECLS
Definition: common.h:74
void tclcad_auto_path(Tcl_Interp *interp)
Tcl_Interp * to_interp
Definition: tclcad.h:123
struct ged_obj * gdv_gop
Definition: tclcad.h:99
Definition: vls.h:56
void tclcad_tcl_library(Tcl_Interp *interp)
int go_dlist_on
Definition: tclcad.h:113
struct ged_obj * to_gop
Definition: tclcad.h:122