fw4spl
include/fwData/StructureTraits.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/Color.hpp"
10 #include "fwData/factory/new.hpp"
11 #include "fwData/Object.hpp"
12 
13 fwCampAutoDeclareDataMacro((fwData)(StructureTraits), FWDATA_API);
14 
15 namespace fwData
16 {
29 class FWDATA_CLASS_API StructureTraits : public ::fwData::Object
30 {
31 public:
33  ::fwData::factory::New< StructureTraits >);
34  fwCampMakeFriendDataMacro((fwData)(StructureTraits));
35 
37  typedef enum
38  {
39  BODY,
40  HEAD,
41  NECK,
42  THORAX,
43  ABDOMEN,
44  PELVIS,
45  ARM,
46  LEG,
47  LIVER_SEGMENTS,
48  OTHER
49  }Category;
50 
51  typedef std::vector<Category> CategoryContainer;
52  typedef std::string ROIExpression;
53 
55  typedef enum
56  {
57  TOOL,
58  ENVIRONMENT,
59  VESSEL,
60  LESION,
61  ORGAN,
62  FUNCTIONAL,
63  NO_CONSTRAINT
65 
70  FWDATA_API StructureTraits(::fwData::Object::Key key);
71 
73  FWDATA_API virtual ~StructureTraits();
74 
79  std::string& getType ();
80  const std::string& getType () const;
81  void setType (const std::string& _type);
83 
88  CategoryContainer& getCategories ();
89  const CategoryContainer& getCategories () const;
90  void setCategories (const CategoryContainer& _categories);
92 
97  StructureClass& getClass ();
98  const StructureClass& getClass () const;
99  void setClass (const StructureClass& _class);
101 
106  ROIExpression& getNativeExp ();
107  const ROIExpression& getNativeExp () const;
108  void setNativeExp (const ROIExpression& _nativeExp);
110 
115  ROIExpression& getNativeGeometricExp ();
116  const ROIExpression& getNativeGeometricExp () const;
117  void setNativeGeometricExp (const ROIExpression& _nativeGeometricExp);
119 
124  std::string& getAttachmentType ();
125  const std::string& getAttachmentType () const;
126  void setAttachmentType (const std::string& _attachmentType);
128 
133  ::fwData::Color::sptr& getColor();
134  const ::fwData::Color::sptr& getColor() const;
135  void setColor (const ::fwData::Color::sptr& _color);
137 
142  std::string& getAnatomicRegion ();
143  const std::string& getAnatomicRegion () const;
144  void setAnatomicRegion (const std::string& _anatomicRegion);
146 
151  std::string& getPropertyCategory ();
152  const std::string& getPropertyCategory () const;
153  void setPropertyCategory (const std::string& _propertyCategory);
154 
156 
161  std::string& getPropertyType ();
162  const std::string& getPropertyType () const;
163  void setPropertyType (const std::string& _propertyType);
165 
167  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
168 
169 private:
170 
172  std::string m_type;
173 
175  CategoryContainer m_categories;
176 
178  ::fwData::Color::sptr m_color;
179 
181  StructureClass m_class;
182 
184  ROIExpression m_nativeExp;
185 
187  ROIExpression m_nativeGeometricExp;
188 
190  std::string m_attachmentType;
191 
193  std::string m_anatomicRegion;
194 
196  std::string m_propertyCategory;
197 
199  std::string m_propertyType;
200 };
201 
202 //-----------------------------------------------------------------------------
203 
204 inline std::string& StructureTraits::getType ()
205 {
206  return m_type;
207 }
208 
209 //-----------------------------------------------------------------------------
210 
211 inline const std::string& StructureTraits::getType () const
212 {
213  return m_type;
214 }
215 
216 //-----------------------------------------------------------------------------
217 
218 inline void StructureTraits::setType (const std::string& _type)
219 {
220  m_type = _type;
221 }
222 
223 //-----------------------------------------------------------------------------
224 
225 inline StructureTraits::CategoryContainer& StructureTraits::getCategories ()
226 {
227  return m_categories;
228 }
229 
230 //-----------------------------------------------------------------------------
231 
232 inline const StructureTraits::CategoryContainer& StructureTraits::getCategories () const
233 {
234  return m_categories;
235 }
236 
237 //-----------------------------------------------------------------------------
238 
239 inline void StructureTraits::setCategories (const StructureTraits::CategoryContainer& _categories)
240 {
241  m_categories = _categories;
242 }
243 
244 //-----------------------------------------------------------------------------
245 
247 {
248  return m_class;
249 }
250 
251 //-----------------------------------------------------------------------------
252 
254 {
255  return m_class;
256 }
257 
258 //-----------------------------------------------------------------------------
259 
261 {
262  m_class = _class;
263 }
264 
265 //-----------------------------------------------------------------------------
266 
267 inline StructureTraits::ROIExpression& StructureTraits::getNativeExp ()
268 {
269  return m_nativeExp;
270 }
271 
272 //-----------------------------------------------------------------------------
273 
274 inline const StructureTraits::ROIExpression& StructureTraits::getNativeExp () const
275 {
276  return m_nativeExp;
277 }
278 
279 //-----------------------------------------------------------------------------
280 
281 inline void StructureTraits::setNativeExp (const StructureTraits::ROIExpression& _nativeExp)
282 {
283  m_nativeExp = _nativeExp;
284 }
285 
286 //-----------------------------------------------------------------------------
287 
288 inline StructureTraits::ROIExpression& StructureTraits::getNativeGeometricExp ()
289 {
290  return m_nativeGeometricExp;
291 }
292 
293 //-----------------------------------------------------------------------------
294 
295 inline const StructureTraits::ROIExpression& StructureTraits::getNativeGeometricExp () const
296 {
297  return m_nativeGeometricExp;
298 }
299 
300 //-----------------------------------------------------------------------------
301 
302 inline void StructureTraits::setNativeGeometricExp (const StructureTraits::ROIExpression& _nativeGeometricExp)
303 {
304  m_nativeGeometricExp = _nativeGeometricExp;
305 }
306 
307 //-----------------------------------------------------------------------------
308 
310 {
311  return m_attachmentType;
312 }
313 
314 //-----------------------------------------------------------------------------
315 
316 inline const std::string& StructureTraits::getAttachmentType () const
317 {
318  return m_attachmentType;
319 }
320 
321 //-----------------------------------------------------------------------------
322 
323 inline void StructureTraits::setAttachmentType (const std::string& _attachmentType)
324 {
325  m_attachmentType = _attachmentType;
326 }
327 
328 //-----------------------------------------------------------------------------
329 
330 inline ::fwData::Color::sptr& StructureTraits::getColor()
331 {
332  return m_color;
333 }
334 
335 //-----------------------------------------------------------------------------
336 
337 inline const ::fwData::Color::sptr& StructureTraits::getColor() const
338 {
339  return m_color;
340 }
341 
342 //-----------------------------------------------------------------------------
343 
344 inline void StructureTraits::setColor (const ::fwData::Color::sptr& _color)
345 {
346  m_color = _color;
347 }
348 
349 //-----------------------------------------------------------------------------
350 
352 {
353  return m_anatomicRegion;
354 }
355 
356 //-----------------------------------------------------------------------------
357 
358 inline const std::string& StructureTraits::getAnatomicRegion () const
359 {
360  return m_anatomicRegion;
361 }
362 
363 //-----------------------------------------------------------------------------
364 
365 inline void StructureTraits::setAnatomicRegion (const std::string& _anatomicRegion)
366 {
367  m_anatomicRegion = _anatomicRegion;
368 }
369 
370 //-----------------------------------------------------------------------------
371 
373 {
374  return m_propertyCategory;
375 }
376 
377 //-----------------------------------------------------------------------------
378 
379 inline const std::string& StructureTraits::getPropertyCategory () const
380 {
381  return m_propertyCategory;
382 }
383 
384 //-----------------------------------------------------------------------------
385 
386 inline void StructureTraits::setPropertyCategory (const std::string& _propertyCategory)
387 {
388  m_propertyCategory = _propertyCategory;
389 }
390 
391 //-----------------------------------------------------------------------------
392 
393 inline std::string& StructureTraits::getPropertyType ()
394 {
395  return m_propertyType;
396 }
397 
398 //-----------------------------------------------------------------------------
399 
400 inline const std::string& StructureTraits::getPropertyType () const
401 {
402  return m_propertyType;
403 }
404 
405 //-----------------------------------------------------------------------------
406 
407 inline void StructureTraits::setPropertyType (const std::string& _propertyType)
408 {
409  m_propertyType = _propertyType;
410 }
411 
412 //-----------------------------------------------------------------------------
413 
414 } // namespace fwData
std::string & getAnatomicRegion()
Get/Set value of the anatomicRegion.
StructureClass & getClass()
Get/Set value of the class.
Category
Defines structure categories.
ROIExpression & getNativeGeometricExp()
Get/Set value of the nativeGeometricExp.
void setClass(const StructureClass &_class)
Get/Set value of the class.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
StructureClass
Defines structure class.
CategoryContainer & getCategories()
Get/Set value of the categories.
ROIExpression & getNativeExp()
Get/Set value of the nativeExp.
void setNativeExp(const ROIExpression &_nativeExp)
Get/Set value of the nativeExp.
std::string & getAttachmentType()
Get/Set value of the attachmentType.
void setAnatomicRegion(const std::string &_anatomicRegion)
Get/Set value of the anatomicRegion.
void setType(const std::string &_type)
Get/Set value of the structure type.
void setCategories(const CategoryContainer &_categories)
Get/Set value of the categories.
std::string & getType()
Get/Set value of the structure type.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
std::string & getPropertyType()
Get/Set value of the propertyType.
::fwData::Color::sptr & getColor()
Get/Set value of the color.
std::string & getPropertyCategory()
Get/Set value of the propertyCategory.
Base class for each data object.
void setNativeGeometricExp(const ROIExpression &_nativeGeometricExp)
Get/Set value of the nativeGeometricExp.
void setColor(const ::fwData::Color::sptr &_color)
Get/Set value of the color.
void setAttachmentType(const std::string &_attachmentType)
Get/Set value of the attachmentType.
Contains the representation of the data objects used in the framework.
This class defines structure traits.
void setPropertyCategory(const std::string &_propertyCategory)
Get/Set value of the propertyCategory.
void setPropertyType(const std::string &_propertyType)
Get/Set value of the propertyType.