fw4spl
src/fwData/ReconstructionTraits.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 "fwData/ReconstructionTraits.hpp"
8 #include "fwData/Exception.hpp"
9 #include "fwData/registry/macros.hpp"
10 
11 #include <fwCore/base.hpp>
12 
13 fwDataRegisterMacro( ::fwData::ReconstructionTraits );
14 
15 namespace fwData
16 {
17 
18 //------------------------------------------------------------------------------
19 
20 void ReconstructionTraits::setMaskOpNode(const ::fwData::Node::sptr& maskOpNode )
21 {
22  m_maskOpNode = maskOpNode;
23 }
24 
25 //------------------------------------------------------------------------------
26 
28 {
29 
30  return m_maskOpNode;
31 }
32 
33 //------------------------------------------------------------------------------
34 
35 void ReconstructionTraits::setMeshOpNode(const ::fwData::Node::sptr& meshOpNode )
36 {
37  m_meshOpNode = meshOpNode;
38 }
39 
40 //------------------------------------------------------------------------------
41 
43 {
44  return m_meshOpNode;
45 }
46 
47 //------------------------------------------------------------------------------
48 
49 void ReconstructionTraits::setStructureTraits(const ::fwData::StructureTraits::sptr& structureTraits )
50 {
51  m_structureTraits = structureTraits;
52 }
53 
54 //------------------------------------------------------------------------------
55 
56 ::fwData::StructureTraits::sptr ReconstructionTraits::getStructureTraits()
57 {
58  return m_structureTraits;
59 }
60 
61 //------------------------------------------------------------------------------
62 
64 {
65 }
66 
67 
68 //------------------------------------------------------------------------------
69 
71 {
72 }
73 
74 //------------------------------------------------------------------------------
75 
76 void ReconstructionTraits::cachedDeepCopy(const Object::csptr &source, DeepCopyCacheType &cache)
77 {
78  ReconstructionTraits::csptr other = ReconstructionTraits::dynamicConstCast(source);
79  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
80  "Unable to copy" + (source ? source->getClassname() : std::string("<NULL>"))
81  + " to " + this->getClassname()), !bool(other) );
82  this->fieldDeepCopy( source, cache );
83 
84  SLM_FATAL("Not implemented." );
85 }
86 
87 } // namespace fwData
88 
89 
This class defines Reconstruction traits.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Implements data exception class.
FWDATA_API ReconstructionTraits(::fwData::Object::Key key)
Constructor.
FWDATA_API::fwData::Node::sptr getMaskOpNode()
Get the reconstruction operator mask node. Return a null pointer if the mask node is not defined...
FWDATA_API void setMeshOpNode(const ::fwData::Node::sptr &meshOpNode)
Set the reconstruction operator mesh node.
virtual const std::string & getClassname() const override
return full object&#39;s classname with its namespace, i.e. fwCore::BaseObject
FWDATA_API void setMaskOpNode(const ::fwData::Node::sptr &maskOpNode)
Set the reconstruction operator mask node.
#define SLM_FATAL(message)
Definition: spyLog.hpp:283
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
virtual FWDATA_API ~ReconstructionTraits()
destructor
FWDATA_API::fwData::Node::sptr getMeshOpNode()
Get the reconstruction operator mesh node. Return a null pointer if the mesh node is not defined...
FWDATA_API void setStructureTraits(const ::fwData::StructureTraits::sptr &structureTraits)
Set the associated structure traits.
Contains the representation of the data objects used in the framework.
FWDATA_API void cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
FWDATA_API::fwData::StructureTraits::sptr getStructureTraits()
Get the associated structure traits.