Moka libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
compute-homology.hh
Go to the documentation of this file.
1 /*
2  * lib-homology : Computation of homology generators.
3  * Copyright (C) 2010, Samuel Peltier, Université de Poitiers, Laboratoire SIC-XLIM
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * Copyright (C) 2010, Guillaume Damiand, CNRS, LIRIS,
6  * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/
7  *
8  * This file is part of lib-homology
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 COMPUTE_HOMOLOGY_HH
26 #define COMPUTE_HOMOLOGY_HH
27 //******************************************************************************
28 #include <vector>
29 class MatricePMQ;
30 
31 namespace GMap3d
32 {
33  class GMCGMapVertex;
34 
35  //******************************************************************************
36  class CHomology
37  {
38  public:
40  CHomology(CGMapVertex* AMap, int AMark=-1);
41 
43  ~CHomology();
44 
49 
54 
56  unsigned long size() const;
57 
59  unsigned int getH0FreeGenerators();
60 
62  unsigned int getH1FreeGenerators();
63 
65  unsigned int getH1TorsionGenerators();
66 
68  unsigned int getH2FreeGenerators();
69 
71  unsigned int getH2TorsionGenerators();
72 
74  unsigned int getH3FreeGenerators();
75 
77  bool getShowH0() const;
78 
80  bool getShowH1free() const;
81 
83  bool getShowH1torsion() const;
84 
86  bool getShowH2free() const;
87 
89  bool getShowH2torsion() const;
90 
92  bool getShowH3() const;
93 
95  void setShowH0(bool AValue);
96 
98  void setShowH1free(bool AValue);
99 
101  void setShowH1torsion(bool AValue);
102 
104  void setShowH2free(bool AValue);
105 
107  void setShowH2torsion(bool AValue);
108 
110  void setShowH3(bool AValue);
111 
112  protected:
120  void computeIncidence(int ADim, bool AComputeNextCells=false);
121 
136  int computeIncidenceNumber(CDart* ADart, int ADim, CDart* ADart2, int AIndex);
137 
139  void updateSelectedDarts();
140 
141  private:
143  CGMapVertex* FMap;
144 
146  int FMark;
147 
149  MatricePMQ* FMatrix[3];
150 
152  std::vector<CDart*> FCells[3];
153 
155  int FNbVertices;
156 
158  int FNbEdges;
159 
161  int FNbFaces;
162 
164  int FNbVolumes;
165 
167  int FSize;
168 
170  int FNbCycleDim0, FNbCycleDim1, FNbCycleDim2, FNbCycleDim3;
171  int FNbBordFaibleDim0, FNbBordFaibleDim1, FNbBordFaibleDim2 ;
172  int FNbGenLibreDim0, FNbGenLibreDim1, FNbGenLibreDim2, FNbGenLibreDim3;
173  int FNbGenTorsionDim1, FNbGenTorsionDim2;
174 
176  bool FShowH0, FShowH1free, FShowH1torsion;
177  bool FShowH2free, FShowH2torsion, FShowH3;
178  };
179  //******************************************************************************
180 } // end namespace GMap3d
181 //******************************************************************************
182 #endif // COMPUTE_HOMOLOGY_HH
183 //******************************************************************************