map3MR_PrimalRegular.h 4.12 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
/*******************************************************************************
* 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 __MAP3MR_PRIMAL__
#define __MAP3MR_PRIMAL__

#include "Topology/map/embeddedMap3.h"
#include "Topology/generic/traversorCell.h"
#include "Topology/generic/traversor3.h"

32 33
#include "Algo/Multiresolution/map3MR/filters_Primal.h"
#include "Algo/Modelisation/tetrahedralization.h"
34 35 36 37

namespace CGoGN
{

38 39 40 41 42 43
namespace Algo
{

namespace Multiresolution
{

44 45 46
/*! \brief The class of regular 3-map MR
 */

47 48
template <typename PFP>
class Map3MR_PrimalRegular
49
{
50 51 52 53 54
public:
	typedef typename PFP::MAP MAP;
	typedef typename PFP::VEC3 VEC3;
	typedef typename PFP::REAL REAL;

55
protected:
56
	MAP& m_map;
57 58
	bool shareVertexEmbeddings;

59 60
	std::vector<Algo::Multiresolution::MRFilter*> synthesisFilters ;
	std::vector<Algo::Multiresolution::MRFilter*> analysisFilters ;
61 62

public:
63
	Map3MR_PrimalRegular(MAP& map);
64

65
	std::string mapTypeName() const { return "Map3MR_PrimalRegular"; }
66 67 68 69 70 71 72 73 74 75 76 77 78 79

	/*! @name Topological helping functions
	 *
	 *************************************************************************/
	//@{
	void swapEdges(Dart d, Dart e);

	void splitSurfaceInVolume(std::vector<Dart>& vd, bool firstSideClosed = true, bool secondSideClosed = false);
	//@}

	/*! @name Level creation
	 *
	 *************************************************************************/
	//@{
untereiner's avatar
untereiner committed
80 81 82 83 84 85
	//!
	/*
	 *
	 */
	void addNewLevelSqrt3(bool embedNewVertices);

86 87 88 89 90 91 92 93
	//!
	/*
	 */
	void addNewLevelTetraOcta(bool embedNewVertices);

	//!
	/*
	 */
94
	void addNewLevelHexa(bool embedNewVertices);
95

96 97 98
	//!
	/*
	 */
99
	//void addNewLevel(bool embedNewVertices);
100 101 102
	//@}

	/*! @name Geometry modification
103
	 *  Analysis / Synthesis
104 105 106 107 108 109
	 *************************************************************************/
	//@{

	//!
	/*
	 */
110
	void setSharingVertexEmbeddings(bool b) { shareVertexEmbeddings = b; }
111 112 113 114

	//!
	/*
	 */
115
	void addSynthesisFilter(Algo::Multiresolution::MRFilter* f) { synthesisFilters.push_back(f) ; }
116 117 118 119

	//!
	/*
	 */
120
	void addAnalysisFilter(Algo::Multiresolution::MRFilter* f) { analysisFilters.push_back(f) ; }
121

122 123 124
	//!
	/*
	 */
125
	void clearSynthesisFilters() { synthesisFilters.clear() ; }
126 127 128 129

	//!
	/*
	 */
130
	void clearAnalysisFilters() { analysisFilters.clear() ; }
131

132 133 134
	//!
	/*
	 */
135
	void analysis() ;
136 137 138 139

	//!
	/*
	 */
140
	void synthesis() ;
141 142 143
	//@}
};

144
} // namespace Multiresolution
145

146
} // namespace Algo
147

148
} // namespace CGoGN
149 150


151
#include "Algo/Multiresolution/map3MR/map3MR_PrimalRegular.hpp"
152

153
#endif /* __MAP3MR_PRIMAL__ */