Moka kernel
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vector.hh
Go to the documentation of this file.
1 /*
2  * lib-gmapkernel : Un noyau de 3-G-cartes et des opérations.
3  * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of lib-gmapkernel
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 //******************************************************************************
25 #ifndef VECTOR_HH
26 #define VECTOR_HH
27 //******************************************************************************
28 #include "math-extension.hh"
29 #include "inline-macro.hh"
30 
31 #include <iostream>
32 //******************************************************************************
34 
40 class CVector
41 {
42 private:
43  TCoordinate* FElements;
44 
45 public:
46  // @name Constantes
47  // @{
48 
52  typedef enum { NullVector, AnyVector } TVectorType;
53 
54  // @}
55 
56  // @name Constructeurs et destructeur
57  // @{
58 
66  CVector(TVectorType AType = AnyVector);
67 
76  CVector(const CVector& AVector);
77 
87 
91  ~CVector();
92 
93  // @}
94  // @name Initialisations
95  // @{
96 
100  void setToNull();
101 
106  CVector& operator=(const CVector& AVector);
107 
108  // @}
109  // @name Accesseur aux éléments du vecteur
110  // @{
111 
119  TCoordinate& operator[](int AIndex) const;
120 
121  // @}
122  // @name Produit de matrices
123  // @{
124 
133  CVector operator*(const CTransformationMatrix& AMatrix) const;
134 
143  TCoordinate operator*(const CVector& AVector) const;
144 
145  // @}
146 };
147 
148 // @name Affichage
149 // @{
150 
156 std::ostream& operator<<(std::ostream& AStream, const CVector& AVector);
157 
158 // @}
159 //******************************************************************************
160 #include INCLUDE_INLINE("vector.icc")
161 //******************************************************************************
162 #endif // VECTOR_HH
163 //******************************************************************************