SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Point1d.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 
68 
75 #ifndef SLIP_POINT1D_HPP
76 #define SLIP_POINT1D_HPP
77 
78 #include <iostream>
79 #include <cassert>
80 #include <string>
81 #include "Point.hpp"
82 
83 #include <boost/serialization/access.hpp>
84 #include <boost/serialization/split_member.hpp>
85 #include <boost/serialization/version.hpp>
86 #include <boost/serialization/base_object.hpp>
87 
88 namespace slip
89 {
100 template <typename CoordType>
101 class Point1d:public Point<CoordType,1>
102 {
103 public :
104  typedef Point1d<CoordType> self;
106 
111 
115  Point1d();
116 
121  Point1d(const CoordType& x1);
122 
133  void x1(const CoordType& x);
134 
139  CoordType& x1();
144  const CoordType& x1() const;
145 
152  std::string name() const;
153 private:
155  template<class Archive>
156  void save(Archive & ar, const unsigned int version) const
157  {
158  ar & boost::serialization::base_object<slip::Point<CoordType,1> >(*this);
159  }
160  template<class Archive>
161  void load(Archive & ar, const unsigned int version)
162  {
163  ar & boost::serialization::base_object<slip::Point<CoordType,1> >(*this);
164  }
165  BOOST_SERIALIZATION_SPLIT_MEMBER()
166 
167 };
168 
189 }//slip::
190 
191 namespace slip
192 {
193  template<typename CoordType>
194  inline
196  {
197  this->coord_[0] = CoordType(0);
198  }
199 
200  template<typename CoordType>
201  inline
202  Point1d<CoordType>::Point1d(const CoordType& x1)
203  {
204  this->coord_[0] = CoordType(x1);
205  }
206 
207  template<typename CoordType>
208  inline
209  CoordType& Point1d<CoordType>::x1() {return this->coord_[0];}
210 
211  template<typename CoordType>
212  inline
213  const CoordType& Point1d<CoordType>::x1() const {return this->coord_[0];}
214 
215  template<typename CoordType>
216  inline
217  void Point1d<CoordType>::x1(const CoordType& x1) {this->coord_[0]=x1;}
218 
219  template<typename CoordType>
220  inline
221  std::string
222  Point1d<CoordType>::name() const {return "Point1d";}
223 
224 
225 }//slip::
226 
227 #endif //SLIP_POINT1D_HPP
std::string name() const
Returns the name of the class.
Definition: Point1d.hpp:222
slip::Point1d< unsigned int > Point1d_ui
unsigned int alias
Definition: Point1d.hpp:184
slip::Point1d< unsigned long > Point1d_ul
unsigned long alias
Definition: Point1d.hpp:176
slip::Point1d< int > Point1d_i
int alias
Definition: Point1d.hpp:182
Provides an abstract class to modelize nd points.
Define an abstract Point structure.
Definition: Box.hpp:92
Point< CoordType, 1 > base
Definition: Point1d.hpp:105
slip::Point1d< double > Point1d_d
double alias
Definition: Point1d.hpp:170
This is a point1d class, a specialized version of Point<CoordType,DIM> with DIM = 1...
Definition: Point1d.hpp:101
friend class boost::serialization::access
Definition: Point1d.hpp:154
slip::Point1d< unsigned char > Point1d_uc
unsigned char alias
Definition: Point1d.hpp:188
slip::Point1d< unsigned short > Point1d_us
unsigned long alias
Definition: Point1d.hpp:180
slip::Point1d< short > Point1d_s
short alias
Definition: Point1d.hpp:178
Point1d()
Constructs a Point1d.
Definition: Point1d.hpp:195
CoordType & x1()
Accessor/Mutator of the first coordinate of Point1d.
Definition: Point1d.hpp:209
slip::Point1d< long > Point1d_l
long alias
Definition: Point1d.hpp:174
slip::Point1d< char > Point1d_c
char alias
Definition: Point1d.hpp:186
slip::Point1d< float > Point1d_f
float alias
Definition: Point1d.hpp:172