fw4spl
Series1.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 <fwAtoms/String.hpp>
8 #include <fwAtoms/Object.hpp>
9 #include <fwAtoms/Sequence.hpp>
10 
11 #include <fwAtomsPatch/StructuralCreatorDB.hpp>
12 #include <fwAtomsPatch/helper/Object.hpp>
13 
14 #include "fwStructuralPatch/creator/fwMedData/Series1.hpp"
15 
16 namespace fwStructuralPatch
17 {
18 namespace creator
19 {
20 namespace fwMedData
21 {
22 
24 {
25  m_classname = "::fwMedData::Series";
26  m_version = "1";
27 }
28 
29 // ----------------------------------------------------------------------------
30 
32 {
33 }
34 
35 // ----------------------------------------------------------------------------
36 
38 {
39 }
40 
41 // ----------------------------------------------------------------------------
42 
43 ::fwAtoms::Object::sptr Series1::create()
44 {
45  ::fwAtoms::Object::sptr series = this->createObjBase();
46  ::fwAtomsPatch::helper::Object helper(series);
47 
48  ::fwAtomsPatch::StructuralCreatorDB::sptr creators = ::fwAtomsPatch::StructuralCreatorDB::getDefault();
49  helper.addAttribute("patient", creators->create( "::fwMedData::Patient", "1") );
50  helper.addAttribute("study", creators->create( "::fwMedData::Study", "1") );
51  helper.addAttribute("equipment", creators->create( "::fwMedData::Equipment", "1") );
52 
53  helper.addAttribute("instance_uid", ::fwAtoms::String::New(""));
54  helper.addAttribute("modality", ::fwAtoms::String::New(""));
55  helper.addAttribute("date", ::fwAtoms::String::New(""));
56  helper.addAttribute("time", ::fwAtoms::String::New(""));
57  helper.addAttribute("performing_physicians_name", ::fwAtoms::Sequence::New());
58  helper.addAttribute("description", ::fwAtoms::String::New(""));
59 
60  return series;
61 }
62 
63 } // namespace fwMedData
64 } // namespace creator
65 } // namespace fwStructuralPatch
virtual FWSTRUCTURALPATCH_API::fwAtoms::Object::sptr create() override
Creates the specified object.
Definition: Series1.cpp:43
Namespace containing medical data.
std::string m_version
Object version.
static FWATOMS_API String::sptr New(std::string value)
Construct a new Object represented a string.
Contains base functionalities used to transform objects from a version to another.
Definition: Abstract.hpp:16
FWSTRUCTURALPATCH_API Series1()
Constructor.
Definition: Series1.cpp:23
FWSTRUCTURALPATCH_API ~Series1()
Destructor.
Definition: Series1.cpp:31
Contains creators and structural patches.
Definition: Landmarks1.hpp:13
Structural creator for fwMedData::Series version 1.
Definition: Series1.hpp:21
FWATOMSPATCH_API::fwAtoms::Object::sptr createObjBase() const
Create the object base : create meta infos : classname, version and id.
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.
static StructuralCreatorDB::sptr getDefault()
Returns the default instance of StructuralCreatorDB.
FWATOMSPATCH_API IStructuralCreator()
Constructor.
std::string m_classname
Object classname.