Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitk::RenderWindowLayerUtilities Namespace Reference

Typedefs

typedef std::vector< BaseRenderer * > RendererVector
 
typedef std::map< int, DataNode::Pointer, std::greater< int > > LayerStack
 

Functions

MITKRENDERWINDOWMANAGER_EXPORT LayerStack GetLayerStack (const DataStorage *dataStorage, const BaseRenderer *renderer, bool withBaseNode)
 Return the stack of layers of the given renderer as std::map<int, DataNode::Pointer>, which guarantees ordering of the layers. Stacked layers are only included if they have their "fixedLayer" property set to true and their "layer" property set. More...
 
MITKRENDERWINDOWMANAGER_EXPORT NodePredicateAnd::Pointer GetRenderWindowPredicate (const BaseRenderer *renderer)
 Helper function to get a node predicate that can be used to filter render window specific data nodes. More...
 
MITKRENDERWINDOWMANAGER_EXPORT void SetRenderWindowProperties (mitk::DataNode *dataNode, const BaseRenderer *renderer)
 Set renderer-specific properties to mark a data node as 'managed by the specific renderer'. In order for a renderer to manage a data node, the 'fixedLayer' property has to be set for the given renderer. Additionally, the 'visible' and the 'layer' property are set and allow to individually render a set of nodes with a specific renderer. The last two mentioned properties are set so that they initially have the same value as the corresponding global property. More...
 

Variables

const int BASE_LAYER_INDEX
 
const int TOP_LAYER_INDEX
 

Typedef Documentation

◆ LayerStack

typedef std::map<int, DataNode::Pointer, std::greater<int> > mitk::RenderWindowLayerUtilities::LayerStack

Definition at line 33 of file mitkRenderWindowLayerUtilities.h.

◆ RendererVector

Function Documentation

◆ GetLayerStack()

mitk::RenderWindowLayerUtilities::LayerStack mitk::RenderWindowLayerUtilities::GetLayerStack ( const DataStorage dataStorage,
const BaseRenderer renderer,
bool  withBaseNode 
)

Return the stack of layers of the given renderer as std::map<int, DataNode::Pointer>, which guarantees ordering of the layers. Stacked layers are only included if they have their "fixedLayer" property set to true and their "layer" property set.

If "renderer" = nullptr: a layer stack won't be created and an empty "LayerStack" will be returned. If "withBaseNode" = true: include the base node in the layer stack, if existing. If "withBaseNode" = false: exclude the base node from the layer stack.

Parameters
dataStoragePointer to a data storage instance whose data nodes should be checked and possibly be included.
rendererPointer to the renderer instance for which the layer stack should be generated.
withBaseNodeBoolean to decide whether the base node should be included in or excluded from the layer stack.

Definition at line 20 of file mitkRenderWindowLayerUtilities.cpp.

References BASE_LAYER_INDEX, GetRenderWindowPredicate(), and mitk::DataStorage::GetSubset().

Referenced by QmitkRenderWindowDataStorageListModel::AddDataNodeToAllRenderer(), mitk::RenderWindowLayerController::InsertLayerNode(), mitk::RenderWindowLayerController::MoveNodeDown(), mitk::RenderWindowLayerController::MoveNodeToBack(), mitk::RenderWindowLayerController::MoveNodeToFront(), mitk::RenderWindowLayerController::MoveNodeToPosition(), mitk::RenderWindowLayerController::MoveNodeUp(), mitk::RenderWindowLayerController::ResetRenderer(), mitk::RenderWindowLayerController::SetBaseDataNode(), and QmitkDataStorageLayerStackModel::setData().

◆ GetRenderWindowPredicate()

mitk::NodePredicateAnd::Pointer mitk::RenderWindowLayerUtilities::GetRenderWindowPredicate ( const BaseRenderer renderer)

Helper function to get a node predicate that can be used to filter render window specific data nodes.

The data nodes must not be 'helper objects'. The must have set a 'fixed layer' property for the given renderer.

Definition at line 53 of file mitkRenderWindowLayerUtilities.cpp.

Referenced by QmitkRenderWindowDataStorageTreeModel::GetCurrentRenderer(), and GetLayerStack().

◆ SetRenderWindowProperties()

void mitk::RenderWindowLayerUtilities::SetRenderWindowProperties ( mitk::DataNode dataNode,
const BaseRenderer renderer 
)

Set renderer-specific properties to mark a data node as 'managed by the specific renderer'. In order for a renderer to manage a data node, the 'fixedLayer' property has to be set for the given renderer. Additionally, the 'visible' and the 'layer' property are set and allow to individually render a set of nodes with a specific renderer. The last two mentioned properties are set so that they initially have the same value as the corresponding global property.

Definition at line 66 of file mitkRenderWindowLayerUtilities.cpp.

References mitk::DataNode::GetIntProperty(), mitk::DataNode::GetVisibility(), mitk::DataNode::SetBoolProperty(), mitk::DataNode::SetIntProperty(), and mitk::DataNode::SetVisibility().

Referenced by mitk::RenderWindowLayerController::InsertLayerNode(), QmitkRenderWindowDataStorageTreeModel::NodeAdded(), and QmitkRenderWindowDataStorageTreeModel::SetControlledRenderer().

Variable Documentation

◆ BASE_LAYER_INDEX

const int mitk::RenderWindowLayerUtilities::BASE_LAYER_INDEX

The base data node of a renderer is supposed to be on layer 0 (zero), which should be the lowest layer in a render window.

Definition at line 38 of file mitkRenderWindowLayerUtilities.h.

Referenced by GetLayerStack(), mitk::RenderWindowLayerController::InsertLayerNode(), mitk::RenderWindowLayerController::ResetRenderer(), and mitk::RenderWindowLayerController::SetBaseDataNode().

◆ TOP_LAYER_INDEX

const int mitk::RenderWindowLayerUtilities::TOP_LAYER_INDEX

The top layer index, denoting that no valid (positive) layer index is given and therefore the index should be resolved into the topmost layer index.

Definition at line 42 of file mitkRenderWindowLayerUtilities.h.

Referenced by mitk::RenderWindowLayerController::InsertLayerNode().