/
cp.c
69 lines (56 loc) · 1.72 KB
/
cp.c
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <stdlib.h>
#include <string.h>
#include "global.h"
int get_conz_points(struct Ortho_Image_Group *group)
{
char msg[1024];
if (!I_get_con_points(group->name, &group->control_points))
group->control_points.count = 0;
sprintf(msg, _("Control Z Point file for group <%s@%s> - "),
group->name, G_mapset());
G_verbose_message(_("Computing equations..."));
select_target_env();
Compute_ortho_equation(group);
select_current_env();
switch (group->con_equation_stat) {
case -1:
strcat(msg, _("Poorly placed control points."));
strcat(msg, _(" Can not generate the transformation equation."));
strcat(msg, _(" Run OPTION 7 of i.ortho.photo again!\n"));
break;
case 0:
strcat(msg, _("No active Control Points!"));
strcat(msg, _(" Can not generate the transformation equation."));
strcat(msg, _(" Run OPTION 7 of i.ortho.photo!\n"));
break;
default:
return 1;
}
G_fatal_error("%s", msg);
return 0;
}
int get_ref_points(struct Ortho_Image_Group *group)
{
char msg[1024];
if (!I_get_ref_points(group->name, &group->photo_points))
exit(0);
sprintf(msg, _("Reference Point file for group <%s@%s> - "),
group->name, G_mapset());
Compute_ref_equation(group);
switch (group->ref_equation_stat) {
case -1:
strcat(msg, _("Poorly placed reference points."));
strcat(msg, _(" Can not generate the transformation equation."));
strcat(msg, _(" Run OPTION 5 of i.ortho.photo again!"));
break;
case 0:
strcat(msg, _("No active reference points."));
strcat(msg, _(" Can not generate the transformation equation."));
strcat(msg, _(" Run OPTION 5 of i.ortho.photo!"));
break;
default:
return 1;
}
G_fatal_error("%s", msg);
return 0;
}