fw4spl
Plane.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/Point.hpp"
12 
13 #include <fwCom/Signal.hpp>
14 #include <fwCom/Signals.hpp>
15 
16 #include <vector>
17 
18 fwCampAutoDeclareDataMacro((fwData)(Plane), FWDATA_API);
19 namespace fwData
20 {
25 class FWDATA_CLASS_API Plane : public Object
26 {
27 
28 public:
29  fwCoreClassDefinitionsWithFactoryMacro( (Plane)(::fwData::Object), (()), ::fwData::factory::New< Plane >);
30 
31  fwCampMakeFriendDataMacro((fwData)(Plane));
32 
33  typedef std::array< ::fwData::Point::sptr, 3> PointContainer;
34 
39  FWDATA_API Plane(::fwData::Object::Key key);
40 
42  FWDATA_API virtual ~Plane();
43 
45  FWDATA_API void shallowCopy( const Object::csptr& _source ) override;
46 
48  FWDATA_API void cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache) override;
49 
51  FWDATA_API void setValue(::fwData::Point::sptr _point1, ::fwData::Point::sptr _point2,
52  ::fwData::Point::sptr _point3);
53 
57  PointContainer& getPoints();
58  const PointContainer& getPoints() const;
59  void setPoints(const PointContainer& _vPoints);
61 
65  bool getIsIntersection () const;
66  void setIsIntersection(bool _isIntersection);
68 
73  typedef ::fwCom::Signal< void (bool) > SelectedSignalType;
75  FWDATA_API static const ::fwCom::Signals::SignalKeyType s_SELECTED_SIG;
80 protected:
81 
83  PointContainer m_vPoints;
84 
87 
88 }; // end class Plane
89 
90 //-----------------------------------------------------------------------------
91 
92 inline Plane::PointContainer& Plane::getPoints()
93 {
94  return this->m_vPoints;
95 }
96 
97 //-----------------------------------------------------------------------------
98 
99 inline const Plane::PointContainer& Plane::getPoints() const
100 {
101  return this->m_vPoints;
102 }
103 
104 //-----------------------------------------------------------------------------
105 
106 inline void Plane::setPoints(const Plane::PointContainer& _vPoints)
107 {
108  this->m_vPoints = _vPoints;
109 }
110 
111 //-----------------------------------------------------------------------------
112 
113 inline bool Plane::getIsIntersection () const
114 {
115  return m_isIntersection;
116 }
117 
118 //-----------------------------------------------------------------------------
119 
120 inline void Plane::setIsIntersection(bool _isIntersection)
121 {
122  this->m_isIntersection = _isIntersection;
123 }
124 
125 //-----------------------------------------------------------------------------
126 
127 } // end namespace fwData
void setPoints(const PointContainer &_vPoints)
get/set points container
Definition: Plane.hpp:106
This class defines a plane defined by tree points.
Definition: Plane.hpp:25
PointContainer m_vPoints
Points container.
Definition: Plane.hpp:83
bool m_isIntersection
flag if the plane is an intersection (else an union)
Definition: Plane.hpp:86
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
void setIsIntersection(bool _isIntersection)
get/set flag if the plane is an intersection one (else an union one)
Definition: Plane.hpp:120
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
Base class for each data object.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_SELECTED_SIG
Signal emitted when plane is selected/deselected.
Definition: Plane.hpp:75
Contains the representation of the data objects used in the framework.
bool getIsIntersection() const
get/set flag if the plane is an intersection one (else an union one)
Definition: Plane.hpp:113
PointContainer & getPoints()
get/set points container
Definition: Plane.hpp:92