Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmlAxisOverlay.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 
18 #include "QmlAxisOverlay.h"
19 #include <vtkProperty.h>
20 #include <vtkActor2D.h>
21 #include <vtkPropCollection.h>
22 //#include "Util_Debug.h"
23 #include "mitkPoint.h"
24 
26 {
27 }
28 
30 {
31 }
32 
34 {
35 }
36 
38 {
39  this->m_axesActor = vtkSmartPointer<vtkAxesActor>::New();
41  this->m_dummyActor = vtkSmartPointer<vtkActor>::New();
42  this->m_dummyMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
43  this->m_dummySource = vtkSmartPointer<vtkSphereSource>::New();
44  this->m_dummyMapper->SetInputConnection(m_dummySource->GetOutputPort());
45  this->m_dummyActor->SetMapper(this->m_dummyMapper);
46  this->m_dummyActor->SetVisibility(false);
47  this->m_dummyActor->GetProperty()->SetOpacity(0.0);
48 }
49 
51 {
52  LocalStorage* ls = this->m_LSH.GetLocalStorage(renderer);
53  if (ls->IsGenerateDataRequired(renderer, this))
54  {
55  ls->m_widget->SetOrientationMarker(ls->m_axesActor);
56  ls->m_widget->SetInteractor(renderer->GetRenderWindow()->GetInteractor());
57  ls->m_widget->SetEnabled(true);
58  ls->m_widget->SetOutlineColor(0.3, 0, 0);
59  ls->m_widget->SetInteractive(true);
60  ls->m_initialized = true;
61  }
62 }
63 
65 {
66  LocalStorage* ls = this->m_LSH.GetLocalStorage(renderer);
67  return ls->m_dummyActor;
68 }
AxisOverlay()
explicit constructor which disallows implicit conversions
vtkSmartPointer< vtkActor > m_dummyActor
vtkSmartPointer< vtkAxesActor > m_axesActor
Organizes the rendering process.
vtkSmartPointer< vtkOrientationMarkerWidget > m_widget
virtual vtkProp * GetVtkProp(BaseRenderer *renderer) const
This method is implemented by the specific VTKOverlays in order to create the element as a vtkProp...
~LocalStorage()
Default deconstructor of the local storage.
bool m_initialized
Actor of a 2D render window.
LocalStorage()
Default constructor of the local storage.
virtual ~AxisOverlay()
virtual destructor in order to derive from this class
vtkRenderWindow * GetRenderWindow() const
Access the RenderWindow into which this renderer renders.
void UpdateVtkOverlay(mitk::BaseRenderer *renderer)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.