subdivision3.h 5.06 KB
Newer Older
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           *
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/                                           *
21 22 23 24
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

untereiner's avatar
untereiner committed
25 26
#ifndef __SUBDIVISION3_H__
#define __SUBDIVISION3_H__
27 28 29

#include <math.h>
#include <vector>
30
#include "Geometry/plane_3d.h"
31
#include "Algo/Modelisation/tetrahedralization.h"
32 33 34 35 36 37 38

namespace CGoGN
{

namespace Algo
{

39 40 41
namespace Volume
{

42 43 44
namespace Modelisation
{

45
template <typename PFP>
Sylvain Thery's avatar
Sylvain Thery committed
46
bool isHexahedron(typename PFP::MAP& the_map, Dart d);
47

48 49 50 51 52 53 54 55
/**
* Cut a 3D ear from a mesh : the ear is sewn by phi3 to the rest of the volume
* @param d dart of the point of the ear
* @return a dart from the new face connecting the ear and the rest of the volume
*/
template <typename PFP>
Dart cut3Ear(typename PFP::MAP& map, Dart d);

56 57 58
/**
* Cut a volume considering a plane
* @param d dart of the volume
59 60
* @return a dart from the created face
* * TODO (optimization) change to build path while splitting faces
61 62
*/
template <typename PFP>
63
Dart sliceConvexVolume(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, Dart d, Geom::Plane3D<typename PFP::REAL> pl);
untereiner's avatar
untereiner committed
64

65 66 67 68 69 70 71 72 73 74
/**
* Cut a volume considering a set of marked edges and vertices
* marked edges and vertices must form a simple path
* @param d dart of the volume
* @param edgesToCut marker to identify edges along the slice
* @param verticesToSplit marker to identify edges on the slice
* @return a dart from the created face
* TODO (optimization) change to build path while splitting faces
*/
template <typename PFP>
75
Dart sliceConvexVolume(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position, Dart d, CellMarker<typename PFP::MAP, EDGE>& edgesToCut, CellMarker<typename PFP::MAP, VERTEX>& verticesToSplit);
76

77 78 79 80 81 82 83 84 85 86
/**
* Cut a set of volumes considering a set of marked edges and vertices
* marked edges and vertices must form a simple path
* @param d dart of the volume
* @param edgesToCut marker to identify edges along the slice
* @param verticesToSplit marker to identify edges on the slice
* @return a dart from the created face
* TODO (optimization) change to build path while splitting faces
*/
template <typename PFP>
87
std::vector<Dart> sliceConvexVolumes(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position,CellMarker<typename PFP::MAP, VOLUME>& volumesToCut, CellMarker<typename PFP::MAP, EDGE>& edgesToCut, CellMarker<typename PFP::MAP, VERTEX>& verticesToSplit);
88 89 90 91 92 93

/**
* catmull clark volumic : do not move the original vertices
* @param map the map
* @param attributs geometric attributes of the vertices
*/
94
template <typename PFP, typename EMBV>
95
void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs);
96

97 98 99 100 101
//template <typename PFP>
//void catmullClarkVol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3>& position)
//{
//	catmullClarkVol<PFP, VertexAttribute<typename PFP::VEC3>, typename PFP::VEC3>(map, position);
//}
102

103
template <typename PFP>
104
void sqrt3Vol(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
105

106
template <typename PFP>
107
void relaxation(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
108

109
template <typename PFP>
110
void computeDual(typename PFP::MAP& map, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& position);
untereiner's avatar
untereiner committed
111

112 113
} // namespace Modelisation

114
} // namespace Volume
115

116 117 118 119
} // namespace Algo

} // namespace CGoGN

untereiner's avatar
untereiner committed
120
#include "Algo/Modelisation/subdivision3.hpp"
121 122

#endif