Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkVtkPropRenderer.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "mitkVtkPropRenderer.h"
18 
19 // MAPPERS
20 #include "mitkCameraController.h"
21 #include "mitkImageVtkMapper2D.h"
22 #include "mitkMapper.h"
24 #include "mitkVtkMapper.h"
25 
27 #include <mitkGeometry3D.h>
28 #include <mitkImageSliceSelector.h>
29 #include <mitkLevelWindow.h>
31 #include <mitkPlaneGeometry.h>
32 #include <mitkProperties.h>
33 #include <mitkRenderingManager.h>
34 #include <mitkSurface.h>
35 #include <mitkVtkInteractorStyle.h>
36 
37 // VTK
38 #include <vtkAssemblyNode.h>
39 #include <vtkAssemblyPath.h>
40 #include <vtkCamera.h>
41 #include <vtkCellPicker.h>
42 #include <vtkInteractorStyleTrackballCamera.h>
43 #include <vtkLight.h>
44 #include <vtkLightKit.h>
45 #include <vtkLinearTransform.h>
46 #include <vtkMapper.h>
47 #include <vtkPointPicker.h>
48 #include <vtkProp.h>
49 #include <vtkRenderWindow.h>
50 #include <vtkRenderWindowInteractor.h>
51 #include <vtkRenderer.h>
52 #include <vtkRendererCollection.h>
53 #include <vtkSmartPointer.h>
54 #include <vtkTextActor.h>
55 #include <vtkTextProperty.h>
56 #include <vtkTransform.h>
57 #include <vtkWorldPointPicker.h>
58 
60  vtkRenderWindow *renWin,
63  : BaseRenderer(name, renWin, rm, renderingMode), m_CameraInitializedForMapperID(0)
64 {
65  didCount = false;
66 
67  m_WorldPointPicker = vtkWorldPointPicker::New();
68 
69  m_PointPicker = vtkPointPicker::New();
70  m_PointPicker->SetTolerance(0.0025);
71 
72  m_CellPicker = vtkCellPicker::New();
73  m_CellPicker->SetTolerance(0.0025);
74 
76  m_CurrentWorldPlaneGeometryMapper = geometryMapper;
77  m_CurrentWorldPlaneGeometryNode->SetMapper(2, geometryMapper);
78 
79  m_LightKit = vtkLightKit::New();
80  m_LightKit->AddLightsToRenderer(m_VtkRenderer);
81  m_PickingMode = WorldPointPicking;
82 
83  m_TextRenderer = vtkRenderer::New();
84  m_TextRenderer->SetRenderWindow(renWin);
85  m_TextRenderer->SetInteractive(0);
86  m_TextRenderer->SetErase(0);
87 }
88 
93 {
94  // Workaround for GLDisplayList Bug
95  {
96  m_MapperID = 0;
97  checkState();
98  }
99 
100  if (m_LightKit != NULL)
101  m_LightKit->Delete();
102 
103  if (m_VtkRenderer != NULL)
104  {
105  m_CameraController = NULL;
106 
107  m_VtkRenderer->Delete();
108 
109  m_VtkRenderer = NULL;
110  }
111  else
112  m_CameraController = NULL;
113 
114  if (m_WorldPointPicker != NULL)
115  m_WorldPointPicker->Delete();
116  if (m_PointPicker != NULL)
117  m_PointPicker->Delete();
118  if (m_CellPicker != NULL)
119  m_CellPicker->Delete();
120  if (m_TextRenderer != NULL)
121  m_TextRenderer->Delete();
122 }
123 
125 {
126  if (storage == NULL || storage == m_DataStorage)
127  return;
128 
130 
131  static_cast<mitk::PlaneGeometryDataVtkMapper3D *>(m_CurrentWorldPlaneGeometryMapper.GetPointer())
132  ->SetDataStorageForTexture(m_DataStorage.GetPointer());
133 
134  // Compute the geometry from the current data tree bounds and set it as world geometry
135  this->SetWorldGeometryToDataStorageBounds();
136 }
137 
139 {
140  if (m_DataStorage.IsNull())
141  return false;
142 
143  // initialize world geometry
144  mitk::TimeGeometry::Pointer geometry = m_DataStorage->ComputeVisibleBoundingGeometry3D(NULL, "includeInBoundingBox");
145 
146  if (geometry.IsNull())
147  return false;
148 
149  this->SetWorldTimeGeometry(geometry);
150  this->GetVtkRenderer()->ResetCamera();
151  this->GetCameraController()->Fit();
152  this->Modified();
153  return true;
154 }
155 
162 {
163  // Update all overlays in any case
164  this->UpdateOverlays();
165  // Do we have objects to render?
166  if (this->GetEmptyWorldGeometry())
167  return 0;
168 
169  if (m_DataStorage.IsNull())
170  return 0;
171 
172  // Update mappers and prepare mapper queue
173  if (type == VtkPropRenderer::Opaque)
174  this->PrepareMapperQueue();
175 
176  // go through the generated list and let the sorted mappers paint
177  for (auto it = m_MappersMap.cbegin(); it != m_MappersMap.cend(); it++)
178  {
179  Mapper *mapper = (*it).second;
180  mapper->MitkRender(this, type);
181  }
182 
183  // Update overlays in case a mapper has changed them
184  this->UpdateOverlays();
185 
186  // Render text
187  if (type == VtkPropRenderer::Overlay)
188  {
189  if (m_TextCollection.size() > 0)
190  {
191  m_TextRenderer->SetViewport(this->GetVtkRenderer()->GetViewport());
192  for (TextMapType::iterator it = m_TextCollection.begin(); it != m_TextCollection.end(); ++it)
193  m_TextRenderer->AddViewProp((*it).second);
194  m_TextRenderer->Render();
195  }
196  }
197  return 1;
198 }
199 
206 void mitk::VtkPropRenderer::PrepareMapperQueue()
207 {
208  // variable for counting LOD-enabled mappers
209  m_NumberOfVisibleLODEnabledMappers = 0;
210 
211  // Do we have to update the mappers ?
212  if (m_LastUpdateTime < GetMTime() || m_LastUpdateTime < this->GetCurrentWorldPlaneGeometry()->GetMTime())
213  {
214  Update();
215  }
216  else if (m_MapperID >= 1 && m_MapperID < 6)
217  Update();
218 
219  // remove all text properties before mappers will add new ones
220  m_TextRenderer->RemoveAllViewProps();
221 
222  for (unsigned int i = 0; i < m_TextCollection.size(); i++)
223  {
224  m_TextCollection[i]->Delete();
225  }
226  m_TextCollection.clear();
227 
228  // clear priority_queue
229  m_MappersMap.clear();
230 
231  int mapperNo = 0;
232 
233  // DataStorage
234  if (m_DataStorage.IsNull())
235  return;
236 
238 
239  for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
240  {
241  const DataNode::Pointer node = it->Value();
242  if (node.IsNull())
243  continue;
244  const mitk::Mapper::Pointer mapper = node->GetMapper(m_MapperID);
245 
246  if (mapper.IsNull())
247  continue;
248 
249  bool visible = true;
250  node->GetVisibility(visible, this, "visible");
251 
252  // The information about LOD-enabled mappers is required by RenderingManager
253  if (mapper->IsLODEnabled(this) && visible)
254  {
255  ++m_NumberOfVisibleLODEnabledMappers;
256  }
257  // mapper without a layer property get layer number 1
258  int layer = 1;
259  node->GetIntProperty("layer", layer, this);
260  int nr = (layer << 16) + mapperNo;
261  m_MappersMap.insert(std::pair<int, Mapper *>(nr, mapper));
262  mapperNo++;
263  }
264 }
265 
267 {
268  if (datatreenode != NULL)
269  {
270  mitk::Mapper::Pointer mapper = datatreenode->GetMapper(m_MapperID);
271  if (mapper.IsNotNull())
272  {
273  if (GetCurrentWorldPlaneGeometry()->IsValid())
274  {
275  mapper->Update(this);
276  {
277  VtkMapper *vtkmapper = dynamic_cast<VtkMapper *>(mapper.GetPointer());
278  if (vtkmapper != NULL)
279  {
280  vtkmapper->UpdateVtkTransform(this);
281  }
282  }
283  }
284  }
285  }
286 }
287 
289 {
290  if (m_DataStorage.IsNull())
291  return;
292 
294  for (mitk::DataStorage::SetOfObjects::ConstIterator it = all->Begin(); it != all->End(); ++it)
295  Update(it->Value());
296 
297  Modified();
298  m_LastUpdateTime = GetMTime();
299 }
300 
306 void mitk::VtkPropRenderer::InitRenderer(vtkRenderWindow *renderWindow)
307 {
308  BaseRenderer::InitRenderer(renderWindow);
309 
310  vtkCallbackCommand *renderCallbackCommand = vtkCallbackCommand::New();
311  renderCallbackCommand->SetCallback(VtkPropRenderer::RenderingCallback);
312  renderWindow->GetInteractor()->AddObserver(vtkCommand::RenderEvent, renderCallbackCommand);
313  renderCallbackCommand->Delete();
314 
315  if (renderWindow == NULL)
316  {
317  m_InitNeeded = false;
318  m_ResizeNeeded = false;
319  return;
320  }
321 
322  m_InitNeeded = true;
323  m_ResizeNeeded = true;
324 
325  m_LastUpdateTime = 0;
326 }
327 
328 void mitk::VtkPropRenderer::RenderingCallback(vtkObject *caller, unsigned long, void *, void *)
329 {
330  vtkRenderWindowInteractor *renderWindowInteractor = dynamic_cast<vtkRenderWindowInteractor *>(caller);
331  if (!renderWindowInteractor)
332  return;
333  mitk::BaseRenderer *renderer = mitk::BaseRenderer::GetInstance(renderWindowInteractor->GetRenderWindow());
334  if (renderer)
335  renderer->RequestUpdate();
336 }
337 
342 {
343  BaseRenderer::Resize(w, h);
344  m_RenderingManager->RequestUpdate(this->GetRenderWindow());
345 }
346 
348 {
349  m_RenderWindow->SetSize(w, h);
350  Superclass::InitSize(w, h);
351  Modified();
352  Update();
353  if (m_VtkRenderer != NULL)
354  {
355  int w = vtkObject::GetGlobalWarningDisplay();
356  vtkObject::GlobalWarningDisplayOff();
357  m_VtkRenderer->ResetCamera();
358  vtkObject::SetGlobalWarningDisplay(w);
359  }
360  this->GetCameraController()->Fit();
361 }
362 
364  std::string text, double posX, double posY, double color1, double color2, double color3, float opacity)
365 {
366  this->GetVtkRenderer()->ViewToDisplay();
367  if (!text.empty())
368  {
369  Point2D p;
370  vtkTextActor *textActor = vtkTextActor::New();
371 
372  textActor->SetDisplayPosition(posX, posY);
373  textActor->SetInput(text.c_str());
374  textActor->SetTextScaleModeToNone();
375  textActor->GetTextProperty()->SetColor(color1, color2, color3); // TODO: Read color from node property
376  textActor->GetTextProperty()->SetOpacity(opacity);
377  int text_id = m_TextCollection.size();
378  m_TextCollection.insert(TextMapType::value_type(text_id, textActor));
379  return text_id;
380  }
381  else
382  {
383  return -1;
384  }
385 }
386 
388 {
389  if (m_MapperID != mapperId)
390  Superclass::SetMapperID(mapperId);
391 
392  // Workaround for GL Displaylist Bug
393  checkState();
394 }
395 
400 {
401  if (m_RenderWindow != NULL)
402  m_RenderWindow->MakeCurrent();
403 }
404 
405 void mitk::VtkPropRenderer::PickWorldPoint(const mitk::Point2D &displayPoint, mitk::Point3D &worldPoint) const
406 {
407  if (this->GetRenderWindow()->GetNeverRendered() != 0)
408  return; // somebody called picking before we ever rendered; cannot have enough information yet
409 
410  switch (m_PickingMode)
411  {
412  case (WorldPointPicking):
413  {
414  m_WorldPointPicker->Pick(displayPoint[0], displayPoint[1], 0, m_VtkRenderer);
415  vtk2itk(m_WorldPointPicker->GetPickPosition(), worldPoint);
416  break;
417  }
418  case (PointPicking):
419  {
420  m_PointPicker->Pick(displayPoint[0], displayPoint[1], 0, m_VtkRenderer);
421  vtk2itk(m_PointPicker->GetPickPosition(), worldPoint);
422  break;
423  }
424  case (CellPicking):
425  {
426  m_CellPicker->Pick(displayPoint[0], displayPoint[1], 0, m_VtkRenderer);
427  vtk2itk(m_CellPicker->GetPickPosition(), worldPoint);
428  break;
429  }
430  }
431  // todo: is this picking in 2D renderwindows?
432  // Superclass::PickWorldPoint(displayPoint, worldPoint);
433 }
434 
435 mitk::DataNode *mitk::VtkPropRenderer::PickObject(const Point2D &displayPosition, Point3D &worldPosition) const
436 {
437  m_CellPicker->InitializePickList();
438 
439  // Iterate over all DataStorage objects to determine all vtkProps intended
440  // for picking
442  for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
443  {
444  const DataNode *node = it->Value();
445  if (node == NULL)
446  continue;
447 
448  bool pickable = false;
449  node->GetBoolProperty("pickable", pickable);
450  if (!pickable)
451  continue;
452 
453  VtkMapper *mapper = dynamic_cast<VtkMapper *>(node->GetMapper(m_MapperID));
454  if (mapper == NULL)
455  continue;
456 
457  vtkProp *prop = mapper->GetVtkProp((mitk::BaseRenderer *)this);
458  if (prop == NULL)
459  continue;
460 
461  m_CellPicker->AddPickList(prop);
462  }
463 
464  // Do the picking and retrieve the picked vtkProp (if any)
465  m_CellPicker->PickFromListOn();
466  m_CellPicker->Pick(displayPosition[0], displayPosition[1], 0.0, m_VtkRenderer);
467  m_CellPicker->PickFromListOff();
468 
469  vtk2itk(m_CellPicker->GetPickPosition(), worldPosition);
470  vtkProp *prop = m_CellPicker->GetViewProp();
471 
472  if (prop == NULL)
473  {
474  return NULL;
475  }
476 
477  // Iterate over all DataStorage objects to determine if the retrieved
478  // vtkProp is owned by any associated mapper.
479  for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
480  {
481  DataNode::Pointer node = it->Value();
482  if (node.IsNull())
483  continue;
484 
485  mitk::Mapper *mapper = node->GetMapper(m_MapperID);
486  if (mapper == NULL)
487  continue;
488 
489  mitk::VtkMapper *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
490 
491  if (vtkmapper)
492  {
493  // if vtk-based, then ...
494  if (vtkmapper->HasVtkProp(prop, const_cast<mitk::VtkPropRenderer *>(this)))
495  {
496  return node;
497  }
498  }
499  }
500  return NULL;
501 }
502 // todo: is this 2D renderwindow picking?
503 // return Superclass::PickObject( displayPosition, worldPosition );
504 
505 vtkTextProperty *mitk::VtkPropRenderer::GetTextLabelProperty(int text_id)
506 {
507  return this->m_TextCollection[text_id]->GetTextProperty();
508 }
509 
511 {
512  if (m_DataStorage.IsNotNull())
513  {
514  this->UpdatePaths();
515  this->m_Paths->InitTraversal();
516  }
517 }
518 
520 {
521  if (m_DataStorage.IsNull())
522  {
523  return;
524  }
525 
526  if (GetMTime() > m_PathTime || (m_Paths != nullptr && m_Paths->GetMTime() > m_PathTime))
527  {
528  // Create the list to hold all the paths
530 
532  for (DataStorage::SetOfObjects::const_iterator iter = objects->begin(); iter != objects->end(); ++iter)
533  {
534  vtkSmartPointer<vtkAssemblyPath> onePath = vtkSmartPointer<vtkAssemblyPath>::New();
535  Mapper *mapper = (*iter)->GetMapper(BaseRenderer::Standard3D);
536  if (mapper)
537  {
538  VtkMapper *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
539  {
540  vtkProp *prop = vtkmapper->GetVtkProp(this);
541  if (prop && prop->GetVisibility())
542  {
543  // add to assembly path
544  onePath->AddNode(prop, prop->GetMatrix());
545  m_Paths->AddItem(onePath);
546  }
547  }
548  }
549  }
550 
551  m_PathTime.Modified();
552  }
553 }
554 
556 {
557  UpdatePaths();
558  return m_Paths->GetNumberOfItems();
559 }
560 
562 {
563  return m_Paths ? m_Paths->GetNextItem() : 0;
564 }
565 
567 {
568  if (m_DataStorage.IsNull())
569  return;
570 
572  for (DataStorage::SetOfObjects::const_iterator iter = allObjects->begin(); iter != allObjects->end(); ++iter)
573  {
574  DataNode::Pointer node = *iter;
575  if (node.IsNull())
576  continue;
577 
578  Mapper *mapper = node->GetMapper(m_MapperID);
579 
580  if (mapper)
581  {
582  VtkMapper *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
583 
584  if (vtkmapper)
585  vtkmapper->ReleaseGraphicsResources(this);
586  }
587  }
588 }
589 
590 const vtkWorldPointPicker *mitk::VtkPropRenderer::GetWorldPointPicker() const
591 {
592  return m_WorldPointPicker;
593 }
594 
595 const vtkPointPicker *mitk::VtkPropRenderer::GetPointPicker() const
596 {
597  return m_PointPicker;
598 }
599 
600 const vtkCellPicker *mitk::VtkPropRenderer::GetCellPicker() const
601 {
602  return m_CellPicker;
603 }
604 
606 {
607  return m_MappersMap;
608 }
609 
610 // Workaround for GL Displaylist bug
611 static int glWorkAroundGlobalCount = 0;
612 
614 {
615  return glWorkAroundGlobalCount > 1;
616 }
617 
618 void mitk::VtkPropRenderer::checkState()
619 {
620  if (m_MapperID == Standard3D)
621  {
622  if (!didCount)
623  {
624  didCount = true;
625  glWorkAroundGlobalCount++;
626 
627  if (glWorkAroundGlobalCount == 2)
628  {
629  MITK_INFO << "Multiple 3D Renderwindows active...: turning Immediate Rendering ON for legacy mappers";
630  // vtkMapper::GlobalImmediateModeRenderingOn();
631  }
632  }
633  }
634  else
635  {
636  if (didCount)
637  {
638  didCount = false;
639  glWorkAroundGlobalCount--;
640  if (glWorkAroundGlobalCount == 1)
641  {
642  MITK_INFO << "Single 3D Renderwindow active...: turning Immediate Rendering OFF for legacy mappers";
643  // vtkMapper::GlobalImmediateModeRenderingOff();
644  }
645  }
646  }
647 }
648 
649 //### Contains all methods which are neceassry before each VTK Render() call
651 {
652  if (this->GetMapperID() != m_CameraInitializedForMapperID)
653  {
654  Initialize2DvtkCamera(); // Set parallel projection etc.
655  }
656  GetCameraController()->AdjustCameraToPlane();
657 }
658 
659 bool mitk::VtkPropRenderer::Initialize2DvtkCamera()
660 {
661  if (this->GetMapperID() == Standard3D)
662  {
663  // activate parallel projection for 2D
664  this->GetVtkRenderer()->GetActiveCamera()->SetParallelProjection(false);
665  vtkSmartPointer<vtkInteractorStyleTrackballCamera> style =
667  this->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
668  this->GetRenderWindow()->GetInteractor()->EnableRenderOff();
669  m_CameraInitializedForMapperID = Standard3D;
670  }
671  else if (this->GetMapperID() == Standard2D)
672  {
673  // activate parallel projection for 2D
674  this->GetVtkRenderer()->GetActiveCamera()->SetParallelProjection(true);
675  // turn the light out in the scene in order to render correct grey values.
676  // TODO Implement a property for light in the 2D render windows (in another method)
677  this->GetVtkRenderer()->RemoveAllLights();
678 
679  vtkSmartPointer<mitkVtkInteractorStyle> style = vtkSmartPointer<mitkVtkInteractorStyle>::New();
680  this->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
681  this->GetRenderWindow()->GetInteractor()->EnableRenderOff();
682  m_CameraInitializedForMapperID = Standard2D;
683  }
684  return true;
685 }
VtkPropRenderer(const char *name="VtkPropRenderer", vtkRenderWindow *renWin=nullptr, mitk::RenderingManager *rm=nullptr, mitk::BaseRenderer::RenderingMode::Type renderingMode=mitk::BaseRenderer::RenderingMode::Standard)
vtkTextProperty * GetTextLabelProperty(int text_id)
CGetTextLabelProperty an be used in order to get a vtkTextProperty for a specific text_id...
static int glWorkAroundGlobalCount
virtual mitk::DataNode * PickObject(const Point2D &displayPosition, Point3D &worldPosition) const override
Determines the object (mitk::DataNode) closest to the current position by means of picking...
std::map< int, Mapper * > MappersMapType
Data management class that handles 'was created by' relations.
virtual ~VtkPropRenderer()
Destructs the VtkPropRenderer.
virtual bool SetWorldGeometryToDataStorageBounds() override
const vtkCellPicker * GetCellPicker() const
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
#define MITK_INFO
Definition: mitkLogMacros.h:22
virtual bool HasVtkProp(const vtkProp *prop, BaseRenderer *renderer)
Returns true if this mapper owns the specified vtkProp for the given BaseRenderer.
virtual void MakeCurrent()
Activates the current renderwindow.
virtual void SetDataStorage(mitk::DataStorage *storage) override
set the datastorage that will be used for rendering
virtual void SetDataStorage(DataStorage *storage)
set the datastorage that will be used for rendering
virtual void Resize(int w, int h)
Called to inform the renderer that the RenderWindow has been resized.
virtual void InitSize(int w, int h) override
Set the initial size. Called by RenderWindow after it has become visible for the first time...
Organizes the rendering process.
int WriteSimpleText(std::string text, double posX, double posY, double color1=0.0, double color2=1.0, double color3=0.0, float opacity=1.0)
WriteSimpleText Write a text in a renderwindow.
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer=nullptr) const
Convenience access method for bool properties (instances of BoolProperty)
virtual void InitRenderer(vtkRenderWindow *renderwindow) override
This method is called from the two Constructors.
static void Update(vtkPolyData *)
Definition: mitkSurface.cpp:35
virtual void PickWorldPoint(const Point2D &displayPoint, Point3D &worldPoint) const override
Perform a picking: find the x,y,z world coordinate of a display x,y coordinate.
int Render(RenderType type)
Called by the vtkMitkRenderProp in order to start MITK rendering process.
const vtkWorldPointPicker * GetWorldPointPicker() const
Base class of all Vtk Mappers in order to display primitives by exploiting Vtk functionality.
Definition: mitkVtkMapper.h:53
Base class of all mappers, Vtk as well as OpenGL mappers.
Definition: mitkMapper.h:54
MappersMapType GetMappersMap() const
itk::SmartPointer< const Self > ConstPointer
itk::SmartPointer< Self > Pointer
Definition: mitkDataNode.h:81
mitk::DataStorage::Pointer m_DataStorage
int MapperSlotId
MapperSlotId defines which kind of mapper (e.g., 2D or 3D) shoud be used.
Manager for coordinating the rendering process.
virtual vtkProp * GetVtkProp(mitk::BaseRenderer *renderer)=0
const vtkPointPicker * GetPointPicker() const
void InitPathTraversal()
Used by vtkPointPicker/vtkPicker. This will query a list of all objects in MITK and provide every vtk...
vtkRenderer * m_VtkRenderer
void vtk2itk(const Tin &in, Tout &out)
virtual void UpdateVtkTransform(mitk::BaseRenderer *renderer)
Set the vtkTransform of the m_Prop3D for the current time step of renderer.
static void RenderingCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata)
Vtk-based mapper to display a PlaneGeometry in a 3D windowUses a PlaneGeometryDataToSurfaceFilter obj...
virtual void PrepareRender()
This methods contains all method neceassary before a VTK Render() call.
virtual void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type)=0
Responsible for calling the appropriate render functions. To be implemented in sub-classes.
static bool useImmediateModeRendering()
mitk::Mapper * GetMapper(MapperSlotId id) const
virtual void ReleaseGraphicsResources(mitk::BaseRenderer *)
Release vtk-based graphics resources that are being consumed by this mapper.
virtual void ReleaseGraphicsResources(vtkWindow *renWin)
Release vtk-based graphics resources. Called by vtkMitkRenderProp::ReleaseGraphicsResources.
virtual void SetMapperID(const MapperSlotId mapperId) override
Set the MapperSlotId to use.
virtual void Update() override
Call update of all mappers. To be implemented in subclasses.
virtual void Resize(int w, int h) override
Resize the OpenGL Window.
DataNode::Pointer m_CurrentWorldPlaneGeometryNode
virtual void InitRenderer(vtkRenderWindow *renderwindow)
Initialize the renderer with a RenderWindow (renderwindow).
vtkAssemblyPath * GetNextPath()
Used by vtkPointPicker/vtkPicker. This will query a list of all objects in MITK and provide every vtk...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.