Moka controlers
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
parameter-creation.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 PARAMETER_CREATION_HH
26 #define PARAMETER_CREATION_HH
27 //******************************************************************************
28 #include "parameter.hh"
29 #include "vector.hh"
30 //******************************************************************************
31 //@name Flags pour la création de cubes (maillés en dimension < 3)
32 
34 #define CUBE_X1 (1 << 0)
35 #define CUBE_X2 (1 << 1)
36 #define CUBE_Y1 (1 << 2)
37 #define CUBE_Y2 (1 << 3)
38 #define CUBE_Z1 (1 << 4)
39 #define CUBE_Z2 (1 << 5)
40 
41 #define CUBE_ALL (CUBE_X1 | CUBE_X2 | CUBE_Y1 | CUBE_Y2 | CUBE_Z1 | CUBE_Z2)
42 
43 #define CUBE_RING_X (CUBE_Y1 | CUBE_Y2 | CUBE_Z1 | CUBE_Z2)
44 #define CUBE_RING_Y (CUBE_X1 | CUBE_X2 | CUBE_Z1 | CUBE_Z2)
45 #define CUBE_RING_Z (CUBE_X1 | CUBE_X2 | CUBE_Y1 | CUBE_Y2)
46 
47 
48 //******************************************************************************
49 class CVertex;
50 
51 namespace GMap3d
52 {
54  {
55  public:
57 
58  CParameterCreation(int ANbRef = 0);
60  virtual ~CParameterCreation();
61  virtual CParameter* copy() const;
62 
64 
66 
67  virtual void save(std::ostream &);
68  virtual void load(std::istream &);
69  virtual void reinit();
70 
72 
74 
75  int getPolygonNbEdges() const;
76  void setPolygonNbEdges(int ANbEdges);
77 
79 
81 
82  int getMeshNbSubdivisionsX() const;
83  int getMeshNbSubdivisionsY() const;
84  int getMeshNbSubdivisionsZ() const;
85 
86  void setMeshNbSubdivisionsX(int ASx);
87  void setMeshNbSubdivisionsY(int ASy);
88  void setMeshNbSubdivisionsZ(int ASz);
89 
90  int getMeshDimension() const;
91  void setMeshDimension(int ADimension);
92 
93  int getMeshSubdivisionDimension() const;
94  void setMeshSubdivisionDimension(int ADimension);
95 
96  bool getMeshCreatedFacesActive() const;
97 
98  unsigned char getMeshCreatedFaces() const;
99  bool getMeshCreatedFace(unsigned char AFace) const;
100 
101  void setMeshCreatedFaces(unsigned char AFaces);
102  void setMeshCreatedFace(unsigned char AFace, bool AValue = true);
103 
105 
107 
108  int getCylinderNbMeridians() const;
109  void setCylinderNbMeridians(int ANb);
110 
111  int getCylinderNbParallels() const;
112  void setCylinderNbParallels(int ANb);
113 
114  bool getCylinderClosedUp() const;
115  void setCylinderClosedUp(bool AClosed);
116 
117  bool getCylinderClosedDown() const;
118  void setCylinderClosedDown(bool AClosed);
119 
121 
123 
124  int getPyramidNbMeridians() const;
125  void setPyramidNbMeridians(int ANb);
126 
127  int getPyramidNbParallels() const;
128  void setPyramidNbParallels(int ANb);
129 
130  bool getPyramidClosed() const;
131  void setPyramidClosed(bool AClosed);
132 
134 
136 
137  int getSphereNbMeridians() const;
138  void setSphereNbMeridians(int ANb);
139 
140  int getSphereNbParallels() const;
141  void setSphereNbParallels(int ANb);
142 
144 
146 
147  int getTorusNbMeridians() const;
148  void setTorusNbMeridians(int ANb);
149 
150  int getTorusNbParallels() const;
151  void setTorusNbParallels(int ANb);
152 
153  float getTorusRadiusRapport() const;
154  void setTorusRadiusRapport(float AValue);
155 
157 
159  virtual int getType() const;
160 
161  private:
162  // Nombre d'arêtes du polygone
163  int FPolygonNbEdges;
164 
165  // Maillages
166  int FMeshNbSubdivisions[3];
167  int FMeshDimension;
168  int FMeshSubdivisionDimension;
169  unsigned char FCreatedFaces;
170 
171  // Cylindre
172  int FCylinderNbMeridians; // Nombre de méridiens du cylindre
173  int FCylinderNbParallels; // Nombre de paralèlles du cylindre
174  bool FCylinderClosedUp; // Fermeture ou non du bord 1
175  bool FCylinderClosedDown; // Fermeture ou non du bord 2
176 
177  // Pyramide
178  int FPyramidNbMeridians; // Nombre de méridiens de la pyramide
179  int FPyramidNbParallels; // Nombre de paralèlles de la pyramide
180  bool FPyramidClosed; // Fermeture ou non de la base
181 
182  // Sphère
183  int FSphereNbMeridians; // Nombre de méridiens de la sphère
184  int FSphereNbParallels; // Nombre de paralèlles de la sphère
185 
186  // Tore
187  int FTorusNbMeridians; // Nombre de méridiens du tore
188  int FTorusNbParallels; // Nombre de paralèlles du tore
189  float FTorusRadiusRapport; // Rapport entre le petit rayon et le grand
190  };
191 
192 } // namespace GMap3d
193 //******************************************************************************
194 #endif // PARAMETER_CREATION_HH
195 //******************************************************************************