| 3013 | } |
| 3014 | |
| 3015 | GMT_LOCAL void gmtplot_map_boundary (struct GMT_CTRL *GMT) { |
| 3016 | int way; |
| 3017 | double w, e, s, n; |
| 3018 | struct PSL_CTRL *PSL= GMT->PSL; |
| 3019 | |
| 3020 | if (!GMT->current.map.frame.draw && GMT->current.proj.projection_GMT != GMT_LINEAR) return; /* We have a separate check in linear_map_boundary */ |
| 3021 | if (GMT->current.map.frame.no_frame) return; /* Specifically did not want frame */ |
| 3022 | |
| 3023 | if (GMT->current.map.frame.order == GMT_BASEMAP_BEFORE && GMT->current.map.frame.basemap_flag & GMT_BASEMAP_FRAME_AFTER) return; /* Wrong order */ |
| 3024 | if (GMT->current.map.frame.order == GMT_BASEMAP_AFTER && !(GMT->current.map.frame.basemap_flag & GMT_BASEMAP_FRAME_AFTER)) return; /* Wrong order */ |
| 3025 | |
| 3026 | w = GMT->common.R.wesn[XLO], e = GMT->common.R.wesn[XHI], s = GMT->common.R.wesn[YLO], n = GMT->common.R.wesn[YHI]; |
| 3027 | |
| 3028 | /* Try to arrange longitudes relative to central meridian if it has been set */ |
| 3029 | if ((way = gmtlib_adjust_we_if_central_lon_set (GMT, &w, &e))) |
| 3030 | GMT_Report (GMT->parent, GMT_MSG_DEBUG, "W/E boundaries shifted by %d\n", way * 360); |
| 3031 | |
| 3032 | if (!PSL->internal.comments) PSL_command(PSL, "\n%%Start of map frame\n"); |
| 3033 | PSL_comment(PSL, "Start of map frame\n"); |
| 3034 | |
| 3035 | gmt_setpen (GMT, &GMT->current.setting.map_frame_pen); |
| 3036 | PSL_setcolor (PSL, GMT->current.setting.map_frame_pen.rgb, PSL_IS_STROKE); |
| 3037 | |
| 3038 | switch (GMT->current.proj.projection_GMT) { |
| 3039 | case GMT_LINEAR: |
| 3040 | if (gmt_M_is_geographic (GMT, GMT_IN)) /* xy is lonlat */ |
| 3041 | gmtplot_fancy_map_boundary (GMT, PSL, w, e, s, n); |
| 3042 | else |
| 3043 | gmtplot_linear_map_boundary (GMT, PSL, w, e, s, n); |
| 3044 | break; |
| 3045 | case GMT_POLAR: |
| 3046 | gmtplot_theta_r_map_boundary (GMT, PSL, w, e, s, n); |
| 3047 | break; |
| 3048 | case GMT_MERCATOR: |
| 3049 | case GMT_CYL_EQ: |
| 3050 | case GMT_CYL_EQDIST: |
| 3051 | case GMT_CYL_STEREO: |
| 3052 | case GMT_MILLER: |
| 3053 | gmtplot_fancy_map_boundary (GMT, PSL, w, e, s, n); |
| 3054 | break; |
| 3055 | case GMT_ALBERS: |
| 3056 | case GMT_ECONIC: |
| 3057 | case GMT_LAMBERT: |
| 3058 | case GMT_POLYCONIC: |
| 3059 | gmtplot_conic_map_boundary (GMT, PSL, w, e, s, n); |
| 3060 | break; |
| 3061 | case GMT_OBLIQUE_MERC: |
| 3062 | gmtplot_oblmrc_map_boundary (GMT, PSL, w, e, s, n); |
| 3063 | break; |
| 3064 | case GMT_GENPER: |
| 3065 | gmtplot_genper_map_boundary (GMT, PSL, w, e, s, n); |
| 3066 | break; |
| 3067 | case GMT_STEREO: |
| 3068 | case GMT_ORTHO: |
| 3069 | case GMT_LAMB_AZ_EQ: |
| 3070 | case GMT_AZ_EQDIST: |
| 3071 | case GMT_GNOMONIC: |
| 3072 | if (GMT->current.proj.polar) |
no test coverage detected