fw4spl
include/fwData/ResectionDB.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/Resection.hpp"
12 
13 #include <fwCom/Signal.hpp>
14 #include <fwCom/Signals.hpp>
15 
16 fwCampAutoDeclareDataMacro((fwData)(ResectionDB), FWDATA_API);
17 
18 namespace fwData
19 {
25 class FWDATA_CLASS_API ResectionDB : public Object
26 {
27 
28 public:
30  ::fwData::factory::New< ResectionDB >);
31  fwCampMakeFriendDataMacro((fwData)(ResectionDB));
32 
37  FWDATA_API ResectionDB(::fwData::Object::Key key);
38 
40  FWDATA_API virtual ~ResectionDB();
41 
43  FWDATA_API void shallowCopy( const Object::csptr& _source ) override;
44 
46  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
47 
48  typedef std::vector< ::fwData::Resection::sptr > ResectionContainerType;
49 
53  FWDATA_API ResectionContainerType::size_type getNumberOfResections() const;
54 
58  FWDATA_API void addResection(const ::fwData::Resection::sptr& resection );
59 
64  const ResectionContainerType& getResections () const;
65  void setResections (const ResectionContainerType& val);
67 
72  ::fwData::Resection::sptr& getSafeResection();
73  const ::fwData::Resection::sptr& getSafeResection() const;
74  void setSafeResection(const ::fwData::Resection::sptr& _safeResection);
76 
77  /***
78  * @name Signals
79  * @{
80  */
81 
83  typedef ::fwCom::Signal< void () > SafePartAddedSignalType;
84 
86  FWDATA_API static const ::fwCom::Signals::SignalKeyType s_SAFE_PART_ADDED_SIG;
87 
89  typedef ::fwCom::Signal< void () > ResectionAddedSignalType;
90 
92  FWDATA_API static const ::fwCom::Signals::SignalKeyType s_RESECTION_ADDED_SIG;
93 
98 protected:
99 
100  ::fwData::Resection::sptr m_safeResection;
101 
102  ResectionContainerType m_resections;
103 
104 private:
105 
107  SafePartAddedSignalType::sptr m_sigSafePartAdded;
108 
110  ResectionAddedSignalType::sptr m_sigResectionAdded;
111 };
112 
113 //-----------------------------------------------------------------------------
114 
115 inline const ResectionDB::ResectionContainerType& ResectionDB::getResections () const
116 {
117  return m_resections;
118 }
119 
120 //-----------------------------------------------------------------------------
121 
122 inline void ResectionDB::setResections (const ResectionDB::ResectionContainerType& val)
123 {
124  m_resections = val;
125 }
126 
127 //-----------------------------------------------------------------------------
128 
129 inline ::fwData::Resection::sptr& ResectionDB::getSafeResection()
130 {
131  return m_safeResection;
132 }
133 
134 //-----------------------------------------------------------------------------
135 
136 inline const ::fwData::Resection::sptr& ResectionDB::getSafeResection() const
137 {
138  return m_safeResection;
139 }
140 
141 //-----------------------------------------------------------------------------
142 
143 inline void ResectionDB::setSafeResection(const ::fwData::Resection::sptr& _safeResection)
144 {
145  m_safeResection = _safeResection;
146 }
147 
148 //-----------------------------------------------------------------------------
149 
150 } // namespace fwData
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_SAFE_PART_ADDED_SIG
Key in m_signals map of signal m_sigSafePartAdded.
::fwData::Resection::sptr & getSafeResection()
Get/Set value of the safe resection.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_RESECTION_ADDED_SIG
Key in m_signals map of signal m_sigResectionAdded.
::fwCom::Signal< void() > SafePartAddedSignalType
Type of signal when the safe part is added.
void setSafeResection(const ::fwData::Resection::sptr &_safeResection)
Get/Set value of the safe resection.
void setResections(const ResectionContainerType &val)
Get/Set value of the resections.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
This class defines a resection container.
::fwCom::Signal< void() > ResectionAddedSignalType
Type of signal when a resection is added.
const ResectionContainerType & getResections() const
Get/Set value of the resections.
Base class for each data object.
Contains the representation of the data objects used in the framework.