fw4spl
include/fwData/Tag.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwData/config.hpp"
10 #include "fwData/factory/new.hpp"
11 #include "fwData/Object.hpp"
12 #include "fwData/PointList.hpp"
13 
14 #include <vector>
15 
16 fwCampAutoDeclareDataMacro((fwData)(Tag), FWDATA_API);
17 
18 namespace fwData
19 {
20 
25 class FWDATA_CLASS_API Tag : public Object
26 {
27 
28 public:
29  fwCoreClassDefinitionsWithFactoryMacro( (Tag)(::fwData::Object), (()), ::fwData::factory::New< Tag >);
30 
35  FWDATA_API Tag(::fwData::Object::Key key);
36 
38  FWDATA_API virtual ~Tag();
39 
40  fwCampMakeFriendDataMacro((fwData)(Tag));
41 
46  ::fwData::PointList::sptr& getPointList();
47  const ::fwData::PointList::sptr& getPointList() const;
48  void setPointList (const ::fwData::PointList::sptr& _pointList);
50 
55  std::string& getType ();
56  const std::string& getType () const;
57  void setType (const std::string& _sType);
59 
64  double& getSize ();
65  double getSize () const;
66  void setSize (const double _size);
68 
70  FWDATA_API void shallowCopy( const Object::csptr& source ) override;
71 
73  FWDATA_API void cachedDeepCopy(const Object::csptr& source, DeepCopyCacheType& cache) override;
74 
75 protected:
76 
78  ::fwData::PointList::sptr m_pointList;
79 
81  std::string m_sType;
82 
84  double m_size;
85 
86 }; // end class Tag
87 
88 //-----------------------------------------------------------------------------
89 
90 inline ::fwData::PointList::sptr& Tag::getPointList()
91 {
92  return this->m_pointList;
93 }
94 
95 //-----------------------------------------------------------------------------
96 
97 inline const ::fwData::PointList::sptr& Tag::getPointList() const
98 {
99  return this->m_pointList;
100 }
101 
102 //-----------------------------------------------------------------------------
103 
104 inline void Tag::setPointList (const ::fwData::PointList::sptr& _pointList)
105 {
106  this->m_pointList = _pointList;
107 }
108 
109 //-----------------------------------------------------------------------------
110 
111 inline std::string& Tag::getType ()
112 {
113  return m_sType;
114 }
115 
116 //-----------------------------------------------------------------------------
117 
118 inline const std::string& Tag::getType () const
119 {
120  return m_sType;
121 }
122 
123 //-----------------------------------------------------------------------------
124 
125 inline void Tag::setType (const std::string& _sType)
126 {
127  this->m_sType = _sType;
128 }
129 
130 //-----------------------------------------------------------------------------
131 
132 inline double Tag::getSize () const
133 {
134  return m_size;
135 }
136 
137 //-----------------------------------------------------------------------------
138 
139 inline double& Tag::getSize ()
140 {
141  return m_size;
142 }
143 
144 //-----------------------------------------------------------------------------
145 
146 inline void Tag::setSize (const double _size)
147 {
148  m_size = _size;
149 }
150 
151 //-----------------------------------------------------------------------------
152 
153 } // end namespace fwData
This class represent a tag. A tag contains a list of points.
void setType(const std::string &_sType)
Get/Set value of the Type.
double & getSize()
Get/Set value of the Tag size.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
::fwData::PointList::sptr & getPointList()
Get/Set value of the pointList.
::fwData::PointList::sptr m_pointList
list of points
void setSize(const double _size)
Get/Set value of the Tag size.
std::string m_sType
type of tag
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
void setPointList(const ::fwData::PointList::sptr &_pointList)
Get/Set value of the pointList.
Base class for each data object.
Contains the representation of the data objects used in the framework.
std::string & getType()
Get/Set value of the Type.
double m_size
size of tag