fw4spl
core/fwMedData/src/fwMedData/Series.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
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 #include "fwMedData/Equipment.hpp"
8 #include "fwMedData/Patient.hpp"
9 #include "fwMedData/Series.hpp"
10 #include "fwMedData/Study.hpp"
11 
12 #include <fwData/Exception.hpp>
13 #include <fwData/registry/macros.hpp>
14 
15 namespace fwMedData
16 {
17 
19  m_patient(::fwMedData::Patient::New()),
20  m_study(::fwMedData::Study::New()),
21  m_equipment(::fwMedData::Equipment::New())
22 {
23 }
24 
25 //------------------------------------------------------------------------------
26 
28 {
29 }
30 
31 //------------------------------------------------------------------------------
32 
33 void Series::shallowCopy(const ::fwData::Object::csptr &_source)
34 {
35  Series::csptr other = Series::dynamicConstCast(_source);
36  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
37  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
38  + " to " + this->getClassname()), !bool(other) );
39 
40  this->fieldShallowCopy( other );
41 
42  m_patient = other->m_patient;
43  m_study = other->m_study;
44  m_equipment = other->m_equipment;
45 
46  m_instanceUID = other->m_instanceUID;
47  m_modality = other->m_modality;
48  m_date = other->m_date;
49  m_time = other->m_time;
50  m_performingPhysiciansName = other->m_performingPhysiciansName;
51  m_description = other->m_description;
52 }
53 
54 //------------------------------------------------------------------------------
55 
56 void Series::cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache)
57 {
58  Series::csptr other = Series::dynamicConstCast(_source);
59  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
60  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
61  + " to " + this->getClassname()), !bool(other) );
62 
63  this->fieldDeepCopy( other, cache );
64 
65  m_patient = ::fwData::Object::copy(other->m_patient, cache);
66  m_study = ::fwData::Object::copy(other->m_study, cache);
67  m_equipment = ::fwData::Object::copy(other->m_equipment, cache);
68 
69  m_instanceUID = other->m_instanceUID;
70  m_modality = other->m_modality;
71  m_date = other->m_date;
72  m_time = other->m_time;
73  m_performingPhysiciansName = other->m_performingPhysiciansName;
74  m_description = other->m_description;
75 }
76 
77 //------------------------------------------------------------------------------
78 
79 } // namespace fwMedData
80 
DicomValueType m_description
Description.
std::shared_ptr< Patient > m_patient
Referring Patient.
Namespace containing medical data.
FWMEDDATA_API Series(::fwData::Object::Key key)
Constructor.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
std::shared_ptr< Equipment > m_equipment
Related Equipment.
Implements data exception class.
FWMEDDATA_API void cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
std::shared_ptr< Study > m_study
Referring Study.
virtual const std::string & getClassname() const override
return full object&#39;s classname with its namespace, i.e. fwCore::BaseObject
DicomValueType m_instanceUID
Series unique identifier.
DicomValuesType m_performingPhysiciansName
Performing physicians name.
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
static FWDATA_API::fwData::Object::sptr copy(const ::fwData::Object::csptr &source)
return a copy of the source. if source is a null pointer, return a null pointer.
virtual FWMEDDATA_API ~Series()
Destructor.
FWDATA_API void fieldShallowCopy(const ::fwData::Object::csptr &source)
A shallow copy of fields (objects in m_children)
FWMEDDATA_API void shallowCopy(const ::fwData::Object::csptr &_source) override
Defines shallow copy.