|
@@ -4,11 +4,14 @@
|
|
|
#include <grass/glocale.h>
|
|
|
#include "plot.h"
|
|
|
|
|
|
+/* arrow heads will be drawn at 25,50,75% of the line length */
|
|
|
+#define PERC_OF_LINE 25
|
|
|
+
|
|
|
int display_dir(struct Map_info *Map, int type, struct cat_list *Clist,
|
|
|
int chcat, int dsize)
|
|
|
{
|
|
|
int ltype;
|
|
|
- double len, x, y, angle, msize;
|
|
|
+ double len, x, y, angle, msize, dist;
|
|
|
struct line_pnts *Points;
|
|
|
struct line_cats *Cats;
|
|
|
|
|
@@ -61,17 +64,13 @@ int display_dir(struct Map_info *Map, int type, struct cat_list *Clist,
|
|
|
|
|
|
len = Vect_line_length(Points);
|
|
|
|
|
|
- Vect_point_on_line(Points, len * 0.25, &x, &y, NULL, &angle, NULL);
|
|
|
- G_debug(3, "plot direction: %f, %f", x, y);
|
|
|
- D_plot_icon(x, y, G_ICON_ARROW, angle, msize);
|
|
|
-
|
|
|
- Vect_point_on_line(Points, len * 0.5, &x, &y, NULL, &angle, NULL);
|
|
|
- G_debug(3, "plot direction: %f, %f", x, y);
|
|
|
- D_plot_icon(x, y, G_ICON_ARROW, angle, msize);
|
|
|
-
|
|
|
- Vect_point_on_line(Points, len * 0.75, &x, &y, NULL, &angle, NULL);
|
|
|
- G_debug(3, "plot direction: %f, %f", x, y);
|
|
|
- D_plot_icon(x, y, G_ICON_ARROW, angle, msize);
|
|
|
+ for (dist = PERC_OF_LINE / 100.0; dist <= 1.0 - PERC_OF_LINE / 100.0;
|
|
|
+ dist += PERC_OF_LINE / 100.0) {
|
|
|
+ Vect_point_on_line(Points, len * dist, &x, &y, NULL, &angle,
|
|
|
+ NULL);
|
|
|
+ G_debug(4, "plot direction: %f, %f", x, y);
|
|
|
+ D_plot_icon(x, y, G_ICON_ARROW, angle, msize);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|