normal.h 4.07 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 24 25 26 27 28 29
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#ifndef __ALGO_GEOMETRY_NORMAL_H__
#define __ALGO_GEOMETRY_NORMAL_H__

#include "Geometry/basic.h"

30

Pierre Kraemer's avatar
Pierre Kraemer committed
31 32 33 34 35 36
namespace CGoGN
{

namespace Algo
{

37 38 39
namespace Surface
{

Pierre Kraemer's avatar
Pierre Kraemer committed
40 41 42
namespace Geometry
{

43
template<typename PFP, typename V_ATT>
44
typename V_ATT::DATA_TYPE triangleNormal(typename PFP::MAP& map, Face f, const V_ATT& position) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
45

46
template<typename PFP, typename V_ATT>
47
typename V_ATT::DATA_TYPE newellNormal(typename PFP::MAP& map, Face f, const V_ATT& position);
48

49
template<typename PFP, typename V_ATT>
50
typename V_ATT::DATA_TYPE faceNormal(typename PFP::MAP& map, Face f, const V_ATT& position) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
51

52
template<typename PFP, typename V_ATT>
53
typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V_ATT& position) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
54

55
template<typename PFP, typename V_ATT>
56
typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, const V_ATT& position) ;
57

58
template <typename PFP, typename V_ATT, typename F_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
59
void computeNormalFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_normal) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
60

Sylvain Thery's avatar
Sylvain Thery committed
61 62 63 64 65 66 67
/**
 * compute normals of  vertices
 * @param map the map on which we work
 * @param position the position of vertices attribute handler
 * @param normal the normal handler in which the result will be stored
 * @param the selector
 */
68
template <typename PFP,typename V_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
69
void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& normal) ;
70

71

72
template <typename PFP, typename V_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
73
typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge d, const V_ATT& position) ;
74 75

template <typename PFP, typename V_ATT, typename E_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
76
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles) ;
77 78 79



80 81
namespace Parallel
{
Pierre Kraemer's avatar
Pierre Kraemer committed
82

83
template <typename PFP,typename V_ATT>
84
void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& normal) ;
85

86
template <typename PFP, typename V_ATT, typename F_ATT>
87
void computeNormalFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_normal) ;
88

89
template <typename PFP, typename V_ATT, typename E_ATT>
90
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles) ;
91

92 93 94
}


Pierre Kraemer's avatar
Pierre Kraemer committed
95 96
} // namespace Geometry

97
} // namespace Surface
98

Pierre Kraemer's avatar
Pierre Kraemer committed
99 100 101 102 103 104 105
} // namespace Algo

} // namespace CGoGN

#include "Algo/Geometry/normal.hpp"

#endif