amino  1.0-beta2
Lightweight Robot Utility Library
scene_win.h
Go to the documentation of this file.
1 /* -*- mode: C; c-basic-offset: 4; -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2015, Rice University
5  * Copyright (c) 2019, Colorado School of Mines
6  * All rights reserved.
7  *
8  * Author(s): Neil T. Dantam <ntd@rice.edu>
9  *
10  * Redistribution and use in source and binary forms, with or
11  * without modification, are permitted provided that the following
12  * conditions are met:
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of copyright holder the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
28  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
31  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #ifndef AMINO_RX_SCENE_WIN_H
40 #define AMINO_RX_SCENE_WIN_H
41 
42 #include <SDL.h>
43 
44 
45 
46 struct aa_rx_sg_sub;
47 
63 AA_API struct aa_rx_win *
65  const char* title,
66  int x_pos,
67  int y_pos,
68  int width,
69  int height,
70  Uint32 flags );
71 
81 AA_API struct aa_rx_win *
83  const char* title, int width, int height );
84 
85 
89 AA_API void
91 
102 AA_API struct aa_gl_globals *
104 
105 
113 AA_API void
115  const struct aa_rx_sg *sg );
116 
127 AA_API void
129  const struct aa_rx_sg_sub *sg_sub );
130 
134 AA_API const struct aa_rx_sg *
135 aa_rx_win_get_sg( struct aa_rx_win * win );
136 
140 AA_API void
142  const struct aa_rx_sg *scenegraph,
143  size_t n_q, const double *q );
144 
145 
149 AA_API void
151  const struct aa_rx_sg *scenegraph,
152  size_t n_tf, const double *tf_abs, size_t ld_tf );
153 
154 
158 AA_API void
160  const struct aa_rx_fk *fk );
161 
168 AA_API void
170  size_t n,
171  const double *q );
172 
179 AA_API void
181  const struct aa_dvec *q );
182 
196 AA_API void
198  aa_sdl_win_display_fun display,
199  void *context,
200  void (*destructor)(void*) );
201 
205 AA_API void
207  struct aa_rx_sg *sg,
208  size_t n_plan_elements,
209  const double *plan );
210 
211 struct aa_rx_mp_seq;
212 
216 AA_API void
217 aa_rx_win_set_display_seq( struct aa_rx_win * win, struct aa_rx_mp_seq *mp_seq);
218 
229 AA_API void aa_rx_win_run( void );
230 
231 
244 
251 AA_API void
252 aa_rx_win_stop( struct aa_rx_win * win );
253 
257 AA_API int
259 
260 
264 AA_API void
265 aa_rx_win_stop_on_quit( struct aa_rx_win * win, int value );
266 
273 AA_API void
274 aa_rx_win_lock( struct aa_rx_win * win );
275 
279 AA_API void
280 aa_rx_win_unlock( struct aa_rx_win * win );
281 
287 AA_API void
289  struct aa_rx_sg *sg );
290 
291 
298 AA_API void
299 aa_rx_win_get_tf_cam( struct aa_rx_win * win, double *E );
300 
307 AA_API void
308 aa_rx_win_set_tf_cam( struct aa_rx_win * win, const double *E );
309 
310 
311 #endif /*AMINO_RX_SCENE_WIN_H*/
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
int(* aa_sdl_win_display_fun)(struct aa_rx_win *win, void *context, struct aa_sdl_display_params *params)
Display handler function for amino windows to call in SDL loop.
Definition: rxtype.h:123
AA_API void aa_rx_win_set_bconfig(struct aa_rx_win *win, const struct aa_dvec *q)
Set the configuration vector (block-vector version) for the window.
AA_API struct aa_rx_win * aa_rx_win_create(const char *title, int x_pos, int y_pos, int width, int height, Uint32 flags)
Create a new SDL / OpenGL window.
AA_API void aa_rx_win_set_sg(struct aa_rx_win *win, const struct aa_rx_sg *sg)
Set a scenegraph for the window.
AA_API void aa_rx_win_get_tf_cam(struct aa_rx_win *win, double *E)
Return the current camera pose.
AA_API void aa_rx_win_display_sg_config(struct aa_rx_win *win, struct aa_sdl_display_params *params, const struct aa_rx_sg *scenegraph, size_t n_q, const double *q)
Render a scenegraph at the given configuration in the window.
AA_API void aa_rx_win_display_fk(struct aa_rx_win *win, struct aa_sdl_display_params *params, const struct aa_rx_fk *fk)
Display a scene graph in the window with the forward kinematics.
AA_API void aa_rx_win_set_sg_sub(struct aa_rx_win *win, const struct aa_rx_sg_sub *sg_sub)
Set a sub-scenegraph for the window.
AA_API void aa_rx_win_set_display_seq(struct aa_rx_win *win, struct aa_rx_mp_seq *mp_seq)
Display a sequence of motion plans.
AA_API void aa_rx_win_set_tf_cam(struct aa_rx_win *win, const double *E)
Set the camera pose.
AA_API struct aa_rx_win * aa_rx_win_default_create(const char *title, int width, int height)
Create a new SDL / OpenGL window with default parameters.
AA_API void aa_rx_win_destroy(struct aa_rx_win *win)
Destroy SDL / OpenGL window.
AA_API void aa_rx_win_run(void)
Synchronous display using current thread.
AA_API void aa_rx_win_run_async(void)
Asynchronous run the display in a new current thread.
AA_API void aa_rx_win_set_display(struct aa_rx_win *win, aa_sdl_win_display_fun display, void *context, void(*destructor)(void *))
Set the window's display function.
AA_API void aa_rx_win_display_sg_tf(struct aa_rx_win *win, struct aa_sdl_display_params *params, const struct aa_rx_sg *scenegraph, size_t n_tf, const double *tf_abs, size_t ld_tf)
Display a scene graph in the window with the given transforms.
AA_API void aa_rx_win_stop_on_quit(struct aa_rx_win *win, int value)
Instruct the rendering thread to stop when the user closes the window.
AA_API int aa_rx_win_is_running(struct aa_rx_win *win)
Return true if the window is still running.
AA_API void aa_rx_win_sg_gl_init(struct aa_rx_win *win, struct aa_rx_sg *sg)
Initialize scenegraph GL values for the given window.
AA_API struct aa_gl_globals * aa_rx_win_gl_globals(struct aa_rx_win *win)
Return a pointer to the window's GL globals struct.
AA_API void aa_rx_win_set_display_plan(struct aa_rx_win *win, struct aa_rx_sg *sg, size_t n_plan_elements, const double *plan)
Display a motion plan in the window.
AA_API void aa_rx_win_unlock(struct aa_rx_win *win)
Unlock the window.
AA_API void aa_rx_win_lock(struct aa_rx_win *win)
Lock the window.
AA_API void aa_rx_win_set_config(struct aa_rx_win *win, size_t n, const double *q)
Set the configuration vector for the window.
AA_API void aa_rx_win_stop(struct aa_rx_win *win)
Instruct the rendering thread to stop.
AA_API const struct aa_rx_sg * aa_rx_win_get_sg(struct aa_rx_win *win)
Retreive the scene graph for the window.
Descriptor for a vector.
Definition: mat.h:63
Opaque type for a scene_graph.
Opaque type for a window.
Definition: rxtype.h:88
Parameters for SDL display function.
Definition: rxtype.h:95