constraint.c
Go to the documentation of this file.00001
00039 #include <grass/Vect.h>
00040 #include <grass/gis.h>
00041
00051 int
00052 Vect_set_constraint_region(struct Map_info *Map,
00053 double n, double s, double e, double w, double t,
00054 double b)
00055 {
00056 if (n <= s)
00057 return (-1);
00058 if (e <= w)
00059 return (-1);
00060
00061 Map->Constraint_region_flag = 1;
00062 Map->Constraint_N = n;
00063 Map->Constraint_S = s;
00064 Map->Constraint_E = e;
00065 Map->Constraint_W = w;
00066 Map->Constraint_T = t;
00067 Map->Constraint_B = b;
00068 Map->proj = G_projection();
00069
00070 return (0);
00071 }
00072
00081 int Vect_get_constraint_box(struct Map_info *Map, BOUND_BOX * Box)
00082 {
00083 Box->N = Map->Constraint_N;
00084 Box->S = Map->Constraint_S;
00085 Box->E = Map->Constraint_E;
00086 Box->W = Map->Constraint_W;
00087 Box->T = Map->Constraint_T;
00088 Box->B = Map->Constraint_B;
00089
00090 return 0;
00091 }
00092
00101 int Vect_set_constraint_type(struct Map_info *Map, int type)
00102 {
00103 Map->Constraint_type = type;
00104 Map->Constraint_type_flag = 1;
00105
00106 return 0;
00107 }
00108
00116 int Vect_remove_constraints(struct Map_info *Map)
00117 {
00118 Map->Constraint_region_flag = 0;
00119 Map->Constraint_type_flag = 0;
00120
00121 return 0;
00122 }