Moka controlers
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
controler-gmap-export-xfig.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 // Export XFig. Il y a deux formats "principaux" :
26 // - sauveCarteXfig pour sauver la carte. Suivant les paramètres,
27 // sauve les brins orientés (comme si on avait une carte), les faces
28 // pleines, les coutures, la grille, les sommets, et inverse l'axe Y.
29 // - sauveCarteIntervoxelXfig qui sauve au format intervoxel (donc avec
30 // les faces pleines, les arêtes et les sommets comme si on avait des
31 // surfels, pointels et lignels.
32 public:
33 
34 void initConfig();
35 
36 void sauveCarteXfig(TViewId, std::ofstream &, bool AArrow, bool AFace,
37  bool ASews, bool AGrid, bool AVertices, bool AInvert = true);
38 
39 void sauveCarteIntervoxelXfig(TViewId, std::ofstream &, bool AInvert = true);
40 
41 // Export the actual map in the fout stream, with intervoxels elements
42 private:
43 void transfoMmPixel(CVertex & v2d);
44 void sauveEntete(std::ofstream &os, int nbCoul);
45 void debutComposante(std::ofstream &os,
46  const CVertex & min, const CVertex & max);
47 int computeProf(const CVertex & V);
48 int computeProf(const CVertex & V1, const CVertex & V2);
49 void sauvePoint(std::ofstream &os, const CVertex & v, int coul, int larg, int AProf=-1);
50 void sauveLine(std::ofstream &os, const CVertex & p1, const CVertex & p2,
51  int coul, int larg, bool arrow, int AProf = -1);
52 void sauveTriangle(std::ofstream & os, int coulFill, int larg,
53  CVertex & PC, CVertex & P1, CVertex & P2);
54 void sauveFace(std::ofstream &os, CVertex *p, int nbPts,
55  int coulFill, int larg, int AProf);
56 
57 void sauveDartVertex(std::ofstream &os, const CVertex & v, const CVertex & v2);
58 
59 void treatSews(std::ofstream & /*fout*/,
60  CDart* /*dart*/, int /*mark*/, int /*mark2*/);
61 
62 void treatFace(std::ofstream& /*fout*/, CDart* /*dart*/,
63  int /*mark*/, int /*mark2*/ );
64 
65 void treatFilledFace(std::ofstream& /*fout*/, CDart* /*dart*/,
66  int /*mark*/, int /*mark2*/ );
67 
68 void treatDartWithArrow(std::ofstream& /*fout*/, CDart* /*dart*/,
69  int /*mark*/, int /*mark2*/, int AProf=-1);
70 
71 void treatDartNoArrow(std::ofstream& /*fout*/, CDart* /*dart*/,
72  int /*mark*/, int /*mark2*/ );
73 
74 void saveGridIncludingBox(std::ofstream & /*fout*/);
75 
76 
77 // Projet the 3d vertex into the 2d plane, with the Open GL
78 // matrix. The z of the out parameter v2d is the depth of the point
79  void transfo3dTo2d( const CVertex &, CVertex & /*v2d*/);
80 
81 // this method is used for compute the 2d including box of an
82 // object. pts is alpha 3d point, min and max was 2d points, in-out
83 // parameters. Project the 3d pts in 2d, and compare this with min
84 // and max, and eventually update them if necessary.
85 // If init is true, min=max=the project in 2d of pts
86 void updateMinMax2d(const CVertex& /*pts*/, CVertex& /*min*/,
87  CVertex & /*max*/, bool init=false);
88 
89 // compute the 2d including box of the projection of the darts in the orbit.
90 void getIncludingBoxForDarts(CDart*, TOrbit, CVertex& /*min*/,
91  CVertex& /*max*/);
92 
93 // save the grid in fout in xfig format.
94 void treatGrid(std::ofstream& /*fout*/);
95 
96 void treatPointel(std::ofstream& /*os*/, CDart* /*d*/, int /*mark*/);
97 void treatLignel(std::ofstream& /*os*/, CDart* /*d*/, int /*mark*/);
98 //******************************************************************************