fw4spl
include/fwData/Line.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 #include "fwData/Point.hpp"
13 
14 #include <utility>
15 #include <vector>
16 
17 fwCampAutoDeclareDataMacro((fwData)(Line), FWDATA_API);
18 
19 namespace fwData
20 {
24 class FWDATA_CLASS_API Line : public Object
25 {
26 
27 public:
29  (()), ::fwData::factory::New< Line >);
30 
35  FWDATA_API Line(::fwData::Object::Key key);
36 
38  FWDATA_API virtual ~Line();
39 
40  fwCampMakeFriendDataMacro((fwData)(Line));
41 
43  FWDATA_API void shallowCopy( const Object::csptr& _source ) override;
44 
46  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
47 
48  FWDATA_API void setValue(const ::fwData::Point::sptr& _position, const ::fwData::Point::sptr& _direction);
49 
53  ::fwData::Point::sptr& getPosition();
54  const ::fwData::Point::sptr& getPosition() const;
55  void setPosition(const ::fwData::Point::sptr& _position);
57 
61  ::fwData::Point::sptr& getDirection();
62  const ::fwData::Point::sptr& getDirection() const;
63  void setDirection (const ::fwData::Point::sptr& _direction);
65 
66 protected:
67 
69  ::fwData::Point::sptr m_position;
70  ::fwData::Point::sptr m_direction;
71 
72 }; // class Line
73 
74 //-----------------------------------------------------------------------------
75 
76 inline ::fwData::Point::sptr& Line::getPosition()
77 {
78  return this->m_position;
79 }
80 
81 //-----------------------------------------------------------------------------
82 
83 inline const ::fwData::Point::sptr& Line::getPosition() const
84 {
85  return this->m_position;
86 }
87 
88 //-----------------------------------------------------------------------------
89 
90 inline void Line::setPosition(const ::fwData::Point::sptr& _position)
91 {
92  this->m_position = _position;
93 }
94 
95 //-----------------------------------------------------------------------------
96 
97 inline ::fwData::Point::sptr& Line::getDirection()
98 {
99  return this->m_direction;
100 }
101 
102 //-----------------------------------------------------------------------------
103 
104 inline const ::fwData::Point::sptr& Line::getDirection() const
105 {
106  return this->m_direction;
107 }
108 
109 //-----------------------------------------------------------------------------
110 
111 inline void Line::setDirection (const ::fwData::Point::sptr& _direction)
112 {
113  this->m_direction = _direction;
114 }
115 
116 //-----------------------------------------------------------------------------
117 
118 } // namespace fwData
void setPosition(const ::fwData::Point::sptr &_position)
get/set point position
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
::fwData::Point::sptr m_position
Points container.
::fwData::Point::sptr & getDirection()
get/set point direction
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
::fwData::Point::sptr & getPosition()
get/set point position
void setDirection(const ::fwData::Point::sptr &_direction)
get/set point direction
Contains the representation of the data objects used in the framework.
This class defines a Line defined by two points.