Moka controlers
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
precompile-preview.hh
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 #ifndef PRECOMPILE_PREVIEW_HH
26 #define PRECOMPILE_PREVIEW_HH
27 //******************************************************************************
30 //******************************************************************************
31 #include "precompile.hh"
32 //******************************************************************************
33 class CVertex;
34 class CTransformationMatrix;
35 
36 namespace GMap3d
37 {
38  class CParameterPreview;
39  class CParameterObjectPosition;
40  class CParameterPolylinePosition;
41  class CParameterCreation;
42 
47  {
48  public:
49  //@name Constructeurs et destructeur.
51 
60  CParameterObjectPosition * AObjectPosition,
61  CParameterCreation * AObjectParameters,
62  CParameterPolylinePosition * APolylinePosition);
64  CPrecompile* copy() const;
65 
67  virtual ~CPrecompilePreview();
69 
71  virtual TPrecompile getType() const;
72 
74 
78  void setParameter(CParameter* AParameter);
79  CParameter* getParameter() const;
80 
82  void setPreview(CParameterPreview* APreview);
83 
85  void setPosition(CParameterObjectPosition* APosition);
86 
88  void setCreation(CParameterCreation* ACreation);
89 
91  void setPolylinePosition(CParameterPolylinePosition* APolylinePosition);
92 
94 
96  void setCurrentMode(TMode AMode);
98 
99  protected:
100 
102  virtual void drawModel();
103 
105  /*
106  * Affichage de l'objet de type XXX qui est en cours de création.
107  */
108  void drawPolyline();
109  void drawPolygon();
110  void drawMesh();
111  void drawSphere();
112  void drawCylinder();
113  void drawPyramid();
114  void drawTorus();
116 
118 
123  void drawMesh1(const CTransformationMatrix & AMatrix,
124  const CVertex & AOrigin, const CVertex & AVector, int ASx);
125 
130  void drawMesh2(const CTransformationMatrix & AMatrix,
131  const CVertex & AOrigin,
132  const CVertex & AVectorX, int ASx,
133  const CVertex & AVectorY, int ASy);
134 
139  void drawMesh3(const CTransformationMatrix & AMatrix,
140  const CVertex & AOrigin,
141  const CVertex & AVectorX, int ASx,
142  const CVertex & AVectorY, int ASy,
143  const CVertex & AVectorZ, int ASz);
144 
146 
147  private:
149  CParameterPreview * FParameterPreview;
150  CParameterObjectPosition * FParameterPosition;
151  CParameterCreation * FParameterCreation;
152  CParameterPolylinePosition * FParameterPolylinePosition;
153 
155  // MODE_CREATION_CYLINDER, MODE_CREATION_MESH, MODE_CREATION_POLYGON,
156  // MODE_CREATION_POLYLINE, MODE_CREATION_PYRAMID,
157  // MODE_CREATION_SPHERE et MODE_CREATION_TORUS
158  TMode FCurrentMode;
159  };
160 
161 } // namespace GMap3d
162 //******************************************************************************
163 #endif // PRECOMPILE_PREVIEW_HH
164 //******************************************************************************