Coupure prévue mardi 3 Août au matin pour maintenance du serveur. Nous faisons au mieux pour que celle-ci soit la plus brève possible.

traversorCell.h 3.64 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
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
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009-2011, 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.u-strasbg.fr/                                         *
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __TRAVERSOR_CELL_H__
#define __TRAVERSOR_CELL_H__

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

namespace CGoGN
{

Sylvain Thery's avatar
Sylvain Thery committed
35
template <typename MAP>
Pierre Kraemer's avatar
Pierre Kraemer committed
36
37
38
39
class TraversorCell
{
private:
	MAP& m ;
40
	unsigned int m_orbit ;
41
42
	DartMarker* dmark ;
	CellMarker* 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
49
50
51
52
53
54
55
56
57
58
	TraversorCell(MAP& map, unsigned int orbit, const FunctorSelect& good = allDarts, bool forceDartMarker = false, unsigned int thread = 0) ;

	~TraversorCell() ;

	Dart begin() ;

	Dart end() ;

	Dart next() ;

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

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

template <typename MAP>
Sylvain Thery's avatar
Sylvain Thery committed
70
class TraversorE : public TraversorCell<MAP>
Pierre Kraemer's avatar
Pierre Kraemer committed
71
72
{
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
73
	TraversorE(MAP& m, const FunctorSelect& good = allDarts, unsigned int thread = 0) : TraversorCell<MAP>(m, EDGE, good, 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>
Sylvain Thery's avatar
Sylvain Thery committed
79
class TraversorF : public TraversorCell<MAP>
Pierre Kraemer's avatar
Pierre Kraemer committed
80
81
{
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
82
	TraversorF(MAP& m, const FunctorSelect& good = allDarts, unsigned int thread = 0) : TraversorCell<MAP>(m, FACE, good, thread)
83
	{}
Pierre Kraemer's avatar
Pierre Kraemer committed
84
};
Pierre Kraemer's avatar
Pierre Kraemer committed
85
86

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

94
95
96
97
98

template <typename MAP>
class TraversorDartsOfOrbit
{
private:
Pierre Kraemer's avatar
Pierre Kraemer committed
99
100
	std::vector<Dart>::iterator m_current ;
	std::vector<Dart> m_vd ;
101
102
103
104
105
106
107
108
109
110
111

public:
	TraversorDartsOfOrbit(MAP& map, unsigned int orbit, Dart d, unsigned int thread = 0) ;

	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