mapMono.h 3.7 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
*                                                                              *
* This library is free software; you can redistribute it and/or modify it      *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your     *
* option) any later version.                                                   *
*                                                                              *
* This library is distributed in the hope that it will be useful, but WITHOUT  *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License  *
* for more details.                                                            *
*                                                                              *
* You should have received a copy of the GNU Lesser General Public License     *
* along with this library; if not, write to the Free Software Foundation,      *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.           *
*                                                                              *
* Web site: http://cgogn.unistra.fr/                                           *
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __MAP_MONO__
#define __MAP_MONO__

#include "attribmap.h"

namespace CGoGN
{

class MapMono : public AttribMap
{
35
36
37
38
public:
	MapMono()
	{}

39
40
41
42
43
protected:
	std::vector<AttributeMultiVector<Dart>*> m_permutation;
	std::vector<AttributeMultiVector<Dart>*> m_permutation_inv;
	std::vector<AttributeMultiVector<Dart>*> m_involution;

44
45
46
	/****************************************
	 *          DARTS MANAGEMENT            *
	 ****************************************/
47

48
	inline virtual Dart newDart();
49

50
	inline virtual void deleteDart(Dart d);
51

52
	inline unsigned int dartIndex(Dart d) const
53
	{
54
		return d.index;
55
56
	}

57
58
59
60
61
62
63
64
65
66
67
68
69
	/**
	 * @return the number of darts in the map
	 */
	inline virtual unsigned int getNbDarts();

	/****************************************
	 *        RELATIONS MANAGEMENT          *
	 ****************************************/

	inline void addInvolution();

	inline void addPermutation();

70
	template <int I>
71
	inline Dart getInvolution(Dart d) const;
72
73

	template <int I>
74
	inline Dart getPermutation(Dart d) const;
75
76

	template <int I>
77
	inline Dart getPermutationInv(Dart d) const;
78
79

	template <int I>
80
	inline void permutationSew(Dart d, Dart e);
81
82

	template <int I>
83
	inline void permutationUnsew(Dart d);
84
85

	template <int I>
86
	inline void involutionSew(Dart d, Dart e);
87
88

	template <int I>
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
	inline void involutionUnsew(Dart d);

	/****************************************
	 *           DARTS TRAVERSALS           *
	 ****************************************/

	/**
	 * Begin of map
	 * @return the first dart of the map
	 */
	inline virtual Dart begin() const;

	/**
	 * End of map
	 * @return the end iterator (next of last) of the map
	 */
	inline virtual Dart end() const;

	/**
	 * allow to go from a dart to the next
	 * in the order of storage
	 * @param d reference to the dart to be modified
	 */
	inline virtual void next(Dart& d) const;
113
114
115
116
} ;

} //namespace CGoGN

117
118
#include "Topology/generic/mapMono.hpp"

119
#endif