public |
Inheritance Graph
graph BT
BudgetRenderer
BudgetRenderer --> NodeRendererState
click BudgetRenderer "classMinSG_1_1SVS_1_1BudgetRenderer"
click NodeRendererState "classMinSG_1_1NodeRendererState"
Description
Budget rendering.
State to perform budget rendering. It collects the GeometryNodes that are going through a rendering channel. When it is deactivated, it displays the most important objects while keeping a budget. To perform the budget rendering, an instance of the 0-1 knapsack problem has to be solved. A greedy approximation is used to achieve this. The objects are sorted by the ratio of their primitive count divided by their projected size. Beginning with the lowest ratio, the objects are displayed iteratively until the budget has been reached. If an object has an attribute containing the projected size (see projectedSizeId ), the minimum of the calculated projected size and the attribute’s value is used for the ratio calculation. The attribute can be set by other renderers to influence the importance of objects.
Author: Benjamin Eikel
Date: 2013-07-23
Public Static Attributes
const Util::StringIdentifier | projectedSizeId Identifier of a node attribute containing the projected size. |
Protected Functions
stateResult_t | doEnableState( FrameContext & context, Node * node, const RenderParam & rp) Clear the set of collected nodes. |
void | doDisableState( FrameContext & context, Node * node, const RenderParam & rp) Display a subset of the collected nodes. |
Public Functions
BudgetRenderer() | |
BudgetRenderer * | clone() const Create a duplicate of this State object. |
uint32_t | getBudget() const |
void | setBudget(uint32_t newBudget) Set the budget as number of primitives to render at most. |
Documentation
variable
MinSG::SVS::BudgetRenderer::projectedSizeId
public | static |
const Util::StringIdentifier projectedSizeId |
Identifier of a node attribute containing the projected size.
Defined in MinSG/Ext/SVS/BudgetRenderer.h:82
function
MinSG::SVS::BudgetRenderer::doEnableState
protected | virtual |
stateResult_t doEnableState( | FrameContext & | context, |
Node * | node, | |
const RenderParam & | rp | |
) |
Clear the set of collected nodes.
Defined in MinSG/Ext/SVS/BudgetRenderer.h:63
function
MinSG::SVS::BudgetRenderer::doDisableState
protected | virtual |
void doDisableState( | FrameContext & | context, |
Node * | node, | |
const RenderParam & | rp | |
) |
Display a subset of the collected nodes.
Defined in MinSG/Ext/SVS/BudgetRenderer.h:66
function
MinSG::SVS::BudgetRenderer::BudgetRenderer
public |
BudgetRenderer( | ) |
Defined in MinSG/Ext/SVS/BudgetRenderer.h:69
function
MinSG::SVS::BudgetRenderer::clone
public | const | virtual |
BudgetRenderer * clone( | ) const |
Create a duplicate of this State object.
Defined in MinSG/Ext/SVS/BudgetRenderer.h:71
function
MinSG::SVS::BudgetRenderer::getBudget
public | const | inline |
uint32_t getBudget( | ) const |
Defined in MinSG/Ext/SVS/BudgetRenderer.h:73
function
MinSG::SVS::BudgetRenderer::setBudget
public | inline |
void setBudget( | uint32_t | newBudget ) |
Set the budget as number of primitives to render at most.
Defined in MinSG/Ext/SVS/BudgetRenderer.h:77