fw4spl
fwMedData/ModelSeries/V1ToV2.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 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 #include "fwStructuralPatch/fwMedData/ModelSeries/V1ToV2.hpp"
8 
9 #include <fwAtoms/Object.hpp>
10 #include <fwAtoms/Object.hxx>
11 
12 namespace fwStructuralPatch
13 {
14 namespace fwMedData
15 {
16 namespace ModelSeries
17 {
18 
20  ::fwAtomsPatch::IStructuralPatch()
21 {
22  m_originClassname = "::fwMedData::ModelSeries";
23  m_targetClassname = "::fwMedData::ModelSeries";
24  m_originVersion = "1";
25  m_targetVersion = "2";
26 }
27 
28 // ----------------------------------------------------------------------------
29 
31 {
32 }
33 
34 // ----------------------------------------------------------------------------
35 
36 V1ToV2::V1ToV2( const V1ToV2& cpy ) :
38 {
39 }
40 
41 // ----------------------------------------------------------------------------
42 
43 void V1ToV2::apply( const ::fwAtoms::Object::sptr& previous,
44  const ::fwAtoms::Object::sptr& current,
45  ::fwAtomsPatch::IPatch::NewVersionsType& newVersions)
46 {
47  IStructuralPatch::apply(previous, current, newVersions);
48 
49  // Update object version
50  this->updateVersion(current);
51 
52  ::fwAtomsPatch::helper::Object helper(current);
53  helper.addAttribute("dicom_reference", ::fwAtoms::Object::sptr());
54 }
55 
56 } // namespace ModelSeries
57 } // namespace fwMedData
58 } // namespace fwStructuralPatch
virtual FWSTRUCTURALPATCH_API void apply(const ::fwAtoms::Object::sptr &previous, const ::fwAtoms::Object::sptr &current,::fwAtomsPatch::IPatch::NewVersionsType &newVersions) override
Applies patch.
Namespace containing medical data.
FWATOMSPATCH_API void updateVersion(std::shared_ptr< ::fwAtoms::Object > current)
Updates the version of the patched object.
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
std::string m_targetClassname
Target type.
FWATOMSPATCH_API IStructuralPatch()
Constructor.
std::string m_originClassname
Origin classname of the object.
Definition: IPatch.hpp:64
Contains creators and structural patches.
Definition: Landmarks1.hpp:13
std::string m_originVersion
Origin version of the object.
Definition: IPatch.hpp:67
Structural patch to convert a fwMedData::ModelSeries from version &#39;1&#39; to version &#39;2&#39;.
FWATOMSPATCH_API void addAttribute(const std::string &name,::fwAtoms::Base::sptr value, conditions::Abstract::sptr condition=conditions::Abstract::New())
Adds a new attribute in the current object.
std::string m_targetVersion
Target version.