Panda3D
|
00001 // Filename: displayRegion.I 00002 // Created by: frang (07Mar99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: DisplayRegion::operator < 00018 // Access: Public 00019 // Description: Returns true if this DisplayRegion should be sorted 00020 // before the other one, false otherwise. 00021 //////////////////////////////////////////////////////////////////// 00022 INLINE bool DisplayRegion:: 00023 operator < (const DisplayRegion &other) const { 00024 return get_sort() < other.get_sort(); 00025 } 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Function: DisplayRegion::get_lens_index 00029 // Access: Public 00030 // Description: Returns the specific lens of the associated Camera 00031 // that will be used for rendering this scene. Most 00032 // Cameras hold only one lens, but for multiple lenses 00033 // this method may be used to selected between them. 00034 //////////////////////////////////////////////////////////////////// 00035 INLINE int DisplayRegion:: 00036 get_lens_index() const { 00037 CDReader cdata(_cycler); 00038 return cdata->_lens_index; 00039 } 00040 00041 /////////////////////////////////////////////////////////////////// 00042 // Function: DisplayRegion::get_dimensions 00043 // Access: Published 00044 // Description: Retrieves the coordinates of the DisplayRegion's 00045 // rectangle within its GraphicsOutput. These numbers 00046 // will be in the range [0..1]. 00047 //////////////////////////////////////////////////////////////////// 00048 INLINE void DisplayRegion:: 00049 get_dimensions(float &l, float &r, float &b, float &t) const { 00050 CDReader cdata(_cycler); 00051 l = cdata->_l; 00052 r = cdata->_r; 00053 b = cdata->_b; 00054 t = cdata->_t; 00055 } 00056 00057 //////////////////////////////////////////////////////////////////// 00058 // Function: DisplayRegion::get_left 00059 // Access: Published 00060 // Description: Retrieves the x coordinate of the left edge of the 00061 // rectangle within its GraphicsOutput. This number 00062 // will be in the range [0..1]. 00063 //////////////////////////////////////////////////////////////////// 00064 INLINE float DisplayRegion:: 00065 get_left() const { 00066 CDReader cdata(_cycler); 00067 return cdata->_l; 00068 } 00069 00070 //////////////////////////////////////////////////////////////////// 00071 // Function: DisplayRegion::get_right 00072 // Access: Published 00073 // Description: Retrieves the x coordinate of the right edge of the 00074 // rectangle within its GraphicsOutput. This number 00075 // will be in the range [0..1]. 00076 //////////////////////////////////////////////////////////////////// 00077 INLINE float DisplayRegion:: 00078 get_right() const { 00079 CDReader cdata(_cycler); 00080 return cdata->_r; 00081 } 00082 00083 //////////////////////////////////////////////////////////////////// 00084 // Function: DisplayRegion::get_bottom 00085 // Access: Published 00086 // Description: Retrieves the y coordinate of the bottom edge of 00087 // the rectangle within its GraphicsOutput. This 00088 // number will be in the range [0..1]. 00089 //////////////////////////////////////////////////////////////////// 00090 INLINE float DisplayRegion:: 00091 get_bottom() const { 00092 CDReader cdata(_cycler); 00093 return cdata->_b; 00094 } 00095 00096 //////////////////////////////////////////////////////////////////// 00097 // Function: DisplayRegion::get_top 00098 // Access: Published 00099 // Description: Retrieves the y coordinate of the top edge of the 00100 // rectangle within its GraphicsOutput. This number 00101 // will be in the range [0..1]. 00102 //////////////////////////////////////////////////////////////////// 00103 INLINE float DisplayRegion:: 00104 get_top() const { 00105 CDReader cdata(_cycler); 00106 return cdata->_t; 00107 } 00108 00109 //////////////////////////////////////////////////////////////////// 00110 // Function: DisplayRegion::get_window 00111 // Access: Published 00112 // Description: Returns the GraphicsOutput that this DisplayRegion is 00113 // ultimately associated with, or NULL if no window is 00114 // associated. 00115 //////////////////////////////////////////////////////////////////// 00116 INLINE GraphicsOutput *DisplayRegion:: 00117 get_window() const { 00118 return _window; 00119 } 00120 00121 //////////////////////////////////////////////////////////////////// 00122 // Function: DisplayRegion::get_camera 00123 // Access: Published 00124 // Description: Returns the camera associated with this 00125 // DisplayRegion, or an empty NodePath if no camera is 00126 // associated. 00127 //////////////////////////////////////////////////////////////////// 00128 INLINE NodePath DisplayRegion:: 00129 get_camera(Thread *current_thread) const { 00130 CDReader cdata(_cycler, current_thread); 00131 return cdata->_camera; 00132 } 00133 00134 //////////////////////////////////////////////////////////////////// 00135 // Function: DisplayRegion::is_active 00136 // Access: Published 00137 // Description: Returns the active flag associated with the 00138 // DisplayRegion. 00139 //////////////////////////////////////////////////////////////////// 00140 INLINE bool DisplayRegion:: 00141 is_active() const { 00142 CDReader cdata(_cycler); 00143 return cdata->_active; 00144 } 00145 00146 //////////////////////////////////////////////////////////////////// 00147 // Function: DisplayRegion::get_sort 00148 // Access: Published 00149 // Description: Returns the sort value associated with the 00150 // DisplayRegion. 00151 //////////////////////////////////////////////////////////////////// 00152 INLINE int DisplayRegion:: 00153 get_sort() const { 00154 CDReader cdata(_cycler); 00155 return cdata->_sort; 00156 } 00157 00158 //////////////////////////////////////////////////////////////////// 00159 // Function: DisplayRegion::get_stereo_channel 00160 // Access: Published 00161 // Description: Returns whether the DisplayRegion is specified as the 00162 // left or right channel of a stereo pair, or whether it 00163 // is a normal, monocular image. See 00164 // set_stereo_channel(). 00165 //////////////////////////////////////////////////////////////////// 00166 INLINE Lens::StereoChannel DisplayRegion:: 00167 get_stereo_channel() { 00168 CDReader cdata(_cycler); 00169 return cdata->_stereo_channel; 00170 } 00171 00172 //////////////////////////////////////////////////////////////////// 00173 // Function: DisplayRegion::get_incomplete_render 00174 // Access: Published 00175 // Description: Returns the incomplete_render flag. See 00176 // set_incomplete_render(). 00177 //////////////////////////////////////////////////////////////////// 00178 INLINE bool DisplayRegion:: 00179 get_incomplete_render() const { 00180 return _incomplete_render; 00181 } 00182 00183 //////////////////////////////////////////////////////////////////// 00184 // Function: DisplayRegion::get_texture_reload_priority 00185 // Access: Published 00186 // Description: Returns the priority which is assigned to 00187 // asynchronous texture reload requests. See 00188 // set_texture_reload_priority(). 00189 //////////////////////////////////////////////////////////////////// 00190 INLINE int DisplayRegion:: 00191 get_texture_reload_priority() const { 00192 return _texture_reload_priority; 00193 } 00194 00195 //////////////////////////////////////////////////////////////////// 00196 // Function: DisplayRegion::get_cube_map_index 00197 // Access: Published 00198 // Description: Returns the cube map face index associated with this 00199 // particular DisplayRegion, or -1 if it is not 00200 // associated with a cube map. See 00201 // set_cube_map_index(). 00202 //////////////////////////////////////////////////////////////////// 00203 INLINE int DisplayRegion:: 00204 get_cube_map_index() const { 00205 CDReader cdata(_cycler); 00206 return cdata->_cube_map_index; 00207 } 00208 00209 //////////////////////////////////////////////////////////////////// 00210 // Function: DisplayRegion::set_cull_callback 00211 // Access: Published 00212 // Description: Sets the CallbackObject that will be notified when 00213 // the DisplayRegion is visited during the cull 00214 // traversal. This callback will be made during the 00215 // cull thread. 00216 // 00217 // The cull traversal is responsible for determining 00218 // which nodes are visible and within the view frustum, 00219 // and for accumulating state and transform, and 00220 // generally building up the list of CullableObjects 00221 // that are to be eventually passed to the draw 00222 // traversal for rendering. 00223 // 00224 // At the time the cull traversal callback is made, the 00225 // traversal for this DisplayRegion has not yet started. 00226 // 00227 // The callback is passed an instance of a 00228 // DisplayRegionCullCallbackData, which contains 00229 // pointers to the current scene information, as well as 00230 // the current DisplayRegion and GSG. The callback 00231 // *replaces* the normal cull behavior, so if your 00232 // callback does nothing, the scene graph will not be 00233 // traversed and therefore nothing will be drawn. If 00234 // you wish the normal cull traversal to be performed 00235 // for this DisplayRegion, you must call 00236 // cbdata->upcall() from your callback. 00237 //////////////////////////////////////////////////////////////////// 00238 INLINE void DisplayRegion:: 00239 set_cull_callback(CallbackObject *object) { 00240 CDWriter cdata(_cycler); 00241 cdata->_cull_callback = object; 00242 } 00243 00244 //////////////////////////////////////////////////////////////////// 00245 // Function: DisplayRegion::clear_cull_callback 00246 // Access: Published 00247 // Description: Removes the callback set by an earlier call to 00248 // set_cull_callback(). 00249 //////////////////////////////////////////////////////////////////// 00250 INLINE void DisplayRegion:: 00251 clear_cull_callback() { 00252 set_cull_callback(NULL); 00253 } 00254 00255 //////////////////////////////////////////////////////////////////// 00256 // Function: DisplayRegion::get_cull_callback 00257 // Access: Published 00258 // Description: Returns the CallbackObject set by set_cull_callback(). 00259 //////////////////////////////////////////////////////////////////// 00260 INLINE CallbackObject *DisplayRegion:: 00261 get_cull_callback() const { 00262 CDReader cdata(_cycler); 00263 return cdata->_cull_callback; 00264 } 00265 00266 //////////////////////////////////////////////////////////////////// 00267 // Function: DisplayRegion::set_draw_callback 00268 // Access: Published 00269 // Description: Sets the CallbackObject that will be notified when 00270 // the contents of DisplayRegion is drawn during the 00271 // draw traversal. This callback will be made during 00272 // the draw thread. 00273 // 00274 // The draw traversal is responsible for actually 00275 // issuing the commands to the graphics engine to draw 00276 // primitives. Its job is to walk through the list of 00277 // CullableObjects build up by the cull traversal, as 00278 // quickly as possible, issuing the appropriate commands 00279 // to draw each one. 00280 // 00281 // At the time the draw traversal callback is made, the 00282 // graphics state is in the initial state, and no 00283 // projection matrix or modelview matrix is in effect. 00284 // begin_scene() has not yet been called, and no objects 00285 // have yet been drawn. However, the viewport has 00286 // already been set to the appropriate part of the 00287 // window, and the clear commands for this DisplayRegion 00288 // (if any) have been issued. 00289 // 00290 // The callback is passed an instance of a 00291 // DisplayRegionDrawCallbackData, which contains 00292 // pointers to the current scene information, as well as 00293 // the current DisplayRegion and GSG. The callback 00294 // *replaces* the normal draw behavior, so if your 00295 // callback does nothing, nothing in the DisplayRegion 00296 // will be drawn. If you wish the draw traversal to 00297 // continue to draw the contents of this DisplayRegion, 00298 // you must call cbdata->upcall() from your callback. 00299 //////////////////////////////////////////////////////////////////// 00300 INLINE void DisplayRegion:: 00301 set_draw_callback(CallbackObject *object) { 00302 CDWriter cdata(_cycler); 00303 cdata->_draw_callback = object; 00304 } 00305 00306 //////////////////////////////////////////////////////////////////// 00307 // Function: DisplayRegion::clear_draw_callback 00308 // Access: Published 00309 // Description: Removes the callback set by an earlier call to 00310 // set_draw_callback(). 00311 //////////////////////////////////////////////////////////////////// 00312 INLINE void DisplayRegion:: 00313 clear_draw_callback() { 00314 set_draw_callback(NULL); 00315 } 00316 00317 //////////////////////////////////////////////////////////////////// 00318 // Function: DisplayRegion::get_draw_callback 00319 // Access: Published 00320 // Description: Returns the CallbackObject set by set_draw_callback(). 00321 //////////////////////////////////////////////////////////////////// 00322 INLINE CallbackObject *DisplayRegion:: 00323 get_draw_callback() const { 00324 CDReader cdata(_cycler); 00325 return cdata->_draw_callback; 00326 } 00327 00328 //////////////////////////////////////////////////////////////////// 00329 // Function: DisplayRegion::get_pixel_width 00330 // Access: Published 00331 // Description: Returns the width of the DisplayRegion in pixels. 00332 //////////////////////////////////////////////////////////////////// 00333 INLINE int DisplayRegion:: 00334 get_pixel_width() const { 00335 CDReader cdata(_cycler); 00336 return cdata->_pr - cdata->_pl; 00337 } 00338 00339 //////////////////////////////////////////////////////////////////// 00340 // Function: DisplayRegion::get_pixel_height 00341 // Access: Published 00342 // Description: Returns the height of the DisplayRegion in pixels. 00343 //////////////////////////////////////////////////////////////////// 00344 INLINE int DisplayRegion:: 00345 get_pixel_height() const { 00346 CDReader cdata(_cycler); 00347 return cdata->_pt - cdata->_pb; 00348 } 00349 00350 //////////////////////////////////////////////////////////////////// 00351 // Function: DisplayRegion::get_pixels 00352 // Access: Public 00353 // Description: Retrieves the coordinates of the DisplayRegion within 00354 // its window, in pixels. 00355 //////////////////////////////////////////////////////////////////// 00356 INLINE void DisplayRegion:: 00357 get_pixels(int &pl, int &pr, int &pb, int &pt) const { 00358 CDReader cdata(_cycler); 00359 pl = cdata->_pl; 00360 pr = cdata->_pr; 00361 pb = cdata->_pb; 00362 pt = cdata->_pt; 00363 } 00364 00365 //////////////////////////////////////////////////////////////////// 00366 // Function: DisplayRegion::get_region_pixels 00367 // Access: Public 00368 // Description: Retrieves the coordinates of the DisplayRegion within 00369 // its window, as the pixel location of its bottom-left 00370 // corner, along with a pixel width and height. 00371 //////////////////////////////////////////////////////////////////// 00372 INLINE void DisplayRegion:: 00373 get_region_pixels(int &xo, int &yo, int &w, int &h) const { 00374 CDReader cdata(_cycler); 00375 xo = cdata->_pl; 00376 yo = cdata->_pb; 00377 w = cdata->_pr - cdata->_pl; 00378 h = cdata->_pt - cdata->_pb; 00379 } 00380 00381 //////////////////////////////////////////////////////////////////// 00382 // Function: DisplayRegion::get_region_pixels_i 00383 // Access: Public 00384 // Description: Similar to get_region_pixels(), but returns the upper 00385 // left corner, and the pixel numbers are numbered from 00386 // the top-left corner down, in the DirectX way of 00387 // things. 00388 //////////////////////////////////////////////////////////////////// 00389 INLINE void DisplayRegion:: 00390 get_region_pixels_i(int &xo, int &yo, int &w, int &h) const { 00391 CDReader cdata(_cycler); 00392 xo = cdata->_pl; 00393 yo = cdata->_pti; 00394 w = cdata->_pr - cdata->_pl; 00395 h = cdata->_pbi - cdata->_pti; 00396 } 00397 00398 //////////////////////////////////////////////////////////////////// 00399 // Function: DisplayRegion::set_cull_result 00400 // Access: Public 00401 // Description: Stores the result of performing a cull operation on 00402 // this DisplayRegion. Normally, this will only be 00403 // called by the GraphicsEngine; you should not call 00404 // this directly. 00405 // 00406 // The stored result will automatically be applied back 00407 // to all upstream pipeline stages. 00408 //////////////////////////////////////////////////////////////////// 00409 INLINE void DisplayRegion:: 00410 set_cull_result(CullResult *cull_result, SceneSetup *scene_setup, 00411 Thread *current_thread) { 00412 CDCullWriter cdata(_cycler_cull, true, current_thread); 00413 cdata->_cull_result = cull_result; 00414 cdata->_scene_setup = scene_setup; 00415 } 00416 00417 //////////////////////////////////////////////////////////////////// 00418 // Function: DisplayRegion::get_cull_result 00419 // Access: Public 00420 // Description: Returns the CullResult value that was stored on this 00421 // DisplayRegion, presumably by the last successful cull 00422 // operation. This method is for the benefit of the 00423 // GraphicsEngine; normally you shouldn't call this 00424 // directly. 00425 //////////////////////////////////////////////////////////////////// 00426 INLINE CullResult *DisplayRegion:: 00427 get_cull_result(Thread *current_thread) const { 00428 CDCullReader cdata(_cycler_cull, current_thread); 00429 return cdata->_cull_result; 00430 } 00431 00432 //////////////////////////////////////////////////////////////////// 00433 // Function: DisplayRegion::get_scene_setup 00434 // Access: Public 00435 // Description: Returns the SceneSetup value that was stored on this 00436 // DisplayRegion, presumably by the last successful cull 00437 // operation. This method is for the benefit of the 00438 // GraphicsEngine; normally you shouldn't call this 00439 // directly. 00440 //////////////////////////////////////////////////////////////////// 00441 INLINE SceneSetup *DisplayRegion:: 00442 get_scene_setup(Thread *current_thread) const { 00443 CDCullReader cdata(_cycler_cull, current_thread); 00444 return cdata->_scene_setup; 00445 } 00446 00447 //////////////////////////////////////////////////////////////////// 00448 // Function: DisplayRegion::get_cull_region_pcollector 00449 // Access: Public 00450 // Description: Returns a PStatCollector for timing the cull 00451 // operation for just this DisplayRegion. 00452 //////////////////////////////////////////////////////////////////// 00453 INLINE PStatCollector &DisplayRegion:: 00454 get_cull_region_pcollector() { 00455 return _cull_region_pcollector; 00456 } 00457 00458 //////////////////////////////////////////////////////////////////// 00459 // Function: DisplayRegion::get_draw_region_pcollector 00460 // Access: Public 00461 // Description: Returns a PStatCollector for timing the draw 00462 // operation for just this DisplayRegion. 00463 //////////////////////////////////////////////////////////////////// 00464 INLINE PStatCollector &DisplayRegion:: 00465 get_draw_region_pcollector() { 00466 return _draw_region_pcollector; 00467 } 00468 00469 //////////////////////////////////////////////////////////////////// 00470 // Function: DisplayRegion::CDataCull::Constructor 00471 // Access: Public 00472 // Description: 00473 //////////////////////////////////////////////////////////////////// 00474 INLINE DisplayRegion::CDataCull:: 00475 CDataCull() { 00476 } 00477 00478 //////////////////////////////////////////////////////////////////// 00479 // Function: DisplayRegion::CDataCull::Copy Constructor 00480 // Access: Public 00481 // Description: 00482 //////////////////////////////////////////////////////////////////// 00483 INLINE DisplayRegion::CDataCull:: 00484 CDataCull(const DisplayRegion::CDataCull ©) : 00485 _cull_result(copy._cull_result), 00486 _scene_setup(copy._scene_setup) 00487 { 00488 } 00489 00490 //////////////////////////////////////////////////////////////////// 00491 // Function: DisplayRegionPipelineReader::Constructor 00492 // Access: Public 00493 // Description: 00494 //////////////////////////////////////////////////////////////////// 00495 INLINE DisplayRegionPipelineReader:: 00496 DisplayRegionPipelineReader(DisplayRegion *object, Thread *current_thread) : 00497 _object(object), 00498 _current_thread(current_thread), 00499 _cdata(object->_cycler.read(current_thread)) 00500 { 00501 #ifdef _DEBUG 00502 nassertv(_object->test_ref_count_nonzero()); 00503 #ifdef DO_PIPELINING 00504 nassertv(_cdata->test_ref_count_nonzero()); 00505 #endif // DO_PIPELINING 00506 #endif // _DEBUG 00507 } 00508 00509 //////////////////////////////////////////////////////////////////// 00510 // Function: DisplayRegionPipelineReader::Copy Constructor 00511 // Access: Private 00512 // Description: Don't attempt to copy these objects. 00513 //////////////////////////////////////////////////////////////////// 00514 INLINE DisplayRegionPipelineReader:: 00515 DisplayRegionPipelineReader(const DisplayRegionPipelineReader &) { 00516 nassertv(false); 00517 } 00518 00519 //////////////////////////////////////////////////////////////////// 00520 // Function: DisplayRegionPipelineReader::Copy Assignment Operator 00521 // Access: Private 00522 // Description: Don't attempt to copy these objects. 00523 //////////////////////////////////////////////////////////////////// 00524 INLINE void DisplayRegionPipelineReader:: 00525 operator = (const DisplayRegionPipelineReader &) { 00526 nassertv(false); 00527 } 00528 00529 //////////////////////////////////////////////////////////////////// 00530 // Function: DisplayRegionPipelineReader::Destructor 00531 // Access: Public 00532 // Description: 00533 //////////////////////////////////////////////////////////////////// 00534 INLINE DisplayRegionPipelineReader:: 00535 ~DisplayRegionPipelineReader() { 00536 #ifdef _DEBUG 00537 nassertv(_object->test_ref_count_nonzero()); 00538 #ifdef DO_PIPELINING 00539 nassertv(_cdata->test_ref_count_nonzero()); 00540 #endif // DO_PIPELINING 00541 #endif // _DEBUG 00542 _object->_cycler.release_read(_cdata); 00543 00544 #ifdef _DEBUG 00545 _object = NULL; 00546 _cdata = NULL; 00547 #endif // _DEBUG 00548 } 00549 00550 //////////////////////////////////////////////////////////////////// 00551 // Function: DisplayRegionPipelineReader::get_object 00552 // Access: Public 00553 // Description: 00554 //////////////////////////////////////////////////////////////////// 00555 INLINE DisplayRegion *DisplayRegionPipelineReader:: 00556 get_object() const { 00557 return _object; 00558 } 00559 00560 //////////////////////////////////////////////////////////////////// 00561 // Function: DisplayRegionPipelineReader::get_current_thread 00562 // Access: Public 00563 // Description: 00564 //////////////////////////////////////////////////////////////////// 00565 INLINE Thread *DisplayRegionPipelineReader:: 00566 get_current_thread() const { 00567 return _current_thread; 00568 } 00569 00570 //////////////////////////////////////////////////////////////////// 00571 // Function: DisplayRegionPipelineReader::is_any_clear_active 00572 // Access: Public 00573 // Description: 00574 //////////////////////////////////////////////////////////////////// 00575 INLINE bool DisplayRegionPipelineReader:: 00576 is_any_clear_active() const { 00577 return _object->is_any_clear_active(); 00578 } 00579 00580 //////////////////////////////////////////////////////////////////// 00581 // Function: DisplayRegionPipelineReader::get_dimensions 00582 // Access: Public 00583 // Description: Retrieves the coordinates of the DisplayRegion's 00584 // rectangle within its GraphicsOutput. These numbers 00585 // will be in the range [0..1]. 00586 //////////////////////////////////////////////////////////////////// 00587 INLINE void DisplayRegionPipelineReader:: 00588 get_dimensions(float &l, float &r, float &b, float &t) const { 00589 l = _cdata->_l; 00590 r = _cdata->_r; 00591 b = _cdata->_b; 00592 t = _cdata->_t; 00593 } 00594 00595 //////////////////////////////////////////////////////////////////// 00596 // Function: DisplayRegionPipelineReader::get_left 00597 // Access: Public 00598 // Description: Retrieves the x coordinate of the left edge of the 00599 // rectangle within its GraphicsOutput. This number 00600 // will be in the range [0..1]. 00601 //////////////////////////////////////////////////////////////////// 00602 INLINE float DisplayRegionPipelineReader:: 00603 get_left() const { 00604 return _cdata->_l; 00605 } 00606 00607 //////////////////////////////////////////////////////////////////// 00608 // Function: DisplayRegionPipelineReader::get_right 00609 // Access: Public 00610 // Description: Retrieves the x coordinate of the right edge of the 00611 // rectangle within its GraphicsOutput. This number 00612 // will be in the range [0..1]. 00613 //////////////////////////////////////////////////////////////////// 00614 INLINE float DisplayRegionPipelineReader:: 00615 get_right() const { 00616 return _cdata->_r; 00617 } 00618 00619 //////////////////////////////////////////////////////////////////// 00620 // Function: DisplayRegionPipelineReader::get_bottom 00621 // Access: Public 00622 // Description: Retrieves the y coordinate of the bottom edge of 00623 // the rectangle within its GraphicsOutput. This 00624 // number will be in the range [0..1]. 00625 //////////////////////////////////////////////////////////////////// 00626 INLINE float DisplayRegionPipelineReader:: 00627 get_bottom() const { 00628 return _cdata->_b; 00629 } 00630 00631 //////////////////////////////////////////////////////////////////// 00632 // Function: DisplayRegionPipelineReader::get_top 00633 // Access: Public 00634 // Description: Retrieves the y coordinate of the top edge of the 00635 // rectangle within its GraphicsOutput. This number 00636 // will be in the range [0..1]. 00637 //////////////////////////////////////////////////////////////////// 00638 INLINE float DisplayRegionPipelineReader:: 00639 get_top() const { 00640 return _cdata->_t; 00641 } 00642 00643 //////////////////////////////////////////////////////////////////// 00644 // Function: DisplayRegionPipelineReader::get_window 00645 // Access: Public 00646 // Description: Returns the GraphicsOutput that this DisplayRegion is 00647 // ultimately associated with, or NULL if no window is 00648 // associated. 00649 //////////////////////////////////////////////////////////////////// 00650 INLINE GraphicsOutput *DisplayRegionPipelineReader:: 00651 get_window() const { 00652 return _object->_window; 00653 } 00654 00655 //////////////////////////////////////////////////////////////////// 00656 // Function: DisplayRegionPipelineReader::get_camera 00657 // Access: Public 00658 // Description: Returns the camera associated with this 00659 // DisplayRegion, or an empty NodePath if no camera is 00660 // associated. 00661 //////////////////////////////////////////////////////////////////// 00662 INLINE NodePath DisplayRegionPipelineReader:: 00663 get_camera() const { 00664 return _cdata->_camera; 00665 } 00666 00667 //////////////////////////////////////////////////////////////////// 00668 // Function: DisplayRegionPipelineReader::is_active 00669 // Access: Public 00670 // Description: Returns the active flag associated with the 00671 // DisplayRegion. 00672 //////////////////////////////////////////////////////////////////// 00673 INLINE bool DisplayRegionPipelineReader:: 00674 is_active() const { 00675 return _cdata->_active; 00676 } 00677 00678 //////////////////////////////////////////////////////////////////// 00679 // Function: DisplayRegionPipelineReader::get_sort 00680 // Access: Public 00681 // Description: Returns the sort value associated with the 00682 // DisplayRegion. 00683 //////////////////////////////////////////////////////////////////// 00684 INLINE int DisplayRegionPipelineReader:: 00685 get_sort() const { 00686 return _cdata->_sort; 00687 } 00688 00689 //////////////////////////////////////////////////////////////////// 00690 // Function: DisplayRegionPipelineReader::get_stereo_channel 00691 // Access: Public 00692 // Description: Returns whether the DisplayRegion is specified as the 00693 // left or right channel of a stereo pair, or whether it 00694 // is a normal, monocular image. See 00695 // set_stereo_channel(). 00696 //////////////////////////////////////////////////////////////////// 00697 INLINE Lens::StereoChannel DisplayRegionPipelineReader:: 00698 get_stereo_channel() { 00699 return _cdata->_stereo_channel; 00700 } 00701 00702 //////////////////////////////////////////////////////////////////// 00703 // Function: DisplayRegionPipelineReader::get_cube_map_index 00704 // Access: Public 00705 // Description: Returns the cube map face index associated with this 00706 // particular DisplayRegion, or -1 if it is not 00707 // associated with a cube map. See 00708 // set_cube_map_index(). 00709 //////////////////////////////////////////////////////////////////// 00710 INLINE int DisplayRegionPipelineReader:: 00711 get_cube_map_index() const { 00712 return _cdata->_cube_map_index; 00713 } 00714 00715 //////////////////////////////////////////////////////////////////// 00716 // Function: DisplayRegionPipelineReader::get_draw_callback 00717 // Access: Published 00718 // Description: Returns the CallbackObject set by set_draw_callback(). 00719 //////////////////////////////////////////////////////////////////// 00720 INLINE CallbackObject *DisplayRegionPipelineReader:: 00721 get_draw_callback() const { 00722 return _cdata->_draw_callback; 00723 } 00724 00725 //////////////////////////////////////////////////////////////////// 00726 // Function: DisplayRegionPipelineReader::get_pixels 00727 // Access: Public 00728 // Description: Retrieves the coordinates of the DisplayRegion within 00729 // its window, in pixels. 00730 //////////////////////////////////////////////////////////////////// 00731 INLINE void DisplayRegionPipelineReader:: 00732 get_pixels(int &pl, int &pr, int &pb, int &pt) const { 00733 pl = _cdata->_pl; 00734 pr = _cdata->_pr; 00735 pb = _cdata->_pb; 00736 pt = _cdata->_pt; 00737 } 00738 00739 //////////////////////////////////////////////////////////////////// 00740 // Function: DisplayRegionPipelineReader::get_region_pixels 00741 // Access: Public 00742 // Description: Retrieves the coordinates of the DisplayRegion within 00743 // its window, as the pixel location of its bottom-left 00744 // corner, along with a pixel width and height. 00745 //////////////////////////////////////////////////////////////////// 00746 INLINE void DisplayRegionPipelineReader:: 00747 get_region_pixels(int &xo, int &yo, int &w, int &h) const { 00748 xo = _cdata->_pl; 00749 yo = _cdata->_pb; 00750 w = _cdata->_pr - _cdata->_pl; 00751 h = _cdata->_pt - _cdata->_pb; 00752 } 00753 00754 //////////////////////////////////////////////////////////////////// 00755 // Function: DisplayRegionPipelineReader::get_region_pixels_i 00756 // Access: Public 00757 // Description: Similar to get_region_pixels(), but returns the upper 00758 // left corner, and the pixel numbers are numbered from 00759 // the top-left corner down, in the DirectX way of 00760 // things. 00761 //////////////////////////////////////////////////////////////////// 00762 INLINE void DisplayRegionPipelineReader:: 00763 get_region_pixels_i(int &xo, int &yo, int &w, int &h) const { 00764 xo = _cdata->_pl; 00765 yo = _cdata->_pti; 00766 w = _cdata->_pr - _cdata->_pl; 00767 h = _cdata->_pbi - _cdata->_pti; 00768 } 00769 00770 //////////////////////////////////////////////////////////////////// 00771 // Function: DisplayRegionPipelineReader::get_pixel_width 00772 // Access: Public 00773 // Description: Returns the width of the DisplayRegion in pixels. 00774 //////////////////////////////////////////////////////////////////// 00775 INLINE int DisplayRegionPipelineReader:: 00776 get_pixel_width() const { 00777 return _cdata->_pr - _cdata->_pl; 00778 } 00779 00780 //////////////////////////////////////////////////////////////////// 00781 // Function: DisplayRegionPipelineReader::get_lens_index 00782 // Access: Public 00783 // Description: Gets the index into a lens_node lens array. 0 default 00784 //////////////////////////////////////////////////////////////////// 00785 INLINE int DisplayRegionPipelineReader:: 00786 get_lens_index() const 00787 { 00788 return _cdata->_lens_index; 00789 } 00790 00791 //////////////////////////////////////////////////////////////////// 00792 // Function: DisplayRegionPipelineReader::get_pixel_height 00793 // Access: Public 00794 // Description: Returns the height of the DisplayRegion in pixels. 00795 //////////////////////////////////////////////////////////////////// 00796 INLINE int DisplayRegionPipelineReader:: 00797 get_pixel_height() const { 00798 return _cdata->_pt - _cdata->_pb; 00799 }