SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DPoint3d.hpp
Go to the documentation of this file.
1 /*
2  * Copyright(c):
3  * Signal Image and Communications (SIC) Department
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * - University of Poitiers, France http://www.univ-poitiers.fr
6  * - XLIM Institute UMR CNRS 7252 http://www.xlim.fr/
7  *
8  * and
9  *
10  * D2 Fluid, Thermic and Combustion
11  * - University of Poitiers, France http://www.univ-poitiers.fr
12  * - PPRIME Institute - UPR CNRS 3346 http://www.pprime.fr
13  * - ISAE-ENSMA http://www.ensma.fr
14  *
15  * Contributor(s):
16  * The SLIP team,
17  * Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>,
18  * Laurent David <laurent.david_AT_lea.univ-poitiers.fr>,
19  * Ludovic Chatellier <ludovic.chatellier_AT_univ-poitiers.fr>,
20  * Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>,
21  * Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>,
22  * Julien Dombre <julien.dombre_AT_univ-poitiers.fr>.
23  *
24  * Description:
25  * The Simple Library of Image Processing (SLIP) is a new image processing
26  * library. It is written in the C++ language following as much as possible
27  * the ISO/ANSI C++ standard. It is consequently compatible with any system
28  * satisfying the ANSI C++ complience. It works on different Unix , Linux ,
29  * Mircrosoft Windows and Mac OS X plateforms. SLIP is a research library that
30  * was created by the Signal, Image and Communications (SIC) departement of
31  * the XLIM, UMR 7252 CNRS Institute in collaboration with the Fluids, Thermic
32  * and Combustion departement of the P', UPR 3346 CNRS Institute of the
33  * University of Poitiers.
34  *
35  * The SLIP Library source code has been registered to the APP (French Agency
36  * for the Protection of Programs) by the University of Poitiers and CNRS,
37  * under registration number IDDN.FR.001.300034.000.S.P.2010.000.21000.
38 
39  * http://www.sic.sp2mi.univ-poitiers.fr/slip/
40  *
41  * This software is governed by the CeCILL-C license under French law and
42  * abiding by the rules of distribution of free software. You can use,
43  * modify and/ or redistribute the software under the terms of the CeCILL-C
44  * license as circulated by CEA, CNRS and INRIA at the following URL
45  * http://www.cecill.info.
46  * As a counterpart to the access to the source code and rights to copy,
47  * modify and redistribute granted by the license, users are provided only
48  * with a limited warranty and the software's author, the holder of the
49  * economic rights, and the successive licensors have only limited
50  * liability.
51  *
52  * In this respect, the user's attention is drawn to the risks associated
53  * with loading, using, modifying and/or developing or reproducing the
54  * software by the user in light of its specific status of free software,
55  * that may mean that it is complicated to manipulate, and that also
56  * therefore means that it is reserved for developers and experienced
57  * professionals having in-depth computer knowledge. Users are therefore
58  * encouraged to load and test the software's suitability as regards their
59  * requirements in conditions enabling the security of their systems and/or
60  * data to be ensured and, more generally, to use and operate it in the
61  * same conditions as regards security.
62  *
63  * The fact that you are presently reading this means that you have had
64  * knowledge of the CeCILL-C license and that you accept its terms.
65  */
66 
67 
74 #ifndef SLIP_DPOINT3D_HPP
75 #define SLIP_DPOINT3D_HPP
76 
77 #include <iostream>
78 #include <cassert>
79 #include <string>
80 #include "DPoint.hpp"
81 
82 #include <boost/serialization/access.hpp>
83 #include <boost/serialization/split_member.hpp>
84 #include <boost/serialization/version.hpp>
85 
86 namespace slip
87 {
99 template <typename CoordType>
100 class DPoint3d:public DPoint<CoordType,3>
101 {
102 public :
103  typedef DPoint3d<CoordType> self;
105 
110 
114  DPoint3d();
115 
120  DPoint3d(const CoordType* array);
121 
122 
129  DPoint3d(const CoordType& dx1,
130  const CoordType& dx2,
131  const CoordType& dx3);
132 
143  void dx1(const CoordType& dx);
148  CoordType& dx1();
153  const CoordType& dx1() const;
158  void dx2(const CoordType& dx);
163  CoordType& dx2();
168  const CoordType& dx2() const;
173  void dx3(const CoordType& dx);
178  CoordType& dx3();
183  const CoordType& dx3() const;
184 
192  void set_coord(const CoordType& dx1,
193  const CoordType& dx2,
194  const CoordType& dx3);
201  std::string name() const;
202  private:
204  template<class Archive>
205  void save(Archive & ar, const unsigned int version) const
206  {
207  ar & boost::serialization::base_object<slip::DPoint<CoordType,3> >(*this);
208  }
209  template<class Archive>
210  void load(Archive & ar, const unsigned int version)
211  {
212  ar & boost::serialization::base_object<slip::DPoint<CoordType,3> >(*this);
213  }
214  BOOST_SERIALIZATION_SPLIT_MEMBER()
215 };
216 }//slip::
217 
218 namespace slip
219 {
220  template<typename CoordType>
221  inline
223  {
224  this->coord_[0] = CoordType(0);
225  this->coord_[1] = CoordType(0);
226  this->coord_[2] = CoordType(0);
227  }
228 
229  template<typename CoordType>
230  inline
231  DPoint3d<CoordType>::DPoint3d(const CoordType* array):
232  DPoint<CoordType,3>(array)
233  {}
234 
235 
236  template<typename CoordType>
237  inline
238  DPoint3d<CoordType>::DPoint3d(const CoordType& dx1,
239  const CoordType& dx2,
240  const CoordType& dx3)
241  {
242  this->coord_[0] = CoordType(dx1);
243  this->coord_[1] = CoordType(dx2);
244  this->coord_[2] = CoordType(dx3);
245  }
246 
247  template<typename CoordType>
248  inline
249  void DPoint3d<CoordType>::dx1(const CoordType& dx) {this->coord_[0]=dx;}
250 
251  template<typename CoordType>
252  inline
253  CoordType& DPoint3d<CoordType>::dx1() {return this->coord_[0];}
254 
255  template<typename CoordType>
256  inline
257  const CoordType& DPoint3d<CoordType>::dx1() const {return this->coord_[0];}
258 
259  template<typename CoordType>
260  inline
261  void DPoint3d<CoordType>::dx2(const CoordType& dx) {this->coord_[1]=dx;}
262 
263  template<typename CoordType>
264  inline
265  CoordType& DPoint3d<CoordType>::dx2() {return this->coord_[1];}
266 
267  template<typename CoordType>
268  inline
269  const CoordType& DPoint3d<CoordType>::dx2() const {return this->coord_[1];}
270 
271  template<typename CoordType>
272  inline
273  void DPoint3d<CoordType>::dx3(const CoordType& dx) {this->coord_[2]=dx;}
274 
275  template<typename CoordType>
276  inline
277  CoordType& DPoint3d<CoordType>::dx3() {return this->coord_[2];}
278 
279  template<typename CoordType>
280  inline
281  const CoordType& DPoint3d<CoordType>::dx3() const {return this->coord_[2];}
282 
283 
284  template<typename CoordType>
285  inline
286  void DPoint3d<CoordType>::set_coord(const CoordType& dx1,
287  const CoordType& dx2,
288  const CoordType& dx3)
289  {
290  this->coord_[0] = dx1;
291  this->coord_[1] = dx2;
292  this->coord_[2] = dx3;
293  }
294 
295 
296  template<typename CoordType>
297  inline
298  std::string
299  DPoint3d<CoordType>::name() const {return "DPoint3d";}
300 
301 }//slip::
302 
303 #endif //SLIP_DPOINT3D_HPP
void set_coord(const CoordType &dx1, const CoordType &dx2, const CoordType &dx3)
Accessor/Mutator of the coordinates of DPoint3d.
Definition: DPoint3d.hpp:286
Difference of Point3D class, specialization of DPoint<CoordType,DIM> with DIM = 3.
CoordType & dx1()
Accessor/Mutator of the first coordinate of DPoint3d.
Definition: DPoint3d.hpp:253
DPoint< CoordType, 3 > base
Definition: DPoint3d.hpp:104
std::string name() const
Returns the name of the class.
Definition: DPoint3d.hpp:299
friend class boost::serialization::access
Definition: DPoint3d.hpp:203
DPoint3d()
Constructs a DPoint3d.
Definition: DPoint3d.hpp:222
CoordType & dx3()
Accessor/Mutator of the second coordinate of DPoint3d.
Definition: DPoint3d.hpp:277
CoordType & dx2()
Accessor/Mutator of the second coordinate of DPoint3d.
Definition: DPoint3d.hpp:265
Provides an abstract class to modelize the difference of slip::Point.