Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLRulerDisplayableManager.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 This file was originally developed by Andras Lasso, PerkLab, Queen's University.
17
18==============================================================================*/
19
20#ifndef __vtkMRMLRulerDisplayableManager_h
21#define __vtkMRMLRulerDisplayableManager_h
22
23// MRMLDisplayableManager includes
25#include "vtkMRMLDisplayableManagerExport.h"
26
27// STL includes
28#include <vector>
29
31class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLRulerDisplayableManager
33{
35
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
52 void AddRulerScalePreset(double length, int numberOfMajorDivisons, int numberOfMinorDivisions, const std::string& displayedUnitName, double displayedScale);
55
56protected:
57
60
62 void Create() override;
63
67 void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller) override;
68
71
74
76 {
77 double Length; // actual length of the ruler (in world coordinates)
78 int NumberOfMajorDivisions; // number of major divisions of the ruler
79 int NumberOfMinorDivisions; // number of divisions of each major division
80 std::string DisplayedUnitName; // label that will be shown after the scaled length
81 double DisplayedScale; // displayed length is Length*Scale
82 };
83
84 // List of ruler presets, ordered based on length.
85 std::vector<RulerScalePreset> RulerScalePresets;
86
87private:
88
90 void operator=(const vtkMRMLRulerDisplayableManager&) = delete;
91
92 class vtkInternal;
93 vtkInternal * Internal;
94};
95
96#endif
void RemoveAllRulerScalePresets()
Remove all scale presets.
void AddRulerScalePreset(double length, int numberOfMajorDivisons, int numberOfMinorDivisions, const std::string &displayedUnitName, double displayedScale)
void UpdateFromViewNode()
Update the renderer from the view node properties.
void Create() override
Observe the View node and initialize the renderer accordingly.
std::vector< RulerScalePreset > RulerScalePresets
~vtkMRMLRulerDisplayableManager() override
static vtkMRMLRulerDisplayableManager * New()
void UpdateFromRenderer()
Update the renderer based on the master renderer (the one that the orientation marker follows)
void OnMRMLDisplayableNodeModifiedEvent(vtkObject *caller) override
void PrintSelf(ostream &os, vtkIndent indent) override