fw4spl
include/fwData/Reconstruction.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/config.hpp"
10 #include "fwData/factory/new.hpp"
11 #include "fwData/Object.hpp"
12 
13 #include <fwCom/Signal.hpp>
14 #include <fwCom/Signals.hpp>
15 
16 fwCampAutoDeclareDataMacro((fwData)(Reconstruction), FWDATA_API);
17 
18 namespace fwData
19 {
20 
21 class Image;
22 class Material;
23 class Mesh;
24 
30 class FWDATA_CLASS_API Reconstruction : public Object
31 {
32 public:
34  ::fwData::factory::New< Reconstruction >);
35 
37 
38 
42  FWDATA_API Reconstruction(::fwData::Object::Key key);
43 
45  FWDATA_API virtual ~Reconstruction();
46 
47  fwCampMakeFriendDataMacro((fwData)(Reconstruction));
48 
50  FWDATA_API void shallowCopy( const Object::csptr& _source ) override;
51 
53  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
54 
56  FWDATA_API static const double s_NO_COMPUTED_MASK_VOLUME;
57 
62  bool getIsVisible () const;
63  void setIsVisible (const bool _bIsVisible);
65 
70  std::string& getOrganName ();
71  const std::string& getOrganName () const;
72  void setOrganName (const std::string& _sOrganName);
74 
79  std::string& getStructureType ();
80  const std::string& getStructureType () const;
81  void setStructureType (const std::string& _sStructureType);
83 
87  SPTR(::fwData::Image) getImage() const;
88  void setImage (const SPTR(::fwData::Image)& val);
89 
93  SPTR(::fwData::Mesh) getMesh() const;
94  void setMesh(const SPTR(::fwData::Mesh)& val);
96 
100  SPTR(::fwData::Material) getMaterial() const;
101  void setMaterial (const SPTR(::fwData::Material)& val);
103 
107  double getComputedMaskVolume () const;
108  void setComputedMaskVolume (double val);
110 
111  /***
112  * @name Signals
113  * @{
114  */
115 
117  typedef ::fwCom::Signal< void (SPTR( ::fwData::Mesh ) ) > MeshChangedSignalType;
118 
120  FWDATA_API static const ::fwCom::Signals::SignalKeyType s_MESH_CHANGED_SIG;
121 
123  typedef ::fwCom::Signal< void (bool) > VisibilityModifiedSignalType;
124 
126  FWDATA_API static const ::fwCom::Signals::SignalKeyType s_VISIBILITY_MODIFIED_SIG;
131 protected:
132 
134  bool m_bIsVisible;
135 
137  std::string m_sOrganName;
138 
140  std::string m_sStructureType;
141 
142  //--------------------------------------------------------------------------
143 
145  SPTR(::fwData::Material) m_material;
146 
148  SPTR(::fwData::Image) m_image;
149 
151  SPTR(::fwData::Mesh) m_mesh;
152 
154  double m_computedMaskVolume;
155 
161  MeshChangedSignalType::sptr m_sigMeshChanged;
163 
165  VisibilityModifiedSignalType::sptr m_sigVisibilityModified;
170 };
171 
172 //-----------------------------------------------------------------------------
173 
174 inline bool Reconstruction::getIsVisible () const
175 {
176  return m_bIsVisible;
177 }
178 
179 //-----------------------------------------------------------------------------
180 
181 inline void Reconstruction::setIsVisible (const bool _bIsVisible)
182 {
183  m_bIsVisible = _bIsVisible;
184 }
185 
186 //-----------------------------------------------------------------------------
187 
188 inline std::string& Reconstruction::getOrganName ()
189 {
190  return m_sOrganName;
191 }
192 
193 //-----------------------------------------------------------------------------
194 
195 inline const std::string& Reconstruction::getOrganName () const
196 {
197  return m_sOrganName;
198 }
199 
200 //-----------------------------------------------------------------------------
201 
202 inline void Reconstruction::setOrganName (const std::string& _sOrganName)
203 {
204  m_sOrganName = _sOrganName;
205 }
206 
207 //-----------------------------------------------------------------------------
208 
209 inline std::string& Reconstruction::getStructureType ()
210 {
211  return this->m_sStructureType;
212 }
213 
214 //-----------------------------------------------------------------------------
215 
216 inline const std::string& Reconstruction::getStructureType () const
217 {
218  return this->m_sStructureType;
219 }
220 
221 //-----------------------------------------------------------------------------
222 
223 inline void Reconstruction::setStructureType (const std::string& _sStructureType)
224 {
225  this->m_sStructureType = _sStructureType;
226 }
227 
228 //-----------------------------------------------------------------------------
229 
230 inline SPTR(::fwData::Image) Reconstruction::getImage() const
231 {
232  return m_image;
233 }
234 
235 //-----------------------------------------------------------------------------
236 
237 inline void Reconstruction::setImage (const SPTR(::fwData::Image)& val)
238 {
239  m_image = val;
240 }
241 
242 //-----------------------------------------------------------------------------
243 
244 inline SPTR(::fwData::Mesh) Reconstruction::getMesh() const
245 {
246  return m_mesh;
247 }
248 
249 //-----------------------------------------------------------------------------
250 
251 inline void Reconstruction::setMesh(const SPTR(::fwData::Mesh)& val)
252 {
253  m_mesh = val;
254 }
255 
256 //-----------------------------------------------------------------------------
257 
258 inline SPTR(::fwData::Material) Reconstruction::getMaterial() const
259 {
260  return m_material;
261 }
262 
263 //-----------------------------------------------------------------------------
264 
265 inline void Reconstruction::setMaterial (const SPTR(::fwData::Material)& val)
266 {
267  m_material = val;
268 }
269 
270 //-----------------------------------------------------------------------------
271 
273 {
274  return m_computedMaskVolume;
275 }
276 
277 //-----------------------------------------------------------------------------
278 
279 inline void Reconstruction::setComputedMaskVolume (double val)
280 {
281  m_computedMaskVolume = val;
282 }
283 
284 //-----------------------------------------------------------------------------
285 
286 } // namespace fwData
#define SPTR(_cls_)
std::string & getStructureType()
Get/Set value of the structureType.
This class defines a reconstruction object.
void setIsVisible(const bool _bIsVisible)
Get/Set value of the bIsVisible.
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
This class defines a material. A material is represented by an ambient color and a diffuse color...
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
STL namespace.
void setStructureType(const std::string &_sStructureType)
Get/Set value of the structureType.
double getComputedMaskVolume() const
Get/Set the volume from mask.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
Contains the representation of the data objects used in the framework.
void setOrganName(const std::string &_sOrganName)
Get/Set value of the organName.
This class defines an image.
std::string & getOrganName()
Get/Set value of the organName.
Data holding a geometric structure composed of points, lines, triangles, quads or polygons...