[GRASS-SVN] r32198 - in grass/trunk: include lib/ogsf

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 21 18:27:55 EDT 2008


Author: martinl
Date: 2008-07-21 18:27:54 -0400 (Mon, 21 Jul 2008)
New Revision: 32198

Modified:
   grass/trunk/include/ogsf_proto.h
   grass/trunk/lib/ogsf/GP2.c
   grass/trunk/lib/ogsf/Gp3.c
   grass/trunk/lib/ogsf/Gs3.c
   grass/trunk/lib/ogsf/Gv3.c
   grass/trunk/lib/ogsf/gp.c
Log:
ogsflib cosmetics: Gs_status() removed -- replaced by G_debug()
message cleaning & minor doxygen updates


Modified: grass/trunk/include/ogsf_proto.h
===================================================================
--- grass/trunk/include/ogsf_proto.h	2008-07-21 22:02:04 UTC (rev 32197)
+++ grass/trunk/include/ogsf_proto.h	2008-07-21 22:27:54 UTC (rev 32198)
@@ -6,7 +6,7 @@
 * PURPOSE:      To list the prototypes for all accessible functions in this
 *               library. The prototypes are listed by the file in which their
 *               function definitions reside.
-* COPYRIGHT:    (C) 2000 by the GRASS Development Team
+* COPYRIGHT:    (C) 2000-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
@@ -306,7 +306,6 @@
 geopoint *Gp_load_sites(const char *, int *, int *, int *);
 
 /* From Gs3.c */
-void Gs_status(const char *);
 double Gs_distance(double *, double *);
 int Gs_loadmap_as_float(struct Cell_head *, const char *, float *, struct BM *,
     int *);

Modified: grass/trunk/lib/ogsf/GP2.c
===================================================================
--- grass/trunk/lib/ogsf/GP2.c	2008-07-21 22:02:04 UTC (rev 32197)
+++ grass/trunk/lib/ogsf/GP2.c	2008-07-21 22:27:54 UTC (rev 32198)
@@ -39,12 +39,6 @@
 {
     int i, found = 0;
 
-#ifdef TRACE_GP_FUNCS
-    {
-	Gs_status("GP_site_exists");
-    }
-#endif
-
     if (NULL == gp_get_site(id)) {
 	return (0);
     }
@@ -54,12 +48,14 @@
 	    found = 1;
 	}
     }
+    
+    G_debug(3, "GP_site_exists(): found=%d", found);
 
     return (found);
 }
 
 /*!
-  \brief Register new point set
+  \brief Create new point set
 
   \return point set id
   \return -1 on error (number of point sets exceeded)
@@ -68,17 +64,14 @@
 {
     geosite *np;
 
-#ifdef TRACE_GP_FUNCS
-    {
-	Gs_status("GP_new_site");
-    }
-#endif
-
     if (Next_site < MAX_SITES) {
 	np = gp_get_new_site();
 	gp_set_defaults(np);
 	Site_ID[Next_site] = np->gsite_id;
 	++Next_site;
+
+	G_debug(3, "GP_new_site() id=%d", np->gsite_id);
+
 	return (np->gsite_id);
     }
 
@@ -86,7 +79,7 @@
 }
 
 /*!
-  \brief Get number of available point sets
+  \brief Get number of loaded point sets
 
   \return number of point sets
 */
@@ -139,11 +132,7 @@
 {
     int i, j, found = 0;
 
-#ifdef TRACE_GP_FUNCS
-    {
-	Gs_status("GP_delete_site");
-    }
-#endif
+    G_debug(3, "GP_delete_site(): id=%d", id);
 
     if (GP_site_exists(id)) {
 	gp_delete_site(id);
@@ -197,8 +186,10 @@
 	strcpy(gp->filename, filename);
     }
 
-    if (gp->points = Gp_load_sites(filename, &(gp->n_sites),
-				   &(gp->has_z), &(gp->has_att))) {
+    gp->points = Gp_load_sites(filename, &(gp->n_sites),
+			       &(gp->has_z), &(gp->has_att));
+
+    if(gp->points) {
 	return (1);
     }
 
@@ -249,14 +240,14 @@
 }
 
 /*!
-  \brief Set mode for point set
+  \brief Set point set mode
 
   \param id point set id
   \param atmod
-  \param color color value
+  \param color icon color
   \param width 
-  \param size point size
-  \param marker marker symbol
+  \param size icon size
+  \param marker icon symbol
 
   \return -1 on error (point set not found)
 */
@@ -393,11 +384,8 @@
 {
     geosite *gp;
 
-#ifdef TRACE_GP_FUNCS
-    {
-	Gs_status("GP_set_trans");
-    }
-#endif
+    G_debug(3, "GP_set_trans(): id=%d trans=%f,%f,%f",
+	    id, xtrans, ytrans, ztrans);
 
     gp = gp_get_site(id);
     if (gp) {
@@ -419,12 +407,6 @@
 {
     geosite *gp;
 
-#ifdef TRACE_GP_FUNCS
-    {
-	Gs_status("GP_get_trans");
-    }
-#endif
-
     gp = gp_get_site(id);
 
     if (gp) {
@@ -433,6 +415,9 @@
 	*ztrans = gp->z_trans;
     }
 
+    G_debug(3, "GP_get_trans(): id=%d, trans=%f,%f,%f",
+	    id, *xtrans, *ytrans, *ztrans);
+
     return;
 }
 

Modified: grass/trunk/lib/ogsf/Gp3.c
===================================================================
--- grass/trunk/lib/ogsf/Gp3.c	2008-07-21 22:02:04 UTC (rev 32197)
+++ grass/trunk/lib/ogsf/Gp3.c	2008-07-21 22:27:54 UTC (rev 32198)
@@ -114,7 +114,7 @@
     Vect_set_open_level (2);
     if (Vect_open_old (&map, grassname, "") == -1) {
 	G_fatal_error (_("Unable to open vector map <%s>"),
-		       grassname);
+		       G_fully_qualified_name(grassname, mapset));
     }
 
     Points = Vect_new_line_struct ();
@@ -144,7 +144,7 @@
 	case -1:
 	{
 	    G_warning(_("Unable to read vector map <%s>"),
-		      grassname);
+		      G_fully_qualified_name(grassname, mapset));
 	    return (NULL);
 	}
 	case -2: /* EOF */
@@ -203,12 +203,12 @@
     Vect_close (&map);
     
     if (!np) {
-	G_warning (_("No points from %s fall within current region"),
-		   grassname);
+	G_warning (_("No points from vector map <%s> fall within current region"),
+		   G_fully_qualified_name(grassname, mapset));
 	return(NULL);
     } else {
-	G_verbose_message(_("Vector file <%s> loaded with %d points"),
-			  grassname, np);
+	G_message(_("Vector map <%s> loaded (%d points)"),
+		  G_fully_qualified_name(grassname, mapset), np);
     }
     
     *nsites = np;

Modified: grass/trunk/lib/ogsf/Gs3.c
===================================================================
--- grass/trunk/lib/ogsf/Gs3.c	2008-07-21 22:02:04 UTC (rev 32197)
+++ grass/trunk/lib/ogsf/Gs3.c	2008-07-21 22:27:54 UTC (rev 32198)
@@ -71,18 +71,6 @@
 
 #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.
- */
-void Gs_status(const char *str)
-{
-    G_debug(3, "%s", str);
-
-    return;
-}
-
 /*!
   \brief Calculates distance in METERS between two points in current projection (2D)
 

Modified: grass/trunk/lib/ogsf/Gv3.c
===================================================================
--- grass/trunk/lib/ogsf/Gv3.c	2008-07-21 22:02:04 UTC (rev 32197)
+++ grass/trunk/lib/ogsf/Gv3.c	2008-07-21 22:27:54 UTC (rev 32198)
@@ -64,9 +64,6 @@
 	return NULL;
     }
 
-    G_message(_("Loading vector map <%s>..."),
-	      G_fully_qualified_name(grassname, mapset));
-    
     top = gln = (geoline *) G_malloc(sizeof(geoline)); /* G_fatal_error */
     if (!top) {
 	return NULL;
@@ -242,13 +239,14 @@
    
     if (!nl) {
 	G_warning (_("No features from vector map <%s> fall within current region"),
-		   grassname);
+		   G_fully_qualified_name(grassname, mapset));
 	return (NULL);
     }
+    else {
+      G_message (_("Vector map <%s> loaded (%d features)"),
+		 grassname, nl);
+    }
     
-    G_verbose_message (_("Vector map <%s> loaded (%d features)"),
-		       grassname, nl);
-    
     *nlines = nl;
     
 #ifdef TRAK_MEM

Modified: grass/trunk/lib/ogsf/gp.c
===================================================================
--- grass/trunk/lib/ogsf/gp.c	2008-07-21 22:02:04 UTC (rev 32197)
+++ grass/trunk/lib/ogsf/gp.c	2008-07-21 22:27:54 UTC (rev 32198)
@@ -37,7 +37,7 @@
 {
     geosite *gp;
 
-    G_debug(3, "gp_get_site");
+    G_debug(4, "gp_get_site");
 
     for (gp = Site_top; gp; gp = gp->next) {
 	if (gp->gsite_id == id) {
@@ -60,7 +60,7 @@
 {
     geosite *pp;
 
-    G_debug(3, "gp_get_prev_site");
+    G_debug(4, "gp_get_prev_site");
 
     for (pp = Site_top; pp; pp = pp->next) {
 	if (pp->gsite_id == id - 1) {
@@ -72,7 +72,7 @@
 }
 
 /*!
-  \brief Get number of registrated point sets
+  \brief Get number of loaded point sets
 
   \return number of point sets
 */
@@ -81,10 +81,10 @@
     geosite *gp;
     int i;
 
-    G_debug(3, "gp_num_sites");
-
     for (i = 0, gp = Site_top; gp; gp = gp->next, i++);
 
+    G_debug(4, "gp_num_sites(): n=%d", i);
+
     return (i);
 }
 
@@ -98,7 +98,7 @@
 {
     geosite *lp;
 
-    G_debug(3, "gp_get_last_site");
+    G_debug(4, "gp_get_last_site");
 
     if (!Site_top) {
 	return (NULL);
@@ -106,7 +106,7 @@
 
     for (lp = Site_top; lp->next; lp = lp->next);
 
-    G_debug(3, " last site id: %d", lp->gsite_id);
+    G_debug(4, " last site id: %d", lp->gsite_id);
 
     return (lp);
 }
@@ -121,7 +121,7 @@
 {
     geosite *np, *lp;
 
-    G_debug(3, "gp_get_new_site");
+    G_debug(4, "gp_get_new_site");
 
     np = (geosite *) G_malloc(sizeof(geosite)); /* G_fatal_error */
     if (!np) {
@@ -185,7 +185,7 @@
     int i;
     float dim;
 
-    G_debug(3, "gp_set_defaults");
+    G_debug(4, "gp_set_defaults");
 
     if (!gp) {
 	return (-1);
@@ -248,7 +248,7 @@
 */
 int gp_init_site(geosite * gp)
 {
-    G_debug(3, "gp_init_site");
+    G_debug(4, "gp_init_site");
 
     if (!gp) {
 	return (-1);
@@ -266,7 +266,7 @@
 {
     geosite *fp;
 
-    G_debug(3, "gp_delete_site");
+    G_debug(4, "gp_delete_site");
 
     fp = gp_get_site(id);
 
@@ -290,7 +290,7 @@
     geosite *gp;
     int found = 0;
 
-    G_debug(3, "gp_free_site");
+    G_debug(4, "gp_free_site");
 
     if (Site_top) {
 	if (fp == Site_top) {



More information about the grass-commit mailing list