Moka controlers
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
controler-gmap-input-events.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 #include "controler-gmap.hh"
26 #include "view-precompile.hh"
27 using namespace GMap3d;
28 //******************************************************************************
30 {
31  switch (FCurrentMode)
32  {
39  }
40 
41  switch (FCurrentMode)
42  {
45  case MODE_CREATION_MESH :
49  case MODE_CREATION_TORUS : modeCreationBegin (); break;
50  case MODE_TRANSLATION : modeTranslationBegin(); break;
51  case MODE_ROTATION : modeRotationBegin (); break;
52  case MODE_SCALE : modeScaleBegin (); break;
53 #ifdef MODULE_ROUNDING
54  case MODE_ROUNDING : modeRoundingBegin (); break;
55 #endif // MODULE_ROUNDING
56 
57  default: CControler::onEnterMode(); break;
58  }
59 }
60 //******************************************************************************
62 {
63  switch (FCurrentMode)
64  {
67  case MODE_CREATION_MESH :
71  case MODE_CREATION_TORUS : modeCreationEnd(); break;
72  case MODE_TRANSLATION : modeTranslationEnd(); break;
73  case MODE_ROTATION : modeRotationEnd(); break;
74  case MODE_SCALE : modeScaleEnd(); break;
75 #ifdef MODULE_ROUNDING
76  case MODE_ROUNDING : modeRoundingEnd(); break;
77 #endif // MODULE_ROUNDING
78 
79  default: CControler::onExitMode(); break;
80  }
81 }
82 //******************************************************************************
84 {
85  return
88 }
89 //******************************************************************************
91 {
92  if (!isInCreationMode())
93  return;
94 
95  TMode currentMode = FCurrentMode+1;
96 
97  if (currentMode>MODE_CREATION_TORUS)
98  currentMode=MODE_CREATION_POLYLINE;
99 
100  setMode(currentMode);
101 }
102 //******************************************************************************
104 {
105  switch (FCurrentMode)
106  {
109  case MODE_CREATION_POLYGON :
111  case MODE_CREATION_MESH :
113  case MODE_CREATION_SPHERE :
117  case MODE_CREATION_PYRAMID :
119  case MODE_CREATION_TORUS :
121  case MODE_TRANSLATION :
123  case MODE_ROTATION :
125  case MODE_SCALE :
127  case MODE_ROUNDING :
129  }
130 
131  switch (FCurrentMode)
132  {
133  case MODE_CREATION_POLYLINE: modeCreationPolylineOperationStart(); break;
134  case MODE_CREATION_POLYGON :
135  case MODE_CREATION_MESH :
136  case MODE_CREATION_SPHERE :
138  case MODE_CREATION_PYRAMID :
139  case MODE_CREATION_TORUS : modeCreationOperationStart(); break;
140  case MODE_TRANSLATION : modeTranslationOperationStart(); break;
141  case MODE_ROTATION : modeRotationOperationStart(); break;
142  case MODE_SCALE : modeScaleOperationStart(); break;
143 #ifdef MODULE_ROUNDING
144  case MODE_ROUNDING : modeRoundingOperationStart(); break;
145 #endif // MODULE_ROUNDING
146 
148  }
149 }
150 //------------------------------------------------------------------------------
152 {
153  switch (FCurrentModeOperation)
154  {
156  modeCreationPolylineOperationMove(); break;
163  modeCreationOperationMove (); break;
165  modeTranslationOperationMove (); break;
167  modeRotationOperationMove (); break;
168  case MODE_OPERATION_SCALE :
169  modeScaleOperationMove (); break;
170 #ifdef MODULE_ROUNDING
172  modeRoundingOperationMove (); break;
173 #endif // MODULE_ROUNDING
174 
176  }
177 }
178 //------------------------------------------------------------------------------
180 {
181  switch (FCurrentModeOperation)
182  {
184  modeCreationPolylineOperationStop (); break;
191  modeCreationOperationStop (); break;
194  case MODE_OPERATION_SCALE :
195  modeTransformationOperationStop (); break;
196 #ifdef MODULE_ROUNDING
198  modeRoundingOperationStop (); break;
199 #endif // MODULE_ROUNDING
200 
202  }
203 }
204 //******************************************************************************