Przeglądaj źródła

ogsf sync'ed with devbr6: initial code doxygenization, minor library cleaning (https://trac.osgeo.org/grass/changeset/31312, https://trac.osgeo.org/grass/changeset/31304, https://trac.osgeo.org/grass/changeset/31271)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@31313 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 17 lat temu
rodzic
commit
013f88a523

+ 170 - 32
lib/ogsf/GK2.c

@@ -1,5 +1,18 @@
-/*
-* $Id$
+/*!
+  \file GK2.c
+ 
+  \brief OGSF library - setting and manipulating keyframes animation
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
 */
 
 #include <stdlib.h>
@@ -7,6 +20,7 @@
 #include <grass/gstypes.h>
 #include <grass/keyframe.h>
 #include <grass/kftypes.h>
+#include <grass/glocale.h>
 
 static int _add_key(Keylist *, int, float);
 static void _remove_key(Keylist *);
@@ -115,6 +129,14 @@ static void _remove_key(Keylist * k)
     return;
 }
 
+/*!
+  \brief Set interpolation mode 
+
+  \param mode interpolation mode (KF_LINEAR or KF_SPLINE)
+
+  \return 1 on success
+  \return -1 on error (invalid interpolation mode)
+*/
 int GK_set_interpmode(int mode)
 {
     if (KF_LEGAL_MODE(mode)) {
@@ -125,6 +147,11 @@ int GK_set_interpmode(int mode)
     return (-1);
 }
 
+/*!
+  \brief Set value for tension when interpmode is KF_SPLINE. 
+
+  \param tens value tens should be between 0.0; 1.0.
+*/
 void GK_set_tension(float tens)
 {
     Tension = tens > 1.0 ? 1.0 : (tens < 0.0 ? 0.0 : tens);
@@ -150,11 +177,21 @@ void GK_showtension_start(void)
     return;
 }
 
+/*!
+  \brief Show tension stop ?
+
+  Use GK_showtension_start/GK_update_tension/GK_showtension_stop to
+  initialize and stop multi-view display of path when changing
+  tension.
+*/
 void GK_showtension_stop(void)
 {
     return;
 }
 
+/*!
+  \brief Update tension
+*/
 void GK_update_tension(void)
 {
     if (Views) {
@@ -164,8 +201,11 @@ void GK_update_tension(void)
     return;
 }
 
+/*!
+  \brief Print keyframe info
 
-
+  \param name filename
+*/
 void GK_print_keys(char *name)
 {
     Keylist *k;
@@ -173,7 +213,7 @@ void GK_print_keys(char *name)
     int cnt = 1;
 
     if (NULL == (fp = fopen(name, "w"))) {
-	fprintf(stderr, "Cannot open file for output\n"), exit(1);
+	G_fatal_error (_("Unable to open file <%s> for writing"), name);
     }
     /* write a default frame rate of 30 at top of file */
     fprintf(fp, "30 \n");
@@ -194,6 +234,12 @@ void GK_print_keys(char *name)
 
 }
 
+/*!
+  \brief Recalculate path using the current number of frames requested.
+
+  Call after changing number of frames or when
+  Keyframes change.
+*/
 void GK_update_frames(void)
 {
     Keylist *k;
@@ -223,8 +269,7 @@ void GK_update_frames(void)
 	Views = gk_make_linear_framesfromkeys(Keys, Numkeys, Viewsteps, loop);
 
 	if (!Views) {
-	    fprintf(stderr,
-		    "Check no. of frames requested and keyframes marked\n");
+	    G_warning(_("Check no. of frames requested and keyframes marked"));
 	}
     }
     else if (Numkeys > 2) {
@@ -237,14 +282,18 @@ void GK_update_frames(void)
 	    (Keys, Numkeys, Viewsteps, loop, 1.0 - Tension);
 
 	if (!Views) {
-	    fprintf(stderr,
-		    "Check no. of frames requested and keyframes marked\n");
+	    G_warning(_("Check no. of frames requested and keyframes marked"));
 	}
     }
 
     return;
 }
 
+/*!
+  \brief Set the number of frames to be interpolated from keyframes
+
+  \param newsteps number of frames
+*/
 void GK_set_numsteps(int newsteps)
 {
     Viewsteps = newsteps;
@@ -253,7 +302,11 @@ void GK_set_numsteps(int newsteps)
     return;
 }
 
+/*!
+  \brief Deletes all keyframes, resets field masks.
 
+  Doesn't change number of frames requested.
+*/
 void GK_clear_keys(void)
 {
     gk_free_key(Keys);
@@ -268,6 +321,18 @@ void GK_clear_keys(void)
     return;
 }
 
+/*!
+  \brief Move keyframe
+
+  Precis works as in other functions - to identify keyframe to move.
+  Only the first keyframe in the precis range will be moved.
+
+  \param oldpos old position
+  \param precis precision value
+  \param newpos new position
+
+  \return number of keys moved (1 or 0)
+*/
 int GK_move_key(float oldpos, float precis, float newpos)
 {
     Keylist *k;
@@ -285,7 +350,20 @@ int GK_move_key(float oldpos, float precis, float newpos)
     return (0);
 }
 
-/* returns number of keys deleted */
+/*!
+  Delete keyframe
+
+  The values pos and precis are used to determine which keyframes to
+  delete.  Any keyframes with their position within precis of pos will
+  be deleted if justone is zero.  If justone is non-zero, only the first
+  (lowest pos) keyframe in the range will be deleted.
+
+  \param pos position
+  \param precis precision
+  \param justone delete only one keyframe
+
+  \return number of keys deleted.
+*/
 int GK_delete_key(float pos, float precis, int justone)
 {
     Keylist *k, *next;
@@ -310,7 +388,44 @@ int GK_delete_key(float pos, float precis, int justone)
     return (cnt);
 }
 
-/* returns 1 if key added, otherwise -1 */
+/*!
+  \brief Add keyframe
+
+  The pos value is the relative position in the animation for this
+  particular keyframe - used to compare relative distance to neighboring
+  keyframes, it can be any floating point value.
+
+  The fmask value can be any of the following or'd together:    
+   - KF_FROMX_MASK    
+   - KF_FROMY_MASK    
+   - KF_FROMZ_MASK    
+   - KF_FROM_MASK (KF_FROMX_MASK | KF_FROMY_MASK | KF_FROMZ_MASK) 
+
+   - KF_DIRX_MASK    
+   - KF_DIRY_MASK    
+   - KF_DIRZ_MASK    
+   - KF_DIR_MASK (KF_DIRX_MASK | KF_DIRY_MASK | KF_DIRZ_MASK) 
+
+   - KF_FOV_MASK    
+   - KF_TWIST_MASK    
+
+   - KF_ALL_MASK (KF_FROM_MASK | KF_DIR_MASK | KF_FOV_MASK | KF_TWIST_MASK) 
+
+   Other fields will be added later.
+
+   The value precis and the boolean force_replace are used to determine
+   if a keyframe should be considered to be at the same position as a
+   pre-existing keyframe. e.g., if anykey.pos - newkey.pos &lt;= precis,
+   GK_add_key() will fail unless force_replace is TRUE.
+
+   \param pos postion
+   \param fmaks
+   \param force_replace
+   \param precis precision value
+   
+   \return 1 if key is added
+   \return -1 key not added
+*/
 int GK_add_key(float pos, unsigned long fmask, int force_replace,
 	       float precis)
 {
@@ -329,16 +444,12 @@ int GK_add_key(float pos, unsigned long fmask, int force_replace,
     newk->fields[KF_FROMY] = tmp[Y];
     newk->fields[KF_FROMZ] = tmp[Z];
 
-#ifdef KDEBUG
-    {
-	fprintf(stderr, "KEY FROM: %f %f %f\n", tmp[X], tmp[Y], tmp[Z]);
-    }
-#endif
+    G_debug (3, "KEY FROM: %f %f %f", tmp[X], tmp[Y], tmp[Z]);
 
 /* Instead of View Dir try get_focus (view center) */
 /* View Dir is implied from eye and center position */
 /*    GS_get_viewdir(tmp); */
-
+    
 /* ACS 1 line: was 	GS_get_focus(tmp);
  	with this kanimator works also for flythrough navigation
 	also changed in gk.c
@@ -363,6 +474,15 @@ int GK_add_key(float pos, unsigned long fmask, int force_replace,
     return (-1);
 }
 
+/*!
+  \brief Moves the animation to frame number "step".
+
+  Step should be a value between 1 and the number of frames.  If
+  render is non-zero, calls draw_all.
+
+  \param step step value
+  \param render
+*/
 void GK_do_framestep(int step, int render)
 {
     if (Views) {
@@ -374,7 +494,11 @@ void GK_do_framestep(int step, int render)
     return;
 }
 
+/*!
+  \brief Draw the current path
 
+  \param flag
+*/
 void GK_show_path(int flag)
 {
     if (flag) {
@@ -397,6 +521,11 @@ void GK_show_path(int flag)
     return;
 }
 
+/*!
+  \brief Show vector sets
+
+  \param flag
+*/
 void GK_show_vect(int flag)
 {
     if (flag) {
@@ -418,6 +547,11 @@ void GK_show_vect(int flag)
     return;
 }
 
+/*!
+  \brief Show point sets
+
+  \param flag
+*/
 void GK_show_site(int flag)
 {
     if (flag) {
@@ -441,6 +575,11 @@ void GK_show_site(int flag)
     return;
 }
 
+/*!
+  \brief Show volumes
+
+  \param flag
+*/
 void GK_show_vol(int flag)
 {
     if (flag) {
@@ -464,24 +603,23 @@ void GK_show_vol(int flag)
     return;
 }
 
+/*!
+  \brief Show list
 
+  \param flag
+*/
 void GK_show_list( int flag)
 {
+    if (flag) {
+	Fmode |= FM_LABEL;
+	
+	if (Views) {
+	    GS_draw_all_list();
+	}
+    }
+    else {
+	Fmode &= ~FM_LABEL;
+    }
 
-        if (flag) {
-
-                Fmode |= FM_LABEL;
-
-                if (Views) {
-
-                GS_draw_all_list();
-
-                }
-        }
-        else {
-                Fmode &= ~FM_LABEL;
-        }
-
-        return;
+    return;
 }
-

+ 199 - 41
lib/ogsf/GP2.c

@@ -1,10 +1,19 @@
-/*
-* $Id$
-*/
-
-/*  GP.c 
-    Bill Brown, USACERL  
-    January 1994
+/*!
+  \file GP2.c
+ 
+  \brief OGSF library - loading and manipulating point sets (higher level functions)
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1994)
+  Doxygenized by Martin landa <landa.martin gmail.com> (May 2008)
 */
 
 #include <stdlib.h>
@@ -17,7 +26,14 @@
 static int Site_ID[MAX_SITES];
 static int Next_site = 0;
 
-/***********************************************************************/
+/*!
+  \brief Check if point set exists
+
+  \param id point set id
+  
+  \return 1 found
+  \return 0 not found
+*/
 int GP_site_exists(int id)
 {
     int i, found = 0;
@@ -41,7 +57,12 @@ int GP_site_exists(int id)
     return (found);
 }
 
-/***********************************************************************/
+/*!
+  \brief Register new point set
+
+  \return point set id
+  \return -1 on error (number of point sets exceeded)
+*/
 int GP_new_site(void)
 {
     geosite *np;
@@ -63,14 +84,26 @@ int GP_new_site(void)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get number of available point sets
+
+  \return number of point sets
+*/
 int GP_num_sites(void)
 {
     return (gp_num_sites());
 }
 
-/***********************************************************************/
-/* USER must free!! */
+/*!
+  \brief Get list of point sets
+  
+  Must freed when no longer needed!
+
+  \param numsites number of point sets
+
+  \return pointer to list of points sets
+  \return NULL on error
+*/
 int *GP_get_site_list(int *numsites)
 {
     int i, *ret;
@@ -78,8 +111,8 @@ int *GP_get_site_list(int *numsites)
     *numsites = Next_site;
 
     if (Next_site) {
-	if (NULL == (ret = (int *) malloc(Next_site * sizeof(int)))) {
-	    fprintf(stderr, "can't malloc\n");
+	ret = (int *) G_malloc(Next_site * sizeof(int)); /* G_fatal_error */
+	if (!ret) {
 	    return (NULL);
 	}
 
@@ -93,7 +126,14 @@ int *GP_get_site_list(int *numsites)
     return (NULL);
 }
 
-/***********************************************************************/
+/*!
+  \brief Delete registrated point set
+
+  \param id point set id
+
+  \return 1 on success
+  \return -1 on error (point sets not available)
+*/
 int GP_delete_site(int id)
 {
     int i, j, found = 0;
@@ -125,16 +165,25 @@ int GP_delete_site(int id)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Load point set from file
+
+  Check to see if handle already loaded, if so - free before loading new 
+  for now, always load to memory 
+  
+  \todo load file handle & ready for reading instead of using
+  memory
+
+  \param id point set id
+  \param filename point set filename
+
+  \return -1 on error
+  \return 1 on success
+*/
 int GP_load_site(int id, char *filename)
 {
     geosite *gp;
 
-    /* check to see if handle already loaded, if so - free before loading new */
-    /* for now, always load to memory */
-    /* TODO SOON: load file handle & ready for reading instead of using */
-    /* memory */
-
     if (NULL == (gp = gp_get_site(id))) {
 	return (-1);
     }
@@ -155,7 +204,15 @@ int GP_load_site(int id, char *filename)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get point set filename
+
+  \param id point set id
+  \param[out] filename point set filename
+
+  \return -1 on error (point set not found)
+  \return 1 on success
+*/
 int GP_get_sitename(int id, char *filename)
 {
     geosite *gp;
@@ -169,7 +226,9 @@ int GP_get_sitename(int id, char *filename)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get point set mode
+*/
 int GP_get_sitemode(int id, int *atmod, int *color, int *width, float *size,
 		    int *marker)
 {
@@ -188,7 +247,18 @@ int GP_get_sitemode(int id, int *atmod, int *color, int *width, float *size,
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set mode for point set
+
+  \param id point set id
+  \param atmod
+  \param color color value
+  \param width 
+  \param size point size
+  \param marker marker symbol
+
+  \return -1 on error (point set not found)
+*/
 int GP_set_sitemode(int id, int atmod, int color, int width, float size,
 		    int marker)
 {
@@ -207,9 +277,18 @@ int GP_set_sitemode(int id, int atmod, int color, int width, float size,
     return (1);
 }
 
-/***********************************************************************/
-/* TODO: make similar routines for attmode_size, attmode_marker (use transform) */
-/* return 1 for success, 0 for no attribute info, -1 for bad parameter */
+/*!
+  \brief Set attribute mode color
+
+  \todo make similar routines for attmode_size, attmode_marker (use transform)
+  
+  \param id surface id
+  \param filename filename
+
+  \return 1 for success
+  \return 0 for no attribute info
+  \return -1 for bad parameter
+*/
 int GP_attmode_color(int id, char *filename)
 {
     geosite *gp;
@@ -230,7 +309,14 @@ int GP_attmode_color(int id, char *filename)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set attribute mode to none
+
+  \param id point set id
+
+  \return -1 on error (invalid point set id)
+  \return 1 on success
+*/
 int GP_attmode_none(int id)
 {
     geosite *gp;
@@ -244,7 +330,16 @@ int GP_attmode_none(int id)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set z-mode
+
+  \param id poin set id
+  \param use_z use z ?
+
+  \return 1 on success
+  \return 0 no z
+  \return -1 on error (invalid point set id)
+*/
 int GP_set_zmode(int id, int use_z)
 {
     geosite *gp;
@@ -266,7 +361,15 @@ int GP_set_zmode(int id, int use_z)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get z-mode
+
+  \param id point set id
+  \param[out] use_z use z
+  
+  \return -1 on error (invalid point set id)
+  \return 1 on success
+*/
 int GP_get_zmode(int id, int *use_z)
 {
     geosite *gp;
@@ -279,7 +382,12 @@ int GP_get_zmode(int id, int *use_z)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set trans ?
+
+  \param id point set id
+  \param xtrans,ytrans,ztrans x/y/z trans values
+*/
 void GP_set_trans(int id, float xtrans, float ytrans, float ztrans)
 {
     geosite *gp;
@@ -300,7 +408,12 @@ void GP_set_trans(int id, float xtrans, float ytrans, float ztrans)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get trans
+
+  \param id point set id
+  \param xtrans,ytrans,ztrans x/y/z trans values
+*/
 void GP_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
 {
     geosite *gp;
@@ -322,7 +435,15 @@ void GP_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Select surface
+
+  \param hp point set id
+  \param hs surface id
+
+  \return 1 surface selected
+  \return -1 on error
+*/
 int GP_select_surf(int hp, int hs)
 {
     geosite *gp;
@@ -342,7 +463,15 @@ int GP_select_surf(int hp, int hs)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Unselect surface
+
+  \param hp point set id
+  \param hs surface id
+
+  \return 1 surface unselected
+  \return -1 on error
+*/
 int GP_unselect_surf(int hp, int hs)
 {
     geosite *gp;
@@ -370,7 +499,15 @@ int GP_unselect_surf(int hp, int hs)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Check if surface is selected
+
+  \param hp point set id
+  \param hs surface id
+
+  \return 1 selected
+  \return 0 not selected
+*/
 int GP_surf_is_selected(int hp, int hs)
 {
     int i;
@@ -389,7 +526,11 @@ int GP_surf_is_selected(int hp, int hs)
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw point set
+
+  \param id point set id
+*/
 void GP_draw_site(int id)
 {
     geosurf *gs;
@@ -412,8 +553,8 @@ void GP_draw_site(int id)
 		if (gs) {
 		    gpd_2dsite(gp, gs, 0);
 		#ifdef TRACE_GP_FUNCS
-		    fprintf(stderr, "Drawing site %d on Surf %d\n", id,
-			    gp->drape_surf_id[i]);
+		    G_debug (3, "Drawing site %d on Surf %d", id,
+			     gp->drape_surf_id[i]);
 		    print_site_fields(gp);
 		#endif
 		}
@@ -424,7 +565,9 @@ void GP_draw_site(int id)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw all available point sets
+*/
 void GP_alldraw_site(void)
 {
     int id;
@@ -436,7 +579,15 @@ void GP_alldraw_site(void)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set client data
+
+  \param id point set id
+  \param clientd client data
+
+  \return 1 on success
+  \return -1 on error (invalid point set id)
+*/
 int GP_Set_ClientData(int id, void *clientd)
 {
     geosite *gp;
@@ -451,7 +602,14 @@ int GP_Set_ClientData(int id, void *clientd)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get client data
+
+  \param id point set id
+
+  \return pointer to client data
+  \return NULL on error
+*/
 void *GP_Get_ClientData(int id)
 {
     geosite *gp;

Plik diff jest za duży
+ 990 - 519
lib/ogsf/GS2.c


+ 15 - 7
lib/ogsf/GSX.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  GSX.c 
-    Bill Brown, USACERL  
-    December 1993
+/*!
+  \file GSX.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (December 1993)
 */
 
 #include <grass/gstypes.h>

+ 177 - 41
lib/ogsf/GS_util.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gs_util.c
-    Bill Brown, USACERL  
-    January 1993
+/*!
+  \file GS_util.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
 */
 
 #include <stdlib.h>
@@ -14,7 +22,35 @@
 
 #include <grass/gstypes.h>
 
-/************************************************************************/
+/*!
+  \brief Calculate distance between 2 coordinates
+
+  Units is one of:
+   - "meters",
+   - "miles",
+   - "kilometers",
+   - "feet",
+   - "yards",
+   - "nmiles" (nautical miles),
+   - "rods",
+   - "inches",
+   - "centimeters",
+   - "millimeters",
+   - "micron",
+   - "nanometers",
+   - "cubits",
+   - "hands",
+   - "furlongs",
+   - "chains"
+
+  Default is meters.
+
+  \param from starting point
+  \param to ending point
+  \param units map units
+
+  \return distance between two geographic coordinates in current projection
+*/
 double GS_geodistance(double *from, double *to, char *units)
 {
     double meters;
@@ -93,7 +129,14 @@ double GS_geodistance(double *from, double *to, char *units)
     return (meters);
 }
 
-/************************************************************************/
+/*!
+  \brief Calculate distance
+  
+  \param from 'from' point (X,Y,Z)
+  \param to 'to' point (X,Y,Z)
+
+  \return distance
+*/
 float GS_distance(float *from, float *to)
 {
     float x, y, z;
@@ -105,7 +148,14 @@ float GS_distance(float *from, float *to)
     return (float) sqrt(x * x + y * y + z * z);
 }
 
-/************************************************************************/
+/*!
+  \brief Calculate distance in plane
+
+  \param from 'from' point (X,Y)
+  \param to 'to' point (X,Y)
+
+  \return distance
+*/  
 float GS_P2distance(float *from, float *to)
 {
     float x, y;
@@ -116,8 +166,14 @@ float GS_P2distance(float *from, float *to)
     return (float) sqrt(x * x + y * y);
 }
 
-/************************************************************************/
-/* v1 = v2 */
+/*!
+  \brief Copy vector values
+
+  v1 = v2
+
+  \param[out] v1 first vector
+  \param v2 second vector
+*/
 void GS_v3eq(float *v1, float *v2)
 {
     v1[X] = v2[X];
@@ -127,8 +183,14 @@ void GS_v3eq(float *v1, float *v2)
     return;
 }
 
-/************************************************************************/
-/* v1 += v2 */
+/*!
+  \brief Sum vectors
+  
+  v1 += v2
+
+  \param[in,out] v1 first vector
+  \param v2 second vector
+*/
 void GS_v3add(float *v1, float *v2)
 {
     v1[X] += v2[X];
@@ -138,8 +200,14 @@ void GS_v3add(float *v1, float *v2)
     return;
 }
 
-/************************************************************************/
-/* v1 -= v2 */
+/*!
+  \brief Subtract vectors
+
+  v1 -= v2
+
+  \param[in,out] v1 first vector
+  \param v2 second vector
+*/  
 void GS_v3sub(float *v1, float *v2)
 {
     v1[X] -= v2[X];
@@ -149,8 +217,14 @@ void GS_v3sub(float *v1, float *v2)
     return;
 }
 
-/************************************************************************/
-/* v1 *= k */
+/*!
+  \brief Multiple vectors
+
+  v1 *= k
+
+  \param[in,out] v1 vector
+  \param k multiplicator
+*/
 void GS_v3mult(float *v1, float k)
 {
     v1[X] *= k;
@@ -160,8 +234,14 @@ void GS_v3mult(float *v1, float k)
     return;
 }
 
-/************************************************************************/
-/* Changes v1 so that it is a unit vector */
+/*!
+  \brief Change v1 so that it is a unit vector (2D)
+
+  \param[in,out] v1 vector
+
+  \return 0 if magnitude of v1 is zero
+  \return 1 if magnitude of v1 > 0
+*/
 int GS_v3norm(float *v1)
 {
     float n;
@@ -179,8 +259,14 @@ int GS_v3norm(float *v1)
     return (1);
 }
 
-/************************************************************************/
-/* Changes v1 so that it is a unit vector */
+/*!
+  \brief Change v1 so that it is a unit vector (3D)
+
+  \param[in,out] v1 vector
+
+  \return 0 if magnitude of v1 is zero
+  \return 1 if magnitude of v1 > 0
+*/
 int GS_v2norm(float *v1)
 {
     float n;
@@ -197,8 +283,14 @@ int GS_v2norm(float *v1)
     return (1);
 }
 
-/************************************************************************/
-/* Changes v1 so that it is a unit vector */
+/*!
+  \brief Changes v1 so that it is a unit vector
+
+  \param dv1 vector
+
+  \return 0 if magnitude of dv1 is zero
+  \return 1 if magnitude of dv1 > 0
+*/
 int GS_dv3norm(double *dv1)
 {
     double n;
@@ -217,8 +309,15 @@ int GS_dv3norm(double *dv1)
 }
 
 
-/************************************************************************/
-/* Changes v2 so that v1v2 is a unit vector */
+/*!
+  \brief Change v2 so that v1v2 is a unit vector
+
+  \param v1 first vector
+  \param v2[in,out] second vector
+
+  \return 0 if magnitude of dx is zero
+  \return 1 if magnitude of dx > 0
+*/
 int GS_v3normalize(float *v1, float *v2)
 {
     float n, dx, dy, dz;
@@ -240,8 +339,16 @@ int GS_v3normalize(float *v1, float *v2)
 }
 
 
-/************************************************************************/
-/* get a normalized direction from v1 to v2, store in v3 */
+/*!
+  \brief Get a normalized direction from v1 to v2, store in v3
+
+  \param v1 first vector
+  \param v2 second vector
+  \param[out] v3 output vector
+
+  \return 0 if magnitude of dx is zero
+  \return 1 if magnitude of dx > 0
+*/
 int GS_v3dir(float *v1, float *v2, float *v3)
 {
     float n, dx, dy, dz;
@@ -264,8 +371,16 @@ int GS_v3dir(float *v1, float *v2, float *v3)
 }
 
 
-/************************************************************************/
-/* get a normalized direction from v1 to v2, store in v3 */
+/*!
+  \brief Get a normalized direction from v1 to v2, store in v3 (2D)
+
+  \param v1 first vector
+  \param v2 second vector
+  \param[out] v3 output vector
+
+  \return 0 if magnitude of dx is zero
+  \return 1 if magnitude of dx > 0
+*/
 void GS_v2dir(float *v1, float *v2, float *v3)
 {
     float n, dx, dy;
@@ -280,8 +395,13 @@ void GS_v2dir(float *v1, float *v2, float *v3)
     return;
 }
 
-/************************************************************************/
-/* return the cross product v3 = v1 cross v2 */
+/*!
+  \brief Get the cross product v3 = v1 cross v2
+
+  \param v1 first vector
+  \param v2 second vector
+  \param[out] v3 output vector
+*/
 void GS_v3cross(float *v1, float *v2, float *v3)
 {
     v3[X] = (v1[Y] * v2[Z]) - (v1[Z] * v2[Y]);
@@ -291,8 +411,12 @@ void GS_v3cross(float *v1, float *v2, float *v3)
     return;
 }
 
-/************************************************************************/
-/* magnitude of vector */
+/*!
+  \brief Magnitude of vector
+
+  \param v1 vector
+  \param[out] mag magnitude value
+*/
 void GS_v3mag(float *v1, float *mag)
 {
     *mag = sqrt(v1[X] * v1[X] + v1[Y] * v1[Y] + v1[Z] * v1[Z]);
@@ -300,9 +424,20 @@ void GS_v3mag(float *v1, float *mag)
     return;
 }
 
-/************************************************************************/
-/* initialize by calling with a number nhist to represent number of
- * previous entrys to check, then call with zero as nhist
+/*!
+  \brief ADD
+
+  Initialize by calling with a number nhist to represent number of
+  previous entrys to check, then call with zero as nhist
+
+  \param p1 first point
+  \param p2 second point
+  \param nhist ?
+
+  \return -1 on error
+  \return -2
+  \return 1
+  \return 9
 */
 int GS_coordpair_repeats(float *p1, float *p2, int nhist)
 {
@@ -313,12 +448,13 @@ int GS_coordpair_repeats(float *p1, float *p2, int nhist)
 
     if (nhist) {
 	if (entrys) {
-	    free(entrys);
+	    G_free(entrys);
 	}
 
-	if (NULL == (entrys = (float *) malloc(4 * nhist * sizeof(float)))) {
-	    return (-1);
-	}
+	entrys = (float *) G_malloc(4 * nhist * sizeof(float));
+
+	if (!entrys)
+	  return (-1);
 
 	len = nhist;
 	next = 0;

+ 179 - 60
lib/ogsf/GV2.c

@@ -1,10 +1,19 @@
-/*
-* $Id$
-*/
-
-/*  GV.c 
-    Bill Brown, USACERL  
-    October 1993
+/*!
+  \file GV2.c
+ 
+  \brief OGSF library - loading and manipulating vector sets (higher level functions)
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+  Doxygenized by Martin Landa <landa.martin gmail.com>
 */
 
 #include <stdio.h>
@@ -14,23 +23,22 @@
 #include <grass/gstypes.h>
 #include "gsget.h"
 
-#ifdef TRACE_FUNCS
-#define TRACE_GV_FUNCS
-#endif
-
 static int Vect_ID[MAX_VECTS];
 static int Next_vect = 0;
 
-/***********************************************************************/
+/*!
+  \brief Check if vector set exists
+
+  \param id vector set id
+
+  \return 0 not found
+  \return 1 found
+*/
 int GV_vect_exists(int id)
 {
     int i, found = 0;
 
-#ifdef TRACE_GV_FUNCS
-    {
-	Gs_status("GV_vect_exists");
-    }
-#endif
+    G_debug(3, "GV_vect_exists");
 
     if (NULL == gv_get_vect(id)) {
 	return (0);
@@ -45,16 +53,17 @@ int GV_vect_exists(int id)
     return (found);
 }
 
-/***********************************************************************/
+/*!
+  \brief Register new vector set
+
+  \return vector set id
+  \return -1 on error
+*/
 int GV_new_vector(void)
 {
     geovect *nv;
 
-#ifdef TRACE_GV_FUNCS
-    {
-	Gs_status("GV_new_vector");
-    }
-#endif
+    G_debug(3, "GV_new_vector");
 
     if (Next_vect < MAX_VECTS) {
 	nv = gv_get_new_vect();
@@ -68,14 +77,26 @@ int GV_new_vector(void)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get number of available vector sets
+
+  \return number of vector sets
+*/
 int GV_num_vects(void)
 {
     return (gv_num_vects());
 }
 
-/***********************************************************************/
-/* USER must free!! */
+/*!
+  \brief Get list of vector sets
+
+  Must free when no longer needed!
+
+  \param numvects number of vector sets
+
+  \return pointer to list of point sets
+  \return NULL on error
+*/
 int *GV_get_vect_list(int *numvects)
 {
     int i, *ret;
@@ -83,32 +104,34 @@ int *GV_get_vect_list(int *numvects)
     *numvects = Next_vect;
 
     if (Next_vect) {
-	if (NULL == (ret = (int *) malloc(Next_vect * sizeof(int)))) {
-	    fprintf(stderr, "can't malloc\n");
-
+	ret = (int *) G_malloc(Next_vect * sizeof(int));
+	if (!ret) {
 	    return (NULL);
 	}
-
+	
 	for (i = 0; i < Next_vect; i++) {
 	    ret[i] = Vect_ID[i];
 	}
-
+	
 	return (ret);
     }
 
     return (NULL);
 }
 
-/***********************************************************************/
+/*!
+  \brief Delete vector set from list
+
+  \param id vector set id
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_delete_vector(int id)
 {
     int i, j, found = 0;
 
-#ifdef TRACE_GV_FUNCS
-    {
-	Gs_status("GV_delete_vect");
-    }
-#endif
+    G_debug(3, "GV_delete_vect");
 
     if (GV_vect_exists(id)) {
 	gv_delete_vect(id);
@@ -132,15 +155,25 @@ int GV_delete_vector(int id)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Load vector set
+
+  Check to see if handle already loaded, if so - free before loading
+  new for now, always load to memory
+  
+  \todo Load file handle & ready for reading instead of using
+  memory
+
+  \param id vector set id
+  \param filename filename
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_load_vector(int id, char *filename)
 {
     geovect *gv;
 
-    /* check to see if handle already loaded, if so - free before loading */
-    /* new for now, always load to memory */
-    /* TODO SOON: load file handle & ready for reading instead of using */
-    /* memory */
     if (NULL == (gv = gv_get_vect(id))) {
 	return (-1);
     }
@@ -160,7 +193,15 @@ int GV_load_vector(int id, char *filename)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get vector map name
+
+  \param id vector set id
+  \param filename filename
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_get_vectname(int id, char *filename)
 {
     geovect *gv;
@@ -174,7 +215,18 @@ int GV_get_vectname(int id, char *filename)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set vector set mode
+
+  \param id vector set id
+  \param mem
+  \param color color value
+  \param width
+  \param flat
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_set_vectmode(int id, int mem, int color, int width, int flat)
 {
     geovect *gv;
@@ -191,7 +243,18 @@ int GV_set_vectmode(int id, int mem, int color, int width, int flat)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get vector set mode
+
+  \param id vector set id
+  \param[out] mem
+  \param[out] color color value
+  \param[out] width
+  \param[out] flat
+
+  \return -1 on error (invalid vector set id)
+  \return 1 on success
+*/
 int GV_get_vectmode(int id, int *mem, int *color, int *width, int *flat)
 {
     geovect *gv;
@@ -208,16 +271,17 @@ int GV_get_vectmode(int id, int *mem, int *color, int *width, int *flat)
     return (1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Set trans ?
+
+  \param id vector set id
+  \param xtrans,ytrans,ztrans x/y/z trans values
+*/
 void GV_set_trans(int id, float xtrans, float ytrans, float ztrans)
 {
     geovect *gv;
 
-#ifdef TRACE_GV_FUNCS
-    {
-	Gs_status("GV_set_trans");
-    }
-#endif
+    G_debug(3, "GV_set_trans");
 
     gv = gv_get_vect(id);
 
@@ -230,7 +294,12 @@ void GV_set_trans(int id, float xtrans, float ytrans, float ztrans)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Get trans ?
+
+  \param id vector set id
+  \param[out] xtrans,ytrans,ztrans x/y/z trans values
+*/
 int GV_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
 {
     geovect *gv;
@@ -248,7 +317,16 @@ int GV_get_trans(int id, float *xtrans, float *ytrans, float *ztrans)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Select surface identified by hs to have vector identified
+  by hv draped over it
+
+  \param hv vector set id
+  \param hs surface id
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_select_surf(int hv, int hs)
 {
     geovect *gv;
@@ -269,7 +347,15 @@ int GV_select_surf(int hv, int hs)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Unselect surface
+
+  \param hv vector set id
+  \param hs surface id
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_unselect_surf(int hv, int hs)
 {
     geovect *gv;
@@ -298,7 +384,15 @@ int GV_unselect_surf(int hv, int hs)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Check if surface is selected
+
+  \param hv vector set id
+  \param hs surface id
+
+  \return 1 selected
+  \return 0 not selected
+*/
 int GV_surf_is_selected(int hv, int hs)
 {
     int i;
@@ -317,7 +411,11 @@ int GV_surf_is_selected(int hv, int hs)
     return (0);
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw vector set
+
+  \param vid vector set id
+*/
 void GV_draw_vect(int vid)
 {
     geosurf *gs;
@@ -339,7 +437,9 @@ void GV_draw_vect(int vid)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw all vector sets
+*/
 void GV_alldraw_vect(void)
 {
     int id;
@@ -351,7 +451,11 @@ void GV_alldraw_vect(void)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Draw vector sets
+
+  \param vid vector set id
+*/
 void GV_draw_fastvect(int vid)
 {
     geosurf *gs;
@@ -373,7 +477,15 @@ void GV_draw_fastvect(int vid)
     return;
 }
 
-/***********************************************************************/
+/*!
+  \brief Set client data
+
+  \param id vector set id
+  \param clientd pointer to client data
+
+  \return 1 on success
+  \return -1 on error
+*/
 int GV_Set_ClientData(int id, void *clientd)
 {
     geovect *gv;
@@ -388,7 +500,14 @@ int GV_Set_ClientData(int id, void *clientd)
     return (-1);
 }
 
-/***********************************************************************/
+/*!
+  \brief Get client data
+
+  \param id vector set id
+
+  \return pointer to client data
+  \return NULL on error
+*/
 void *GV_Get_ClientData(int id)
 {
     geovect *gv;

Plik diff jest za duży
+ 729 - 475
lib/ogsf/GVL2.c


+ 15 - 8
lib/ogsf/Gp3.c

@@ -1,11 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  Gp.c 
-    Bill Brown, USACERL  
-    January 1994
-    Uses GRASS routines!
+/*!
+  \file Gp3.c
+ 
+  \brief OGSF library - loading and manipulating point sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (January 1994)
 */
 
 #include <stdlib.h>

+ 26 - 18
lib/ogsf/Gs3.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  Gs.c 
-    Bill Brown, USACERL  
-    January 1993
+/*!
+  \file Gs3.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (January 1993)
 */
 
 #include <stdlib.h>
@@ -56,20 +64,20 @@
 
 typedef int FILEDESC;
 
-/*
-#define TRACE_FUNCS
-*/
-
 #define NO_DATA_COL 0xffffff
 
-/************************************************************************/
-/* This should be a function variable that 
- * may be replaced by a user's function. 
- * Or else use G_set_error_routine.
+/*!
+  \brief Warning handling
+
+  This should be a function variable that 
+  may be replaced by a user's function. 
+  Or else use G_set_error_routine().
+
+  \param str message
 */
 void Gs_warning(char *str)
 {
-    fprintf(stderr, "%s\n", str);
+    G_warning("%s", str);
 
     return;
 }
@@ -78,10 +86,10 @@ void Gs_warning(char *str)
 /* This should be a function variable that 
  * may be replaced by a user's function. 
  * Or else use G_set_error_routine.
-*/
+ */
 void Gs_status(char *str)
 {
-    fprintf(stderr, "%s\n", str);
+    G_debug(3, "%s", str);
 
     return;
 }

+ 15 - 7
lib/ogsf/Gv3.c

@@ -1,12 +1,20 @@
-/*
-* $Id$
+/*!
+  \file Gv3.c
+ 
+  \brief OGSF library - loading and manipulating vector sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (December 1993)
 */
 
-/*  Gv.c 
-    Bill Brown, USACERL  
-    December 1993
-    Uses GRASS routines!
-*/
 #include <stdlib.h>
 #include <grass/gis.h>
 #include <grass/Vect.h>

+ 15 - 4
lib/ogsf/Gvl3.c

@@ -1,7 +1,18 @@
-/*  GVL3.c
-    Volume access routines
-    Tomas Paudits
-    December 2003
+/*!
+  \file Gvl3.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Tomas Paudits (December 2003)
 */
 
 #include <grass/gis.h>

+ 15 - 2
lib/ogsf/gk.c

@@ -1,5 +1,18 @@
-/*
-* $Id$
+/*!
+  \file gk.c
+ 
+  \brief OGSF library - setting and manipulating keyframes animation
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
 */
 
 #include <stdlib.h>

+ 15 - 7
lib/ogsf/gp.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gp.c
-    Bill Brown, USACERL  
-    January 1994
+/*!
+  \file gp.c
+ 
+  \brief OGSF library - loading and manipulating point sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (January 1994)
 */
 
 #include <stdlib.h>

+ 15 - 7
lib/ogsf/gpd.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gpd.c
-    Bill Brown, USACERL  
-    December 1993
+/*!
+  \file gpd.c
+ 
+  \brief OGSF library - loading and manipulating point sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (December 1993)
 */
 
 #include <stdio.h>

+ 16 - 12
lib/ogsf/gs.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gs.c
-    Bill Brown, USACERL  
-    January 1993
+/*!
+  \file gs.c
+ 
+  \brief OGSF library - loading and manipulating surfaces (lower level functions)
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (January 1993)
 */
 
 #include <stdlib.h>
@@ -16,17 +24,13 @@
 
 #define FIRST_SURF_ID 110658
 
-/*
-#define TRACE_FUNCS
-*/
-
 static geosurf *Surf_top;
 static int Invertmask;
 
 /***********************************************************************/
 void gs_err(char *msg)
 {
-    fprintf(stderr, "%s\n", msg);
+    G_warning ("%s", msg);
 
     return;
 }

+ 15 - 7
lib/ogsf/gs_bm.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gs.c
-    Bill Brown, USACERL  
-    September 1993
+/*!
+  \file gs_bm.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (September 1993)
 */
 
 #include <grass/gstypes.h>

+ 15 - 7
lib/ogsf/gs_norms.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gs_norms.c
-    Bill Brown, USACERL
-    functions for calculating normals
+/*!
+  \file gs_norms.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL
 */
 
 #include <grass/gstypes.h>

+ 15 - 7
lib/ogsf/gs_query.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gs_query.c
-    Bill Brown, USACERL  
-    January 1994
+/*!
+  \file gs_query.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1994)
 */
 
 #include <math.h>

+ 15 - 7
lib/ogsf/gsd_cplane.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gsd_cplane.c
-    Bill Brown, USACERL  
-    January 1993
+/*!
+  \file gsd_cplane.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (January 1993)
 */
 
 /* DEBUG */

+ 18 - 13
lib/ogsf/gsd_fonts.c

@@ -1,16 +1,21 @@
-/*
-****************************************************************************
-*
-* MODULE: 	GRASS ogsf library
-* AUTHOR(S):	Bill Brown, USACERL
-* PURPOSE: 	This file needs to be re-written in OpenGL
-* COPYRIGHT:    (C) 2000 by the GRASS Development Team
-*
-*               This program is free software under the GNU General Public
-*   	    	License (>=v2). Read the file COPYING that comes with GRASS
-*   	    	for details.
-*
-*****************************************************************************/
+/*!
+  \file gsd_fonts.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  \todo This file needs to be re-written in OpenGL
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+*/
 
 #include <string.h>
 #include <assert.h>

+ 18 - 1
lib/ogsf/gsd_fringe.c

@@ -1,4 +1,21 @@
-
+/*!
+  \file gsd_fonts.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  \todo This file needs to be re-written in OpenGL
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+*/
 
 #include <stdio.h>
 

+ 17 - 0
lib/ogsf/gsd_img_mpeg.c

@@ -1,3 +1,20 @@
+/*!
+  \file gsd_img_mpeg.c
+ 
+  \brief OGSF library - FFMPEG stuff
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+*/
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>

+ 24 - 9
lib/ogsf/gsd_img_ppm.c

@@ -1,12 +1,27 @@
-/* - added little/big endian test Markus Neteler
- * -modified to PPM by Bob Covill <bcovill@tekmap.ns.ca>
- *
- * $Id$ 
- *
- * changed 10/99 Jaro
- * Created new function GS_write_ppm based
- * on RGB dump 
- */
+/*!
+  \file gsd_img_ppm.c
+ 
+  \brief OGSF library - PPM stuff
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+
+  - added little/big endian test Markus Neteler
+  - modified to PPM by Bob Covill <bcovill@tekmap.ns.ca>
+  - changed 10/99 Jaro
+  - Created new function GS_write_ppm based on RGB dump 
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+  Markus Neteler
+  Bob Covill
+  Jaro Hofierka
+*/
 
 #include <stdlib.h>
 #include <stdio.h>

+ 24 - 8
lib/ogsf/gsd_img_tif.c

@@ -1,11 +1,27 @@
-/*
- * $Id$
- *
- * endian added Markus
- * changed 10/99 Jaro
- * Created new function GS_write_tif based
- * on RGB dump 
- */
+/*!
+  \file gsd_img_tif.c
+ 
+  \brief OGSF library - TIFF stuff
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+
+  - added little/big endian test Markus Neteler
+  - modified to PPM by Bob Covill <bcovill@tekmap.ns.ca>
+  - changed 10/99 Jaro
+  - Created new function GS_write_tif based on RGB dump 
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois
+  Markus Neteler
+  Jaro Hofierka
+*/
+
 #include <grass/config.h>
 
 #ifdef HAVE_TIFFIO_H

+ 16 - 16
lib/ogsf/gsd_label.c

@@ -1,19 +1,19 @@
-/*
-* $Id$
-*
-****************************************************************************
-*
-* MODULE: 	GRASS ogsf library
-* AUTHOR(S):	Original author - Bill Brown - USA CERL 1991 - 1992
-*   	    	<new author name here>
-* PURPOSE: 	This file needs to be re-written in OpenGL
-* COPYRIGHT:    (C) 2000 by the GRASS Development Team
-*
-*               This program is free software under the GNU General Public
-*   	    	License (>=v2). Read the file COPYING that comes with GRASS
-*   	    	for details.
-*
-*****************************************************************************/
+/*!
+  \file gsd_label.c
+ 
+  \brief OGSF library - label management
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (1991-1992)
+*/
 
 #include <grass/gstypes.h>
 #include "rgbpack.h"

+ 18 - 3
lib/ogsf/gsd_legend.c

@@ -1,6 +1,21 @@
-/*
- * Converted code from legend.c in SG3d
- * routines to set viewport, close viewport, and make legend
+/*!
+  \file gsd_legend.c
+ 
+  \brief OGSF library - legend creation
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  Converted code from legend.c in SG3d
+  routines to set viewport, close viewport, and make legend
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL
 */
 
 #include <stdlib.h>

+ 15 - 7
lib/ogsf/gsd_objs.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gsd.c
-    Bill Brown, USACERL  
-    October 1993
+/*!
+  \file gsd_label.c
+ 
+  \brief OGSF library - objects management
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (October 1993)
 */
 
 #include <stdio.h>

+ 15 - 7
lib/ogsf/gsd_prim.c

@@ -1,10 +1,18 @@
-/*
-    $Id$
-
-    gsd_prim.c
-    Bill Brown, USACERL  
-    January 1993
-    Primitive drawing functions
+/*!
+  \file gsd_prim.c
+ 
+  \brief OGSF library - primitive drawing functions
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1993)
 */
 
 /* DEBUG */

+ 14 - 6
lib/ogsf/gsd_surf.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
+/*!
+  \file gsd_surf.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
 
-/*  gsd.c
-    Bill Brown, USACERL  
-    October 1993
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (October 1993)
 */
 
 #include <stdlib.h>

+ 15 - 7
lib/ogsf/gsd_views.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gsd_views.c
-    Bill Brown, USACERL  
-    January 1993
+/*!
+  \file gsd_views.c
+ 
+  \brief OGSF library - manipulating views
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1993)
 */
 
 /* DEBUG */

+ 15 - 7
lib/ogsf/gsd_wire.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gsd.c
-    Bill Brown, USACERL  
-    January 1993
+/*!
+  \file gsd_wire.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1993)
 */
 
 #include <stdio.h>

+ 26 - 18
lib/ogsf/gsdiff.c

@@ -1,21 +1,29 @@
-/*
-* $Id$
-*/
-
-/*  gsdiff.c
-    Bill Brown, USACERL  
-    November 1994
-routines to set up automatic on-the-fly recalculation
-of surface elevations, doing a "scaled difference" using another
-surface for reference
-
-Note that we're using a true difference here, between data set values,
-no translations, etc.
-
-TODO: generalize this concept to allow transform functions which are
-dependent on surfaces that are dependent on other surfaces, etc., as long
-as the dependency doesn't loop back.
-
+/*!
+  \file gsdiff.c
+ 
+  \brief OGSF library - loading and manipulating surfaces
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  Routines to set up automatic on-the-fly recalculation
+  of surface elevations, doing a "scaled difference" using another
+  surface for reference
+  
+  Note that we're using a true difference here, between data set values,
+  no translations, etc.
+  
+  \todo generalize this concept to allow transform functions which are
+  dependent on surfaces that are dependent on other surfaces, etc., as long
+  as the dependency doesn't loop back.
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL, GMSL/University of Illinois (November 1994)
 */
 
 #include <stdio.h>

+ 46 - 42
lib/ogsf/gsdrape.c

@@ -1,45 +1,49 @@
-/*
-* $Id$
-*/
-
-/* drape.c
- * AUTHOR: Bill Brown, UI GMS Lab
- * functions to intersect line segments with edges of surface polygons 
-*/
-
-/*
-For efficiency, intersections are found without respect to which
-specific triangle edge is intersected, but on a broader sense with
-the horizontal, vertical, and diagonal seams in the grid, then
-the intersections are ordered.  If quadstrips are used for drawing 
-rather than tmesh, triangulation is not consistant; for diagonal
-intersections, the proper diagonal to intersect would need to be
-determined according to the algorithm used by qstrip (look at nearby
-normals). It may be faster to go ahead and find the intersections 
-with the other diagonals using the same methods, then at sorting 
-time determine which diagonal array to look at for each quad.  
-It would also require a mechanism for throwing out unused intersections
-with the diagonals during the ordering phase.
-Do intersections in 2D, fill line structure with 3D pts (maybe calling
-routine will cache for redrawing).  Get Z value by using linear interp 
-between corners.
-
-1) check for easy cases:
-    a) single point
-    b) colinear with horizontal or vertical edges
-    c) colinear with diagonal edges of triangles
-2) calculate three arrays of ordered intersections:
-    a) with vertical edges
-    b) with horizontal edges
-    c) with diagonal edges
-   and interpolate Z, using simple linear interpolation.
-3) eliminate duplicate intersections (need only compare one coord for each)
-4) build ordered set of points.
-
-Return static pointer to 3D set of points.  Max number of intersections
-will be rows + cols + diags, so should allocate this number to initialize.
-Let calling routine worry about copying points for caching.
-
+/*!
+  \file gsdrape.c
+ 
+  \brief OGSF library - functions to intersect line segments with edges of surface polygons
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  For efficiency, intersections are found without respect to which
+  specific triangle edge is intersected, but on a broader sense with
+  the horizontal, vertical, and diagonal seams in the grid, then
+  the intersections are ordered.  If quadstrips are used for drawing 
+  rather than tmesh, triangulation is not consistant; for diagonal
+  intersections, the proper diagonal to intersect would need to be
+  determined according to the algorithm used by qstrip (look at nearby
+  normals). It may be faster to go ahead and find the intersections 
+  with the other diagonals using the same methods, then at sorting 
+  time determine which diagonal array to look at for each quad.  
+  It would also require a mechanism for throwing out unused intersections
+  with the diagonals during the ordering phase.
+  Do intersections in 2D, fill line structure with 3D pts (maybe calling
+  routine will cache for redrawing).  Get Z value by using linear interp 
+  between corners.
+  
+  - check for easy cases:
+   - single point
+   - colinear with horizontal or vertical edges
+   - colinear with diagonal edges of triangles
+  - calculate three arrays of ordered intersections:
+   - with vertical edges
+   - with horizontal edges
+   - with diagonal edges and interpolate Z, using simple linear interpolation.
+  - eliminate duplicate intersections (need only compare one coord for each)
+  - build ordered set of points.
+  
+  Return static pointer to 3D set of points.  Max number of intersections
+  will be rows + cols + diags, so should allocate this number to initialize.
+  Let calling routine worry about copying points for caching.
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown UI GMS Lab
 */
 
 #include <stdio.h>

+ 52 - 40
lib/ogsf/gsds.c

@@ -1,5 +1,55 @@
-/*
-* $Id$
+/*!
+  \file gsds.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  The idea here is to treat datasets as seperate objects, which SHOULD:
+   - allow easier reuse of data for different attributes.
+   - allow a mechanism for changing data and have changes reflected
+   in each attribute using that data.
+   - allow a mechanism to automatically update data when the data source
+   is changed.
+   - allow easier weaning from GRASS.
+   - allow easier use of shared memory between processes.
+
+  These structures are defined in gstypes.h:
+
+  <code>
+  typedef struct{
+  float *fb;
+  int *ib;
+  short *sb;
+  char *cb;
+  struct BM *bm;
+  } typbuff;
+  </code>
+
+  How about adding a transform func here, so GET_MAPATT would do an
+  on-the-fly transformation? Or even a transform func LIST!
+
+  <code>
+  typedef struct{
+  int data_id;
+  int dims[MAXDIMS];
+  int ndims;
+  int numbytes;
+  char unique_name[80];
+  typbuff databuff;
+  int changed;
+  int need_reload;
+  } dataset;
+  </code>
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown UI GMS Lab
 */
 
 #include <stdlib.h>
@@ -8,44 +58,6 @@
 
 #include <grass/gstypes.h>
 
-/*  The idea here is to treat datasets as seperate objects, which SHOULD:
- *     - allow easier reuse of data for different attributes.
- *     - allow a mechanism for changing data and have changes reflected
- *       in each attribute using that data.
- *     - allow a mechanism to automatically update data when the data source
- *       is changed.
- *     - allow easier weaning from GRASS.
- *     - allow easier use of shared memory between processes.
- * 
- * These structures are defined in gstypes.h:
- * typedef struct{
- *     float *fb;
- *     int *ib;
- *     short *sb;
- *     char *cb;
- *     struct BM *bm;
- * } typbuff;
-  How about adding a transform func here, so GET_MAPATT would do an
-  on-the-fly transformation? Or even a transform func LIST!
- * 
- * typedef struct{
- *     int data_id;
- *     int dims[MAXDIMS];
- *     int ndims;
- *     int numbytes;
- *     char unique_name[80];
- *     typbuff databuff;
- *     int changed;
- *     int need_reload;
- * } dataset;
- *
- * 
-*/
-
-/*
-#define TRACE_FUNCS
-*/
-
 #define LUCKY 33
 #define BLOC 20
 #define MAX_DS 100

+ 15 - 2
lib/ogsf/gsget.c

@@ -1,5 +1,18 @@
-/*
-* $Id$
+/*!
+  \file gsd_get.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (January 1993)
 */
 
 #include <grass/gstypes.h>

+ 0 - 8
lib/ogsf/gsget.h

@@ -1,11 +1,3 @@
-/*
-* $Id$
-*/
-
-/***********
-* gsget.h
-***********/
-
 #ifndef _GSGET_H
 #define _GSGET_H
 

+ 15 - 11
lib/ogsf/gv.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gv.c
-    Bill Brown, USACERL  
-    November 1993
+/*!
+  \file gv.c
+ 
+  \brief OGSF library - loading and manipulating vector sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (November 1993)
 */
 
 #include <stdio.h>
@@ -15,10 +23,6 @@
 
 #define FIRST_VECT_ID 20656
 
-/*
-#define TRACE_FUNCS
-*/
-
 static geovect *Vect_top = NULL;
 
 /***********************************************************************/

+ 18 - 12
lib/ogsf/gv_quick.c

@@ -1,15 +1,21 @@
-/*
-* $Id$
-*/
-
-/*  gv_quick.c
-    Bill Brown, USACERL  
-    December 1993
-*/
-
-/*
-Trying some stuff to draw a quick version of a vector map, to represent
-it when doing interactive translations.
+/*!
+  \file gv_quick.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  Trying some stuff to draw a quick version of a vector map, to represent
+  it when doing interactive translations.
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+
+  \author Bill Brown, USACERL (December 1993)
 */
 
 #include <stdio.h>

+ 15 - 7
lib/ogsf/gvd.c

@@ -1,10 +1,18 @@
-/*
-* $Id$
-*/
-
-/*  gvd.c
-    Bill Brown, USACERL  
-    December 1993
+/*!
+  \file gvd.c
+ 
+  \brief OGSF library - loading and manipulating vector sets
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown USACERL (December 1993)
 */
 	
 #include <stdio.h>

+ 16 - 8
lib/ogsf/gvl.c

@@ -1,11 +1,19 @@
-/*
-* $Id$
-*/
-
-/*  gvl.c
-    volume access routines
-    Bill Brown, UI-GMSL, May 1997
-	Tomas Paudits, Februar 2004
+/*!
+  \file gvl.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Bill Brown, UI-GMSL (May 1997)
+  Tomas Paudits (February 2004)
 */
 
 #include <stdio.h>

+ 16 - 4
lib/ogsf/gvl_calc.c

@@ -1,7 +1,19 @@
-/*  gvl_isosurf_calc.c
- * Tomas Paudits
- * Februar 2004
- */
+/*!
+  \file gvl_calc.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Tomas Paudits (February 2004)
+*/
 
 #include <stdio.h>
 #include <math.h>

+ 18 - 6
lib/ogsf/gvl_calc2.c

@@ -1,9 +1,21 @@
-/*
-Based on implementation of MarchingCubes 33 Algorithm by
-Thomas Lewiner, thomas.lewiner@polytechnique.org, Math Dept, PUC-Rio
-
-Implementation in ogsf library
-Tomas Paudits, 2004
+/*!
+  \file gvl_calc2.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  Based on implementation of MarchingCubes 33 Algorithm by
+  Thomas Lewiner, thomas.lewiner@polytechnique.org, Math Dept, PUC-Rio
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Tomas Paudits, 2004
 */
 
 #include <float.h>

+ 15 - 0
lib/ogsf/gvl_file.c

@@ -1,3 +1,18 @@
+/*!
+  \file gvl_file.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+*/
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>

+ 16 - 4
lib/ogsf/gvld.c

@@ -1,7 +1,19 @@
-/*  gvld.c
- * Tomas Paudits
- * Februar 2004
- */
+/*!
+  \file gvld.c
+ 
+  \brief OGSF library - loading and manipulating volumes
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Tomas Paudits (February 2004)
+*/
 
 #include <stdio.h>
 #include <math.h>

+ 19 - 7
lib/ogsf/mc33_table.h

@@ -1,14 +1,26 @@
-#ifndef _CELL_TABLE_H
-#define _CELL_TABLE_H
+/*!
+  \file m33_table.h
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  LookUpTable for the MarchingCubes 33 Algorithm
+  Thomas Lewiner, thomas.lewiner@polytechnique.org, Math Dept, PUC-Rio
 
-/*
-LookUpTable for the MarchingCubes 33 Algorithm
-Thomas Lewiner, thomas.lewiner@polytechnique.org, Math Dept, PUC-Rio
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
 
-Implementation in ogsf library
-Tomas Paudits, 2004
+  \author Tomas Paudits, 2004
 */
 
+#ifndef _CELL_TABLE_H
+#define _CELL_TABLE_H
+
 typedef struct
 {
     unsigned char nedges;

Plik diff jest za duży
+ 198 - 546
lib/ogsf/ogsflib.dox


+ 0 - 4
lib/ogsf/rgbpack.h

@@ -1,7 +1,3 @@
-/*
-* $Id$
-*/
-
 #ifndef _RGBPACK_H
 #define _RGBPACK_H
 

+ 0 - 4
lib/ogsf/rowcol.h

@@ -1,7 +1,3 @@
-/*
-* $Id$
-*/
-
 #ifndef _ROWCOL_H
 #define _ROWCOL_H
 

+ 39 - 32
lib/ogsf/trans.c

@@ -1,35 +1,42 @@
-/* NOTE: This file should be REMOVED and any calls to the functions in this
-** file should be replaced with appropriate OpenGL calls.
-*/
-
-/*
-**  Written by Dave Gerdes Jan 1990
-**  Copyright  Dave Gerdes 1990    All rights reserved
-**  US Army Construction Engineering Research Lab
-**
-**  Further authors: Justin Hickey, Bob Covill, Brad Douglas
-**
-**  COPYRIGHT:    (C) 1999, 2006 by the GRASS Development Team
-**
-**               This program is free software under the GNU General Public
-**               License (>=v2). Read the file COPYING that comes with GRASS
-**               for details.
-**
-**  Matrix Transformation library.
-**  
-**   P_pushmatrix ()
-**   P_popmatrix ()
-**   P_scale ()		
-**   P_rot ()
-**   P_transform ()      transform array of vectors using current T matrix
-**      		 This routine should be available in GL!
-**
-**  Arguments are same as GL counterparts
-**
-**  I threw this code together in January at the beginning of this
-**  class.  I was still learning about GL at the time.
-**  There are many places where the code could be improved.
-**
+/*!
+  \file trans.c
+ 
+  \brief OGSF library - 
+ 
+  GRASS OpenGL gsurf OGSF Library 
+
+  NOTE: This file should be REMOVED and any calls to the functions in this
+  file should be replaced with appropriate OpenGL calls.
+
+  Matrix Transformation library.
+  
+  P_pushmatrix ()
+  
+  P_popmatrix ()
+
+  P_scale ()		
+  
+  P_rot ()
+
+  P_transform ()      transform array of vectors using current T matrix
+
+  This routine should be available in GL!
+
+  Arguments are same as GL counterparts
+  
+  I threw this code together in January at the beginning of this
+  class.  I was still learning about GL at the time.
+  There are many places where the code could be improved.
+ 
+  (C) 1999-2008 by the GRASS Development Team
+ 
+  This program is free software under the 
+  GNU General Public License (>=v2). 
+  Read the file COPYING that comes with GRASS
+  for details.
+  
+  \author Dave Gerdes Jan 1990 All rights reserved, US Army Construction Engineering Research Lab
+  Bill Brown USACERL (November 1993)
 */
 
 #include <stdio.h>