ogsflib.dox 10.0 KB

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