traversorCell.h 3.92 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
2
3
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
4
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
Pierre Kraemer's avatar
Pierre Kraemer committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
*                                                                              *
* 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.           *
*                                                                              *
20
* Web site: http://cgogn.unistra.fr/                                           *
Pierre Kraemer's avatar
Pierre Kraemer committed
21
22
23
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/
24
#include "Topology/generic/traversorGen.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
25
26
27
28
29

#ifndef __TRAVERSOR_CELL_H__
#define __TRAVERSOR_CELL_H__

#include "Topology/generic/dart.h"
30
#include "Topology/generic/dartmarker.h"
31
#include "Topology/generic/cellmarker.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
32
33
34
35

namespace CGoGN
{

36
template <typename MAP, unsigned int ORBIT>
37
class TraversorCell: public Traversor<MAP>
Pierre Kraemer's avatar
Pierre Kraemer committed
38
39
40
{
private:
	MAP& m ;
41
	DartMarker* dmark ;
42
	CellMarker<ORBIT>* cmark ;
Pierre Kraemer's avatar
Pierre Kraemer committed
43
	Dart current ;
44
	bool firstTraversal ;
Pierre Kraemer's avatar
Pierre Kraemer committed
45
	const FunctorSelect& m_good ;
Pierre Kraemer's avatar
Pierre Kraemer committed
46
47

public:
48
	TraversorCell(MAP& map, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) ;
49
50
51
52
53
54
55
56
57

	~TraversorCell() ;

	Dart begin() ;

	Dart end() ;

	Dart next() ;

58
	void skip(Dart d);
Pierre Kraemer's avatar
Pierre Kraemer committed
59
60
61
} ;

template <typename MAP>
62
class TraversorV : public TraversorCell<MAP, VERTEX>
Pierre Kraemer's avatar
Pierre Kraemer committed
63
64
{
public:
65
	TraversorV(MAP& m, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) : TraversorCell<MAP, VERTEX>(m, good, forceDartMarker, thread)
66
	{}
Pierre Kraemer's avatar
Pierre Kraemer committed
67
};
Pierre Kraemer's avatar
Pierre Kraemer committed
68
69

template <typename MAP>
70
class TraversorE : public TraversorCell<MAP, EDGE>
Pierre Kraemer's avatar
Pierre Kraemer committed
71
72
{
public:
73
	TraversorE(MAP& m, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) : TraversorCell<MAP, EDGE>(m, good, forceDartMarker, thread)
74
	{}
Pierre Kraemer's avatar
Pierre Kraemer committed
75
};
Pierre Kraemer's avatar
Pierre Kraemer committed
76

untereiner's avatar
untereiner committed
77

Pierre Kraemer's avatar
Pierre Kraemer committed
78
template <typename MAP>
79
class TraversorF : public TraversorCell<MAP, FACE>
Pierre Kraemer's avatar
Pierre Kraemer committed
80
81
{
public:
82
	TraversorF(MAP& m, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) : TraversorCell<MAP, FACE>(m, good, forceDartMarker, thread)
83
	{}
Pierre Kraemer's avatar
Pierre Kraemer committed
84
};
Pierre Kraemer's avatar
Pierre Kraemer committed
85
86

template <typename MAP>
87
class TraversorW : public TraversorCell<MAP, VOLUME>
Pierre Kraemer's avatar
Pierre Kraemer committed
88
89
{
public:
90
	TraversorW(MAP& m, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) : TraversorCell<MAP, VOLUME>(m, good, forceDartMarker, thread)
91
	{}
Pierre Kraemer's avatar
Pierre Kraemer committed
92
};
Pierre Kraemer's avatar
Pierre Kraemer committed
93

94

95
template <typename MAP, unsigned int ORBIT>
96
class TraversorDartsOfOrbit: public Traversor<MAP>
97
98
{
private:
Pierre Kraemer's avatar
Pierre Kraemer committed
99
100
	std::vector<Dart>::iterator m_current ;
	std::vector<Dart> m_vd ;
101
102

public:
103
	TraversorDartsOfOrbit(MAP& map, Dart d, unsigned int thread = 0) ;
104
105
106
107
108
109
110
111

	Dart begin() ;

	Dart end() ;

	Dart next() ;
} ;

Pierre Kraemer's avatar
Pierre Kraemer committed
112
113
} // namespace CGoGN

114
115
#include "Topology/generic/traversorCell.hpp"

Pierre Kraemer's avatar
Pierre Kraemer committed
116
#endif