#include <OSGTileLoadBalancer.h>
Public Member Functions | |
| RegionLoad (TileGeometryLoad *load=NULL) | |
| Real32 | getCost (const RenderNode &renderNode) |
| Real32 | getCost (const RenderNode &renderNode, const Int32 wmin[2], const Int32 wmax[2]) const |
| TileGeometryLoad * | getLoad (void) |
| void | updateCost (const Int32 wmin[2], const Int32 wmax[2]) |
Private Attributes | |
| Real32 | _visibleFaces |
| Real32 | _invisibleFaces |
| Real32 | _pixel |
| TileGeometryLoad * | _load |
Definition at line 141 of file OSGTileLoadBalancer.h.
| osg::TileLoadBalancer::RegionLoad::RegionLoad | ( | TileGeometryLoad * | load = NULL |
) | [inline] |
Constructor
Definition at line 43 of file OSGTileLoadBalancer.inl.
00043 : 00044 _load(load) 00045 { 00046 }
| Real32 osg::TileLoadBalancer::RegionLoad::getCost | ( | const RenderNode & | renderNode | ) | [inline] |
Calculate the rendering cost
| renderNode | Node to render the geometry |
Definition at line 79 of file OSGTileLoadBalancer.inl.
References _invisibleFaces, _pixel, _visibleFaces, and osg::RenderNode::estimatePerformance().
00080 { 00081 return renderNode.estimatePerformance(_invisibleFaces, 00082 _visibleFaces, 00083 _pixel); 00084 }
| Real32 osg::TileLoadBalancer::RegionLoad::getCost | ( | const RenderNode & | renderNode, | |
| const Int32 | wmin[2], | |||
| const Int32 | wmax[2] | |||
| ) | const [inline] |
Calculate the rendering cost for the given region
| renderNode | Node to render the geometry | |
| wmin | bottom, left corner of the area | |
| wmax | top, right corner of the area |
Definition at line 92 of file OSGTileLoadBalancer.inl.
References _load, osg::RenderNode::estimatePerformance(), osg::TileGeometryLoad::getFaces(), and osg::TileGeometryLoad::getVisibleFraction().
00095 { 00096 Int32 vismin[2]; 00097 Int32 vismax[2]; 00098 Real32 visibleFaces; 00099 Real32 invisibleFaces; 00100 Real32 visible; 00101 00102 Real32 faces =Real32(_load->getFaces()); 00103 visible=_load->getVisibleFraction(wmin,wmax,vismin,vismax); 00104 if(visible==0.0) 00105 return 0.0; 00106 visibleFaces=faces*visible; 00107 invisibleFaces=faces-visibleFaces; 00108 Real32 pixel=Real32( 00109 (vismax[0] - vismin[0] + 1)* 00110 (vismax[1] - vismin[1] + 1)); 00111 return renderNode.estimatePerformance(invisibleFaces, 00112 visibleFaces, 00113 pixel); 00114 }
| TileGeometryLoad * osg::TileLoadBalancer::RegionLoad::getLoad | ( | void | ) | [inline] |
Return gemetry load info object
Definition at line 118 of file OSGTileLoadBalancer.inl.
References _load.
00119 { 00120 return _load; 00121 }
| void osg::TileLoadBalancer::RegionLoad::updateCost | ( | const Int32 | wmin[2], | |
| const Int32 | wmax[2] | |||
| ) | [inline] |
Update region dependent values
Definition at line 50 of file OSGTileLoadBalancer.inl.
References _invisibleFaces, _load, _pixel, _visibleFaces, osg::TileGeometryLoad::getFaces(), and osg::TileGeometryLoad::getVisibleFraction().
00052 { 00053 Real32 faces =Real32(_load->getFaces()); 00054 Real32 visible; 00055 Int32 vismin[2]; 00056 Int32 vismax[2]; 00057 00058 visible=_load->getVisibleFraction(wmin,wmax,vismin,vismax); 00059 if(visible) 00060 { 00061 _visibleFaces=faces*visible; 00062 _invisibleFaces=faces-_visibleFaces; 00063 _pixel=Real32( 00064 (vismax[0] - vismin[0] + 1)* 00065 (vismax[1] - vismin[1] + 1)); 00066 } 00067 else 00068 { 00069 _pixel=0; 00070 _invisibleFaces=0; 00071 _visibleFaces=0; 00072 } 00073 }
Definition at line 156 of file OSGTileLoadBalancer.h.
Referenced by getCost(), getLoad(), and updateCost().
1.5.5