OpenFrames
OF_Interface.h
Go to the documentation of this file.
1 /***********************************
2  Copyright 2018 Ravishankar Mathur
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 ***********************************/
16 
17 #ifndef _OF_FORTRAN_
18 #define _OF_FORTRAN_
19 
20 #include <OpenFrames/Export.h>
21 
22 // Macro to handle compiler function name mangling
23 #if defined(GFORTRAN_CALLS)
24  #define OF_FCN(name) name##__
26 #else
27  #define OF_FCN(name) name
30 #endif
31 
32 // Macros to handle Fortran hidden string length arguments
33 
36 
39 
40 #if defined(GFORTRAN_CALLS) || defined(IFORT_CALLS)
41  // Fortran compilers pass hidden char array lengths
42  #define OF_CHARARG(name) const char *name, unsigned int name##len
43  #define OF_STRING(name) name, name##len
44 #else
45  #define OF_CHARARG(name) const char *name
46  #define OF_STRING(name) name
47 #endif
48 
49 // Define shortcuts for callback function signatures
51 #define BASIC_CALLBACK_SIG unsigned int *winID, unsigned int *row, unsigned int *col
52 
53 #define KEYPRESS_SIG BASIC_CALLBACK_SIG, int *key
54 
55 #define MOUSEMOTION_SIG BASIC_CALLBACK_SIG, float *x, float *y
56 
57 #define BUTTON_SIG MOUSEMOTION_SIG, unsigned int *button
58 
59 // Make sure this header can be used by "pure" C compilers (e.g. Matlab)
60 #ifdef __cplusplus
61 extern "C"
62 {
63 #endif
64 
82 // Must be called before using OpenFrames
83 // Sets up all internal data
84 OF_EXPORT void OF_FCN(of_initialize)();
85 
86 // Must be called when done using OpenFrames
87 // Cleans up all internal data
88 OF_EXPORT void OF_FCN(of_cleanup)();
89 
90 /*
91  * \brief Get the return value returned by the most recent API function call.
92  *
93  * Functions return zero to indicate success, and non-zero to indicate an error.
94  * \warning DO NOT call of_getreturnedvalue after calling of_cleanup.
95  * of_cleanup sets the pointer for _objs to NULL, which would be dereferenced by this function.
96  *
97  * \param val variable to store the return value from the previous API function call.
98  */
99 OF_EXPORT void OF_FCN(of_getreturnedvalue)(int *val);
100 
101 /***********************************************************************
102  Window Functions
103 ***********************************************************************/
104 // Set the current active WindowProxy
105 
106 /*
107  * \brief Set the active WindowProxy
108  *
109  * \param[out] id ID of the window to activate.
110  */
111 OF_EXPORT void OF_FCN(ofwin_activate)(unsigned int *id);
112 
113 /*
114  * \brief Get ID of the active WindowProxy
115  *
116  * \param[out] retid ID of the active window.
117  */
118 OF_EXPORT void OF_FCN(ofwin_getid)(unsigned int *retid);
119 
120 /*
121  * \brief Create a new WindowProxy that will manage drawing onto a window.
122  *
123  * This new WindowProxy will also become the current active one.
124  *
125  * \param x X-coordinate (in pixels) of the screen of the upper-right corner of the window.
126  * \param y Y-coordinate (in pixels) of the screen of the upper-right corner of the window.
127  * \param width Width of the window (in pixels).
128  * \param height Height of the window (in pixels).
129  * \param nrow Number of rows in the window grid.
130  * \param ncol Number of columns in the window grid.
131  * \param embedded True if the user wants to provide their own OpenGL window.
132  * \param id ID of this window.
133  */
134 OF_EXPORT void OF_FCN(ofwin_createproxy)(int *x, int *y,
135  unsigned int *width, unsigned int *height,
136  unsigned int *nrow, unsigned int *ncol,
137  bool *embedded, unsigned int *id);
138 
139 /*
140  * \brief Set the window name (title). Only applies to non-embedded windows.
141  *
142  * \param winname The new window name.
143  */
144 OF_EXPORT void OF_FCN(ofwin_setwindowname)(OF_CHARARG(winname));
145 
146 /*
147  * \brief Set the number rows and columns in the grid.
148  *
149  * This applies to the current active WindowProxy.
150  *
151  * \param nrow Number of rows in the window grid.
152  * \param ncol Number of columns in the window grid.
153  */
154 OF_EXPORT void OF_FCN(ofwin_setgridsize)(int *nrow, int *ncol);
155 
156 // Set event handling callbacks
157 
158 /*
159  * \brief Set a callback function to be called on keypress.
160  *
161  * This applies to the current active WindowProxy.
162  *
163  * \param fcn Callback function to be called on keypress.
164  */
165 OF_EXPORT void OF_FCN(ofwin_setkeypresscallback)(void (*fcn)(KEYPRESS_SIG));
166 
167 /*
168  * \brief Set a callback function to be called on mouse motion.
169  *
170  * This applies to the current active WindowProxy.
171  *
172  * \param fcn Callback function to be called on mouse motion.
173  */
174 OF_EXPORT void OF_FCN(ofwin_setmousemotioncallback)(void (*fcn)(MOUSEMOTION_SIG));
175 
176 /*
177  * \brief Set a callback function to be called on button press.
178  *
179  * This applies to the current active WindowProxy.
180  *
181  * \param fcn Callback function to be called on button press
182  */
183 OF_EXPORT void OF_FCN(ofwin_setbuttonpresscallback)(void (*fcn)(BUTTON_SIG));
184 
185 /*
186  * \brief Set a callback function to be called on button release.
187  *
188  * This applies to the current active WindowProxy.
189  *
190  * \param fcn Callback function to be called on button release.
191  */
192 OF_EXPORT void OF_FCN(ofwin_setbuttonreleasecallback)(void (*fcn)(BUTTON_SIG));
193 
194 // Start/stop animation
195 OF_EXPORT void OF_FCN(ofwin_start)(); // Start animation
196 OF_EXPORT void OF_FCN(ofwin_stop)(); // Force animation to stop and wait for stop
197 OF_EXPORT void OF_FCN(ofwin_signalstop)(); // Force animation to stop
198 OF_EXPORT void OF_FCN(ofwin_waitforstop)(); // Wait for user to exit animation
199 
200 /*
201  * \brief Pause/unpause the animation.
202  *
203  * This applies to the current active WindowProxy.
204  *
205  * \param pause True to pause the animation, False to unpause the animation.
206  */
207 OF_EXPORT void OF_FCN(ofwin_pauseanimation)(bool *pause);
208 
209 /*
210  * \brief Check if the animation is running.
211  *
212  * This applies to the current active WindowProxy.
213  *
214  * \param state This variable is set to 1 if the animation is running, 0 otherwise.
215  */
216 OF_EXPORT void OF_FCN(ofwin_isrunning)(unsigned int *state);
217 
218 // Time control
219 
220 /*
221  * \brief Set the simulation time.
222  *
223  * This applies to the current active WindowProxy.
224  *
225  * \param time New simulation time.
226  */
227 OF_EXPORT void OF_FCN(ofwin_settime)(double *time);
228 
229 /*
230  * \brief Get the simulation time.
231  *
232  * This applies to the current active WindowProxy.
233  *
234  * \param time Current simulation time.
235  */
236 OF_EXPORT void OF_FCN(ofwin_gettime)(double *time);
237 
238 /*
239  * \brief Set whether to pause time.
240  *
241  * This applies to the current active WindowProxy.
242  *
243  * \param pause Set to 1 to pause the simulation time, 0 to unpause.
244  */
245 OF_EXPORT void OF_FCN(ofwin_pausetime)(bool *pause);
246 
247 /*
248  * \brief Check if time is paused.
249  *
250  * This applies to the current active WindowProxy.
251  *
252  * \param pause Set to 1 if simulation time is paused, 0 if unpaused.
253  */
254 OF_EXPORT void OF_FCN(ofwin_istimepaused)(bool *isPaused);
255 
256 /*
257  * \brief Set the simulation time scale.
258  *
259  * This applies to the current active WindowProxy.
260  *
261  * \param tscale New simulation time scale.
262  */
263 OF_EXPORT void OF_FCN(ofwin_settimescale)(double *tscale);
264 
265 /*
266  * \brief Get the simulation time scale.
267  *
268  * This applies to the current active WindowProxy.
269  *
270  * \param tscale Current simulation time scale.
271  */
272 OF_EXPORT void OF_FCN(ofwin_gettimescale)(double *tscale);
273 
274 // Default lighting control.
275 // This can be overridden by enabling light from at least one ReferenceFrame.
276 
277 /*
278  * \brief Set the lighting parameters for the specified grid position.
279  *
280  * This applies to the current active WindowProxy.
281  *
282  * \param row Row in the grid to set.
283  * \param col Column in the grid to set.
284  * \param r Red component of specified light.
285  * \param g Green component of specified light.
286  * \param b Blue component of specified light.
287  */
288 OF_EXPORT void OF_FCN(ofwin_setlightambient)(unsigned int *row, unsigned int *col,
289  float *r, float *g, float *b);
290 OF_EXPORT void OF_FCN(ofwin_setlightdiffuse)(unsigned int *row, unsigned int *col,
291  float *r, float *g, float *b);
292 OF_EXPORT void OF_FCN(ofwin_setlightspecular)(unsigned int *row, unsigned int *col,
293  float *r, float *g, float *b);
294 
295 /*
296  * \brief Set the light position for the specified grid position.
297  *
298  * This applies to the current active WindowProxy.
299  * Light position is defined in eye coordinates (x right, y up, z out of screen).
300  *
301  * \param row Row in the grid to set.
302  * \param col Column in the grid to set.
303  * \param x X position in eye space.
304  * \param y Y position in eye space.
305  * \param z Z position in eye space.
306  * \param w If 0 then directional (antiparallel to x,y,z direction).
307  * If 1 then positional (radiates from x,y,z direction).
308  */
309 OF_EXPORT void OF_FCN(ofwin_setlightposition)(unsigned int *row, unsigned int *col,
310  float *x, float *y, float *z, float *w);
311 
312 /*
313  * \brief Set the scene at the specified grid position.
314  *
315  * This applies to the current active WindowProxy.
316  * The scene is specified by the currently active FrameManager.
317  *
318  * \param row Row in the grid to set.
319  * \param col Column in the grid to set.
320  */
321 OF_EXPORT void OF_FCN(ofwin_setscene)(unsigned int *row, unsigned int *col);
322 
323 /*
324  * \brief Set the 3D stereo mode for the specified grid position.
325  *
326  * This applies to the current active WindowProxy.
327  *
328  * \param row Row in the grid to set.
329  * \param col Column in the grid to set.
330  * \param enable True to enable 3D stereo mode.
331  * \param eyeseparation Set eye separation for 3D stereo.
332  * \param width Width of the screen.
333  * \param height Height of the screen.
334  * \param distance Distance of the screen.
335  */
336 OF_EXPORT void OF_FCN(ofwin_setstereo)(unsigned int *row, unsigned int *col, bool *enable, float *eyeseparation, float *width, float *height, float *distance);
337 
338 /*
339  * \brief Set the background color of the specified grid position.
340  *
341  * This applies to the current active WindowProxy.
342  *
343  * \param row Row in the grid to set.
344  * \param col Column in the grid to set.
345  * \param r Red color component [0-1].
346  * \param g Green color component [0-1].
347  * \param b Blue color component [0-1].
348  */
349 OF_EXPORT void OF_FCN(ofwin_setbackgroundcolor)(unsigned int *row, unsigned int *col,
350  float *r, float *g, float *b);
351 
352 /*
353  * \brief Set the background texture of the specified grid position.
354  *
355  * This applies to the current active WindowProxy.
356  *
357  * \param row Row in the grid to set.
358  * \param col Column in the grid to set.
359  * \param fname File containing the background texture.
360  */
361 OF_EXPORT void OF_FCN(ofwin_setbackgroundtexture)(unsigned int *row, unsigned int *col, OF_CHARARG(fname));
362 
363 /*
364  * \brief Set the background star field of the specified grid position.
365  *
366  * This applies to the current active WindowProxy.
367  *
368  * \param row Row in the grid to set.
369  * \param col Column in the grid to set.
370  * \param minMag Minimum star magnitude to show.
371  * \param maxMag Maximum star magnitude to show.
372  * \param fname File containing the background star field catalog data.
373  */
374 OF_EXPORT void OF_FCN(ofwin_setbackgroundstardata)(unsigned int *row, unsigned int *col, float *minMag, float *maxMag, OF_CHARARG(fname));
375 
376 /*
377  * \brief Enable/disable the HUD text for the specified grid position. Create placeholder
378  * HUD text if it does not yet exist.
379  *
380  * This applies to the current active WindowProxy.
381  *
382  * \param row Row in the grid to set.
383  * \param col Column in the grid to set.
384  * \param enable Whether to enable or disable the HUD text.
385  */
386 OF_EXPORT void OF_FCN(ofwin_enablehudtext)(unsigned int *row, unsigned int *col, bool *enable);
387 
388 /*
389  * \brief Set HUD font. Create placeholder HUD text if it does not yet exist.
390  *
391  * This applies to the current active WindowProxy.
392  *
393  * \param row Row in the grid to set.
394  * \param col Column in the grid to set.
395  * \param fname Name of font to use, e.g. "arial.ttf".
396  */
397 OF_EXPORT void OF_FCN(ofwin_sethudtextfont)(unsigned int *row, unsigned int *col, OF_CHARARG(fname));
398 
399 /*
400  * \brief Set HUD color and size. Create placeholder HUD text if it does not yet exist.
401  *
402  * This applies to the current active WindowProxy.
403  *
404  * \param row Row in the grid to set.
405  * \param col Column in the grid to set.
406  * \param r Red color component.
407  * \param g Green color component.
408  * \param b Blue color component.
409  * \param charSize Character size in pixels.
410  */
411 OF_EXPORT void OF_FCN(ofwin_sethudtextparameters)(unsigned int *row, unsigned int *col, float *r, float *g, float *b, float *charSize);
412 
413 /*
414  * \brief Set HUD text position and alignment. Create placeholder HUD text if it does not yet exist.
415  *
416  * This applies to the current active WindowProxy.
417  *
418  * \param row Row in the grid to set.
419  * \param col Column in the grid to set.
420  * \param x Text origin x position, in range [0,1] from left to right.
421  * \param y Text origin y position, in range [0,1] from bottom to top.
422  * \param alignment Alignment location of text origin, see osgText::AlignmentType enum.
423  */
424 OF_EXPORT void OF_FCN(ofwin_sethudtextposition)(unsigned int *row, unsigned int *col, float *x, float *y, unsigned int *alignment);
425 
426 /*
427  * \brief Set HUD text. Create placeholder HUD text if it does not yet exist.
428  *
429  * This applies to the current active WindowProxy.
430  *
431  * \param row Row in the grid to set.
432  * \param col Column in the grid to set.
433  * \param text The new HUD text.
434  */
435 OF_EXPORT void OF_FCN(ofwin_sethudtext)(unsigned int *row, unsigned int *col, OF_CHARARG(text));
436 
437 /*
438  * \brief Set a callback function for swapping the front/back buffers.
439  *
440  * This applies to the current active WindowProxy.
441  *
442  * \param fcn Callback function to be called.
443  */
444 OF_EXPORT void OF_FCN(ofwin_setswapbuffersfunction)(void (*fcn)(unsigned int *winID));
445 
446 /*
447  * \brief Set a callback function for making the OpenGL context current (so it can be drawn on).
448  *
449  * This applies to the current active WindowProxy.
450  *
451  * \param fcn Callback function to be called.
452  */
453 OF_EXPORT void OF_FCN(ofwin_setmakecurrentfunction)(void (*fcn)(unsigned int *winID, bool *success));
454 
455 /*
456  * \brief Set a callback function for updating the OpenGL context after qualifying events.
457  *
458  * Currently this includes resize.
459  *
460  * This applies to the current active WindowProxy.
461  *
462  * \param fcn Callback function to be called.
463  */
464 OF_EXPORT void OF_FCN(ofwin_setupdatecontextfunction)(void (*fcn)(unsigned int *winID, bool *success));
465 
466 // Inform the WindowProxy that an event occurred.
467 
468 /*
469  * \brief Resize the window to a new position and size.
470  *
471  * This applies to the current active WindowProxy.
472  *
473  * \param x X-coordinate (in pixels) of the screen of the upper-right corner of the window.
474  * \param y Y-coordinate (in pixels) of the screen of the upper-right corner of the window.
475  * \param width Width of the window (in pixels).
476  * \param height Height of the window (in pixels).
477  */
478 OF_EXPORT void OF_FCN(ofwin_resizewindow)(int *x, int *y, unsigned int *width, unsigned int *height);
479 
480 /*
481  * \brief Create a key-pressed event.
482  *
483  * This applies to the current active WindowProxy.
484  *
485  * \param key Key pressed (see osg::GUIEventAdapter::KeySymbol enum).
486  */
487 OF_EXPORT void OF_FCN(ofwin_keypress)(unsigned int *key);
488 
489 /*
490  * \brief Create a key released event.
491  *
492  * This applies to the current active WindowProxy.
493  *
494  * \param key Key released (see osg::GUIEventAdapter::KeySymbol enum).
495  */
496 OF_EXPORT void OF_FCN(ofwin_keyrelease)(unsigned int *key);
497 
498 /*
499  * \brief Create a mouse button pressed event.
500  *
501  * This applies to the current active WindowProxy.
502  *
503  * \param x X-coordinate of the mouse in the window.
504  * \param y Y-coordinate of the mouse in the window.
505  * \param button Mouse button pressed. Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
506  */
507 OF_EXPORT void OF_FCN(ofwin_buttonpress)(float *x, float *y, unsigned int *button);
508 
509 /*
510  * \brief Create a mouse button released event.
511  *
512  * This applies to the current active WindowProxy.
513  *
514  * \param x X-coordinate of the mouse in the window.
515  * \param y Y-coordinate of the mouse in the window.
516  * \param button Mouse button released. Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
517  */
518 OF_EXPORT void OF_FCN(ofwin_buttonrelease)(float *x, float *y, unsigned int *button);
519 
520 /*
521  * \brief Create a mouse-moved event.
522  *
523  * This applies to the current active WindowProxy.
524  *
525  * \param x X-coordinate of the mouse in the window.
526  * \param y Y-coordinate of the mouse in the window.
527  */
528 OF_EXPORT void OF_FCN(ofwin_mousemotion)(float *x, float *y);
529 
530 /*
531  * \brief Set the desired framerate of the window (frames/second).
532  *
533  * This applies to the current active WindowProxy.
534  *
535  * \param fps Desired framerate value in frames per second.
536  */
537 OF_EXPORT void OF_FCN(ofwin_setdesiredframerate)(double *fps);
538 
539 // Control views in any given grid position.
540 
541 /*
542  * \brief Add a view to the window.
543  *
544  * This applies to the current active WindowProxy.
545  * This adds the current acive View.
546  *
547  * \param row Row to add the view to.
548  * \param col Column to add the view to.
549  */
550 OF_EXPORT void OF_FCN(ofwin_addview)(unsigned int *row, unsigned int *col);
551 
552 /*
553  * \brief Remove a view from the window.
554  *
555  * This applies to the current active WindowProxy.
556  * This removes the current acive View.
557  *
558  * \param row Row to remove the view from.
559  * \param col Column to remove the view from.
560  */
561 OF_EXPORT void OF_FCN(ofwin_removeview)(unsigned int *row, unsigned int *col);
562 
563 /*
564  * \brief Remove all the view(s) from the window.
565  *
566  * This applies to the current active WindowProxy.
567  *
568  * \param row Row to remove the view(s) from.
569  * \param col Column to remove the view(s) from.
570  */
571 OF_EXPORT void OF_FCN(ofwin_removeallviews)(unsigned int *row, unsigned int *col);
572 
573 /*
574  * \brief Set the view currently displayed in the window.
575  *
576  * This applies to the current active WindowProxy.
577  * This selects the current acive View.
578  *
579  * \param row Row to set the active view in.
580  * \param col Column to set the active view in.
581  */
582 OF_EXPORT void OF_FCN(ofwin_selectview)(unsigned int *row, unsigned int *col);
583 
584 // Window capture functions.
585 // Intel Fortran passes string lengths after all arguments.
586 
587 /*
588  * \brief Set the file name and type that will be used for window captures.
589  *
590  * This applies to the currently active WindowProxy.
591  *
592  * \param fname File name (without extension).
593  * \param fext File extension (determines image type).
594  */
595 
596 /*
597  * \brief Capture the next rendered frame.
598  *
599  * This applies to the currently active WindowProxy.
600  */
601 OF_EXPORT void OF_FCN(ofwin_capturewindow)();
602 #if defined(IFORT_CALLS)
603 OF_EXPORT void OF_FCN(ofwin_setwindowcapturefile)(const char *fname,
604  const char *fext,
605  unsigned int fnamelen,
606  unsigned int fextlen);
607 
608 // GFortran passes string lengths after each argument
609 // C doesn't need string lengths
610 // Both these cases are handled by the OF_CHARARG() macro
611 #else
612 OF_EXPORT void OF_FCN(ofwin_setwindowcapturefile)(OF_CHARARG(fname),
613  OF_CHARARG(fext));
614 #endif
615 
616 /*
617  * \brief Set the key that activates a window capture.
618  *
619  * This applies to the currently active WindowProxy.
620  *
621  * \param key Integer representation of key char. Set to 0 (zero) to disable key-based window capture.
622  */
623 OF_EXPORT void OF_FCN(ofwin_setwindowcapturekey)(int *key);
624 
625 /******************************************************************
626  FrameManger Functions
627 ******************************************************************/
628 
629 /*
630  * \brief Set the currently active FrameManager.
631  *
632  * \param id ID of the frame manager to activate.
633  */
634 OF_EXPORT void OF_FCN(offm_activate)(int *id);
635 
636 /*
637  * \brief Create a new FrameManager with the given ID.
638  *
639  * This new FrameManager will also become the current active one.
640  *
641  * \param id ID of the frame manager to create.
642  */
643 OF_EXPORT void OF_FCN(offm_create)(int *id);
644 
645 /*
646  * \brief Assign a ReferenceFrame to the FrameManager.
647  *
648  * This applies to the current active FrameManager.
649  * The scene is specified by the currently active ReferenceFrame.
650  */
651 OF_EXPORT void OF_FCN(offm_setframe)();
652 
653 /*
654  * \brief Lock the current FrameManager.
655  *
656  * This should be done before the FrameManager's scene is modified.
657  * This applies to the current active FrameManager.
658  */
659 OF_EXPORT void OF_FCN(offm_lock)();
660 
661 /*
662  * \brief Unlock the current FrameManager.
663  *
664  * This should be done after the FrameManager's scene is modified.
665  * This applies to the current active FrameManager.
666  */
667 OF_EXPORT void OF_FCN(offm_unlock)();
668 
669 /******************************************************************
670  ReferenceFrame Functions
671 ******************************************************************/
672 
673 /*
674  * \brief Set the currently active reference frame.
675  *
676  * \param name Name of the frame to activate.
677  */
678 OF_EXPORT void OF_FCN(offrame_activate)(OF_CHARARG(name));
679 
680 /*
681  * \brief Create a new ReferenceFrame with the given name.
682  *
683  * This new ReferenceFrame will also become the current active one.
684  *
685  * \param name Name of the frame to create.
686  */
687 OF_EXPORT void OF_FCN(offrame_create)(OF_CHARARG(name));
688 
689 /*
690  * \brief Set the color of the current frame.
691  *
692  * This applies to the current active ReferenceFrame.
693  *
694  * \param r Red color component [0-1].
695  * \param g Green color component [0-1].
696  * \param b Blue color component [0-1].
697  * \param a Alpha (transparancy) component [0-1].
698  */
699 OF_EXPORT void OF_FCN(offrame_setcolor)(float *r, float *g, float *b, float *a);
700 
709 OF_EXPORT void OF_FCN(offrame_addchild)(OF_CHARARG(name));
710 
711 /*
712  * \brief Remove a child frame from the current frame.
713  *
714  * This applies to the current active ReferenceFrame.
715  * The currently active frame will remain active.
716  *
717  * \param name Name of the child frame to remove from the active frame.
718  */
719 OF_EXPORT void OF_FCN(offrame_removechild)(OF_CHARARG(name));
720 
721 /*
722  * \brief Remove all child frames from the current frame.
723  *
724  * This applies to the current active ReferenceFrame.
725  * The currently active frame will remain active.
726  */
727 OF_EXPORT void OF_FCN(offrame_removeallchildren)();
728 
729 /*
730  * \brief Get the number of child frames in the current frame.
731  *
732  * This applies to the current active ReferenceFrame.
733  *
734  * \param numchildren variable to store the number of child frames to.
735  */
736 OF_EXPORT void OF_FCN(offrame_getnumchildren)(int *numchildren);
737 
738 /*
739  * \brief Set the position of the current frame.
740  *
741  * This applies to the current active ReferenceFrame.
742  *
743  * \param x X position.
744  * \param y Y position.
745  * \param z Z position.
746  */
747 OF_EXPORT void OF_FCN(offrame_setposition)(double *x, double *y, double *z);
748 
749 /*
750  * \brief Get the position of the current frame.
751  *
752  * This applies to the current active ReferenceFrame.
753  *
754  * \param x Returned X position.
755  * \param y Returned Y position.
756  * \param z Returned Z position.
757  */
758 OF_EXPORT void OF_FCN(offrame_getposition)(double *x, double *y, double *z);
759 
760 /*
761  * \brief Set the attitude of the current frame.
762  *
763  * This applies to the current active ReferenceFrame.
764  *
765  * \param rx X component of the rotation quaternion.
766  * \param ry Y component of the rotation quaternion.
767  * \param rz Z component of the rotation quaternion.
768  * \param angle Angle component of the rotation quaternion.
769  */
770 OF_EXPORT void OF_FCN(offrame_setattitude)(double *rx, double *ry, double *rz, double *angle);
771 
772 /*
773  * \brief Get the attitude of the current frame.
774  *
775  * This applies to the current active ReferenceFrame.
776  *
777  * \param rx Returned X component of the rotation quaternion.
778  * \param ry Returned Y component of the rotation quaternion.
779  * \param rz Returned Z component of the rotation quaternion.
780  * \param angle Returned angle component of the rotation quaternion.
781  */
782 OF_EXPORT void OF_FCN(offrame_getattitude)(double *rx, double *ry, double *rz, double *angle);
783 
784 /*
785  * \brief Toggle which axis components are displayed.
786  *
787  * This applies to the current active ReferenceFrame.
788  * The axis is initially drawn at the origin of the reference frame unless otherwise
789  * specified by offrame_movexaxis(), offrame_moveyaxis() or offrame_movezaxis().
790  *
791  * To show multiple axis components, sum the enumerations of OpenFrames::ReferenceFrame::AxesType you want to show.
792  *
793  * \param axes Axis components to show specified by OpenFrames::ReferenceFrame::AxesType, others will be hidden.
794  */
795 OF_EXPORT void OF_FCN(offrame_showaxes)(unsigned int *axes);
796 
797 /*
798  * \brief Toggle display of the name label of the frame.
799  *
800  * This applies to the current active ReferenceFrame.
801  *
802  * \param namelabel True to display the label, false to hide it.
803  */
804 OF_EXPORT void OF_FCN(offrame_shownamelabel)(bool *namelabel);
805 
806 /*
807  * \brief Toggle which axis labels are displayed.
808  *
809  * This applies to the current active ReferenceFrame.
810  * The axis is initially drawn at the origin of the reference frame unless otherwise
811  * specified by offrame_movexaxis(), offrame_moveyaxis() or offrame_movezaxis().
812  *
813  * To show multiple axis labels, sum the enumerations of OpenFrames::ReferenceFrame::AxesType you want to show.
814  *
815  * \param labels Axis labels to show specified by OpenFrames::ReferenceFrame::AxesType, others will be hidden.
816  */
817 OF_EXPORT void OF_FCN(offrame_showaxeslabels)(unsigned int *labels);
818 
819 /*
820  * \brief Change the name label for the current ReferenceFrame.
821  *
822  * Note that it will still be referred to using the name assigned to it at creation.
823  *
824  * This applies to the current active ReferenceFrame.
825  *
826  * \param name Name of the label.
827  */
828 OF_EXPORT void OF_FCN(offrame_setnamelabel)(OF_CHARARG(name));
829 
830 /*
831  * \brief Change the axes labels for the current ReferenceFrame.
832  * Note- Intel Fortran passes string lengths after all arguments.
833  *
834  * This applies to the current active ReferenceFrame.
835  *
836  * \param xlabel Name of the x-axis label.
837  * \param ylabel Name of the y-axis label.
838  * \param zlabel Name of the z-axis label.
839  */
840 #if defined(IFORT_CALLS)
841 OF_EXPORT void OF_FCN(offrame_setaxeslabels)(const char *xlabel,
842  const char *ylabel,
843  const char *zlabel,
844  unsigned int xlabellen,
845  unsigned int ylabellen,
846  unsigned int zlabellen);
847 
848 // GFortran passes string lengths after each argument
849 // C doesn't need string lengths
850 // Both these cases are handled by the OF_CHARARG() macro
851 #else
852 OF_EXPORT void OF_FCN(offrame_setaxeslabels)(OF_CHARARG(xlabel),
853  OF_CHARARG(ylabel),
854  OF_CHARARG(zlabel));
855 #endif
856 
857 // Reposition axes.
858 
859 /*
860  * \brief Reposition and resize the x component of the coordinate axis.
861  *
862  * Make sure that offrame_showaxes() is configured to display this axis.
863  *
864  * This applies to the current active ReferenceFrame.
865  *
866  * \param pos Position array of the origin of the x-axis component.
867  * \param length Length of the x-axis arrow.
868  * \param headRatio Ratio of the arrow head to body. Set to 0.0 to use default.
869  * \param bodyRadius Radius of the body of the arrow. Set to 0.0 to use default.
870  * \param headRadius Radius of the head of the arrow. Set to 0.0 to use default.
871  */
872 OF_EXPORT void OF_FCN(offrame_movexaxis)(double pos[], double *length, double *headRatio, double *bodyRadius, double *headRadius);
873 
874 /*
875  * \brief Reposition and resize the y component of the coordinate axis.
876  *
877  * Make sure that offrame_showaxes() is configured to display this axis.
878  *
879  * This applies to the current active ReferenceFrame.
880  *
881  * \param pos Position array of the origin of the y-axis component.
882  * \param length Length of the y-axis arrow.
883  * \param headRatio Ratio of the arrow head to body. Set to 0.0 to use default.
884  * \param bodyRadius Radius of the body of the arrow. Set to 0.0 to use default.
885  * \param headRadius Radius of the head of the arrow. Set to 0.0 to use default.
886  */
887 OF_EXPORT void OF_FCN(offrame_moveyaxis)(double pos[], double *length, double *headRatio, double *bodyRadius, double *headRadius);
888 
889 /*
890  * \brief Reposition and resize the z component of the coordinate axis.
891  *
892  * Make sure that offrame_showaxes() is configured to display this axis.
893  *
894  * This applies to the current active ReferenceFrame.
895  *
896  * \param pos Position array of the origin of the z-axis component.
897  * \param length Length of the z-axis arrow.
898  * \param headRatio Ratio of the arrow head to body. Set to 0.0 to use default.
899  * \param bodyRadius Radius of the body of the arrow. Set to 0.0 to use default.
900  * \param headRadius Radius of the head of the arrow. Set to 0.0 to use default.
901  */
902 OF_EXPORT void OF_FCN(offrame_movezaxis)(double pos[], double *length, double *headRatio, double *bodyRadius, double *headRadius);
903 
904 // Enable and manage lighting for the currently active ReferenceFrame.
905 
906 /*
907  * \brief Enable and manage per-frame lighting.
908  *
909  * This applies to the current active ReferenceFrame.
910  *
911  * \param enabled Whether to enable or disable lighting.
912  * \param r Red component of specified light type.
913  * \param g Green component of specified light type.
914  * \param b Blue component of specified light type.
915  */
916 OF_EXPORT void OF_FCN(offrame_setlightsourceenabled)(bool *enabled);
917 
918 OF_EXPORT void OF_FCN(offrame_getlightsourceenabled)(bool *enabled);
919 OF_EXPORT void OF_FCN(offrame_setlightambient)(float *r, float *g, float *b);
920 OF_EXPORT void OF_FCN(offrame_setlightdiffuse)(float *r, float *g, float *b);
921 OF_EXPORT void OF_FCN(offrame_setlightspecular)(float *r, float *g, float *b);
922 
923 /*
924  * \brief Have this frame follow the specified trajectory.
925  *
926  * The name used is the one used in the trajecotries creation in oftraj_create().
927  *
928  * This applies to the current active ReferenceFrame.
929  *
930  * \param name Name of the trajectory to follow.
931  */
932 OF_EXPORT void OF_FCN(offrame_followtrajectory)(OF_CHARARG(name));
933 
934 /*
935  * \brief Follow the trajectory's position, attitude, or both, and set the follow mode.
936  *
937  * The function offrame_followtrajectory() must be called before this function.
938  *
939  * This applies to the current active ReferenceFrame.
940  *
941  * \param data Set whether to follow position and/or velocity (see OpenFrames::TrajectoryFollower::FollowData).
942  * \param mode Set the follow mode to loop repeatedly or to limit to the times added to the trajectory (see OpenFrames::TrajectoryFollower::FollowMode).
943  */
944 OF_EXPORT void OF_FCN(offrame_followtype)(int *data, int *mode);
945 
946 /*
947  * \brief Set the elements to follow position.
948  *
949  * Each of src, element, opt, and scale must be 3-element arrays, with one element for each x/y/z source.
950  *
951  * The function offrame_followtrajectory() must be called before this function.
952  *
953  * This applies to the current active ReferenceFrame.
954  *
955  * \param src Set data source for each axis (see OpenFrames::Trajectory::SourceType).
956  * \param element Set which element to follow.
957  * \param opt Set which optional to follow.
958  * \param scale Set the scale for each axis.
959  */
960 OF_EXPORT void OF_FCN(offrame_followposition)(int src[], unsigned int element[],
961  unsigned int opt[], double scale[]);
962 
963 /*
964  * \brief DEPRECATED Change how this frame follows a trajectory.
965  *
966  * This applies to the current active ReferenceFrame.
967  *
968  * \param affectChildren True if the children of this frame are also affected by this function, if false, only this frame is affected.
969  * \param reset UNUSED Set to true to reset the trajectory to its initial time.
970  * \param changePauseState True if this function call is to set the pauseState, false to ignore the provided value of pauseState.
971  * \param pauseState Indicate if the playback is to be paused.
972  * \param changeOffsetTime True if this function call is to set the offsetTime, false to ignore the provided value of offsetTime.
973  * \param offsetTime Shift the playback time by this offset value.
974  * \param changeTimeScale True if this function call is to set the timeScale, false to ignore the provided value of timeScale.
975  * \param timeScale Set the timescale for playback.
976  */
977 OF_EXPORT void OF_FCN(offrame_managetime)(bool *affectChildren, bool *reset,
978  bool *changePauseState, bool *pauseState,
979  bool *changeOffsetTime, double *offsetTime,
980  bool *changeTimeScale, double *timeScale);
981 
982 /*
983  * \brief Print (to std::out) a formatted string of the current ReferenceFrame's descendant hierarchy.
984  *
985  * This applies to the current active ReferenceFrame.
986  */
987 OF_EXPORT void OF_FCN(offrame_printframestring)();
988 
989 /******************************************************************
990  Sphere Functions
991 A Sphere is a type of ReferenceFrame, so all the above ReferenceFrame
992 functions also apply to a Sphere. In addition, to operate on a Sphere
993 you must first set it as the currently active ReferenceFrame by using
994 offrame_activate() (just like for any other ReferenceFrame).
995 ******************************************************************/
996 
997 /*
998  * \brief Create a new Sphere with the given name.
999  *
1000  * This new Sphere will also become the current active one.
1001  *
1002  * \param name Name of the sphere to create.
1003  */
1004 OF_EXPORT void OF_FCN(ofsphere_create)(OF_CHARARG(name));
1005 
1006 /*
1007  * \brief Set the radius of the sphere.
1008  *
1009  * This applies to the current active Sphere.
1010  *
1011  * \param radius Radius of the sphere.
1012  */
1013 OF_EXPORT void OF_FCN(ofsphere_setradius)(double *radius);
1014 
1015 /*
1016  * \brief Set the image file used as the texture map for the sphere.
1017  *
1018  * See the OpenSceneGraph documentation for supported file types.
1019  *
1020  * This applies to the current active Sphere.
1021  *
1022  * \param fname File containing the texture map.
1023  */
1024 OF_EXPORT void OF_FCN(ofsphere_settexturemap)(OF_CHARARG(fname));
1025 
1026 /*
1027  * \brief Set the image file used as the night texture map for the sphere.
1028  *
1029  * See the OpenSceneGraph documentation for supported file types.
1030  *
1031  * This applies to the current active Sphere.
1032  *
1033  * \param fname File containing the night texture map.
1034  */
1035 OF_EXPORT void OF_FCN(ofsphere_setnighttexturemap)(OF_CHARARG(fname));
1036 
1037 /*
1038  * \brief Enable/disable auto level of detailing for the sphere.
1039  *
1040  * This applies to the current active Sphere.
1041  *
1042  * \param lod True to enable auto level of detailing, false to disable.
1043  */
1044 OF_EXPORT void OF_FCN(ofsphere_setautolod)(bool *lod);
1045 
1046 /*
1047  * \brief Set position of the sphere (within its own reference frame).
1048  *
1049  * This applies to the current active Sphere.
1050  *
1051  * \param x X position.
1052  * \param y Y position.
1053  * \param z Z position.
1054  */
1055 OF_EXPORT void OF_FCN(ofsphere_setsphereposition)(double *x, double *y, double *z);
1056 
1057 /*
1058  * \brief Set attitude of the sphere (within its own reference frame).
1059  *
1060  * This applies to the current active Sphere.
1061  *
1062  * \param rx X component of the rotation quaternion.
1063  * \param ry Y component of the rotation quaternion.
1064  * \param rz Z component of the rotation quaternion.
1065  * \param angle Angle component of the rotation quaternion.
1066  */
1067 OF_EXPORT void OF_FCN(ofsphere_setsphereattitude)(double *rx, double *ry, double *rz, double *angle);
1068 
1069 /*
1070  * \brief Set the scale of the sphere (to turn sphere into ellipsoid).
1071  * This applies to the current active Sphere, and can be used to turn a Sphere into an ellipsoid.
1072  *
1073  * \param sx X scale.
1074  * \param sy Y scale.
1075  * \param sz Z scale.
1076  */
1077 OF_EXPORT void OF_FCN(ofsphere_setspherescale)(double *sx, double *sy, double *sz);
1078 
1079 /*
1080  * \brief Set material parameters for the sphere.
1081  *
1082  * This applies to the current active Sphere.
1083  *
1084  * \param r Red component of reflectivity for given component.
1085  * \param g Green component of reflectivity for given component.
1086  * \param b Blue component of reflectivity for given component.
1087  * \param shininess Specular shininess for given component.
1088  */
1089 OF_EXPORT void OF_FCN(ofsphere_setmaterialambient)(float *r, float *g, float *b);
1090 OF_EXPORT void OF_FCN(ofsphere_setmaterialdiffuse)(float *r, float *g, float *b);
1091 OF_EXPORT void OF_FCN(ofsphere_setmaterialspecular)(float *r, float *g, float *b);
1092 OF_EXPORT void OF_FCN(ofsphere_setmaterialemission)(float *r, float *g, float *b);
1093 OF_EXPORT void OF_FCN(ofsphere_setmaterialshininess)(float *shininess);
1094 
1095 /******************************************************************
1096  Model Functions
1097 A Model displays a 3D model (specified in an external file) in the scene.
1098 See the OpenSceneGraph documentation for allowable model file formats.
1099 A Model is a type of ReferenceFrame, so all the above ReferenceFrame
1100 functions also apply to it. In addition, to operate on a Model
1101 you must first set it as the currently active ReferenceFrame by using
1102 offrame_activate() (just like for any other ReferenceFrame).
1103 ******************************************************************/
1104 
1105 /*
1106 * \brief Create a new Model with the given name.
1107 *
1108 * This new Model will also become the current active one.
1109 *
1110 * \param name Name of the model to create.
1111 **/
1112 OF_EXPORT void OF_FCN(ofmodel_create)(OF_CHARARG(name));
1113 
1114 /*
1115  * \brief Set the 3D model to be displayed.
1116  *
1117  * See the OpenSceneGraph documentation for supported model types.
1118  *
1119  * This applies to the current active Model.
1120  *
1121  * \param fname File containing the 3D model.
1122  */
1123 OF_EXPORT void OF_FCN(ofmodel_setmodel)(OF_CHARARG(fname));
1124 
1125 /*
1126  * \brief Set the position wrt the local origin of the current model.
1127  *
1128  * This applies to the current active Model.
1129  *
1130  * \param x X position.
1131  * \param y Y position.
1132  * \param z Z position.
1133  */
1134 OF_EXPORT void OF_FCN(ofmodel_setmodelposition)(double *x, double *y, double *z);
1135 
1136 /*
1137  * \brief Get the position wrt the local origin of the current model.
1138  *
1139  * This applies to the current active Model.
1140  *
1141  * \param x Returned X position.
1142  * \param y Returned Y position.
1143  * \param z Returned Z position.
1144  */
1145 OF_EXPORT void OF_FCN(ofmodel_getmodelposition)(double *x, double *y, double *z);
1146 
1147 /*
1148  * \brief Set the scale wrt the local origin of the current model.
1149  *
1150  * This applies to the current active Model.
1151  *
1152  * \param sx Scale along X axis.
1153  * \param sy Scale along Y axis.
1154  * \param sz Scale along Z axis.
1155  */
1156 OF_EXPORT void OF_FCN(ofmodel_setmodelscale)(double *sx, double *sy, double *sz);
1157 
1158 /*
1159  * \brief Get the scale wrt the local origin of the current model.
1160  *
1161  * This applies to the current active Model.
1162  *
1163  * \param sx Returned scale along X axis.
1164  * \param sy Returned scale along Y axis.
1165  * \param sz Returned scale along Z axis.
1166  */
1167 OF_EXPORT void OF_FCN(ofmodel_getmodelscale)(double *sx, double *sy, double *sz);
1168 
1169 /*
1170  * \brief Set the model pivot point wrt the local origin of the current model.
1171  *
1172  * This is the point about which all rotations and scales take place.
1173  *
1174  * This applies to the current active Model.
1175  *
1176  * \param px X position of pivot point.
1177  * \param py Y position of pivot point.
1178  * \param pz Z position of pivot point.
1179  */
1180 OF_EXPORT void OF_FCN(ofmodel_setmodelpivot)(double *px, double *py, double *pz);
1181 
1182 /*
1183  * \brief Get the position wrt the local origin of the current model.
1184  *
1185  * This is the point about which all rotations and scales take place.
1186  *
1187  * This applies to the current active Model.
1188  *
1189  * \param px Returned X position of pivot point.
1190  * \param py Returned Y position of pivot point.
1191  * \param pz Returned Z position of pivot point.
1192  */
1193 OF_EXPORT void OF_FCN(ofmodel_getmodelpivot)(double *px, double *py, double *pz);
1194 
1195 /*
1196  * \brief Get the size of the model.
1197  *
1198  * This is the radius of the model's bounding sphere.
1199  *
1200  * This applies to the current active Model.
1201  *
1202  * \param size Returned size of the model.
1203  */
1204 OF_EXPORT void OF_FCN(ofmodel_getmodelsize)(double *size);
1205 
1206 /******************************************************************
1207  DrawableTrajectory Functions
1208 A DrawableTrajectory allows a TrajectoryArtist to do its drawing.
1209 A DrawableTrajectory is a type of ReferenceFrame, so all the above ReferenceFrame
1210 functions also apply to it. In addition, to operate on a DrawableTrajectory
1211 you must first set it as the currently active ReferenceFrame by using
1212 offrame_activate() (just like for any other ReferenceFrame).
1213 ******************************************************************/
1214 
1215 /*
1216  * \brief Create a new DrawableTrajectory with the given name.
1217  *
1218  * This new DrawableTrajectory will also become the current active one.
1219  *
1220  * \param name Name of the drawable trajectory to create.
1221  */
1222 OF_EXPORT void OF_FCN(ofdrawtraj_create)(OF_CHARARG(name));
1223 
1224 /*
1225  * \brief Allow specified TrajectoryArtist to draw using this DrawableTrajectory.
1226  *
1227  * Note that the currently active TrajectoryArtist will NOT be changed.
1228  *
1229  * This applies to the current active DrawableTrajectory.
1230  *
1231  * \param name Name of the trajectory artist to draw this DrawableTrajectory.
1232  */
1233 OF_EXPORT void OF_FCN(ofdrawtraj_addartist)(OF_CHARARG(name));
1234 
1235 /*
1236  * \brief Remove specified artist from the current DrawableTrajectory.
1237  *
1238  * Note that the currently active TrajectoryArtist will NOT be changed.
1239  *
1240  * This applies to the current active DrawableTrajectory.
1241  *
1242  * \param name Name of the trajectory artist to be removed from this DrawableTrajectory.
1243  */
1244 OF_EXPORT void OF_FCN(ofdrawtraj_removeartist)(OF_CHARARG(name));
1245 
1246 /*
1247  * \brief Remove all artists from the current DrawableTrajectory.
1248  *
1249  * This applies to the current active DrawableTrajectory.
1250  */
1251 OF_EXPORT void OF_FCN(ofdrawtraj_removeallartists)();
1252 
1253 
1254 /******************************************************************
1255  CoordinateAxes Functions
1256 A CoordinateAxis is a ReferenceFrame that draws x/y/z axes at its origin,
1257 and allows for variably spaced major and minor tick marks.
1258 ******************************************************************/
1259 
1260 /*
1261  * \brief Create a new CoordinateAxes with the given name.
1262  *
1263  * This new CoordinateAxes will also become the current active one.
1264  *
1265  * \param name Name of the coordinate axes to create.
1266  */
1267 OF_EXPORT void OF_FCN(ofcoordaxes_create)(OF_CHARARG(name));
1268 
1269 /*
1270  * \brief Sets the length of the axis.
1271  *
1272  * This applies to the current active CoordinateAxes.
1273  *
1274  * \param len Axis length.
1275  */
1276 OF_EXPORT void OF_FCN(ofcoordaxes_setaxislength)(double *len);
1277 
1278 /*
1279  * \brief Sets which axis to draw.
1280  *
1281  * To show multiple axis components, sum the enumerations of OpenFrames::ReferenceFrame::AxesType you want to show.
1282  *
1283  * This applies to the current active CoordinateAxes.
1284  *
1285  * \param axes Axis components to show specified by OpenFrames::ReferenceFrame::AxesType, others will be hidden.
1286  */
1287 OF_EXPORT void OF_FCN(ofcoordaxes_setdrawaxes)(unsigned int *axes);
1288 
1289 /*
1290  * \brief Sets the major and minor tick spacing.
1291  *
1292  * This applies to the current active CoordinateAxes.
1293  *
1294  * \param major Major tick spacing.
1295  * \param minor Major tick spacing.
1296  */
1297 OF_EXPORT void OF_FCN(ofcoordaxes_settickspacing)(double *major, double *minor);
1298 
1299 /*
1300  * \brief Sets the major and minor tick size.
1301  *
1302  * This applies to the current active CoordinateAxes.
1303  *
1304  * \param major Major tick size.
1305  * \param minor Major tick size.
1306  */
1307 OF_EXPORT void OF_FCN(ofcoordaxes_setticksize)(unsigned int *major, unsigned int *minor);
1308 
1309 /*
1310  * \brief Sets an image to be used for the tick, overriding any existing shader.
1311  *
1312  * If an empty string is provided, the tick marker is reset.
1313  *
1314  * This applies to the current active CoordinateAxes.
1315  *
1316  * \param fname File containing the image.
1317  */
1318 OF_EXPORT void OF_FCN(ofcoordaxes_settickimage)(OF_CHARARG(fname));
1319 
1320 /*
1321  * \brief Set GLSL fragment shader used to draw tick mark, overriding any existing image.
1322  *
1323  * If an empty string is provided, the tick marker is reset.
1324  *
1325  * This applies to the current active CoordinateAxes.
1326  *
1327  * \param fname File containing the shader source.
1328  */
1329 OF_EXPORT void OF_FCN(ofcoordaxes_settickshader)(OF_CHARARG(fname));
1330 
1331 /******************************************************************
1332  LatLonGrid Functions
1333 A LatLonGrid is a ReferenceFrame that draws a spherical latitude/longitude
1334 grid with specified radius and line spacings.
1335 ******************************************************************/
1336 
1337 /*
1338  * \brief Create a new LatLonGrid with the given name.
1339  *
1340  * This new LatLonGrid will also become the current active one.
1341  *
1342  * \param name Name of the grid to create.
1343  */
1344 OF_EXPORT void OF_FCN(oflatlongrid_create)(OF_CHARARG(name));
1345 
1346 /*
1347  * \brief Sets the parameters of the LatLonGrid.
1348  *
1349  * This applies to the current active LatLonGrid.
1350  *
1351  * \param radius Radius of the grid.
1352  * \param latSpace Spacing between latitude grid lines in radians.
1353  * \param lonSpace Spacing between longitude grid lines in radians.
1354  */
1355 OF_EXPORT void OF_FCN(oflatlongrid_setparameters)(double *radius,
1356  double *latSpace,
1357  double *lonSpace);
1358 
1359 /******************************************************************
1360  RadialPlane Functions
1361 A RadialPlane is a ReferenceFrame that draws a circular X/Y plane with
1362 specified radius, radial circle distance, and longitude line spacing.
1363 ******************************************************************/
1364 
1365 /*
1366  * \brief Create a new RadialPlane with the given name.
1367  *
1368  * This new RadialPlane will also become the current active one.
1369  *
1370  * \param name Name of the radial plane to create.
1371  */
1372 OF_EXPORT void OF_FCN(ofradialplane_create)(OF_CHARARG(name));
1373 
1374 /*
1375  * \brief Sets the parameters of the RadialPlane.
1376  *
1377  * This applies to the current active RadialPlane.
1378  *
1379  * \param radius Radius of the radial plane.
1380  * \param radSpace Spacing between radial grid lines in radians.
1381  * \param lonSpace Spacing between longitude grid lines in radians.
1382  */
1383 OF_EXPORT void OF_FCN(ofradialplane_setparameters)(double *radius,
1384  double *radSpace,
1385  double *lonSpace);
1386 
1387 /*
1388  * \brief Set the plane color of the current radial plane.
1389  *
1390  * This applies to the current active RadialPlane.
1391  *
1392  * \param r Red color component [0-1].
1393  * \param g Green color component [0-1].
1394  * \param b Blue color component [0-1].
1395  * \param a Alpha (transparancy) component [0-1].
1396  */
1397 OF_EXPORT void OF_FCN(ofradialplane_setplanecolor)(float *r, float *g,
1398  float *b, float *a);
1399 
1400 /*
1401  * \brief Set the line color of the current radial plane.
1402  *
1403  * This applies to the current active RadialPlane.
1404  *
1405  * \param r Red color component [0-1].
1406  * \param g Green color component [0-1].
1407  * \param b Blue color component [0-1].
1408  * \param a Alpha (transparancy) component [0-1].
1409  */
1410 OF_EXPORT void OF_FCN(ofradialplane_setlinecolor)(float *r, float *g,
1411  float *b, float *a);
1412 
1413 /******************************************************************
1414  Trajectory Functions
1415 ******************************************************************/
1416 
1417 /*
1418  * \brief Set the currently-active trajectory.
1419  *
1420  * \param name Name of the Trajectory to activate.
1421  */
1422 OF_EXPORT void OF_FCN(oftraj_activate)(OF_CHARARG(name));
1423 
1424 /*
1425  * \brief Create a new Trajectory with the given name.
1426  *
1427  * This new Trajectory will also become the current active one.
1428  *
1429  * This applies to the current active Trajectory.
1430  *
1431  * \param name Name of the trajectory to create.
1432  * \param dof Number of degrees of freedom this trajectory has.
1433  * \param numopt Number of optionals this trajectory has.
1434  */
1435 #if defined(IFORT_CALLS)
1436 OF_EXPORT void OF_FCN(oftraj_create)(const char *name, unsigned int *dof,
1437  unsigned int *numopt,
1438  unsigned int namelen);
1439 #else
1440 OF_EXPORT void OF_FCN(oftraj_create)(OF_CHARARG(name), unsigned int *dof,
1441  unsigned int *numopt);
1442 #endif
1443 
1444 /*
1445  * \brief Change the number of optionals for the currently active Trajectory.
1446  *
1447  * Each optional has an x/y/z component added.
1448  *
1449  * This applies to the current active Trajectory.
1450  *
1451  * \param nopt Number of optional coordinates to set.
1452  */
1453 OF_EXPORT void OF_FCN(oftraj_setnumoptionals)(unsigned int *nopt);
1454 
1455 /*
1456  * \brief Change the degrees of freedom for the currently-active Trajectory.
1457  *
1458  * This applies to the current active Trajectory.
1459  *
1460  * \param dof Desired number of degrees of freedom.
1461  */
1462 OF_EXPORT void OF_FCN(oftraj_setdof)(unsigned int *dof);
1463 
1464 /*
1465  * \brief Add a time to the current trajectory.
1466  *
1467  * This applies to the current active Trajectory.
1468  *
1469  * Future positions/attitudes/optionals added to this trajectory will correspond to this time until a new call to oftraj_addtime().
1470  *
1471  * \param t Time.
1472  */
1473 OF_EXPORT void OF_FCN(oftraj_addtime)(const double *t);
1474 
1475 /*
1476  * \brief Add a position to the current trajectory.
1477  *
1478  * Add a position as long as the new number of positions will not exceed
1479  * the current number of times. Note that for 2D trajectories, the z
1480  * component will be ignored.
1481  *
1482  * This position corresponds to the most recent time provided by oftraj_addtime().
1483  *
1484  * /warning If multiple positions are added after the previous call to oftraj_addtime(), all but the last position will be overwritten.
1485  *
1486  * \param x X position.
1487  * \param y Y position.
1488  * \param z Z position.
1489  */
1490 OF_EXPORT void OF_FCN(oftraj_addposition)(const double *x, const double *y,
1491  const double *z);
1492 
1493 /*
1494  * \brief Add a position to the current trajectory.
1495  *
1496  * This applies to the current active Trajectory.
1497  *
1498  * This position corresponds to the most recent time provided by oftraj_addtime().
1499  *
1500  * \param pos Position array to add (length 3).
1501  */
1502 OF_EXPORT void OF_FCN(oftraj_addpositionvec)(const double pos[]);
1503 
1504 /*
1505  * \brief Add an attitude to the current trajectory.
1506  *
1507  * This applies to the current active Trajectory. It is ignored if the new
1508  * number of attitudes will exceed the current number of times.
1509  * The attitude is given as a 4-element quaternion.
1510  *
1511  * \param x X component of the rotation quaternion.
1512  * \param y Y component of the rotation quaternion.
1513  * \param z Z component of the rotation quaternion.
1514  * \param w Angle component of the rotation quaternion.
1515  */
1516 OF_EXPORT void OF_FCN(oftraj_addattitude)(const double *x, const double *y,
1517  const double *z, const double *w);
1518 
1519 /*
1520  * \brief Set the attitude of the current trajectory.
1521  *
1522  * This applies to the current active Trajectory.
1523  *
1524  * \param att Quaternion array to add (length 4). The vector component of the quaternion precedes the scalar component.
1525  */
1526 OF_EXPORT void OF_FCN(oftraj_addattitudevec)(const double att[]);
1527 
1528 /*
1529  * \brief Set the optional with the given index, for the most recently-added position.
1530  *
1531  * This applies to the current active Trajectory.
1532  * The index must be in the range [0, num optionals - 1].
1533  *
1534  * This optional corresponds to the most recent time provided by oftraj_addtime().
1535  *
1536  * \param index index of optional to add values to.
1537  * \param x X component of optional.
1538  * \param y Y component of optional.
1539  * \param z Z component of optional.
1540  */
1541 OF_EXPORT void OF_FCN(oftraj_setoptional)(unsigned int *index, const double *x,
1542  const double *y, const double *z);
1543 
1544 /*
1545  * \brief Set the optional with the given index, for the most recently added position.
1546  *
1547  * This applies to the current active Trajectory.
1548  * Here the optional is given as a 2 or 3 element vector.
1549  *
1550  * This optional corresponds to the most recent time provided by oftraj_addtime().
1551  *
1552  * \param index index of optional to add values to.
1553  * \param opt Array of values to add to optional (length 3).
1554  */
1555 OF_EXPORT void OF_FCN(oftraj_setoptionalvec)(unsigned int *index, const double opt[]);
1556 
1557 /*
1558  * \brief Clear all points from the currently active Trajectory.
1559  *
1560  * This applies to the current active Trajectory.
1561  */
1562 OF_EXPORT void OF_FCN(oftraj_clear)();
1563 
1564 /*
1565  * \brief Inform drawable trajectories to redraw this trajectory.
1566  *
1567  * This is only necessary to call if oftraj_autoinformartists() has been set to false. By default, the artists are informed every time data is added.
1568  *
1569  * This applies to the current active Trajectory and all the TrajectoryArtists that are linked to it.
1570  */
1571 OF_EXPORT void OF_FCN(oftraj_informartists)();
1572 
1573 /*
1574  * \brief Inform drawable trajecotries to redraw this trajectory.
1575  *
1576  * If this function is not called, the default is to automatically inform the artists.
1577  *
1578  * If auto-inform is disabled, the artists will still be automatically informed if the data is cleared, or the number of optional coordinates is modified.
1579  *
1580  * This applies to the current active Trajectory and all the TrajectoryArtists that are linked to it.
1581  *
1582  * \param autoinform True to auto-inform linked artists when data is added to this trajectory.
1583  * False to not inform artists unless oftraj_autoinformartists() is called.
1584  */
1585 OF_EXPORT void OF_FCN(oftraj_autoinformartists)(bool *autoinform);
1586 
1587 /******************************************************************
1588  TrajectoryArtist Functions
1589 A TrajectoryArtist graphically interprets the data contained in a
1590 Trajectory. Since it is not a ReferenceFrame, it must be attached
1591 to a DrawableTrajectory before it can be added to a scene. Note that
1592 you cannot create a TrajectoryArtist by itself. You must create one
1593 of its derived types (eg CurveArtist etc...).
1594 ******************************************************************/
1595 
1596 /*
1597  * \brief Set the currently active trajectory artist.
1598  *
1599  * \param name Name of the TrajectoryArtist to activate.
1600  */
1601 OF_EXPORT void OF_FCN(oftrajartist_activate)(OF_CHARARG(name));
1602 
1603 /*
1604  * \brief Set the currently-active trajectory artist.
1605  *
1606  * \param name Name of the TrajectoryArtist to activate.
1607  */
1608 OF_EXPORT void OF_FCN(oftrajartist_settrajectory)();
1609 
1610 /*****************************************************************
1611  CurveArtist Functions
1612 A CurveArtist is a type of TrajectoryArtist that allows arbitrary
1613 Trajectory data to be used for plotting (x,y,z) points. Since it
1614 is a type of Trajectory, a CurveArtist has all Trajectory functions
1615 available to it.
1616 *****************************************************************/
1617 
1618 /*
1619  * \brief Create a new CurveArtist with the given name.
1620  *
1621  * This new CurveArtist will also become the current active one.
1622  *
1623  * \param name Name of the curve artist to create.
1624  */
1625 OF_EXPORT void OF_FCN(ofcurveartist_create)(OF_CHARARG(name));
1626 
1627 /*
1628  * \brief Set the data used for X coordinates of each point.
1629  *
1630  * This applies to the current active CurveArtist.
1631  *
1632  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1633  * \param element Array index of the data indicated in src to plot.
1634  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1635  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1636  * \param scale Scale factor to apply to drawn trajectory data.
1637  */
1638 OF_EXPORT void OF_FCN(ofcurveartist_setxdata)(int *src, unsigned int *element,
1639  unsigned int *opt, double *scale);
1640 
1641 /*
1642  * \brief Set the data used for Y coordinates of each point.
1643  *
1644  * This applies to the current active CurveArtist.
1645  *
1646  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1647  * \param element Array index of the data indicated in src to plot.
1648  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1649  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1650  * \param scale Scale factor to apply to drawn trajectory data.
1651  */
1652 OF_EXPORT void OF_FCN(ofcurveartist_setydata)(int *src, unsigned int *element,
1653  unsigned int *opt, double *scale);
1654 
1655 /*
1656  * \brief Set the data used for Z coordinates of each point.
1657  *
1658  * This applies to the current active CurveArtist.
1659  *
1660  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1661  * \param element Array index of the data indicated in src to plot.
1662  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1663  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1664  * \param scale Scale factor to apply to drawn trajectory data.
1665  */
1666 OF_EXPORT void OF_FCN(ofcurveartist_setzdata)(int *src, unsigned int *element,
1667  unsigned int *opt, double *scale);
1668 
1669 /*
1670  * \brief Set the color of the current curve artist.
1671  *
1672  * This applies to the current active CurveArtist.
1673  *
1674  * \param r Red color component [0-1].
1675  * \param g Green color component [0-1].
1676  * \param b Blue color component [0-1].
1677  */
1678 OF_EXPORT void OF_FCN(ofcurveartist_setcolor)(float *r, float *g, float *b);
1679 
1680 /*
1681  * \brief Set the width of the current curve artist.
1682  *
1683  * This applies to the current active CurveArtist.
1684  *
1685  * \param width Width of the line.
1686  */
1687 OF_EXPORT void OF_FCN(ofcurveartist_setwidth)(float *width);
1688 
1689 /*
1690 * \brief Set the line pattern of the current curve artist.
1691 *
1692 * This applies to the current active CurveArtist.
1693 *
1694 * For valid factors and patterns, see OpenGL::glLineStipple().
1695 *
1696 * \param factor Specifies scaling factor used to draw the pattern.
1697 * \param pattern 16-bit integer which specifies the line pattern.
1698 */
1699 OF_EXPORT void OF_FCN(ofcurveartist_setpattern)(int *factor, unsigned short *pattern);
1700 
1701 /*****************************************************************
1702  SegmentArtist Functions
1703 A SegmentArtist is a type of TrajectoryArtist that allows arbitrary
1704 Trajectory data to be used for plotting line segments. Since it
1705 is a type of Trajectory, a SegmentArtist has all Trajectory functions
1706 available to it.
1707 *****************************************************************/
1708 
1709 /*
1710  * \brief Create a new SegmentArtist with the given name.
1711  *
1712  * This new SegmentArtist will also become the current active one.
1713  *
1714  * \param name Name of the segment artist to create.
1715  */
1716 OF_EXPORT void OF_FCN(ofsegmentartist_create)(OF_CHARARG(name));
1717 
1718 /*
1719  * \brief Set the data used for starting X coordinate of each segment.
1720  *
1721  * This applies to the current active SegmentArtist.
1722  *
1723  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1724  * \param element Array index of the data indicated in src to plot.
1725  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1726  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1727  * \param scale Scale factor to apply to drawn trajectory data.
1728  */
1729 OF_EXPORT void OF_FCN(ofsegmentartist_setstartxdata)(int *src, unsigned int *element,
1730  unsigned int *opt, double *scale);
1731 
1732 /*
1733  * \brief Set the data used for starting Y coordinate of each segment.
1734  *
1735  * This applies to the current active SegmentArtist.
1736  *
1737  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1738  * \param element Array index of the data indicated in src to plot.
1739  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1740  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1741  * \param scale Scale factor to apply to drawn trajectory data.
1742  */
1743 OF_EXPORT void OF_FCN(ofsegmentartist_setstartydata)(int *src, unsigned int *element,
1744  unsigned int *opt, double *scale);
1745 
1746 /*
1747  * \brief Set the data used for starting Z coordinate of each segment.
1748  *
1749  * This applies to the current active SegmentArtist.
1750  *
1751  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1752  * \param element Array index of the data indicated in src to plot.
1753  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1754  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1755  * \param scale Scale factor to apply to drawn trajectory data.
1756  */
1757 OF_EXPORT void OF_FCN(ofsegmentartist_setstartzdata)(int *src, unsigned int *element,
1758  unsigned int *opt, double *scale);
1759 
1760 /*
1761 * \brief Set the data used for ending X coordinate of each segment.
1762 *
1763 * This applies to the current active SegmentArtist.
1764 *
1765 * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1766 * \param element Array index of the data indicated in src to plot.
1767 * \param opt Indicate if a position or optional is plotted. 0 is for position,
1768 * other values indicate the index of the optional to use. Only used if src = POSOPT.
1769 * \param scale Scale factor to apply to drawn trajectory data.
1770 **/
1771 OF_EXPORT void OF_FCN(ofsegmentartist_setendxdata)(int *src, unsigned int *element,
1772  unsigned int *opt, double *scale);
1773 
1774 /*
1775  * \brief Set the data used for ending Y coordinate of each segment.
1776  *
1777  * This applies to the current active SegmentArtist.
1778  *
1779  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1780  * \param element Array index of the data indicated in src to plot.
1781  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1782  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1783  * \param scale Scale factor to apply to drawn trajectory data.
1784  */
1785 OF_EXPORT void OF_FCN(ofsegmentartist_setendydata)(int *src, unsigned int *element,
1786  unsigned int *opt, double *scale);
1787 
1788 /*
1789  * \brief Set the data used for ending Z coordinate of each segment.
1790  *
1791  * This applies to the current active SegmentArtist.
1792  *
1793  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1794  * \param element Array index of the data indicated in src to plot.
1795  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1796  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1797  * \param scale Scale factor to apply to drawn trajectory data.
1798  */
1799 OF_EXPORT void OF_FCN(ofsegmentartist_setendzdata)(int *src, unsigned int *element,
1800  unsigned int *opt, double *scale);
1801 
1802 /*
1803  * \brief Set the offset between drawn points.
1804  *
1805  * This applies to the current active SegmentArtist.
1806  *
1807  * \param stride Minimum offset between sucessive drawn points.
1808  */
1809 OF_EXPORT void OF_FCN(ofsegmentartist_setstride)(unsigned int *stride);
1810 
1811 // Set line attributes
1812 
1813 /*
1814  * \brief Set the color of the current segment artist.
1815  *
1816  * This applies to the current active SegmentArtist.
1817  *
1818  * \param r Red color component [0-1].
1819  * \param g Green color component [0-1].
1820  * \param b Blue color component [0-1].
1821  */
1822 OF_EXPORT void OF_FCN(ofsegmentartist_setcolor)(float *r, float *g, float *b);
1823 
1824 /*
1825  * \brief Set the width of the current segment artist.
1826  *
1827  * This applies to the current active SegmentArtist.
1828  *
1829  * \param width Width of the line.
1830  */
1831 OF_EXPORT void OF_FCN(ofsegmentartist_setwidth)(float *width);
1832 
1833 /*
1834  * \brief Set the line pattern of the current segment artist.
1835  *
1836  * For valid factors and patterns, see OpenGL::glLineStipple().
1837  *
1838  * This applies to the current active SegmentArtist.
1839  *
1840  * \param factor Specifies scaling factor used to draw the pattern.
1841  * \param pattern 16-bit integer which specifies the line pattern.
1842  */
1843 OF_EXPORT void OF_FCN(ofsegmentartist_setpattern)(int *factor, unsigned short *pattern);
1844 
1845 /*****************************************************************
1846  MarkerArtist Functions
1847 A MarkerArtist is a type of TrajectoryArtist that plots markers at the
1848 start/end of a trajectory. The marker style can be customized.
1849 *****************************************************************/
1850 
1851 /*
1852  * \brief Create a new MarkerArtist with the given name.
1853  *
1854  * This new MarkerArtist will also become the current active one.
1855  *
1856  * \param name Name of the marker artist to create.
1857  */
1858 OF_EXPORT void OF_FCN(ofmarkerartist_create)(OF_CHARARG(name));
1859 
1860 /*
1861  * \brief Set the data used for X coordinates of each point.
1862  *
1863  * This applies to the current active MarkerArtist.
1864  *
1865  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1866  * \param element Array index of the data indicated in src to plot.
1867  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1868  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1869  * \param scale Scale factor to apply to drawn trajectory data.
1870  */
1871 OF_EXPORT void OF_FCN(ofmarkerartist_setxdata)(int *src, unsigned int *element,
1872  unsigned int *opt, double *scale);
1873 
1874 /*
1875  * \brief Set the data used for Y coordinates of each point.
1876  *
1877  * This applies to the current active MarkerArtist.
1878  *
1879  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1880  * \param element Array index of the data indicated in src to plot.
1881  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1882  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1883  * \param scale Scale factor to apply to drawn trajectory data.
1884  */
1885 OF_EXPORT void OF_FCN(ofmarkerartist_setydata)(int *src, unsigned int *element,
1886  unsigned int *opt, double *scale);
1887 
1888 /*
1889  * \brief Set the data used for Z coordinates of each point.
1890  *
1891  * This applies to the current active MarkerArtist.
1892  *
1893  * \param src Type of data source to draw (see OpenFrames::Trajectory::SourceType enum).
1894  * \param element Array index of the data indicated in src to plot.
1895  * \param opt Indicate if a position or optional is plotted. 0 is for position,
1896  * other values indicate the index of the optional to use. Only used if src = POSOPT.
1897  * \param scale Scale factor to apply to drawn trajectory data.
1898  */
1899 OF_EXPORT void OF_FCN(ofmarkerartist_setzdata)(int *src, unsigned int *element,
1900  unsigned int *opt, double *scale);
1901 
1902 /*
1903  * \brief Define which markers should be plotted for the current marker artist.
1904  *
1905  * This applies to the current active MarkerArtist.
1906  *
1907  * \param markers Indicates which data points should be drawn as markers (see: OpenFrames::MarkerArtist::DrawnMarkers enum).
1908  */
1909 OF_EXPORT void OF_FCN(ofmarkerartist_setmarkers)( unsigned int *markers );
1910 
1911 /*
1912  * \brief Set the color of the current marker artist.
1913  *
1914  * This applies to the current active MarkerArtist.
1915  *
1916  * \param markers The markers whose color should be set (see: OpenFrames::MarkerArtist::DrawnMarkers enum).
1917  * \param r Red color component [0-1].
1918  * \param g Green color component [0-1].
1919  * \param b Blue color component [0-1].
1920  */
1921 OF_EXPORT void OF_FCN(ofmarkerartist_setmarkercolor)( unsigned int *markers, float *r, float *g, float *b );
1922 
1923 /*
1924  * \brief Set image used as marker, overriding any existing shader.
1925  *
1926  * If an empty string is given, then use default circular point.
1927  *
1928  * This applies to the current active MarkerArtist.
1929  *
1930  * \param fname File containing the image.
1931  */
1932 OF_EXPORT void OF_FCN(ofmarkerartist_setmarkerimage)(OF_CHARARG(fname));
1933 
1934 /*
1935  * \brief Set GLSL fragment shader used to draw marker, overriding any existing image.
1936  *
1937  * If an empty string is given, then use default circular point.
1938  *
1939  * This applies to the current active MarkerArtist.
1940  *
1941  * \param fname File containing the shader source.
1942  */
1943 OF_EXPORT void OF_FCN(ofmarkerartist_setmarkershader)(OF_CHARARG(fname));
1944 
1945 /*
1946  * \brief Specify which type of intermediate markers should be drawn.
1947  *
1948  * This applies to the current active MarkerArtist.
1949  *
1950  * \param type Indicates how intermediate marker spacing is determined (see: OpenFrames::MarkerArtist::IntermediateType enum).
1951  */
1952 OF_EXPORT void OF_FCN(ofmarkerartist_setintermediatetype)( unsigned int *type );
1953 
1954 /*
1955  * \brief Specify the spacing used for intermediate markers.
1956  *
1957  * This applies to the current active MarkerArtist.
1958  *
1959  * \param spacing Set spacing for intermediate markers.
1960  */
1961 OF_EXPORT void OF_FCN(ofmarkerartist_setintermediatespacing)( double *spacing );
1962 
1963 /*
1964  * \brief Specify the drawing direction (from start or end) of intermediate markers.
1965  *
1966  * This applies to the current active MarkerArtist.
1967  *
1968  * \param direction Set intermediate marker direction (see: OpenFrames::MarkerArtist::DrawnMarkers enum).
1969  */
1970 OF_EXPORT void OF_FCN(ofmarkerartist_setintermediatedirection)( unsigned int *direction );
1971 
1972 /*
1973  * \brief Specify the marker size in pixels.
1974  *
1975  * This applies to the current active MarkerArtist.
1976  *
1977  * \param size The marker size.
1978  */
1979 OF_EXPORT void OF_FCN(ofmarkerartist_setmarkersize)( unsigned int *size );
1980 
1981 /*
1982  * \brief Specify whether marker size should be automatically attenuated.
1983  *
1984  * This applies to the current active MarkerArtist.
1985  *
1986  * \param autoattenuate True to automatically attenuate marker size, False otherwise.
1987  */
1988 OF_EXPORT void OF_FCN(ofmarkerartist_setautoattenuate)( bool *autoattenuate );
1989 
1990 /*****************************************************************
1991  View Functions
1992 A View represents the "camera" that looks at a scene. It controls the
1993 projection (like the lens of the camera) and modelview (like the position
1994 of the camera) matrices. Views are added to grid positions in a WindowProxy,
1995 and multiple Views are allowed for each grid position.
1996 *****************************************************************/
1997 
1998 /*
1999  * \brief Set the currently active view.
2000  *
2001  * \param name Name of the View to activate.
2002  */
2003 OF_EXPORT void OF_FCN(ofview_activate)(OF_CHARARG(name));
2004 
2005 /*
2006  * \brief Create a new View with the given name.
2007  *
2008  * This new View will also become the current active one.
2009  *
2010  * \param name Name of the view to create
2011  */
2012 OF_EXPORT void OF_FCN(ofview_create)(OF_CHARARG(name));
2013 
2014 /*
2015  * \brief Set an orthographic projection with the given bounds.
2016  *
2017  * This applies to the current active View.
2018  *
2019  * \param left Left coordinate bound of orthographic projection.
2020  * \param right Right coordinate bound of orthographic projection.
2021  * \param bottom Bottom coordinate bound of orthographic projection.
2022  * \param top Top coordinate bound of orthographic projection.
2023  */
2024 OF_EXPORT void OF_FCN(ofview_setorthographic)(double *left, double *right,
2025  double *bottom, double *top);
2026 
2027 /*
2028  * \brief Set the current view to use a symmetric perspective projection.
2029  *
2030  * This applies to the current active View.
2031  *
2032  * \param fov Vertical field of view (in degrees).
2033  * \param ratio x/y aspect ratio.
2034  */
2035 OF_EXPORT void OF_FCN(ofview_setperspective)(double *fov, double *ratio);
2036 
2037 /*
2038  * \brief Tell current view to follow the specified ReferenceFrame.
2039  *
2040  * The 'root' input should be set to the root of the ReferenceFrame heirarchy, and the
2041  * 'frame' input should be set to whatever frame you want to view. Note that
2042  * this function does NOT use or modify the currently active ReferenceFrame.
2043  *
2044  * This applies to the current active View.
2045  *
2046  * \param root Name of the root of the ReferenceFrame heirarchy.
2047  * \param frame ReferenceFrame to follow with this view.
2048  */
2049 #if defined(IFORT_CALLS)
2050 OF_EXPORT void OF_FCN(ofview_setviewframe)(const char *root, const char *frame, unsigned int rootlen, unsigned int framelen);
2051 #else
2052 OF_EXPORT void OF_FCN(ofview_setviewframe)(OF_CHARARG(root),
2053  OF_CHARARG(frame));
2054 #endif
2055 
2056 /*
2057  * \brief View from one frame towards another, using a specified frame type and rotation type.
2058  *
2059  * The 'root' input should be set to the root of the ReferenceFrame
2060  * heirarchy, and must contain 'srcframe' and 'dstframe'. Note that
2061  * this function does NOT use or modify the currently active ReferenceFrame.
2062  *
2063  * This applies to the current active View.
2064  *
2065  * /see OpenFrames::View::ViewFrameType and OpenFrames::View::ViewRotationType.
2066  *
2067  * \param root Name of the root of the ReferenceFrame heirarchy. Note: Must contain 'srcframe' and 'dstframe'.
2068  * \param srcframe ReferenceFrame this view will look from.
2069  * \param dstframe ReferenceFrame this view will look towards.
2070  * \param frameType Frame type to use (see: OpenFrames::View::ViewFrameType enum)
2071  * \param rotationType Rotation type to use when following dstframe (see: OpenFrames::View::ViewRotationType enum).
2072  */
2073 #if defined(IFORT_CALLS)
2074 OF_EXPORT void OF_FCN(ofview_setviewbetweenframes)(const char *root, const char *srcframe, const char *dstframe, unsigned int *frameType, unsigned int *rotationType, unsigned int rootlen, unsigned int srcframelen, unsigned int dstframelen);
2075 #else
2076 OF_EXPORT void OF_FCN(ofview_setviewbetweenframes)(OF_CHARARG(root), OF_CHARARG(srcframe), OF_CHARARG(dstframe), unsigned int *frameType, unsigned int *rotationType);
2077 #endif
2078 
2079 /*
2080  * \brief Set the default view distance.
2081  *
2082  * This applies to the current active View.
2083  *
2084  * \param distance Distance the camera is from the terget point of the reference frame.
2085  * A value <= 0.0 means the distance should be auto-computed.
2086  */
2087 OF_EXPORT void OF_FCN(ofview_setdefaultviewdistance)(double *distance);
2088 
2089 /*
2090  * \brief Get the trackball's view matrix.
2091  *
2092  * This applies to the current active View.
2093  *
2094  * \param eye 3-vector eye position.
2095  * \param center 3-vector look-at position.
2096  * \param up 3-vector up vector.
2097  */
2098 OF_EXPORT void OF_FCN(ofview_gettrackball)(double eye[], double center[], double up[]);
2099 
2100 /*
2101  * \brief Set the trackball view matrix.
2102  *
2103  * This applies to the current active View.
2104  *
2105  * \param eye 3-vector eye position.
2106  * \param center 3-vector look-at position.
2107  * \param up 3-vector up vector.
2108  */
2109 OF_EXPORT void OF_FCN(ofview_settrackball)(double eye[], double center[], double up[]);
2110 
2111 /*
2112  * \brief Check if the view frame for the current View is valid.
2113  *
2114  * One reason for an invalid view is if the frame to be viewed is not a child of the specified root frame.
2115  *
2116  * This applies to the current active View.
2117  *
2118  * \param valid Returned value if the view is valid.
2119  */
2120 OF_EXPORT void OF_FCN(ofview_isvalid)(bool *valid);
2121 
2122 /*
2123  * \brief Reset the view to its default state.
2124  *
2125  * This applies to the current active View.
2126  */
2127 OF_EXPORT void OF_FCN(ofview_reset)();
2128 
2129 #ifdef __cplusplus
2130 }
2131 #endif
2132 
2133 #endif
OF_EXPORT void OF_FCN() offrame_addchild(OF_CHARARG(name))
Add a child frame to the current frame.
#define KEYPRESS_SIG
Definition: OF_Interface.h:53
#define OF_CHARARG(name)
Definition: OF_Interface.h:45
#define OF_FCN(name)
Definition: OF_Interface.h:29
#define BUTTON_SIG
Definition: OF_Interface.h:57
#define MOUSEMOTION_SIG
Definition: OF_Interface.h:55