GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
constraint.c
Go to the documentation of this file.
1 
39 #include <grass/Vect.h>
40 #include <grass/gis.h>
41 
51 int
53  double n, double s, double e, double w, double t,
54  double b)
55 {
56  if (n <= s)
57  return (-1);
58  if (e <= w)
59  return (-1);
60 
61  Map->Constraint_region_flag = 1;
62  Map->Constraint_N = n;
63  Map->Constraint_S = s;
64  Map->Constraint_E = e;
65  Map->Constraint_W = w;
66  Map->Constraint_T = t;
67  Map->Constraint_B = b;
68  Map->proj = G_projection();
69 
70  return (0);
71 }
72 
81 int Vect_get_constraint_box(struct Map_info *Map, BOUND_BOX * Box)
82 {
83  Box->N = Map->Constraint_N;
84  Box->S = Map->Constraint_S;
85  Box->E = Map->Constraint_E;
86  Box->W = Map->Constraint_W;
87  Box->T = Map->Constraint_T;
88  Box->B = Map->Constraint_B;
89 
90  return 0;
91 }
92 
101 int Vect_set_constraint_type(struct Map_info *Map, int type)
102 {
103  Map->Constraint_type = type;
104  Map->Constraint_type_flag = 1;
105 
106  return 0;
107 }
108 
116 int Vect_remove_constraints(struct Map_info *Map)
117 {
118  Map->Constraint_region_flag = 0;
119  Map->Constraint_type_flag = 0;
120 
121  return 0;
122 }
float b
Definition: named_colr.c:8
int Vect_get_constraint_box(struct Map_info *Map, BOUND_BOX *Box)
Get constraint box.
Definition: constraint.c:81
int Vect_set_constraint_type(struct Map_info *Map, int type)
Set constraint type.
Definition: constraint.c:101
float Box[8][3]
Vertices for box.
Definition: gsd_objs.c:1420
int Vect_remove_constraints(struct Map_info *Map)
Remove constraints.
Definition: constraint.c:116
int Vect_set_constraint_region(struct Map_info *Map, double n, double s, double e, double w, double t, double b)
Set constraint region.
Definition: constraint.c:52
tuple Map
Definition: render.py:1310
int n
Definition: dataquad.c:291
int G_projection(void)
query cartographic projection
Definition: proj1.c:33