gmap0.h 4.23 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 29 30 31 32 33 34 35 36 37 38 39 40 41
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009, 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: https://iggservis.u-strasbg.fr/CGoGN/                              *
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __GMAP0_H__
#define __GMAP0_H__

#include "Topology/generic/attribmap.h"
#include "Topology/generic/dartmarker.h"
#include "Topology/generic/cellmarker.h"

namespace CGoGN
{

/**
* The class of 0-GMap
* Warning here we use beta instead of classic alpha
*/
class GMap0 : public AttribMap
{
protected:
42
	AttributeMultiVector<Dart>* m_beta0 ;
Pierre Kraemer's avatar
Pierre Kraemer committed
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87

public:
	GMap0();

	virtual std::string mapTypeName();

	virtual unsigned int dimension();

	/*! @name Basic Topological Operators
	 * Access and Modification
	 *************************************************************************/

	virtual Dart newDart();

	Dart beta0(const Dart d);

	void beta0sew(Dart d, Dart e);

	void beta0unsew(Dart d);

	/*! @name Constructors and Destructors
	 *  To generate or delete cells in a 0-G-map
	 *************************************************************************/

	/**
	* create an edge
	* @return a dart of the edge
	*/
	Dart newEdge();

	/**
	* delete an edge
	* @param d a dart of the edge
	*/
	void deleteEdge(Dart d);

	/*! @name Cell Functors
	 *  Apply functors to all darts of a cell
	 *************************************************************************/

	//@{
	//! Apply a functor on every dart of a vertex
	/*! @param d a dart of the vertex
	 *  @param f the functor to apply
	 */
Sylvain Thery's avatar
Sylvain Thery committed
88
	bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread=0);
Pierre Kraemer's avatar
Pierre Kraemer committed
89 90 91 92 93

	//! Apply a functor on every dart of an edge
	/*! @param d a dart of the edge
	 *  @param f the functor to apply
	 */
Sylvain Thery's avatar
Sylvain Thery committed
94
	bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread=0);
Pierre Kraemer's avatar
Pierre Kraemer committed
95 96 97 98 99

	//! Apply a functor on every dart of an oriented face
	/*! @param d a dart of the face
	 *  @param f the functor to apply
	 */
Sylvain Thery's avatar
Sylvain Thery committed
100
	bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread=0);
Pierre Kraemer's avatar
Pierre Kraemer committed
101 102 103 104 105

	//! Apply a functor on every dart of a face
	/*! @param d a dart of the face
	 *  @param f the functor to apply
	 */
Sylvain Thery's avatar
Sylvain Thery committed
106
	bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread=0);
Pierre Kraemer's avatar
Pierre Kraemer committed
107 108 109 110 111

	//! Apply a functor on every dart of a volume
	/*! @param d a dart of the volume
	 *  @param f the functor to apply
	 */
Sylvain Thery's avatar
Sylvain Thery committed
112
	bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread=0);
Pierre Kraemer's avatar
Pierre Kraemer committed
113 114 115 116 117

	//! Apply a functor on every dart of a connected component
	/*! @param d a dart of the onnected component
	 *  @param f the functor to apply
	 */
Sylvain Thery's avatar
Sylvain Thery committed
118
	bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread=0);
Pierre Kraemer's avatar
Pierre Kraemer committed
119 120 121 122 123 124 125 126
	//@}
};

} // namespace CGoGN

#include "Topology/gmap/gmap0.hpp"

#endif