File: print_tree

package info (click to toggle)
grass 6.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 104,028 kB
  • ctags: 40,409
  • sloc: ansic: 419,980; python: 63,559; tcl: 46,692; cpp: 29,791; sh: 18,564; makefile: 7,000; xml: 3,505; yacc: 561; perl: 559; lex: 480; sed: 70; objc: 7
file content (55 lines) | stat: -rw-r--r-- 1,288 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
int print_tree(tree)
 struct quadtree *tree;
{
 double x_se,x_sw,x_ne,x_nw,y_se,y_sw,y_ne,y_nw;
    static int k=0;
    static int i=1;

    if (i)
    {
	i = 0;
	printf ("ORGANIZATION: USGS-NMD  DLG DATA - CHARACTE\n");
	printf ("DIGIT DATE:   1977,\n");
	printf ("DIGIT NAME:   grass\n");
	printf ("MAP NAME:     RAPID CITY, SD\n");
	printf ("MAP DATE:     1977,\n");
	printf ("MAP SCALE:    100000\n");
	printf ("OTHER INFO:   RC3.RDS03\n");
	printf ("ZONE:         13\n");
	printf ("WEST EDGE:    -123\n");
	printf ("EAST EDGE:    8004\n");
	printf ("SOUTH EDGE:   -20\n");
	printf ("NORTH EDGE:   5580\n");
	printf ("MAP THRESH:   2\n");
	printf ("VERTI:\n");

    }

 if (tree==NULL) return 0;
 if (tree->data==NULL) return 0;
 if (tree->data->points == NULL) {
  print_tree(tree->se_leaf);
  print_tree(tree->sw_leaf);
  print_tree(tree->ne_leaf);
  print_tree(tree->nw_leaf);
 }
 else {
  x_sw=tree->data->x_orig;
  y_sw=tree->data->y_orig;
  x_nw=x_sw;
  y_se=y_sw;
  x_se=x_sw+tree->data->n_cols*step;
  y_nw=y_sw+tree->data->n_rows*step;
  y_ne=y_nw;
  x_ne=x_se;
  printf("L   5\n");
  printf(" %lf  %lf\n",y_sw,x_sw);
  printf(" %lf  %lf\n",y_nw,x_nw);
  printf(" %lf  %lf\n",y_ne,x_ne);
  printf(" %lf  %lf\n",y_se,x_se);
  printf(" %lf  %lf\n",y_sw,x_sw);
 }
return 1;
}