MCPcopy Create free account
hub / github.com/MITK/MITK / PrepareMapperQueue

Method PrepareMapperQueue

Modules/Core/src/Rendering/mitkVtkPropRenderer.cpp:180–229  ·  view source on GitHub ↗

! \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. */

Source from the content-addressed store, hash-verified

178wrt to their layer.
179*/
180void 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
231void mitk::VtkPropRenderer::SetPropertyKeys(vtkInformation *info)
232{

Callers 1

RenderMethod · 0.95

Calls 11

UpdateFunction · 0.85
GetAllMethod · 0.80
ValueMethod · 0.80
GetMapperMethod · 0.80
GetVisibilityMethod · 0.80
GetMTimeMethod · 0.45
clearMethod · 0.45
IsNullMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
GetIntPropertyMethod · 0.45

Tested by

no test coverage detected