Browse Source

nvizlib: fix indentation in position.c

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46776 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 years ago
parent
commit
12a85f3b45
1 changed files with 49 additions and 43 deletions
  1. 49 43
      lib/nviz/position.c

+ 49 - 43
lib/nviz/position.c

@@ -1,10 +1,10 @@
 /*!
 /*!
    \file lib/nviz/position.c
    \file lib/nviz/position.c
-   
+
    \brief Nviz library -- Position, focus settings
    \brief Nviz library -- Position, focus settings
-   
+
    Based on visualization/nviz/src/position.c
    Based on visualization/nviz/src/position.c
-   
+
    (C) 2008, 2010 by the GRASS Development Team
    (C) 2008, 2010 by the GRASS Development Team
    This program is free software under the GNU General Public License
    This program is free software under the GNU General Public License
    (>=v2). Read the file COPYING that comes with GRASS for details.
    (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -20,21 +20,21 @@
 
 
    Set position to center of view
    Set position to center of view
  */
  */
-void Nviz_init_view(nv_data *data)
+void Nviz_init_view(nv_data * data)
 {
 {
     GS_init_view();
     GS_init_view();
-    Nviz_set_focus_state(1);   /* center of view */
-    
+    Nviz_set_focus_state(1);	/* center of view */
+
     /* set default lights (1 & 2) */
     /* set default lights (1 & 2) */
     Nviz_set_light_position(data, 1, 0.68, -0.68, 0.80, 0.0);
     Nviz_set_light_position(data, 1, 0.68, -0.68, 0.80, 0.0);
-    Nviz_set_light_bright(data,   1, 0.8);
-    Nviz_set_light_color(data,    1, 255, 255, 255);
-    Nviz_set_light_ambient(data,  1, 0.2);
+    Nviz_set_light_bright(data, 1, 0.8);
+    Nviz_set_light_color(data, 1, 255, 255, 255);
+    Nviz_set_light_ambient(data, 1, 0.2);
     Nviz_set_light_position(data, 2, 0.0, 0.0, 1.0, 0.0);
     Nviz_set_light_position(data, 2, 0.0, 0.0, 1.0, 0.0);
-    Nviz_set_light_bright(data,   2, 0.5);
-    Nviz_set_light_color(data,    2, 255, 255, 255);
-    Nviz_set_light_ambient(data,  2, 0.3);
-    
+    Nviz_set_light_bright(data, 2, 0.5);
+    Nviz_set_light_color(data, 2, 255, 255, 255);
+    Nviz_set_light_ambient(data, 2, 0.3);
+
     return;
     return;
 }
 }
 
 
@@ -49,12 +49,12 @@ void Nviz_init_view(nv_data *data)
 int Nviz_set_focus_state(int state_flag)
 int Nviz_set_focus_state(int state_flag)
 {
 {
     if (state_flag == 1)
     if (state_flag == 1)
-        GS_set_infocus();   /* return center of view */
+	GS_set_infocus();	/* return center of view */
     else if (state_flag == 0)
     else if (state_flag == 0)
-        GS_set_nofocus();   /* no center of view -- use viewdir */
+	GS_set_nofocus();	/* no center of view -- use viewdir */
     else {
     else {
-        G_warning(_("Unable to set focus"));
-        return 0;
+	G_warning(_("Unable to set focus"));
+	return 0;
     }
     }
 
 
     return 1;
     return 1;
@@ -75,49 +75,51 @@ int Nviz_set_focus_state(int state_flag)
 int Nviz_set_focus_map(int type, int id)
 int Nviz_set_focus_map(int type, int id)
 {
 {
     if (GS_num_surfs() < 0 && GVL_num_vols() < 0) {
     if (GS_num_surfs() < 0 && GVL_num_vols() < 0) {
-        GS_set_nofocus();
-        return 0;
+	GS_set_nofocus();
+	return 0;
     }
     }
 
 
     if (type == MAP_OBJ_UNDEFINED) {
     if (type == MAP_OBJ_UNDEFINED) {
-        int *surf_list, num_surfs, *vol_list;
-
-        if (GS_num_surfs() > 0) {
-            surf_list = GS_get_surf_list(&num_surfs);
-            id = surf_list[0];
-            G_free(surf_list);
-    
-            GS_set_focus_center_map(id);
-        }
-
-        if (GVL_num_vols() > 0) {
-            vol_list = GVL_get_vol_list(&num_surfs);
-            id = vol_list[0];
-            G_free(vol_list);
-    
-            GVL_set_focus_center_map(id);
-        }
-        return id;
+	int *surf_list, num_surfs, *vol_list;
+
+	if (GS_num_surfs() > 0) {
+	    surf_list = GS_get_surf_list(&num_surfs);
+	    id = surf_list[0];
+	    G_free(surf_list);
+
+	    GS_set_focus_center_map(id);
+	}
+
+	if (GVL_num_vols() > 0) {
+	    vol_list = GVL_get_vol_list(&num_surfs);
+	    id = vol_list[0];
+	    G_free(vol_list);
+
+	    GVL_set_focus_center_map(id);
+	}
+	return id;
     }
     }
 
 
     if (type == MAP_OBJ_SURF) {
     if (type == MAP_OBJ_SURF) {
-        GS_set_focus_center_map(id);
+	GS_set_focus_center_map(id);
     }
     }
     else if (type == MAP_OBJ_VOL) {
     else if (type == MAP_OBJ_VOL) {
-        GVL_set_focus_center_map(id);
+	GVL_set_focus_center_map(id);
     }
     }
 
 
     return id;
     return id;
 }
 }
+
 /*!
 /*!
    \brief Get focus
    \brief Get focus
 
 
    \param data nviz data
    \param data nviz data
    \param x,y,z focus coordinates
    \param x,y,z focus coordinates
  */
  */
-int Nviz_get_focus(nv_data * data, float * x, float * y, float * z)
+int Nviz_get_focus(nv_data * data, float *x, float *y, float *z)
 {
 {
     float realto[3];
     float realto[3];
+
     /* Get current center */
     /* Get current center */
     GS_get_focus(realto);
     GS_get_focus(realto);
     *x = realto[0];
     *x = realto[0];
@@ -129,6 +131,7 @@ int Nviz_get_focus(nv_data * data, float * x, float * y, float * z)
     return 1;
     return 1;
 
 
 }
 }
+
 /*!
 /*!
    \brief Set focus
    \brief Set focus
 
 
@@ -149,6 +152,7 @@ int Nviz_set_focus(nv_data * data, float x, float y, float z)
     return 1;
     return 1;
 
 
 }
 }
+
 /*!
 /*!
    \brief Test focus
    \brief Test focus
 
 
@@ -159,10 +163,11 @@ int Nviz_has_focus(nv_data * data)
     float realto[3];
     float realto[3];
 
 
     if (GS_get_focus(realto))
     if (GS_get_focus(realto))
-        return 1;
+	return 1;
     else
     else
-        return 0;
+	return 0;
 }
 }
+
 /*!
 /*!
    \brief Get xy range
    \brief Get xy range
 
 
@@ -170,8 +175,9 @@ int Nviz_has_focus(nv_data * data)
  */
  */
 float Nviz_get_xyrange(nv_data * data)
 float Nviz_get_xyrange(nv_data * data)
 {
 {
-   return data->xyrange;
+    return data->xyrange;
 }
 }
+
 /*!
 /*!
    \brief Get z range
    \brief Get z range