Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

normal.h 4.17 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>
Pierre Kraemer's avatar
Pierre Kraemer committed
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>
Pierre Kraemer's avatar
Pierre Kraemer committed
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>
Pierre Kraemer's avatar
Pierre Kraemer committed
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>
Pierre Kraemer's avatar
Pierre Kraemer committed
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>
Pierre Kraemer's avatar
Pierre Kraemer committed
56
typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, const V_ATT& position) ;
57

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

Sylvain Thery's avatar
Sylvain Thery committed
61
62
63
64
65
66
67
68
/**
 * 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
 * @ param th the thread number
 */
69
70
template <typename PFP,typename V_ATT>
void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& normal, unsigned int thread = 0) ;
71

72

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

template <typename PFP, typename V_ATT, typename E_ATT>
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles, unsigned int thread = 0) ;



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

84
template <typename PFP,typename V_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
85
void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& normal) ;
86

87
template <typename PFP, typename V_ATT, typename F_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
88
void computeNormalFaces(typename PFP::MAP& map, const V_ATT& position, F_ATT& face_normal) ;
89

Pierre Kraemer's avatar
Pierre Kraemer committed
90
template <typename PFP, typename V_ATT, typename E_ATT>
Sylvain Thery's avatar
Sylvain Thery committed
91
void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
92

93
94
95
}


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

98
} // namespace Surface
99

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

} // namespace CGoGN

#include "Algo/Geometry/normal.hpp"

#endif