Changeset 62026
- Timestamp:
- Sep 17, 2014, 3:43:22 PM (10 years ago)
- Location:
- grass/trunk
- Files:
-
- 4 edited
-
display/d.info/main.c (modified) (1 diff)
-
include/defs/display.h (modified) (2 diffs)
-
lib/display/r_raster.c (modified) (4 diffs)
-
lib/display/setup.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/display/d.info/main.c
r52861 r62026 72 72 73 73 if (rflag->answer || dflag->answer || fflag->answer) 74 D_get_ window(&t, &b, &l, &r);74 D_get_frame(&t, &b, &l, &r); 75 75 76 76 -
grass/trunk/include/defs/display.h
r49183 r62026 150 150 int D_save_command(const char *); 151 151 152 void D_get_window(double *, double *, double *, double *);153 154 152 void D__erase(void); 155 153 … … 163 161 void D_font_info(char ***, int *); 164 162 163 void D_get_clip_window(double *, double *, double *, double *); 164 void D_set_clip_window(double, double, double, double); 165 void D_get_frame(double *, double *, double *, double *); 166 void D_set_clip_window_to_map_window(void); 167 void D_set_clip_window_to_screen_window(void); 168 165 169 #endif /* GRASS_DISPLAYDEFS_H */ -
grass/trunk/lib/display/r_raster.c
r60215 r62026 37 37 static int read_env_file(const char *); 38 38 39 static struct { 40 double t, b, l, r; 41 } screen; 42 39 43 static void init(void) 40 44 { … … 61 65 62 66 if (frame) { 63 double t, b, l, r; 64 sscanf(frame, "%lf,%lf,%lf,%lf", &t, &b, &l, &r); 65 COM_Set_window(t, b, l, r); 67 sscanf(frame, "%lf,%lf,%lf,%lf", &screen.t, &screen.b, &screen.l, &screen.r); 68 COM_Set_window(screen.t, screen.b, screen.l, screen.r); 66 69 } 70 else 71 COM_Get_window(&screen.t, &screen.b, &screen.l, &screen.r); 67 72 } 68 73 … … 267 272 268 273 /*! 269 \brief Get clipping frame270 271 \param[out] t top272 \param[out] b bottom273 \param[out] l left274 \param[out] r right275 */276 void D_get_window(double *t, double *b, double *l, double *r)277 {278 return COM_Get_window(t, b, l, r);279 }280 281 /*!282 274 \brief Draw text 283 275 … … 335 327 COM_Font_info(list, count); 336 328 } 329 330 /*! 331 * \brief get graphical clipping window 332 * 333 * Queries the graphical clipping window (origin is top right) 334 * 335 * \param[out] t top edge of clip window 336 * \param[out] b bottom edge of clip window 337 * \param[out] l left edge of clip window 338 * \param[out] r right edge of clip window 339 * \return ~ 340 */ 341 342 void D_get_clip_window(double *t, double *b, double *l, double *r) 343 { 344 COM_Get_window(t, b, l, r); 345 } 346 347 /*! 348 * \brief set graphical clipping window 349 * 350 * Sets the graphical clipping window to the specified rectangle 351 * (origin is top right) 352 * 353 * \param t top edge of clip window 354 * \param b bottom edge of clip window 355 * \param l left edge of clip window 356 * \param r right edge of clip window 357 * \return ~ 358 */ 359 360 void D_set_clip_window(double t, double b, double l, double r) 361 { 362 if (t < screen.t) t = screen.t; 363 if (b > screen.b) b = screen.b; 364 if (l < screen.l) l = screen.l; 365 if (r > screen.r) r = screen.r; 366 367 COM_Set_window(t, b, l, r); 368 } 369 370 /*! 371 * \brief get graphical window (frame) 372 * 373 * Queries the graphical frame (origin is top right) 374 * 375 * \param[out] t top edge of frame 376 * \param[out] b bottom edge of frame 377 * \param[out] l left edge of frame 378 * \param[out] r right edge of frame 379 * \return ~ 380 */ 381 382 void D_get_frame(double *t, double *b, double *l, double *r) 383 { 384 *t = screen.t; 385 *b = screen.b; 386 *l = screen.l; 387 *r = screen.r; 388 } 389 390 /*! 391 * \brief set graphical clipping window to map window 392 * 393 * Sets the graphical clipping window to the pixel window that corresponds 394 * to the current database region. 395 * 396 * \param ~ 397 * \return ~ 398 */ 399 400 void D_set_clip_window_to_map_window(void) 401 { 402 D_set_clip_window( 403 D_get_d_north(), D_get_d_south(), 404 D_get_d_west(), D_get_d_east()); 405 } 406 407 /*! 408 * \brief set clipping window to screen window 409 * 410 * Sets the clipping window to the pixel window that corresponds to the 411 * full screen window. Off screen rendering is still clipped. 412 * 413 * \param ~ 414 * \return ~ 415 */ 416 417 void D_set_clip_window_to_screen_window(void) 418 { 419 COM_Set_window(screen.t, screen.b, screen.l, screen.r); 420 } 421 -
grass/trunk/lib/display/setup.c
r52601 r62026 47 47 double dt, db, dl, dr; 48 48 49 D_get_ window(&dt, &db, &dl, &dr);49 D_get_frame(&dt, &db, &dl, &dr); 50 50 51 51 G_get_set_window(®ion); … … 54 54 D_do_conversions(®ion, dt, db, dl, dr); 55 55 56 D_set_clip_window_to_screen_window(); 57 56 58 if (clear) 57 59 D_erase(DEFAULT_BG_COLOR); 60 61 D_set_clip_window_to_map_window(); 58 62 } 59 63 … … 74 78 double dt, db, dl, dr; 75 79 76 D_get_ window(&dt, &db, &dl, &dr);80 D_get_frame(&dt, &db, &dl, &dr); 77 81 78 82 D_set_src(dt, db, dl, dr); … … 81 85 D_update_conversions(); 82 86 87 D_set_clip_window_to_screen_window(); 88 83 89 if (clear) 84 90 D_erase(DEFAULT_BG_COLOR); 91 92 D_set_clip_window_to_map_window(); 85 93 } 86 94 … … 106 114 double dt, db, dl, dr; 107 115 108 D_get_ window(&dt, &db, &dl, &dr);116 D_get_frame(&dt, &db, &dl, &dr); 109 117 110 118 D_set_src(st, sb, sl, sr); … … 116 124 D_update_conversions(); 117 125 126 D_set_clip_window_to_screen_window(); 127 118 128 if (clear) 119 129 D_erase(DEFAULT_BG_COLOR); 130 131 D_set_clip_window_to_map_window(); 120 132 }
Note:
See TracChangeset
for help on using the changeset viewer.
