Moka controlers
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
parameter-spamod.cc
Go to the documentation of this file.
1 /*
2  * lib-controler-gmap : Le contrôleur de 3-G-cartes, surcouche de lib-controler.
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-controler-gmap
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 #ifdef MODULE_SPAMOD
26 //******************************************************************************
27 #include "controler-gmap-types.hh"
29 #include "parameter-spamod.hh"
30 #include <cassert>
31 using namespace std;
32 using namespace GMap3d;
33 //******************************************************************************
34 CParameterSpamod::CParameterSpamod(int ANbRef) :
35  CParameter(ANbRef),
36  FViewMode (SPAMOD_TOPOLOGICAL)
37 {
38  FEuclidianParam[0] = true;
39  FEuclidianParam[1] = true;
40 
41  FAnalyticParam [0] = true;
42  FAnalyticParam [1] = true;
43  FAnalyticParam [2] = true;
44  FAnalyticParam [3] = true;
45 
46  FVoxelParam [0] = true;
47  FVoxelParam [1] = true;
48  FVoxelParam [2] = true;
49 
50  FK2Param [0] = true;
51  FK2Param [1] = true;
52  FK2Param [2] = true;
53 }
54 //******************************************************************************
55 CParameterSpamod::CParameterSpamod(const CParameterSpamod & AParam) :
56  CParameter(AParam),
57  FViewMode (AParam.FViewMode)
58 {
59  FEuclidianParam[0] = AParam.FEuclidianParam[0];
60  FEuclidianParam[1] = AParam.FEuclidianParam[1];
61 
62  FAnalyticParam [0] = AParam.FAnalyticParam [0];
63  FAnalyticParam [1] = AParam.FAnalyticParam [1];
64  FAnalyticParam [2] = AParam.FAnalyticParam [2];
65  FAnalyticParam [3] = AParam.FAnalyticParam [3];
66 
67  FVoxelParam [0] = AParam.FVoxelParam [0];
68  FVoxelParam [1] = AParam.FVoxelParam [1];
69  FVoxelParam [2] = AParam.FVoxelParam [2];
70 
71  FK2Param [0] = AParam.FK2Param [0];
72  FK2Param [1] = AParam.FK2Param [1];
73  FK2Param [2] = AParam.FK2Param [2];
74 }
75 //******************************************************************************
76 CParameterSpamod::~CParameterSpamod()
77 {}
78 //******************************************************************************
79 CParameter * CParameterSpamod::copy() const
80 { return new CParameterSpamod(*this); }
81 //******************************************************************************
82 void CParameterSpamod::save(ostream& /*AStream*/)
83 {}
84 //------------------------------------------------------------------------------
85 void CParameterSpamod::load(istream& /*AStream*/)
86 {}
87 //------------------------------------------------------------------------------
88 void CParameterSpamod::reinit()
89 {}
90 //******************************************************************************
91 int CParameterSpamod::getType() const
92 {
93  return PARAMETER_SPAMOD;
94 }
95 //******************************************************************************
96 void CParameterSpamod::setViewMode(TSpamodViewMode AMode)
97 {
98  if ( FViewMode!=AMode )
99  {
100  FViewMode = AMode;
101  putAllNeedToUpdate();
102  }
103 }
104 //******************************************************************************
105 void CParameterSpamod::setNextViewMode()
106 {
107  if (FViewMode==SPAMOD_K2) FViewMode=SPAMOD_TOPOLOGICAL;
108  else FViewMode = 1+(int)FViewMode;
109  putAllNeedToUpdate();
110 }
111 //******************************************************************************
112 TSpamodViewMode CParameterSpamod::getViewMode() const
113 {
114  return FViewMode;
115 }
116 //******************************************************************************
117 bool CParameterSpamod::getEuclidianParam(int AIndex)
118 {
119  assert(0<=AIndex && AIndex<=1);
120  return FEuclidianParam[AIndex];
121 }
122 //******************************************************************************
123 void CParameterSpamod::setEuclidianParam(int AIndex, bool AValue)
124 {
125  assert(0<=AIndex && AIndex<=1);
126  FEuclidianParam[AIndex] = AValue;
127 }
128 //******************************************************************************
129 bool CParameterSpamod::getAnalyticParam(int AIndex)
130 {
131  assert(0<=AIndex && AIndex<=3);
132  return FAnalyticParam[AIndex];
133 }
134 //******************************************************************************
135 void CParameterSpamod::setAnalyticParam(int AIndex, bool AValue)
136 {
137  assert(0<=AIndex && AIndex<=1);
138  FAnalyticParam[AIndex] = AValue;
139 }
140 //******************************************************************************
141 bool CParameterSpamod::getVoxelParam(int AIndex)
142 {
143  assert(0<=AIndex && AIndex<=2);
144  return FVoxelParam[AIndex];
145 }
146 //******************************************************************************
147 void CParameterSpamod::setVoxelParam(int AIndex, bool AValue)
148 {
149  assert(0<=AIndex && AIndex<=1);
150  FVoxelParam[AIndex] = AValue;
151 }
152 //******************************************************************************
153 bool CParameterSpamod::getK2Param(int AIndex)
154 {
155  assert(0<=AIndex && AIndex<=2);
156  return FK2Param[AIndex];
157 }
158 //******************************************************************************
159 void CParameterSpamod::setK2Param(int AIndex, bool AValue)
160 {
161  assert(0<=AIndex && AIndex<=1);
162  FK2Param[AIndex] = AValue;
163 }
164 //******************************************************************************
165 #endif // MODULE_SPAMOD
166 //******************************************************************************