Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkFloatPropertyExtension.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 
18 
19 namespace mitk
20 {
21  struct FloatPropertyExtension::Impl
22  {
23  Impl();
24  Impl(float minimum, float maximum, float singleStep, int decimals);
25  ~Impl();
26 
27  int Decimals;
28  float Maximum;
29  float Minimum;
30  float SingleStep;
31  };
32 
33  FloatPropertyExtension::Impl::Impl() : Decimals(2), Maximum(99.9999999999f), Minimum(0.0f), SingleStep(1.0f) {}
34  FloatPropertyExtension::Impl::Impl(float minimum, float maximum, float singleStep, int decimals)
35  : Decimals(decimals), Maximum(maximum), Minimum(minimum), SingleStep(singleStep)
36  {
37  }
38 
39  FloatPropertyExtension::Impl::~Impl() {}
40 }
41 
42 mitk::FloatPropertyExtension::FloatPropertyExtension() : m_Impl(new Impl)
43 {
44 }
45 
46 mitk::FloatPropertyExtension::FloatPropertyExtension(float minimum, float maximum, float singleStep, int decimals)
47  : m_Impl(new Impl(minimum, maximum, singleStep, decimals))
48 {
49 }
50 
51 mitk::FloatPropertyExtension::~FloatPropertyExtension()
52 {
53  delete m_Impl;
54 }
55 
57 {
58  return m_Impl->Decimals;
59 }
60 
62 {
63  m_Impl->Decimals = decimals;
64 }
65 
67 {
68  return m_Impl->Maximum;
69 }
70 
72 {
73  m_Impl->Maximum = maximum;
74 }
75 
77 {
78  return m_Impl->Minimum;
79 }
80 
82 {
83  m_Impl->Minimum = minimum;
84 }
85 
87 {
88  return m_Impl->SingleStep;
89 }
90 
92 {
93  m_Impl->SingleStep = singleStep;
94 }
DataCollection - Class to facilitate loading/accessing structured data.