! \brief PrepareMapperQueue iterates the datatree PrepareMapperQueue iterates the datatree in order to find mappers which shall be rendered. Also, it sortes the mappers wrt to their layer. */
| 178 | wrt to their layer. |
| 179 | */ |
| 180 | void mitk::VtkPropRenderer::PrepareMapperQueue() |
| 181 | { |
| 182 | // variable for counting LOD-enabled mappers |
| 183 | m_NumberOfVisibleLODEnabledMappers = 0; |
| 184 | |
| 185 | // Do we have to update the mappers ? |
| 186 | if (m_LastUpdateTime < GetMTime() || m_LastUpdateTime < this->GetCurrentWorldPlaneGeometry()->GetMTime()) |
| 187 | { |
| 188 | Update(); |
| 189 | } |
| 190 | else if (m_MapperID >= 1 && m_MapperID < 6) |
| 191 | Update(); |
| 192 | |
| 193 | // clear priority_queue |
| 194 | m_MappersMap.clear(); |
| 195 | |
| 196 | int mapperNo = 0; |
| 197 | |
| 198 | // DataStorage |
| 199 | if (m_DataStorage.IsNull()) |
| 200 | return; |
| 201 | |
| 202 | DataStorage::SetOfObjects::ConstPointer allObjects = m_DataStorage->GetAll(); |
| 203 | |
| 204 | for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it) |
| 205 | { |
| 206 | const DataNode::Pointer node = it->Value(); |
| 207 | if (node.IsNull()) |
| 208 | continue; |
| 209 | const mitk::Mapper::Pointer mapper = node->GetMapper(m_MapperID); |
| 210 | |
| 211 | if (mapper.IsNull()) |
| 212 | continue; |
| 213 | |
| 214 | bool visible = true; |
| 215 | node->GetVisibility(visible, this, "visible"); |
| 216 | |
| 217 | // The information about LOD-enabled mappers is required by RenderingManager |
| 218 | if (mapper->IsLODEnabled(this) && visible) |
| 219 | { |
| 220 | ++m_NumberOfVisibleLODEnabledMappers; |
| 221 | } |
| 222 | // mapper without a layer property get layer number 1 |
| 223 | int layer = 1; |
| 224 | node->GetIntProperty("layer", layer, this); |
| 225 | int nr = (layer << 16) + mapperNo; |
| 226 | m_MappersMap.insert(std::pair<int, Mapper *>(nr, mapper)); |
| 227 | mapperNo++; |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | void mitk::VtkPropRenderer::SetPropertyKeys(vtkInformation *info) |
| 232 | { |