Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkScaleLegendOverlay.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 "mitkScaleLegendOverlay.h"
18 #include <vtkLegendScaleActor.h>
19 
21 {
23 
24  SetLeftAxisVisibility(false);
25 
26  SetTopAxisVisibility(false);
27 
29 
30  SetLegendVisibility(false);
31 
33 
35 }
36 
38 {
39 }
40 
42 {
43 }
44 
46 {
47  m_legendScaleActor = vtkSmartPointer<vtkLegendScaleActor>::New();
48 }
49 
51 {
52  LocalStorage *ls = this->m_LSH.GetLocalStorage(renderer);
53 
54  if (ls->IsGenerateDataRequired(renderer, this))
55  {
56  ls->m_legendScaleActor->SetRightAxisVisibility(this->GetRightAxisVisibility());
57  ls->m_legendScaleActor->SetTopAxisVisibility(this->GetTopAxisVisibility());
58  ls->m_legendScaleActor->SetLeftAxisVisibility(this->GetLeftAxisVisibility());
59  ls->m_legendScaleActor->SetBottomAxisVisibility(this->GetBottomAxisVisibility());
60  ls->m_legendScaleActor->SetLegendVisibility(this->GetLegendVisibility());
61  ls->m_legendScaleActor->SetRightBorderOffset(this->GetRightBorderOffset());
62  ls->m_legendScaleActor->SetCornerOffsetFactor(this->GetCornerOffsetFactor());
63  }
64 }
65 
67 {
68  LocalStorage *ls = this->m_LSH.GetLocalStorage(renderer);
69  return ls->m_legendScaleActor;
70 }
71 
73 {
74  SetBoolProperty("ScaleLegendOverlay.RightAxisVisibility", visibility);
75 }
76 
78 {
79  bool visibility;
80  GetPropertyList()->GetBoolProperty("ScaleLegendOverlay.RightAxisVisibility", visibility);
81  return visibility;
82 }
83 
85 {
86  SetBoolProperty("ScaleLegendOverlay.LeftAxisVisibility", visibility);
87 }
88 
90 {
91  bool visibility;
92  GetPropertyList()->GetBoolProperty("ScaleLegendOverlay.LeftAxisVisibility", visibility);
93  return visibility;
94 }
95 
97 {
98  SetBoolProperty("ScaleLegendOverlay.TopAxisVisibility", visibility);
99 }
100 
102 {
103  bool visibility;
104  GetPropertyList()->GetBoolProperty("ScaleLegendOverlay.TopAxisVisibility", visibility);
105  return visibility;
106 }
107 
109 {
110  SetBoolProperty("ScaleLegendOverlay.BottomAxisVisibility", visibility);
111 }
112 
114 {
115  bool visibility;
116  GetPropertyList()->GetBoolProperty("ScaleLegendOverlay.BottomAxisVisibility", visibility);
117  return visibility;
118 }
119 
121 {
122  SetBoolProperty("ScaleLegendOverlay.SetLegendVisibility", visibility);
123 }
124 
126 {
127  bool visibility;
128  GetPropertyList()->GetBoolProperty("ScaleLegendOverlay.SetLegendVisibility", visibility);
129  return visibility;
130 }
131 
133 {
134  SetIntProperty("ScaleLegendOverlay.RightBorderOffset", offset);
135 }
136 
138 {
139  int offset;
140  GetPropertyList()->GetIntProperty("ScaleLegendOverlay.RightBorderOffset", offset);
141  return offset;
142 }
143 
145 {
146  SetFloatProperty("ScaleLegendOverlay.CornerOffsetFactor", offsetFactor);
147 }
148 
150 {
151  float offsetFactor;
152  GetPropertyList()->GetFloatProperty("ScaleLegendOverlay.CornerOffsetFactor", offsetFactor);
153  return offsetFactor;
154 }
void SetTopAxisVisibility(bool visibility)
void SetLeftAxisVisibility(bool visibility)
ScaleLegendOverlay()
explicit constructor which disallows implicit conversions
virtual vtkProp * GetVtkProp(BaseRenderer *renderer) const override
This method is implemented by the specific VTKOverlays in order to create the element as a vtkProp...
Organizes the rendering process.
LocalStorage()
Default constructor of the local storage.
static Vector3D offset
vtkSmartPointer< vtkLegendScaleActor > m_legendScaleActor
Actor of a 2D render window.
void SetBottomAxisVisibility(bool visibility)
virtual void UpdateVtkOverlay(BaseRenderer *renderer) override
virtual ~ScaleLegendOverlay()
virtual destructor in order to derive from this class
void SetCornerOffsetFactor(float offsetFactor)
~LocalStorage()
Default deconstructor of the local storage.
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Overlay *overlay)
void SetLegendVisibility(bool visibility)
void SetRightAxisVisibility(bool visibility)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.