fw4spl
include/fwData/ROITraits.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/factory/new.hpp"
10 #include "fwData/Node.hpp"
11 #include "fwData/StructureTraits.hpp"
12 
13 fwCampAutoDeclareDataMacro((fwData)(ROITraits), FWDATA_API);
14 
15 namespace fwData
16 {
30 class FWDATA_CLASS_API ROITraits : public ::fwData::Object
31 {
32 public:
33  fwCoreClassDefinitionsWithFactoryMacro( (ROITraits)(::fwData::Object), (()), ::fwData::factory::New< ROITraits >);
34  fwCampMakeFriendDataMacro((fwData)(ROITraits));
35 
40  FWDATA_API ROITraits(::fwData::Object::Key key);
41 
45  FWDATA_API virtual ~ROITraits();
46 
51  std::string& getIdentifier();
52  const std::string& getIdentifier() const;
53  void setIdentifier(const std::string& _identifier);
55 
60  StructureTraits::ROIExpression& getEvaluatedExp ();
61  const StructureTraits::ROIExpression& getEvaluatedExp () const;
62  void setEvaluatedExp (const StructureTraits::ROIExpression& _evaluatedExp);
64 
66  FWDATA_API void setMaskOpNode(const ::fwData::Node::sptr& maskOpNode );
67 
69  // "W" ( W <=> World <=> no roi constraint ).
70  FWDATA_API ::fwData::Node::sptr getMaskOpNode();
71 
73  FWDATA_API void setStructureTraits(const ::fwData::StructureTraits::sptr& structureTraits );
74 
76  FWDATA_API ::fwData::StructureTraits::sptr getStructureTraits();
77 
79  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
80 
81 private:
82 
84  std::string m_identifier;
85 
87  ::fwData::Node::sptr m_maskOpNode;
88 
90  ::fwData::StructureTraits::sptr m_structureTraits;
91 
93  StructureTraits::ROIExpression m_evaluatedExp;
94 };
95 
96 //-----------------------------------------------------------------------------
97 
98 inline std::string& ROITraits::getIdentifier()
99 {
100  return m_identifier;
101 }
102 
103 //-----------------------------------------------------------------------------
104 
105 inline const std::string& ROITraits::getIdentifier() const
106 {
107  return m_identifier;
108 }
109 
110 //-----------------------------------------------------------------------------
111 
112 inline void ROITraits::setIdentifier(const std::string& _identifier)
113 {
114  m_identifier = _identifier;
115 }
116 
117 //-----------------------------------------------------------------------------
118 
119 inline StructureTraits::ROIExpression& ROITraits::getEvaluatedExp ()
120 {
121  return m_evaluatedExp;
122 }
123 
124 //-----------------------------------------------------------------------------
125 
126 inline const StructureTraits::ROIExpression& ROITraits::getEvaluatedExp () const
127 {
128  return m_evaluatedExp;
129 }
130 
131 //-----------------------------------------------------------------------------
132 
133 inline void ROITraits::setEvaluatedExp (const StructureTraits::ROIExpression& _evaluatedExp)
134 {
135  m_evaluatedExp = _evaluatedExp;
136 }
137 
138 //-----------------------------------------------------------------------------
139 
140 } // namespace fwData
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
void setEvaluatedExp(const StructureTraits::ROIExpression &_evaluatedExp)
Get/Set value of the ROI evaluated expression.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
StructureTraits::ROIExpression & getEvaluatedExp()
Get/Set value of the ROI evaluated expression.
Contains the representation of the data objects used in the framework.
This class defines ROI traits.
void setIdentifier(const std::string &_identifier)
Get/Set value of the ROIs identifier.
std::string & getIdentifier()
Get/Set value of the ROIs identifier.