ogsflib.dox 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. /*! \page ogsflib GRASS GIS OGSF Library
  2. <!-- doxygenized from "GRASS 5 Programmer's Manual"
  3. by M. Neteler 2/2004
  4. Updated by Martin Landa <landa.martin gmail.com> in 6/2011
  5. -->
  6. by GRASS Development Team (https://grass.osgeo.org)
  7. \section ogsfintro OGSF Library for OpenGL programming
  8. <b>Overview</b>
  9. The OGSF (gsurf) library, consisting of approximately 27,000 lines of
  10. C code, contains some 250 public functions and about twice as many
  11. internal functions for run-time data storage, manipulation, querying,
  12. and visualization using OpenGL. The library handles all drawing and
  13. lighting operations, including use of user-defined clipping planes and
  14. drawing various style "fences" on clipping planes when drawing
  15. multiple surfaces, and treats datasets as objects which can be used
  16. for various attributes of the rendering. It allows data sharing
  17. (%e.g., same data for more than one attribute of same or different
  18. surfaces), separate masking for each surface, multiple surfaces,
  19. %vector sets, or %point sets, and will also allow multiple volumes.
  20. The library provides all query features such as 3D "point on surface",
  21. keyframe animation routines, and full state saving functionality.
  22. Database-specific routines for interfacing with the \ref gislib are
  23. kept isolated for easier library reuse with other databases. The
  24. gsurf library is not dependent upon any particular interface library,
  25. and has been used successfully with both Motif, Tcl/Tk or wxPython. It
  26. is used for Nviz visualization tool.
  27. The library is designed to provide a unique "handle" or identifier
  28. number to the calling program for each new geographic object added to
  29. the model. The object could be a surface, %vector set, or %point set,
  30. which could each be defined by one or more database files. Once
  31. created, the application only needs to keep track of the "handles" to
  32. the objects (which are returned by the creation routines); for
  33. example, to draw a surface the application would make the call:
  34. \subsection ogsfNames Naming Conventions
  35. The following naming conventions for function prefixes are used:
  36. - <b>GS_</b> - Functions which have to do with loading &amp;
  37. manipulating surfaces. Also functions for library
  38. initialization, setting global variables, viewer positioning,
  39. and lighting.
  40. - <b>GSU_</b> - Utility functions for distance calculations, common
  41. 2D &amp; 3D unit %vector operations such as cross product or
  42. %vector arithmetic.
  43. - <b>GV_</b> - Functions which have to do with loading &amp;
  44. manipulating %vector sets.
  45. - <b>GP_</b> - Functions which have to do with loading &amp;
  46. manipulating %point sets.
  47. - <b>GVL_</b> - Functions which have to do with loading &amp;
  48. manipulating 3D volumes.
  49. - <b>GK_</b> - Functions which have to do with setting &amp;
  50. manipulating keyframes for viewer position animation (fly-bys).
  51. Programmers' documentation is currently incomplete, but see the
  52. following for more details of the library design and capabilities in
  53. the appendix (PLEASE ADD EXPLANATIONS!!):
  54. - public function prototypes
  55. - public include file include/gsurf.h
  56. - public include file include/keyframe.h
  57. - public color packing utility macros rgbpack.h
  58. - private types and defines include/gstypes.h
  59. - private utilities gsget.h
  60. \section ogsfTodo Major todos
  61. - remove global variables
  62. - dynamically allocate items instead of static arrays
  63. - merge GP_ functions into GV_
  64. \section ogsfPublic Public function prototypes
  65. \subsection ogsfGs Initialization and positioning surfaces (GS)
  66. Functions which have to do with loading &amp; manipulating surfaces.
  67. Also functions for library initialization, setting global variables,
  68. viewer positioning, and lighting.
  69. - GS_alldraw_cplane_fences()
  70. - GS_alldraw_surf()
  71. - GS_alldraw_wire()
  72. - GS_check_cancel()
  73. - GS_clear()
  74. - GS_coordpair_repeats()
  75. - GS_delete_list()
  76. - GS_delete_surface()
  77. - GS_distance()
  78. - GS_done_draw()
  79. - GS_draw_all_list()
  80. - GS_draw_cplane()
  81. - GS_draw_cplane_fence()
  82. - GS_draw_flowline_at_xy()
  83. - GS_draw_fringe()
  84. - GS_draw_legend()
  85. - GS_draw_lighting_model()
  86. - GS_draw_lighting_model1()
  87. - GS_draw_line_onsurf()
  88. - GS_draw_nline_onsurf()
  89. - GS_draw_surf()
  90. - GS_draw_wire()
  91. - GS_draw_X()
  92. - GS_dv3norm()
  93. - GS_geodistance()
  94. - GS_get_aspect()
  95. - GS_get_att()
  96. - GS_get_cat_at_xy()
  97. - GS_Get_ClientData()
  98. - GS_get_dims()
  99. - GS_get_distance_alongsurf()
  100. - GS_get_drawmode()
  101. - GS_get_drawres()
  102. - GS_get_exag_guess()
  103. - GS_get_fencecolor()
  104. - GS_get_focus()
  105. - GS_get_fov()
  106. - GS_get_from()
  107. - GS_get_from_real()
  108. - GS_getlight_ambient()
  109. - GS_getlight_color()
  110. - GS_getlight_position()
  111. - GS_get_longdim()
  112. - GS_get_maskmode()
  113. - GS_get_modelposition()
  114. - GS_get_modelposition1()
  115. - GS_get_norm_at_xy()
  116. - GS_get_nozero()
  117. - GS_get_region()
  118. - GS_get_scale()
  119. - GS_get_SDscale()
  120. - GS_get_SDsurf()
  121. - GS_get_selected_point_on_surface()
  122. - GS_get_surf_list()
  123. - GS_get_to()
  124. - GS_get_to_real()
  125. - GS_get_trans()
  126. - GS_get_twist()
  127. - GS_get_val_at_xy()
  128. - GS_get_viewdir()
  129. - GS_get_wire_color()
  130. - GS_get_zextents()
  131. - GS_get_zrange()
  132. - GS_get_zrange_nz()
  133. - GS_global_exag()
  134. - GS_has_transparency()
  135. - GS_init_view()
  136. - GS_is_masked()
  137. - GS_libinit()
  138. - GS_lights_off()
  139. - GS_lights_on()
  140. - GS_load_3dview()
  141. - GS_load_att_map()
  142. - GS_look_here()
  143. - GS_moveto()
  144. - GS_moveto_real()
  145. - GS_new_light()
  146. - GS_new_surface()
  147. - GS_num_surfs()
  148. - GS_P2distance()
  149. - GS_ready_draw()
  150. - GS_save_3dview()
  151. - GS_setall_drawmode()
  152. - GS_setall_drawres()
  153. - GS_set_att_const()
  154. - GS_set_att_defaults()
  155. - GS_set_cancel()
  156. - GS_Set_ClientData()
  157. - GS_set_cplane()
  158. - GS_set_cplane_rot()
  159. - GS_set_cplane_trans()
  160. - GS_set_cxl_func()
  161. - GS_set_draw()
  162. - GS_set_drawmode()
  163. - GS_set_drawres()
  164. - GS_set_exag()
  165. - GS_set_fencecolor()
  166. - GS_set_focus()
  167. - GS_set_focus_center_map()
  168. - GS_set_focus_real()
  169. - GS_set_fov()
  170. - GS_set_global_exag()
  171. - GS_set_infocus()
  172. - GS_setlight_ambient()
  173. - GS_setlight_color()
  174. - GS_setlight_position()
  175. - GS_set_maskmode()
  176. - GS_set_Narrow()
  177. - GS_set_nofocus()
  178. - GS_set_nozero()
  179. - GS_set_SDscale()
  180. - GS_set_SDsurf()
  181. - GS_set_trans()
  182. - GS_set_twist()
  183. - GS_set_viewdir()
  184. - GS_set_viewport()
  185. - GS_set_wire_color()
  186. - GS_surf_exists()
  187. - GS_switchlight()
  188. - GS_transp_is_set()
  189. - GS_unset_att()
  190. - GS_unset_cplane()
  191. - GS_unset_SDsurf()
  192. - GS_update_curmask()
  193. - GS_update_normals()
  194. - GS_util.c()
  195. - GS_v2dir()
  196. - GS_v2norm()
  197. - GS_v3add()
  198. - GS_v3cross()
  199. - GS_v3dir()
  200. - GS_v3eq()
  201. - GS_v3mag()
  202. - GS_v3mult()
  203. - GS_v3norm()
  204. - GS_v3normalize()
  205. - GS_v3sub()
  206. - GS_write_ppm()
  207. - GS_write_tif()
  208. - GS_write_zoom()
  209. - GS_zoom_setup()
  210. \subsection ogsfGv Loading and manipulation of vector maps (GV)
  211. Functions which have to do with loading &amp; manipulating %vector
  212. sets.
  213. - GV_alldraw_fastvect()
  214. - GV_alldraw_vect()
  215. - GV_delete_vector()
  216. - GV_draw_fastvect()
  217. - GV_draw_vect()
  218. - GV_Get_ClientData()
  219. - GV_get_trans()
  220. - GV_get_vect_list()
  221. - GV_get_style()
  222. - GV_get_vectname()
  223. - GV_load_vector()
  224. - GV_new_vector()
  225. - GV_num_vects()
  226. - GV_select_surf()
  227. - GV_Set_ClientData()
  228. - GV_set_trans()
  229. - GV_set_style()
  230. - GV_surf_is_selected()
  231. - GV_unselect_surf()
  232. - GV_vect_exists()
  233. \subsection ogsfGp Loading and manipulation of vector point maps (GP)
  234. Functions which have to do with loading &amp; manipulating %point
  235. sets.
  236. - GP_alldraw_site()
  237. - GP_attmode_color()
  238. - GP_attmode_none()
  239. - GP_delete_site()
  240. - GP_draw_site()
  241. - GP_Get_ClientData()
  242. - GP_get_site_list()
  243. - GP_get_sitename()
  244. - GP_get_style()
  245. - GP_get_trans()
  246. - GP_get_zmode()
  247. - GP_load_site()
  248. - GP_new_site()
  249. - GP_num_sites()
  250. - GP_select_surf()
  251. - GP_Set_ClientData()
  252. - GP_set_style()
  253. - GP_set_style_thematic()
  254. - GP_set_trans()
  255. - GP_set_zmode()
  256. - GP_site_exists()
  257. - GP_str_to_marker()
  258. - GP_surf_is_selected()
  259. - GP_unselect_surf()
  260. \subsection ogsf ogsfGk Keyframe animation
  261. Functions which have to do with setting &amp; manipulating keyframes
  262. for viewer position animation (fly-bys).
  263. - GK_add_key()
  264. - GK_clear_keys()
  265. - GK_delete_key()
  266. - GK_do_framestep()
  267. - GK_move_key()
  268. - GK_print_keys()
  269. - GK_set_interpmode()
  270. - GK_set_numsteps()
  271. - GK_set_tension()
  272. - GK_show_list()
  273. - GK_show_path()
  274. - GK_show_site()
  275. - GK_showtension_start()
  276. - GK_showtension_stop()
  277. - GK_show_vect()
  278. - GK_show_vol()
  279. - GK_update_frames()
  280. - GK_update_tension()
  281. \subsection ogsfGvl Loading and manipulation of volume maps (GVL)
  282. Functions which have to do with loading &amp; manipulating 3D volumes.
  283. - GVL_alldraw_vol()
  284. - GVL_alldraw_wire()
  285. - GVL_delete_vol()
  286. - GVL_draw_vol()
  287. - GVL_draw_wire()
  288. - GVL_Get_ClientData()
  289. - GVL_get_dims()
  290. - GVL_get_region()
  291. - GVL_get_trans()
  292. - GVL_get_vol_list()
  293. - GVL_get_volname()
  294. - GVL_get_window()
  295. - GVL_isosurf_add()
  296. - GVL_isosurf_del()
  297. - GVL_isosurf_get_att()
  298. - GVL_isosurf_get_drawmode()
  299. - GVL_isosurf_get_drawres()
  300. - GVL_isosurf_get_flags()
  301. - GVL_isosurf_get_maskmode()
  302. - GVL_isosurf_move_down()
  303. - GVL_isosurf_move_up()
  304. - GVL_isosurf_num_isosurfs()
  305. - GVL_isosurf_set_att_const()
  306. - GVL_isosurf_set_att_map()
  307. - GVL_isosurf_set_drawmode()
  308. - GVL_isosurf_set_drawres()
  309. - GVL_isosurf_set_flags()
  310. - GVL_isosurf_set_maskmode()
  311. - GVL_isosurf_unset_att()
  312. - GVL_libinit()
  313. - GVL_load_vol()
  314. - GVL_new_vol()
  315. - GVL_num_vols()
  316. - GVL_Set_ClientData()
  317. - GVL_set_focus_center_map()
  318. - GVL_set_trans()
  319. - GVL_slice_add()
  320. - GVL_slice_del()
  321. - GVL_slice_get_drawmode()
  322. - GVL_slice_get_drawres()
  323. - GVL_slice_get_pos()
  324. - GVL_slice_get_transp()
  325. - GVL_slice_move_down()
  326. - GVL_slice_move_up()
  327. - GVL_slice_num_slices()
  328. - GVL_slice_set_drawmode()
  329. - GVL_slice_set_drawres()
  330. - GVL_slice_set_pos()
  331. - GVL_slice_set_transp()
  332. - GVL_vol_exists()
  333. \subsection ogsfGvlIso Loading and manipulation of isosurfaces (GVL)
  334. Functions which have to do with loading &amp; manipulating
  335. isosurfaces.
  336. - GVL_isosurf_add()
  337. - GVL_isosurf_del()
  338. - GVL_isosurf_get_att()
  339. - GVL_isosurf_get_drawmode()
  340. - GVL_isosurf_get_drawres()
  341. - GVL_isosurf_get_flags()
  342. - GVL_isosurf_get_maskmode()
  343. - GVL_isosurf_move_down()
  344. - GVL_isosurf_move_up()
  345. - GVL_isosurf_num_isosurfs()
  346. - GVL_isosurf_set_att_const()
  347. - GVL_isosurf_set_att_map()
  348. - GVL_isosurf_set_drawmode()
  349. - GVL_isosurf_set_drawres()
  350. - GVL_isosurf_set_flags()
  351. - GVL_isosurf_set_maskmode()
  352. - GVL_isosurf_unset_att()
  353. \subsection ogsfGvlSlice Loading and manipulation of slices (GVL)
  354. Functions which have to do with loading &amp; manipulating slices.
  355. - GVL_slice_add()
  356. - GVL_slice_del()
  357. - GVL_slice_get_drawmode()
  358. - GVL_slice_get_drawres()
  359. - GVL_slice_get_pos()
  360. - GVL_slice_get_transp()
  361. - GVL_slice_move_down()
  362. - GVL_slice_move_up()
  363. - GVL_slice_num_slices()
  364. - GVL_slice_set_drawmode()
  365. - GVL_slice_set_drawres()
  366. - GVL_slice_set_pos()
  367. - GVL_slice_set_transp()
  368. \section authors Authors
  369. Bill Brown GMSL/University of Illinois
  370. */