MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / gmtplot_contlabel_drawlines

Function gmtplot_contlabel_drawlines

src/gmt_plot.c:4036–4050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4034}
4035
4036GMT_LOCAL void gmtplot_contlabel_drawlines (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, struct GMT_CONTOUR *G, unsigned int mode) {
4037 uint64_t seg, k;
4038 unsigned int *pen = NULL;
4039 struct GMT_CONTOUR_LINE *L = NULL;
4040 for (seg = 0; seg < G->n_segments; seg++) {
4041 L = G->segment[seg]; /* Pointer to current segment */
4042 if (L->annot && mode == 1) continue; /* Annotated lines done with curved text routine */
4043 gmt_setpen (GMT, &L->pen);
4044 pen = gmt_M_memory (GMT, NULL, L->n, unsigned int);
4045 for (k = 1, pen[0] = PSL_MOVE; k < L->n; k++) pen[k] = PSL_DRAW;
4046 PSL_comment (PSL, "%s: %s\n", G->line_name, L->name);
4047 gmt_plot_line (GMT, L->x, L->y, pen, L->n, PSL_LINEAR);
4048 gmt_M_free (GMT, pen);
4049 }
4050}
4051
4052GMT_LOCAL void gmtplot_contlabel_plotlabels (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, struct GMT_CONTOUR *G, unsigned int mode) {
4053 /* mode controls what takes place:

Callers 1

gmt_contlabel_plotFunction · 0.85

Calls 3

gmt_setpenFunction · 0.85
PSL_commentFunction · 0.85
gmt_plot_lineFunction · 0.85

Tested by

no test coverage detected