fw4spl
Axis.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWRENDERQT_DATA_AXIS_HPP__
8 #define __FWRENDERQT_DATA_AXIS_HPP__
9 
10 #include <memory>
11 
12 namespace fwRenderQt
13 {
14 namespace data
15 {
16 
20 class Axis
21 {
22 
23 public:
24 
25  typedef std::shared_ptr < Axis > sptr;
26 
27  typedef enum
28  {
29  LINEAR,
30  LOG
31  } ScaleType;
32 
36  Axis() :
37  m_origin(0.f),
38  m_scale(1.f),
39  m_scaleType(LINEAR)
40  {
41  }
42 
44  float getOrigin() const;
45 
47  void setOrigin (float origin);
48 
50  float getScale() const;
51 
53  void setScale (float scale);
54 
56  ScaleType getScaleType() const;
57 
59  void setScaleType(ScaleType scaleType);
60 
61 private:
63  float m_origin, m_scale;
64 
66  ScaleType m_scaleType;
67 
68 };
69 
70 //-----------------------------------------------------------------------------
71 
72 inline float Axis::getOrigin() const
73 {
74  return m_origin;
75 }
76 
77 //-----------------------------------------------------------------------------
78 
79 inline void Axis::setOrigin (float origin)
80 {
81  m_origin = origin;
82 }
83 
84 //-----------------------------------------------------------------------------
85 
86 inline float Axis::getScale() const
87 {
88  return m_scale;
89 }
90 
91 //-----------------------------------------------------------------------------
92 
93 inline void Axis::setScale (float scale)
94 {
95  m_scale = scale;
96 }
97 
98 //-----------------------------------------------------------------------------
99 
100 inline Axis::ScaleType Axis::getScaleType() const
101 {
102  return m_scaleType;
103 }
104 
105 //-----------------------------------------------------------------------------
106 
107 inline void Axis::setScaleType(ScaleType scaleType)
108 {
109  m_scaleType = scaleType;
110 }
111 
112 //-----------------------------------------------------------------------------
113 
114 } // namespace data
115 } // namespace fwRenderQt
116 
117 #endif // __FWRENDERQT_DATA_AXIS_HPP__
118 
float getScale() const
Get m_scale attribute.
Definition: Axis.hpp:86
void setOrigin(float origin)
Set m_origin attribute.
Definition: Axis.hpp:79
Axis()
Constructor, set origin to 0, scale to 1 and type to LINEAR.
Definition: Axis.hpp:36
float getOrigin() const
Get m_origin attribute.
Definition: Axis.hpp:72
void setScaleType(ScaleType scaleType)
Set m_scaleType attribute.
Definition: Axis.hpp:107
The namespace fwRenderQt contains classes for rendering with Qt.
Definition: Axis.hpp:12
void setScale(float scale)
Set m_scale attribute.
Definition: Axis.hpp:93
ScaleType getScaleType() const
Get m_scaleType attribute.
Definition: Axis.hpp:100
This class manages an axis on the scene2D.
Definition: Axis.hpp:20