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

Function gmtplot_vertical_wall

src/gmt_plot.c:3152–3176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3150}
3151
3152GMT_LOCAL void gmtplot_vertical_wall (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, int quadrant, double *nesw, bool back, unsigned int mode3d) {
3153 /* Draws the two vertical walls in the back of the 3-D plot */
3154 int plane = (quadrant + 1) % 2; /* Black magic that gives us GMT_X (for yz plane) or GMT_Y (for xz plane) */
3155 double xx[4], yy[4];
3156 gmt_plane_perspective (GMT, plane, nesw[quadrant % 4]);
3157 /* Assign the coordinates of the four corners of the wall (hence assumed to be rectangular) */
3158 xx[0] = xx[1] = nesw[(quadrant+1)%4]; xx[2] = xx[3] = nesw[(quadrant+3)%4];
3159 yy[0] = yy[3] = GMT->current.proj.zmin; yy[1] = yy[2] = GMT->current.proj.zmax;
3160 if (mode3d & GMT_3D_WALL && back) { /* Called for one of the back walls and we wish to draw it */
3161 int wplane = 1 - plane; /* Get integer for the correct plain side */
3162 if (GMT->current.map.frame.paint[wplane]) { /* First paint the back wall, with no outline drawn */
3163 PSL_setfill (PSL, GMT->current.map.frame.fill[wplane].rgb, 0);
3164 PSL_plotbox (PSL, nesw[(quadrant+1)%4], GMT->current.proj.zmin, nesw[(quadrant+3)%4], GMT->current.proj.zmax);
3165 }
3166 if (back) /* Gridlines was requested, so draw those now */
3167 gmtplot_z_gridlines (GMT, PSL, GMT->common.R.wesn[ZLO], GMT->common.R.wesn[ZHI], plane, mode3d, quadrant);
3168
3169 if (GMT->current.map.frame.draw_wall) { /* We wanted the outline of the back-wall drawn, do now to overwrite any perimeter gridlines */
3170 gmt_setpen (GMT, &GMT->current.map.frame.pen);
3171 PSL_plotline (PSL, xx, yy, 4, PSL_MOVE|PSL_STROKE);
3172 }
3173 }
3174 else if (back) /* Get here if no back-walls were filled our outlined */
3175 gmtplot_z_gridlines (GMT, PSL, GMT->common.R.wesn[ZLO], GMT->common.R.wesn[ZHI], plane, mode3d, quadrant);
3176}
3177
3178GMT_LOCAL void gmtplot_cube_box (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, int quadrant, double *nesw) {
3179 /* Draws the 3-D cube lines */

Callers 1

gmt_vertical_axisFunction · 0.85

Calls 6

gmt_plane_perspectiveFunction · 0.85
PSL_setfillFunction · 0.85
PSL_plotboxFunction · 0.85
gmtplot_z_gridlinesFunction · 0.85
gmt_setpenFunction · 0.85
PSL_plotlineFunction · 0.85

Tested by

no test coverage detected